mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-12 10:34:32 +08:00
1419538ea7
* asd * changes * fix everything * cleanup * add changeset * fix casing * lockfile * fix casing * fix ci, enable linting * fix test * add changeset * add changeset * delete changeset * fix dirs * fix casing * fix notebooks * fix casing * fix casing * fix casing * fix casing * fix casing * fix casing * fix casing * fix casing --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
57 lines
1.1 KiB
Svelte
57 lines
1.1 KiB
Svelte
<script lang="ts">
|
|
import { createEventDispatcher, afterUpdate } from "svelte";
|
|
import { _ } from "svelte-i18n";
|
|
|
|
import type { LoadingStatus } from "@gradio/statustracker/types";
|
|
|
|
import StaticCode from "./static";
|
|
import InteractiveCode from "./interactive";
|
|
|
|
export let value = "";
|
|
export let value_is_output = false;
|
|
export let language = "";
|
|
export let lines = 5;
|
|
export let target: HTMLElement;
|
|
export let elem_id = "";
|
|
export let elem_classes: string[] = [];
|
|
export let visible = true;
|
|
export let mode: "static" | "dynamic";
|
|
export let label = "Code";
|
|
export let show_label = true;
|
|
export let loading_status: LoadingStatus;
|
|
</script>
|
|
|
|
{#if mode == "static"}
|
|
<StaticCode
|
|
bind:value
|
|
bind:value_is_output
|
|
{language}
|
|
{lines}
|
|
{target}
|
|
{elem_id}
|
|
{elem_classes}
|
|
{visible}
|
|
{label}
|
|
{show_label}
|
|
{loading_status}
|
|
on:change
|
|
on:input
|
|
/>
|
|
{:else}
|
|
<InteractiveCode
|
|
bind:value
|
|
bind:value_is_output
|
|
{language}
|
|
{lines}
|
|
{target}
|
|
{elem_id}
|
|
{elem_classes}
|
|
{visible}
|
|
{label}
|
|
{show_label}
|
|
{loading_status}
|
|
on:change
|
|
on:input
|
|
/>
|
|
{/if}
|