gradio/ui/packages/app/src/components/Radio/Radio.svelte
aliabid94 95bf08b2e2
Adding the .select event listener (#3399)
* changes

* changes

* changes

* changes

* changes

* changes

* changs

* changes

* changes

* changes

* changes

* changes

* changes

* preview

* fix notebook

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* Add type hints (#3403)

Co-authored-by: aliabid94 <aabid94@gmail.com>

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* change

* changes

* changes

* changes

* changes

* changes

* changes

* Update gradio/helpers.py

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* doc update

* changes

* changes

* changes

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
2023-03-13 17:12:41 -07:00

41 lines
987 B
Svelte

<script lang="ts">
import { Radio } from "@gradio/form";
import { Block } from "@gradio/atoms";
import StatusTracker from "../StatusTracker/StatusTracker.svelte";
import type { LoadingStatus } from "../StatusTracker/types";
import type { Styles } from "@gradio/utils";
export let label: string = "Radio";
export let info: string | undefined = undefined;
export let elem_id: string = "";
export let visible: boolean = true;
export let value: string | null = null;
export let choices: Array<string> = [];
export let mode: "static" | "dynamic";
export let show_label: boolean;
export let style: Styles = {};
export let loading_status: LoadingStatus;
</script>
<Block
{visible}
type="fieldset"
{elem_id}
disable={typeof style.container === "boolean" && !style.container}
>
<StatusTracker {...loading_status} />
<Radio
bind:value
{label}
{info}
{elem_id}
{show_label}
{choices}
{style}
disabled={mode === "static"}
on:change
on:select
/>
</Block>