fix(SW-1509): removed support for plain array items in order to handle proper props extending
various fixes for supporting default selected
This commit is contained in:
@@ -14,9 +14,15 @@ export default meta
|
||||
|
||||
type Story = StoryObj<typeof Select>
|
||||
|
||||
const items = [
|
||||
{ label: 'Foo', value: 'foo' },
|
||||
{ label: 'Bar', value: 'bar' },
|
||||
{ label: 'Baz', value: 'baz' },
|
||||
]
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
items: ['Foo', 'Bar', 'Baz'],
|
||||
items,
|
||||
label: 'Select an item',
|
||||
name: 'foo',
|
||||
},
|
||||
@@ -24,40 +30,38 @@ export const Default: Story = {
|
||||
|
||||
export const DefaultSelected: Story = {
|
||||
args: {
|
||||
items: ['Foo', 'Bar', 'Baz'],
|
||||
label: 'Select an item',
|
||||
name: 'foo',
|
||||
defaultSelectedKey: 'Foo',
|
||||
},
|
||||
}
|
||||
|
||||
export const ObjectItem: Story = {
|
||||
args: {
|
||||
items: [
|
||||
{ label: 'Foo', value: 'foo' },
|
||||
{ label: 'Bar', value: 'bar' },
|
||||
{ label: 'Baz', value: 'baz' },
|
||||
],
|
||||
items,
|
||||
label: 'Select an item',
|
||||
name: 'foo',
|
||||
defaultSelectedKey: 'foo',
|
||||
},
|
||||
}
|
||||
|
||||
export const Icons: Story = {
|
||||
args: {
|
||||
icon: 'star',
|
||||
itemIcon: 'check',
|
||||
items: ['Foo', 'Bar', 'Baz'],
|
||||
items,
|
||||
label: 'Select an item',
|
||||
name: 'foo',
|
||||
icon: 'star',
|
||||
itemIcon: 'check',
|
||||
},
|
||||
}
|
||||
|
||||
export const Filtering: Story = {
|
||||
args: {
|
||||
items: ['Foo', 'Bar', 'Baz'],
|
||||
items,
|
||||
label: 'Select an item',
|
||||
name: 'foo',
|
||||
enableFiltering: true,
|
||||
},
|
||||
}
|
||||
|
||||
export const FilteringSelected: Story = {
|
||||
args: {
|
||||
items,
|
||||
label: 'Select an item',
|
||||
name: 'foo',
|
||||
enableFiltering: true,
|
||||
defaultSelectedKey: 'foo',
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user