diff --git a/components/calendar/index.en-US.md b/components/calendar/index.en-US.md index 87cf2c9885..0c1e9ab1f5 100644 --- a/components/calendar/index.en-US.md +++ b/components/calendar/index.en-US.md @@ -47,7 +47,7 @@ Common props ref:[Common props](/docs/react/common-props) | disabledDate | Function that specifies the dates that cannot be selected, `currentDate` is same dayjs object as `value` prop which you shouldn't mutate it](https://github.com/ant-design/ant-design/issues/30987) | (currentDate: Dayjs) => boolean | - | | | fullscreen | Whether to display in full-screen | boolean | true | | | showWeek | Whether to display week number | boolean | false | 5.23.0 | -| headerRender | Render custom header in panel | function(object:{value: Dayjs, type: string, onChange: f(), onTypeChange: f()}) | - | | +| headerRender | Render custom header in panel | function(object:{value: Dayjs, type: 'year' \| 'month', onChange: f(), onTypeChange: f()}) | - | | | locale | The calendar's locale | object | [(default)](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) | | | mode | The display mode of the calendar | `month` \| `year` | `month` | | | validRange | To set valid range | \[[dayjs](https://day.js.org/), [dayjs](https://day.js.org/)] | - | | diff --git a/components/calendar/index.tsx b/components/calendar/index.tsx index d89d8cec86..d340679b3e 100644 --- a/components/calendar/index.tsx +++ b/components/calendar/index.tsx @@ -1,7 +1,7 @@ import type { Dayjs } from 'dayjs'; import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs'; -import type { CalendarProps } from './generateCalendar'; +import type { CalendarMode, CalendarProps } from './generateCalendar'; import generateCalendar from './generateCalendar'; const Calendar = generateCalendar(dayjsGenerateConfig); @@ -12,5 +12,5 @@ export type CalendarType = typeof Calendar & { (Calendar as CalendarType).generateCalendar = generateCalendar; -export type { CalendarProps }; +export type { CalendarMode, CalendarProps }; export default Calendar as CalendarType; diff --git a/components/calendar/index.zh-CN.md b/components/calendar/index.zh-CN.md index 46217865b6..707911d643 100644 --- a/components/calendar/index.zh-CN.md +++ b/components/calendar/index.zh-CN.md @@ -48,7 +48,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*-p-wQLik200AAA | disabledDate | 不可选择的日期,参数为当前 `value`,注意使用时[不要直接修改](https://github.com/ant-design/ant-design/issues/30987) | (currentDate: Dayjs) => boolean | - | | | fullscreen | 是否全屏显示 | boolean | true | | | showWeek | 是否显示周数列 | boolean | false | 5.23.0 | -| headerRender | 自定义头部内容 | function(object:{value: Dayjs, type: string, onChange: f(), onTypeChange: f()}) | - | | +| headerRender | 自定义头部内容 | function(object:{value: Dayjs, type: 'year' \| 'month', onChange: f(), onTypeChange: f()}) | - | | | locale | 国际化配置 | object | [(默认配置)](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) | | | mode | 初始模式 | `month` \| `year` | `month` | | | validRange | 设置可以显示的日期 | \[[dayjs](https://day.js.org/), [dayjs](https://day.js.org/)] | - | | diff --git a/components/index.ts b/components/index.ts index c4410ce792..b081087cdd 100644 --- a/components/index.ts +++ b/components/index.ts @@ -21,7 +21,7 @@ export type { BreadcrumbItemProps, BreadcrumbProps } from './breadcrumb'; export { default as Button } from './button'; export type { ButtonProps } from './button'; export { default as Calendar } from './calendar'; -export type { CalendarProps } from './calendar'; +export type { CalendarMode, CalendarProps } from './calendar'; export { default as Card } from './card'; export type { CardProps } from './card'; export { default as Carousel } from './carousel';