Refactoring: include 'label' section into Checkbox

This commit is contained in:
Pieter Vander Vennet 2023-09-28 03:07:10 +02:00
parent 08e408e19d
commit 4067912ce0
2 changed files with 25 additions and 25 deletions

View file

@ -1,12 +1,14 @@
<script lang="ts">
import { UIEventSource } from "../../Logic/UIEventSource.js"
import type { Writable } from "svelte/store";
/**
* For some stupid reason, it is very hard to bind inputs
*/
export let selected: UIEventSource<boolean>
let _c: boolean = selected.data ?? true
$: selected.setData(_c)
export let selected: Writable<boolean>;
let _c: boolean = selected.data ?? true;
$: selected.set(_c);
</script>
<input type="checkbox" bind:checked={_c} />
<label class="no-image-background flex gap-1">
<input bind:checked={_c} type="checkbox" />
<slot />
</label>