diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnDrawer.svelte index 3f2f75a206..ef4726751b 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnDrawer.svelte @@ -7,6 +7,7 @@ Input, Select, Label, + Body, } from "@budibase/bbui" import { flip } from "svelte/animate" import { dndzone } from "svelte-dnd-action" @@ -59,59 +60,81 @@ updateColumnOrder(e) dragDisabled = true } + + const reset = () => { + columns = options.map(col => ({ + name: col, + displayName: col, + })) + }
{#if columns?.length} -
+
- {#each columns as column (column.id)} -
-
(dragDisabled = false)} - > - +
+ {#each columns as column (column.id)} +
+
(dragDisabled = false)} + > + +
+ + removeColumn(column.id)} + disabled={columns.length === 1} + />
- - removeColumn(column.id)} - /> -
- {/each} + {/each} +
+ + {:else} +
+
+ Add the first column to your table.
{/if} -
-
- +
+
+
+
+ + +
+
@@ -145,4 +168,11 @@ display: grid; place-items: center; } + .buttons { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + gap: var(--spacing-m); + }