import { Dayjs } from 'dayjs';
import { HTMLAttributes, ReactNode } from 'react';
import { DropPlacementsType, ShapeType, SizeType, ThemeType } from '../const/types.cjs';
import { IconType } from '../icon/index.cjs';
export type DatePickerValueType = "date" | "timestamp" | "unix" | "string";
export type DatePickerModeType = "year" | "month" | "date" | "time" | "dateTime" | "dateRange" | "dateTimeRange";
export type DatePickerInput = Date | Dayjs | string | number | null | undefined;
export type DatePickerOutput = Date | string | number | null;
export interface DatePickerPreset {
label: string;
value: () => DatePickerInput | DatePickerInput[];
}
export interface DatePickerProps extends Omit, "onChange" | "children" | "defaultValue" | "defaultChecked"> {
value?: DatePickerInput | DatePickerInput[];
startDate?: DatePickerInput;
endDate?: DatePickerInput;
valueType?: DatePickerValueType;
mode?: DatePickerModeType;
presets?: DatePickerPreset[];
disabled?: boolean;
readOnly?: boolean;
open?: boolean;
clearable?: boolean;
editable?: boolean;
placeholder?: string | string[];
format?: string;
disabledDate?: (date: Date) => boolean;
disabledTime?: (date: Date) => boolean;
size?: SizeType;
dateIcon?: IconType[];
theme?: ThemeType;
shape?: ShapeType;
bordered?: boolean;
placement?: DropPlacementsType;
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
destroyOnClose?: boolean;
header?: ReactNode | ((api: {
emit: (value: DatePickerInput | DatePickerInput[]) => void;
}) => ReactNode);
footer?: ReactNode | ((api: {
emit: (value: DatePickerInput | DatePickerInput[]) => void;
}) => ReactNode);
onChange?: (date: DatePickerOutput | DatePickerOutput[], dateStr: string | string[]) => void;
onStartDateChange?: (value: DatePickerOutput) => void;
onEndDateChange?: (value: DatePickerOutput) => void;
onOpenChange?: (open: boolean) => void;
onClear?: () => void;
/** Render only the picker panel without a trigger or portal. */
panelOnly?: boolean;
}
declare function DatePicker({ value, startDate, endDate, valueType, mode, presets, disabled, readOnly, open, clearable, editable, placeholder, format, disabledDate, disabledTime, size: sizeProp, dateIcon, theme: themeProp, shape: shapeProp, bordered, placement, destroyOnClose, header, footer, onChange, onStartDateChange, onEndDateChange, onOpenChange, onClear, panelOnly, className, style, ...rest }: DatePickerProps): import("react").JSX.Element;
export type DatePickerPanelProps = Omit;
export declare function DatePickerPanel(props: DatePickerPanelProps): import("react").JSX.Element;
declare const _default: typeof DatePicker;
export default _default;