diff --git a/packages/frontend-core/src/components/sheet/KeyboardManager.svelte b/packages/frontend-core/src/components/sheet/KeyboardManager.svelte
index bb3e9410e4..684ce81fe0 100644
--- a/packages/frontend-core/src/components/sheet/KeyboardManager.svelte
+++ b/packages/frontend-core/src/components/sheet/KeyboardManager.svelte
@@ -2,23 +2,36 @@
import { getContext, onMount } from "svelte"
import { get } from "svelte/store"
- const { rows, rand, selectedCellId, columns, selectedCellRow, stickyColumn, selectedCellAPI } =
- getContext("sheet")
+ const {
+ rows,
+ selectedCellId,
+ columns,
+ selectedCellRow,
+ stickyColumn,
+ selectedCellAPI,
+ } = getContext("sheet")
const handleKeyDown = e => {
const api = get(selectedCellAPI)
+ if (!api) {
+ return
+ }
- // Always capture escape and blur any selected cell
+ // Always intercept certain key presses
if (e.key === "Escape") {
- api?.blur()
+ api.blur()
+ } else if (e.key === "Tab") {
+ api.blur()
+ changeSelectedColumn(1)
}
// Pass the key event to the selected cell and let it decide whether to
// capture it or not
- const handled = api?.onKeyDown?.(e)
+ const handled = api.onKeyDown?.(e)
if (handled) {
return
}
+ e.preventDefault()
// Handle the key ourselves
switch (e.key) {
@@ -39,7 +52,7 @@
break
case "Enter":
focusSelectedCell()
- break;
+ break
}
}
diff --git a/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte b/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte
index ab39b01fa0..256feb9f0a 100644
--- a/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte
+++ b/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte
@@ -46,6 +46,7 @@
// Handles a wheel even and updates the scroll offsets
const handleWheel = e => {
+ console.log("wheel scrol!")
e.preventDefault()
const modifier = e.ctrlKey || e.metaKey
let x = modifier ? e.deltaY : e.deltaX
diff --git a/packages/frontend-core/src/components/sheet/cells/BlankCell.svelte b/packages/frontend-core/src/components/sheet/cells/BlankCell.svelte
new file mode 100644
index 0000000000..2a2a65044f
--- /dev/null
+++ b/packages/frontend-core/src/components/sheet/cells/BlankCell.svelte
@@ -0,0 +1 @@
+
[MISSING]
diff --git a/packages/frontend-core/src/components/sheet/cells/HeaderCell.svelte b/packages/frontend-core/src/components/sheet/cells/HeaderCell.svelte
index 155a287df2..81adafd6ed 100644
--- a/packages/frontend-core/src/components/sheet/cells/HeaderCell.svelte
+++ b/packages/frontend-core/src/components/sheet/cells/HeaderCell.svelte
@@ -2,7 +2,7 @@
import { getContext } from "svelte"
import SheetCell from "./SheetCell.svelte"
import { Icon, Popover, Menu, MenuItem } from "@budibase/bbui"
- import { getIconForField } from "../utils"
+ import { getColumnIcon } from "../utils"
export let column
export let idx
@@ -17,7 +17,7 @@
renderedColumns,
dispatch,
config,
- ui
+ ui,
} = getContext("sheet")
let anchor
@@ -99,7 +99,7 @@
>
diff --git a/packages/frontend-core/src/components/sheet/cells/LongFormCell.svelte b/packages/frontend-core/src/components/sheet/cells/LongFormCell.svelte
new file mode 100644
index 0000000000..982c449d2a
--- /dev/null
+++ b/packages/frontend-core/src/components/sheet/cells/LongFormCell.svelte
@@ -0,0 +1,101 @@
+
+
+{#if isOpen}
+
+{:else}
+
+{/if}
+
+
diff --git a/packages/frontend-core/src/components/sheet/cells/OptionsCell.svelte b/packages/frontend-core/src/components/sheet/cells/OptionsCell.svelte
index 1c96eab83c..d7837eff91 100644
--- a/packages/frontend-core/src/components/sheet/cells/OptionsCell.svelte
+++ b/packages/frontend-core/src/components/sheet/cells/OptionsCell.svelte
@@ -183,17 +183,18 @@
);
}
.options {
- min-width: 100%;
+ min-width: calc(100% + 2px);
position: absolute;
- top: 0;
- left: 0;
+ top: -1px;
+ left: -1px;
display: flex;
flex-direction: column;
box-shadow: 0 0 8px 4px rgba(0, 0, 0, 0.15);
justify-content: flex-start;
align-items: stretch;
- max-height: calc(6 * var(--cell-height) - 1px);
+ max-height: calc(5 * var(--cell-height) + 1px);
overflow-y: auto;
+ border: var(--cell-border);
}
.option {
flex: 0 0 var(--cell-height);
diff --git a/packages/frontend-core/src/components/sheet/renderers.js b/packages/frontend-core/src/components/sheet/renderers.js
index c8bede658d..dca114346c 100644
--- a/packages/frontend-core/src/components/sheet/renderers.js
+++ b/packages/frontend-core/src/components/sheet/renderers.js
@@ -4,13 +4,22 @@ import MultiSelectCell from "./cells/MultiSelectCell.svelte"
import NumberCell from "./cells/NumberCell.svelte"
import RelationshipCell from "./cells/RelationshipCell.svelte"
import TextCell from "./cells/TextCell.svelte"
+import BlankCell from "./cells/BlankCell.svelte"
+import LongFormCell from "./cells/LongFormCell.svelte"
const TypeComponentMap = {
+ text: TextCell,
options: OptionsCell,
datetime: DateCell,
+ barcodeqr: BlankCell,
+ longform: LongFormCell,
array: MultiSelectCell,
number: NumberCell,
+ boolean: BlankCell,
+ attachment: BlankCell,
link: RelationshipCell,
+ formula: BlankCell,
+ json: BlankCell,
}
export const getCellRenderer = column => {
return TypeComponentMap[column?.schema?.type] || TextCell
diff --git a/packages/frontend-core/src/components/sheet/utils.js b/packages/frontend-core/src/components/sheet/utils.js
index dd2dd4ee57..8ff2b621c1 100644
--- a/packages/frontend-core/src/components/sheet/utils.js
+++ b/packages/frontend-core/src/components/sheet/utils.js
@@ -5,10 +5,10 @@ export const getColor = (idx, opacity = 0.3) => {
return `hsla(${((idx + 1) * 222) % 360}, 90%, 75%, ${opacity})`
}
-const DataTypeIconMap = {
+const TypeIconMap = {
+ text: "Text",
options: "Dropdown",
datetime: "Date",
- text: "Text",
barcodeqr: "Camera",
longform: "TextAlignLeft",
array: "Dropdown",
@@ -20,7 +20,7 @@ const DataTypeIconMap = {
json: "Brackets",
}
-export const getIconForField = field => {
- const type = field.schema.type
- return DataTypeIconMap[type] || "Text"
+export const getColumnIcon = column => {
+ const type = column.schema.type
+ return TypeIconMap[type] || "Text"
}