From f6466711ded0ff958999c4e1859ae0a6f29c00d0 Mon Sep 17 00:00:00 2001 From: Conor_Mack Date: Fri, 29 May 2020 10:45:19 +0100 Subject: [PATCH] Tidyup --- .../userInterface/OptionSelect.svelte | 26 ++++++++++--------- .../userInterface/SettingsView.svelte | 4 --- packages/builder/src/helpers.js | 13 ++++++++++ 3 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 packages/builder/src/helpers.js diff --git a/packages/builder/src/components/userInterface/OptionSelect.svelte b/packages/builder/src/components/userInterface/OptionSelect.svelte index 8ac0ca4184..197d3e6a0d 100644 --- a/packages/builder/src/components/userInterface/OptionSelect.svelte +++ b/packages/builder/src/components/userInterface/OptionSelect.svelte @@ -1,7 +1,6 @@ - - {#if panelDefinition.length > 0} {#each panelDefinition as definition} {#if propExistsOnComponentDef(definition.key)} diff --git a/packages/builder/src/helpers.js b/packages/builder/src/helpers.js new file mode 100644 index 0000000000..ee2053d8e4 --- /dev/null +++ b/packages/builder/src/helpers.js @@ -0,0 +1,13 @@ +export const buildStyle = styles => { + let str = "" + for (let s in styles) { + if (styles[s]) { + str += `${s}: ${styles[s]}; ` + } + } + return str +} + +export const convertCamel = str => { + return str.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`) +}