Skip to content

Commit f4a4162

Browse files
authored
fix broken stories (#1197)
1 parent ba2e865 commit f4a4162

File tree

6 files changed

+439
-457
lines changed

6 files changed

+439
-457
lines changed

.storybook/main.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const remarkGfm = require('remark-gfm');
2+
13
const prettierConfig = require('../.prettierrc.js');
24

35
module.exports = {
@@ -15,12 +17,21 @@ module.exports = {
1517

1618
addons: [
1719
{
20+
name: '@storybook/addon-docs',
21+
options: {
22+
mdxPluginOptions: {
23+
mdxCompileOptions: {
24+
remarkPlugins: [remarkGfm],
25+
},
26+
},
27+
},
28+
},
29+
{
1830
name: '@storybook/addon-storysource',
1931
options: {
2032
loaderOptions: {
21-
prettierConfig: prettierConfig,
22-
injectStoryParameters: false,
23-
},
33+
prettierConfig: { printWidth: 80, singleQuote: true },
34+
},
2435
},
2536
},
2637
{
@@ -36,7 +47,6 @@ module.exports = {
3647
},
3748
},
3849
},
39-
'@storybook/addon-mdx-gfm',
4050
],
4151

4252
docs: {

.yarn/install-state.gz

-56.4 KB
Binary file not shown.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-data-table-component",
3-
"version": "7.6.0",
3+
"version": "7.6.1",
44
"description": "A simple to use declarative react based data table",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.es.js",
@@ -50,9 +50,7 @@
5050
"@rollup/plugin-node-resolve": "^15.2.3",
5151
"@storybook/addon-a11y": "^7.6.7",
5252
"@storybook/addon-essentials": "^7.6.7",
53-
"@storybook/addon-mdx-gfm": "^7.6.7",
5453
"@storybook/addon-storysource": "^7.6.7",
55-
"@storybook/addons": "^7.6.7",
5654
"@storybook/react": "^7.6.7",
5755
"@storybook/react-webpack5": "^7.6.7",
5856
"@storybook/theming": "^7.6.7",
@@ -89,6 +87,7 @@
8987
"react": "^18.2.0",
9088
"react-app-polyfill": "^3.0.0",
9189
"react-dom": "^18.2.0",
90+
"remark-gfm": "^4.0.0",
9291
"rimraf": "^5.0.5",
9392
"rollup": "^2.61.1",
9493
"rollup-plugin-terser": "^7.0.2",

stories/props.stories.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import { Meta } from '@storybook/addon-docs';
5656
| selectableRowsComponentProps | object | no | {} | Additional props you want to pass to `selectableRowsComponent`. See [Material UI Example](/docs/ui-library-material-ui-table--table) to learn how you can override indeterminate state |
5757
| selectableRowSelected | `(row) => {}` | no | | Select a row based on a property in your data. e.g. `row => row.isSelected`. `selectableRowSelected` must return a boolean to determine if the row should be programatically selected. <br /><br />**Important Notes:**<br />- Changing the state of selectableRowSelected will NOT re-render RDT, instead you should change your data if you want to update the items that are selected.<br />- When using `selectableRowsSingle` `selectableRowSelected` will only return the first match |
5858
| selectableRowDisabled | `(row) => {}` | no | | Disable row select based on a property in your data. e.g. `row => row.isDisabled`. `selectableRowDisabled` must return a boolean to determine if the row should be programatically disabled. |
59-
| onSelectedRowsChange | `({ allSelected; selectedCount; selectedRows }) => {}` | no | | Callback that fires anytime the rows selected state changes. Returns ({ allSelected, selectedCount, selectedRows }).<br /><br />**Note:** It's highly recommended that you memoize the callback that you pass to `onSelectedRowsChange` if it updates the state of your parent component. This prevents `DataTable` from unnecessary re-renders every time your parent component is re-rendered |
59+
| onSelectedRowsChange | `({ allSelected; selectedCount; selectedRows }) => {}` | no | | Callback that fires anytime the rows selected state changes. Returns `({ allSelected, selectedCount, selectedRows })`.<br /><br />**Note:** It's highly recommended that you memoize the callback that you pass to `onSelectedRowsChange` if it updates the state of your parent component. This prevents `DataTable` from unnecessary re-renders every time your parent component is re-rendered |
6060

6161
# Row Expander
6262

@@ -77,7 +77,7 @@ import { Meta } from '@storybook/addon-docs';
7777
# Pagination
7878

7979
| Property | Type | Required | Default | Description |
80-
| ---------------------------- | ----------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
80+
| ---------------------------- | ----------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8181
| pagination | boolean | no | false | Enable pagination with defaults. by default the total record set will be sliced depending on the page, rows per page. if you wish to use server side pagination then use the `paginationServer` property |
8282
| paginationServer | boolean | no | false | Changes the default pagination to work with server side pagination |
8383
| paginationServerOptions | object | no | `{ persistSelectedOnPageChange: false, persistSelectedOnSort: false }` | When using `selectableRows` is used to make selected rows persist on page change and on sort when using server side pagination. <br /><br />**Note:** when using `persistSelectedOnPageChange` that select all checkbox will not be visible (i.e. you cannot select rows there you have to retrieved from the server) |

stories/shared/users.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { faker } from '@faker-js/faker';
22

33
const createUser = () => ({
4-
id: faker.datatype.uuid(),
5-
name: faker.name.findName(),
4+
id: faker.string.uuid(),
5+
name: faker.internet.userName(),
66
email: faker.internet.email(),
7-
address: faker.address.streetAddress(),
7+
address: faker.location.streetAddress(),
88
bio: faker.lorem.sentence(),
99
image: faker.image.avatar(),
1010
});

0 commit comments

Comments
 (0)