summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/lib/components/Select.svelte
diff options
context:
space:
mode:
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}