From 90bcd87d246951c3b933f51fad9cedf925201dbc Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 19 Apr 2021 14:04:07 +0100 Subject: [PATCH] Update all design panel settings and styles to use new spectrum components --- .../bbui/src/DropdownMenu/DropdownMenu.svelte | 3 +- packages/bbui/src/Form/Core/Picker.svelte | 13 +- packages/bbui/src/Form/Core/Select.svelte | 3 + packages/bbui/src/Form/Core/TextField.svelte | 21 +- packages/bbui/src/Form/Input.svelte | 5 +- packages/bbui/src/Form/Multiselect.svelte | 8 +- packages/bbui/src/Form/Select.svelte | 5 +- .../PropertyControls/DataSourceSelect.svelte | 63 ++--- .../PropertyControls/FieldSelect.svelte | 32 ++- .../PropertyControls/LayoutSelect.svelte | 12 +- .../PropertyControls/MultiFieldSelect.svelte | 34 ++- .../PropertyControls/MultiOptionSelect.svelte | 43 --- .../PropertyControls/OptionSelect.svelte | 257 ------------------ .../PropertyControls/RoleSelect.svelte | 12 +- packages/standard-components/manifest.json | 16 +- 15 files changed, 143 insertions(+), 384 deletions(-) delete mode 100644 packages/builder/src/components/design/PropertiesPanel/PropertyControls/MultiOptionSelect.svelte delete mode 100644 packages/builder/src/components/design/PropertiesPanel/PropertyControls/OptionSelect.svelte diff --git a/packages/bbui/src/DropdownMenu/DropdownMenu.svelte b/packages/bbui/src/DropdownMenu/DropdownMenu.svelte index d297e5e947..b3e19dbf3a 100644 --- a/packages/bbui/src/DropdownMenu/DropdownMenu.svelte +++ b/packages/bbui/src/DropdownMenu/DropdownMenu.svelte @@ -43,7 +43,8 @@ use:clickOutside={hide} style={menuStyle} on:keydown={handleEscape} - class="spectrum-Popover is-open" role="presentation"> + class="spectrum-Popover is-open" + role="presentation"> diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index 1e2d6645ac..5bc0480f94 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -3,6 +3,7 @@ import "@spectrum-css/popover/dist/index-vars.css" import "@spectrum-css/menu/dist/index-vars.css" import { fly } from "svelte/transition" + import { createEventDispatcher } from "svelte" export let id = null export let disabled = false @@ -16,6 +17,16 @@ export let getOptionLabel = option => option export let getOptionValue = option => option export let open = false + export let readonly = false + + const dispatch = createEventDispatcher() + const onClick = () => { + dispatch("click") + if (readonly) { + return + } + open = true + }