gradio/js/dropdown/Multiselect.stories.svelte
Abubakar Abid ddc02268f7
Allows the gr.Dropdown to have separate names and values, as well as enables allow_custom_value for multiselect dropdown (#5384)
* dropdown

* changes

* add changeset

* refactor

* cleanup

* dropdown

* more refactoring

* fixes

* simplify, docstring

* restore active_index

* split into two files

* new files

* simplify

* single select dropdown working

* single select dropdown almost working

* dropdown

* multiselect

* multiselect wip

* multiselect

* multiselect

* multiselect

* interactive working

* dropdown

* lint

* add changeset

* type

* typing

* fix multiselect static

* dropdown

* stories and tests

* split stories

* lint

* add changeset

* revert

* add changeset

* fix x

* dropdown

* lint, test

* backend fixes

* lint

* fix tests

* lint

* fix final test

* clean

* review fixes

* dropdown

* lint

* lint

* changes

* typing

* fixes

* active index null bug

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-09-12 09:58:18 -07:00

47 lines
761 B
Svelte

<script>
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
import Multiselect from "./shared/Multiselect.svelte";
</script>
<Meta
title="Components/Multiselect"
component={Multiselect}
argTypes={{
multiselect: {
control: [true, false],
name: "multiselect",
value: false
}
}}
/>
<Template let:args>
<Multiselect {...args} />
</Template>
<Story
name="Multiselect"
args={{
value: ["swim", "run"],
choices: [
["run", "run"],
["swim", "swim"],
["jump", "jump"]
],
label: "Multiselect Dropdown"
}}
/>
<Story
name="Multiselect Static"
args={{
value: ["swim", "run"],
choices: [
["run", "run"],
["swim", "swim"],
["jump", "jump"]
],
label: "Multiselect Dropdown",
disabled: true
}}
/>