From 0ebc3f0f7e9d8af1d19602a2bffbaf605b560ed3 Mon Sep 17 00:00:00 2001 From: tglide <26071571+TGlide@users.noreply.github.com> Date: Mon, 13 Feb 2023 19:59:58 +0000 Subject: [PATCH] refactor: multiple design review changes --- src/lib/elements/forms/index.ts | 1 + src/lib/elements/forms/inputCheckbox.svelte | 9 ++--- src/lib/elements/forms/inputCron.svelte | 7 ++-- src/lib/elements/forms/inputDateTime.svelte | 9 ++--- src/lib/elements/forms/inputDomain.svelte | 7 ++-- src/lib/elements/forms/inputEmail.svelte | 7 ++-- src/lib/elements/forms/inputNumber.svelte | 9 ++--- src/lib/elements/forms/inputPassword.svelte | 7 ++-- src/lib/elements/forms/inputPhone.svelte | 6 ++-- src/lib/elements/forms/inputRadio.svelte | 6 ++-- src/lib/elements/forms/inputSecret.svelte | 7 ++-- src/lib/elements/forms/inputSelect.svelte | 9 ++--- src/lib/elements/forms/inputTags.svelte | 7 ++-- src/lib/elements/forms/inputText.svelte | 25 ++++++-------- src/lib/elements/forms/inputTextarea.svelte | 7 ++-- src/lib/elements/forms/inputURL.svelte | 7 ++-- src/lib/elements/forms/label.svelte | 33 +++++++++++++++++++ .../document-[document]/attributeForm.svelte | 13 ++++---- .../attributes/string.svelte | 1 + .../wizard/step1.svelte | 3 +- 20 files changed, 114 insertions(+), 66 deletions(-) create mode 100644 src/lib/elements/forms/label.svelte diff --git a/src/lib/elements/forms/index.ts b/src/lib/elements/forms/index.ts index dd02f69649..d60fb54424 100644 --- a/src/lib/elements/forms/index.ts +++ b/src/lib/elements/forms/index.ts @@ -23,3 +23,4 @@ export { default as InputURL } from './inputURL.svelte'; export { default as InputId } from './inputId.svelte'; export { default as InputSecret } from './inputSecret.svelte'; export { default as Helper } from './helper.svelte'; +export { default as Label } from './label.svelte'; diff --git a/src/lib/elements/forms/inputCheckbox.svelte b/src/lib/elements/forms/inputCheckbox.svelte index 7e2f89ac9e..b8c601635b 100644 --- a/src/lib/elements/forms/inputCheckbox.svelte +++ b/src/lib/elements/forms/inputCheckbox.svelte @@ -1,5 +1,5 @@ -
import { onMount } from 'svelte'; - import { FormItem, Helper } from '.'; + import { FormItem, Helper, Label } from '.'; export let label: string; export let showLabel = true; @@ -48,7 +48,10 @@ - + +
import { onMount } from 'svelte'; - import { FormItem, Helper } from '.'; + import { FormItem, Helper, Label } from '.'; export let label: string; export let showLabel = true; @@ -39,12 +39,9 @@ -
import { onMount } from 'svelte'; - import { FormItem, Helper } from '.'; + import { FormItem, Helper, Label } from '.'; export let label: string; export let showLabel = true; @@ -47,7 +47,10 @@ - + +
import { onMount } from 'svelte'; - import { FormItem, Helper } from '.'; + import { FormItem, Helper, Label } from '.'; export let label: string; export let showLabel = true; @@ -41,7 +41,10 @@ - + +
import { onMount } from 'svelte'; - import { FormItem, Helper } from '.'; + import { FormItem, Helper, Label } from '.'; export let label: string; export let optionalText: string | undefined = undefined; @@ -52,12 +52,9 @@ -
import { onMount } from 'svelte'; - import { FormItem, Helper } from '.'; + import { FormItem, Helper, Label } from '.'; export let id: string; export let label: string; @@ -47,7 +47,10 @@ - + +
{#if showInPlainText} import { onMount } from 'svelte'; - import { FormItem, Helper } from '.'; + import { FormItem, Helper, Label } from '.'; export let label: string; export let showLabel = true; @@ -46,7 +46,9 @@ - +
- import { FormItem, Helper } from '.'; + import { FormItem, Helper, Label } from '.'; export let label: string; export let showLabel = true; @@ -40,7 +40,9 @@ bind:group bind:this={element} on:invalid={handleInvalid} /> - +
{#if error} {error} diff --git a/src/lib/elements/forms/inputSecret.svelte b/src/lib/elements/forms/inputSecret.svelte index f7244bf751..c1932133d9 100644 --- a/src/lib/elements/forms/inputSecret.svelte +++ b/src/lib/elements/forms/inputSecret.svelte @@ -1,5 +1,5 @@ - + +
{#if showInPlainText}
- import { FormItem, Helper } from '.'; + import { FormItem, Helper, Label } from '.'; export let id: string; export let label: string; @@ -33,12 +33,9 @@ -
+ {#if maxlength} + + {value?.length ?? 0} + + {maxlength} + + {/if}
{#if error} {error} diff --git a/src/lib/elements/forms/inputTextarea.svelte b/src/lib/elements/forms/inputTextarea.svelte index 8c828baf9d..7285b6f240 100644 --- a/src/lib/elements/forms/inputTextarea.svelte +++ b/src/lib/elements/forms/inputTextarea.svelte @@ -1,6 +1,6 @@ - + +