diff --git a/db/TDesign.db b/db/TDesign.db index e0e53a6c..edf6a60c 100644 Binary files a/db/TDesign.db and b/db/TDesign.db differ diff --git a/packages/products/tdesign-mobile-vue/src/date-time-picker/date-time-picker.en-US.md b/packages/products/tdesign-mobile-vue/src/date-time-picker/date-time-picker.en-US.md index 9e0464ed..512803b6 100644 --- a/packages/products/tdesign-mobile-vue/src/date-time-picker/date-time-picker.en-US.md +++ b/packages/products/tdesign-mobile-vue/src/date-time-picker/date-time-picker.en-US.md @@ -6,21 +6,27 @@ name | type | default | description | required -- | -- | -- | -- | -- +autoClose | Boolean | false | \- | N cancelBtn | String | 取消 | \- | N confirmBtn | String | - | \- | N end | String / Number | - | \- | N filter | Function | - | Typescript:`(type: TimeModeValues, columns: DateTimePickerColumn) => DateTimePickerColumn` `type DateTimePickerColumn = DateTimePickerColumnItem[]` `interface DateTimePickerColumnItem { label: string,value: string}`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts) | N +footer | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N format | String | 'YYYY-MM-DD HH:mm:ss' | \- | N +header | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N mode | String / Array | 'date' | Typescript:`DateTimePickerMode` `type DateTimePickerMode = TimeModeValues \| Array ` `type TimeModeValues = 'year' \| 'month' \| 'date' \| 'hour' \| 'minute' \| 'second'`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts) | N renderLabel | Function | - | Typescript:`(type: string, value: number) => string` | N showWeek | Boolean | false | \- | N start | String / Number | - | \- | N +steps | Object | - | Typescript:`Record` | N title | String | '选择时间' | title of picker | N -usePopup | Boolean | true | \- | N +usePopup | Boolean | false | \- | N value | String / Number | - | `v-model` and `v-model:value` is supported。Typescript:`DateValue` `type DateValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts) | N defaultValue | String / Number | - | uncontrolled property。Typescript:`DateValue` `type DateValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts) | N +visible | Boolean | false | \- | N onCancel | Function | | Typescript:`(context: { e: MouseEvent }) => void`
| N onChange | Function | | Typescript:`(value: DateValue) => void`
| N +onClose | Function | | Typescript:`(trigger: TriggerSource) => void`
[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts)。
`import { TriggerSource } from '@Picker'`
| N onConfirm | Function | | Typescript:`(value: DateValue) => void`
| N onPick | Function | | Typescript:`(value: DateValue) => void`
| N @@ -30,5 +36,6 @@ name | params | description -- | -- | -- cancel | `(context: { e: MouseEvent })` | \- change | `(value: DateValue)` | \- +close | `(trigger: TriggerSource)` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts)。
`import { TriggerSource } from '@Picker'`
confirm | `(value: DateValue)` | \- pick | `(value: DateValue)` | \- diff --git a/packages/products/tdesign-mobile-vue/src/date-time-picker/date-time-picker.md b/packages/products/tdesign-mobile-vue/src/date-time-picker/date-time-picker.md index 015bebf0..a5951c8c 100644 --- a/packages/products/tdesign-mobile-vue/src/date-time-picker/date-time-picker.md +++ b/packages/products/tdesign-mobile-vue/src/date-time-picker/date-time-picker.md @@ -6,21 +6,27 @@ 名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- +autoClose | Boolean | false | 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible | N cancelBtn | String | 取消 | 取消按钮文字 | N confirmBtn | String | - | 确定按钮文字 | N end | String / Number | - | 选择器的最大可选时间,默认为当前时间+10年 | N filter | Function | - | 列选项过滤函数,支持自定义列内容。(type 值可为: year, month, date, hour, minute, second)。TS 类型:`(type: TimeModeValues, columns: DateTimePickerColumn) => DateTimePickerColumn` `type DateTimePickerColumn = DateTimePickerColumnItem[]` `interface DateTimePickerColumnItem { label: string,value: string}`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts) | N +footer | Slot / Function | - | 底部内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N format | String | 'YYYY-MM-DD HH:mm:ss' | 用于pick、change、confirm事件参数格式化[详细文档](https://day.js.org/docs/en/display/format) | N +header | Slot / Function | - | 顶部内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N mode | String / Array | 'date' | year = 年;month = 年月;date = 年月日;hour = 年月日时; minute = 年月日时分;当类型为数组时,第一个值控制年月日,第二个值控制时分秒。TS 类型:`DateTimePickerMode` `type DateTimePickerMode = TimeModeValues \| Array ` `type TimeModeValues = 'year' \| 'month' \| 'date' \| 'hour' \| 'minute' \| 'second'`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts) | N renderLabel | Function | - | 自定义label。TS 类型:`(type: string, value: number) => string` | N showWeek | Boolean | false | 【开发中】是否在日期旁边显示周几(如周一,周二,周日等) | N start | String / Number | - | 选择器的最小可选时间,默认为当前时间-10年 | N +steps | Object | - | 时间间隔步数,示例:`{ minute: 5 }`。TS 类型:`Record` | N title | String | '选择时间' | 标题 | N -usePopup | Boolean | true | 是否使用弹出层包裹 | N +usePopup | Boolean | false | 是否使用弹出层包裹 | N value | String / Number | - | 选中值。支持语法糖 `v-model` 或 `v-model:value`。TS 类型:`DateValue` `type DateValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts) | N defaultValue | String / Number | - | 选中值。非受控属性。TS 类型:`DateValue` `type DateValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts) | N +visible | Boolean | false | 是否显示 | N onCancel | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
取消按钮点击时触发 | N onChange | Function | | TS 类型:`(value: DateValue) => void`
value改变时触发 | N +onClose | Function | | TS 类型:`(trigger: TriggerSource) => void`
关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts)。
`import { TriggerSource } from '@Picker'`
| N onConfirm | Function | | TS 类型:`(value: DateValue) => void`
确认按钮点击时触发 | N onPick | Function | | TS 类型:`(value: DateValue) => void`
选中值发生变化时触发 | N @@ -30,5 +36,6 @@ onPick | Function | | TS 类型:`(value: DateValue) => void`
选中值发 -- | -- | -- cancel | `(context: { e: MouseEvent })` | 取消按钮点击时触发 change | `(value: DateValue)` | value改变时触发 +close | `(trigger: TriggerSource)` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/date-time-picker/type.ts)。
`import { TriggerSource } from '@Picker'`
confirm | `(value: DateValue)` | 确认按钮点击时触发 pick | `(value: DateValue)` | 选中值发生变化时触发 diff --git a/packages/products/tdesign-mobile-vue/src/date-time-picker/props.ts b/packages/products/tdesign-mobile-vue/src/date-time-picker/props.ts index 577724df..34d7e7b7 100644 --- a/packages/products/tdesign-mobile-vue/src/date-time-picker/props.ts +++ b/packages/products/tdesign-mobile-vue/src/date-time-picker/props.ts @@ -8,6 +8,8 @@ import { TdDateTimePickerProps } from './type'; import { PropType } from 'vue'; export default { + /** 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible */ + autoClose: Boolean, /** 取消按钮文字 */ cancelBtn: { type: String, @@ -26,11 +28,19 @@ export default { filter: { type: Function as PropType, }, + /** 底部内容 */ + footer: { + type: Function as PropType, + }, /** 用于pick、change、confirm事件参数格式化[详细文档](https://day.js.org/docs/en/display/format) */ format: { type: String, default: 'YYYY-MM-DD HH:mm:ss', }, + /** 顶部内容 */ + header: { + type: Function as PropType, + }, /** year = 年;month = 年月;date = 年月日;hour = 年月日时; minute = 年月日时分;当类型为数组时,第一个值控制年月日,第二个值控制时分秒 */ mode: { type: [String, Array] as PropType, @@ -46,16 +56,17 @@ export default { start: { type: [String, Number] as PropType, }, + /** 时间间隔步数,示例:`{ minute: 5 }` */ + steps: { + type: Object as PropType, + }, /** 标题 */ title: { type: String, default: '选择时间', }, /** 是否使用弹出层包裹 */ - usePopup: { - type: Boolean, - default: true, - }, + usePopup: Boolean, /** 选中值 */ value: { type: [String, Number] as PropType, @@ -69,10 +80,14 @@ export default { defaultValue: { type: [String, Number] as PropType, }, + /** 是否显示 */ + visible: Boolean, /** 取消按钮点击时触发 */ onCancel: Function as PropType, /** value改变时触发 */ onChange: Function as PropType, + /** 关闭时触发 */ + onClose: Function as PropType, /** 确认按钮点击时触发 */ onConfirm: Function as PropType, /** 选中值发生变化时触发 */ diff --git a/packages/products/tdesign-mobile-vue/src/date-time-picker/type.ts b/packages/products/tdesign-mobile-vue/src/date-time-picker/type.ts index a34adf61..1a509b4f 100644 --- a/packages/products/tdesign-mobile-vue/src/date-time-picker/type.ts +++ b/packages/products/tdesign-mobile-vue/src/date-time-picker/type.ts @@ -4,7 +4,15 @@ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ +import { TriggerSource } from '../picker'; +import { TNode } from '../common'; + export interface TdDateTimePickerProps { + /** + * 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible + * @default false + */ + autoClose?: boolean; /** * 取消按钮文字 * @default 取消 @@ -23,11 +31,19 @@ export interface TdDateTimePickerProps { * 列选项过滤函数,支持自定义列内容。(type 值可为: year, month, date, hour, minute, second) */ filter?: (type: TimeModeValues, columns: DateTimePickerColumn) => DateTimePickerColumn; + /** + * 底部内容 + */ + footer?: TNode; /** * 用于pick、change、confirm事件参数格式化[详细文档](https://day.js.org/docs/en/display/format) * @default 'YYYY-MM-DD HH:mm:ss' */ format?: string; + /** + * 顶部内容 + */ + header?: TNode; /** * year = 年;month = 年月;date = 年月日;hour = 年月日时; minute = 年月日时分;当类型为数组时,第一个值控制年月日,第二个值控制时分秒 * @default 'date' @@ -46,6 +62,10 @@ export interface TdDateTimePickerProps { * 选择器的最小可选时间,默认为当前时间-10年 */ start?: string | number; + /** + * 时间间隔步数,示例:`{ minute: 5 }` + */ + steps?: Record; /** * 标题 * @default '选择时间' @@ -53,7 +73,7 @@ export interface TdDateTimePickerProps { title?: string; /** * 是否使用弹出层包裹 - * @default true + * @default false */ usePopup?: boolean; /** @@ -68,6 +88,11 @@ export interface TdDateTimePickerProps { * 选中值 */ modelValue?: DateValue; + /** + * 是否显示 + * @default false + */ + visible?: boolean; /** * 取消按钮点击时触发 */ @@ -76,6 +101,10 @@ export interface TdDateTimePickerProps { * value改变时触发 */ onChange?: (value: DateValue) => void; + /** + * 关闭时触发 + */ + onClose?: (trigger: TriggerSource) => void; /** * 确认按钮点击时触发 */ diff --git a/packages/products/tdesign-mobile-vue/src/picker/picker.en-US.md b/packages/products/tdesign-mobile-vue/src/picker/picker.en-US.md index 46698475..0baa179e 100644 --- a/packages/products/tdesign-mobile-vue/src/picker/picker.en-US.md +++ b/packages/products/tdesign-mobile-vue/src/picker/picker.en-US.md @@ -6,18 +6,23 @@ name | type | default | description | required -- | -- | -- | -- | -- +autoClose | Boolean | true | \- | N cancelBtn | String / Boolean | true | Typescript:`boolean \| string` | N columns | Array / Function | [] | required。Typescript:`PickerColumn \| Array \| ((item: Array) => Array)` `type PickerColumn = PickerColumnItem[]` `interface PickerColumnItem { label: string,value: string}`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts) | Y confirmBtn | String / Boolean | true | Typescript:`boolean \| string` | N +footer | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N header | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N option | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N renderLabel | Function | - | Typescript:`(item: PickerColumnItem) => string` | N title | String | '' | \- | N +usePopup | Boolean | false | \- | N value | Array | - | `v-model` and `v-model:value` is supported。Typescript:`Array` `type PickerValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts) | N defaultValue | Array | - | uncontrolled property。Typescript:`Array` `type PickerValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts) | N +visible | Boolean | false | \- | N onCancel | Function | | Typescript:`(context: { e: MouseEvent }) => void`
| N onChange | Function | | Typescript:`(value: Array, context: { columns: Array, e: MouseEvent }) => void`
[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts)。
`interface PickerContext{ column: number,index: number }`
| N +onClose | Function | | Typescript:`(trigger: TriggerSource) => void`
[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts)。
`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`
| N onConfirm | Function | | Typescript:`(value: Array, context: { index: number[], e: MouseEvent, label: string[] }) => void`
| N onPick | Function | | Typescript:`(value: Array,context: PickerContext) => void`
| N @@ -27,5 +32,6 @@ name | params | description -- | -- | -- cancel | `(context: { e: MouseEvent })` | \- change | `(value: Array, context: { columns: Array, e: MouseEvent }) ` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts)。
`interface PickerContext{ column: number,index: number }`
+close | `(trigger: TriggerSource)` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts)。
`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`
confirm | `(value: Array, context: { index: number[], e: MouseEvent, label: string[] })` | \- pick | `(value: Array,context: PickerContext)` | \- diff --git a/packages/products/tdesign-mobile-vue/src/picker/picker.md b/packages/products/tdesign-mobile-vue/src/picker/picker.md index 174f770c..bd29241f 100644 --- a/packages/products/tdesign-mobile-vue/src/picker/picker.md +++ b/packages/products/tdesign-mobile-vue/src/picker/picker.md @@ -6,18 +6,23 @@ 名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- +autoClose | Boolean | true | 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible | N cancelBtn | String / Boolean | true | 取消按钮文字。TS 类型:`boolean \| string` | N columns | Array / Function | [] | 必需。配置每一列的选项。TS 类型:`PickerColumn \| Array \| ((item: Array) => Array)` `type PickerColumn = PickerColumnItem[]` `interface PickerColumnItem { label: string,value: string}`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts) | Y confirmBtn | String / Boolean | true | 确定按钮文字。TS 类型:`boolean \| string` | N +footer | Slot / Function | - | 底部内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N header | Slot / Function | - | 自定义头部内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N keys | Object | - | 用来定义 value / label / disabled 在 `columns ` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N option | Slot / Function | - | 自定义选项内容。参数为 `option: PickerColumnItem, index: number`。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N renderLabel | Function | - | 自定义label。TS 类型:`(item: PickerColumnItem) => string` | N title | String | '' | 标题 | N +usePopup | Boolean | false | 是否使用弹出层包裹 | N value | Array | - | 选中值。支持语法糖 `v-model` 或 `v-model:value`。TS 类型:`Array` `type PickerValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts) | N defaultValue | Array | - | 选中值。非受控属性。TS 类型:`Array` `type PickerValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts) | N +visible | Boolean | false | 是否显示 | N onCancel | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
点击取消按钮时触发 | N onChange | Function | | TS 类型:`(value: Array, context: { columns: Array, e: MouseEvent }) => void`
选中变化时候触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts)。
`interface PickerContext{ column: number,index: number }`
| N +onClose | Function | | TS 类型:`(trigger: TriggerSource) => void`
关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts)。
`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`
| N onConfirm | Function | | TS 类型:`(value: Array, context: { index: number[], e: MouseEvent, label: string[] }) => void`
点击确认按钮时触发 | N onPick | Function | | TS 类型:`(value: Array,context: PickerContext) => void`
任何一列选中都会触发,不同的列参数不同。`context.column` 表示第几列变化,`context.index` 表示变化那一列的选中项下标 | N @@ -27,5 +32,6 @@ onPick | Function | | TS 类型:`(value: Array,context: PickerCo -- | -- | -- cancel | `(context: { e: MouseEvent })` | 点击取消按钮时触发 change | `(value: Array, context: { columns: Array, e: MouseEvent }) ` | 选中变化时候触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts)。
`interface PickerContext{ column: number,index: number }`
+close | `(trigger: TriggerSource)` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/picker/type.ts)。
`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`
confirm | `(value: Array, context: { index: number[], e: MouseEvent, label: string[] })` | 点击确认按钮时触发 pick | `(value: Array,context: PickerContext)` | 任何一列选中都会触发,不同的列参数不同。`context.column` 表示第几列变化,`context.index` 表示变化那一列的选中项下标 diff --git a/packages/products/tdesign-mobile-vue/src/picker/props.ts b/packages/products/tdesign-mobile-vue/src/picker/props.ts index fd16dd66..4272b6d3 100644 --- a/packages/products/tdesign-mobile-vue/src/picker/props.ts +++ b/packages/products/tdesign-mobile-vue/src/picker/props.ts @@ -8,6 +8,11 @@ import { TdPickerProps } from './type'; import { PropType } from 'vue'; export default { + /** 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible */ + autoClose: { + type: Boolean, + default: true, + }, /** 取消按钮文字 */ cancelBtn: { type: [String, Boolean] as PropType, @@ -24,6 +29,10 @@ export default { type: [String, Boolean] as PropType, default: true, }, + /** 底部内容 */ + footer: { + type: Function as PropType, + }, /** 自定义头部内容 */ header: { type: Function as PropType, @@ -45,6 +54,8 @@ export default { type: String, default: '', }, + /** 是否使用弹出层包裹 */ + usePopup: Boolean, /** 选中值 */ value: { type: Array as PropType, @@ -58,10 +69,14 @@ export default { defaultValue: { type: Array as PropType, }, + /** 是否显示 */ + visible: Boolean, /** 点击取消按钮时触发 */ onCancel: Function as PropType, /** 选中变化时候触发 */ onChange: Function as PropType, + /** 关闭时触发 */ + onClose: Function as PropType, /** 点击确认按钮时触发 */ onConfirm: Function as PropType, /** 任何一列选中都会触发,不同的列参数不同。`context.column` 表示第几列变化,`context.index` 表示变化那一列的选中项下标 */ diff --git a/packages/products/tdesign-mobile-vue/src/picker/type.ts b/packages/products/tdesign-mobile-vue/src/picker/type.ts index a30b4e44..cc98c61b 100644 --- a/packages/products/tdesign-mobile-vue/src/picker/type.ts +++ b/packages/products/tdesign-mobile-vue/src/picker/type.ts @@ -7,6 +7,11 @@ import { TNode, KeysType } from '../common'; export interface TdPickerProps { + /** + * 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible + * @default true + */ + autoClose?: boolean; /** * 取消按钮文字 * @default true @@ -22,6 +27,10 @@ export interface TdPickerProps { * @default true */ confirmBtn?: boolean | string; + /** + * 底部内容 + */ + footer?: TNode; /** * 自定义头部内容 */ @@ -43,6 +52,11 @@ export interface TdPickerProps { * @default '' */ title?: string; + /** + * 是否使用弹出层包裹 + * @default false + */ + usePopup?: boolean; /** * 选中值 */ @@ -55,6 +69,11 @@ export interface TdPickerProps { * 选中值 */ modelValue?: Array; + /** + * 是否显示 + * @default false + */ + visible?: boolean; /** * 点击取消按钮时触发 * @default '' @@ -65,6 +84,10 @@ export interface TdPickerProps { * @default '' */ onChange?: (value: Array, context: { columns: Array; e: MouseEvent }) => void; + /** + * 关闭时触发 + */ + onClose?: (trigger: TriggerSource) => void; /** * 点击确认按钮时触发 * @default '' @@ -90,3 +113,5 @@ export interface PickerContext { column: number; index: number; } + +export type TriggerSource = 'overlay' | 'cancel-btn' | 'confirm-btn'; diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 03509823..4e94af96 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -36179,6 +36179,7 @@ { "id": 1710844322, "platform_framework": [ + "8", "64" ], "component": "DateTimePicker", @@ -36207,6 +36208,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(Mobile)", "Miniprogram" ], "field_type_text": [ @@ -36332,6 +36334,43 @@ "TNode" ] }, + { + "id": 1739431044, + "platform_framework": [ + "8" + ], + "component": "DateTimePicker", + "field_category": 1, + "field_name": "header", + "field_type": [ + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "顶部内容", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2025-02-13 07:17:24", + "update_time": "2025-02-13 07:17:24", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(Mobile)" + ], + "field_type_text": [ + "TNode" + ] + }, { "id": 1573, "platform_framework": [ @@ -36546,6 +36585,7 @@ { "id": 3482, "platform_framework": [ + "8", "16", "32", "64" @@ -36565,7 +36605,7 @@ "create_time": "2023-05-05 06:12:50", "update_time": "2023-05-05 06:12:50", "event_output": null, - "custom_field_type": "", + "custom_field_type": "Record", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -36576,6 +36616,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(Mobile)", "React(Mobile)", "Angular(Mobile)", "Miniprogram" @@ -36665,7 +36706,6 @@ { "id": 1725285145, "platform_framework": [ - "8", "16", "32", "64" @@ -36696,7 +36736,6 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)", "React(Mobile)", "Angular(Mobile)", "Miniprogram" @@ -36705,6 +36744,43 @@ "Boolean" ] }, + { + "id": 1739431358, + "platform_framework": [ + "8" + ], + "component": "DateTimePicker", + "field_category": 1, + "field_name": "usePopup", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "是否使用弹出层包裹", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2025-02-13 07:22:38", + "update_time": "2025-02-13 07:22:38", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(Mobile)" + ], + "field_type_text": [ + "Boolean" + ] + }, { "id": 1520, "platform_framework": [ @@ -36753,6 +36829,7 @@ { "id": 1522, "platform_framework": [ + "8", "16", "32", "64" @@ -36783,6 +36860,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(Mobile)", "React(Mobile)", "Angular(Mobile)", "Miniprogram" @@ -36934,6 +37012,7 @@ { "id": 3354, "platform_framework": [ + "8", "16", "32", "64" @@ -36947,7 +37026,7 @@ "field_desc_zh": "关闭时触发", "field_desc_en": null, "field_required": 0, - "event_input": "(trigger: TriggerSource)【type TriggerSource = 'overlay' | 'cancel-btn' | 'confirm-btn'】", + "event_input": "(trigger: TriggerSource【import { TriggerSource } from '@Picker'】)", "create_time": "2023-02-28 12:33:00", "update_time": "2023-02-28 12:33:00", "event_output": null, @@ -36962,6 +37041,7 @@ "support_default_value": 0, "field_category_text": "Events", "platform_framework_text": [ + "Vue(Mobile)", "React(Mobile)", "Angular(Mobile)", "Miniprogram" @@ -80411,6 +80491,7 @@ { "id": 2834, "platform_framework": [ + "8", "64" ], "component": "Picker", @@ -80439,6 +80520,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(Mobile)", "Miniprogram" ], "field_type_text": [ @@ -80659,6 +80741,7 @@ { "id": 1710843235, "platform_framework": [ + "8", "64" ], "component": "Picker", @@ -80687,6 +80770,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(Mobile)", "Miniprogram" ], "field_type_text": [ @@ -81122,6 +81206,43 @@ "Boolean" ] }, + { + "id": 1739431490, + "platform_framework": [ + "8" + ], + "component": "Picker", + "field_category": 1, + "field_name": "usePopup", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "是否使用弹出层包裹", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2025-02-13 07:24:50", + "update_time": "2025-02-13 07:24:50", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(Mobile)" + ], + "field_type_text": [ + "Boolean" + ] + }, { "id": 1719908481, "platform_framework": [ @@ -81205,6 +81326,7 @@ { "id": 1471, "platform_framework": [ + "8", "16", "32", "64" @@ -81235,6 +81357,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(Mobile)", "React(Mobile)", "Angular(Mobile)", "Miniprogram" @@ -81367,6 +81490,7 @@ { "id": 3353, "platform_framework": [ + "8", "64" ], "component": "Picker", @@ -81393,6 +81517,7 @@ "support_default_value": 0, "field_category_text": "Events", "platform_framework_text": [ + "Vue(Mobile)", "Miniprogram" ], "field_type_text": []