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-04-12 06:18:30 +02:00
|
|
|
import { stepsToString, stringToSteps } from "./steps";
|
|
|
|
|
|
|
|
export let value: number[];
|
|
|
|
|
|
|
|
let stringValue: string;
|
|
|
|
$: stringValue = stepsToString(value);
|
|
|
|
|
|
|
|
function update(this: HTMLInputElement): void {
|
2021-05-28 23:59:20 +02:00
|
|
|
value = stringToSteps(this.value);
|
2021-04-12 06:18:30 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-06-21 21:16:40 +02:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
value={stringValue}
|
|
|
|
class="form-control"
|
2021-11-24 22:17:41 +01:00
|
|
|
class:nightMode={$pageTheme.isDark}
|
2021-06-21 21:16:40 +02:00
|
|
|
on:blur={update}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<style lang="scss">
|
2021-10-09 02:25:03 +02:00
|
|
|
@use "sass/night-mode" as nightmode;
|
2021-06-21 21:16:40 +02:00
|
|
|
|
|
|
|
.nightMode {
|
|
|
|
@include nightmode.input;
|
|
|
|
}
|
|
|
|
</style>
|