treeselect: suffix -> suffixIcon

This commit is contained in:
HeskeyBaozi 2018-09-16 19:47:00 +08:00 committed by 偏右
parent 006b274d9e
commit 457f781e6f
5 changed files with 8 additions and 8 deletions

View File

@ -34,7 +34,7 @@ class Demo extends React.Component {
return (
<TreeSelect
showSearch
suffix={icon}
suffixIcon={icon}
style={{ width: 300 }}
value={this.state.value}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}

View File

@ -37,7 +37,7 @@ Any data whose entries are defined in a hierarchical manner is fit to use this c
| showCheckedStrategy | The way show selected item in box. **Default:** just show child nodes. **`TreeSelect.SHOW_ALL`:** show all checked treeNodes (include parent treeNode). **`TreeSelect.SHOW_PARENT`:** show checked treeNodes (just show parent treeNode). | enum { TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD } | TreeSelect.SHOW_CHILD |
| showSearch | Whether to display a search input in the dropdown menu(valid only in the single mode) | boolean | false |
| size | To set the size of the select input, options: `large` `small` | string | 'default' |
| suffix | The custom suffix icon | ReactNode | - |
| suffixIcon | The custom suffix icon | ReactNode | - |
| treeCheckable | Whether to show checkbox on the treeNodes | boolean | false |
| treeCheckStrictly | Whether to check nodes precisely (in the `checkable` mode), means parent and child nodes are not associated, and it will make `labelInValue` be true | boolean | false |
| treeData | Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value) | array&lt;{ value, title, children, [disabled, disableCheckbox, selectable] }> | \[] |

View File

@ -75,7 +75,7 @@ export default class TreeSelect extends React.Component<TreeSelectProps, any> {
notFoundContent,
dropdownStyle,
dropdownClassName,
suffix,
suffixIcon,
...restProps
} = this.props;
const rest = omit(restProps, ['inputIcon', 'removeIcon', 'clearIcon', 'switcherIcon']);
@ -90,9 +90,9 @@ export default class TreeSelect extends React.Component<TreeSelectProps, any> {
checkable = <span className={`${prefixCls}-tree-checkbox-inner`} />;
}
const inputIcon = suffix && (
React.isValidElement<{ className?: string }>(suffix)
? React.cloneElement(suffix) : suffix) || (
const inputIcon = suffixIcon && (
React.isValidElement<{ className?: string }>(suffixIcon)
? React.cloneElement(suffixIcon) : suffixIcon) || (
<Icon type="down" className={`${prefixCls}-arrow-icon`} />
);

View File

@ -37,7 +37,7 @@ title: TreeSelect
| showCheckedStrategy | 定义选中项回填的方式。`TreeSelect.SHOW_ALL`: 显示所有选中节点(包括父节点). `TreeSelect.SHOW_PARENT`: 只显示父节点(当父节点下所有子节点都选中时). 默认只显示子节点. | enum{TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD } | TreeSelect.SHOW_CHILD |
| showSearch | 在下拉中显示搜索框(仅在单选模式下生效) | boolean | false |
| size | 选择框大小,可选 `large` `small` | string | 'default' |
| suffix | 自定义的选择框后缀图标 | ReactNode | - |
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - |
| treeCheckable | 显示 checkbox | boolean | false |
| treeCheckStrictly | checkable 状态下节点选择完全受控(父子节点选中状态不再关联),会使得 `labelInValue` 强制为 true | boolean | false |
| treeData | treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点value 在整个树范围内唯一) | array&lt;{value, title, children, [disabled, disableCheckbox, selectable]}> | \[] |

View File

@ -52,5 +52,5 @@ export interface TreeSelectProps extends AbstractSelectProps {
labelInValue?: boolean;
treeCheckStrictly?: boolean;
getPopupContainer?: (triggerNode: Element) => HTMLElement;
suffix?: React.ReactNode;
suffixIcon?: React.ReactNode;
}