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 { tables, loadTables } = useProject()
const { tables, loadTables, isSharedBase } = useProject()
const { activeTab } = useTabs()
const { deleteTable } = useTable()
@ -143,7 +143,11 @@ const activeTable = computed(() => {
</div>
<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
style="direction: ltr"
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">
.nc-grid-wrapper {
width: 100%;
// todo : proper height calculation
height: calc(100vh - 215px);
overflow: auto;
@apply h-full w-full overflow-auto;
td,
th {
@ -482,10 +479,7 @@ const expandForm = (row: Row, state: Record<string, any>) => {
table,
td,
th {
border-right: 1px solid #f0f0f0 !important;
border-left: 1px solid #f0f0f0 !important;
border-bottom: 1px solid #f0f0f0 !important;
border-top: 1px solid #f0f0f0 !important;
@apply !border-1;
border-collapse: collapse;
}
@ -511,8 +505,7 @@ const expandForm = (row: Row, state: Record<string, any>) => {
}
td.active::before {
background: #0040bc;
opacity: 0.1;
@apply bg-primary/5;
}
}

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

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

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

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { TabItem } from '~/composables'
import { TabType } from '~/composables'
import { TabType, useProject } from '~/composables'
import { TabMetaInj } from '~/context'
import { useTabs, useUIPermission } from '#imports'
import MdiPlusIcon from '~icons/mdi/plus'
@ -17,6 +17,8 @@ const { tabs, activeTabIndex, activeTab, closeTab } = useTabs()
const { isUIAllowed } = useUIPermission()
const { isSharedBase } = useProject()
const tableCreateDialog = ref(false)
const airtableImportDialog = ref(false)
const quickImportDialog = ref(false)
@ -43,7 +45,7 @@ const icon = (tab: TabItem) => {
</script>
<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>
<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">
.nc-container {
height: calc(100% - var(--header-height));
height: calc(100vh - var(--header-height));
flex: 1 1 100%;
&.shared {
height: calc(100vh - var(--header-height) - 20px);
}
}
:deep(.nc-root-tabs) {

Loading…
Cancel
Save