From 517fb201ec371dcefbfabae93c4ca609053ee46f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 6 Oct 2020 16:02:48 +0100 Subject: [PATCH] Move multiselect to BBUI --- packages/builder/package.json | 2 +- .../DataTable/RecordFieldControl.svelte | 24 ++- .../modals/CreateEditRecordModal.svelte | 7 +- .../common/LinkedRecordSelector.svelte | 13 +- .../src/components/common/MultiSelect.svelte | 146 +++++++++++++----- packages/builder/yarn.lock | 12 +- 6 files changed, 131 insertions(+), 73 deletions(-) diff --git a/packages/builder/package.json b/packages/builder/package.json index 0ad83945b1..73a8be3fe6 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -63,7 +63,7 @@ } }, "dependencies": { - "@budibase/bbui": "^1.39.0", + "@budibase/bbui": "^1.40.1", "@budibase/client": "^0.1.23", "@budibase/colorpicker": "^1.0.1", "@fortawesome/fontawesome-free": "^5.14.0", diff --git a/packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte b/packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte index 55129b47e3..50d13557fd 100644 --- a/packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte +++ b/packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte @@ -2,39 +2,33 @@ import { Input, Select, Label, DatePicker, Toggle } from "@budibase/bbui" import Dropzone from "components/common/Dropzone.svelte" import { capitalise } from "../../../helpers" + import LinkedRecordSelector from "components/common/LinkedRecordSelector.svelte" export let meta export let value = meta.type === "boolean" ? false : "" - const type = determineInputType(meta) - const label = capitalise(meta.name) - - function determineInputType(meta) { - if (meta.type === "datetime") return "date" - if (meta.type === "number") return "number" - if (meta.type === "boolean") return "checkbox" - if (meta.type === "attachment") return "file" - if (meta.type === "options") return "select" - return "text" - } + $: type = meta.type + $: label = capitalise(meta.name) -{#if type === 'select'} +{#if type === 'options'} -{:else if type === 'date'} +{:else if type === 'datetime'} -{:else if type === 'file'} +{:else if type === 'attachment'}
-{:else if type === 'checkbox'} +{:else if type === 'boolean'} +{:else if type === 'link'} + {:else} {/if} diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditRecordModal.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditRecordModal.svelte index 2592552236..547d68d50a 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditRecordModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditRecordModal.svelte @@ -1,7 +1,6 @@