From 75b7e845905ce66e7ef0f666a6c8eff96e3f85cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=C9=A8=D5=BC=C9=A2=D3=84=D5=A1=D6=85=D5=BC=C9=A2?= Date: Fri, 3 Nov 2023 19:30:15 +0800 Subject: [PATCH] refactor(nc-gui): revise imports --- packages/nc-gui/components/cell/DatePicker.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/cell/DatePicker.vue b/packages/nc-gui/components/cell/DatePicker.vue index 14c8d698ad..9c81d6842a 100644 --- a/packages/nc-gui/components/cell/DatePicker.vue +++ b/packages/nc-gui/components/cell/DatePicker.vue @@ -6,16 +6,22 @@ import { ColumnInj, EditColumnInj, EditModeInj, + IsLockedInj, ReadonlyInj, computed, inject, + isDateMonthFormat, isDrawerOrModalExist, + onClickOutside, + onMounted, + onUnmounted, parseProp, ref, + useGlobal, + useI18n, useSelectedCellKeyupListener, watch, } from '#imports' -import { isDateMonthFormat } from '~/utils' interface Props { modelValue?: string | null @@ -197,12 +203,15 @@ const updateOpen = (next: boolean) => { } const cellClickHook = inject(CellClickHookInj, null) + const cellClickHandler = () => { open.value = (active.value || editable.value) && !open.value } + onMounted(() => { cellClickHook?.on(cellClickHandler) }) + onUnmounted(() => { cellClickHook?.on(cellClickHandler) })