Browse Source

mobile optimisations - work on merging right and left sidebar (WIP)

pull/4898/head
Daniel Spaude 2 years ago
parent
commit
5a05ce6142
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 71
      packages/nc-gui/components/smartsheet/sidebar/mobile.vue
  2. 2
      packages/nc-gui/components/tabs/Smartsheet.vue
  3. 7
      packages/nc-gui/pages/[projectType]/[projectId]/index.vue

71
packages/nc-gui/components/smartsheet/sidebar/mobile.vue

@ -139,47 +139,46 @@ function onOpenModal({
onMounted(async () => {
await loadViews()
})
</script>
<template>
<div>
MOBILE
<!-- <br />
<!-- <div> -->
<!-- MOBILE -->
<!-- <br />
META: {{ JSON.stringify(meta) }} -->
<br />
<!-- <br />
VIEWS: {{ JSON.stringify(views.length) }}
<br />
<a-layout-sider
ref="sidebar"
:collapsed="sidebarCollapsed"
collapsiple
collapsed-width="0"
width="0"
class="nc-view-sidebar relative shadow h-full w-full !flex-1 !min-w-0 !max-w-[150px] !w-[150px] lg:(!max-w-[250px] !w-[250px])"
theme="light"
>
<LazySmartsheetSidebarToolbar
class="min-h-[var(--toolbar-height)] max-h-[var(--toolbar-height)] flex items-center py-3 px-3 justify-between border-b-1"
/>
<div class="flex-1 flex flex-col min-h-0">
<GeneralOverlay v-if="!views.length" :model-value="isLoading" inline class="bg-gray-300/50">
<div class="w-full h-full flex items-center justify-center">
<a-spin />
</div>
</GeneralOverlay>
<LazySmartsheetSidebarMenuTop :views="views" @open-modal="onOpenModal" @deleted="loadViews" />
<template v-if="isUIAllowed('virtualViewsCreateOrEdit')">
<div class="!my-3 w-full border-b-1" />
<LazySmartsheetSidebarMenuBottom @open-modal="onOpenModal" />
</template>
</div>
</a-layout-sider>
</div>
<br /> -->
<a-layout-sider
ref="sidebar"
:collapsed="sidebarCollapsed"
collapsiple
collapsed-width="0"
width="0"
class="nc-view-sidebar relative shadow h-full w-full !flex-1 !min-w-0 !max-w-[150px] !w-[150px] lg:(!max-w-[250px] !w-[250px])"
theme="light"
>
<LazySmartsheetSidebarToolbar
class="min-h-[var(--toolbar-height)] max-h-[var(--toolbar-height)] flex items-center py-3 px-3 justify-between border-b-1"
/>
<div class="flex-1 flex flex-col min-h-0">
<GeneralOverlay v-if="!views.length" :model-value="isLoading" inline class="bg-gray-300/50">
<div class="w-full h-full flex items-center justify-center">
<a-spin />
</div>
</GeneralOverlay>
<LazySmartsheetSidebarMenuTop :views="views" @open-modal="onOpenModal" @deleted="loadViews" />
<template v-if="isUIAllowed('virtualViewsCreateOrEdit')">
<div class="!my-3 w-full border-b-1" />
<LazySmartsheetSidebarMenuBottom @open-modal="onOpenModal" />
</template>
</div>
</a-layout-sider>
<!-- </div> -->
</template>
<style scoped>

2
packages/nc-gui/components/tabs/Smartsheet.vue

@ -111,7 +111,7 @@ onMounted(() => {
<!-- {{ JSON.stringify(metas) }} -->
<!-- <SmartsheetSidebarMobile v-if="meta && isMobileMode" v-show="isMobileRightSidebarOpen" class="nc-left-sidebar-mobile" /> -->
<div class="flex flex-col h-full flex-1 min-w-0" ref="mainArea">
LazySmartsheetToolbar: <LazySmartsheetToolbar />
<LazySmartsheetToolbar />
<Transition name="layout" mode="out-in">
<template v-if="meta">

7
packages/nc-gui/pages/[projectType]/[projectId]/index.vue

@ -191,9 +191,13 @@ onBeforeMount(async () => {
}
})
const showViewsMenu = ref(false)
const FOO = (ev: GlobalEvents) => {
// TODO: filter for event type
console.log(ev)
// alert('event')
showViewsMenu.value = true
if (isMobileMode) {
toggle(false)
}
@ -610,9 +614,10 @@ provide(MetaInj, meta)
</div>
</div>
<LazyDashboardTreeView @create-base-dlg="toggleDialog(true, 'dataSources')" />
<LazyDashboardTreeView v-show="!showViewsMenu" @create-base-dlg="toggleDialog(true, 'dataSources')" />
<!-- v-show="isMobileRightSidebarOpen" -->
SmartsheetSidebarMobile IN INDEX<SmartsheetSidebarMobile
v-show="showViewsMenu"
v-if="meta && isMobileMode"
class="nc-left-sidebar-mobile"
/>SmartsheetSidebarMobile IN INDEX END

Loading…
Cancel
Save