From ac65ec7f8c74d5242c888ce663575339aa50afbd Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 1 Dec 2022 18:02:20 +0800 Subject: [PATCH] fix(nc-gui): change $e type from a -> c --- packages/nc-gui/components/dashboard/TreeView.vue | 2 +- packages/nc-gui/components/general/FullScreen.vue | 2 +- .../nc-gui/components/general/ShareBaseButton.vue | 2 +- packages/nc-gui/components/smartsheet/Grid.vue | 12 ++++++------ .../nc-gui/pages/[projectType]/[projectId]/index.vue | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/nc-gui/components/dashboard/TreeView.vue b/packages/nc-gui/components/dashboard/TreeView.vue index 6a4c1f3e76..8a4f6a4523 100644 --- a/packages/nc-gui/components/dashboard/TreeView.vue +++ b/packages/nc-gui/components/dashboard/TreeView.vue @@ -241,7 +241,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => { if (isCreateTableAllowed.value && !isDrawerOrModalExist()) { // prevent the key `T` is inputted to table title input e.preventDefault() - $e('a:shortcut', { key: 'ALT + T' }) + $e('c:shortcut', { key: 'ALT + T' }) openTableCreateDialog() } break diff --git a/packages/nc-gui/components/general/FullScreen.vue b/packages/nc-gui/components/general/FullScreen.vue index 0562df692b..c779635125 100644 --- a/packages/nc-gui/components/general/FullScreen.vue +++ b/packages/nc-gui/components/general/FullScreen.vue @@ -22,7 +22,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => { case 70: { // ALT + F if (!isDrawerOrModalExist()) { - $e('a:shortcut', { key: 'ALT + F' }) + $e('c:shortcut', { key: 'ALT + F' }) isSidebarsOpen.value = !isSidebarsOpen.value } break diff --git a/packages/nc-gui/components/general/ShareBaseButton.vue b/packages/nc-gui/components/general/ShareBaseButton.vue index 96e687cf3e..b010809848 100644 --- a/packages/nc-gui/components/general/ShareBaseButton.vue +++ b/packages/nc-gui/components/general/ShareBaseButton.vue @@ -26,7 +26,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => { case 73: { // ALT + I if (isShareBaseAllowed.value && !isDrawerOrModalExist()) { - $e('a:shortcut', { key: 'ALT + I' }) + $e('c:shortcut', { key: 'ALT + I' }) showUserModal.value = true } break diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index e785bfc7bb..aadfaa2539 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -226,7 +226,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa switch (e.key) { case 'ArrowUp': e.preventDefault() - $e('a:shortcut', { key: 'CTRL + ArrowUp' }) + $e('c:shortcut', { key: 'CTRL + ArrowUp' }) selectedCell.row = 0 selectedCell.col = selectedCell.col ?? 0 scrollToCell?.() @@ -234,7 +234,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa return true case 'ArrowDown': e.preventDefault() - $e('a:shortcut', { key: 'CTRL + ArrowDown' }) + $e('c:shortcut', { key: 'CTRL + ArrowDown' }) selectedCell.row = data.value.length - 1 selectedCell.col = selectedCell.col ?? 0 scrollToCell?.() @@ -242,7 +242,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa return true case 'ArrowRight': e.preventDefault() - $e('a:shortcut', { key: 'CTRL + ArrowRight' }) + $e('c:shortcut', { key: 'CTRL + ArrowRight' }) selectedCell.row = selectedCell.row ?? 0 selectedCell.col = fields.value?.length - 1 scrollToCell?.() @@ -250,7 +250,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa return true case 'ArrowLeft': e.preventDefault() - $e('a:shortcut', { key: 'CTRL + ArrowLeft' }) + $e('c:shortcut', { key: 'CTRL + ArrowLeft' }) selectedCell.row = selectedCell.row ?? 0 selectedCell.col = 0 scrollToCell?.() @@ -264,7 +264,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa case 82: { // ALT + R if (isAddingEmptyRowAllowed) { - $e('a:shortcut', { key: 'ALT + R' }) + $e('c:shortcut', { key: 'ALT + R' }) addEmptyRow() } break @@ -272,7 +272,7 @@ const { selectCell, startSelectRange, endSelectRange, clearSelectedRange, copyVa case 67: { // ALT + C if (isAddingColumnAllowed) { - $e('a:shortcut', { key: 'ALT + C' }) + $e('c:shortcut', { key: 'ALT + C' }) addColumnDropdown.value = true } break diff --git a/packages/nc-gui/pages/[projectType]/[projectId]/index.vue b/packages/nc-gui/pages/[projectType]/[projectId]/index.vue index edc83e18b7..983090343d 100644 --- a/packages/nc-gui/pages/[projectType]/[projectId]/index.vue +++ b/packages/nc-gui/pages/[projectType]/[projectId]/index.vue @@ -213,7 +213,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => { // ALT + , if (isUIAllowed('settings') && !isDrawerOrModalExist()) { e.preventDefault() - $e('a:shortcut', { key: 'ALT + ,' }) + $e('c:shortcut', { key: 'ALT + ,' }) toggleDialog(true, 'teamAndAuth') } break @@ -224,7 +224,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => { switch (e.key) { case '/': if (!isDrawerOrModalExist()) { - $e('a:shortcut', { key: 'CTRL + /' }) + $e('c:shortcut', { key: 'CTRL + /' }) openKeyboardShortcutDialog() } break