File size: 1,254 Bytes
96413f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26fbf1c
 
 
 
 
 
 
 
 
96413f0
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<script context="module" lang="ts">
	export { default as BaseCheckbox } from "./shared/Checkbox.svelte";
</script>

<script lang="ts">
	import { Gradio } from "@gradio/utils";
	import { Block, Info } from "@gradio/atoms";
	import { StatusTracker } from "@gradio/statustracker";
	import type { CheckboxProps, CheckboxEvents } from "./types";
	import BaseCheckbox from "./shared/Checkbox.svelte";

	let props = $props();
	const gradio = new Gradio<CheckboxEvents, CheckboxProps>(props);
</script>

<Block
	visible={gradio.shared.visible}
	elem_id={gradio.shared.elem_id}
	elem_classes={gradio.shared.elem_classes}
>
	<StatusTracker
		autoscroll={gradio.shared.autoscroll}
		i18n={gradio.i18n}
		{...gradio.shared.loading_status}
		on_clear_status={() =>
			gradio.dispatch("clear_status", gradio.shared.loading_status)}
	/>
	<BaseCheckbox
		label={gradio.shared.label || gradio.i18n("checkbox.checkbox")}
		bind:value={gradio.props.value}
		interactive={gradio.shared.interactive}
		show_label={gradio.shared.show_label}
		on_change={(val) => gradio.dispatch("change", val)}
		on_input={() => gradio.dispatch("input")}
		on_select={(data) => gradio.dispatch("select", data)}
	/>
	{#if gradio.props.info}
		<Info info={gradio.props.info} />
	{/if}
</Block>