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">
|
2023-09-09 01:00:55 +02:00
|
|
|
import Col from "./Col.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";
|
2023-09-09 01:00:55 +02:00
|
|
|
import Row from "./Row.svelte";
|
|
|
|
import Switch from "./Switch.svelte";
|
2021-06-12 10:25:11 +02:00
|
|
|
|
|
|
|
export let value: boolean;
|
|
|
|
export let defaultValue: boolean;
|
2023-09-14 01:06:15 +02:00
|
|
|
export let disabled: boolean = false;
|
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}>
|
2023-09-14 01:06:15 +02:00
|
|
|
<Switch {id} bind:value {disabled} />
|
2022-10-25 08:18:50 +02:00
|
|
|
<RevertButton slot="revert" bind:value {defaultValue} />
|
|
|
|
</ConfigInput>
|
2021-06-12 10:25:11 +02:00
|
|
|
</Col>
|
|
|
|
</Row>
|