From a7dc9bd1067a6fb97de2cd51336f417fafa43fd7 Mon Sep 17 00:00:00 2001 From: mertmit Date: Sat, 2 Dec 2023 12:12:08 +0300 Subject: [PATCH] fix: PR requested changes Signed-off-by: mertmit --- packages/nc-gui/components/cell/Percent.vue | 79 +++++++++++++++------ 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/packages/nc-gui/components/cell/Percent.vue b/packages/nc-gui/components/cell/Percent.vue index cdf9993658..0492fb5e32 100644 --- a/packages/nc-gui/components/cell/Percent.vue +++ b/packages/nc-gui/components/cell/Percent.vue @@ -35,35 +35,72 @@ const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))! const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value && (el as HTMLInputElement)?.focus() +const cellFocused = ref(false) + +const expandedEditEnabled = ref(false) + const percentMeta = computed(() => { return { is_progress: false, ...parseProp(column.value?.meta), } }) + +const onBlur = () => { + if (editEnabled) { + editEnabled.value = false + } + cellFocused.value = false + expandedEditEnabled.value = false +} + +const onFocus = () => { + cellFocused.value = true +} + +const onMouseover = () => { + expandedEditEnabled.value = true +} + +const onMouseleave = () => { + if (!cellFocused.value) { + expandedEditEnabled.value = false + } +}