feat: better keyboard navigations and shortcut support

This commit is contained in:
DarkPhoenix2704
2025-02-17 13:10:53 +00:00
parent 32a4569bb0
commit cc3a0fddaa
9 changed files with 385 additions and 146 deletions

View File

@@ -1,36 +0,0 @@
import { type ColumnType, isSystemColumn, isVirtualCol } from 'nocodb-sdk'
export function isPasteable(row?: Row, col?: ColumnType, showInfo = false) {
if (!row || !col) {
if (showInfo) {
message.info('Please select a cell to paste')
}
return false
}
// skip pasting virtual columns (including LTAR columns for now) and system columns
if (isVirtualCol(col) || isSystemColumn(col)) {
if (showInfo) {
message.info(t('msg.info.pasteNotSupported'))
}
return false
}
// skip pasting auto increment columns
if (col.ai) {
if (showInfo) {
message.info(t('msg.info.autoIncFieldNotEditable'))
}
return false
}
// skip pasting primary key columns
if (col.pk && !row.rowMeta.new) {
if (showInfo) {
message.info(t('msg.info.editingPKnotSupported'))
}
return false
}
return true
}