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 ef4726751b..1524459d57 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnDrawer.svelte @@ -15,6 +15,7 @@ export let columns = [] export let options = [] + export let schema = {} const flipDurationMs = 150 let dragDisabled = true @@ -61,11 +62,22 @@ dragDisabled = true } + const addAllColumns = () => { + let newColumns = [] + options.forEach(field => { + const fieldSchema = schema[field] + if (!fieldSchema?.autocolumn) { + newColumns.push({ + name: field, + displayName: field, + }) + } + }) + columns = newColumns + } + const reset = () => { - columns = options.map(col => ({ - name: col, - displayName: col, - })) + columns = [] } @@ -78,6 +90,7 @@
+
(column.displayName = e.detail)} /> + {:else}
-
- Add the first column to your table. +
+ + By default, all table columns will automatically be shown. +
+ You can manually control which columns are included in your table, + and their widths, by adding them below. + +
{/if} -
-
-
-
- +
+
+ + + {#if columns?.length} -
+ {/if}
@@ -143,7 +163,7 @@