From 10f55cf572e27149d739bd7a35013c8063bf80c1 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 19 Jan 2022 18:33:58 +0000 Subject: [PATCH] Adding in static/dynamic select, as well as the ability to set a tooltip on a select. --- packages/bbui/src/Form/Field.svelte | 3 +- packages/bbui/src/Form/FieldLabel.svelte | 17 ++++-- packages/bbui/src/Form/Select.svelte | 3 +- packages/bbui/src/Label/Label.svelte | 59 +----------------- .../bbui/src/Tooltip/TooltipWrapper.svelte | 60 +++++++++++++++++++ .../DataTable/modals/CreateEditColumn.svelte | 20 ++++++- 6 files changed, 96 insertions(+), 66 deletions(-) create mode 100644 packages/bbui/src/Tooltip/TooltipWrapper.svelte diff --git a/packages/bbui/src/Form/Field.svelte b/packages/bbui/src/Form/Field.svelte index a2e41072a5..5033c28f7d 100644 --- a/packages/bbui/src/Form/Field.svelte +++ b/packages/bbui/src/Form/Field.svelte @@ -6,11 +6,12 @@ export let label = null export let labelPosition = "above" export let error = null + export let tooltip = ""
{#if label} - + {/if}
diff --git a/packages/bbui/src/Form/FieldLabel.svelte b/packages/bbui/src/Form/FieldLabel.svelte index b070df8cae..3606d77c7b 100644 --- a/packages/bbui/src/Form/FieldLabel.svelte +++ b/packages/bbui/src/Form/FieldLabel.svelte @@ -1,19 +1,24 @@ - + + + diff --git a/packages/bbui/src/Tooltip/TooltipWrapper.svelte b/packages/bbui/src/Tooltip/TooltipWrapper.svelte new file mode 100644 index 0000000000..c587dec1dc --- /dev/null +++ b/packages/bbui/src/Tooltip/TooltipWrapper.svelte @@ -0,0 +1,60 @@ + + +
+ + {#if tooltip} +
+
(showTooltip = true)} + on:mouseleave={() => (showTooltip = false)} + > + +
+ {#if showTooltip} +
+ +
+ {/if} +
+ {/if} +
+ + diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 1fa5c6e073..370289f11f 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -150,6 +150,7 @@ delete field.subtype delete field.tableId delete field.relationshipType + delete field.formulaType // Add in defaults and initial definition const definition = fieldDefinitions[event.detail?.toUpperCase()] @@ -161,6 +162,9 @@ if (field.type === LINK_TYPE) { field.relationshipType = RelationshipTypes.MANY_TO_MANY } + if (field.type === FORMULA_TYPE) { + field.formulaType = "dynamic" + } } function onChangeRequired(e) { @@ -431,8 +435,20 @@ error={errors.relatedName} /> {:else if field.type === FORMULA_TYPE} + (field.subtype = e.detail)} options={Object.entries(getAutoColumnInformation())}