mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
more work on the select checkbox
This commit is contained in:
1 parent
bc9672ec25
commit
2860406850
4 files changed
+53
-72
No files matched your search
@@ -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}
|
||||
<FormList class="u-margin-block-start-8">
|
||||
{#if column.format === 'enum'}
|
||||
<InputSelectSearch
|
||||
id="value"
|
||||
bind:value
|
||||
<InputSelectCheckbox
|
||||
name="value"
|
||||
bind:tags={arrayValues}
|
||||
bind:search
|
||||
placeholder="Select value"
|
||||
options={column?.elements?.map((value) => ({
|
||||
label: value,
|
||||
value,
|
||||
data: arrayValues
|
||||
}))}
|
||||
label="Value"
|
||||
showLabel={false}
|
||||
interactiveOutput
|
||||
let:option={o}>
|
||||
<SelectSearchCheckbox {value} data={o.data}>
|
||||
{o.label}
|
||||
</SelectSearchCheckbox>
|
||||
<svelte:fragment slot="output" let:option={o}>
|
||||
<output class="input-text is-read-only">
|
||||
<SelectSearchItem data={o.data}>
|
||||
{o.label}
|
||||
</SelectSearchItem>
|
||||
</output>
|
||||
</svelte:fragment>
|
||||
</InputSelectSearch>
|
||||
}))}>
|
||||
</InputSelectCheckbox>
|
||||
{:else}
|
||||
<InputTags
|
||||
label="values"
|
||||
|
||||
@@ -31,4 +31,4 @@ export { default as InputDate } from './inputDate.svelte';
|
||||
export { default as InputDateRange } from './inputDateRange.svelte';
|
||||
export { default as InputTime } from './inputTime.svelte';
|
||||
export { default as InputDigits } from './inputDigits.svelte';
|
||||
export { default as InputSelectBlock } from './inputSelectBlock.svelte';
|
||||
export { default as InputSelectCheckbox } from './inputSelectCheckbox.svelte';
|
||||
@@ -1,51 +0,0 @@
|
||||
<script lang="ts">
|
||||
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;
|
||||
</script>
|
||||
|
||||
<div class="tags-input u-position-relative u-padding-inline-end-40 u-cursor-pointer" type="button" on:click={}>
|
||||
<div class="tags">
|
||||
<ul class="tags-list">
|
||||
{#each tags as tag}
|
||||
<li class="tags-item">
|
||||
<div class="input-tag">
|
||||
<span class="tag-text">{tag}</span>
|
||||
</div>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<input class="tags-input-text u-cursor-text" {placeholder} />
|
||||
<span
|
||||
class="icon-cheveron-down u-position-absolute u-inset-block-start-4 u-inset-inline-end-12"
|
||||
aria-hidden="true"></span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{#each options as option, i}
|
||||
<li class="drop-list-item">
|
||||
test
|
||||
<!-- <button
|
||||
class="drop-button"
|
||||
class:is-selected={selected === i}
|
||||
type="button"
|
||||
on:click|preventDefault={() => {
|
||||
selectOption(option);
|
||||
}}>
|
||||
<slot {option}>
|
||||
<span class="text" data-private>{option.label}</span>
|
||||
</slot>
|
||||
</button> -->
|
||||
</li>
|
||||
{:else}
|
||||
<li class="drop-list-item">
|
||||
<span class="text">There are no {name} that match your search</span>
|
||||
</li>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -0,0 +1,45 @@
|
||||
<script lang="ts">
|
||||
import { DropList } from '$lib/components';
|
||||
|
||||
export let name: string;
|
||||
export let search = '';
|
||||
export let tags: string[] = [];
|
||||
export let placeholder: string;
|
||||
export let options: { value: string | boolean | number; label: string }[] = [];
|
||||
|
||||
let show = false;
|
||||
</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)}>
|
||||
<div class="tags">
|
||||
<ul class="tags-list">
|
||||
{#each tags as tag}
|
||||
<li class="tags-item">
|
||||
<div class="input-tag">
|
||||
<span class="tag-text">{tag}</span>
|
||||
</div>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<input class="tags-input-text u-cursor-text" {placeholder} />
|
||||
<span
|
||||
class="icon-cheveron-down u-position-absolute u-inset-block-start-4 u-inset-inline-end-12"
|
||||
aria-hidden="true"></span>
|
||||
</button>
|
||||
|
||||
<svelte:fragment slot="list">
|
||||
{#each options as option, i}
|
||||
<slot {option} />
|
||||
{:else}
|
||||
<li class="drop-list-item">
|
||||
<span class="text">There are no {name} that match your search</span>
|
||||
</li>
|
||||
{/each}
|
||||
</svelte:fragment>
|
||||
</DropList>
|
||||
Reference in new issue
Block a user