From ceabd5b4c9d824019a81f3b0d5fa89b9a4b26509 Mon Sep 17 00:00:00 2001 From: mertmit Date: Mon, 14 Nov 2022 00:26:03 +0300 Subject: [PATCH] feat: bases panel Signed-off-by: mertmit --- .../nc-gui/components/dashboard/TreeView.vue | 75 +++++++++++++------ 1 file changed, 52 insertions(+), 23 deletions(-) diff --git a/packages/nc-gui/components/dashboard/TreeView.vue b/packages/nc-gui/components/dashboard/TreeView.vue index 393cfb4711..33f7bfc814 100644 --- a/packages/nc-gui/components/dashboard/TreeView.vue +++ b/packages/nc-gui/components/dashboard/TreeView.vue @@ -49,7 +49,7 @@ const keys = $ref>({}) const activeKey = ref([]) -const menuRefs = $ref() +const menuRefs = $ref() let filterQuery = $ref('') @@ -130,8 +130,10 @@ const initSortable = (el: Element) => { watchEffect(() => { if (menuRefs) { - for (const menuRef of menuRefs) { - initSortable(menuRef) + if (menuRefs instanceof HTMLElement) { + initSortable(menuRefs) + } else { + menuRefs.forEach((el) => initSortable(el)) } } }) @@ -289,7 +291,9 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => { {{ $t('objects.tables') }} - ({{ tables.length || '0' }}) + @@ -299,10 +303,10 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => { -
+
@@ -411,15 +415,15 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
-
+
- +
@@ -463,7 +467,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
-
+
{ :data-testid="`tree-view-table-${table.title}`" @click="addTableTab(table)" > - +
@@ -664,10 +697,6 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
- -
- -
@@ -772,7 +801,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => { } .nc-tree-item { - @apply relative cursor-pointer after:(pointer-events-none content-[''] absolute top-0 left-0 w-full h-full right-0 !bg-current transition transition-opactity duration-100 opacity-0); + @apply relative cursor-pointer after:(pointer-events-none content-[''] absolute top-0 left-0 w-full h-full right-0 !bg-current transition transition-opactity duration-100 opacity-0); } .nc-tree-item svg {