2022-02-07 22:34:53 +08:00
|
|
|
<script lang="ts">
|
2022-03-08 21:35:42 +08:00
|
|
|
import { Range } from "@gradio/form";
|
2022-04-26 22:48:39 +08:00
|
|
|
import { Block } from "@gradio/atoms";
|
|
|
|
import StatusTracker from "../StatusTracker/StatusTracker.svelte";
|
2022-05-06 03:05:05 +08:00
|
|
|
import type { LoadingStatus } from "../StatusTracker/types";
|
2022-06-02 01:02:18 +08:00
|
|
|
import type { Styles } from "@gradio/utils";
|
2022-03-08 21:35:42 +08:00
|
|
|
|
2022-05-12 12:40:41 +08:00
|
|
|
export let elem_id: string = "";
|
2022-06-17 07:49:54 +08:00
|
|
|
export let visible: boolean = true;
|
2022-03-12 00:00:48 +08:00
|
|
|
export let value: number = 0;
|
2022-04-21 01:54:44 +08:00
|
|
|
export let label: string = "Slider";
|
2023-02-23 07:16:15 +08:00
|
|
|
export let info: string | undefined = undefined;
|
2022-06-02 01:02:18 +08:00
|
|
|
export let style: Styles = {};
|
2022-02-07 22:34:53 +08:00
|
|
|
export let minimum: number;
|
|
|
|
export let maximum: number;
|
|
|
|
export let step: number;
|
2022-03-12 00:00:48 +08:00
|
|
|
export let mode: "static" | "dynamic";
|
2022-04-27 18:47:15 +08:00
|
|
|
export let show_label: boolean;
|
2022-03-24 21:08:13 +08:00
|
|
|
|
2022-05-06 03:05:05 +08:00
|
|
|
export let loading_status: LoadingStatus;
|
2022-02-01 21:45:55 +08:00
|
|
|
</script>
|
|
|
|
|
2022-06-02 01:02:18 +08:00
|
|
|
<Block
|
2022-06-17 07:49:54 +08:00
|
|
|
{visible}
|
2022-06-02 01:02:18 +08:00
|
|
|
{elem_id}
|
|
|
|
disable={typeof style.container === "boolean" && !style.container}
|
|
|
|
>
|
2022-05-06 03:05:05 +08:00
|
|
|
<StatusTracker {...loading_status} />
|
2022-04-26 22:48:39 +08:00
|
|
|
|
|
|
|
<Range
|
|
|
|
bind:value
|
|
|
|
{label}
|
2023-02-23 07:16:15 +08:00
|
|
|
{info}
|
2022-04-27 18:47:15 +08:00
|
|
|
{show_label}
|
2022-04-26 22:48:39 +08:00
|
|
|
{minimum}
|
|
|
|
{maximum}
|
|
|
|
{step}
|
|
|
|
disabled={mode === "static"}
|
|
|
|
on:change
|
|
|
|
/>
|
|
|
|
</Block>
|