gradio/js/tabs/static/StaticTabs.svelte
pngwn fe057300f0
delegate gradio events via a custom event dispatcher (#5279)
* delegate gradio events via a custom event dispatcher

* improve md perf + share code

* fix df markdown

* prevent model3d from rerending too frequently

* tweaks

* fix more event bugs with video

* add changeset

* optimise handle mount

* does this do anything

* fix

* remove old dispatches

* fix dropdown position

* oops

* fixes

* fix tests

* fix types

* format

* fix markdown code

* add changeset

* fix typecheck

* fix typecheck

* fix demos

* notebooks

* fix tests

* changer

* maybe this

* fixes

* add changeset

* fix chatbot alignment mobile

* fix chantbot

* add changeset

* changeset

* changeset

* storybook

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-08-23 21:48:10 +01:00

30 lines
648 B
Svelte

<script lang="ts">
import type { Gradio, SelectData } from "@gradio/utils";
import { createEventDispatcher } from "svelte";
import Tabs from "./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 gradio: Gradio<{
change: never;
select: SelectData;
}>;
$: 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)}
>
<slot />
</Tabs>