import { ViewProps } from 'remax/one'; import dayjs, { ManipulateType } from 'dayjs'; import React from 'react'; type Current = dayjs.Dayjs | [dayjs.Dayjs | undefined, dayjs.Dayjs | undefined]; export interface Props { /** * 样式类名 */ className?: string; /** * 子项样式类名 */ itemCls?: string; /** * 选中的子项样式类名 */ activeItemCls?: string; /** * 选中的标记点样式类名 */ activeDotCls?: string; /** * 不可选中的子项样式类名 */ disableItemCls?: string; /** * 标记点的类名 */ dotCls?: string; /** * 标记点Wrap的类名 */ dotWrapCls?: string; /** * 日期范围选择 */ range?: boolean; /** * 选中的日期,range为true是返回的是数组 */ current?: Current; /** * 选中的日期改变的事件,range为true是返回的是数组 */ onChange?: (day: Current) => void; /** * 渲染标记点,返回false不显示,可以返回一个元素可以自定义显示 */ renderDot?: (day: dayjs.Dayjs, index: number) => React.ReactNode | boolean; /** * 渲染禁止的日期 * @default day => day.isBefore(dayjs(), 'date') */ renderDisable?: (day: dayjs.Dayjs) => boolean; /** * 日期范围天数 * @default 14 */ limit?: number; /** * 自定义渲染 */ renderDate?: (day: dayjs.Dayjs) => React.ReactNode; /** * 自定义渲染item props */ renderItemProps?: (day: dayjs.Dayjs) => ViewProps; /** * 设置这个后会渲染成列表模式 */ listEndDay?: dayjs.Dayjs; /** * 列表模式的月份类名 */ monthCls?: string; /** * 开始时间 * @default 今天 */ startDay?: dayjs.Dayjs; /** * 星期排列偏移 * @default 0 */ weekOffset?: number; /** * 适老模式,开启后尺寸会变大 */ elderly?: boolean; style?: React.CSSProperties; /** * 星期的类名 */ weekCls?: string; /** * 被范围选择项的类名 */ rangeActiveCls?: string; /** * 禁止的日期是否可以被选择 */ disabledCanChoose?: boolean; /** * 小范围切换单位 */ smallRangeUnit?: ManipulateType; /** * 大范围切换单位 */ bigRangeUnit?: ManipulateType; /** * 自定义星期文案 */ weeks?: string[]; } declare const Calendar: { ({ className, current, renderDot, onChange: _onChange, itemCls, renderDisable, activeItemCls, disableItemCls, activeDotCls, dotWrapCls, limit, renderDate, listEndDay: _listEndDay, weekOffset, monthCls, startDay: _outStartDay, renderItemProps, dotCls, range, weekCls, rangeActiveCls, disabledCanChoose, weeks, ...props }: Props): React.JSX.Element; Picker: ({ style, startDay, current, renderDisable, headerCls, onPickerChange, smallRangeUnit, bigRangeUnit, ...props }: Props & { headerCls?: string | undefined; onPickerChange?: ((day: dayjs.Dayjs | [dayjs.Dayjs | undefined, dayjs.Dayjs | undefined]) => void) | undefined; }) => React.JSX.Element; }; export default Calendar;