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-03-12 00:00:48 +08:00
|
|
|
export let value: number = 0;
|
2022-03-29 21:10:35 +08:00
|
|
|
|
2022-04-21 01:54:44 +08:00
|
|
|
export let label: string = "Slider";
|
2022-03-29 21:10:35 +08:00
|
|
|
export let default_value: number;
|
2022-04-08 01:18:41 +08:00
|
|
|
|
|
|
|
export let style: string = "";
|
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-03-24 21:08:13 +08:00
|
|
|
|
2022-03-29 21:10:35 +08:00
|
|
|
if (default_value) value = default_value;
|
2022-02-01 21:45:55 +08:00
|
|
|
</script>
|
|
|
|
|
2022-03-12 00:00:48 +08:00
|
|
|
<Range
|
|
|
|
bind:value
|
2022-04-06 01:11:29 +08:00
|
|
|
{label}
|
2022-03-23 06:40:36 +08:00
|
|
|
{style}
|
2022-03-12 00:00:48 +08:00
|
|
|
{minimum}
|
|
|
|
{maximum}
|
|
|
|
{step}
|
|
|
|
disabled={mode === "static"}
|
|
|
|
on:change
|
|
|
|
/>
|