summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/lib
diff options
context:
space:
mode:
authorWolfgang Müller2024-07-12 19:54:44 +0200
committerWolfgang Müller2024-07-22 14:08:03 +0200
commitf530348de4aa5db05eff44c801af6251200372cf (patch)
tree0e280dbfec4e8d342b915928bf1d1fa00f0ac0e9 /frontend/src/lib
parent2fe2b3cf8627f97eb32aba5548034630f1187109 (diff)
downloadhircine-f530348de4aa5db05eff44c801af6251200372cf.tar.gz
build/deps: Update Svelecte to 4.2.2
This includes changes to CSS in order to bring the look & feel in line with the previous version as much as possible. We can now remove the warning about TypeScript types (Svelecte 4 now includes them) and retire the clunky handling of pending options. Additionally, the focus issue has been fixed, allowing users to tab through controls without getting stuck.
Diffstat (limited to '')
-rw-r--r--frontend/src/lib/components/Select.svelte22
1 files changed, 1 insertions, 21 deletions
diff --git a/frontend/src/lib/components/Select.svelte b/frontend/src/lib/components/Select.svelte
index f7e87a4..dece4a5 100644
--- a/frontend/src/lib/components/Select.svelte
+++ b/frontend/src/lib/components/Select.svelte
@@ -1,7 +1,5 @@
<script lang="ts">
import type { ListItem } from '$lib/Utils';
-
- // @ts-expect-error Svelecte 3 does not have types, and 4 (which does) is pending stabilization
import Svelecte from 'svelecte';
let inputId: string;
@@ -17,12 +15,6 @@
export let value: Value;
export { inputId as id, valueAsObject as object, multiple as multi };
-
- function optionsPlaceholder(from: Value): Item[] {
- if (from === undefined || from === null) return [];
-
- return Array.isArray(from) ? from : [from];
- }
</script>
{#if options !== null && options !== undefined}
@@ -39,17 +31,5 @@
bind:value
/>
{:else}
- <Svelecte
- virtualList
- valueField="id"
- labelField="name"
- disabled
- options={optionsPlaceholder(value)}
- {multiple}
- {clearable}
- {inputId}
- {valueAsObject}
- {placeholder}
- {value}
- />
+ <Svelecte {placeholder} />
{/if}