File size: 424 Bytes
bc20498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script>import { getCtx } from "../ctx.js";
export let asChild = false;
export let el = void 0;
const {
  states: { checked },
  getAttrs
} = getCtx();
$:
  attrs = {
    ...getAttrs("thumb"),
    "data-state": $checked ? "checked" : "unchecked",
    "data-checked": $checked ? "" : void 0
  };
</script>

{#if asChild}
	<slot {attrs} checked={$checked} />
{:else}
	<span bind:this={el} {...$$restProps} {...attrs} />
{/if}