gradio/js/app/src/components/Checkbox/Checkbox.svelte

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

37 lines
1.0 KiB
Svelte
Raw Normal View History

2022-02-02 22:02:09 +08:00
<script lang="ts">
2022-03-08 21:35:42 +08:00
import { Checkbox } from "@gradio/form";
import { Block, Info } from "@gradio/atoms";
import StatusTracker from "../StatusTracker/StatusTracker.svelte";
import type { LoadingStatus } from "../StatusTracker/types";
2022-03-12 00:00:48 +08:00
export let elem_id: string = "";
export let elem_classes: Array<string> = [];
export let visible: boolean = true;
2022-03-12 00:00:48 +08:00
export let value: boolean = false;
export let value_is_output: boolean = false;
export let label: string = "Checkbox";
export let info: string | undefined = undefined;
2022-03-12 00:00:48 +08:00
export let mode: "static" | "dynamic";
export let container: boolean = true;
export let scale: number | null = null;
export let min_width: number | undefined = undefined;
export let loading_status: LoadingStatus;
</script>
<Block {visible} {elem_id} {elem_classes} {container} {scale} {min_width}>
<StatusTracker {...loading_status} />
{#if info}
<Info>{info}</Info>
{/if}
<Checkbox
{label}
bind:value
bind:value_is_output
on:change
on:input
on:select
disabled={mode === "static"}
/>
</Block>