2021-04-12 06:18:30 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
2022-09-27 04:16:45 +02:00
|
|
|
import Select from "../components/Select.svelte";
|
|
|
|
import SelectOption from "../components/SelectOption.svelte";
|
2021-05-30 19:46:39 +02:00
|
|
|
|
2022-09-27 04:16:45 +02:00
|
|
|
export let options: string[] = [];
|
2022-02-10 00:55:43 +01:00
|
|
|
export let disabled: number[] = [];
|
2022-09-27 04:16:45 +02:00
|
|
|
export let value = 0;
|
2022-12-01 10:24:26 +01:00
|
|
|
|
|
|
|
$: label = options[value];
|
2021-04-12 06:18:30 +02:00
|
|
|
</script>
|
|
|
|
|
2022-12-01 10:24:26 +01:00
|
|
|
<Select bind:value {label}>
|
2022-09-27 04:16:45 +02:00
|
|
|
{#each options as option, idx}
|
2022-12-01 10:24:26 +01:00
|
|
|
<SelectOption value={idx} disabled={disabled.includes(idx)}
|
2022-09-27 04:16:45 +02:00
|
|
|
>{option}</SelectOption
|
|
|
|
>
|
2021-05-28 00:52:49 +02:00
|
|
|
{/each}
|
2022-09-27 04:16:45 +02:00
|
|
|
</Select>
|