@sheinx/base 3.8.0-beta.8 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/absolute-list/absolute-list.js +2 -2
- package/cjs/absolute-list/use-container.d.ts +1 -0
- package/cjs/absolute-list/use-container.d.ts.map +1 -1
- package/cjs/absolute-list/use-container.js +3 -0
- package/cjs/alert/alert.d.ts.map +1 -1
- package/cjs/alert/alert.js +1 -1
- package/cjs/avatar/avatar.type.d.ts +5 -0
- package/cjs/avatar/avatar.type.d.ts.map +1 -1
- package/cjs/avatar/group.js +1 -1
- package/cjs/breadcrumb/breadcrumb-item.d.ts +11 -0
- package/cjs/breadcrumb/breadcrumb-item.d.ts.map +1 -0
- package/cjs/breadcrumb/breadcrumb-item.js +83 -0
- package/cjs/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/cjs/breadcrumb/breadcrumb.js +34 -32
- package/cjs/breadcrumb/breadcrumb.type.d.ts +4 -0
- package/cjs/breadcrumb/breadcrumb.type.d.ts.map +1 -1
- package/cjs/button/button.type.d.ts +1 -1
- package/cjs/button/button.type.d.ts.map +1 -1
- package/cjs/cascader/cascader.d.ts.map +1 -1
- package/cjs/cascader/cascader.js +3 -5
- package/cjs/cascader/cascader.type.d.ts +8 -0
- package/cjs/cascader/cascader.type.d.ts.map +1 -1
- package/cjs/cascader/node.d.ts.map +1 -1
- package/cjs/cascader/node.js +7 -3
- package/cjs/config/index.d.ts +23 -0
- package/cjs/config/index.d.ts.map +1 -1
- package/cjs/config/index.js +7 -0
- package/cjs/config/locale/en_US.d.ts +3 -0
- package/cjs/config/locale/en_US.d.ts.map +1 -1
- package/cjs/config/locale/en_US.js +3 -0
- package/cjs/config/locale/zh-CN.d.ts +3 -0
- package/cjs/config/locale/zh-CN.d.ts.map +1 -1
- package/cjs/config/locale/zh-CN.js +3 -0
- package/cjs/date-picker/date-picker.js +1 -1
- package/cjs/date-picker/date-picker.type.d.ts +1 -1
- package/cjs/date-picker/date-picker.type.d.ts.map +1 -1
- package/cjs/date-picker/day.d.ts.map +1 -1
- package/cjs/date-picker/time.d.ts.map +1 -1
- package/cjs/date-picker/time.js +6 -2
- package/cjs/dropdown/Item.d.ts.map +1 -1
- package/cjs/dropdown/Item.js +3 -1
- package/cjs/empty/empty.d.ts.map +1 -1
- package/cjs/empty/empty.js +10 -5
- package/cjs/empty/empty.type.d.ts +4 -4
- package/cjs/form/form-field.d.ts.map +1 -1
- package/cjs/form/form-field.js +25 -2
- package/cjs/form/form-field.type.d.ts +12 -21
- package/cjs/form/form-field.type.d.ts.map +1 -1
- package/cjs/form/form-fieldset.d.ts.map +1 -1
- package/cjs/form/form-fieldset.js +55 -3
- package/cjs/form/form-fieldset.type.d.ts +35 -23
- package/cjs/form/form-fieldset.type.d.ts.map +1 -1
- package/cjs/form/form-flow.type.d.ts +11 -7
- package/cjs/form/form-flow.type.d.ts.map +1 -1
- package/cjs/form/form-item.d.ts.map +1 -1
- package/cjs/form/form-item.js +41 -16
- package/cjs/form/form-item.type.d.ts +1 -0
- package/cjs/form/form-item.type.d.ts.map +1 -1
- package/cjs/form/form.d.ts.map +1 -1
- package/cjs/form/form.js +2 -1
- package/cjs/form/form.type.d.ts +34 -24
- package/cjs/form/form.type.d.ts.map +1 -1
- package/cjs/form/form.type.js +4 -0
- package/cjs/form/index.d.ts +1 -1
- package/cjs/form/index.d.ts.map +1 -1
- package/cjs/icons/config.d.ts +3 -0
- package/cjs/icons/config.d.ts.map +1 -1
- package/cjs/icons/config.js +3 -0
- package/cjs/icons/icons.d.ts +1 -0
- package/cjs/icons/icons.d.ts.map +1 -1
- package/cjs/icons/icons.js +150 -1
- package/cjs/input/input-number.d.ts.map +1 -1
- package/cjs/input/input-number.js +4 -2
- package/cjs/input/use-input-common.d.ts +1 -1
- package/cjs/list/list.d.ts.map +1 -1
- package/cjs/list/list.js +54 -22
- package/cjs/list/list.type.d.ts +8 -1
- package/cjs/list/list.type.d.ts.map +1 -1
- package/cjs/modal/modal-content.d.ts.map +1 -1
- package/cjs/modal/modal-content.js +51 -14
- package/cjs/modal/modal.d.ts.map +1 -1
- package/cjs/modal/modal.js +2 -1
- package/cjs/modal/modal.type.d.ts +8 -2
- package/cjs/modal/modal.type.d.ts.map +1 -1
- package/cjs/pagination/pagination-size-list.d.ts.map +1 -1
- package/cjs/pagination/pagination-size-list.js +10 -9
- package/cjs/pagination/pagination-size-list.type.d.ts +1 -1
- package/cjs/pagination/pagination-size-list.type.d.ts.map +1 -1
- package/cjs/pagination/pagination.d.ts.map +1 -1
- package/cjs/pagination/pagination.js +10 -2
- package/cjs/pagination/pagination.type.d.ts +11 -11
- package/cjs/pagination/pagination.type.d.ts.map +1 -1
- package/cjs/popover/popover.d.ts.map +1 -1
- package/cjs/popover/popover.js +11 -2
- package/cjs/radio/group-context.d.ts.map +1 -1
- package/cjs/radio/group-context.js +1 -0
- package/cjs/radio/radio-group.d.ts.map +1 -1
- package/cjs/radio/radio-group.js +5 -1
- package/cjs/radio/radio.d.ts.map +1 -1
- package/cjs/radio/radio.js +9 -0
- package/cjs/radio/radio.type.d.ts +7 -1
- package/cjs/radio/radio.type.d.ts.map +1 -1
- package/cjs/radio/simple-radio.d.ts.map +1 -1
- package/cjs/radio/simple-radio.js +2 -1
- package/cjs/select/list-columns.d.ts.map +1 -1
- package/cjs/select/list-columns.js +6 -2
- package/cjs/select/list.d.ts.map +1 -1
- package/cjs/select/list.js +2 -0
- package/cjs/select/result-more.d.ts.map +1 -1
- package/cjs/select/result-more.js +5 -15
- package/cjs/select/result-more.type.d.ts +0 -1
- package/cjs/select/result-more.type.d.ts.map +1 -1
- package/cjs/select/result.d.ts.map +1 -1
- package/cjs/select/result.js +24 -8
- package/cjs/select/result.type.d.ts +1 -0
- package/cjs/select/result.type.d.ts.map +1 -1
- package/cjs/select/select.d.ts.map +1 -1
- package/cjs/select/select.js +25 -10
- package/cjs/select/select.type.d.ts +206 -127
- package/cjs/select/select.type.d.ts.map +1 -1
- package/cjs/sticky/sticky.d.ts.map +1 -1
- package/cjs/sticky/sticky.js +105 -22
- package/cjs/sticky/sticky.type.d.ts +6 -0
- package/cjs/sticky/sticky.type.d.ts.map +1 -1
- package/cjs/table/table.d.ts.map +1 -1
- package/cjs/table/table.js +45 -22
- package/cjs/table/table.type.d.ts +81 -82
- package/cjs/table/table.type.d.ts.map +1 -1
- package/cjs/table/tbody.d.ts.map +1 -1
- package/cjs/table/tbody.js +13 -1
- package/cjs/table/tbody.type.d.ts +5 -0
- package/cjs/table/tbody.type.d.ts.map +1 -1
- package/cjs/table/td.d.ts.map +1 -1
- package/cjs/table/td.js +5 -23
- package/cjs/table/tfoot.d.ts.map +1 -1
- package/cjs/table/tfoot.js +6 -2
- package/cjs/table/tfoot.type.d.ts +1 -0
- package/cjs/table/tfoot.type.d.ts.map +1 -1
- package/cjs/table/thead-filter.d.ts.map +1 -1
- package/cjs/table/thead-filter.js +17 -7
- package/cjs/table/tr.d.ts +1 -0
- package/cjs/table/tr.d.ts.map +1 -1
- package/cjs/table/tr.js +5 -4
- package/cjs/tabs/tabs-header.d.ts.map +1 -1
- package/cjs/tabs/tabs-header.js +41 -11
- package/cjs/textarea/simple-textarea.d.ts.map +1 -1
- package/cjs/textarea/simple-textarea.js +4 -1
- package/cjs/tooltip/tooltip.js +2 -1
- package/cjs/tree/tree-content.d.ts.map +1 -1
- package/cjs/tree/tree-content.js +2 -0
- package/cjs/tree/tree-content.type.d.ts +1 -0
- package/cjs/tree/tree-content.type.d.ts.map +1 -1
- package/cjs/tree/tree-node.type.d.ts +1 -0
- package/cjs/tree/tree-node.type.d.ts.map +1 -1
- package/cjs/tree/tree-simple-node.d.ts.map +1 -1
- package/cjs/tree/tree-simple-node.js +3 -1
- package/cjs/tree/tree-virtual-node.d.ts.map +1 -1
- package/cjs/tree/tree-virtual-node.js +15 -2
- package/cjs/tree/tree-virtual.d.ts.map +1 -1
- package/cjs/tree/tree-virtual.js +2 -1
- package/cjs/tree/tree.type.d.ts +2 -1
- package/cjs/tree/tree.type.d.ts.map +1 -1
- package/cjs/tree-select/tree-select.d.ts.map +1 -1
- package/cjs/tree-select/tree-select.js +1 -0
- package/cjs/tree-select/tree-select.type.d.ts +8 -0
- package/cjs/tree-select/tree-select.type.d.ts.map +1 -1
- package/cjs/upload/result.d.ts.map +1 -1
- package/cjs/upload/result.js +19 -5
- package/cjs/upload/useInputClick.d.ts +1 -0
- package/cjs/upload/useInputClick.d.ts.map +1 -1
- package/cjs/upload/useInputClick.js +4 -0
- package/cjs/virtual-scroll/scroll-table.d.ts.map +1 -1
- package/cjs/virtual-scroll/scroll-table.js +6 -2
- package/cjs/virtual-scroll/virtual-scroll-list.d.ts.map +1 -1
- package/cjs/virtual-scroll/virtual-scroll-list.js +8 -2
- package/cjs/virtual-scroll/virtual-scroll-list.type.d.ts +1 -0
- package/cjs/virtual-scroll/virtual-scroll-list.type.d.ts.map +1 -1
- package/esm/absolute-list/absolute-list.js +2 -2
- package/esm/absolute-list/use-container.d.ts +1 -0
- package/esm/absolute-list/use-container.d.ts.map +1 -1
- package/esm/absolute-list/use-container.js +3 -0
- package/esm/alert/alert.d.ts.map +1 -1
- package/esm/alert/alert.js +1 -1
- package/esm/avatar/avatar.type.d.ts +5 -0
- package/esm/avatar/avatar.type.d.ts.map +1 -1
- package/esm/avatar/group.js +1 -1
- package/esm/breadcrumb/breadcrumb-item.d.ts +11 -0
- package/esm/breadcrumb/breadcrumb-item.d.ts.map +1 -0
- package/esm/breadcrumb/breadcrumb-item.js +76 -0
- package/esm/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/esm/breadcrumb/breadcrumb.js +34 -33
- package/esm/breadcrumb/breadcrumb.type.d.ts +4 -0
- package/esm/breadcrumb/breadcrumb.type.d.ts.map +1 -1
- package/esm/button/button.type.d.ts +1 -1
- package/esm/button/button.type.d.ts.map +1 -1
- package/esm/cascader/cascader.d.ts.map +1 -1
- package/esm/cascader/cascader.js +3 -5
- package/esm/cascader/cascader.type.d.ts +8 -0
- package/esm/cascader/cascader.type.d.ts.map +1 -1
- package/esm/cascader/node.d.ts.map +1 -1
- package/esm/cascader/node.js +7 -3
- package/esm/config/index.d.ts +23 -0
- package/esm/config/index.d.ts.map +1 -1
- package/esm/config/index.js +8 -0
- package/esm/config/locale/en_US.d.ts +3 -0
- package/esm/config/locale/en_US.d.ts.map +1 -1
- package/esm/config/locale/en_US.js +3 -0
- package/esm/config/locale/zh-CN.d.ts +3 -0
- package/esm/config/locale/zh-CN.d.ts.map +1 -1
- package/esm/config/locale/zh-CN.js +3 -0
- package/esm/date-picker/date-picker.js +1 -1
- package/esm/date-picker/date-picker.type.d.ts +1 -1
- package/esm/date-picker/date-picker.type.d.ts.map +1 -1
- package/esm/date-picker/day.d.ts.map +1 -1
- package/esm/date-picker/time.d.ts.map +1 -1
- package/esm/date-picker/time.js +6 -2
- package/esm/dropdown/Item.d.ts.map +1 -1
- package/esm/dropdown/Item.js +3 -1
- package/esm/empty/empty.d.ts.map +1 -1
- package/esm/empty/empty.js +10 -5
- package/esm/empty/empty.type.d.ts +4 -4
- package/esm/form/form-field.d.ts.map +1 -1
- package/esm/form/form-field.js +26 -3
- package/esm/form/form-field.type.d.ts +12 -21
- package/esm/form/form-field.type.d.ts.map +1 -1
- package/esm/form/form-fieldset.d.ts.map +1 -1
- package/esm/form/form-fieldset.js +55 -3
- package/esm/form/form-fieldset.type.d.ts +35 -23
- package/esm/form/form-fieldset.type.d.ts.map +1 -1
- package/esm/form/form-flow.type.d.ts +11 -7
- package/esm/form/form-flow.type.d.ts.map +1 -1
- package/esm/form/form-item.d.ts.map +1 -1
- package/esm/form/form-item.js +39 -16
- package/esm/form/form-item.type.d.ts +1 -0
- package/esm/form/form-item.type.d.ts.map +1 -1
- package/esm/form/form.d.ts.map +1 -1
- package/esm/form/form.js +2 -1
- package/esm/form/form.type.d.ts +34 -24
- package/esm/form/form.type.d.ts.map +1 -1
- package/esm/form/form.type.js +5 -0
- package/esm/form/index.d.ts +1 -1
- package/esm/form/index.d.ts.map +1 -1
- package/esm/icons/config.d.ts +3 -0
- package/esm/icons/config.d.ts.map +1 -1
- package/esm/icons/config.js +3 -0
- package/esm/icons/icons.d.ts +1 -0
- package/esm/icons/icons.d.ts.map +1 -1
- package/esm/icons/icons.js +150 -1
- package/esm/input/input-number.d.ts.map +1 -1
- package/esm/input/input-number.js +4 -2
- package/esm/input/use-input-common.d.ts +1 -1
- package/esm/list/list.d.ts.map +1 -1
- package/esm/list/list.js +55 -23
- package/esm/list/list.type.d.ts +8 -1
- package/esm/list/list.type.d.ts.map +1 -1
- package/esm/modal/modal-content.d.ts.map +1 -1
- package/esm/modal/modal-content.js +52 -15
- package/esm/modal/modal.d.ts.map +1 -1
- package/esm/modal/modal.js +2 -1
- package/esm/modal/modal.type.d.ts +8 -2
- package/esm/modal/modal.type.d.ts.map +1 -1
- package/esm/pagination/pagination-size-list.d.ts.map +1 -1
- package/esm/pagination/pagination-size-list.js +10 -9
- package/esm/pagination/pagination-size-list.type.d.ts +1 -1
- package/esm/pagination/pagination-size-list.type.d.ts.map +1 -1
- package/esm/pagination/pagination.d.ts.map +1 -1
- package/esm/pagination/pagination.js +11 -3
- package/esm/pagination/pagination.type.d.ts +11 -11
- package/esm/pagination/pagination.type.d.ts.map +1 -1
- package/esm/popover/popover.d.ts.map +1 -1
- package/esm/popover/popover.js +11 -2
- package/esm/radio/group-context.d.ts.map +1 -1
- package/esm/radio/group-context.js +1 -0
- package/esm/radio/radio-group.d.ts.map +1 -1
- package/esm/radio/radio-group.js +5 -2
- package/esm/radio/radio.d.ts.map +1 -1
- package/esm/radio/radio.js +9 -0
- package/esm/radio/radio.type.d.ts +7 -1
- package/esm/radio/radio.type.d.ts.map +1 -1
- package/esm/radio/simple-radio.d.ts.map +1 -1
- package/esm/radio/simple-radio.js +2 -1
- package/esm/select/list-columns.d.ts.map +1 -1
- package/esm/select/list-columns.js +6 -2
- package/esm/select/list.d.ts.map +1 -1
- package/esm/select/list.js +2 -0
- package/esm/select/result-more.d.ts.map +1 -1
- package/esm/select/result-more.js +5 -15
- package/esm/select/result-more.type.d.ts +0 -1
- package/esm/select/result-more.type.d.ts.map +1 -1
- package/esm/select/result.d.ts.map +1 -1
- package/esm/select/result.js +24 -8
- package/esm/select/result.type.d.ts +1 -0
- package/esm/select/result.type.d.ts.map +1 -1
- package/esm/select/select.d.ts.map +1 -1
- package/esm/select/select.js +25 -10
- package/esm/select/select.type.d.ts +206 -127
- package/esm/select/select.type.d.ts.map +1 -1
- package/esm/sticky/sticky.d.ts.map +1 -1
- package/esm/sticky/sticky.js +105 -22
- package/esm/sticky/sticky.type.d.ts +6 -0
- package/esm/sticky/sticky.type.d.ts.map +1 -1
- package/esm/table/table.d.ts.map +1 -1
- package/esm/table/table.js +46 -23
- package/esm/table/table.type.d.ts +81 -82
- package/esm/table/table.type.d.ts.map +1 -1
- package/esm/table/tbody.d.ts.map +1 -1
- package/esm/table/tbody.js +13 -1
- package/esm/table/tbody.type.d.ts +5 -0
- package/esm/table/tbody.type.d.ts.map +1 -1
- package/esm/table/td.d.ts.map +1 -1
- package/esm/table/td.js +4 -20
- package/esm/table/tfoot.d.ts.map +1 -1
- package/esm/table/tfoot.js +6 -2
- package/esm/table/tfoot.type.d.ts +1 -0
- package/esm/table/tfoot.type.d.ts.map +1 -1
- package/esm/table/thead-filter.d.ts.map +1 -1
- package/esm/table/thead-filter.js +17 -7
- package/esm/table/tr.d.ts +1 -0
- package/esm/table/tr.d.ts.map +1 -1
- package/esm/table/tr.js +5 -4
- package/esm/tabs/tabs-header.d.ts.map +1 -1
- package/esm/tabs/tabs-header.js +41 -11
- package/esm/textarea/simple-textarea.d.ts.map +1 -1
- package/esm/textarea/simple-textarea.js +4 -1
- package/esm/tooltip/tooltip.js +2 -1
- package/esm/tree/tree-content.d.ts.map +1 -1
- package/esm/tree/tree-content.js +2 -0
- package/esm/tree/tree-content.type.d.ts +1 -0
- package/esm/tree/tree-content.type.d.ts.map +1 -1
- package/esm/tree/tree-node.type.d.ts +1 -0
- package/esm/tree/tree-node.type.d.ts.map +1 -1
- package/esm/tree/tree-simple-node.d.ts.map +1 -1
- package/esm/tree/tree-simple-node.js +3 -1
- package/esm/tree/tree-virtual-node.d.ts.map +1 -1
- package/esm/tree/tree-virtual-node.js +15 -2
- package/esm/tree/tree-virtual.d.ts.map +1 -1
- package/esm/tree/tree-virtual.js +2 -1
- package/esm/tree/tree.type.d.ts +2 -1
- package/esm/tree/tree.type.d.ts.map +1 -1
- package/esm/tree-select/tree-select.d.ts.map +1 -1
- package/esm/tree-select/tree-select.js +1 -0
- package/esm/tree-select/tree-select.type.d.ts +8 -0
- package/esm/tree-select/tree-select.type.d.ts.map +1 -1
- package/esm/upload/result.d.ts.map +1 -1
- package/esm/upload/result.js +20 -6
- package/esm/upload/useInputClick.d.ts +1 -0
- package/esm/upload/useInputClick.d.ts.map +1 -1
- package/esm/upload/useInputClick.js +4 -0
- package/esm/virtual-scroll/scroll-table.d.ts.map +1 -1
- package/esm/virtual-scroll/scroll-table.js +6 -2
- package/esm/virtual-scroll/virtual-scroll-list.d.ts.map +1 -1
- package/esm/virtual-scroll/virtual-scroll-list.js +8 -2
- package/esm/virtual-scroll/virtual-scroll-list.type.d.ts +1 -0
- package/esm/virtual-scroll/virtual-scroll-list.type.d.ts.map +1 -1
- package/package.json +3 -3
- package/cjs/empty/empty-image.d.ts +0 -2
- package/cjs/empty/empty-image.d.ts.map +0 -1
- package/cjs/empty/empty-image.js +0 -157
- package/esm/empty/empty-image.d.ts +0 -2
- package/esm/empty/empty-image.d.ts.map +0 -1
- package/esm/empty/empty-image.js +0 -152
|
@@ -40,6 +40,7 @@ export type SelectClasses = {
|
|
|
40
40
|
triggerHover: string;
|
|
41
41
|
resultTextPadding: string;
|
|
42
42
|
compressedWrapper: string;
|
|
43
|
+
compressedBoundWrapper: string;
|
|
43
44
|
multipleCompressedWrapper: string;
|
|
44
45
|
controlMouse: string;
|
|
45
46
|
controlKeyboard: string;
|
|
@@ -130,6 +131,7 @@ export interface BaseListProps<DataItem, Value> extends Pick<SelectProps<DataIte
|
|
|
130
131
|
originalData: any;
|
|
131
132
|
groupKey?: string;
|
|
132
133
|
dynamicVirtual?: boolean;
|
|
134
|
+
keepScrollTop?: boolean;
|
|
133
135
|
controlType?: 'mouse' | 'keyboard';
|
|
134
136
|
optionListRef: React.MutableRefObject<OptionListRefType | undefined>;
|
|
135
137
|
isAnimationFinish: boolean;
|
|
@@ -139,303 +141,356 @@ export interface BaseListProps<DataItem, Value> extends Pick<SelectProps<DataIte
|
|
|
139
141
|
export interface SelectPropsBase<DataItem, Value> extends Omit<BaseSelectProps<DataItem, Value>, 'control' | 'filterSameChange'>, Pick<CommonType, 'className' | 'style' | 'size' | 'status' | 'innerTitle' | 'filterSameChange'>, Pick<AbsoluteListProps, 'absolute' | 'zIndex'>, BaseTipProps {
|
|
140
142
|
jssStyle?: JssStyleType;
|
|
141
143
|
/**
|
|
142
|
-
* @en custom empty
|
|
143
|
-
* @cn
|
|
144
|
+
* @en Custom empty state content. When used with renderOptionList, setting emptyText to false will disable this feature. You can render custom empty content in renderOptionList
|
|
145
|
+
* @cn 自定义空状态内容。与 renderOptionList 搭配使用时,将 emptyText 设置为 false 可禁用此功能,需要自定义空内容时可在 renderOptionList 中处理
|
|
146
|
+
* @when When no options match the filter or data array is empty
|
|
144
147
|
*/
|
|
145
148
|
emptyText?: React.ReactNode;
|
|
146
149
|
/**
|
|
147
|
-
* @en
|
|
148
|
-
* @cn
|
|
150
|
+
* @en Array of option items to display in the dropdown list
|
|
151
|
+
* @cn 下拉列表的选项数据数组
|
|
149
152
|
* @override DataItem[]
|
|
153
|
+
* @when Use for flat list data structure
|
|
150
154
|
*/
|
|
151
155
|
data?: DataItem[];
|
|
152
156
|
/**
|
|
153
|
-
* @en Tree data
|
|
154
|
-
* @cn
|
|
157
|
+
* @en Tree-structured data with nested children. Format: [{children: [...]}]
|
|
158
|
+
* @cn 树形结构数据,包含嵌套的子节点。格式:[{children: [...]}]
|
|
155
159
|
* @override Object[]
|
|
160
|
+
* @when Use for hierarchical/nested data structure instead of flat data
|
|
156
161
|
*/
|
|
157
162
|
treeData?: DataItem[];
|
|
158
163
|
/**
|
|
159
|
-
* @en
|
|
160
|
-
* @cn
|
|
164
|
+
* @en Specifies the property name for child nodes in tree data
|
|
165
|
+
* @cn 指定树形数据中子节点的属性名称
|
|
161
166
|
* @default 'children'
|
|
167
|
+
* @when When using treeData with a different property name for children
|
|
162
168
|
*/
|
|
163
169
|
childrenKey?: ObjectKey<DataItem>;
|
|
164
170
|
/**
|
|
165
|
-
* @en Auxiliary method for generating key. When it is a function, use the return value of this function. When it is a string, use the data value corresponding to this string. For example, "id" is the same thing as (d) => d.id
|
|
166
|
-
* @cn 生成 key 的辅助方法, 为函数时,使用此函数返回值, 为 string 时,使用这个 string 对应的数据值。如 "id",相当于 (d) => d.id
|
|
171
|
+
* @en Auxiliary method for generating key. When it is a function, use the return value of this function. When it is a string, use the data value corresponding to this string. For example, "id" is the same thing as (d) => d.id. The default value is the array index. For simple arrays (strings/numbers), this works fine. However, for object arrays, you MUST specify a proper keygen to avoid errors. Without a proper keygen, the component will use the entire object as the key, which can cause React rendering errors when renderItem defaults to (d) => d.
|
|
172
|
+
* @cn 生成 key 的辅助方法, 为函数时,使用此函数返回值, 为 string 时,使用这个 string 对应的数据值。如 "id",相当于 (d) => d.id。默认值为数组索引。对于简单数组(字符串/数字),可以使用默认值。但对于对象数组,必须指定合适的 keygen 以避免错误。如果不指定 keygen,组件会将整个对象作为 key,当 renderItem 默认为 (d) => d 时,会导致将对象直接渲染到 DOM 中,引发 React 渲染错误。
|
|
167
173
|
* @default index
|
|
174
|
+
* @when Always required for object arrays; optional for primitive arrays
|
|
168
175
|
*/
|
|
169
176
|
keygen: KeygenType<DataItem>;
|
|
170
177
|
/**
|
|
171
|
-
* @en
|
|
172
|
-
* @cn
|
|
178
|
+
* @en The selected value(s). In Form context, this prop is managed by Form. Note: Do not use undefined or null as meaningful option values - the component will skip processing when value is undefined/null
|
|
179
|
+
* @cn 选中的值。在表单中使用时,此属性由表单管理。注意:请勿使用 undefined 或 null 作为有效选项值,当 value 为 undefined/null 时组件将跳过处理
|
|
173
180
|
* @override any
|
|
181
|
+
* @when For controlled component usage; omit when used inside Form
|
|
174
182
|
*/
|
|
175
183
|
value?: Value;
|
|
176
184
|
/**
|
|
177
|
-
* @en
|
|
178
|
-
* @cn
|
|
185
|
+
* @en Shows a clear icon to remove all selected values when enabled
|
|
186
|
+
* @cn 启用时显示清除图标,可一键清空所有选中值
|
|
179
187
|
* @default false
|
|
188
|
+
* @when When users need ability to quickly clear selection
|
|
180
189
|
*/
|
|
181
190
|
clearable?: boolean;
|
|
182
191
|
/**
|
|
183
|
-
* @en Placeholder text
|
|
184
|
-
* @cn
|
|
192
|
+
* @en Placeholder text displayed when no option is selected
|
|
193
|
+
* @cn 未选择任何选项时显示的占位文本
|
|
194
|
+
* @when To provide hint text when select is empty
|
|
185
195
|
*/
|
|
186
196
|
placeholder?: string;
|
|
187
197
|
/**
|
|
188
|
-
* @en
|
|
189
|
-
* @cn
|
|
198
|
+
* @en Loading state indicator. Shows default Spin component when true, or accepts custom loading component
|
|
199
|
+
* @cn 加载状态指示器。为 true 时显示默认的 Spin 组件,也可传入自定义加载组件
|
|
190
200
|
* @override boolean | ReactNode
|
|
191
201
|
* @default false
|
|
202
|
+
* @when When fetching data asynchronously or during search operations
|
|
192
203
|
*/
|
|
193
204
|
loading?: boolean | React.ReactNode;
|
|
194
205
|
/**
|
|
195
|
-
* @en Custom
|
|
196
|
-
* @cn
|
|
206
|
+
* @en Custom content rendered at the top of the dropdown list
|
|
207
|
+
* @cn 自定义下拉列表顶部内容
|
|
208
|
+
* @when To display instructions, filters, or actions above options
|
|
197
209
|
*/
|
|
198
210
|
header?: React.ReactNode;
|
|
199
211
|
/**
|
|
200
|
-
* @en Custom
|
|
201
|
-
* @cn
|
|
212
|
+
* @en Custom content rendered at the bottom of the dropdown list
|
|
213
|
+
* @cn 自定义下拉列表底部内容
|
|
214
|
+
* @when To display summary, actions, or load more button below options
|
|
202
215
|
*/
|
|
203
216
|
footer?: React.ReactNode;
|
|
204
217
|
/**
|
|
205
|
-
* @
|
|
206
|
-
* @
|
|
218
|
+
* @en Custom render function for the entire dropdown list content. The first parameter `list` contains the pre-rendered option list (including virtual scrolling, columns layout if configured). The second parameter `info` contains: `loading` - current loading state, which can be boolean (shows default spinner when true) or custom ReactNode. Note: When using this prop with emptyText, set emptyText to false to fully control empty state rendering
|
|
219
|
+
* @cn 自定义渲染整个下拉列表内容。第一个参数 `list` 包含预渲染的选项列表(包括虚拟滚动、多列布局等)。第二个参数 `info` 包含:`loading` - 当前加载状态,可为 boolean(true 时显示默认加载动画)或自定义 ReactNode。注意:与 emptyText 配合使用时,将 emptyText 设为 false 可完全控制空状态渲染
|
|
220
|
+
* @when For complete control over dropdown content (e.g., custom wrapper, animations, additional UI elements around the option list)
|
|
207
221
|
*/
|
|
208
222
|
renderOptionList?: (list: React.ReactNode, info: {
|
|
209
223
|
loading?: boolean | React.ReactNode;
|
|
210
224
|
}) => React.ReactNode;
|
|
211
225
|
/**
|
|
212
|
-
* @
|
|
213
|
-
* @
|
|
226
|
+
* @en Controls whether to display the select box border
|
|
227
|
+
* @cn 控制是否显示选择框边框
|
|
214
228
|
* @default true
|
|
229
|
+
* @when Set to false for borderless design or custom styling
|
|
215
230
|
*/
|
|
216
231
|
border?: boolean;
|
|
217
232
|
/**
|
|
218
|
-
* @en
|
|
219
|
-
* @cn
|
|
233
|
+
* @en Shows only the bottom border for a minimal underline style
|
|
234
|
+
* @cn 仅显示底部边框,呈现下划线样式
|
|
220
235
|
* @default false
|
|
236
|
+
* @when For minimal UI design or form-like appearance
|
|
221
237
|
*/
|
|
222
238
|
underline?: boolean;
|
|
223
239
|
/**
|
|
224
|
-
* @en
|
|
225
|
-
* @cn
|
|
240
|
+
* @en Controls the visibility of the dropdown list programmatically
|
|
241
|
+
* @cn 程序化控制下拉列表的显示/隐藏状态
|
|
242
|
+
* @when For controlled dropdown state or custom trigger logic
|
|
226
243
|
*/
|
|
227
244
|
open?: boolean;
|
|
228
245
|
/**
|
|
229
|
-
* @
|
|
230
|
-
* @
|
|
246
|
+
* @en Width of the select input box. Accepts number (px) or string with units
|
|
247
|
+
* @cn 选择框的宽度。可接受数字(像素)或带单位的字符串
|
|
248
|
+
* @when To set fixed width instead of default auto-sizing
|
|
231
249
|
*/
|
|
232
250
|
width?: number | string;
|
|
233
251
|
/**
|
|
234
|
-
* @
|
|
235
|
-
* @
|
|
252
|
+
* @en Maximum height of the dropdown list. Accepts number (px) or string with units
|
|
253
|
+
* @cn 下拉列表的最大高度。可接受数字(像素)或带单位的字符串
|
|
254
|
+
* @when To limit dropdown height when many options exist
|
|
236
255
|
*/
|
|
237
256
|
height?: number | string;
|
|
238
257
|
/**
|
|
239
|
-
* @
|
|
240
|
-
* @
|
|
258
|
+
* @en Width of the dropdown list. Accepts number (px) or string with units
|
|
259
|
+
* @cn 下拉列表的宽度。可接受数字(像素)或带单位的字符串
|
|
241
260
|
* @default 100%
|
|
261
|
+
* @when When dropdown needs different width than select input
|
|
242
262
|
*/
|
|
243
263
|
optionWidth?: number | string;
|
|
244
264
|
/**
|
|
245
|
-
* @en
|
|
246
|
-
* @cn
|
|
265
|
+
* @en Maximum number of options rendered at once. Uses virtual scrolling for performance with large datasets. Increase if you need to display more than 10 visible items
|
|
266
|
+
* @cn 一次渲染的最大选项数。使用虚拟滚动优化大数据集性能。如需显示超过 10 个可见项,请调整此值
|
|
247
267
|
* @default 10
|
|
268
|
+
* @when Increase when dropdown height shows more than 10 items
|
|
248
269
|
*/
|
|
249
270
|
itemsInView?: number;
|
|
250
271
|
/**
|
|
251
|
-
* @en
|
|
252
|
-
* @cn
|
|
272
|
+
* @en Height of each option item. For fixed-height content, set a number. Use 'auto' for dynamic heights based on content (may impact performance with large datasets)
|
|
273
|
+
* @cn 每个选项的高度。固定高度内容请设置数字;设为 'auto' 则根据内容自适应高度(大数据集时可能影响性能)
|
|
253
274
|
* @default 32
|
|
254
|
-
* @version 3.4.0
|
|
275
|
+
* @version 3.4.0 added 'auto' mode
|
|
276
|
+
* @when Set number for consistent height items; 'auto' for variable content
|
|
255
277
|
*/
|
|
256
278
|
lineHeight?: number | 'auto';
|
|
257
279
|
/**
|
|
258
|
-
* @en
|
|
259
|
-
* @cn
|
|
280
|
+
* @en Dropdown list placement position. 'auto' adjusts based on available space
|
|
281
|
+
* @cn 下拉列表弹出位置。'auto' 会根据可用空间自动调整
|
|
260
282
|
* @default auto
|
|
283
|
+
* @when Override auto positioning for specific layout requirements
|
|
261
284
|
*/
|
|
262
285
|
position?: 'auto' | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
263
286
|
/**
|
|
264
|
-
* @en
|
|
265
|
-
* @cn
|
|
287
|
+
* @en Number of columns to display options. Values > 1 enable multi-column layout
|
|
288
|
+
* @cn 选项显示的列数。大于 1 时启用多列布局模式
|
|
266
289
|
* @default 1
|
|
290
|
+
* @when When many short options need better space utilization
|
|
267
291
|
*/
|
|
268
292
|
columns?: number;
|
|
269
293
|
/**
|
|
270
|
-
* @en Title
|
|
271
|
-
* @cn
|
|
294
|
+
* @en Title displayed above columns in multi-column multi-select mode
|
|
295
|
+
* @cn 多列多选模式下,列顶部显示的标题
|
|
296
|
+
* @when Using multi-column layout with multiple selection
|
|
272
297
|
*/
|
|
273
298
|
columnsTitle?: React.ReactNode;
|
|
274
299
|
/**
|
|
275
|
-
* @en
|
|
276
|
-
* @cn
|
|
300
|
+
* @en Disables value-to-data caching. By default, Select caches the mapping between values and data items for performance. When data changes frequently, set this to true to ensure the component always uses the latest data
|
|
301
|
+
* @cn 禁用值与数据项的缓存。默认情况下,Select 会缓存 value 对应的 data 项以优化性能。当 data 频繁变化时,建议设为 true 以确保组件始终使用最新数据
|
|
277
302
|
* @default false
|
|
303
|
+
* @when When data updates frequently or dynamically
|
|
278
304
|
*/
|
|
279
305
|
noCache?: boolean;
|
|
280
306
|
/**
|
|
281
|
-
* @en
|
|
282
|
-
* @cn
|
|
307
|
+
* @en Shows dropdown arrow icon (single select only)
|
|
308
|
+
* @cn 显示下拉箭头图标(仅单选模式)
|
|
283
309
|
* @default true
|
|
310
|
+
* @when Set to false for cleaner appearance or custom icon
|
|
284
311
|
*/
|
|
285
312
|
showArrow?: boolean;
|
|
286
313
|
/**
|
|
287
|
-
* @en
|
|
288
|
-
* @cn
|
|
314
|
+
* @en In multi-select with filter, whether to select the filter text after clicking an option
|
|
315
|
+
* @cn 多选模式下启用过滤时,点击选项后是否选中过滤输入框中的文本
|
|
289
316
|
* @default true
|
|
317
|
+
* @when Set to false to preserve filter text after selection
|
|
290
318
|
*/
|
|
291
319
|
focusSelected?: boolean;
|
|
292
320
|
/**
|
|
293
|
-
* @en
|
|
294
|
-
* @cn
|
|
321
|
+
* @en Automatically removes leading/trailing whitespace from input on blur
|
|
322
|
+
* @cn 失去焦点时自动删除输入内容的首尾空白字符
|
|
295
323
|
* @default false
|
|
324
|
+
* @when For cleaner data when users may accidentally input spaces
|
|
296
325
|
*/
|
|
297
326
|
trim?: boolean;
|
|
298
327
|
/**
|
|
299
|
-
* @en
|
|
300
|
-
* @cn columns
|
|
328
|
+
* @en Width of each column in multi-column layout (only when columns > 1)
|
|
329
|
+
* @cn 多列布局中每列的宽度(仅在 columns > 1 时生效)
|
|
301
330
|
* @default 160
|
|
331
|
+
* @when Adjust based on option content length in multi-column mode
|
|
302
332
|
*/
|
|
303
333
|
columnWidth?: number;
|
|
304
334
|
/**
|
|
305
|
-
* @en
|
|
306
|
-
* @cn
|
|
335
|
+
* @en Maximum character length allowed in the filter input
|
|
336
|
+
* @cn 过滤输入框允许输入的最大字符数
|
|
337
|
+
* @when To limit filter/create input length
|
|
307
338
|
*/
|
|
308
339
|
maxLength?: number;
|
|
309
340
|
/**
|
|
310
|
-
* @en
|
|
311
|
-
* @cn
|
|
341
|
+
* @en In multi-select mode, joins selected values into a string using this separator
|
|
342
|
+
* @cn 多选模式下,使用此分隔符将选中值连接成字符串
|
|
343
|
+
* @when When backend expects comma-separated or other delimited string
|
|
312
344
|
*/
|
|
313
345
|
separator?: string;
|
|
314
346
|
/**
|
|
315
|
-
* @en
|
|
316
|
-
* @cn
|
|
347
|
+
* @en Auto-adjusts dropdown width based on content
|
|
348
|
+
* @cn 下拉列表宽度根据内容自动调整
|
|
317
349
|
* @default false
|
|
350
|
+
* @when When option content varies significantly in width
|
|
318
351
|
*/
|
|
319
352
|
autoAdapt?: boolean;
|
|
320
353
|
/**
|
|
321
|
-
* @en
|
|
322
|
-
* @cn
|
|
354
|
+
* @en Compresses multiple selected items display. true: dynamically calculates and shows '+N' based on container width; 'no-repeat': same as true but hides already selected items from popover; 'hide-popover': shows '+N' without popover
|
|
355
|
+
* @cn 压缩多选项显示。true: 根据容器宽度动态计算并显示 '+N';'no-repeat': 与 true 相同但弹出框中不重复显示已选项;'hide-popover': 仅显示 '+N' 不显示弹出框
|
|
323
356
|
* @default false
|
|
357
|
+
* @when When multiple selections may exceed container width
|
|
324
358
|
*/
|
|
325
359
|
compressed?: boolean | 'no-repeat' | 'hide-popover';
|
|
326
360
|
/**
|
|
327
|
-
* @en
|
|
328
|
-
* @cn
|
|
361
|
+
* @en Fixed number of tags to display before showing '+N'. When set, always shows this many tags regardless of container width. This provides better performance for large datasets as it avoids expensive DOM calculations
|
|
362
|
+
* @cn 固定显示的标签数量,超出部分显示 '+N'。设置后将始终显示指定数量的标签,不再根据容器宽度动态计算。对于大数据集,推荐设置此属性以避免昂贵的 DOM 计算,提升性能
|
|
363
|
+
* @when With compressed mode and many selections for better performance
|
|
329
364
|
*/
|
|
330
365
|
compressedBound?: number;
|
|
331
366
|
/**
|
|
332
|
-
* @en
|
|
333
|
-
* @cn
|
|
367
|
+
* @en CSS class name for the compressed items popover
|
|
368
|
+
* @cn 压缩项弹出框的 CSS 类名
|
|
369
|
+
* @when To style the compressed items popover
|
|
334
370
|
*/
|
|
335
371
|
compressedClassName?: string;
|
|
336
372
|
/**
|
|
337
|
-
* @en Custom render compressed
|
|
338
|
-
* @cn
|
|
373
|
+
* @en Custom render function for compressed items display
|
|
374
|
+
* @cn 自定义渲染压缩/折叠项的显示内容
|
|
339
375
|
* @version 3.5.0
|
|
376
|
+
* @when To customize the '+N' display or compressed content
|
|
340
377
|
*/
|
|
341
378
|
renderCompressed?: (options: RenderCompressedOption<DataItem>) => React.ReactNode;
|
|
342
379
|
/**
|
|
343
|
-
* @en
|
|
344
|
-
* @cn
|
|
380
|
+
* @en Hides the create option from the dropdown list. Press Enter to select the created value directly
|
|
381
|
+
* @cn 从下拉列表中隐藏创建选项。按回车键直接选中创建的值
|
|
345
382
|
* @default false
|
|
383
|
+
* @when With onCreate for cleaner UI when creating is primary action
|
|
346
384
|
*/
|
|
347
385
|
hideCreateOption?: boolean;
|
|
348
386
|
/**
|
|
349
|
-
* @en
|
|
350
|
-
* @cn
|
|
387
|
+
* @en Auto-selects the only matching option on blur when filtering returns single result
|
|
388
|
+
* @cn 过滤结果仅剩一个选项时,失焦自动选中该选项(仅在启用过滤时有效)
|
|
351
389
|
* @default false
|
|
390
|
+
* @when For better UX when users expect single match to be selected
|
|
352
391
|
*/
|
|
353
392
|
filterSingleSelect?: boolean;
|
|
354
393
|
/**
|
|
355
|
-
* @en
|
|
356
|
-
* @cn
|
|
394
|
+
* @en Initially expanded node keys for tree data (uncontrolled)
|
|
395
|
+
* @cn 树形数据中默认展开的节点 key 值(非受控)
|
|
357
396
|
* @override (string | number)[]
|
|
397
|
+
* @when With treeData to show specific nodes expanded initially
|
|
358
398
|
*/
|
|
359
399
|
defaultExpanded?: KeygenResult[];
|
|
360
400
|
/**
|
|
361
|
-
* @en
|
|
362
|
-
* @cn
|
|
401
|
+
* @en Initially expands all tree nodes (tree data only)
|
|
402
|
+
* @cn 初始展开所有树节点(仅树形数据有效)
|
|
363
403
|
* @default false
|
|
404
|
+
* @when For small tree datasets where all nodes should be visible
|
|
364
405
|
*/
|
|
365
406
|
defaultExpandAll?: boolean;
|
|
366
407
|
/**
|
|
367
|
-
* @en
|
|
368
|
-
* @cn
|
|
408
|
+
* @en Controlled expanded node keys for tree data
|
|
409
|
+
* @cn 树形数据中展开的节点 key 值(受控)
|
|
369
410
|
* @override (string | number)[]
|
|
411
|
+
* @when For controlled tree expansion state
|
|
370
412
|
*/
|
|
371
413
|
expanded?: KeygenResult[];
|
|
372
414
|
/**
|
|
373
|
-
* @en
|
|
374
|
-
* @cn
|
|
415
|
+
* @en Shows descendant nodes of matched items when filtering tree data
|
|
416
|
+
* @cn 过滤树形数据时,显示匹配项的所有子节点
|
|
375
417
|
* @default false
|
|
418
|
+
* @when To keep parent-child context visible during search
|
|
376
419
|
*/
|
|
377
420
|
showHitDescendants?: boolean;
|
|
378
421
|
/**
|
|
379
|
-
* @
|
|
380
|
-
* @
|
|
422
|
+
* @en Converts line breaks when pasting text. String replaces breaks; function transforms the text
|
|
423
|
+
* @cn 粘贴文本时转换换行符。字符串用于替换换行;函数用于转换文本
|
|
381
424
|
* @default " "
|
|
425
|
+
* @when When pasting multi-line content with onCreate
|
|
382
426
|
*/
|
|
383
427
|
convertBr?: string | ((text: string) => string);
|
|
384
428
|
/**
|
|
385
|
-
* @en
|
|
386
|
-
* @cn
|
|
429
|
+
* @en CSS class name for selected item display. Can be string or function returning class based on value
|
|
430
|
+
* @cn 选中项显示容器的 CSS 类名。可为字符串或基于值返回类名的函数
|
|
431
|
+
* @when To style selected items differently based on value
|
|
387
432
|
*/
|
|
388
433
|
resultClassName?: ((value: DataItem) => string) | string;
|
|
389
434
|
/**
|
|
390
|
-
* @en
|
|
391
|
-
* @cn
|
|
435
|
+
* @en Renders each option in dropdown. String uses property value; function customizes display
|
|
436
|
+
* @cn 渲染下拉列表中的每个选项。字符串使用属性值;函数自定义显示
|
|
392
437
|
* @default d => d
|
|
438
|
+
* @when To display complex option content or specific property
|
|
393
439
|
*/
|
|
394
440
|
renderItem?: ((data: DataItem, index?: number) => React.ReactNode) | ObjectKey<DataItem>;
|
|
395
441
|
/**
|
|
396
|
-
* @en
|
|
397
|
-
* @cn
|
|
442
|
+
* @en Renders selected items display. Falls back to renderItem if not specified
|
|
443
|
+
* @cn 渲染选中项的显示内容。未指定时使用 renderItem
|
|
398
444
|
* @default renderItem
|
|
445
|
+
* @when When selected display differs from dropdown display
|
|
399
446
|
*/
|
|
400
447
|
renderResult?: (data: DataItem, index?: number) => React.ReactNode;
|
|
401
448
|
/**
|
|
402
|
-
* @en
|
|
403
|
-
* @cn
|
|
449
|
+
* @en Custom render for values that don't match any option in data
|
|
450
|
+
* @cn 自定义渲染数据中不存在的值
|
|
451
|
+
* @when When value might not exist in current data (e.g., async loading)
|
|
404
452
|
*/
|
|
405
453
|
renderUnmatched?: (value: Value extends (infer U)[] ? U : Value) => React.ReactNode;
|
|
406
454
|
/**
|
|
407
|
-
* @en
|
|
408
|
-
* @cn
|
|
455
|
+
* @en Triggered when the select loses focus
|
|
456
|
+
* @cn 选择框失去焦点时触发
|
|
457
|
+
* @when For form validation or saving draft selections
|
|
409
458
|
*/
|
|
410
459
|
onBlur?: (e: any) => void;
|
|
411
460
|
/**
|
|
412
|
-
* @en
|
|
413
|
-
* @cn
|
|
461
|
+
* @en Triggered when the select receives focus
|
|
462
|
+
* @cn 选择框获得焦点时触发
|
|
463
|
+
* @when To load data, show hints, or track analytics
|
|
414
464
|
*/
|
|
415
465
|
onFocus?: (e: any) => void;
|
|
416
466
|
/**
|
|
417
|
-
* @en
|
|
418
|
-
* @cn
|
|
467
|
+
* @en Enables filtering. Return a function for client-side filtering, or undefined for server-side filtering
|
|
468
|
+
* @cn 启用过滤功能。返回函数用于前端过滤,返回 undefined 用于后端过滤
|
|
469
|
+
* @when For searchable select or large datasets
|
|
419
470
|
*/
|
|
420
471
|
onFilter?: (text: string, from?: string) => ((data: DataItem) => boolean) | void | undefined;
|
|
421
472
|
/**
|
|
422
|
-
* @en
|
|
423
|
-
* @cn
|
|
473
|
+
* @en Creates new options from input. true uses input as-is; function transforms input into option
|
|
474
|
+
* @cn 从输入创建新选项。true 直接使用输入值;函数将输入转换为选项
|
|
475
|
+
* @when For tags input or allowing custom values
|
|
424
476
|
*/
|
|
425
477
|
onCreate?: ((input: string | DataItem) => DataItem | string) | boolean;
|
|
426
478
|
/**
|
|
427
|
-
* @en
|
|
428
|
-
* @cn
|
|
479
|
+
* @en Called when Enter key is pressed to expand dropdown. Return false to prevent expansion
|
|
480
|
+
* @cn 按回车键展开下拉框时调用。返回 false 阻止展开
|
|
481
|
+
* @when To customize Enter key behavior
|
|
429
482
|
*/
|
|
430
483
|
onEnterExpand?: (e: React.KeyboardEvent<HTMLDivElement>) => boolean;
|
|
431
484
|
/**
|
|
432
|
-
* @en
|
|
433
|
-
* @cn
|
|
485
|
+
* @en Triggered when dropdown opens or closes. Parameter indicates collapsed state
|
|
486
|
+
* @cn 下拉框打开/关闭时触发。参数表示是否收起状态
|
|
487
|
+
* @when To sync UI state or load data on open
|
|
434
488
|
*/
|
|
435
489
|
onCollapse?: (collapse: boolean) => void;
|
|
436
490
|
/**
|
|
437
|
-
* @en
|
|
438
|
-
* @cn
|
|
491
|
+
* @en Triggered when tree nodes expand/collapse. Receives array of expanded node keys
|
|
492
|
+
* @cn 树节点展开/收起时触发。接收展开节点的 key 数组
|
|
493
|
+
* @when For controlled tree expansion or tracking state
|
|
439
494
|
*/
|
|
440
495
|
onExpand?: (value: KeygenResult[]) => void;
|
|
441
496
|
/**
|
|
@@ -443,65 +498,89 @@ export interface SelectPropsBase<DataItem, Value> extends Omit<BaseSelectProps<D
|
|
|
443
498
|
* @cn 新增 api ,开启 onFilter 和 onCreate 时,用于比对是否已经存在相同的数据,默认用输入的值和 keygen 值比对
|
|
444
499
|
*/
|
|
445
500
|
/**
|
|
446
|
-
* @en
|
|
447
|
-
* @cn
|
|
501
|
+
* @en Clears filter input after selecting an option
|
|
502
|
+
* @cn 选中选项后清空过滤输入框
|
|
448
503
|
* @default false
|
|
504
|
+
* @when For better UX in searchable multi-select
|
|
449
505
|
*/
|
|
450
506
|
emptyAfterSelect?: boolean;
|
|
451
507
|
/**
|
|
452
|
-
* @en
|
|
453
|
-
* @cn
|
|
508
|
+
* @en Debounce delay (ms) for filter input
|
|
509
|
+
* @cn 过滤输入的防抖延迟(毫秒)
|
|
454
510
|
* @default 400
|
|
511
|
+
* @when Adjust for server-side filtering or performance
|
|
455
512
|
*/
|
|
456
513
|
filterDelay?: number;
|
|
457
514
|
/**
|
|
458
|
-
* @en
|
|
459
|
-
* @cn
|
|
515
|
+
* @en Loads children dynamically for tree nodes. Nodes without children trigger loader on expand
|
|
516
|
+
* @cn 动态加载树节点子级。无 children 的节点展开时触发加载
|
|
517
|
+
* @when For lazy-loading large tree structures
|
|
460
518
|
*/
|
|
461
519
|
loader?: (key: KeygenResult, data: DataItem) => void;
|
|
462
520
|
/**
|
|
463
|
-
* @en
|
|
464
|
-
* @cn
|
|
521
|
+
* @en Advanced filter mode allowing toggle between filtered results and original data at current level
|
|
522
|
+
* @cn 高级过滤模式,允许在当前层级的过滤结果和原始数据间切换
|
|
523
|
+
* @when For complex filtering scenarios with toggle capability
|
|
465
524
|
*/
|
|
466
525
|
onAdvancedFilter?: (text: string) => (data: DataItem) => boolean;
|
|
467
526
|
/**
|
|
468
|
-
* @en
|
|
469
|
-
* @cn
|
|
527
|
+
* @en Auto-focuses filter input after selecting when filter and create are enabled
|
|
528
|
+
* @cn 启用过滤和创建功能时,选中选项后自动聚焦输入框
|
|
470
529
|
* @default false
|
|
530
|
+
* @when For continuous input in filter+create mode
|
|
471
531
|
*/
|
|
472
532
|
reFocus?: boolean;
|
|
473
533
|
/**
|
|
474
|
-
* @en
|
|
475
|
-
* @cn
|
|
534
|
+
* @en Auto-adjusts dropdown position when blocked by viewport edges
|
|
535
|
+
* @cn 下拉框被视口边缘遮挡时自动调整位置
|
|
476
536
|
* @default true
|
|
537
|
+
* @when Set to false for fixed positioning requirements
|
|
477
538
|
*/
|
|
478
539
|
adjust?: boolean;
|
|
479
540
|
/**
|
|
480
|
-
* @en
|
|
481
|
-
* @cn
|
|
541
|
+
* @en Triggered when scrolling to bottom of dropdown list for infinite scrolling
|
|
542
|
+
* @cn 滚动到下拉列表底部时触发,用于无限滚动加载
|
|
482
543
|
* @version 3.4.0
|
|
544
|
+
* @when For pagination or lazy-loading large datasets
|
|
483
545
|
*/
|
|
484
546
|
onLoadMore?: () => void | Promise<any>;
|
|
485
547
|
/**
|
|
486
|
-
* @en
|
|
487
|
-
* @cn
|
|
548
|
+
* @en Scroll threshold (0-1) for triggering onLoadMore. 1 means bottom of list
|
|
549
|
+
* @cn 触发 onLoadMore 的滚动阈值(0-1)。1 表示列表底部
|
|
488
550
|
* @default 1
|
|
489
551
|
* @version 3.4.0
|
|
552
|
+
* @when Set lower to preload before reaching bottom
|
|
490
553
|
*/
|
|
491
554
|
threshold?: number;
|
|
492
555
|
/**
|
|
493
|
-
* @
|
|
494
|
-
* @
|
|
556
|
+
* @en Trigger mode for opening dropdown
|
|
557
|
+
* @cn 打开下拉框的触发方式
|
|
495
558
|
* @default 'click'
|
|
496
559
|
* @version 3.4.0
|
|
560
|
+
* @when Use 'hover' for quick preview scenarios
|
|
497
561
|
*/
|
|
498
562
|
trigger?: 'click' | 'hover';
|
|
499
563
|
/**
|
|
500
|
-
* @
|
|
501
|
-
* @
|
|
564
|
+
* @en Highlights matching text when filtering
|
|
565
|
+
* @cn 过滤时高亮匹配的文本
|
|
502
566
|
* @version 3.7.0
|
|
567
|
+
* @when To visually indicate search matches
|
|
503
568
|
*/
|
|
504
569
|
highlight?: boolean;
|
|
570
|
+
/**
|
|
571
|
+
* @en Whether to prevent selecting existing options when pressing Enter while onCreate is enabled
|
|
572
|
+
* @cn 开启 onCreate 时,是否阻止回车选中已有选项,仅创建选项
|
|
573
|
+
* @default false
|
|
574
|
+
* @version 3.8.0
|
|
575
|
+
*/
|
|
576
|
+
preventEnterSelect?: boolean;
|
|
577
|
+
/**
|
|
578
|
+
* @en Triggered when clearing the selected value
|
|
579
|
+
* @cn 清除选中值时触发
|
|
580
|
+
* @version 3.8.0
|
|
581
|
+
* @when For custom clearing behavior
|
|
582
|
+
*/
|
|
583
|
+
onClear?: () => void;
|
|
505
584
|
}
|
|
506
585
|
export interface SelectPropsA<DataItem, Value> extends Omit<SelectPropsBase<DataItem, Value>, 'treeData' | 'childrenKey'> {
|
|
507
586
|
/**
|