@quasar/quasar-ui-qcalendar
Version:
QCalendar - Day/Month/Week Calendars, Popups, Date Pickers, Schedules, Agendas, Planners and Tasks for your Vue Apps
102 lines (101 loc) • 3.26 kB
TypeScript
import { Ref, EmitFn, ComputedRef } from 'vue';
import { createNativeLocaleFormatter, Timestamp } from '../utils/Timestamp';
import { CommonProps } from './useCommon';
import { CellWidthProps } from './useCellWidth';
import { Scope } from './useInterval';
export interface MonthProps {
dayHeight: number | string;
dayMinHeight: number | string;
dayStyle?: (_scope: Scope) => any;
dayClass?: (_scope: Scope) => string;
weekdayStyle?: (_scope: Scope) => any;
weekdayClass?: (_scope: Scope) => string;
dayPadding?: string;
minWeeks: number | string;
shortMonthLabel: boolean;
showWorkWeeks: boolean;
showMonthLabel: boolean;
showDayOfYearLabel: boolean;
enableOutsideDays: boolean;
noOutsideDays: boolean;
hover: boolean;
miniMode: boolean | 'auto';
breakpoint: number | string;
monthLabelSize: string;
}
export declare const useMonthProps: {
dayHeight: {
type: (StringConstructor | NumberConstructor)[];
default: number;
validator: (v: any) => boolean;
};
dayMinHeight: {
type: (StringConstructor | NumberConstructor)[];
default: number;
validator: (v: any) => boolean;
};
dayStyle: FunctionConstructor;
dayClass: FunctionConstructor;
weekdayStyle: FunctionConstructor;
weekdayClass: FunctionConstructor;
dayPadding: StringConstructor;
minWeeks: {
type: (StringConstructor | NumberConstructor)[];
default: number;
validator: (v: any) => boolean;
};
shortMonthLabel: BooleanConstructor;
showWorkWeeks: BooleanConstructor;
showMonthLabel: {
type: BooleanConstructor;
default: boolean;
};
showDayOfYearLabel: BooleanConstructor;
enableOutsideDays: BooleanConstructor;
noOutsideDays: BooleanConstructor;
hover: BooleanConstructor;
miniMode: {
type: (StringConstructor | BooleanConstructor)[];
validator: (v: any) => boolean;
};
breakpoint: {
type: (StringConstructor | NumberConstructor)[];
default: string;
validator: (v: any) => boolean;
};
monthLabelSize: {
type: StringConstructor;
default: string;
validator: (v: any) => boolean;
};
};
interface UseMonthReturn {
parsedCellWidth: ComputedRef<number>;
parsedMinWeeks: ComputedRef<number>;
parsedMinDays: ComputedRef<number>;
parsedMonthStart: ComputedRef<Timestamp>;
parsedMonthEnd: ComputedRef<Timestamp>;
parsedBreakpoint: ComputedRef<number>;
parsedMonthLabelSize: ComputedRef<string>;
days: Ref<Timestamp[]>;
todayWeek: Ref<Timestamp[]>;
isMiniMode: ComputedRef<boolean>;
monthFormatter: Ref<ReturnType<typeof createNativeLocaleFormatter>>;
isOutside: (_timestamp: Timestamp) => boolean;
}
export default function useMonth(props: MonthProps & CommonProps & CellWidthProps, emit: EmitFn<{
'mini-mode': [boolean];
}>, { times, parsedStart, parsedEnd, size, headerColumnRef, }: {
times: {
today: Timestamp;
};
parsedStart: Ref<Timestamp>;
parsedEnd: Ref<Timestamp>;
size: {
width: number;
};
headerColumnRef: Ref<{
offsetWidth: number;
} | null>;
}): UseMonthReturn;
export {};