mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
61cd768490
* * fix tab visibility * add story * add changeset * stuff * fix * more fix * fix undefined tab labels * fix tabs again * add changeset * format * format * fix type * add changeset * fix all things * format * add changeset * notebooks * visible tabs --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>
38 lines
874 B
Svelte
38 lines
874 B
Svelte
<script context="module" lang="ts">
|
|
export { default as BaseTabs, TABS, type Tab } from "./shared/Tabs.svelte";
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
import type { Gradio, SelectData } from "@gradio/utils";
|
|
import { createEventDispatcher } from "svelte";
|
|
import Tabs, { type Tab } from "./shared/Tabs.svelte";
|
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
export let visible = true;
|
|
export let elem_id = "";
|
|
export let elem_classes: string[] = [];
|
|
export let selected: number | string;
|
|
export let initial_tabs: Tab[] = [];
|
|
export let gradio:
|
|
| Gradio<{
|
|
change: never;
|
|
select: SelectData;
|
|
}>
|
|
| undefined;
|
|
|
|
$: dispatch("prop_change", { selected });
|
|
</script>
|
|
|
|
<Tabs
|
|
{visible}
|
|
{elem_id}
|
|
{elem_classes}
|
|
bind:selected
|
|
on:change={() => gradio?.dispatch("change")}
|
|
on:select={(e) => gradio?.dispatch("select", e.detail)}
|
|
{initial_tabs}
|
|
>
|
|
<slot />
|
|
</Tabs>
|