From 773d0268d497884d7e6d996ca08ea201161ff250 Mon Sep 17 00:00:00 2001 From: Conor_Mack Date: Tue, 2 Jun 2020 14:01:25 +0100 Subject: [PATCH] Card Settings and Fix for Input Suffixes --- .../src/components/common/Input.svelte | 13 +- .../userInterface/propertyCategories.js | 6 + .../userInterface/temporaryPanelStructure.js | 30 ++- packages/server/yarn.lock | 190 +----------------- 4 files changed, 49 insertions(+), 190 deletions(-) diff --git a/packages/builder/src/components/common/Input.svelte b/packages/builder/src/components/common/Input.svelte index 04272c1d76..03759a1ef2 100644 --- a/packages/builder/src/components/common/Input.svelte +++ b/packages/builder/src/components/common/Input.svelte @@ -5,13 +5,24 @@ export let textAlign = "left" export let width = "160px" export let placeholder = "" + export let suffix = "" + export let onChange = val => {} let centerPlaceholder = textAlign === "center" let style = buildStyle({ width, textAlign }) + + function handleChange(val) { + value = val + let _value = suffix ? value + suffix : value + onChange(_value) + } + + $: displayValue = suffix && value.endsWith(suffix) ? value.replace(new RegExp(`${suffix}$`), "") : value + - + handleChange(e.target.value)} />