6e51f9302e7ecb65721149726e8ad98e3e5692ec2dbb5712634297d08c74955fcc7b2e18048c2ea7d986b44b4e3c854e11fc08a7c7237c950bcfabc54fb5e6 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import dayjs from 'dayjs';
  2. import type { ComputedRef } from 'vue';
  3. import type { Dayjs } from 'dayjs';
  4. import type { DateCell } from './types';
  5. import type { DisabledDateType } from './props/shared';
  6. type DayRange = [Dayjs | undefined, Dayjs | undefined];
  7. export declare const isValidRange: (range: DayRange) => boolean;
  8. type GetDefaultValueParams = {
  9. lang: string;
  10. step?: number;
  11. unit: 'month' | 'year';
  12. unlinkPanels: boolean;
  13. };
  14. export type DefaultValue = [Date, Date] | Date | undefined;
  15. export declare const getDefaultValue: (defaultValue: DefaultValue, { lang, step, unit, unlinkPanels }: GetDefaultValueParams) => dayjs.Dayjs[];
  16. type Dimension = {
  17. row: number;
  18. column: number;
  19. };
  20. type BuildPickerTableMetadata = {
  21. startDate?: Dayjs | null;
  22. unit: 'month' | 'day';
  23. columnIndexOffset: number;
  24. now: Dayjs;
  25. nextEndDate: Dayjs | null;
  26. relativeDateGetter: (index: number) => Dayjs;
  27. setCellMetadata?: (cell: DateCell, dimension: {
  28. rowIndex: number;
  29. columnIndex: number;
  30. }) => void;
  31. setRowMetadata?: (row: DateCell[]) => void;
  32. };
  33. export declare const buildPickerTable: (dimension: Dimension, rows: DateCell[][], { columnIndexOffset, startDate, nextEndDate, now, unit, relativeDateGetter, setCellMetadata, setRowMetadata, }: BuildPickerTableMetadata) => void;
  34. export declare const datesInMonth: (date: Dayjs, year: number, month: number, lang: string) => Date[];
  35. export declare const getValidDateOfMonth: (date: Dayjs, year: number, month: number, lang: string, disabledDate?: DisabledDateType) => dayjs.Dayjs;
  36. export declare const getValidDateOfYear: (value: Dayjs, lang: string, disabledDate?: DisabledDateType) => dayjs.Dayjs;
  37. export declare const correctlyParseUserInput: (value: string | Dayjs | Dayjs[], format: string, lang: string, defaultFormat: ComputedRef<boolean> | undefined) => Dayjs | Dayjs[];
  38. export {};