2021-06-12 10:25:11 +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-17 04:49:52 +01:00
|
|
|
import Col from "../components/Col.svelte";
|
2022-02-04 09:36:34 +01:00
|
|
|
import Row from "../components/Row.svelte";
|
2022-06-01 12:26:16 +02:00
|
|
|
import Switch from "../components/Switch.svelte";
|
2022-10-25 08:18:50 +02:00
|
|
|
import ConfigInput from "./ConfigInput.svelte";
|
2021-06-12 10:25:11 +02:00
|
|
|
import Label from "./Label.svelte";
|
|
|
|
import RevertButton from "./RevertButton.svelte";
|
|
|
|
|
|
|
|
export let value: boolean;
|
|
|
|
export let defaultValue: boolean;
|
2021-06-21 18:15:41 +02:00
|
|
|
|
|
|
|
const id = Math.random().toString(36).substring(2);
|
2021-06-12 10:25:11 +02:00
|
|
|
</script>
|
|
|
|
|
2021-11-17 04:49:52 +01:00
|
|
|
<Row --cols={6}>
|
2022-11-04 01:06:57 +01:00
|
|
|
<Col --col-size={4}><Label for={id} preventMouseClick><slot /></Label></Col>
|
2021-11-17 04:49:52 +01:00
|
|
|
<Col --col-justify="flex-end">
|
2022-10-25 08:18:50 +02:00
|
|
|
<ConfigInput grow={false}>
|
|
|
|
<Switch {id} bind:value />
|
|
|
|
<RevertButton slot="revert" bind:value {defaultValue} />
|
|
|
|
</ConfigInput>
|
2021-06-12 10:25:11 +02:00
|
|
|
</Col>
|
|
|
|
</Row>
|