|
|
|
@ -173,8 +173,16 @@ const getContainerScrollForElement = (
|
|
|
|
|
return scroll |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCellClick, clearSelectedRange, copyValue } = |
|
|
|
|
useMultiSelect( |
|
|
|
|
const { |
|
|
|
|
isCellSelected, |
|
|
|
|
activeCell, |
|
|
|
|
handleMouseDown, |
|
|
|
|
handleMouseOver, |
|
|
|
|
handleCellClick, |
|
|
|
|
clearSelectedRange, |
|
|
|
|
copyValue, |
|
|
|
|
isCellActive, |
|
|
|
|
} = useMultiSelect( |
|
|
|
|
meta, |
|
|
|
|
fields, |
|
|
|
|
data, |
|
|
|
@ -202,7 +210,7 @@ const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCell
|
|
|
|
|
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey |
|
|
|
|
const altOrOptionKey = e.altKey |
|
|
|
|
if (e.key === ' ') { |
|
|
|
|
if (activeCell.row != null && !editEnabled && hasEditPermission) { |
|
|
|
|
if (isCellActive.value && !editEnabled && hasEditPermission) { |
|
|
|
|
e.preventDefault() |
|
|
|
|
clearSelectedRange() |
|
|
|
|
const row = data.value[activeCell.row] |
|
|
|
@ -226,6 +234,8 @@ const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCell
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (cmdOrCtrl) { |
|
|
|
|
if (!isCellActive.value) return |
|
|
|
|
|
|
|
|
|
switch (e.key) { |
|
|
|
|
case 'ArrowUp': |
|
|
|
|
e.preventDefault() |
|
|
|
@ -294,7 +304,7 @@ const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCell
|
|
|
|
|
// update/save cell value |
|
|
|
|
await updateOrSaveRow(rowObj, ctx.updatedColumnTitle || columnObj.title) |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
function scrollToCell(row?: number | null, col?: number | null) { |
|
|
|
|
row = row ?? activeCell.row |
|
|
|
@ -674,8 +684,7 @@ const closeAddColumnDropdown = () => {
|
|
|
|
|
<thead ref="tableHead"> |
|
|
|
|
<tr class="nc-grid-header border-1 bg-gray-100 sticky top[-1px]"> |
|
|
|
|
<th data-testid="grid-id-column"> |
|
|
|
|
<div class="w-full h-full bg-gray-100 flex min-w-[70px] pl-5 pr-1 items-center" |
|
|
|
|
data-testid="nc-check-all"> |
|
|
|
|
<div class="w-full h-full bg-gray-100 flex min-w-[70px] pl-5 pr-1 items-center" data-testid="nc-check-all"> |
|
|
|
|
<template v-if="!readOnly"> |
|
|
|
|
<div class="nc-no-label text-gray-500" :class="{ hidden: selectedAllRecords }">#</div> |
|
|
|
|
<div |
|
|
|
@ -897,8 +906,7 @@ const closeAddColumnDropdown = () => {
|
|
|
|
|
</div> |
|
|
|
|
</a-menu-item> |
|
|
|
|
|
|
|
|
|
<a-menu-item v-if="contextMenuTarget" data-testid="context-menu-item-copy" |
|
|
|
|
@click="copyValue(contextMenuTarget)"> |
|
|
|
|
<a-menu-item v-if="contextMenuTarget" data-testid="context-menu-item-copy" @click="copyValue(contextMenuTarget)"> |
|
|
|
|
<div v-e="['a:row:copy']" class="nc-project-menu-item"> |
|
|
|
|
<!-- Copy --> |
|
|
|
|
{{ $t('general.copy') }} |
|
|
|
|