Skip to content

Commit

Permalink
fix(OnyxDataGrid): Fix OnyxDataGrid more actions example (#2297)
Browse files Browse the repository at this point in the history
<!-- Is your PR related to an issue? Then please link it via the
"Relates to #" below. Else, remove it. -->

Relates to #1939 

- The more actions storybook example is renamed to Header Interactions
- The flyout options are added to every column
- The flyout options are changes
The changes were requested by UX
  • Loading branch information
MajaZarkova authored Dec 10, 2024
1 parent 8698b68 commit 5c1c4f1
Showing 1 changed file with 22 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,35 @@ export const Default = {
},
} satisfies Story;

export const MoreActions = {
export const HeaderInteractions = {
args: {
columns: ["name", "age", "birthday"],
features: [
{
name: Symbol("More actions"),
watch: [],
header: {
actions: (column) =>
column === "name"
? [
{
iconComponent: h(OnyxIconButton, {
label: "Sort options",
icon: sort,
color: "neutral",
}),
listItems: [
h(OnyxListItem, () => "No sorting"),
h(OnyxListItem, () => "Random sort"),
],
},
{
iconComponent: h(OnyxIconButton, {
label: "Sort options",
icon: sort,
color: "neutral",
}),
listItems: [
h(OnyxListItem, () => "Sort ascending"),
h(OnyxListItem, () => "Sort descending"),
],
},
]
: [],
actions: () => [
{
iconComponent: h(OnyxIconButton, {
label: "Column options",
icon: sort,
color: "neutral",
}),
listItems: [
h(OnyxListItem, () => "Pin column"),
h(OnyxListItem, () => "Unpin column"),
],
},
{
iconComponent: h(OnyxIconButton, {
label: "Column options",
icon: sort,
color: "neutral",
}),
listItems: [h(OnyxListItem, () => "Remove column")],
},
],
},
},
],
Expand Down

0 comments on commit 5c1c4f1

Please sign in to comment.