From 28604068500b5e540fac1bf9dfae77b6cff223ac Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 7 Mar 2024 11:51:37 +0100 Subject: [PATCH] more work on the select checkbox --- src/lib/components/filters/content.svelte | 27 +++------- src/lib/elements/forms/index.ts | 2 +- .../elements/forms/inputSelectBlock.svelte | 51 ------------------- .../elements/forms/inputSelectCheckbox.svelte | 45 ++++++++++++++++ 4 files changed, 53 insertions(+), 72 deletions(-) delete mode 100644 src/lib/elements/forms/inputSelectBlock.svelte create mode 100644 src/lib/elements/forms/inputSelectCheckbox.svelte diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index 4c952dae1..e62a9924d 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -5,7 +5,8 @@ InputSelect, InputText, InputTags, - FormList + FormList, + InputSelectCheckbox } from '$lib/elements/forms'; import { Query } from '@appwrite.io/console'; import { createEventDispatcher, onMount } from 'svelte'; @@ -184,31 +185,17 @@ {#if column?.array} {#if column.format === 'enum'} - ({ label: value, value, data: arrayValues - }))} - label="Value" - showLabel={false} - interactiveOutput - let:option={o}> - - {o.label} - - - - - {o.label} - - - - + }))}> + {:else} - import { DropList } from '$lib/components'; - - export let tags: string[] = []; - export let placeholder: string; - export let options: { value: string | boolean | number; label: string }[] = []; - - let show = false; - - -
-
-
    - {#each tags as tag} -
  • -
    - {tag} -
    -
  • - {/each} -
-
- - - -
- -
- {#each options as option, i} -
  • - test - -
  • - {:else} -
  • - There are no {name} that match your search -
  • - {/each} -
    diff --git a/src/lib/elements/forms/inputSelectCheckbox.svelte b/src/lib/elements/forms/inputSelectCheckbox.svelte new file mode 100644 index 000000000..a79e3cdce --- /dev/null +++ b/src/lib/elements/forms/inputSelectCheckbox.svelte @@ -0,0 +1,45 @@ + + + + + + + {#each options as option, i} + + {:else} +
  • + There are no {name} that match your search +
  • + {/each} +
    +