From 3cccacc236c26ab130dff5cc5452b11c9e55ec9f Mon Sep 17 00:00:00 2001 From: robo <1719221+robokozo@users.noreply.github.com> Date: Sat, 21 Oct 2023 13:22:15 -0700 Subject: [PATCH] feat: calendar week number slots --- components/lib/calendar/Calendar.d.ts | 24 ++++++++++++++++++++++++ components/lib/calendar/Calendar.vue | 12 +++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/components/lib/calendar/Calendar.d.ts b/components/lib/calendar/Calendar.d.ts index 68629b3e3..55a404a98 100755 --- a/components/lib/calendar/Calendar.d.ts +++ b/components/lib/calendar/Calendar.d.ts @@ -801,6 +801,30 @@ export interface CalendarSlots { */ class: any; }): VNode[]; + /** + * Custom header for the showWeek + */ + showWeekHeader(): VNode[]; + /** + * Custom showWeek template + * @param {Object} scope - showWeek slot params + */ + showWeek(scope: { + /** + * Date information corresponding to first day of week + */ + date: { + day: number; + month: number; + year: number; + today: boolean; + selectable: boolean; + }; + /** + * Internally calculated week number + */ + weekNumber: number; + }): VNode[]; } /** diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index 48d1bbc6d..3b82b8456 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -169,7 +169,11 @@ - {{ weekHeaderLabel }} + + + {{ weekHeaderLabel }} + + {{ weekDay }} @@ -180,8 +184,10 @@ - 0 - {{ month.weekNumbers[i] }} + + 0 + {{ month.weekNumbers[i] }} +