mirror of
https://github.com/bartvdbraak/omnidash.git
synced 2025-07-05 07:39:11 +00:00
feat: move structure
This commit is contained in:
parent
abe1d003c6
commit
0fa3061777
220 changed files with 116 additions and 67 deletions
20
web/src/lib/components/ui/form/form-select.svelte
Normal file
20
web/src/lib/components/ui/form/form-select.svelte
Normal file
|
@ -0,0 +1,20 @@
|
|||
<script lang="ts">
|
||||
import * as Select from '$lib/components/ui/select';
|
||||
import { getFormField } from 'formsnap';
|
||||
import type { Select as SelectPrimitive } from 'bits-ui';
|
||||
|
||||
type $$Props = SelectPrimitive.Props<unknown>;
|
||||
const { setValue, name, value } = getFormField();
|
||||
export let onSelectedChange: $$Props['onSelectedChange'] = undefined;
|
||||
</script>
|
||||
|
||||
<Select.Root
|
||||
onSelectedChange={(v) => {
|
||||
onSelectedChange?.(v);
|
||||
setValue(v ? v.value : undefined);
|
||||
}}
|
||||
{...$$restProps}
|
||||
>
|
||||
<slot />
|
||||
<input hidden {name} value={$value} />
|
||||
</Select.Root>
|
Loading…
Add table
Add a link
Reference in a new issue