diff --git a/packages/nc-gui/components/smartsheet/sidebar/index.vue b/packages/nc-gui/components/smartsheet/sidebar/index.vue index 5478223bda..137fce1f75 100644 --- a/packages/nc-gui/components/smartsheet/sidebar/index.vue +++ b/packages/nc-gui/components/smartsheet/sidebar/index.vue @@ -8,6 +8,7 @@ import { inject, provide, ref, + useNuxtApp, useRoute, useRouter, useSidebar, @@ -102,7 +103,7 @@ function onCreate(view: ViewType) { ref="sidebar" :collapsed="sidebarCollapsed" collapsiple - collapsed-width="50" + collapsed-width="0" width="250" class="relative shadow-md h-full" theme="light" diff --git a/packages/nc-gui/components/tabs/Smartsheet.vue b/packages/nc-gui/components/tabs/Smartsheet.vue index 1efd57026c..ea912fe9e4 100644 --- a/packages/nc-gui/components/tabs/Smartsheet.vue +++ b/packages/nc-gui/components/tabs/Smartsheet.vue @@ -15,6 +15,7 @@ import { inject, provide, ref, + toRef, useMetas, useProvideSmartsheetStore, useSidebar, @@ -22,24 +23,24 @@ import { } from '#imports' import type { TabItem } from '~/lib' -const { activeTab } = defineProps<{ +const props = defineProps<{ activeTab: TabItem }>() const { metas } = useMetas() -const activeView = ref() +const activeTab = toRef(props, 'activeTab') -const el = ref() +const activeView = ref() const fields = ref([]) -provide(TabMetaInj, ref(activeTab)) -const meta = computed(() => metas.value?.[activeTab?.id as string]) +const meta = computed(() => metas.value[activeTab.value.id!]) const reloadEventHook = createEventHook() const reloadViewMetaEventHook = createEventHook() + const openNewRecordFormHook = createEventHook() const { isGallery, isGrid, isForm, isLocked } = useProvideSmartsheetStore(activeView, meta) @@ -56,6 +57,7 @@ provide(ReloadViewMetaHookInj, reloadViewMetaEventHook) provide(OpenNewRecordFormHookInj, openNewRecordFormHook) provide(FieldsInj, fields) provide(IsFormInj, isForm) +provide(TabMetaInj, activeTab) const treeViewIsLockedInj = inject('TreeViewIsLockedInj', ref(false)) @@ -71,7 +73,7 @@ watch(isLocked, (nextValue) => (treeViewIsLockedInj.value = nextValue), { immedi