diff --git a/db/TDesign.db b/db/TDesign.db index 540809ed0..e6411c8c5 100644 Binary files a/db/TDesign.db and b/db/TDesign.db differ diff --git a/packages/products/tdesign-react/packages/components/select/select.en-US.md b/packages/products/tdesign-react/packages/components/select/select.en-US.md index e1bd0ad46..13e020d68 100644 --- a/packages/products/tdesign-react/packages/components/select/select.en-US.md +++ b/packages/products/tdesign-react/packages/components/select/select.en-US.md @@ -7,62 +7,62 @@ name | type | default | description | required -- | -- | -- | -- | -- className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N autoWidth | Boolean | false | \- | N autofocus | Boolean | false | \- | N borderless | Boolean | false | \- | N clearable | Boolean | false | \- | N -collapsedItems | TElement | - | Typescript:`TNode<{ value: T[]; collapsedSelectedItems: T[]; count: number; onClose: (context: { index: number, e?: MouseEvent }) => void }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +collapsedItems | TElement | - | Typescript: `TNode<{ value: T[]; collapsedSelectedItems: T[]; count: number; onClose: (context: { index: number, e?: MouseEvent }) => void }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N creatable | Boolean | false | \- | N disabled | Boolean | undefined | \- | N -empty | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -filter | Function | - | Typescript:`(filterWords: string, option: T) => boolean \| Promise` | N +empty | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/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-react/blob/develop/packages/components/select/type.ts) | N -inputValue | String / Number | - | input value。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-react/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N -label | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +inputProps | Object | - | Typescript: `InputProps`,[Input API Documents](./input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N +inputValue | String / Number | - | input value。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-react/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N +label | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N loading | Boolean | false | \- | N -loadingText | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +loadingText | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/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 | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -panelTopContent | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +options | Array | - | Typescript: `Array` | N +optionsLayout | String | 'vertical' | layout of options in popup。Typescript: `'vertical' \| 'horizontal'` | N +panelBottomContent | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +panelTopContent | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/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-react/blob/develop/packages/components/select/type.ts) | N +popupProps | Object | - | Typescript: `PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N popupVisible | Boolean | - | \- | N defaultPopupVisible | Boolean | - | uncontrolled property | N -prefixIcon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +prefixIcon | TElement | - | Typescript: `TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/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-react/blob/develop/packages/components/common.ts) | N -selectInputProps | Object | - | Typescript:`SelectInputProps`,[SelectInput API Documents](./select-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N +scroll | Object | - | lazy load and virtual scroll。Typescript: `TScroll`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +selectInputProps | Object | - | Typescript: `SelectInputProps`,[SelectInput API Documents](./select-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/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-react/blob/develop/packages/components/common.ts) | N +size | String | medium | options: small/medium/large。Typescript: `SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N status | String | default | options: default/success/warning/error | N -suffix | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -suffixIcon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -tagInputProps | Object | - | Typescript:`TagInputProps`,[TagInput API Documents](./tag-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N -tagProps | Object | - | Typescript:`TagProps`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N -tips | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -value | String / Number / Boolean / Object / Array | - | Typescript:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/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-react/blob/develop/packages/components/select/type.ts) | N -valueDisplay | TNode | - | `MouseEvent`。Typescript:`string \| TNode<{ value: SelectValue; onClose: (index: number) => void; displayValue?: SelectValue; label?: string }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +suffix | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +suffixIcon | TElement | - | Typescript: `TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +tagInputProps | Object | - | Typescript: `TagInputProps`,[TagInput API Documents](./tag-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N +tagProps | Object | - | Typescript: `TagProps`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N +tips | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +value | String / Number / Boolean / Object / Array / BigInt | - | Typescript: `SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N +defaultValue | String / Number / Boolean / Object / Array / BigInt | - | uncontrolled property。Typescript: `SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N +valueDisplay | TNode | - | `MouseEvent`。Typescript: `string \| TNode<{ value: SelectValue; onClose: (index: number) => void; displayValue?: SelectValue; label?: string }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/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-react/blob/develop/packages/components/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-react/blob/develop/packages/components/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-react/blob/develop/packages/components/select/type.ts)。
`import { PopupVisibleChangeContext } from '@Popup'`
| N -onRemove | Function | | Typescript:`(options: SelectRemoveContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/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-react/blob/develop/packages/components/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-react/blob/develop/packages/components/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-react/blob/develop/packages/components/select/type.ts)。
`import { PopupVisibleChangeContext } from '@Popup'`
| N +onRemove | Function | | Typescript: `(options: SelectRemoveContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts)。
`interface SelectRemoveContext { value: string \| number; data: T; e: MouseEvent \| KeyboardEvent }`
| N +onSearch | Function | | Typescript: `(filterWords: string, context: { e: KeyboardEvent }) => void`
| N ### Option Props @@ -70,14 +70,14 @@ onSearch | Function | | Typescript:`(filterWords: string, context: { e: Keybo name | type | default | description | required -- | -- | -- | -- | -- className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N checkAll | Boolean | false | check all option, which can be both top of the panel and bottom of the panel | N -children | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -content | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +children | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +content | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N disabled | Boolean | false | \- | N label | String | - | \- | N title | String | - | \- | N -value | String / Number / Boolean | - | \- | N +value | String / Number / Boolean / BigInt | - | \- | N ### OptionGroup Props @@ -85,7 +85,7 @@ value | String / Number / Boolean | - | \- | N name | type | default | description | required -- | -- | -- | -- | -- className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N divider | Boolean | true | \- | N label | String | - | \- | N diff --git a/packages/products/tdesign-react/packages/components/select/select.md b/packages/products/tdesign-react/packages/components/select/select.md index e3e709033..b074202dd 100644 --- a/packages/products/tdesign-react/packages/components/select/select.md +++ b/packages/products/tdesign-react/packages/components/select/select.md @@ -49,8 +49,8 @@ suffixIcon | TElement | - | 组件后置图标。TS 类型:`TNode`。[通用 tagInputProps | Object | - | 透传 TagInput 标签输入框组件的全部属性。TS 类型:`TagInputProps`,[TagInput API Documents](./tag-input?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N tagProps | Object | - | 透传 Tag 标签组件全部属性。TS 类型:`TagProps`,[Tag API Documents](./tag?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N tips | TNode | - | 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -value | String / Number / Boolean / Object / Array | - | 选中值。TS 类型:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N -defaultValue | String / Number / Boolean / Object / Array | - | 选中值。非受控属性。TS 类型:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N +value | String / Number / Boolean / Object / Array / BigInt | - | 选中值。TS 类型:`SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N +defaultValue | String / Number / Boolean / Object / Array / BigInt | - | 选中值。非受控属性。TS 类型:`SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/select/type.ts) | N valueDisplay | TNode | - | 自定义选中项呈现的内容。TS 类型:`string \| TNode<{ value: SelectValue; onClose: (index: number) => void; displayValue?: SelectValue; label?: string }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N valueType | String | value | 用于控制选中值的类型。假设数据选项为:`[{ label: '姓名', value: 'name' }]`,value 表示值仅返回数据选项中的 value, object 表示值返回全部数据。可选项:value/object | N onBlur | Function | | TS 类型:`(context: { value: SelectValue; e: FocusEvent \| KeyboardEvent }) => void`
输入框失去焦点时触发 | N @@ -77,7 +77,7 @@ content | TNode | - | 用于定义复杂的选项内容。TS 类型:`string \| disabled | Boolean | false | 是否禁用该选项 | N label | String | - | 选项名称 | N title | String | - | 选项标题,在选项过长时hover选项展示 | N -value | String / Number / Boolean | - | 选项值 | N +value | String / Number / Boolean / BigInt | - | 选项值 | N ### OptionGroup Props diff --git a/packages/products/tdesign-react/packages/components/select/type.ts b/packages/products/tdesign-react/packages/components/select/type.ts index e912ad6b6..2e2183527 100644 --- a/packages/products/tdesign-react/packages/components/select/type.ts +++ b/packages/products/tdesign-react/packages/components/select/type.ts @@ -299,7 +299,7 @@ export interface TdOptionProps { /** * 选项值 */ - value?: string | number | boolean; + value?: string | number | boolean | bigint; } export interface TdOptionGroupProps { @@ -321,7 +321,13 @@ export interface SelectKeysType { disabled?: string; } -export type SelectValue = string | number | boolean | T | Array>; +export type SelectValue = + | string + | number + | bigint + | boolean + | T + | Array>; export type SelectValueChangeTrigger = 'clear' | 'tag-remove' | 'backspace' | 'check' | 'uncheck' | 'default'; diff --git a/packages/products/tdesign-vue-next/packages/components/select/option-props.ts b/packages/products/tdesign-vue-next/packages/components/select/option-props.ts index e3dd5e02a..45e102128 100644 --- a/packages/products/tdesign-vue-next/packages/components/select/option-props.ts +++ b/packages/products/tdesign-vue-next/packages/components/select/option-props.ts @@ -32,6 +32,6 @@ export default { }, /** 选项值 */ value: { - type: [String, Number, Boolean] as PropType, + type: [String, Number, Boolean, BigInt] as PropType, }, }; diff --git a/packages/products/tdesign-vue-next/packages/components/select/props.ts b/packages/products/tdesign-vue-next/packages/components/select/props.ts index 93ff143cf..51f63824b 100644 --- a/packages/products/tdesign-vue-next/packages/components/select/props.ts +++ b/packages/products/tdesign-vue-next/packages/components/select/props.ts @@ -173,16 +173,16 @@ export default { }, /** 选中值 */ value: { - type: [String, Number, Boolean, Object, Array] as PropType, + type: [String, Number, Boolean, Object, Array, BigInt] as PropType, default: undefined as TdSelectProps['value'], }, modelValue: { - type: [String, Number, Boolean, Object, Array] as PropType, + type: [String, Number, Boolean, Object, Array, BigInt] as PropType, default: undefined as TdSelectProps['value'], }, /** 选中值,非受控属性 */ defaultValue: { - type: [String, Number, Boolean, Object, Array] as PropType, + type: [String, Number, Boolean, Object, Array, BigInt] as PropType, }, /** 自定义选中项呈现的内容 */ valueDisplay: { diff --git a/packages/products/tdesign-vue-next/packages/components/select/select.en-US.md b/packages/products/tdesign-vue-next/packages/components/select/select.en-US.md index 54b649a1d..a35c09edf 100644 --- a/packages/products/tdesign-vue-next/packages/components/select/select.en-US.md +++ b/packages/products/tdesign-vue-next/packages/components/select/select.en-US.md @@ -10,57 +10,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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/select/type.ts) | N -inputValue | String / Number | - | input value。`v-model:inputValue` 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-next/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N -label | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +inputProps | Object | - | Typescript: `InputProps`,[Input API Documents](./input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N +inputValue | String / Number | - | input value。`v-model:inputValue` 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-next/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N +label | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N loading | Boolean | false | \- | N -loadingText | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +loadingText | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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-next/blob/develop/packages/components/common.ts) | N -panelTopContent | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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-next/blob/develop/packages/components/common.ts) | N +panelTopContent | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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-next/blob/develop/packages/components/select/type.ts) | N +popupProps | Object | - | Typescript: `PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N popupVisible | Boolean | - | `v-model:popupVisible` is supported | N defaultPopupVisible | Boolean | - | uncontrolled property | N -prefixIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +prefixIcon | Slot / Function | - | Typescript: `TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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-next/blob/develop/packages/components/common.ts) | N -selectInputProps | Object | - | Typescript:`SelectInputProps`,[SelectInput API Documents](./select-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N +scroll | Object | - | lazy load and virtual scroll。Typescript: `TScroll`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +selectInputProps | Object | - | Typescript: `SelectInputProps`,[SelectInput API Documents](./select-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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-next/blob/develop/packages/components/common.ts) | N +size | String | medium | options: small/medium/large。Typescript: `SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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-next/blob/develop/packages/components/common.ts) | N -suffixIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -tagInputProps | Object | - | Typescript:`TagInputProps`,[TagInput API Documents](./tag-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N -tagProps | Object | - | Typescript:`TagProps`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N -tips | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -value | String / Number / Boolean / Object / Array | - | `v-model` and `v-model:value` is supported。Typescript:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/common.ts) | N +suffix | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +suffixIcon | Slot / Function | - | Typescript: `TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +tagInputProps | Object | - | Typescript: `TagInputProps`,[TagInput API Documents](./tag-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N +tagProps | Object | - | Typescript: `TagProps`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N +tips | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +value | String / Number / Boolean / Object / Array / BigInt | - | `v-model` and `v-model:value` is supported。Typescript: `SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N +defaultValue | String / Number / Boolean / Object / Array / BigInt | - | uncontrolled property。Typescript: `SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/select/type.ts)。
`import { PopupVisibleChangeContext } from '@Popup'`
| N -onRemove | Function | | Typescript:`(options: SelectRemoveContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/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-next/blob/develop/packages/components/select/type.ts)。
`import { PopupVisibleChangeContext } from '@Popup'`
| N +onRemove | Function | | Typescript: `(options: SelectRemoveContext) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/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,12 +83,12 @@ 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-next/blob/develop/packages/components/common.ts) | N -default | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +content | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +default | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N disabled | Boolean | false | \- | N label | String | - | \- | N title | String | - | \- | N -value | String / Number / Boolean | - | \- | N +value | String / Number / Boolean / BigInt | - | \- | N ### OptionGroup Props diff --git a/packages/products/tdesign-vue-next/packages/components/select/select.md b/packages/products/tdesign-vue-next/packages/components/select/select.md index 8e10aaae9..1a2d85d5a 100644 --- a/packages/products/tdesign-vue-next/packages/components/select/select.md +++ b/packages/products/tdesign-vue-next/packages/components/select/select.md @@ -47,8 +47,8 @@ suffixIcon | Slot / Function | - | 组件后置图标。TS 类型:`TNode`。[ tagInputProps | Object | - | 透传 TagInput 标签输入框组件的全部属性。TS 类型:`TagInputProps`,[TagInput API Documents](./tag-input?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N tagProps | Object | - | 透传 Tag 标签组件全部属性。TS 类型:`TagProps`,[Tag API Documents](./tag?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N tips | String / Slot / Function | - | 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -value | String / Number / Boolean / Object / Array | - | 选中值。支持语法糖 `v-model` 或 `v-model:value`。TS 类型:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N -defaultValue | String / Number / Boolean / Object / Array | - | 选中值。非受控属性。TS 类型:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N +value | String / Number / Boolean / Object / Array / BigInt | - | 选中值。支持语法糖 `v-model` 或 `v-model:value`。TS 类型:`SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N +defaultValue | String / Number / Boolean / Object / Array / BigInt | - | 选中值。非受控属性。TS 类型:`SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/select/type.ts) | N valueDisplay | String / Slot / Function | - | 自定义选中项呈现的内容。TS 类型:`string \| TNode<{ value: SelectValue; onClose: (index: number) => void; displayValue?: SelectValue; label?: string }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N valueType | String | value | 用于控制选中值的类型。假设数据选项为:`[{ label: '姓名', value: 'name' }]`,value 表示值仅返回数据选项中的 value, object 表示值返回全部数据。可选项:value/object | N onBlur | Function | | TS 类型:`(context: { value: SelectValue; e: FocusEvent \| KeyboardEvent }) => void`
输入框失去焦点时触发 | N @@ -88,7 +88,7 @@ default | String / Slot / Function | - | 用于定义复杂的选项内容。同 disabled | Boolean | false | 是否禁用该选项 | N label | String | - | 选项名称 | N title | String | - | 选项标题,在选项过长时hover选项展示 | N -value | String / Number / Boolean | - | 选项值 | N +value | String / Number / Boolean / BigInt | - | 选项值 | N ### OptionGroup Props diff --git a/packages/products/tdesign-vue-next/packages/components/select/type.ts b/packages/products/tdesign-vue-next/packages/components/select/type.ts index 50643ec3e..15e8db042 100644 --- a/packages/products/tdesign-vue-next/packages/components/select/type.ts +++ b/packages/products/tdesign-vue-next/packages/components/select/type.ts @@ -297,7 +297,7 @@ export interface TdOptionProps { /** * 选项值 */ - value?: string | number | boolean; + value?: string | number | boolean | bigint; } export interface TdOptionGroupProps { @@ -319,7 +319,13 @@ export interface SelectKeysType { disabled?: string; } -export type SelectValue = string | number | boolean | T | Array>; +export type SelectValue = + | string + | number + | bigint + | boolean + | T + | Array>; export type SelectValueChangeTrigger = 'clear' | 'tag-remove' | 'backspace' | 'check' | 'uncheck' | 'default'; diff --git a/packages/products/tdesign-vue/src/select/option-props.ts b/packages/products/tdesign-vue/src/select/option-props.ts index e3dd5e02a..45e102128 100644 --- a/packages/products/tdesign-vue/src/select/option-props.ts +++ b/packages/products/tdesign-vue/src/select/option-props.ts @@ -32,6 +32,6 @@ export default { }, /** 选项值 */ value: { - type: [String, Number, Boolean] as PropType, + type: [String, Number, Boolean, BigInt] as PropType, }, }; diff --git a/packages/products/tdesign-vue/src/select/props.ts b/packages/products/tdesign-vue/src/select/props.ts index f99a734ed..24503f4b5 100644 --- a/packages/products/tdesign-vue/src/select/props.ts +++ b/packages/products/tdesign-vue/src/select/props.ts @@ -169,11 +169,11 @@ export default { }, /** 选中值 */ value: { - type: [String, Number, Boolean, Object, Array] as PropType, + type: [String, Number, Boolean, Object, Array, BigInt] as PropType, }, /** 选中值,非受控属性 */ defaultValue: { - type: [String, Number, Boolean, Object, Array] as PropType, + type: [String, Number, Boolean, Object, Array, BigInt] as PropType, }, /** 自定义选中项呈现的内容 */ valueDisplay: { 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..78e540bc7 100644 --- a/packages/products/tdesign-vue/src/select/select.en-US.md +++ b/packages/products/tdesign-vue/src/select/select.en-US.md @@ -10,57 +10,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 / BigInt | - | `v-model` is supported。Typescript: `SelectValue` `type SelectValue = string \| number \| bigint \| 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 / BigInt | - | uncontrolled property。Typescript: `SelectValue` `type SelectValue = string \| number \| bigint \| 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,12 +83,12 @@ 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 -value | String / Number / Boolean | - | \- | N +value | String / Number / Boolean / BigInt | - | \- | N ### OptionGroup Props diff --git a/packages/products/tdesign-vue/src/select/select.md b/packages/products/tdesign-vue/src/select/select.md index 4fc525e45..302bc3e4b 100644 --- a/packages/products/tdesign-vue/src/select/select.md +++ b/packages/products/tdesign-vue/src/select/select.md @@ -47,8 +47,8 @@ suffixIcon | Slot / Function | - | 组件后置图标。TS 类型:`TNode`。[ tagInputProps | Object | - | 透传 TagInput 标签输入框组件的全部属性。TS 类型:`TagInputProps`,[TagInput API Documents](./tag-input?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N tagProps | Object | - | 透传 Tag 标签组件全部属性。TS 类型:`TagProps`,[Tag API Documents](./tag?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N tips | String / Slot / Function | - | 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -value | String / Number / Boolean / Object / Array | - | 选中值。支持语法糖 `v-model`。TS 类型:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N -defaultValue | String / Number / Boolean / Object / Array | - | 选中值。非受控属性。TS 类型:`SelectValue` `type SelectValue = string \| number \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +value | String / Number / Boolean / Object / Array / BigInt | - | 选中值。支持语法糖 `v-model`。TS 类型:`SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N +defaultValue | String / Number / Boolean / Object / Array / BigInt | - | 选中值。非受控属性。TS 类型:`SelectValue` `type SelectValue = string \| number \| bigint \| boolean \| T \| Array>`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/select/type.ts) | N valueDisplay | String / Slot / Function | - | 自定义选中项呈现的内容。TS 类型:`string \| TNode<{ value: SelectValue; onClose: (index: number) => void; displayValue?: SelectValue; label?: string }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N valueType | String | value | 用于控制选中值的类型。假设数据选项为:`[{ label: '姓名', value: 'name' }]`,value 表示值仅返回数据选项中的 value, object 表示值返回全部数据。可选项:value/object | N onBlur | Function | | TS 类型:`(context: { value: SelectValue; e: FocusEvent \| KeyboardEvent }) => void`
输入框失去焦点时触发 | N @@ -88,7 +88,7 @@ default | String / Slot / Function | - | 用于定义复杂的选项内容。同 disabled | Boolean | false | 是否禁用该选项 | N label | String | - | 选项名称 | N title | String | - | 选项标题,在选项过长时hover选项展示 | N -value | String / Number / Boolean | - | 选项值 | N +value | String / Number / Boolean / BigInt | - | 选项值 | N ### OptionGroup Props diff --git a/packages/products/tdesign-vue/src/select/type.ts b/packages/products/tdesign-vue/src/select/type.ts index 950a5c6b1..19b10bc83 100644 --- a/packages/products/tdesign-vue/src/select/type.ts +++ b/packages/products/tdesign-vue/src/select/type.ts @@ -293,7 +293,7 @@ export interface TdOptionProps { /** * 选项值 */ - value?: string | number | boolean; + value?: string | number | boolean | bigint; } export interface TdOptionGroupProps { @@ -315,7 +315,13 @@ export interface SelectKeysType { disabled?: string; } -export type SelectValue = string | number | boolean | T | Array>; +export type SelectValue = + | string + | number + | bigint + | boolean + | T + | Array>; export type SelectValueChangeTrigger = 'clear' | 'tag-remove' | 'backspace' | 'check' | 'uncheck' | 'default'; diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 500d1ce04..cecfe8629 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -86692,7 +86692,8 @@ "field_type": [ "1", "2", - "4" + "4", + "1024" ], "field_default_value": "", "field_enum": "", @@ -86720,7 +86721,8 @@ "field_type_text": [ "String", "Number", - "Boolean" + "Boolean", + "BigInt" ] }, { @@ -108396,7 +108398,8 @@ "2", "4", "8", - "16" + "16", + "1024" ], "field_default_value": "", "field_enum": "", @@ -108407,7 +108410,7 @@ "create_time": "2020-12-17 10:48:27", "update_time": "2022-01-21 04:21:17", "event_output": null, - "custom_field_type": "SelectValue【type SelectValue = string | number | boolean | T | Array>】", + "custom_field_type": "SelectValue【type SelectValue = string | number | bigint | boolean | T | Array>】", "syntactic_sugar": "v-model", "readonly": 1, "html_attribute": 0, @@ -108426,7 +108429,8 @@ "Number", "Boolean", "Object", - "Array" + "Array", + "BigInt" ] }, { diff --git a/packages/scripts/map.json b/packages/scripts/map.json index cdad69380..2ceb5ec79 100644 --- a/packages/scripts/map.json +++ b/packages/scripts/map.json @@ -129,6 +129,10 @@ { "label": "any", "value": "512" + }, + { + "label": "BigInt", + "value": "1024" } ], "components": [ diff --git a/packages/server/controllers/ComponentApi/const.ts b/packages/server/controllers/ComponentApi/const.ts index 9ffbfa75d..7515e5522 100644 --- a/packages/server/controllers/ComponentApi/const.ts +++ b/packages/server/controllers/ComponentApi/const.ts @@ -17,6 +17,7 @@ const TNODE = 64; const Date = 128; const FILE = 256; const ANY = 512; +const BIGINT = 1024; const P_VUE_PC = 1; const P_REACT_PC = 2; @@ -73,6 +74,7 @@ export const FIELD_TYPE_MAP: MapOptions = { [Date]: 'Date', [FILE]: 'File', [ANY]: 'any', + [BIGINT]: 'BigInt', }; export const PLATFORM_FRAMEWORK: MapOptions = {