@cainiaofe/cn-ui-m
Version:
61 lines (60 loc) • 2.29 kB
TypeScript
import { ReactNode } from 'react';
import { Dayjs } from "../../../utils/dayjs";
import { BasicComponentProps } from "../../../types";
import { CnSelectDrawerProps } from "../../select-drawer";
import { CnCalendarProps } from '../../cn-calendar';
import { IAvailableDate } from './i-available-date';
import { TLanguage } from '@cainiaofe/cn-i18n';
import type { ModeType } from './mode-type';
export interface CnRangeDatePickerProProps extends Omit<BasicComponentProps, 'defaultValue' | 'value' | 'onChange' | 'style'>, Omit<CnCalendarProps, 'value' | 'defaultValue' | 'onChange' | 'renderLabel'>, Omit<CnSelectDrawerProps, 'content' | 'defaultValue' | 'value' | 'onChange' | 'style' | 'cancelText' | 'okText' | 'showIcon' | 'showToolbar' | 'hideButton' | 'notFoundContent' | 'type' | 'showClear' | 'isOverflowEllipsis' | 'drawerTitle' | 'buttonPosition'> {
/**
* 日期格式化
*/
format?: string | ((value: Dayjs) => string);
/**
* 日期输出的格式化方法,影响onChange的返回值
*/
outputFormat?: string | ((value: Dayjs) => unknown);
/**
* 选择日期时,时间戳是否取当天的时间末尾(23:59:59)
*/
endOfDay?: boolean | [boolean, boolean];
/**
* 受控值
*/
value?: IAvailableDate[] | null;
/**
* 默认值
*/
defaultValue?: IAvailableDate[] | null;
/**
* 面板页脚定制
*/
extraFooterRender?: ReactNode | (() => ReactNode);
/**
* 日期值改变时的回调
*/
onChange?: (value: number[] | undefined, dateStr: string[] | undefined) => void;
/**
* 日期面板的状态
*/
mode?: ModeType;
/**
* 自定义渲染每列展示的内容
*/
renderLabel?: ((type: string, data: number) => React.ReactNode) | ((date: Date) => React.ReactNode);
/**
* 是否显示时间
*/
showTime?: boolean;
/**
* 开启国际化适配:不设置 跟随系统配置;true 开启;false 关闭;配置语种 固定语种格式
*/
adapterLocale?: boolean | TLanguage;
/**
* 结束日期是否取当前周期类型的最后一天的时间末尾(23:59:59), 仅在范围选择时有效
* @default false
* @since 0.12.54
*/
endOfRange?: boolean;
}