From 48309349aef4cb0cb57136a8dafe927ac066e0fa Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Mar 2023 08:32:03 +0000 Subject: [PATCH] Add basic keyboard interactions to dataspaces --- .../components/sheet/KeyboardManager.svelte | 68 +++++++++++++++++++ .../src/components/sheet/Sheet.svelte | 12 ++-- .../src/components/sheet/SheetRow.svelte | 2 +- .../src/components/sheet/StickyColumn.svelte | 2 +- .../src/components/sheet/stores/rows.js | 4 +- .../sheet/stores/{interface.js => ui.js} | 21 +++++- 6 files changed, 99 insertions(+), 10 deletions(-) create mode 100644 packages/frontend-core/src/components/sheet/KeyboardManager.svelte rename packages/frontend-core/src/components/sheet/stores/{interface.js => ui.js} (82%) diff --git a/packages/frontend-core/src/components/sheet/KeyboardManager.svelte b/packages/frontend-core/src/components/sheet/KeyboardManager.svelte new file mode 100644 index 0000000000..03ad5e30c8 --- /dev/null +++ b/packages/frontend-core/src/components/sheet/KeyboardManager.svelte @@ -0,0 +1,68 @@ + diff --git a/packages/frontend-core/src/components/sheet/Sheet.svelte b/packages/frontend-core/src/components/sheet/Sheet.svelte index 333a0a0d66..6c3bcfa321 100644 --- a/packages/frontend-core/src/components/sheet/Sheet.svelte +++ b/packages/frontend-core/src/components/sheet/Sheet.svelte @@ -9,7 +9,7 @@ import { createColumnsStores } from "./stores/columns" import { createScrollStores } from "./stores/scroll" import { createBoundsStores } from "./stores/bounds" - import { createInterfaceStores } from "./stores/interface" + import { createUIStores } from "./stores/ui" export { createUserStores } from "./stores/users" import { createWebsocket } from "./websocket" import { createUserStores } from "./stores/users" @@ -23,6 +23,8 @@ import MenuOverlay from "./MenuOverlay.svelte" import StickyColumn from "./StickyColumn.svelte" import UserAvatars from "./UserAvatars.svelte" + import KeyboardManager from "./KeyboardManager.svelte" + import { clickOutside } from "@budibase/bbui" export let API export let tableId @@ -60,12 +62,12 @@ context = { ...context, ...createScrollStores(context) } context = { ...context, ...createViewportStores(context) } context = { ...context, ...createReorderStores(context) } - context = { ...context, ...createInterfaceStores(context) } + context = { ...context, ...createUIStores(context) } context = { ...context, ...createUserStores(context) } context = { ...context, ...createMenuStores(context) } // Reference some stores for local use - const { isResizing, isReordering } = context + const { isResizing, isReordering, ui } = context // Keep config store up to date $: config.set({ @@ -88,10 +90,11 @@
@@ -112,6 +115,7 @@
+