2022-03-08 21:35:42 +08:00
|
|
|
<script lang="ts">
|
|
|
|
import { Button } from "@gradio/button";
|
2022-04-09 02:46:00 +08:00
|
|
|
import { _ } from "svelte-i18n";
|
2022-03-08 21:35:42 +08:00
|
|
|
|
2022-05-12 12:40:41 +08:00
|
|
|
export let elem_id: string = "";
|
2023-03-16 05:01:53 +08:00
|
|
|
export let elem_classes: Array<string> = [];
|
2022-06-17 07:49:54 +08:00
|
|
|
export let visible: boolean = true;
|
2022-03-29 21:10:35 +08:00
|
|
|
export let value: string;
|
2023-03-07 04:52:31 +08:00
|
|
|
export let variant: "primary" | "secondary" | "stop" = "secondary";
|
2023-02-22 03:11:46 +08:00
|
|
|
export let mode: "static" | "dynamic" = "dynamic";
|
2023-06-08 09:35:31 +08:00
|
|
|
export let size: "sm" | "lg" = "lg";
|
2023-06-22 03:34:12 +08:00
|
|
|
export let scale: number | null = null;
|
2023-06-08 09:35:31 +08:00
|
|
|
export let min_width: number | undefined = undefined;
|
2022-03-08 21:35:42 +08:00
|
|
|
</script>
|
|
|
|
|
2023-02-22 03:11:46 +08:00
|
|
|
<Button
|
|
|
|
{variant}
|
|
|
|
{elem_id}
|
2023-03-16 05:01:53 +08:00
|
|
|
{elem_classes}
|
2023-06-08 09:35:31 +08:00
|
|
|
{size}
|
|
|
|
{scale}
|
|
|
|
{min_width}
|
2023-02-22 03:11:46 +08:00
|
|
|
{visible}
|
|
|
|
disabled={mode === "static"}
|
|
|
|
on:click
|
|
|
|
>
|
2022-04-09 02:46:00 +08:00
|
|
|
{$_(value)}
|
2022-03-08 21:35:42 +08:00
|
|
|
</Button>
|