Skip to content

Commit

Permalink
feat(CascaderSelect): Clear the search box after selecting the item, c…
Browse files Browse the repository at this point in the history
  • Loading branch information
YunMeng99 authored and eternalsky committed Jun 27, 2024
1 parent 09303ce commit 9e159f2
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 58 deletions.
56 changes: 28 additions & 28 deletions components/cascader-select/__docs__/index.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,34 @@ Inherits partial props from Cascader, support passing props to Cascader: dataSou
checkStrictly, resultRender, expandedValue, defaultExpandedValue, expandTriggerType, onExpand, listStyle, listClassName, loadData, i
temRender, immutable. Support passing props to Select: other Select props except those listed above and those listed below.

| Param | Description | Type | Default Value | Required |
| --------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- |
| size | Size | 'small' \| 'medium' \| 'large' | 'medium' | |
| disabled | Disabled | boolean | false | |
| hasArrow | HasArrow | boolean | true | |
| hasBorder | HasBorder | boolean | true | |
| hasClear | HasClear | boolean | false | |
| readOnly | ReadOnly, popup layer can be expanded but cannot be selected in read | boolean | - | |
| defaultValue | Default value(not controlled) | string \| Array\<string> | - | |
| value | Current value(controlled) | string \| Array\<string> | - | |
| onChange | Callback when selected value changes | (<br/> value: string \| Array\<string> \| null,<br/> data: CascaderDataItem \| Array\<CascaderDataItem> \| null,<br/> extra?: Extra<br/> ) => void | - | |
| changeOnSelect | Whether to call onChange as soon as selected, this property only works in single selection mode | boolean | false | |
| displayRender | Custom render function of selected result | (<br/> label: Array\<React.ReactNode>,<br/> data?: CascaderSelectDataItem<br/> ) => React.ReactNode | - | |
| showSearch | Show search box | boolean | false | |
| filter | Custom search function | (searchValue: string, path: CascaderSelectDataItem[]) => boolean | - | |
| onSearch | Callback when search value changes | (value: string) => void | - | |
| resultAutoWidth | Whether the search result list is the same width as the selection box | boolean | true | |
| notFoundContent | Content when no data | React.ReactNode | - | |
| header | Custom dropdown header | React.ReactNode | - | |
| footer | Custom dropdown footer | React.ReactNode | - | |
| defaultVisible | Visible by default | boolean | false | |
| visible | Current visible | boolean | - | |
| onVisibleChange | - | (visible: boolean, type?: CascaderSelectVisibleChangeType) => void | - | |
| popupProps | Props object passed to Popup | React.ComponentPropsWithRef\<typeof Popup> | - | |
| isPreview | Whether it is in preview mode | boolean | false | |
| renderPreview | Custom preview | (<br/> value: CascaderSelectDataItem \| CascaderSelectDataItem[],<br/> props: CascaderSelectProps<br/> ) => React.ReactNode | - | |
| treeCheckable | - | boolean | - | |
| menuProps | - | Omit\<CascaderProps, 'onSelect' \| 'onChange'> | - | |
| Param | Description | Type | Default Value | Required | Supported Version |
| -------------------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | ----------------- |
| size | Size | 'small' \| 'medium' \| 'large' | 'medium' | | - |
| disabled | Disabled | boolean | false | | - |
| hasArrow | HasArrow | boolean | true | | - |
| hasBorder | HasBorder | boolean | true | | - |
| hasClear | HasClear | boolean | false | | - |
| readOnly | ReadOnly, popup layer can be expanded but cannot be selected in read | boolean | - | | - |
| defaultValue | Default value(not controlled) | string \| Array\<string> | - | | - |
| value | Current value(controlled) | string \| Array\<string> | - | | - |
| onChange | Callback when selected value changes | (<br/> value: string \| Array\<string> \| null,<br/> data: CascaderDataItem \| Array\<CascaderDataItem> \| null,<br/> extra?: Extra<br/> ) => void | - | | - |
| changeOnSelect | Whether to call onChange as soon as selected, this property only works in single selection mode | boolean | false | | - |
| displayRender | Custom render function of selected result | (<br/> label: Array\<React.ReactNode>,<br/> data: CascaderSelectDataItem<br/> ) => React.ReactNode | - | | - |
| showSearch | Show search box | boolean | false | | - |
| filter | Custom search function | (searchValue: string, path: CascaderSelectDataItem[]) => boolean | - | | - |
| onSearch | Callback when search value changes | (value: string) => void | - | | 1.23 |
| resultAutoWidth | Whether the search result list is the same width as the selection box | boolean | true | | - |
| notFoundContent | Content when no data | React.ReactNode | - | | - |
| header | Custom dropdown header | React.ReactNode | - | | - |
| footer | Custom dropdown footer | React.ReactNode | - | | - |
| defaultVisible | Visible by default | boolean | false | | - |
| visible | Current visible | boolean | - | | - |
| onVisibleChange | - | (visible: boolean, type?: CascaderSelectVisibleChangeType) => void | - | | - |
| popupProps | Props object passed to Popup | React.ComponentPropsWithRef\<typeof Popup> | - | | - |
| isPreview | Whether it is in preview mode | boolean | false | | - |
| renderPreview | Custom preview | (<br/> value: CascaderSelectDataItem \| CascaderSelectDataItem[],<br/> props: CascaderSelectProps<br/> ) => React.ReactNode | - | | - |
| menuProps | Props object passed to Cascader | Omit\<CascaderProps, 'onSelect' \| 'onChange'> | - | | - |
| autoClearSearchValue | Whether the current search will be cleared on selecting an item. Only applies when multiple is true | boolean | false | | - |

<!-- api-extra-start -->

Expand Down
Loading

0 comments on commit 9e159f2

Please sign in to comment.