Browse Source

feat(gui-v2): assign proper grid and treeview height

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3123/head
Pranav C 2 years ago
parent
commit
7120e09011
  1. 8
      packages/nc-gui-v2/components/dashboard/TreeView.vue
  2. 13
      packages/nc-gui-v2/components/smartsheet/Grid.vue
  3. 17
      packages/nc-gui-v2/components/smartsheet/Pagination.vue
  4. 11
      packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index.vue

8
packages/nc-gui-v2/components/dashboard/TreeView.vue

@ -14,7 +14,7 @@ const { addTab } = useTabs()
const { $api, $e } = useNuxtApp() const { $api, $e } = useNuxtApp()
const { tables, loadTables } = useProject() const { tables, loadTables, isSharedBase } = useProject()
const { activeTab } = useTabs() const { activeTab } = useTabs()
const { deleteTable } = useTable() const { deleteTable } = useTable()
@ -143,7 +143,11 @@ const activeTable = computed(() => {
</div> </div>
<a-dropdown :trigger="['contextmenu']"> <a-dropdown :trigger="['contextmenu']">
<div class="p-2 flex-1 overflow-y-auto flex flex-column scrollbar-thin-dull" style="direction: rtl"> <div
class="p-2 flex-1 overflow-y-auto flex flex-column scrollbar-thin-dull"
:class="{ 'mb-[20px]': isSharedBase }"
style="direction: rtl"
>
<div <div
style="direction: ltr" style="direction: ltr"
class="py-1 px-3 flex w-full align-center gap-1 cursor-pointer" class="py-1 px-3 flex w-full align-center gap-1 cursor-pointer"

13
packages/nc-gui-v2/components/smartsheet/Grid.vue

@ -462,10 +462,7 @@ const expandForm = (row: Row, state: Record<string, any>) => {
<style scoped lang="scss"> <style scoped lang="scss">
.nc-grid-wrapper { .nc-grid-wrapper {
width: 100%; @apply h-full w-full overflow-auto;
// todo : proper height calculation
height: calc(100vh - 215px);
overflow: auto;
td, td,
th { th {
@ -482,10 +479,7 @@ const expandForm = (row: Row, state: Record<string, any>) => {
table, table,
td, td,
th { th {
border-right: 1px solid #f0f0f0 !important; @apply !border-1;
border-left: 1px solid #f0f0f0 !important;
border-bottom: 1px solid #f0f0f0 !important;
border-top: 1px solid #f0f0f0 !important;
border-collapse: collapse; border-collapse: collapse;
} }
@ -511,8 +505,7 @@ const expandForm = (row: Row, state: Record<string, any>) => {
} }
td.active::before { td.active::before {
background: #0040bc; @apply bg-primary/5;
opacity: 0.1;
} }
} }

17
packages/nc-gui-v2/components/smartsheet/Pagination.vue

@ -34,21 +34,12 @@ const page = computed({
:show-size-changer="false" :show-size-changer="false"
/> />
<div v-else class="mx-auto d-flex align-center mt-n1" style="max-width: 250px"> <div v-else class="mx-auto d-flex align-center mt-n1" style="max-width: 250px">
<span class="caption" style="white-space: nowrap"> Change page:</span> <span class="text-xs" style="white-space: nowrap"> Change page:</span>
<v-text-field <a-input :value="page" size="small" class="ml-1 !text-xs" type="number" @keydown.enter="changePage(page)">
:value="page" <template #suffix>
class="ml-1 caption"
:full-width="false"
outlined
dense
hide-details
type="number"
@keydown.enter="changePage(page)"
>
<template #append>
<MdiKeyboardIcon class="mt-1" @click="changePage(page)" /> <MdiKeyboardIcon class="mt-1" @click="changePage(page)" />
</template> </template>
</v-text-field> </a-input>
</div> </div>
<div class="flex-1" /> <div class="flex-1" />

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

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { TabItem } from '~/composables' import type { TabItem } from '~/composables'
import { TabType } from '~/composables' import { TabType, useProject } from '~/composables'
import { TabMetaInj } from '~/context' import { TabMetaInj } from '~/context'
import { useTabs, useUIPermission } from '#imports' import { useTabs, useUIPermission } from '#imports'
import MdiPlusIcon from '~icons/mdi/plus' import MdiPlusIcon from '~icons/mdi/plus'
@ -17,6 +17,8 @@ const { tabs, activeTabIndex, activeTab, closeTab } = useTabs()
const { isUIAllowed } = useUIPermission() const { isUIAllowed } = useUIPermission()
const { isSharedBase } = useProject()
const tableCreateDialog = ref(false) const tableCreateDialog = ref(false)
const airtableImportDialog = ref(false) const airtableImportDialog = ref(false)
const quickImportDialog = ref(false) const quickImportDialog = ref(false)
@ -43,7 +45,7 @@ const icon = (tab: TabItem) => {
</script> </script>
<template> <template>
<div class="h-full w-full nc-container pt-[9px]"> <div class="h-full w-full nc-container pt-[9px]" :class="{ shared: isSharedBase }">
<div class="h-full w-full flex flex-col"> <div class="h-full w-full flex flex-col">
<div> <div>
<a-tabs v-model:activeKey="activeTabIndex" class="nc-root-tabs" type="editable-card" @edit="closeTab"> <a-tabs v-model:activeKey="activeTabIndex" class="nc-root-tabs" type="editable-card" @edit="closeTab">
@ -156,8 +158,11 @@ const icon = (tab: TabItem) => {
<style scoped lang="scss"> <style scoped lang="scss">
.nc-container { .nc-container {
height: calc(100% - var(--header-height)); height: calc(100vh - var(--header-height));
flex: 1 1 100%; flex: 1 1 100%;
&.shared {
height: calc(100vh - var(--header-height) - 20px);
}
} }
:deep(.nc-root-tabs) { :deep(.nc-root-tabs) {

Loading…
Cancel
Save