import { DatePickerProps } from 'element-plus'; type D = string | Date; export type DateValueType = D | [D, D]; export type SelectTime = { /** * 展示的名称 */ text: string; /** * 唯一key */ key: number | string; /** * 选中的时间 */ value: DateValueType | (() => DateValueType) | undefined | null; }; export interface DateSelectProps { /** * 日期选择类型 */ type?: DatePickerProps['type']; /** * 大小 */ size?: 'default' | 'small' | 'large'; /** * 选择的值 Date | [Date, Date] */ modelValue?: DateValueType; /** * 前置的快捷选择类型 */ shortcutActionType?: 'select' | 'radio'; /** * 时间格式字符串 */ valueFormat?: string; /** * shortcutActionType为radio时可以一次时间选择器 */ hideDatePicker?: boolean; /** * shortcutActionType为radio时配置radio项 */ defaultShortcutsTimes?: SelectTime[]; /** * shortcutActionType为radio时默认选中的 */ defaultSelectKey?: string | number; /** * 存在快捷选择时间时, 时间选择器选中事件时是否置空,SelectKey */ dateChangeResetSelectKey?: boolean; } /** * 事件 */ export type DateSelectEmits = { /** * v-mode 事件 */ 'update:modelValue': [value: DateValueType]; /** * 用户确认选定的值时触发 */ 'change': [value: DateValueType]; /** * 快捷方式选择时触发 */ 'shortcutsChange': [SelectTime['key']]; }; export interface ZiDateSelectExpose { /** * 手动聚焦 */ handleFocus: () => void; /** * 手动打开选择面板 */ handleOpen: () => void; /** * 手动关闭选择面板 */ handleClose: () => void; } export interface DateSelectSlot { /** * 自定义范围分割符内容 */ 'range-separator': (props: any) => void; /** * 自定义单元格内容 */ 'default': (props: any) => void; /** * 自定义尾部插槽 */ 'after': () => void; } export {};