|
5 | 5 |
|
6 | 6 | name | type | default | description | required |
7 | 7 | -- | -- | -- | -- | -- |
8 | | -className | String | - | 类名 | N |
9 | | -style | Object | - | 样式,Typescript:`React.CSSProperties` | N |
10 | | -cell | TNode | - | Typescript:`string \| TNode<CalendarCell>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N |
11 | | -cellAppend | TNode | - | Typescript:`string \| TNode<CalendarCell>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N |
12 | | -controllerConfig | Boolean / Object | undefined | Typescript:`boolean \| CalendarController` | N |
| 8 | +className | String | - | className of component | N |
| 9 | +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N |
| 10 | +cell | TNode | - | Typescript: `string \| TNode<CalendarCell>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N |
| 11 | +cellAppend | TNode | - | Typescript: `string \| TNode<CalendarCell>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N |
| 12 | +controllerConfig | Boolean / Object | undefined | Typescript: `boolean \| CalendarController` | N |
13 | 13 | fillWithZero | Boolean | true | \- | N |
14 | | -firstDayOfWeek | Number | 1 | options:1/2/3/4/5/6/7 | N |
| 14 | +firstDayOfWeek | Number | 1 | options: 1/2/3/4/5/6/7 | N |
15 | 15 | format | String | 'YYYY-MM-DD' | \- | N |
16 | | -head | TNode | - | Typescript:`string \| TNode<ControllerOptions>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N |
| 16 | +head | TNode | - | Typescript: `string \| TNode<ControllerOptions>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N |
17 | 17 | isShowWeekendDefault | Boolean | true | \- | N |
18 | | -mode | String | month | options:month/year | N |
| 18 | +mode | String | month | options: month/year | N |
19 | 19 | month | String / Number | - | \- | N |
20 | 20 | multiple | Boolean | - | \- | N |
21 | 21 | preventCellContextmenu | Boolean | false | \- | N |
22 | | -range | Array | - | Typescript:`Array<CalendarValue>` | N |
23 | | -theme | String | full | options:full/card | N |
24 | | -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 |
25 | | -week | TNode | - | Typescript:`Array<string> \| TNode<CalendarWeek>` `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 |
| 22 | +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<CalendarValue>` `type CalendarValue = string \| Date`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts) | N |
| 23 | +theme | String | full | options: full/card | N |
| 24 | +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 |
| 25 | +week | TNode | - | Typescript: `Array<string> \| TNode<CalendarWeek>` `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 |
26 | 26 | year | String / Number | - | \- | N |
27 | | -onCellClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`<br/> | N |
28 | | -onCellDoubleClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`<br/> | N |
29 | | -onCellRightClick | Function | | Typescript:`(options: { cell: CalendarCell; e: MouseEvent }) => void`<br/> | N |
30 | | -onControllerChange | Function | | Typescript:`(options: ControllerOptions) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts)。<br/>`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`<br/> | N |
31 | | -onMonthChange | Function | | Typescript:`(options: { month: string; year: string }) => void`<br/> | N |
| 27 | +onCellClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`<br/> | N |
| 28 | +onCellDoubleClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`<br/> | N |
| 29 | +onCellRightClick | Function | | Typescript: `(options: { cell: CalendarCell; e: MouseEvent }) => void`<br/> | N |
| 30 | +onControllerChange | Function | | Typescript: `(options: ControllerOptions) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/calendar/type.ts)。<br/>`interface ControllerOptions { filterDate: Date; formattedFilterDate: string; mode: string; isShowWeekend: boolean }`<br/> | N |
| 31 | +onMonthChange | Function | | Typescript: `(options: { month: string; year: string }) => void`<br/> | N |
| 32 | + |
| 33 | +### CalendarInstanceFunctions 组件实例方法 |
| 34 | + |
| 35 | +name | params | return | description |
| 36 | +-- | -- | -- | -- |
| 37 | +className | String | - | className of component | N |
| 38 | +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N |
| 39 | +toCurrent | \- | \- | go to today |
32 | 40 |
|
33 | 41 | ### CalendarController |
34 | 42 |
|
35 | 43 | name | type | default | description | required |
36 | 44 | -- | -- | -- | -- | -- |
37 | | -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 |
| 45 | +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 |
38 | 46 | disabled | Boolean | false | \- | N |
39 | | -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 |
40 | | -month | Object | - | Typescript:`{ visible?: boolean; selectProps?: SelectProps }` | N |
41 | | -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 |
42 | | -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 |
| 47 | +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 |
| 48 | +month | Object | - | Typescript: `{ visible?: boolean; selectProps?: SelectProps }` | N |
| 49 | +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 |
| 50 | +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 |
43 | 51 |
|
44 | 52 | ### CalendarCell |
45 | 53 |
|
46 | 54 | name | type | default | description | required |
47 | 55 | -- | -- | -- | -- | -- |
48 | 56 | belongTo | Number | - | \- | N |
49 | | -date | Object | - | Typescript:`Date` | N |
| 57 | +date | Object | - | Typescript: `Date` | N |
50 | 58 | day | Number | - | \- | N |
51 | 59 | formattedDate | String | - | \- | N |
52 | 60 | isCurrent | Boolean | - | \- | N |
53 | 61 | weekOrder | Number | - | \- | N |
54 | | -`ControllerOptions` | \- | - | \- | N |
| 62 | +`ControllerOptions` | \- | - | extends `ControllerOptions` | N |
0 commit comments