From 571dc66858881d64590789c2fd8a136afbf001e9 Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Tue, 20 Feb 2024 07:15:45 +0000 Subject: [PATCH] feat(nc-gui): calendar type tab animation --- .../smartsheet/toolbar/CalendarMode.vue | 57 ++++++++----------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/toolbar/CalendarMode.vue b/packages/nc-gui/components/smartsheet/toolbar/CalendarMode.vue index 74c73c4106..4a0c86535e 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/CalendarMode.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/CalendarMode.vue @@ -2,8 +2,13 @@ import { useCalendarViewStoreOrThrow } from "#imports"; -const setActiveCalendarMode = (mode: 'day' | 'week' | 'month' | 'year') => { +const highlightStyle = ref({ left: '0px' }); + + +const setActiveCalendarMode = (mode: 'day' | 'week' | 'month' | 'year', event: MouseEvent) => { changeCalendarView(mode); + const tabElement = event.target as HTMLElement; + highlightStyle.value.left = `${tabElement.offsetLeft}px`; }; const { changeCalendarView, activeCalendarView } = useCalendarViewStoreOrThrow() @@ -11,47 +16,32 @@ const { changeCalendarView, activeCalendarView } = useCalendarViewStoreOrThrow() \ No newline at end of file