diff --git a/lerna.json b/lerna.json index 694a22ccc9..b1292cd20a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.33-alpha.6", + "version": "2.9.33-alpha.11", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/bbui/src/FancyForm/FancySelect.svelte b/packages/bbui/src/FancyForm/FancySelect.svelte index ee43ecc3ca..e015f51570 100644 --- a/packages/bbui/src/FancyForm/FancySelect.svelte +++ b/packages/bbui/src/FancyForm/FancySelect.svelte @@ -2,8 +2,9 @@ import { createEventDispatcher } from "svelte" import FancyField from "./FancyField.svelte" import Icon from "../Icon/Icon.svelte" - import Popover from "../Popover/Popover.svelte" import FancyFieldLabel from "./FancyFieldLabel.svelte" + import StatusLight from "../StatusLight/StatusLight.svelte" + import Picker from "../Form/Core/Picker.svelte" export let label export let value @@ -11,18 +12,30 @@ export let error = null export let validate = null export let options = [] + export let isOptionEnabled = () => true export let getOptionLabel = option => extractProperty(option, "label") export let getOptionValue = option => extractProperty(option, "value") - + export let getOptionSubtitle = option => extractProperty(option, "subtitle") + export let getOptionColour = () => null const dispatch = createEventDispatcher() let open = false - let popover let wrapper $: placeholder = !value $: selectedLabel = getSelectedLabel(value) + $: fieldColour = getFieldAttribute(getOptionColour, value, options) + const getFieldAttribute = (getAttribute, value, options) => { + // Wait for options to load if there is a value but no options + if (!options?.length) { + return "" + } + const index = options.findIndex( + (option, idx) => getOptionValue(option, idx) === value + ) + return index !== -1 ? getAttribute(options[index], index) : null + } const extractProperty = (value, property) => { if (value && typeof value === "object") { return value[property] @@ -64,46 +77,45 @@ {label} {/if} + {#if fieldColour} + + + + {/if} +
{selectedLabel || ""}
-
+
- (open = false)} - useAnchorWidth={true} - maxWidth={null} -> -
- {#if options.length} - {#each options as option, idx} -
onChange(getOptionValue(option, idx))} - > - - {getOptionLabel(option, idx)} - - {#if value === getOptionValue(option, idx)} - - {/if} -
- {/each} - {/if} -
-
+
+ option === value} + /> +
diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index aada17b318..f736f523ad 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -8,6 +8,8 @@ import Icon from "../../Icon/Icon.svelte" import StatusLight from "../../StatusLight/StatusLight.svelte" import Popover from "../../Popover/Popover.svelte" + import Tags from "../../Tags/Tags.svelte" + import Tag from "../../Tags/Tag.svelte" export let id = null export let disabled = false @@ -26,6 +28,7 @@ export let getOptionIcon = () => null export let useOptionIconImage = false export let getOptionColour = () => null + export let getOptionSubtitle = () => null export let open = false export let readonly = false export let quiet = false @@ -37,7 +40,7 @@ export let customPopoverHeight export let align = "left" export let footer = null - + export let customAnchor = null const dispatch = createEventDispatcher() let searchTerm = null @@ -99,7 +102,7 @@ bind:this={button} > {#if fieldIcon} - {#if !useOptionIconImage} + {#if !useOptionIconImage}x @@ -139,9 +142,8 @@ - {/if} + {#if getOptionSubtitle(option, idx)} + {getOptionSubtitle(option, idx)} + {/if} + {getOptionLabel(option, idx)} + {#if option.tag} + + + {option.tag} + + + {/if} .spectrum-Icon) { + margin-top: 2px; + } diff --git a/packages/bbui/src/Form/Core/Select.svelte b/packages/bbui/src/Form/Core/Select.svelte index 2fad886910..e79ead7e8c 100644 --- a/packages/bbui/src/Form/Core/Select.svelte +++ b/packages/bbui/src/Form/Core/Select.svelte @@ -21,7 +21,7 @@ export let sort = false export let align export let footer = null - + export let tag = null const dispatch = createEventDispatcher() let open = false @@ -83,6 +83,7 @@ {isOptionEnabled} {autocomplete} {sort} + {tag} isPlaceholder={value == null || value === ""} placeholderOption={placeholder === false ? null : placeholder} isOptionSelected={option => option === value} diff --git a/packages/bbui/src/Form/Select.svelte b/packages/bbui/src/Form/Select.svelte index e87496652d..a9214320f9 100644 --- a/packages/bbui/src/Form/Select.svelte +++ b/packages/bbui/src/Form/Select.svelte @@ -25,7 +25,7 @@ export let customPopoverHeight export let align export let footer = null - + export let tag = null const dispatch = createEventDispatcher() const onChange = e => { value = e.detail @@ -61,6 +61,7 @@ {isOptionEnabled} {autocomplete} {customPopoverHeight} + {tag} on:change={onChange} on:click /> diff --git a/packages/bbui/src/Tooltip/TempTooltip.svelte b/packages/bbui/src/Tooltip/TempTooltip.svelte index 0d590b1ec6..6da01a2bfc 100644 --- a/packages/bbui/src/Tooltip/TempTooltip.svelte +++ b/packages/bbui/src/Tooltip/TempTooltip.svelte @@ -4,7 +4,7 @@ export let text = null export let condition = true - export let duration = 3000 + export let duration = 5000 export let position export let type diff --git a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js index 968d6deb4a..54dd38ac63 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js @@ -3,6 +3,9 @@ import { Screen } from "./utils/Screen" import { Component } from "./utils/Component" export default function (datasources) { + if (!Array.isArray(datasources)) { + return [] + } return datasources.map(datasource => { return { name: `${datasource.name} - List`, diff --git a/packages/builder/src/components/backend/DataTable/buttons/grid/GridCreateViewButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/grid/GridCreateViewButton.svelte index 3244ce3277..3441d8de17 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/grid/GridCreateViewButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/grid/GridCreateViewButton.svelte @@ -1,18 +1,30 @@ - - Add view - + + + Create view + + diff --git a/packages/builder/src/components/backend/DataTable/modals/grid/GridCreateViewModal.svelte b/packages/builder/src/components/backend/DataTable/modals/grid/GridCreateViewModal.svelte index f698a8cb97..2f96a3d82a 100644 --- a/packages/builder/src/components/backend/DataTable/modals/grid/GridCreateViewModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/grid/GridCreateViewModal.svelte @@ -46,13 +46,13 @@
- Users - { - store.update(state => { - state.builderSidePanel = false - return state - }) - }} - /> -
- +
+ + { + store.update(state => { + state.builderSidePanel = false + return state + }) + }} + /> +
+ {#if !invitingFlow} +