From 98cdf4196311089605ff957fb5a1151df6dda424 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:19:01 +0000 Subject: [PATCH] fix(nc-gui): extension panel resize issue --- .../nc-gui/components/extensions/Pane.vue | 251 ++++++++---------- .../nc-gui/components/tabs/Smartsheet.vue | 40 +-- 2 files changed, 135 insertions(+), 156 deletions(-) diff --git a/packages/nc-gui/components/extensions/Pane.vue b/packages/nc-gui/components/extensions/Pane.vue index 54b54c329e..dfe8aa85fe 100644 --- a/packages/nc-gui/components/extensions/Pane.vue +++ b/packages/nc-gui/components/extensions/Pane.vue @@ -17,8 +17,6 @@ const { const { $e } = useNuxtApp() -const isReady = ref(false) - const searchExtensionRef = ref() const extensionHeaderRef = ref() @@ -27,6 +25,13 @@ const searchQuery = ref('') const showSearchBox = ref(false) +const panelSize = computed(() => { + if (isPanelExpanded.value) { + return extensionPanelSize.value + } + return 0 +}) + const { width } = useElementSize(extensionHeaderRef) const isOpenSearchBox = computed(() => { @@ -54,14 +59,6 @@ const toggleMarket = () => { isMarketVisible.value = !isMarketVisible.value } -const normalizePaneMaxWidth = computed(() => { - if (isReady.value) { - return 60 - } else { - return extensionPanelSize.value - } -}) - const onMove = async (_event: { moved: { newIndex: number; oldIndex: number; element: ExtensionType } }) => { let { moved: { newIndex = 0, oldIndex = 0, element }, @@ -100,20 +97,6 @@ const onMove = async (_event: { moved: { newIndex: number; oldIndex: number; ele $e('a:extension:reorder') } -defineExpose({ - onReady: () => { - isReady.value = true - }, -}) - -watch(isPanelExpanded, (newValue) => { - if (newValue && !isReady.value) { - setTimeout(() => { - isReady.value = true - }, 300) - } -}) - onClickOutside(searchExtensionRef, () => { if (searchQuery.value) { return @@ -130,125 +113,119 @@ onMounted(() => {