From a3db26fdb2545519c21b0059c3434dfe4dd012c6 Mon Sep 17 00:00:00 2001 From: youluna Date: Thu, 5 Sep 2019 10:49:50 +0800 Subject: [PATCH] fix(Table): add filterProps for users to customize filter --- src/table/base/cell.jsx | 2 ++ src/table/base/filter.jsx | 4 ++++ src/table/base/header.jsx | 2 ++ src/table/column.jsx | 2 ++ 4 files changed, 10 insertions(+) diff --git a/src/table/base/cell.jsx b/src/table/base/cell.jsx index 8db9af6ef9..384b9283f3 100644 --- a/src/table/base/cell.jsx +++ b/src/table/base/cell.jsx @@ -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, @@ -74,6 +75,7 @@ export default class Cell extends React.Component { __normalized, filterMode, filterMenuProps, + filterProps, filters, sortable, lock, diff --git a/src/table/base/filter.jsx b/src/table/base/filter.jsx index c6057df417..36fb483f1d 100644 --- a/src/table/base/filter.jsx +++ b/src/table/base/filter.jsx @@ -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, @@ -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; @@ -185,6 +188,7 @@ export default class Filter extends React.Component { needAdjust={false} container={node => node.parentNode} onVisibleChange={this.onFilterVisible} + {...filterProps} > ) : null; diff --git a/src/table/column.jsx b/src/table/column.jsx index c9cbee44e7..52e801ef6e 100644 --- a/src/table/column.jsx +++ b/src/table/column.jsx @@ -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` */ @@ -84,6 +85,7 @@ export default class Column extends React.Component { filterMenuProps: { subMenuSelectable: false, }, + filterProps: {}, resizable: false, };