|
|
|
@ -1,9 +1,8 @@
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import type { ColumnType, GridType } from 'nocodb-sdk' |
|
|
|
|
import type { ColumnType } from 'nocodb-sdk' |
|
|
|
|
import { isSystemColumn } from 'nocodb-sdk' |
|
|
|
|
import { |
|
|
|
|
ActiveCellInj, |
|
|
|
|
ActiveViewInj, |
|
|
|
|
ColumnInj, |
|
|
|
|
EditModeInj, |
|
|
|
|
IsFormInj, |
|
|
|
@ -61,8 +60,6 @@ const props = defineProps<Props>()
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['update:modelValue', 'save', 'navigate', 'update:editEnabled']) |
|
|
|
|
|
|
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
|
|
|
|
|
|
const column = toRef(props, 'column') |
|
|
|
|
|
|
|
|
|
const active = toRef(props, 'active', false) |
|
|
|
@ -127,23 +124,6 @@ const syncAndNavigate = (dir: NavigateDir, e: KeyboardEvent) => {
|
|
|
|
|
|
|
|
|
|
if (!isForm.value) e.stopImmediatePropagation() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const rowHeight = computed(() => { |
|
|
|
|
if ((view.value?.view as GridType)?.row_height !== undefined) { |
|
|
|
|
switch ((view.value?.view as GridType)?.row_height) { |
|
|
|
|
case 0: |
|
|
|
|
return 1 |
|
|
|
|
case 1: |
|
|
|
|
return 2 |
|
|
|
|
case 2: |
|
|
|
|
return 4 |
|
|
|
|
case 3: |
|
|
|
|
return 6 |
|
|
|
|
default: |
|
|
|
|
return 1 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
@ -152,8 +132,6 @@ const rowHeight = computed(() => {
|
|
|
|
|
:class="[ |
|
|
|
|
`nc-cell-${(column?.uidt || 'default').toLowerCase()}`, |
|
|
|
|
{ 'text-blue-600': isPrimary(column) && !props.virtual && !isForm }, |
|
|
|
|
{ 'm-y-auto !h-auto': !rowHeight || rowHeight === 1 }, |
|
|
|
|
{ '!h-full': rowHeight && rowHeight !== 1 }, |
|
|
|
|
]" |
|
|
|
|
@keydown.enter.exact="syncAndNavigate(NavigateDir.NEXT, $event)" |
|
|
|
|
@keydown.shift.enter.exact="syncAndNavigate(NavigateDir.PREV, $event)" |
|
|
|
|