import { CombinedVueInstance } from 'vue/types/vue'; import { VNode, ScopedSlotReturnValue } from 'vue/types/vnode'; import { DayOfWeek } from '../../utils/format/date'; import { TouchMixinInstance } from '../../mixins/touch'; export declare type CalendarSelectMode = 'single' | 'multi' | 'range'; export interface CalendarInfo { date: Date; year: number; month: number; day: number; } export interface CalendarProps { /** * The `Date` array to bind, with the event `change` for v-model. */ value: Date[]; /** * Selection mode: single, multi or range */ mode?: CalendarSelectMode; /** * Set the start time to `00:00:00` and the end time to `23:59:59` while in `range` mode. * @default false */ rangeUseStartEnd?: boolean; /** * The earliest acceptable date. */ min?: Date; /** * The latest acceptable date. */ max?: Date; /** * Customize today. */ today?: Date; /** * Set the first day of week, such as Monday. */ firstDayOfWeek?: DayOfWeek; /** * The header title text. */ title?: string; /** * Show title bar or not. */ showTitleBar: boolean; /** * Show cancel button or not. * @default false */ showCancel?: boolean; /** * Show confirm button or not. * @default false */ showConfirm?: boolean; /** * Config the v-model event `change` behavior. * If `true`, the `change` event will only be emitted after click the confirm button, * and the cancel and confirm button will always show. * @default false */ requireConfirm?: boolean; } export interface CalendarPropsInit extends CalendarProps { mode: CalendarSelectMode; rangeUseStartEnd: boolean; today: Date; firstDayOfWeek: DayOfWeek; title: string; showCancel: boolean; showConfirm: boolean; requireConfirm: boolean; } export interface CalendarEvents { onChange(value: Date[]): void; onConfirm?(value: Date): void; onCancel?(): void; } export interface MonthBlock { year: number; month: number; height: number; translateY: number; } export interface CalendarData { queueMonths: MonthBlock[]; currentIndex: number; selected: Date[]; } export interface CalendarMethods { detectDisabled(date: Date): boolean; updateHeight(): void; initSelected(): void; setSelected(value: Date[]): void; select(date: Date): void; emitChange(): Date[]; scroll(distance: number): void; scrollEnd(): void; onTouchStart(event: TouchEvent): void; onTouchMove(event: TouchEvent): void; onTouchEnd(event: TouchEvent): void; onCancel(event?: Event): void; onConfirm(event?: Event): void; renderMonthBlock(monthOffset: number): VNode; } export interface CalendarComputed { daysOfWeek: DayOfWeek[]; dateRange: Date[]; } export interface CalendarScopedSlotsProps { selected: Date[]; setSelected(value: Date[]): void; cancel(): void; confirm(): void; } export interface CalendarScopedSlots { headerLeft?(props: CalendarScopedSlotsProps): ScopedSlotReturnValue; headerRight?(props: CalendarScopedSlotsProps): ScopedSlotReturnValue; bottomFloat?(props: CalendarScopedSlotsProps): ScopedSlotReturnValue; } export interface CalendarDataExtra { startTranslateY: number; monthBarHeight: number; minTime?: number; maxTime?: number; shouldEmitChange?: boolean; $scopedSlots: CalendarScopedSlots; } export declare type CalendarInstance = CombinedVueInstance & CalendarDataExtra; declare const _default: import("../../utils/create/component").TsxComponent; export default _default;