wip more work on select search

This commit is contained in:
Arman committed 2024-03-07 16:28:33 +01:00
1 parent dd952e941e
commit c8e38e0fd4
3 files changed
+14 -20

No files matched your search

+7 -1
View File
@@ -194,7 +194,13 @@
label: value,
value,
data: arrayValues
}))}>
}))}
let:option={o}>
<SelectSearchCheckbox
bind:checked={arrayValues[0]}
bind:value={o.value}>
{o.label}
</SelectSearchCheckbox>
</InputSelectCheckbox>
{:else}
<InputTags
@@ -8,13 +8,17 @@
export let options: { value: string | boolean | number; label: string }[] = [];
let show = false;
$: filteredOptions = search
? options.filter((option) => option.label.toLowerCase().includes(search.toLowerCase()))
: options;
</script>
<DropList bind:show noStyle noArrow scrollable placement="bottom-end" position="static" fixed>
<button
class="tags-input u-position-relative u-padding-inline-end-40 u-cursor-pointer"
type="button"
on:click={() => (show = true)}>
on:click={() => (show = !show)}>
<div class="tags">
<ul class="tags-list">
{#each tags as tag}
@@ -34,7 +38,7 @@
</button>
<svelte:fragment slot="list">
{#each options as option, i}
{#each filteredOptions as option}
<slot {option} />
{:else}
<li class="drop-list-item">
+1 -17
View File
@@ -1,7 +1,5 @@
<script lang="ts">
import { tooltip } from '$lib/actions/tooltip';
export let data: string[] = [];
// export let data: string[] = [];
export let value: string;
export let checked = false;
</script>
@@ -13,18 +11,4 @@
<input id={value} type="checkbox" bind:checked />
<slot />
</span>
{#if data?.length}
<span
class="u-flex u-flex-1 u-trim-1 u-gap-4"
use:tooltip={{
content: data.map((e) => e ?? 'null').join(' | ')
}}>
{#each data as item, i}
{#if i}
<span class="u-text-color-gray">|</span>
{/if}
<span class="text" style="white-space: nowrap" data-private>{item}</span>
{/each}
</span>
{/if}
</div>