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">
|
2021-11-24 22:17:41 +01:00
|
|
|
import { pageTheme } from "../sveltelib/theme";
|
2021-05-30 19:46:39 +02:00
|
|
|
|
2021-04-12 06:18:30 +02:00
|
|
|
export let choices: string[];
|
|
|
|
export let value: number = 0;
|
2022-02-10 00:55:43 +01:00
|
|
|
export let disabled: number[] = [];
|
2021-04-12 06:18:30 +02:00
|
|
|
</script>
|
|
|
|
|
2021-06-21 21:16:40 +02:00
|
|
|
<select
|
|
|
|
bind:value
|
2021-11-24 22:17:41 +01:00
|
|
|
class:nightMode={$pageTheme.isDark}
|
|
|
|
class:visible-down-arrow={$pageTheme.isDark}
|
2021-11-17 04:49:52 +01:00
|
|
|
class="enum-selector form-select"
|
2021-06-21 21:16:40 +02:00
|
|
|
>
|
2021-05-28 00:52:49 +02:00
|
|
|
{#each choices as choice, idx}
|
2022-02-10 00:55:43 +01:00
|
|
|
<option value={idx} disabled={disabled.includes(idx)}>{choice}</option>
|
2021-05-28 00:52:49 +02:00
|
|
|
{/each}
|
|
|
|
</select>
|
2021-05-30 19:46:39 +02:00
|
|
|
|
|
|
|
<style lang="scss">
|
2021-10-09 02:25:03 +02:00
|
|
|
@use "sass/night-mode" as nightmode;
|
|
|
|
@use "sass/button-mixins" as button;
|
2021-05-30 19:46:39 +02:00
|
|
|
|
2021-06-21 21:16:40 +02:00
|
|
|
.nightMode {
|
|
|
|
@include nightmode.input;
|
|
|
|
}
|
|
|
|
|
2021-11-17 04:49:52 +01:00
|
|
|
.enum-selector {
|
|
|
|
/* overwrite Bootstrap */
|
|
|
|
padding: 0.2rem 0.75rem;
|
|
|
|
}
|
|
|
|
|
2021-05-30 19:46:39 +02:00
|
|
|
.visible-down-arrow {
|
|
|
|
/* override the default down arrow */
|
2021-06-05 00:40:55 +02:00
|
|
|
background-image: button.down-arrow(white);
|
2021-05-30 19:46:39 +02:00
|
|
|
}
|
|
|
|
</style>
|