mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
improve filter style, ref #413
This commit is contained in:
parent
5e1f611863
commit
cd8c6e7154
@ -2,6 +2,7 @@ import React from 'react';
|
||||
import Menu from 'rc-menu';
|
||||
import Dropdown from '../dropdown';
|
||||
import Icon from '../icon';
|
||||
import Checkbox from '../checkbox';
|
||||
|
||||
let FilterMenu = React.createClass({
|
||||
getInitialState() {
|
||||
@ -40,10 +41,16 @@ let FilterMenu = React.createClass({
|
||||
this.setState({
|
||||
visible: visible
|
||||
});
|
||||
if (!visible) {
|
||||
this.props.confirmFilter(this.props.column, this.state.selectedKeys);
|
||||
}
|
||||
},
|
||||
renderMenus(items) {
|
||||
let menuItems = items.map((item) => {
|
||||
return <Menu.Item key={item.value}>{item.text}</Menu.Item>;
|
||||
return <Menu.Item key={item.value}>
|
||||
<Checkbox checked={this.state.selectedKeys.indexOf(item.value) >= 0} />
|
||||
{item.text}
|
||||
</Menu.Item>;
|
||||
});
|
||||
return menuItems;
|
||||
},
|
||||
|
@ -220,16 +220,9 @@
|
||||
.@{table-prefix-cls}-filter-dropdown {
|
||||
min-width: 88px;
|
||||
margin-left: -8px;
|
||||
margin-top: -6px;
|
||||
.ant-dropdown-menu-item {
|
||||
overflow: hidden;
|
||||
padding: 7px 24px 8px 7px;
|
||||
&.ant-dropdown-menu-item-selected {
|
||||
.selected_icon();
|
||||
}
|
||||
&.ant-dropdown-menu-item-selected:after {
|
||||
padding-right: 8px;
|
||||
}
|
||||
padding: 7px 8px;
|
||||
}
|
||||
|
||||
a&-link {
|
||||
@ -245,7 +238,6 @@
|
||||
}
|
||||
&.clear {
|
||||
float: right;
|
||||
margin-right: -32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user