MapComplete/src/UI/Base/Checkbox.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
399 B
Svelte
Raw Normal View History

2023-03-28 05:13:48 +02:00
<script lang="ts">
2023-12-13 01:01:56 +01:00
import { UIEventSource } from "../../Logic/UIEventSource"
2023-03-28 05:13:48 +02:00
/**
* For some stupid reason, it is very hard to bind inputs
*/
2023-12-13 01:01:56 +01:00
export let selected: UIEventSource<boolean>
2023-09-28 23:50:27 +02:00
let _c: boolean = selected.data ?? true
$: selected.set(_c)
2023-03-28 05:13:48 +02:00
</script>
2023-09-28 23:50:27 +02:00
2023-12-13 01:01:56 +01:00
<label class="no-image-background flex items-center gap-1">
<input bind:checked={_c} type="checkbox" />
<slot />
</label>