diff --git a/db/TDesign.db b/db/TDesign.db index 1b6879e08..30393765f 100644 Binary files a/db/TDesign.db and b/db/TDesign.db differ diff --git a/packages/products/tdesign-vue/src/select/option-group-props.ts b/packages/products/tdesign-vue/src/select/option-group-props.ts index dac9dc9ec..203980472 100644 --- a/packages/products/tdesign-vue/src/select/option-group-props.ts +++ b/packages/products/tdesign-vue/src/select/option-group-props.ts @@ -4,6 +4,9 @@ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ +import { TdOptionGroupProps } from '../select/type'; +import { PropType } from 'vue'; + export default { /** 是否显示分隔线 */ divider: { @@ -12,7 +15,6 @@ export default { }, /** 分组别名 */ label: { - type: String, - default: '', + type: [String, Function] as PropType, }, }; diff --git a/packages/products/tdesign-vue/src/select/select.en-US.md b/packages/products/tdesign-vue/src/select/select.en-US.md index 6a2357eda..2fa367038 100644 --- a/packages/products/tdesign-vue/src/select/select.en-US.md +++ b/packages/products/tdesign-vue/src/select/select.en-US.md @@ -1,7 +1,6 @@ :: BASE_DOC :: ## API - ### Select Props name | type | default | description | required @@ -10,57 +9,57 @@ autoWidth | Boolean | false | \- | N autofocus | Boolean | false | \- | N borderless | Boolean | false | \- | N clearable | Boolean | false | \- | N -collapsedItems | Slot / Function | - | Typescript:`TNode<{ value: T[]; collapsedSelectedItems: T[]; count: number; onClose: (context: { index: number, e?: MouseEvent }) => void }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +collapsedItems | Slot / Function | - | Typescript: `TNode<{ value: T[]; collapsedSelectedItems: T[]; count: number; onClose: (context: { index: number, e?: MouseEvent }) => void }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N creatable | Boolean | false | \- | N disabled | Boolean | undefined | \- | N -empty | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -filter | Function | - | Typescript:`(filterWords: string, option: T) => boolean \| Promise` | N +empty | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +filter | Function | - | Typescript: `(filterWords: string, option: T) => boolean \| Promise` | N filterable | Boolean | false | \- | N -inputProps | Object | - | Typescript:`InputProps`,[Input API Documents](./input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N -inputValue | String / Number | - | input value。`.sync` is supported。Typescript:`string` | N -defaultInputValue | String / Number | - | input value。uncontrolled property。Typescript:`string` | N -keys | Object | - | alias option field。Typescript:`SelectKeysType` `interface SelectKeysType { value?: string \| ((option: SelectOption) => string); label?: string \| ((option: SelectOption) => string); disabled?: string }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N -label | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +inputProps | Object | - | Typescript: `InputProps`,[Input API Documents](./input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +inputValue | String / Number | - | input value。`.sync` is supported。Typescript: `string` | N +defaultInputValue | String / Number | - | input value。uncontrolled property。Typescript: `string` | N +keys | Object | - | alias option field。Typescript: `SelectKeysType` `interface SelectKeysType { value?: string \| ((option: SelectOption) => string); label?: string \| ((option: SelectOption) => string); disabled?: string }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +label | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N loading | Boolean | false | \- | N -loadingText | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +loadingText | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N max | Number | 0 | \- | N minCollapsedNum | Number | 0 | \- | N multiple | Boolean | false | \- | N -options | Array | - | Typescript:`Array` | N -optionsLayout | String | 'vertical' | layout of options in popup。Typescript:`'vertical' \| 'horizontal'` | N -panelBottomContent | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -panelTopContent | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +options | Array | - | Typescript: `Array` | N +optionsLayout | String | 'vertical' | layout of options in popup。Typescript: `'vertical' \| 'horizontal'` | N +panelBottomContent | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +panelTopContent | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N placeholder | String | undefined | \- | N -popupProps | Object | - | Typescript:`PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +popupProps | Object | - | Typescript: `PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N popupVisible | Boolean | - | `.sync` is supported | N defaultPopupVisible | Boolean | - | uncontrolled property | N -prefixIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +prefixIcon | Slot / Function | - | Typescript: `TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N readonly | Boolean | undefined | \- | N reserveKeyword | Boolean | false | \- | N -scroll | Object | - | lazy load and virtual scroll。Typescript:`TScroll`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -selectInputProps | Object | - | Typescript:`SelectInputProps`,[SelectInput API Documents](./select-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +scroll | Object | - | lazy load and virtual scroll。Typescript: `TScroll`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +selectInputProps | Object | - | Typescript: `SelectInputProps`,[SelectInput API Documents](./select-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N showArrow | Boolean | true | \- | N -size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +size | String | medium | options: small/medium/large。Typescript: `SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N status | String | default | options: default/success/warning/error | N -suffix | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -suffixIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -tagInputProps | Object | - | Typescript:`TagInputProps`,[TagInput API Documents](./tag-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N -tagProps | Object | - | Typescript:`TagProps`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N -tips | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -value | String / Number / Boolean / Object / Array | - | `v-model` is supported。Typescript:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N -defaultValue | String / Number / Boolean / Object / Array | - | uncontrolled property。Typescript:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N -valueDisplay | String / Slot / Function | - | `MouseEvent`。Typescript:`string \| TNode<{ value: SelectValue; onClose: (index: number) => void; displayValue?: SelectValue; label?: string }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +suffix | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +suffixIcon | Slot / Function | - | Typescript: `TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +tagInputProps | Object | - | Typescript: `TagInputProps`,[TagInput API Documents](./tag-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +tagProps | Object | - | Typescript: `TagProps`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +tips | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +value | String / Number / Boolean / Object / Array | - | `v-model` is supported。Typescript: `SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +defaultValue | String / Number / Boolean / Object / Array | - | uncontrolled property。Typescript: `SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +valueDisplay | String / Slot / Function | - | `MouseEvent`。Typescript: `string \| TNode<{ value: SelectValue; onClose: (index: number) => void; displayValue?: SelectValue; label?: string }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N valueType | String | value | options: value/object | N -onBlur | Function | | Typescript:`(context: { value: SelectValue; e: FocusEvent \| KeyboardEvent }) => void`
| N -onChange | Function | | Typescript:`(value: SelectValue, context: { option?: T, selectedOptions: T[], trigger: SelectValueChangeTrigger; e?: MouseEvent \| KeyboardEvent }) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts)。
`type SelectValueChangeTrigger = 'clear' \| 'tag-remove' \| 'backspace' \| 'check' \| 'uncheck' \| 'default'`
| N -onClear | Function | | Typescript:`(context: { e: MouseEvent }) => void`
| N -onCreate | Function | | Typescript:`(value: string \| number \| boolean) => void`
| N -onEnter | Function | | Typescript:`(context: { inputValue: string; e: KeyboardEvent; value: SelectValue }) => void`
| N -onFocus | Function | | Typescript:`(context: { value: SelectValue; e: FocusEvent \| KeyboardEvent }) => void`
| N -onInputChange | Function | | Typescript:`(value: string, context?: SelectInputValueChangeContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts)。
`import { SelectInputValueChangeContext } from '@SelectInput'`
| N -onPopupVisibleChange | Function | | Typescript:`(visible: boolean, context: PopupVisibleChangeContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts)。
`import { PopupVisibleChangeContext } from '@Popup'`
| N -onRemove | Function | | Typescript:`(options: SelectRemoveContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts)。
`interface SelectRemoveContext { value: string \| number; data: T; e: MouseEvent \| KeyboardEvent }`
| N -onSearch | Function | | Typescript:`(filterWords: string, context: { e: KeyboardEvent }) => void`
| N +onBlur | Function | | Typescript: `(context: { value: SelectValue; e: FocusEvent \| KeyboardEvent }) => void`
| N +onChange | Function | | Typescript: `(value: SelectValue, context: { option?: T, selectedOptions: T[], trigger: SelectValueChangeTrigger; e?: MouseEvent \| KeyboardEvent }) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts)。
`type SelectValueChangeTrigger = 'clear' \| 'tag-remove' \| 'backspace' \| 'check' \| 'uncheck' \| 'default'`
| N +onClear | Function | | Typescript: `(context: { e: MouseEvent }) => void`
| N +onCreate | Function | | Typescript: `(value: string \| number \| boolean) => void`
| N +onEnter | Function | | Typescript: `(context: { inputValue: string; e: KeyboardEvent; value: SelectValue }) => void`
| N +onFocus | Function | | Typescript: `(context: { value: SelectValue; e: FocusEvent \| KeyboardEvent }) => void`
| N +onInputChange | Function | | Typescript: `(value: string, context?: SelectInputValueChangeContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts)。
`import { SelectInputValueChangeContext } from '@SelectInput'`
| N +onPopupVisibleChange | Function | | Typescript: `(visible: boolean, context: PopupVisibleChangeContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts)。
`import { PopupVisibleChangeContext } from '@Popup'`
| N +onRemove | Function | | Typescript: `(options: SelectRemoveContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts)。
`interface SelectRemoveContext { value: string \| number; data: T; e: MouseEvent \| KeyboardEvent }`
| N +onSearch | Function | | Typescript: `(filterWords: string, context: { e: KeyboardEvent }) => void`
| N ### Select Events @@ -83,8 +82,8 @@ search | `(filterWords: string, context: { e: KeyboardEvent })` | \- name | type | default | description | required -- | -- | -- | -- | -- checkAll | Boolean | false | check all option, which can be both top of the panel and bottom of the panel | N -content | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -default | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +content | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +default | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N disabled | Boolean | false | \- | N label | String | - | \- | N title | String | - | \- | N @@ -96,7 +95,7 @@ value | String / Number / Boolean | - | \- | N name | type | default | description | required -- | -- | -- | -- | -- divider | Boolean | true | \- | N -label | String | - | \- | N +label | String / Slot / Function | - | Group alias。Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N ### TScroll diff --git a/packages/products/tdesign-vue/src/select/select.md b/packages/products/tdesign-vue/src/select/select.md index 4fc525e45..9dcb47c28 100644 --- a/packages/products/tdesign-vue/src/select/select.md +++ b/packages/products/tdesign-vue/src/select/select.md @@ -1,7 +1,6 @@ :: BASE_DOC :: ## API - ### Select Props 名称 | 类型 | 默认值 | 描述 | 必传 @@ -96,7 +95,7 @@ value | String / Number / Boolean | - | 选项值 | N 名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- divider | Boolean | true | 是否显示分隔线 | N -label | String | - | 分组别名 | N +label | String / Slot / Function | - | 分组别名。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N ### TScroll diff --git a/packages/products/tdesign-vue/src/select/type.ts b/packages/products/tdesign-vue/src/select/type.ts index 950a5c6b1..75475f3e2 100644 --- a/packages/products/tdesign-vue/src/select/type.ts +++ b/packages/products/tdesign-vue/src/select/type.ts @@ -304,9 +304,8 @@ export interface TdOptionGroupProps { divider?: boolean; /** * 分组别名 - * @default '' */ - label?: string; + label?: string | TNode; } export interface SelectKeysType { diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 509209ef9..571cbe85c 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -85821,12 +85821,13 @@ "field_category": 1, "field_name": "label", "field_type": [ - "1" + "1", + "64" ], "field_default_value": "", "field_enum": "", "field_desc_zh": "分组别名", - "field_desc_en": null, + "field_desc_en": "Group alias", "field_required": 0, "event_input": "", "create_time": "2020-12-18 06:09:53", @@ -85847,7 +85848,8 @@ "React(PC)" ], "field_type_text": [ - "String" + "String", + "TNode" ] }, {