rename ComboboxItem -> ComboboxOption
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<script lang="ts">
|
||||
import type { ClassValue } from 'svelte/elements';
|
||||
|
||||
import Combobox, { type ComboboxItem } from './Combobox.svelte';
|
||||
import Combobox, { type ComboboxOption } from './Combobox.svelte';
|
||||
|
||||
interface Props {
|
||||
label?: string;
|
||||
@@ -64,7 +64,7 @@
|
||||
return a.timeZone.localeCompare(b.timeZone);
|
||||
});
|
||||
|
||||
const options: ComboboxItem[] = sortedTimeZones.map((timeZone) => {
|
||||
const options: ComboboxOption[] = sortedTimeZones.map((timeZone) => {
|
||||
const infotext = [...new Set([timeZone.short, timeZone.offset])]
|
||||
.filter((item) => item !== undefined)
|
||||
.join(' · ');
|
||||
@@ -82,10 +82,10 @@
|
||||
acc[option.value] = option;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, ComboboxItem>
|
||||
{} as Record<string, ComboboxOption>
|
||||
);
|
||||
|
||||
let timezone = $state<ComboboxItem | undefined>(
|
||||
let timezone = $state<ComboboxOption | undefined>(
|
||||
optionsMap[Intl.DateTimeFormat().resolvedOptions().timeZone]
|
||||
);
|
||||
|
||||
@@ -106,6 +106,6 @@
|
||||
class={classValue}
|
||||
/>
|
||||
|
||||
{#snippet timezoneLabel(item: ComboboxItem)}
|
||||
{#snippet timezoneLabel(item: ComboboxOption)}
|
||||
{@html wbr(item.label ?? 'Missing label')}
|
||||
{/snippet}
|
||||
|
||||
Reference in New Issue
Block a user