From 7ec5c2b1f2cf9b462ad360cb1d7ceb2f5b1738ab Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 3 Nov 2021 11:58:06 +0000 Subject: [PATCH] Allow table with search block to render correct components for all relevant field types --- packages/client/manifest.json | 18 +- packages/client/src/components/Block.svelte | 5 +- .../app/blocks/TableWithSearch.svelte | 166 +++++++++++++----- 3 files changed, 129 insertions(+), 60 deletions(-) diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 541bd80a18..fe6db323cb 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -2626,13 +2626,6 @@ "key": "rowCount", "defaultValue": 8 }, - { - "type": "multifield", - "label": "Table Columns", - "key": "tableColumns", - "dependsOn": "dataSource", - "placeholder": "All columns" - }, { "type": "select", "label": "Size", @@ -2649,14 +2642,21 @@ } ] }, + { + "type": "multifield", + "label": "Table Columns", + "key": "tableColumns", + "dependsOn": "dataSource", + "placeholder": "All columns" + }, { "type": "boolean", - "label": "Quiet", + "label": "Quiet table variant", "key": "quiet" }, { "type": "boolean", - "label": "Auto Columns", + "label": "Show auto columns", "key": "showAutoColumns", "defaultValue": false } diff --git a/packages/client/src/components/Block.svelte b/packages/client/src/components/Block.svelte index d8698a1d2c..b5e610c1bb 100644 --- a/packages/client/src/components/Block.svelte +++ b/packages/client/src/components/Block.svelte @@ -2,7 +2,6 @@ import { getContext, setContext } from "svelte" const component = getContext("component") - const { styleable } = getContext("sdk") // We need to set a block context to know we're inside a block, but also // to be able to reference the actual component ID of the block from @@ -10,6 +9,4 @@ setContext("block", { id: $component.id }) -
- -
+ diff --git a/packages/client/src/components/app/blocks/TableWithSearch.svelte b/packages/client/src/components/app/blocks/TableWithSearch.svelte index f5f84b664a..b3b6598cee 100644 --- a/packages/client/src/components/app/blocks/TableWithSearch.svelte +++ b/packages/client/src/components/app/blocks/TableWithSearch.svelte @@ -1,4 +1,5 @@ - - {#if searchColumns?.length} -