Skip to content

Commit

Permalink
fix(Table): add filterProps for users to customize filter
Browse files Browse the repository at this point in the history
  • Loading branch information
youluna committed Sep 5, 2019
1 parent b566d7a commit a3db26f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/table/base/cell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default class Cell extends React.Component {
innerStyle: PropTypes.object,
filterMode: PropTypes.oneOf(['single', 'multiple']),
filterMenuProps: PropTypes.object,
filterProps: PropTypes.object,
filters: PropTypes.array,
sortable: PropTypes.bool,
lock: PropTypes.any,
Expand Down Expand Up @@ -74,6 +75,7 @@ export default class Cell extends React.Component {
__normalized,
filterMode,
filterMenuProps,
filterProps,
filters,
sortable,
lock,
Expand Down
4 changes: 4 additions & 0 deletions src/table/base/filter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default class Filter extends React.Component {
filterMode: PropTypes.string,
filterParams: PropTypes.object,
filterMenuProps: PropTypes.object,
filterProps: PropTypes.object,
locale: PropTypes.object,
onFilter: PropTypes.func,
prefix: PropTypes.string,
Expand Down Expand Up @@ -124,8 +125,10 @@ export default class Filter extends React.Component {
locale,
filterMode,
filterMenuProps,
filterProps,
rtl,
} = this.props;

const { visible, selectedKeys } = this.state;
const { subMenuSelectable, ...others } = filterMenuProps;

Expand Down Expand Up @@ -185,6 +188,7 @@ export default class Filter extends React.Component {
needAdjust={false}
container={node => node.parentNode}
onVisibleChange={this.onFilterVisible}
{...filterProps}
>
<Menu
footer={footer}
Expand Down
2 changes: 2 additions & 0 deletions src/table/base/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default class Header extends React.Component {
filters,
filterMode,
filterMenuProps,
filterProps,
width,
align,
alignHeader,
Expand Down Expand Up @@ -144,6 +145,7 @@ export default class Header extends React.Component {
filterParams={filterParams}
filterMode={filterMode}
filterMenuProps={filterMenuProps}
filterProps={filterProps}
onFilter={onFilter}
/>
) : null;
Expand Down
2 changes: 2 additions & 0 deletions src/table/column.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default class Column extends React.Component {
* @property {Boolean} isSelectIconRight 默认为`false` 是否将选中图标居右。注意:SubMenu 上的选中图标一直居左,不受此API控制
*/
filterMenuProps: PropTypes.object,
filterProps: PropTypes.object,
/**
* 是否支持锁列,可选值为`left`,`right`, `true`
*/
Expand All @@ -84,6 +85,7 @@ export default class Column extends React.Component {
filterMenuProps: {
subMenuSelectable: false,
},
filterProps: {},
resizable: false,
};

Expand Down

0 comments on commit a3db26f

Please sign in to comment.