mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
9cefd2e90a
* image-editor-examples * add changeset * add changeset * delete changeset * change to process_example() * add changeset * changes for all components until dataset.py * rename * fix checkboxgroup * format * changes * add changeset * changes * add changeset * radio * add changeset * changes * add changeset * changes * examples * remove print * fix * clean * add changeset * fix tests * fix tests * fix test * fix * add changeset * fix video example * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
33 lines
605 B
Svelte
33 lines
605 B
Svelte
<script lang="ts">
|
|
export let value: string[];
|
|
export let type: "gallery" | "table";
|
|
export let selected = false;
|
|
export let choices: [string, string | number][];
|
|
|
|
let names = value
|
|
.map(
|
|
(val) =>
|
|
(
|
|
choices.find((pair) => pair[1] === val) as
|
|
| [string, string | number]
|
|
| undefined
|
|
)?.[0]
|
|
)
|
|
.filter((name) => name !== undefined);
|
|
let names_string = names.join(", ");
|
|
</script>
|
|
|
|
<div
|
|
class:table={type === "table"}
|
|
class:gallery={type === "gallery"}
|
|
class:selected
|
|
>
|
|
{names_string}
|
|
</div>
|
|
|
|
<style>
|
|
.gallery {
|
|
padding: var(--size-1) var(--size-2);
|
|
}
|
|
</style>
|