mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
bd2c695328
* py * path * barebones js * add changeset * add changeset * downloadbutton * add changeset * changes * clog * commit * revert' * fix * js * add changeset * cleanup * download * notebooks * stories * change * fix * format * download * Fix updating `icon` parameter (bug resulting from https://github.com/gradio-app/gradio/pull/7528) (#7554) * fetch 2 * fix --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
42 lines
1.0 KiB
Svelte
42 lines
1.0 KiB
Svelte
<script context="module" lang="ts">
|
|
export { default as BaseButton } from "./shared/DownloadButton.svelte";
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
import type { Gradio } from "@gradio/utils";
|
|
import { type FileData } from "@gradio/client";
|
|
|
|
import DownloadButton from "./shared/DownloadButton.svelte";
|
|
|
|
export let elem_id = "";
|
|
export let elem_classes: string[] = [];
|
|
export let visible = true;
|
|
export let value: null | FileData;
|
|
export let variant: "primary" | "secondary" | "stop" = "secondary";
|
|
export let interactive: boolean;
|
|
export let size: "sm" | "lg" = "lg";
|
|
export let scale: number | null = null;
|
|
export let icon: null | FileData = null;
|
|
export let min_width: number | undefined = undefined;
|
|
export let label: string | null = null;
|
|
export let gradio: Gradio<{
|
|
click: never;
|
|
}>;
|
|
</script>
|
|
|
|
<DownloadButton
|
|
{value}
|
|
{variant}
|
|
{elem_id}
|
|
{elem_classes}
|
|
{size}
|
|
{scale}
|
|
{icon}
|
|
{min_width}
|
|
{visible}
|
|
disabled={!interactive}
|
|
on:click={() => gradio.dispatch("click")}
|
|
>
|
|
{label ? gradio.i18n(label) : ""}
|
|
</DownloadButton>
|