From 1a839c795cc261723994a02339859cf4dfd0391a Mon Sep 17 00:00:00 2001
From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com>
Date: Thu, 25 Jan 2024 12:47:34 +0000
Subject: [PATCH] feat(nc-gui): clickable command palette footer
---
packages/nc-gui/app.vue | 15 ++++-
.../nc-gui/components/cmd-footer/index.vue | 65 +++++++++++++++++++
packages/nc-gui/components/cmd-k/index.vue | 53 ++-------------
packages/nc-gui/components/cmd-l/index.vue | 28 +-------
.../composables/useCommandPalette/commands.ts | 2 -
packages/nc-gui/lib/types.ts | 3 +
6 files changed, 88 insertions(+), 78 deletions(-)
create mode 100644 packages/nc-gui/components/cmd-footer/index.vue
diff --git a/packages/nc-gui/app.vue b/packages/nc-gui/app.vue
index 78c4972704..3e61d2e478 100644
--- a/packages/nc-gui/app.vue
+++ b/packages/nc-gui/app.vue
@@ -1,6 +1,6 @@
@@ -85,10 +95,11 @@ function onScope(scope: string) {
:data="cmdData"
:placeholder="cmdPlaceholder"
:load-temporary-scope="loadTemporaryScope"
+ :set-active-cmd-view="setActiveCmdView"
@scope="onScope"
/>
-
+
diff --git a/packages/nc-gui/components/cmd-footer/index.vue b/packages/nc-gui/components/cmd-footer/index.vue
new file mode 100644
index 0000000000..cb1c4b2c98
--- /dev/null
+++ b/packages/nc-gui/components/cmd-footer/index.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
diff --git a/packages/nc-gui/components/cmd-k/index.vue b/packages/nc-gui/components/cmd-k/index.vue
index 26b6c77d44..be8d87084f 100644
--- a/packages/nc-gui/components/cmd-k/index.vue
+++ b/packages/nc-gui/components/cmd-k/index.vue
@@ -4,6 +4,7 @@ import { useMagicKeys, whenever } from '@vueuse/core'
import { commandScore } from './command-score'
import type { ComputedRef, VNode } from '#imports'
import { iconMap, onClickOutside } from '#imports'
+import type { CommandPaletteType } from '~/lib'
interface CmdAction {
id: string
@@ -25,6 +26,7 @@ const props = defineProps<{
placeholder?: string
hotkey?: string
loadTemporaryScope?: (scope: { scope: string; data: any }) => void
+ setActiveCmdView: (cmd: CommandPaletteType) => void
}>()
const emits = defineEmits(['update:open', 'scope'])
@@ -405,7 +407,7 @@ defineExpose({
{{ act.title }}
-
+
{{ act.title }}
@@ -426,54 +428,7 @@ defineExpose({
-
+
diff --git a/packages/nc-gui/components/cmd-l/index.vue b/packages/nc-gui/components/cmd-l/index.vue
index 703a8dd1d6..57e99cd02c 100644
--- a/packages/nc-gui/components/cmd-l/index.vue
+++ b/packages/nc-gui/components/cmd-l/index.vue
@@ -1,9 +1,11 @@