summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/lib/components/Select.svelte
diff options
context:
space:
mode:
authorWolfgang Müller2025-02-13 17:52:16 +0100
committerWolfgang Müller2025-02-13 17:52:16 +0100
commitdc4db405d2991d3ec6a114f3b08d3fccd057d3ee (patch)
tree2c620c9af2062ba09fa591f8b3ed961664adab58 /frontend/src/lib/components/Select.svelte
parent4df870d793123be95c8af031a340a39b5b8402ac (diff)
downloadhircine-dc4db405d2991d3ec6a114f3b08d3fccd057d3ee.tar.gz
frontend: Migrate to Svelte 5
Diffstat (limited to 'frontend/src/lib/components/Select.svelte')
-rw-r--r--frontend/src/lib/components/Select.svelte27
1 files changed, 18 insertions, 9 deletions
diff --git a/frontend/src/lib/components/Select.svelte b/frontend/src/lib/components/Select.svelte
index dece4a5..44828d3 100644
--- a/frontend/src/lib/components/Select.svelte
+++ b/frontend/src/lib/components/Select.svelte
@@ -2,19 +2,28 @@
import type { ListItem } from '$lib/Utils';
import Svelecte from 'svelecte';
- let inputId: string;
- let valueAsObject = false;
- let multiple = false;
-
type Item = number | string | ListItem;
type Value = Item | Item[] | undefined | null;
- export let clearable = false;
- export let placeholder = 'Select...';
- export let options: ListItem[] | undefined;
- export let value: Value;
+ interface Props {
+ id: string;
+ object?: boolean;
+ multi?: boolean;
+ clearable?: boolean;
+ placeholder?: string;
+ options: ListItem[] | undefined;
+ value: Value;
+ }
- export { inputId as id, valueAsObject as object, multiple as multi };
+ let {
+ id: inputId,
+ object: valueAsObject = false,
+ multi: multiple = false,
+ clearable = false,
+ placeholder = 'Select...',
+ options,
+ value = $bindable()
+ }: Props = $props();
</script>
{#if options !== null && options !== undefined}