2022-03-12 00:00:48 +08:00
|
|
|
<script lang="ts">
|
2023-08-24 04:48:10 +08:00
|
|
|
import type { Gradio, SelectData } from "@gradio/utils";
|
2022-07-07 22:37:51 +08:00
|
|
|
import { createEventDispatcher } from "svelte";
|
2023-08-04 06:01:18 +08:00
|
|
|
import Tabs from "./Tabs.svelte";
|
2022-04-09 02:46:00 +08:00
|
|
|
|
2022-07-07 22:37:51 +08:00
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
|
2023-08-04 06:01:18 +08:00
|
|
|
export let visible = true;
|
|
|
|
export let elem_id = "";
|
|
|
|
export let elem_classes: string[] = [];
|
2022-07-07 22:37:51 +08:00
|
|
|
export let selected: number | string;
|
2023-08-24 04:48:10 +08:00
|
|
|
export let gradio: Gradio<{
|
|
|
|
change: never;
|
|
|
|
select: SelectData;
|
|
|
|
}>;
|
2022-07-07 22:37:51 +08:00
|
|
|
|
|
|
|
$: dispatch("prop_change", { selected });
|
2022-03-12 00:00:48 +08:00
|
|
|
</script>
|
|
|
|
|
2023-08-24 04:48:10 +08:00
|
|
|
<Tabs
|
|
|
|
{visible}
|
|
|
|
{elem_id}
|
|
|
|
{elem_classes}
|
|
|
|
bind:selected
|
|
|
|
on:change={() => gradio.dispatch("change")}
|
|
|
|
on:select={(e) => gradio.dispatch("select", e.detail)}
|
|
|
|
>
|
2022-03-12 00:00:48 +08:00
|
|
|
<slot />
|
|
|
|
</Tabs>
|