From 942af74bbdfbf9177b31d0f1773e7e25bfb5077b Mon Sep 17 00:00:00 2001 From: Joe <49767913+joebudi@users.noreply.github.com> Date: Wed, 24 Jun 2020 16:20:15 +0100 Subject: [PATCH] Formatting and linting --- .../ModelDataTable/ModelDataTable.svelte | 14 +- .../ModelDataTable/modals/DeleteRecord.svelte | 1 - .../Colorpicker/CheckedBackground.svelte | 23 +- .../Colorpicker/Colorpicker.svelte | 195 +++++++------- .../Colorpicker/Colorpreview.svelte | 237 +++++++++--------- .../userInterface/Colorpicker/Input.svelte | 7 +- .../userInterface/Colorpicker/Palette.svelte | 3 +- .../userInterface/Colorpicker/Slider.svelte | 42 ++-- .../userInterface/Colorpicker/Swatch.svelte | 54 ++-- .../BlockList/WorkflowBlock.svelte | 1 - packages/standard-components/src/Login.svelte | 17 +- 11 files changed, 300 insertions(+), 294 deletions(-) diff --git a/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte b/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte index b450c1eb25..69e2011989 100644 --- a/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/database/ModelDataTable/ModelDataTable.svelte @@ -55,14 +55,12 @@ $: { if ($backendUiStore.selectedView) { - api - .fetchDataForView($backendUiStore.selectedView) - .then(records => { - data = records || [] - headers = Object.keys($backendUiStore.selectedModel.schema).filter( - key => !INTERNAL_HEADERS.includes(key) - ) - }) + api.fetchDataForView($backendUiStore.selectedView).then(records => { + data = records || [] + headers = Object.keys($backendUiStore.selectedModel.schema).filter( + key => !INTERNAL_HEADERS.includes(key) + ) + }) } } diff --git a/packages/builder/src/components/database/ModelDataTable/modals/DeleteRecord.svelte b/packages/builder/src/components/database/ModelDataTable/modals/DeleteRecord.svelte index 203267996b..f3c32633cc 100644 --- a/packages/builder/src/components/database/ModelDataTable/modals/DeleteRecord.svelte +++ b/packages/builder/src/components/database/ModelDataTable/modals/DeleteRecord.svelte @@ -5,7 +5,6 @@ export let record export let onClosed -
diff --git a/packages/builder/src/components/userInterface/Colorpicker/CheckedBackground.svelte b/packages/builder/src/components/userInterface/Colorpicker/CheckedBackground.svelte index 9da2c7eaca..3d64c38921 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/CheckedBackground.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/CheckedBackground.svelte @@ -1,14 +1,14 @@ @@ -16,6 +16,9 @@
+
+ +
- -
- -
diff --git a/packages/builder/src/components/userInterface/Colorpicker/Colorpicker.svelte b/packages/builder/src/components/userInterface/Colorpicker/Colorpicker.svelte index e582f39e1c..c50b119e53 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/Colorpicker.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/Colorpicker.svelte @@ -1,7 +1,7 @@
@@ -182,6 +181,73 @@
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+ setHue(hue.detail)} + on:dragend={dispatchValue} /> + + + setAlpha(alpha.detail, isDrag)} + on:dragend={dispatchValue} /> + + +
+
+ + {#if !disableSwatches} +
+ {#if swatches.length > 0} + {#each swatches as color, idx} + applySwatch(color)} + on:removeswatch={() => removeSwatch(idx)} /> + {/each} + {/if} + {#if swatches.length !== 12} +
+ + +
+ {/if} +
+ {/if} + +
+ + handleColorInput(event.target.value)} + on:change={dispatchInputChange} /> +
+
+
- -
- -
- -
- -
-
-
- -
- -
-
- setHue(hue.detail)} on:dragend={dispatchValue} /> - - - setAlpha(alpha.detail, isDrag)} - on:dragend={dispatchValue} - /> - - -
-
- - {#if !disableSwatches} -
- {#if swatches.length > 0} - {#each swatches as color, idx} - applySwatch(color)} on:removeswatch={() => removeSwatch(idx)} /> - {/each} - {/if} - {#if swatches.length !== 12} -
- + -
- {/if} -
- {/if} - -
- - handleColorInput(event.target.value)} on:change={dispatchInputChange} /> -
-
- -
diff --git a/packages/builder/src/components/userInterface/Colorpicker/Colorpreview.svelte b/packages/builder/src/components/userInterface/Colorpicker/Colorpreview.svelte index 53ead6c8fb..72da43181e 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/Colorpreview.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/Colorpreview.svelte @@ -1,146 +1,143 @@
- {#if !errorMsg} - -
- + {#if !errorMsg} + +
+ - {#if open} -
- -
-
open = false} class="overlay">
- {/if} - {:else} -
- × -
+ {#if open} +
+ +
+
(open = false)} class="overlay" /> {/if} {:else}
diff --git a/packages/builder/src/components/userInterface/Colorpicker/Input.svelte b/packages/builder/src/components/userInterface/Colorpicker/Input.svelte index 5e0c3a2b3f..c148d6bf30 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/Input.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/Input.svelte @@ -5,6 +5,9 @@
+
+ +
- -
- -
diff --git a/packages/builder/src/components/userInterface/Colorpicker/Palette.svelte b/packages/builder/src/components/userInterface/Colorpicker/Palette.svelte index e31400e98a..64fac9d9c9 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/Palette.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/Palette.svelte @@ -21,7 +21,8 @@ if ( clickX > 0 && clickY > 0 && - clickX < paletteWidth && clickY < paletteHeight + clickX < paletteWidth && + clickY < paletteHeight ) { let s = (clickX / paletteWidth) * 100 let v = 100 - (clickY / paletteHeight) * 100 diff --git a/packages/builder/src/components/userInterface/Colorpicker/Slider.svelte b/packages/builder/src/components/userInterface/Colorpicker/Slider.svelte index dee685bb6a..906f5f0d6a 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/Slider.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/Slider.svelte @@ -11,18 +11,15 @@ let sliderWidth = 0 function onSliderChange(mouseX, isDrag = false) { - const { left, width } = slider.getBoundingClientRect(); - let clickPosition = mouseX - left; + const { left, width } = slider.getBoundingClientRect() + let clickPosition = mouseX - left let percentageClick = (clickPosition / sliderWidth).toFixed(2) if (percentageClick >= 0 && percentageClick <= 1) { - let value = - type === "hue" - ? 360 * percentageClick - : percentageClick; - - dispatch("change", {color: value, isDrag}); + let value = type === "hue" ? 360 * percentageClick : percentageClick + + dispatch("change", { color: value, isDrag }) } } @@ -45,6 +42,20 @@ class="slider-thumb" {style} />
+
onSliderChange(event.clientX)} + class="color-format-slider" + class:hue={type === 'hue'} + class:alpha={type === 'alpha'}> +
onSliderChange(e.detail, true)} + on:dragend + class="slider-thumb" + {style} /> +
- -
onSliderChange(event.clientX)} - class="color-format-slider" - class:hue={type === 'hue'} - class:alpha={type === 'alpha'}> -
onSliderChange(e.detail, true)} - on:dragend - class="slider-thumb" - {style} /> -
diff --git a/packages/builder/src/components/userInterface/Colorpicker/Swatch.svelte b/packages/builder/src/components/userInterface/Colorpicker/Swatch.svelte index e602b72d33..2424df2003 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/Swatch.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/Swatch.svelte @@ -1,27 +1,47 @@ +
+ +
(hovered = true)} + on:mouseleave={() => (hovered = false)}> + {#if hovered} +
dispatch('removeswatch')}> + dispatch('removeswatch')}>× +
+ {/if} +
+
+
+ - -
- -
hovered = true} on:mouseleave={() => hovered = false}> - {#if hovered} -
dispatch("removeswatch")}> - dispatch("removeswatch")}>× -
- {/if} -
-
-
\ No newline at end of file diff --git a/packages/builder/src/components/workflow/WorkflowPanel/BlockList/WorkflowBlock.svelte b/packages/builder/src/components/workflow/WorkflowPanel/BlockList/WorkflowBlock.svelte index 7cf7269e34..1882f91b7a 100644 --- a/packages/builder/src/components/workflow/WorkflowPanel/BlockList/WorkflowBlock.svelte +++ b/packages/builder/src/components/workflow/WorkflowPanel/BlockList/WorkflowBlock.svelte @@ -15,7 +15,6 @@ } -
{ loading = true - const response = await _bb.api.post("/api/authenticate", { username, password }) + const response = await _bb.api.post("/api/authenticate", { + username, + password, + }) if (response.status === 200) { const json = await response.json() localStorage.setItem("budibase:token", json.token) @@ -39,20 +42,12 @@
- {#if _logo} + {#if logo}
- logo + logo
{/if} - -
-
- {#if logo} -
- logo -
-