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-03-08 21:35:42 +08:00
|
|
|
|
2022-05-12 12:40:41 +08:00
|
|
|
export let elem_id: string = "";
|
2022-05-25 14:30:24 +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";
|
2022-05-12 12:40:41 +08:00
|
|
|
export let style: Record<string, any> = {};
|
2022-04-08 01:18:41 +08:00
|
|
|
|
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-22 17:19:59 +08:00
|
|
|
export let form_position: "first" | "last" | "mid" | "single" = "single";
|
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-05-25 14:30:24 +08:00
|
|
|
<Block {form_position} {elem_id} {visible} {style}>
|
2022-05-06 03:05:05 +08:00
|
|
|
<StatusTracker {...loading_status} />
|
2022-04-26 22:48:39 +08:00
|
|
|
|
|
|
|
<Range
|
|
|
|
bind:value
|
|
|
|
{label}
|
2022-04-27 18:47:15 +08:00
|
|
|
{show_label}
|
2022-04-26 22:48:39 +08:00
|
|
|
{minimum}
|
|
|
|
{maximum}
|
|
|
|
{step}
|
2022-05-12 12:40:41 +08:00
|
|
|
{style}
|
2022-04-26 22:48:39 +08:00
|
|
|
disabled={mode === "static"}
|
|
|
|
on:change
|
|
|
|
/>
|
|
|
|
</Block>
|