-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
ColorPicker.svelte
39 lines (35 loc) 路 1.08 KB
/
ColorPicker.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<svelte:options accessors={true} />
<script lang="ts">
import { ColorPicker } from "@gradio/form";
import { Block } from "@gradio/atoms";
import StatusTracker from "../StatusTracker/StatusTracker.svelte";
import type { LoadingStatus } from "../StatusTracker/types";
export let label: string = "ColorPicker";
export let info: string | undefined = undefined;
export let elem_id: string = "";
export let elem_classes: Array<string> = [];
export let visible: boolean = true;
export let value: string;
export let value_is_output: boolean = false;
export let show_label: boolean;
export let container: boolean = true;
export let scale: number | null = null;
export let min_width: number | undefined = undefined;
export let loading_status: LoadingStatus;
export let mode: "static" | "dynamic";
</script>
<Block {visible} {elem_id} {elem_classes} {container} {scale} {min_width}>
<StatusTracker {...loading_status} />
<ColorPicker
bind:value
bind:value_is_output
{label}
{info}
{show_label}
on:change
on:input
on:submit
on:blur
disabled={mode === "static"}
/>
</Block>