Skip to content

Commit

Permalink
📝 - docs: further improvements to DataGrid stories
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvandescheur committed Oct 18, 2024
1 parent 8cab271 commit ae1780b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/components/data/datagrid/datagrid.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export const DataGridComponent = {
],
},
},
argTypes: {
onPageChange: { action: "onPageChange" },
onPageSizeChange: { action: "onPageSizeChange" },
},
};

/**
Expand Down Expand Up @@ -77,14 +81,15 @@ export const Decorated: Story = {
* to be editable can be controlled by passing `TypedField` items to the `fields`
* prop.
*/
export const EditableRows: Story = {
export const Editable: Story = {
...DataGridComponent,
args: {
...DataGridComponent.args,
fields: ["name", "category", "price", "stock", "isAvailable"],
editable: true,
},
argTypes: {
...DataGridComponent.argTypes,
onEdit: { action: "onEdit" },
},
};
Expand All @@ -110,6 +115,7 @@ export const FieldsSelectable: Story = {
fieldsSelectable: true,
},
argTypes: {
...DataGridComponent.argTypes,
onFieldsChange: { action: "onFieldsChange" },
},
};
Expand All @@ -133,6 +139,7 @@ export const Filterable: Story = {
],
},
argTypes: {
...DataGridComponent.argTypes,
onFilter: { action: "onFilter" },
},
};
Expand All @@ -158,6 +165,7 @@ export const Selectable: Story = {
],
},
argTypes: {
...DataGridComponent.argTypes,
onSelect: { action: "onSelect" },
onSelectionChange: { action: "onSelectionChange" },
onSelectAllPages: { action: "onSelectAllPages" },
Expand Down Expand Up @@ -245,6 +253,7 @@ export const FilterableSelectableSortable: Story = {
sort: "price",
},
argTypes: {
...DataGridComponent.argTypes,
onFilter: { action: "onFilter" },
onSelect: { action: "onSelect" },
onSelectionChange: { action: "onSelectionChange" },
Expand All @@ -271,6 +280,7 @@ export const DateFilter: Story = {
],
},
argTypes: {
...Filterable.argTypes,
onFilter: {
action: "onFilter",
},
Expand All @@ -294,11 +304,6 @@ export const DateRangeFilter: Story = {
{ name: "releaseDate", type: "daterange" },
],
},
argTypes: {
onFilter: {
action: "onFilter",
},
},
};

export const JSXAsValue: Story = {
Expand Down

0 comments on commit ae1780b

Please sign in to comment.