2022-02-02 22:02:09 +08:00
|
|
|
<script lang="ts">
|
2022-03-08 21:35:42 +08:00
|
|
|
import { Checkbox } from "@gradio/form";
|
2022-04-26 22:48:39 +08:00
|
|
|
import { Block } from "@gradio/atoms";
|
|
|
|
import StatusTracker from "../StatusTracker/StatusTracker.svelte";
|
2022-03-12 00:00:48 +08:00
|
|
|
|
|
|
|
export let value: boolean = false;
|
2022-03-29 21:10:35 +08:00
|
|
|
export let default_value: boolean = false;
|
2022-04-08 01:18:41 +08:00
|
|
|
export let style: string = "";
|
2022-04-21 01:54:44 +08:00
|
|
|
export let label: string = "Checkbox";
|
2022-03-12 00:00:48 +08:00
|
|
|
export let mode: "static" | "dynamic";
|
2022-04-22 17:19:59 +08:00
|
|
|
export let form_position: "first" | "last" | "mid" | "single" = "single";
|
2022-04-27 18:47:15 +08:00
|
|
|
export let show_label: boolean;
|
2022-03-24 21:08:13 +08:00
|
|
|
|
2022-04-26 22:48:39 +08:00
|
|
|
export let loading_status: "complete" | "pending" | "error";
|
|
|
|
|
2022-03-29 21:10:35 +08:00
|
|
|
if (default_value) value = default_value;
|
2022-02-01 21:45:55 +08:00
|
|
|
</script>
|
|
|
|
|
2022-04-26 22:48:39 +08:00
|
|
|
<Block {form_position}>
|
|
|
|
<StatusTracker tracked_status={loading_status} />
|
|
|
|
|
2022-04-27 18:47:15 +08:00
|
|
|
<Checkbox
|
|
|
|
{style}
|
|
|
|
{label}
|
|
|
|
{show_label}
|
|
|
|
bind:value
|
|
|
|
on:change
|
|
|
|
disabled={mode === "static"}
|
|
|
|
/>
|
2022-04-26 22:48:39 +08:00
|
|
|
</Block>
|