anki/ts/deck-options/EnumSelector.svelte
Matthias Metelka 9c45a2f7d0
Refactor Select component | Fix CSV import issue (#2227)
* Refactor Select component and implement/update it in various screens

* Remove redundant select CSS

* Tweak DeckOptionsPage

* Fix CSV import layout

* Fix save button margin in change notetype screen

* Fix sticky header positioning

* Remove unused imports

* Make StickyHeader sticky instead of fixed
2022-12-01 19:24:26 +10:00

23 lines
619 B
Svelte

<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import Select from "../components/Select.svelte";
import SelectOption from "../components/SelectOption.svelte";
export let options: string[] = [];
export let disabled: number[] = [];
export let value = 0;
$: label = options[value];
</script>
<Select bind:value {label}>
{#each options as option, idx}
<SelectOption value={idx} disabled={disabled.includes(idx)}
>{option}</SelectOption
>
{/each}
</Select>