From 99e478951dd012e2206b052ccb553f56b3df537b Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Sat, 24 Aug 2024 21:24:08 +0200 Subject: [PATCH] Added cancel action for dialog create --- components/calendar/dialog/Create.vue | 16 ++++++++++++++-- components/calendar/form/Create.vue | 19 ++++++++++++------- .../ui/alert-dialog/AlertDialogClose.vue | 0 pages/i/world/[id].vue | 8 ++++++-- 4 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 components/ui/alert-dialog/AlertDialogClose.vue diff --git a/components/calendar/dialog/Create.vue b/components/calendar/dialog/Create.vue index eacea35..b50abe2 100644 --- a/components/calendar/dialog/Create.vue +++ b/components/calendar/dialog/Create.vue @@ -1,4 +1,5 @@ diff --git a/components/calendar/form/Create.vue b/components/calendar/form/Create.vue index c849ce7..2d1ca9d 100644 --- a/components/calendar/form/Create.vue +++ b/components/calendar/form/Create.vue @@ -12,10 +12,6 @@ onMounted(() => { type FormTabs = 'global' | 'months' | 'today' const activeTab = ref('global') -/** - * === Months list handling === - */ - /** * === Current date === */ @@ -48,13 +44,19 @@ async function handleSubmit() { */ const emit = defineEmits<{ // eslint-disable-next-line no-unused-vars - (e: 'changed-name', calendarName: string): void + (e: 'on-changed-name', calendarName: string): void + // eslint-disable-next-line no-unused-vars + (e: 'on-cancel'): void }>() /** Hook to emit a debounced event for the changed skeleton name */ const handleNameChange = useDebounceFn(() => { - emit('changed-name', calendarSkeleton.value.name) + emit('on-changed-name', calendarSkeleton.value.name) }, 400) + +function handleFormCancel() { + emit('on-cancel') +}