Upload folder using huggingface_hub
Browse files- 6.23.0/radio/Example.svelte +16 -12
- 6.23.0/radio/Index.svelte +1 -1
- 6.23.0/radio/shared/Radio.svelte +2 -2
6.23.0/radio/Example.svelte
CHANGED
|
@@ -1,17 +1,21 @@
|
|
| 1 |
<script lang="ts">
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
let name_string
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
}
|
| 12 |
-
let name = choices.find((pair) => pair[1] === value);
|
| 13 |
-
name_string = name ? name[0] : "";
|
| 14 |
-
}
|
| 15 |
</script>
|
| 16 |
|
| 17 |
<div
|
|
|
|
| 1 |
<script lang="ts">
|
| 2 |
+
let {
|
| 3 |
+
value,
|
| 4 |
+
type,
|
| 5 |
+
selected = false,
|
| 6 |
+
choices
|
| 7 |
+
}: {
|
| 8 |
+
value: string | null;
|
| 9 |
+
type: "gallery" | "table";
|
| 10 |
+
selected?: boolean;
|
| 11 |
+
choices: [string, string | number][];
|
| 12 |
+
} = $props();
|
| 13 |
|
| 14 |
+
let name_string = $derived.by(() => {
|
| 15 |
+
if (value === null) return "";
|
| 16 |
+
const name = choices.find((pair) => pair[1] === value);
|
| 17 |
+
return name ? name[0] : "";
|
| 18 |
+
});
|
|
|
|
|
|
|
|
|
|
| 19 |
</script>
|
| 20 |
|
| 21 |
<div
|
6.23.0/radio/Index.svelte
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
<script
|
| 2 |
export { default as BaseRadio } from "./shared/Radio.svelte";
|
| 3 |
export { default as BaseExample } from "./Example.svelte";
|
| 4 |
</script>
|
|
|
|
| 1 |
+
<script module lang="ts">
|
| 2 |
export { default as BaseRadio } from "./shared/Radio.svelte";
|
| 3 |
export { default as BaseExample } from "./Example.svelte";
|
| 4 |
</script>
|
6.23.0/radio/shared/Radio.svelte
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
<script
|
| 2 |
let id = 0;
|
| 3 |
</script>
|
| 4 |
|
|
@@ -38,7 +38,7 @@
|
|
| 38 |
value={internal_value}
|
| 39 |
aria-checked={is_selected}
|
| 40 |
bind:group={selected}
|
| 41 |
-
|
| 42 |
/>
|
| 43 |
<span>{display_value}</span>
|
| 44 |
</label>
|
|
|
|
| 1 |
+
<script module>
|
| 2 |
let id = 0;
|
| 3 |
</script>
|
| 4 |
|
|
|
|
| 38 |
value={internal_value}
|
| 39 |
aria-checked={is_selected}
|
| 40 |
bind:group={selected}
|
| 41 |
+
oninput={handle_input}
|
| 42 |
/>
|
| 43 |
<span>{display_value}</span>
|
| 44 |
</label>
|