From 0921bcf3334e6a77a67b8771005587e2f37a3af4 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 1 Nov 2023 11:40:27 +0000 Subject: [PATCH 001/155] Add button setting to grid and allow removing all buttons --- .../ButtonConfiguration/ButtonConfiguration.svelte | 13 ++++++++----- packages/client/manifest.json | 10 ++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/ButtonConfiguration/ButtonConfiguration.svelte b/packages/builder/src/components/design/settings/controls/ButtonConfiguration/ButtonConfiguration.svelte index 324418511b..6fed8abdba 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonConfiguration/ButtonConfiguration.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonConfiguration/ButtonConfiguration.svelte @@ -19,7 +19,7 @@ componentBindings: componentBindings || [], bindings, removeButton, - canRemove: buttonCount > 1, + canRemove: true, } const sanitizeValue = val => { @@ -86,11 +86,11 @@ focus={focusItem} draggable={buttonCount > 1} /> - - {/if} + + diff --git a/packages/frontend-core/src/components/grid/layout/Grid.svelte b/packages/frontend-core/src/components/grid/layout/Grid.svelte index e2ecd0f968..285282ddf7 100644 --- a/packages/frontend-core/src/components/grid/layout/Grid.svelte +++ b/packages/frontend-core/src/components/grid/layout/Grid.svelte @@ -48,6 +48,7 @@ export let fixedRowHeight = null export let notifySuccess = null export let notifyError = null + export let buttons = null // Unique identifier for DOM nodes inside this instance const rand = Math.random() @@ -99,6 +100,7 @@ fixedRowHeight, notifySuccess, notifyError, + buttons, }) // Set context for children to consume diff --git a/packages/frontend-core/src/components/grid/layout/GridBody.svelte b/packages/frontend-core/src/components/grid/layout/GridBody.svelte index 0bb2a51fb4..559c465b86 100644 --- a/packages/frontend-core/src/components/grid/layout/GridBody.svelte +++ b/packages/frontend-core/src/components/grid/layout/GridBody.svelte @@ -3,6 +3,7 @@ import GridScrollWrapper from "./GridScrollWrapper.svelte" import GridRow from "./GridRow.svelte" import { BlankRowID } from "../lib/constants" + import ButtonColumn from "./ButtonColumn.svelte" const { bounds, @@ -13,6 +14,7 @@ dispatch, isDragging, config, + props, } = getContext("grid") let body @@ -54,6 +56,9 @@ /> {/if} + {#if $props.buttons?.length} + + {/if} diff --git a/packages/bbui/src/Form/Core/CheckboxGroup.svelte b/packages/bbui/src/Form/Core/CheckboxGroup.svelte index faf37f3ad8..66ac55561b 100644 --- a/packages/bbui/src/Form/Core/CheckboxGroup.svelte +++ b/packages/bbui/src/Form/Core/CheckboxGroup.svelte @@ -35,17 +35,13 @@ title={getOptionLabel(option)} class="spectrum-Checkbox spectrum-FieldGroup-item" class:is-invalid={!!error} + class:readonly >