diff --git a/db/TDesign.db b/db/TDesign.db index 1b6879e08..6fba00354 100644 Binary files a/db/TDesign.db and b/db/TDesign.db differ diff --git a/packages/products/tdesign-react/packages/components/calendar/calendar.en-US.md b/packages/products/tdesign-react/packages/components/calendar/calendar.en-US.md index 85c3a5bcb..8f2c71cb6 100644 --- a/packages/products/tdesign-react/packages/components/calendar/calendar.en-US.md +++ b/packages/products/tdesign-react/packages/components/calendar/calendar.en-US.md @@ -5,50 +5,58 @@ name | type | default | description | required -- | -- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,Typescript:`React.CSSProperties` | N -cell | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -cellAppend | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -controllerConfig | Boolean / Object | undefined | Typescript:`boolean \| CalendarController` | N +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +cell | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +cellAppend | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +controllerConfig | Boolean / Object | undefined | Typescript: `boolean \| CalendarController` | N fillWithZero | Boolean | true | \- | N -firstDayOfWeek | Number | 1 | options:1/2/3/4/5/6/7 | N +firstDayOfWeek | Number | 1 | options: 1/2/3/4/5/6/7 | N format | String | 'YYYY-MM-DD' | \- | N -head | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N +head | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N isShowWeekendDefault | Boolean | true | \- | N -mode | String | month | options:month/year | N +mode | String | month | options: month/year | N month | String / Number | - | \- | N multiple | Boolean | - | \- | N preventCellContextmenu | Boolean | false | \- | N -range | Array | - | Typescript:`Array` | N -theme | String | full | options:full/card | N -value | String / Array / Date | - | Typescript:`CalendarValue \| CalendarValue[]` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N -week | TNode | - | Typescript:`Array \| TNode` `interface CalendarWeek { day: WeekDay }` `type WeekDay = 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7`。[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/calendar/type.ts) | N +range | Array | - | Set the year and month display range of calendar, [start, end]. Example 1: `['2018-08', '2028-04']`. Example 2: `[new Date(2018, 8), new Date(2028, 4)]`. Only when both items from the input list can be parsed normally by `dayjs` can the specified calendar range take effect, while you can set the start or end of the range separately by inputting a list with only one item that can be parsed normally。Typescript: `Array` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N +theme | String | full | options: full/card | N +value | String / Array / Date | - | Typescript: `CalendarValue \| CalendarValue[]` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N +week | TNode | - | Typescript: `Array \| TNode` `interface CalendarWeek { day: WeekDay }` `type WeekDay = 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7`。[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/calendar/type.ts) | N year | String / Number | - | \- | N -onCellClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N -onCellDoubleClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N -onCellRightClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N -onControllerChange | Function | | Typescript:`(options: ControllerOptions) => void`
[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
| N -onMonthChange | Function | | Typescript:`(options: { month: string; year: string }) => void`
| N +onCellClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N +onCellDoubleClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N +onCellRightClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N +onControllerChange | Function | | Typescript: `(options: ControllerOptions) => void`
[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
| N +onMonthChange | Function | | Typescript: `(options: { month: string; year: string }) => void`
| N + +### CalendarInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +toCurrent | \- | \- | go to today ### CalendarController name | type | default | description | required -- | -- | -- | -- | -- -current | Object | - | Typescript:`{ visible?: boolean; currentDayButtonProps?: ButtonProps; currentMonthButtonProps?: ButtonProps }`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N +current | Object | - | Typescript: `{ visible?: boolean; currentDayButtonProps?: ButtonProps; currentMonthButtonProps?: ButtonProps }`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N disabled | Boolean | false | \- | N -mode | Object | - | Typescript:`{ visible?: boolean; radioGroupProps?: RadioGroupProps }`,[Radio API Documents](./radio?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N -month | Object | - | Typescript:`{ visible?: boolean; selectProps?: SelectProps }` | N -weekend | Object | - | Typescript:`{ visible?: boolean; showWeekendButtonProps?: CheckTagProps; hideWeekendButtonProps?: CheckTagProps }`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N -year | Object | - | Typescript:`{ visible?: boolean; selectProps?: SelectProps }`,[Select API Documents](./select?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N +mode | Object | - | Typescript: `{ visible?: boolean; radioGroupProps?: RadioGroupProps }`,[Radio API Documents](./radio?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N +month | Object | - | Typescript: `{ visible?: boolean; selectProps?: SelectProps }` | N +weekend | Object | - | Typescript: `{ visible?: boolean; showWeekendButtonProps?: CheckTagProps; hideWeekendButtonProps?: CheckTagProps }`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N +year | Object | - | Typescript: `{ visible?: boolean; selectProps?: SelectProps }`,[Select API Documents](./select?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N ### CalendarCell name | type | default | description | required -- | -- | -- | -- | -- belongTo | Number | - | \- | N -date | Object | - | Typescript:`Date` | N +date | Object | - | Typescript: `Date` | N day | Number | - | \- | N formattedDate | String | - | \- | N isCurrent | Boolean | - | \- | N weekOrder | Number | - | \- | N -`ControllerOptions` | \- | - | \- | N +`ControllerOptions` | \- | - | extends `ControllerOptions` | N diff --git a/packages/products/tdesign-react/packages/components/calendar/calendar.md b/packages/products/tdesign-react/packages/components/calendar/calendar.md index f48859880..53e0e6f23 100644 --- a/packages/products/tdesign-react/packages/components/calendar/calendar.md +++ b/packages/products/tdesign-react/packages/components/calendar/calendar.md @@ -3,7 +3,7 @@ ## API ### Calendar Props -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- className | String | - | 类名 | N style | Object | - | 样式,TS 类型:`React.CSSProperties` | N @@ -19,7 +19,7 @@ mode | String | month | 日历展示维度。可选项:month/year | N month | String / Number | - | 控制当前面板展示月份,优先级高于 `controllerConfig.month` | N multiple | Boolean | - | 是否高亮多个日期单元格 | N preventCellContextmenu | Boolean | false | 是否禁用单元格右键默认系统菜单 | N -range | Array | - | 用于设置日历的年月份显示范围,[范围开始,范围结束]。TS 类型:`Array` | N +range | Array | - | 用于设置日历的年月份显示范围,[范围开始,范围结束]。示例一:`['2018-08', '2028-04']`。示例二:`[new Date(2018, 8), new Date(2028, 4)]`。传入列表的两项均能被`dayjs`正常解析时才能使指定的日历范围生效,仅有一项正常解析时则为仅指定日历范围上限或下限。TS 类型:`Array` `type CalendarValue = string \| Date`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N theme | String | full | 日历风格。可选项:full/card | N value | String / Array / Date | - | 当前高亮的日期。TS 类型:`CalendarValue \| CalendarValue[]` `type CalendarValue = string \| Date`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N week | TNode | - | 用于自定义日历星期呈现方式。CalendarWeek.day 表示当前是星期几。示例一:['周一', '周二', '周三', '周四', '周五', '星期六', '星期天']。示例二:`({ day }) => '周' + day`。TS 类型:`Array \| TNode` `interface CalendarWeek { day: WeekDay }` `type WeekDay = 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N @@ -30,9 +30,17 @@ onCellRightClick | Function | | TS 类型:`(options: { cell: CalendarCell; e: onControllerChange | Function | | TS 类型:`(options: ControllerOptions) => void`
右上角控件组选中值有变化的时候触发。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
| N onMonthChange | Function | | TS 类型:`(options: { month: string; year: string }) => void`
月份切换时触发 | N +### CalendarInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +toCurrent | \- | \- | 跳转到今天 + ### CalendarController -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- current | Object | - | “今天(本月)”按钮控制器。TS 类型:`{ visible?: boolean; currentDayButtonProps?: ButtonProps; currentMonthButtonProps?: ButtonProps }`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N disabled | Boolean | false | 是否禁用右上角控制器 | N @@ -43,7 +51,7 @@ year | Object | - | 日历年份控制器。TS 类型:`{ visible?: boolean; se ### CalendarCell -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- belongTo | Number | - | 用于表示日期单元格属于哪一个月份。值为 0 表示是当前日历显示的月份中的日期,值为 -1 表示是上个月的,值为 1 表示是下个月的(日历展示维度是“月”时有值) | N date | Object | - | 日历单元格日期。TS 类型:`Date` | N @@ -51,4 +59,4 @@ day | Number | - | 日期单元格对应的星期,值为 1~7,表示周一到 formattedDate | String | - | 日历单元格日期字符串(输出日期的格式和 format 有关) | N isCurrent | Boolean | - | 日期单元格是否为当前高亮日期或高亮月份 | N weekOrder | Number | - | 日期在本月的第几周(日历展示维度是“月”时有值) | N -`ControllerOptions` | \- | - | 继承 `ControllerOptions` 中的全部 API | N +`ControllerOptions` | \- | - | 继承 `ControllerOptions` 中的全部属性 | N diff --git a/packages/products/tdesign-react/packages/components/calendar/type.ts b/packages/products/tdesign-react/packages/components/calendar/type.ts index 37ca0c7b2..e50b717a0 100644 --- a/packages/products/tdesign-react/packages/components/calendar/type.ts +++ b/packages/products/tdesign-react/packages/components/calendar/type.ts @@ -65,7 +65,7 @@ export interface TdCalendarProps { */ preventCellContextmenu?: boolean; /** - * 用于设置日历的年月份显示范围,[范围开始,范围结束] + * 用于设置日历的年月份显示范围,[范围开始,范围结束]。示例一:`['2018-08', '2028-04']`。示例二:`[new Date(2018, 8), new Date(2028, 4)]`。传入列表的两项均能被`dayjs`正常解析时才能使指定的日历范围生效,仅有一项正常解析时则为仅指定日历范围上限或下限 */ range?: Array; /** @@ -107,6 +107,14 @@ export interface TdCalendarProps { onMonthChange?: (options: { month: string; year: string }) => void; } +/** 组件实例方法 */ +export interface CalendarInstanceFunctions { + /** + * 跳转到今天 + */ + toCurrent?: () => void; +} + export interface CalendarController { /** * “今天(本月)”按钮控制器 diff --git a/packages/products/tdesign-vue-next/packages/components/calendar/calendar.en-US.md b/packages/products/tdesign-vue-next/packages/components/calendar/calendar.en-US.md index 783874dcb..eb51cc2e5 100644 --- a/packages/products/tdesign-vue-next/packages/components/calendar/calendar.en-US.md +++ b/packages/products/tdesign-vue-next/packages/components/calendar/calendar.en-US.md @@ -5,28 +5,28 @@ name | type | default | description | required -- | -- | -- | -- | -- -cell | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -cellAppend | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -controllerConfig | Boolean / Object | undefined | Typescript:`boolean \| CalendarController` | N +cell | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +cellAppend | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +controllerConfig | Boolean / Object | undefined | Typescript: `boolean \| CalendarController` | N fillWithZero | Boolean | true | \- | N -firstDayOfWeek | Number | 1 | options:1/2/3/4/5/6/7 | N +firstDayOfWeek | Number | 1 | options: 1/2/3/4/5/6/7 | N format | String | 'YYYY-MM-DD' | \- | N -head | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N +head | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N isShowWeekendDefault | Boolean | true | \- | N -mode | String | month | options:month/year | N +mode | String | month | options: month/year | N month | String / Number | - | \- | N multiple | Boolean | - | \- | N preventCellContextmenu | Boolean | false | \- | N -range | Array | - | Typescript:`Array` | N -theme | String | full | options:full/card | N -value | String / Array / Date | - | Typescript:`CalendarValue \| CalendarValue[]` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N -week | Array / Slot / Function | - | Typescript:`Array \| TNode` `interface CalendarWeek { day: WeekDay }` `type WeekDay = 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7`。[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/calendar/type.ts) | N +range | Array | - | Set the year and month display range of calendar, [start, end]. Example 1: `['2018-08', '2028-04']`. Example 2: `[new Date(2018, 8), new Date(2028, 4)]`. Only when both items from the input list can be parsed normally by `dayjs` can the specified calendar range take effect, while you can set the start or end of the range separately by inputting a list with only one item that can be parsed normally。Typescript: `Array` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N +theme | String | full | options: full/card | N +value | String / Array / Date | - | Typescript: `CalendarValue \| CalendarValue[]` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N +week | Array / Slot / Function | - | Typescript: `Array \| TNode` `interface CalendarWeek { day: WeekDay }` `type WeekDay = 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7`。[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/calendar/type.ts) | N year | String / Number | - | \- | N -onCellClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N -onCellDoubleClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N -onCellRightClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N -onControllerChange | Function | | Typescript:`(options: ControllerOptions) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
| N -onMonthChange | Function | | Typescript:`(options: { month: string; year: string }) => void`
| N +onCellClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N +onCellDoubleClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N +onCellRightClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N +onControllerChange | Function | | Typescript: `(options: ControllerOptions) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
| N +onMonthChange | Function | | Typescript: `(options: { month: string; year: string }) => void`
| N ### Calendar Events @@ -38,25 +38,31 @@ cell-right-click | `(options: { cell: CalendarCell; e: MouseEvent })` | \- controller-change | `(options: ControllerOptions)` | [see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
month-change | `(options: { month: string; year: string })` | \- +### CalendarInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +toCurrent | \- | \- | go to today + ### CalendarController name | type | default | description | required -- | -- | -- | -- | -- -current | Object | - | Typescript:`{ visible?: boolean; currentDayButtonProps?: ButtonProps; currentMonthButtonProps?: ButtonProps }`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N +current | Object | - | Typescript: `{ visible?: boolean; currentDayButtonProps?: ButtonProps; currentMonthButtonProps?: ButtonProps }`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N disabled | Boolean | false | \- | N -mode | Object | - | Typescript:`{ visible?: boolean; radioGroupProps?: RadioGroupProps }`,[Radio API Documents](./radio?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N -month | Object | - | Typescript:`{ visible?: boolean; selectProps?: SelectProps }` | N -weekend | Object | - | Typescript:`{ visible?: boolean; showWeekendButtonProps?: CheckTagProps; hideWeekendButtonProps?: CheckTagProps }`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N -year | Object | - | Typescript:`{ visible?: boolean; selectProps?: SelectProps }`,[Select API Documents](./select?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N +mode | Object | - | Typescript: `{ visible?: boolean; radioGroupProps?: RadioGroupProps }`,[Radio API Documents](./radio?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N +month | Object | - | Typescript: `{ visible?: boolean; selectProps?: SelectProps }` | N +weekend | Object | - | Typescript: `{ visible?: boolean; showWeekendButtonProps?: CheckTagProps; hideWeekendButtonProps?: CheckTagProps }`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N +year | Object | - | Typescript: `{ visible?: boolean; selectProps?: SelectProps }`,[Select API Documents](./select?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N ### CalendarCell name | type | default | description | required -- | -- | -- | -- | -- belongTo | Number | - | \- | N -date | Object | - | Typescript:`Date` | N +date | Object | - | Typescript: `Date` | N day | Number | - | \- | N formattedDate | String | - | \- | N isCurrent | Boolean | - | \- | N weekOrder | Number | - | \- | N -`ControllerOptions` | \- | - | \- | N +`ControllerOptions` | \- | - | extends `ControllerOptions` | N diff --git a/packages/products/tdesign-vue-next/packages/components/calendar/calendar.md b/packages/products/tdesign-vue-next/packages/components/calendar/calendar.md index 1a6afe343..ea9c0cd98 100644 --- a/packages/products/tdesign-vue-next/packages/components/calendar/calendar.md +++ b/packages/products/tdesign-vue-next/packages/components/calendar/calendar.md @@ -3,7 +3,7 @@ ## API ### Calendar Props -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- cell | String / Slot / Function | - | 单元格插槽。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N cellAppend | String / Slot / Function | - | 单元格插槽,在原来的内容之后追加。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N @@ -17,7 +17,7 @@ mode | String | month | 日历展示维度。可选项:month/year | N month | String / Number | - | 控制当前面板展示月份,优先级高于 `controllerConfig.month` | N multiple | Boolean | - | 是否高亮多个日期单元格 | N preventCellContextmenu | Boolean | false | 是否禁用单元格右键默认系统菜单 | N -range | Array | - | 用于设置日历的年月份显示范围,[范围开始,范围结束]。TS 类型:`Array` | N +range | Array | - | 用于设置日历的年月份显示范围,[范围开始,范围结束]。示例一:`['2018-08', '2028-04']`。示例二:`[new Date(2018, 8), new Date(2028, 4)]`。传入列表的两项均能被`dayjs`正常解析时才能使指定的日历范围生效,仅有一项正常解析时则为仅指定日历范围上限或下限。TS 类型:`Array` `type CalendarValue = string \| Date`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N theme | String | full | 日历风格。可选项:full/card | N value | String / Array / Date | - | 当前高亮的日期。TS 类型:`CalendarValue \| CalendarValue[]` `type CalendarValue = string \| Date`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N week | Array / Slot / Function | - | 用于自定义日历星期呈现方式。CalendarWeek.day 表示当前是星期几。示例一:['周一', '周二', '周三', '周四', '周五', '星期六', '星期天']。示例二:`({ day }) => '周' + day`。TS 类型:`Array \| TNode` `interface CalendarWeek { day: WeekDay }` `type WeekDay = 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N @@ -38,9 +38,15 @@ cell-right-click | `(options: { cell: CalendarCell; e: MouseEvent })` | 日历 controller-change | `(options: ControllerOptions)` | 右上角控件组选中值有变化的时候触发。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
month-change | `(options: { month: string; year: string })` | 月份切换时触发 +### CalendarInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +toCurrent | \- | \- | 跳转到今天 + ### CalendarController -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- current | Object | - | “今天(本月)”按钮控制器。TS 类型:`{ visible?: boolean; currentDayButtonProps?: ButtonProps; currentMonthButtonProps?: ButtonProps }`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/calendar/type.ts) | N disabled | Boolean | false | 是否禁用右上角控制器 | N @@ -51,7 +57,7 @@ year | Object | - | 日历年份控制器。TS 类型:`{ visible?: boolean; se ### CalendarCell -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- belongTo | Number | - | 用于表示日期单元格属于哪一个月份。值为 0 表示是当前日历显示的月份中的日期,值为 -1 表示是上个月的,值为 1 表示是下个月的(日历展示维度是“月”时有值) | N date | Object | - | 日历单元格日期。TS 类型:`Date` | N @@ -59,4 +65,4 @@ day | Number | - | 日期单元格对应的星期,值为 1~7,表示周一到 formattedDate | String | - | 日历单元格日期字符串(输出日期的格式和 format 有关) | N isCurrent | Boolean | - | 日期单元格是否为当前高亮日期或高亮月份 | N weekOrder | Number | - | 日期在本月的第几周(日历展示维度是“月”时有值) | N -`ControllerOptions` | \- | - | 继承 `ControllerOptions` 中的全部 API | N +`ControllerOptions` | \- | - | 继承 `ControllerOptions` 中的全部属性 | N diff --git a/packages/products/tdesign-vue-next/packages/components/calendar/props.ts b/packages/products/tdesign-vue-next/packages/components/calendar/props.ts index 107eb9f94..3b4ff5679 100644 --- a/packages/products/tdesign-vue-next/packages/components/calendar/props.ts +++ b/packages/products/tdesign-vue-next/packages/components/calendar/props.ts @@ -19,7 +19,7 @@ export default { /** 右上角控制器配置。支持全局配置。值为 false 则表示不显示控制器,值为 true 则显示控制器默认配置,值类型为 CalendarController 则显示为自定义控制器配置 */ controllerConfig: { type: [Boolean, Object] as PropType, - default: undefined, + default: undefined as TdCalendarProps['controllerConfig'], }, /** 小于 10 的日期,是否使用 '0' 填充。支持全局配置。默认表现为 `01` `02`,值为 false 表现为 `1` `2` `9` */ fillWithZero: { @@ -65,7 +65,7 @@ export default { multiple: Boolean, /** 是否禁用单元格右键默认系统菜单 */ preventCellContextmenu: Boolean, - /** 用于设置日历的年月份显示范围,[范围开始,范围结束] */ + /** 用于设置日历的年月份显示范围,[范围开始,范围结束]。示例一:`['2018-08', '2028-04']`。示例二:`[new Date(2018, 8), new Date(2028, 4)]`。传入列表的两项均能被`dayjs`正常解析时才能使指定的日历范围生效,仅有一项正常解析时则为仅指定日历范围上限或下限 */ range: { type: Array as PropType, }, diff --git a/packages/products/tdesign-vue-next/packages/components/calendar/type.ts b/packages/products/tdesign-vue-next/packages/components/calendar/type.ts index 1b09ab43b..f186eb2c0 100644 --- a/packages/products/tdesign-vue-next/packages/components/calendar/type.ts +++ b/packages/products/tdesign-vue-next/packages/components/calendar/type.ts @@ -64,7 +64,7 @@ export interface TdCalendarProps { */ preventCellContextmenu?: boolean; /** - * 用于设置日历的年月份显示范围,[范围开始,范围结束] + * 用于设置日历的年月份显示范围,[范围开始,范围结束]。示例一:`['2018-08', '2028-04']`。示例二:`[new Date(2018, 8), new Date(2028, 4)]`。传入列表的两项均能被`dayjs`正常解析时才能使指定的日历范围生效,仅有一项正常解析时则为仅指定日历范围上限或下限 */ range?: Array; /** @@ -106,6 +106,14 @@ export interface TdCalendarProps { onMonthChange?: (options: { month: string; year: string }) => void; } +/** 组件实例方法 */ +export interface CalendarInstanceFunctions { + /** + * 跳转到今天 + */ + toCurrent?: () => void; +} + export interface CalendarController { /** * “今天(本月)”按钮控制器 diff --git a/packages/products/tdesign-vue/src/calendar/calendar.en-US.md b/packages/products/tdesign-vue/src/calendar/calendar.en-US.md index f9421143f..15bdafa2d 100644 --- a/packages/products/tdesign-vue/src/calendar/calendar.en-US.md +++ b/packages/products/tdesign-vue/src/calendar/calendar.en-US.md @@ -5,28 +5,28 @@ name | type | default | description | required -- | -- | -- | -- | -- -cell | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -cellAppend | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -controllerConfig | Boolean / Object | undefined | Typescript:`boolean \| CalendarController` | N +cell | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +cellAppend | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +controllerConfig | Boolean / Object | undefined | Typescript: `boolean \| CalendarController` | N fillWithZero | Boolean | true | \- | N -firstDayOfWeek | Number | 1 | options:1/2/3/4/5/6/7 | N +firstDayOfWeek | Number | 1 | options: 1/2/3/4/5/6/7 | N format | String | 'YYYY-MM-DD' | \- | N -head | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +head | String / Slot / Function | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N isShowWeekendDefault | Boolean | true | \- | N -mode | String | month | options:month/year | N +mode | String | month | options: month/year | N month | String / Number | - | \- | N multiple | Boolean | - | \- | N preventCellContextmenu | Boolean | false | \- | N -range | Array | - | Typescript:`Array` | N -theme | String | full | options:full/card | N -value | String / Array / Date | - | Typescript:`CalendarValue \| CalendarValue[]` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N -week | Array / Slot / Function | - | Typescript:`Array \| TNode` `interface CalendarWeek { day: WeekDay }` `type WeekDay = 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7`。[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/calendar/type.ts) | N +range | Array | - | Set the year and month display range of calendar, [start, end]. Example 1: `['2018-08', '2028-04']`. Example 2: `[new Date(2018, 8), new Date(2028, 4)]`. Only when both items from the input list can be parsed normally by `dayjs` can the specified calendar range take effect, while you can set the start or end of the range separately by inputting a list with only one item that can be parsed normally。Typescript: `Array` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N +theme | String | full | options: full/card | N +value | String / Array / Date | - | Typescript: `CalendarValue \| CalendarValue[]` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N +week | Array / Slot / Function | - | Typescript: `Array \| TNode` `interface CalendarWeek { day: WeekDay }` `type WeekDay = 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7`。[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/calendar/type.ts) | N year | String / Number | - | \- | N -onCellClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N -onCellDoubleClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N -onCellRightClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N -onControllerChange | Function | | Typescript:`(options: ControllerOptions) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
| N -onMonthChange | Function | | Typescript:`(options: { month: string; year: string }) => void`
| N +onCellClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N +onCellDoubleClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N +onCellRightClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`
| N +onControllerChange | Function | | Typescript: `(options: ControllerOptions) => void`
[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
| N +onMonthChange | Function | | Typescript: `(options: { month: string; year: string }) => void`
| N ### Calendar Events @@ -38,25 +38,31 @@ cell-right-click | `(options: { cell: CalendarCell; e: MouseEvent })` | \- controller-change | `(options: ControllerOptions)` | [see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
month-change | `(options: { month: string; year: string })` | \- +### CalendarInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +toCurrent | \- | \- | go to today + ### CalendarController name | type | default | description | required -- | -- | -- | -- | -- -current | Object | - | Typescript:`{ visible?: boolean; currentDayButtonProps?: ButtonProps; currentMonthButtonProps?: ButtonProps }`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N +current | Object | - | Typescript: `{ visible?: boolean; currentDayButtonProps?: ButtonProps; currentMonthButtonProps?: ButtonProps }`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N disabled | Boolean | false | \- | N -mode | Object | - | Typescript:`{ visible?: boolean; radioGroupProps?: RadioGroupProps }`,[Radio API Documents](./radio?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N -month | Object | - | Typescript:`{ visible?: boolean; selectProps?: SelectProps }` | N -weekend | Object | - | Typescript:`{ visible?: boolean; showWeekendButtonProps?: CheckTagProps; hideWeekendButtonProps?: CheckTagProps }`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N -year | Object | - | Typescript:`{ visible?: boolean; selectProps?: SelectProps }`,[Select API Documents](./select?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N +mode | Object | - | Typescript: `{ visible?: boolean; radioGroupProps?: RadioGroupProps }`,[Radio API Documents](./radio?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N +month | Object | - | Typescript: `{ visible?: boolean; selectProps?: SelectProps }` | N +weekend | Object | - | Typescript: `{ visible?: boolean; showWeekendButtonProps?: CheckTagProps; hideWeekendButtonProps?: CheckTagProps }`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N +year | Object | - | Typescript: `{ visible?: boolean; selectProps?: SelectProps }`,[Select API Documents](./select?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N ### CalendarCell name | type | default | description | required -- | -- | -- | -- | -- belongTo | Number | - | \- | N -date | Object | - | Typescript:`Date` | N +date | Object | - | Typescript: `Date` | N day | Number | - | \- | N formattedDate | String | - | \- | N isCurrent | Boolean | - | \- | N weekOrder | Number | - | \- | N -`ControllerOptions` | \- | - | \- | N +`ControllerOptions` | \- | - | extends `ControllerOptions` | N diff --git a/packages/products/tdesign-vue/src/calendar/calendar.md b/packages/products/tdesign-vue/src/calendar/calendar.md index 7238adbbf..3a9e4743d 100644 --- a/packages/products/tdesign-vue/src/calendar/calendar.md +++ b/packages/products/tdesign-vue/src/calendar/calendar.md @@ -3,7 +3,7 @@ ## API ### Calendar Props -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- cell | String / Slot / Function | - | 单元格插槽。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N cellAppend | String / Slot / Function | - | 单元格插槽,在原来的内容之后追加。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N @@ -17,7 +17,7 @@ mode | String | month | 日历展示维度。可选项:month/year | N month | String / Number | - | 控制当前面板展示月份,优先级高于 `controllerConfig.month` | N multiple | Boolean | - | 是否高亮多个日期单元格 | N preventCellContextmenu | Boolean | false | 是否禁用单元格右键默认系统菜单 | N -range | Array | - | 用于设置日历的年月份显示范围,[范围开始,范围结束]。TS 类型:`Array` | N +range | Array | - | 用于设置日历的年月份显示范围,[范围开始,范围结束]。示例一:`['2018-08', '2028-04']`。示例二:`[new Date(2018, 8), new Date(2028, 4)]`。传入列表的两项均能被`dayjs`正常解析时才能使指定的日历范围生效,仅有一项正常解析时则为仅指定日历范围上限或下限。TS 类型:`Array` `type CalendarValue = string \| Date`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N theme | String | full | 日历风格。可选项:full/card | N value | String / Array / Date | - | 当前高亮的日期。TS 类型:`CalendarValue \| CalendarValue[]` `type CalendarValue = string \| Date`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N week | Array / Slot / Function | - | 用于自定义日历星期呈现方式。CalendarWeek.day 表示当前是星期几。示例一:['周一', '周二', '周三', '周四', '周五', '星期六', '星期天']。示例二:`({ day }) => '周' + day`。TS 类型:`Array \| TNode` `interface CalendarWeek { day: WeekDay }` `type WeekDay = 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N @@ -38,9 +38,15 @@ cell-right-click | `(options: { cell: CalendarCell; e: MouseEvent })` | 日历 controller-change | `(options: ControllerOptions)` | 右上角控件组选中值有变化的时候触发。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts)。
`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`
month-change | `(options: { month: string; year: string })` | 月份切换时触发 +### CalendarInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +toCurrent | \- | \- | 跳转到今天 + ### CalendarController -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- current | Object | - | “今天(本月)”按钮控制器。TS 类型:`{ visible?: boolean; currentDayButtonProps?: ButtonProps; currentMonthButtonProps?: ButtonProps }`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/calendar/type.ts) | N disabled | Boolean | false | 是否禁用右上角控制器 | N @@ -51,7 +57,7 @@ year | Object | - | 日历年份控制器。TS 类型:`{ visible?: boolean; se ### CalendarCell -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- belongTo | Number | - | 用于表示日期单元格属于哪一个月份。值为 0 表示是当前日历显示的月份中的日期,值为 -1 表示是上个月的,值为 1 表示是下个月的(日历展示维度是“月”时有值) | N date | Object | - | 日历单元格日期。TS 类型:`Date` | N @@ -59,4 +65,4 @@ day | Number | - | 日期单元格对应的星期,值为 1~7,表示周一到 formattedDate | String | - | 日历单元格日期字符串(输出日期的格式和 format 有关) | N isCurrent | Boolean | - | 日期单元格是否为当前高亮日期或高亮月份 | N weekOrder | Number | - | 日期在本月的第几周(日历展示维度是“月”时有值) | N -`ControllerOptions` | \- | - | 继承 `ControllerOptions` 中的全部 API | N +`ControllerOptions` | \- | - | 继承 `ControllerOptions` 中的全部属性 | N diff --git a/packages/products/tdesign-vue/src/calendar/props.ts b/packages/products/tdesign-vue/src/calendar/props.ts index 107eb9f94..f645943f0 100644 --- a/packages/products/tdesign-vue/src/calendar/props.ts +++ b/packages/products/tdesign-vue/src/calendar/props.ts @@ -65,7 +65,7 @@ export default { multiple: Boolean, /** 是否禁用单元格右键默认系统菜单 */ preventCellContextmenu: Boolean, - /** 用于设置日历的年月份显示范围,[范围开始,范围结束] */ + /** 用于设置日历的年月份显示范围,[范围开始,范围结束]。示例一:`['2018-08', '2028-04']`。示例二:`[new Date(2018, 8), new Date(2028, 4)]`。传入列表的两项均能被`dayjs`正常解析时才能使指定的日历范围生效,仅有一项正常解析时则为仅指定日历范围上限或下限 */ range: { type: Array as PropType, }, diff --git a/packages/products/tdesign-vue/src/calendar/type.ts b/packages/products/tdesign-vue/src/calendar/type.ts index 1b09ab43b..f186eb2c0 100644 --- a/packages/products/tdesign-vue/src/calendar/type.ts +++ b/packages/products/tdesign-vue/src/calendar/type.ts @@ -64,7 +64,7 @@ export interface TdCalendarProps { */ preventCellContextmenu?: boolean; /** - * 用于设置日历的年月份显示范围,[范围开始,范围结束] + * 用于设置日历的年月份显示范围,[范围开始,范围结束]。示例一:`['2018-08', '2028-04']`。示例二:`[new Date(2018, 8), new Date(2028, 4)]`。传入列表的两项均能被`dayjs`正常解析时才能使指定的日历范围生效,仅有一项正常解析时则为仅指定日历范围上限或下限 */ range?: Array; /** @@ -106,6 +106,14 @@ export interface TdCalendarProps { onMonthChange?: (options: { month: string; year: string }) => void; } +/** 组件实例方法 */ +export interface CalendarInstanceFunctions { + /** + * 跳转到今天 + */ + toCurrent?: () => void; +} + export interface CalendarController { /** * “今天(本月)”按钮控制器 diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 509209ef9..e5a2d8f0d 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -17401,14 +17401,14 @@ ], "field_default_value": "", "field_enum": "", - "field_desc_zh": "用于设置日历的年月份显示范围,[范围开始,范围结束]", - "field_desc_en": null, + "field_desc_zh": "用于设置日历的年月份显示范围,[范围开始,范围结束]。示例一:`['2018-08', '2028-04']`。示例二:`[new Date(2018, 8), new Date(2028, 4)]`。传入列表的两项均能被`dayjs`正常解析时才能使指定的日历范围生效,仅有一项正常解析时则为仅指定日历范围上限或下限", + "field_desc_en": "Set the year and month display range of calendar, [start, end]. Example 1: `['2018-08', '2028-04']`. Example 2: `[new Date(2018, 8), new Date(2028, 4)]`. Only when both items from the input list can be parsed normally by `dayjs` can the specified calendar range take effect, while you can set the start or end of the range separately by inputting a list with only one item that can be parsed normally", "field_required": 0, "event_input": "", "create_time": "2021-01-15 11:04:51", "update_time": "2021-01-16 12:15:06", "event_output": null, - "custom_field_type": "Array", + "custom_field_type": "Array【type CalendarValue = string | Date】", "syntactic_sugar": "", "readonly": 1, "html_attribute": 0,