Fixed #5077 - Calendar: Incorrect interface "CalendarContext" for Calendar component

pull/5098/head
tugcekucukoglu 2024-01-15 17:00:58 +03:00
parent 3c2d08ac67
commit 5cfd122598
1 changed files with 53 additions and 2 deletions

View File

@ -398,6 +398,32 @@ export interface CalendarState {
currentView: string; currentView: string;
} }
/**
* Defines current date options in Calendar component.
*/
export interface CalendarDateContext {
/**
* Current date.
*/
day: number;
/**
* Current month state.
*/
month: number;
/**
* Current year state.
*/
year: number;
/**
* Current today state of the calendar's day.
*/
today: boolean;
/**
* Selectable state of the day.
*/
selectable: boolean;
}
/** /**
* Defines current options in Calendar component. * Defines current options in Calendar component.
*/ */
@ -405,7 +431,7 @@ export interface CalendarContext {
/** /**
* Current date. * Current date.
*/ */
date: string | Date | string[] | Date[] | undefined | null; date: CalendarDateContext;
/** /**
* Current today state of the calendar's day. * Current today state of the calendar's day.
* @defaultValue false * @defaultValue false
@ -760,6 +786,31 @@ export interface CalendarProps {
*/ */
unstyled?: boolean; unstyled?: boolean;
} }
/**
* Defines valid options of the date slot in Calendar component.
*/
export interface CalendarDateSlotOptions {
/**
* Current date.
*/
day: number;
/**
* Current month state.
*/
month: number;
/**
* Current year state.
*/
year: number;
/**
* Current today state of the calendar's day.
*/
today: boolean;
/**
* Selectable state of the day.
*/
selectable: boolean;
}
/** /**
* Defines valid slots in Calendar component. * Defines valid slots in Calendar component.
@ -780,7 +831,7 @@ export interface CalendarSlots {
/** /**
* Value of the component. * Value of the component.
*/ */
date: { day: number; month: number; year: number; today: boolean; selectable: boolean }; date: CalendarDateSlotOptions;
}): VNode[]; }): VNode[];
/** /**
* Custom decade template. * Custom decade template.