()
-const emit = defineEmits(['update:modelValue', 'save'])
+const emit = defineEmits(['update:modelValue', 'save', 'navigate', 'update:editEnabled'])
provide(ColumnInj, column)
-provide(EditModeInj, toRef(props, 'editEnabled'))
+provide(EditModeInj, useVModel(props, 'editEnabled', emit))
let changed = $ref(false)
const syncValue = useDebounceFn(function () {
+ changed = false
emit('save')
}, 1000)
@@ -59,6 +61,7 @@ const vModel = computed({
syncValue()
} else if (!isManualSaved) {
emit('save')
+ changed = true
}
}
},
@@ -87,10 +90,26 @@ const {
isPercent,
isPhoneNumber,
} = useColumn(column)
+
+const syncAndNavigate = (dir: NavigateDir) => {
+ if (changed) {
+ emit('save')
+ changed = false
+ }
+ emit('navigate', dir)
+}
-
+
diff --git a/packages/nc-gui-v2/components/smartsheet/Grid.vue b/packages/nc-gui-v2/components/smartsheet/Grid.vue
index 59a9d45409..528ebcba5c 100644
--- a/packages/nc-gui-v2/components/smartsheet/Grid.vue
+++ b/packages/nc-gui-v2/components/smartsheet/Grid.vue
@@ -1,7 +1,6 @@
@@ -255,15 +273,25 @@ onKeyStroke(['Tab', 'Shift', 'Enter', 'Delete', 'ArrowDown', 'ArrowUp', 'ArrowLe
@dblclick="editEnabled = true"
@contextmenu="contextMenuTarget = { row: rowIndex, col: colIndex }"
>
-
+
+
-
+
+
@@ -318,13 +346,13 @@ onKeyStroke(['Tab', 'Shift', 'Enter', 'Delete', 'ArrowDown', 'ArrowUp', 'ArrowLe
min-height: 41px !important;
height: 41px !important;
position: relative;
- padding: 0 5px;
+ //padding: 0 5px;
- & > * {
+ & > div {
+ overflow: hidden;
@apply flex align-center h-auto;
+ padding: 0 5px;
}
-
- overflow: hidden;
}
table,
@@ -360,7 +388,7 @@ onKeyStroke(['Tab', 'Shift', 'Enter', 'Delete', 'ArrowDown', 'ArrowUp', 'ArrowLe
}
td.active::before {
- background: #0040bc /*var(--v-primary-base)*/;
+ background: #0040bc;
opacity: 0.1;
}
}
diff --git a/packages/nc-gui-v2/components/smartsheet/VirtualCell.vue b/packages/nc-gui-v2/components/smartsheet/VirtualCell.vue
index 47eb8e5cc1..8cb234b3c4 100644
--- a/packages/nc-gui-v2/components/smartsheet/VirtualCell.vue
+++ b/packages/nc-gui-v2/components/smartsheet/VirtualCell.vue
@@ -2,6 +2,7 @@
import type { ColumnType } from 'nocodb-sdk'
import { provide, useVirtualCell } from '#imports'
import { ColumnInj } from '~/context'
+import { NavigateDir } from '~/lib'
interface Props {
column: ColumnType
@@ -10,7 +11,7 @@ interface Props {
const { column, modelValue: value } = defineProps()
-const emit = defineEmits(['update:modelValue'])
+const emit = defineEmits(['update:modelValue', 'navigate'])
provide(ColumnInj, column)
provide('value', value)
@@ -19,196 +20,20 @@ const { isLookup, isBt, isRollup, isMm, isHm, isFormula, isCount } = useVirtualC
-