From e9142983a2fc8d3becee97b6e98ae970c3896b3e Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 3 Aug 2022 19:22:26 +0530 Subject: [PATCH] fix(gui-v2): many to many Signed-off-by: Pranav C --- .../nc-gui-v2/components/smartsheet/Grid.vue | 1 + .../components/smartsheet/VirtualCell.vue | 16 +- .../components/virtual-cell/HasMany.vue | 370 +----------------- .../components/virtual-cell/ManyToMany.vue | 40 +- .../components/ListChildItems.vue | 5 +- .../virtual-cell/components/ListItems.vue | 238 +---------- .../nc-gui-v2/composables/useLTARStore.ts | 6 +- packages/nc-gui-v2/context/index.ts | 3 +- 8 files changed, 45 insertions(+), 634 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Grid.vue b/packages/nc-gui-v2/components/smartsheet/Grid.vue index bc2918123f..febc2570d6 100644 --- a/packages/nc-gui-v2/components/smartsheet/Grid.vue +++ b/packages/nc-gui-v2/components/smartsheet/Grid.vue @@ -282,6 +282,7 @@ const onNavigate = (dir: NavigateDir) => { :column="columnObj" @navigate="onNavigate" :active="selected.col === colIndex && selected.row === rowIndex" + :row="row" /> -import { computed } from '@vue/reactivity' -import { Row } from 'ant-design-vue' import type { ColumnType } from 'nocodb-sdk' -import { provide, useVirtualCell } from '#imports' -import { ColumnInj, ValueInj, ActiveCellInj, RowInj } from '~/context' +import { provide, toRef, useVirtualCell } from '#imports' +import type { Row } from '~/composables' +import { ActiveCellInj, ColumnInj, RowInj, ValueInj } from '~/context' import { NavigateDir } from '~/lib' interface Props { column: ColumnType modelValue: any - row: Record + row: Row active?: boolean } const props = defineProps() const emit = defineEmits(['update:modelValue', 'navigate']) - -const { column, modelValue: value, row } = props +const { column, modelValue: value } = props const active = toRef(props, 'active', false) - +const row = toRef(props, 'row') provide(ColumnInj, column) provide(ValueInj, value) provide(ActiveCellInj, active) provide(RowInj, row) -provide('value', value) +provide(ValueInj, value) const { isLookup, isBt, isRollup, isMm, isHm, isFormula, isCount } = useVirtualCell(column) diff --git a/packages/nc-gui-v2/components/virtual-cell/HasMany.vue b/packages/nc-gui-v2/components/virtual-cell/HasMany.vue index 4e1ac0cc1d..2d8e72fbce 100644 --- a/packages/nc-gui-v2/components/virtual-cell/HasMany.vue +++ b/packages/nc-gui-v2/components/virtual-cell/HasMany.vue @@ -1,8 +1,12 @@