diff --git a/packages/bbui/src/Drawer/Drawer.svelte b/packages/bbui/src/Drawer/Drawer.svelte index 4bc8a69445..b4a73544c5 100644 --- a/packages/bbui/src/Drawer/Drawer.svelte +++ b/packages/bbui/src/Drawer/Drawer.svelte @@ -74,4 +74,12 @@ align-items: flex-start; gap: var(--spacing-xs); } + + .buttons { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + gap: var(--spacing-m); + } diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnDrawer.svelte new file mode 100644 index 0000000000..ef4726751b --- /dev/null +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnDrawer.svelte @@ -0,0 +1,178 @@ + + + +
+ + {#if columns?.length} + +
+
+ + +
+
+
+ {#each columns as column (column.id)} +
+
(dragDisabled = false)} + > + +
+ + removeColumn(column.id)} + disabled={columns.length === 1} + /> +
+ {/each} +
+ + {:else} +
+
+ Add the first column to your table. +
+ {/if} +
+
+
+
+ + +
+
+
+ +
+ + + diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnEditor.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnEditor.svelte new file mode 100644 index 0000000000..8cebf5a657 --- /dev/null +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColumnEditor/ColumnEditor.svelte @@ -0,0 +1,64 @@ + + +Configure columns + + + Configure the columns in your table. + + + + diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte index 40357f50be..33a82d1886 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte @@ -15,7 +15,7 @@ } -Configure Links +Configure links Configure the links in your navigation bar. diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/componentSettings.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/componentSettings.js index 15aa670fa9..23a0a312bc 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/componentSettings.js +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/componentSettings.js @@ -18,6 +18,7 @@ import OptionsEditor from "./OptionsEditor/OptionsEditor.svelte" import FormFieldSelect from "./FormFieldSelect.svelte" import ValidationEditor from "./ValidationEditor/ValidationEditor.svelte" import DrawerBindableCombobox from "components/common/bindings/DrawerBindableCombobox.svelte" +import ColumnEditor from "./ColumnEditor/ColumnEditor.svelte" const componentMap = { text: DrawerBindableCombobox, @@ -40,6 +41,7 @@ const componentMap = { navigation: NavigationEditor, filter: FilterEditor, url: URLSelect, + columns: ColumnEditor, "field/string": FormFieldSelect, "field/number": FormFieldSelect, "field/options": FormFieldSelect, diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 06dbaad660..d578c7056d 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -2680,11 +2680,10 @@ "defaultValue": 8 }, { - "type": "multifield", + "type": "columns", "label": "Columns", "key": "columns", - "dependsOn": "dataProvider", - "placeholder": "All columns" + "dependsOn": "dataProvider" }, { "type": "select", @@ -2951,7 +2950,7 @@ "defaultValue": 8 }, { - "type": "multifield", + "type": "columns", "label": "Table Columns", "key": "tableColumns", "dependsOn": "dataSource", diff --git a/packages/client/src/components/app/table/Table.svelte b/packages/client/src/components/app/table/Table.svelte index f462b93551..1662f5fa09 100644 --- a/packages/client/src/components/app/table/Table.svelte +++ b/packages/client/src/components/app/table/Table.svelte @@ -40,7 +40,8 @@ // Check for an invalid column selection let invalid = false customColumns?.forEach(column => { - if (schema[column] == null) { + const columnName = typeof column === "string" ? column : column.name + if (schema[columnName] == null) { invalid = true } }) @@ -75,9 +76,16 @@ } fields.forEach(field => { - newSchema[field] = schema[field] - if (schema[field] && UnsortableTypes.indexOf(schema[field].type) !== -1) { - newSchema[field].sortable = false + const columnName = typeof field === "string" ? field : field.name + if (!schema[columnName]) { + return + } + newSchema[columnName] = schema[columnName] + if (UnsortableTypes.includes(schema[columnName].type)) { + newSchema[columnName].sortable = false + } + if (field?.displayName) { + newSchema[columnName].displayName = field?.displayName } }) return newSchema