|
|
@ -37,6 +37,7 @@ import { |
|
|
|
useI18n, |
|
|
|
useI18n, |
|
|
|
useMetas, |
|
|
|
useMetas, |
|
|
|
useMultiSelect, |
|
|
|
useMultiSelect, |
|
|
|
|
|
|
|
useNuxtApp, |
|
|
|
useRoles, |
|
|
|
useRoles, |
|
|
|
useRoute, |
|
|
|
useRoute, |
|
|
|
useSmartsheetStoreOrThrow, |
|
|
|
useSmartsheetStoreOrThrow, |
|
|
@ -52,6 +53,8 @@ const meta = inject(MetaInj, ref()) |
|
|
|
|
|
|
|
|
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { $e } = useNuxtApp() |
|
|
|
|
|
|
|
|
|
|
|
// keep a root fields variable and will get modified from |
|
|
|
// keep a root fields variable and will get modified from |
|
|
|
// fields menu and get used in grid and gallery |
|
|
|
// fields menu and get used in grid and gallery |
|
|
|
const fields = inject(FieldsInj, ref([])) |
|
|
|
const fields = inject(FieldsInj, ref([])) |
|
|
@ -223,6 +226,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa |
|
|
|
switch (e.key) { |
|
|
|
switch (e.key) { |
|
|
|
case 'ArrowUp': |
|
|
|
case 'ArrowUp': |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
|
|
|
|
$e('a:shortcut', { key: 'CTRL + ArrowUp' }) |
|
|
|
selectedCell.row = 0 |
|
|
|
selectedCell.row = 0 |
|
|
|
selectedCell.col = selectedCell.col ?? 0 |
|
|
|
selectedCell.col = selectedCell.col ?? 0 |
|
|
|
scrollToCell?.() |
|
|
|
scrollToCell?.() |
|
|
@ -230,6 +234,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa |
|
|
|
return true |
|
|
|
return true |
|
|
|
case 'ArrowDown': |
|
|
|
case 'ArrowDown': |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
|
|
|
|
$e('a:shortcut', { key: 'CTRL + ArrowDown' }) |
|
|
|
selectedCell.row = data.value.length - 1 |
|
|
|
selectedCell.row = data.value.length - 1 |
|
|
|
selectedCell.col = selectedCell.col ?? 0 |
|
|
|
selectedCell.col = selectedCell.col ?? 0 |
|
|
|
scrollToCell?.() |
|
|
|
scrollToCell?.() |
|
|
@ -237,6 +242,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa |
|
|
|
return true |
|
|
|
return true |
|
|
|
case 'ArrowRight': |
|
|
|
case 'ArrowRight': |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
|
|
|
|
$e('a:shortcut', { key: 'CTRL + ArrowRight' }) |
|
|
|
selectedCell.row = selectedCell.row ?? 0 |
|
|
|
selectedCell.row = selectedCell.row ?? 0 |
|
|
|
selectedCell.col = fields.value?.length - 1 |
|
|
|
selectedCell.col = fields.value?.length - 1 |
|
|
|
scrollToCell?.() |
|
|
|
scrollToCell?.() |
|
|
@ -244,6 +250,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa |
|
|
|
return true |
|
|
|
return true |
|
|
|
case 'ArrowLeft': |
|
|
|
case 'ArrowLeft': |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
|
|
|
|
$e('a:shortcut', { key: 'CTRL + ArrowLeft' }) |
|
|
|
selectedCell.row = selectedCell.row ?? 0 |
|
|
|
selectedCell.row = selectedCell.row ?? 0 |
|
|
|
selectedCell.col = 0 |
|
|
|
selectedCell.col = 0 |
|
|
|
scrollToCell?.() |
|
|
|
scrollToCell?.() |
|
|
@ -257,6 +264,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa |
|
|
|
case 82: { |
|
|
|
case 82: { |
|
|
|
// ALT + R |
|
|
|
// ALT + R |
|
|
|
if (isAddingEmptyRowAllowed) { |
|
|
|
if (isAddingEmptyRowAllowed) { |
|
|
|
|
|
|
|
$e('a:shortcut', { key: 'ALT + R' }) |
|
|
|
addEmptyRow() |
|
|
|
addEmptyRow() |
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
@ -264,6 +272,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa |
|
|
|
case 67: { |
|
|
|
case 67: { |
|
|
|
// ALT + C |
|
|
|
// ALT + C |
|
|
|
if (isAddingColumnAllowed) { |
|
|
|
if (isAddingColumnAllowed) { |
|
|
|
|
|
|
|
$e('a:shortcut', { key: 'ALT + C' }) |
|
|
|
addColumnDropdown.value = true |
|
|
|
addColumnDropdown.value = true |
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|