@fesjs/fes-design
Version:
fes-design for PC
121 lines (120 loc) • 4.15 kB
TypeScript
import { type Ref } from 'vue';
import type { Picker } from './pickerHandler';
import type { CalendarProps } from './calendar.vue';
import type { CalendarEmits, DateObj, DayItem, UpdateSelectedDates } from './interface';
type UpdateCurrentDate = (date: Partial<DateObj>) => void;
export declare const useCurrentDate: (props: CalendarProps, emit: CalendarEmits) => {
currentDate: {
year: number;
month: number;
day: number;
hour: number;
minute: number;
second: number;
};
updateCurrentDate: UpdateCurrentDate;
};
export declare const useSelectedDates: (props: CalendarProps, emit: (event: 'selectedDay' | 'change', ...args: any[]) => void, picker: Ref<Picker>) => {
selectedDates: Ref<{
year: number;
month: number;
day: number;
hour: number;
minute: number;
second: number;
quarter?: number;
}[], DateObj[] | {
year: number;
month: number;
day: number;
hour: number;
minute: number;
second: number;
quarter?: number;
}[]>;
updateSelectedDates: UpdateSelectedDates;
};
export declare function useYear({ props, selectedDates, updateSelectedDates, activeIndex, currentDate, updateCurrentDate, }: {
props: CalendarProps;
selectedDates: Ref<DateObj[]>;
updateSelectedDates: UpdateSelectedDates;
activeIndex: Ref<number>;
currentDate: DateObj;
updateCurrentDate: UpdateCurrentDate;
}): {
years: import("vue").ComputedRef<any[]>;
yearStart: import("vue").ComputedRef<number>;
yearEnd: import("vue").ComputedRef<number>;
selectYear: (year: number) => void;
isYearSelect: import("vue").ComputedRef<boolean>;
yearCls: (year: number) => (string | string[])[];
};
export declare function useCommonRange({ props, selectedDates, picker, }: {
props: CalendarProps;
selectedDates: Ref<DateObj[]>;
picker: Ref<Picker>;
}): {
completeRangeSelected: import("vue").ComputedRef<boolean>;
inRangeDate: (date: Date, format: string) => boolean;
};
export declare function useMonth({ props, selectedDates, updateSelectedDates, activeIndex, currentDate, updateCurrentDate, picker, }: {
props: CalendarProps;
selectedDates: Ref<DateObj[]>;
updateSelectedDates: UpdateSelectedDates;
activeIndex: Ref<number>;
currentDate: DateObj;
updateCurrentDate: UpdateCurrentDate;
picker: Ref<Picker>;
}): {
isMonthSelect: import("vue").ComputedRef<boolean>;
selectMonth: (month: number) => void;
monthToNext: () => void;
monthToPre: () => void;
monthCls: (month: number) => {
[x: string]: boolean;
'is-start': boolean;
'is-end': boolean;
};
};
export declare function useDay({ props, selectedDates, currentDate, picker, }: {
props: CalendarProps;
selectedDates: Ref<DateObj[]>;
currentDate: DateObj;
picker: Ref<Picker>;
}): {
days: import("vue").ComputedRef<any[]>;
isDaySelect: import("vue").ComputedRef<boolean>;
weekNames: import("vue").ComputedRef<string[]>;
dayCls: (item: DayItem) => {
[x: string]: boolean;
'is-start': boolean;
'is-end': boolean;
};
};
export interface QuarterItem {
name: string;
value: number;
}
export declare const useQuarter: (props: CalendarProps, selectedDates: Ref<DateObj[]>, updateSelectedDates: UpdateSelectedDates, activeIndex: Ref<number>, currentDate: DateObj) => {
isQuarterSelect: import("vue").ComputedRef<boolean>;
quarterList: {
name: string;
value: number;
}[];
selectQuarter: (item: QuarterItem) => void;
quarterCls: (item: QuarterItem) => {
[x: string]: boolean;
};
};
export declare const useTime: ({ props, selectedDates, updateSelectedDates, activeIndex, picker, }: {
props: CalendarProps;
selectedDates: Ref<DateObj[]>;
updateSelectedDates: UpdateSelectedDates;
activeIndex: Ref<number>;
picker: Ref<Picker>;
}) => {
currentTime: Ref<string, string>;
changeTime: (time: string) => void;
innerDisabledTime: import("vue").ComputedRef<boolean>;
};
export {};