From 5cfd122598c0852f343fc21d85895a65e3b03b6a Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Mon, 15 Jan 2024 17:00:58 +0300 Subject: [PATCH] Fixed #5077 - Calendar: Incorrect interface "CalendarContext" for Calendar component --- components/lib/calendar/Calendar.d.ts | 55 ++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/components/lib/calendar/Calendar.d.ts b/components/lib/calendar/Calendar.d.ts index 8e84870be..c7eb93421 100755 --- a/components/lib/calendar/Calendar.d.ts +++ b/components/lib/calendar/Calendar.d.ts @@ -398,6 +398,32 @@ export interface CalendarState { 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. */ @@ -405,7 +431,7 @@ export interface CalendarContext { /** * Current date. */ - date: string | Date | string[] | Date[] | undefined | null; + date: CalendarDateContext; /** * Current today state of the calendar's day. * @defaultValue false @@ -760,6 +786,31 @@ export interface CalendarProps { */ 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. @@ -780,7 +831,7 @@ export interface CalendarSlots { /** * Value of the component. */ - date: { day: number; month: number; year: number; today: boolean; selectable: boolean }; + date: CalendarDateSlotOptions; }): VNode[]; /** * Custom decade template.