import { RenderFunction, SetupContext, Ref, ComputedRef } from 'vue' import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentBaseOptions, VxeComponentEventParams, ValueOf, VxeComponentStyleType, VxeComponentSizeType } from '@vxe-ui/core' /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */ export declare const VxeDatePanel: DefineVxeComponentApp export type VxeDatePanelComponent = DefineVxeComponentOptions export type VxeDatePanelInstance = DefineVxeComponentInstance export interface VxeDatePanelConstructor extends VxeComponentBaseOptions, VxeDatePanelMethods { props: VxeDatePanelProps context: SetupContext reactData: DatePanelReactData getRefMaps(): DatePanelPrivateRef getComputeMaps(): DatePanelPrivateComputed renderVN: RenderFunction } export interface DatePanelPrivateRef { refElem: Ref refInput: Ref } export interface VxeDatePanelPrivateRef extends DatePanelPrivateRef {} export namespace VxeDatePanelPropTypes { export type Size = VxeComponentSizeType export type ModelValue = string | number | Date | null | (string | number | Date | null)[] export type ClassName = string export type CellClassName = string | ((params: { $datePanel: VxeDatePanelConstructor; type: string; viewType: VxeDatePanelDefines.DatePanelType; date: Date }) => string) export type Type = 'date' | 'time' | 'datetime' | 'week' | 'month' | 'quarter' | 'year' export type Multiple = boolean export type LimitCount = string | number export type StartDate = string | number | Date | null export type EndDate = string | number | Date | null export type DefaultMode = 'first' | 'last' | '' export type DefaultDate = string | number | Date | null export type DefaultTime = string | number | Date | null export type MinDate = string | number | Date | null export type MaxDate = string | number | Date | null export type StartDay = 0 | 1 | 2 | 3 | 4 | 5 | 6 export type SelectDay = 0 | 1 | 2 | 3 | 4 | 5 | 6 export type LabelFormat = string export type ValueFormat = string export type TimeFormat = string export type ValueSort = boolean export type FestivalMethod = (params: VxeDatePanelDefines.DateFestivalParams) => VxeDatePanelDefines.DateFestivalInfo | null | void export type DisabledMethod = (params: VxeDatePanelDefines.DateDisabledParams) => boolean export interface TimeConfig { hours?: | number[] | string[] | { label?: string | number value: string | number disabled?: boolean }[] hourDisabledMethod?(params: { hour: number }): boolean minutes?: | number[] | string[] | { label?: string | number value: string | number disabled?: boolean }[] minuteDisabledMethod?(params: { minute: number }): boolean seconds?: | number[] | string[] | { label?: string | number value: string | number disabled?: boolean }[] secondDisabledMethod?(params: { second: number }): boolean } } export interface VxeDatePanelProps { size?: VxeDatePanelPropTypes.Size modelValue?: VxeDatePanelPropTypes.ModelValue className?: VxeDatePanelPropTypes.ClassName cellClassName?: VxeDatePanelPropTypes.CellClassName type?: VxeDatePanelPropTypes.Type multiple?: VxeDatePanelPropTypes.Multiple limitCount?: VxeDatePanelPropTypes.LimitCount /** * 日期面板的起始周为星期几 */ startDate?: VxeDatePanelPropTypes.StartDate endDate?: VxeDatePanelPropTypes.EndDate /** * 用于 multiple 模式,当选中值时,视图的显示默认,默认以第一个值来展示视图,可以指定 first 或 last */ defaultMode?: VxeDatePanelPropTypes.DefaultMode /** * 当未绑定值时,默认以当前日期来展示视图,可以指定日期 */ defaultDate?: VxeDatePanelPropTypes.DefaultDate defaultTime?: VxeDatePanelPropTypes.DefaultTime minDate?: VxeDatePanelPropTypes.MinDate maxDate?: VxeDatePanelPropTypes.MaxDate startDay?: VxeDatePanelPropTypes.StartDay labelFormat?: VxeDatePanelPropTypes.LabelFormat valueFormat?: VxeDatePanelPropTypes.ValueFormat timeFormat?: VxeDatePanelPropTypes.TimeFormat ValueSort?: VxeDatePanelPropTypes.ValueSort festivalMethod?: VxeDatePanelPropTypes.FestivalMethod disabledMethod?: VxeDatePanelPropTypes.DisabledMethod timeConfig?: VxeDatePanelPropTypes.TimeConfig /** * 只对 type=week 有效,选中日期后指定为一周的哪一天 */ selectDay?: VxeDatePanelPropTypes.SelectDay } export interface DatePanelPrivateComputed { computeSize: ComputedRef computeYearList: ComputedRef } export interface VxeDatePanelPrivateComputed extends DatePanelPrivateComputed {} export interface DatePanelReactData { visiblePanel: boolean isAniVisible: boolean isActivated: boolean inputValue: any inputLabel: any datetimePanelValue: Date | null datePanelValue: Date | null datePanelLabel: string datePanelType: VxeDatePanelDefines.DatePanelType selectMonth: Date | null currentDate: Date | null } export interface DatePanelInternalData { yearSize: number monthSize: number quarterSize: number hpTimeout?: undefined | number } export interface DatePanelMethods { dispatchEvent(type: ValueOf, params: Record, evnt: Event | null): void getModelValue(): string getViewType(): VxeDatePanelDefines.DatePanelType setPanelDate(date: Date): void getPanelDate(): Date checkValue(inputLabel: string): void confirmByEvent(event: Event): void } export interface VxeDatePanelMethods extends DatePanelMethods {} export interface DatePanelPrivateMethods {} export interface VxeDatePanelPrivateMethods extends DatePanelPrivateMethods {} export type VxeDatePanelEmits = ['update:modelValue', 'change', 'click', 'clear', 'date-prev', 'date-today', 'date-next', 'confirm', 'revert'] export namespace VxeDatePanelDefines { export interface DatePanelEventParams extends VxeComponentEventParams { $datePanel: VxeDatePanelConstructor } export interface DateYearItem { date: Date isPrev: boolean isCurrent: boolean isNow: boolean isNext: boolean year: number } export interface DateMonthItem { date: Date isPrev: boolean isCurrent: boolean isNow: boolean isNext: boolean month: number } export interface DateQuarterItem { date: Date isPrev: boolean isCurrent: boolean isNow: boolean isNext: boolean quarter: number } export interface DateDayItem { date: Date isWeekNumber?: boolean isPrev: boolean isCurrent: boolean isNow: boolean isNext: boolean label: number } export interface DateHourMinuteSecondItem { value: number label: string disabled: boolean } export type DatePanelType = 'year' | 'quarter' | 'month' | 'week' | 'date' | 'day' interface DateFestivalItem { /** * 显示名称 */ label?: string /** * 标记为重要信息 */ important?: boolean className?: string style?: VxeComponentStyleType } /** * 日期节日对象 */ export interface DateFestivalInfo extends DateFestivalItem { /** * 显示左上角小圆点通知 */ notice?: boolean /** * 显示右上角信息 */ extra?: string | DateFestivalItem } export interface DateFestivalParams { $datePanel: VxeDatePanelConstructor type: string viewType: DatePanelType date: Date } export interface DateDisabledParams { $datePanel: VxeDatePanelConstructor type: string viewType: DatePanelType date: Date } export interface DatePanelParams { value: string } export interface ChangeEventParams extends DatePanelEventParams, DatePanelParams { currValue: string } export interface ConfirmEventParams extends DatePanelEventParams {} export interface RevertEventParams extends DatePanelEventParams { label: string } export interface DateTodayEventParams { type: string viewType: DatePanelType viewDate: string } export interface DatePrevEventParams extends DateTodayEventParams {} export interface DateNextEventParams extends DateTodayEventParams {} } export type VxeDatePanelEventProps = { 'onUpdate:modelValue'?: VxeDatePanelEvents.UpdateModelValue onChange?: VxeDatePanelEvents.Change onConfirm?: VxeDatePanelEvents.Confirm onRevert?: VxeDatePanelEvents.Revert onDatePrev?: VxeDatePanelEvents.DatePrev onDateToday?: VxeDatePanelEvents.DateToday onDateNext?: VxeDatePanelEvents.DateNext } export interface VxeDatePanelListeners { 'update:modelValue'?: VxeDatePanelEvents.UpdateModelValue change?: VxeDatePanelEvents.Change confirm?: VxeDatePanelEvents.Confirm revert?: VxeDatePanelEvents.Revert datePrev?: VxeDatePanelEvents.DatePrev dateToday?: VxeDatePanelEvents.DateToday dateNext?: VxeDatePanelEvents.DateNext } export namespace VxeDatePanelEvents { export type UpdateModelValue = (modelValue: VxeDatePanelPropTypes.ModelValue) => void export type Change = (params: VxeDatePanelDefines.ChangeEventParams) => void export type Confirm = (params: VxeDatePanelDefines.ConfirmEventParams) => void export type Revert = (params: VxeDatePanelDefines.RevertEventParams) => void export type DatePrev = (params: VxeDatePanelDefines.DatePrevEventParams) => void export type DateToday = (params: VxeDatePanelDefines.DateTodayEventParams) => void export type DateNext = (params: VxeDatePanelDefines.DateNextEventParams) => void } export namespace VxeDatePanelSlotTypes { export interface DefaultSlotParams {} } export interface VxeDatePanelSlots { default?: (params: VxeDatePanelSlotTypes.DefaultSlotParams) => any } export const DatePanel: typeof VxeDatePanel export default VxeDatePanel