Skip to content

Commit

Permalink
fix broken stories (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbetancur authored Jan 12, 2024
1 parent ba2e865 commit f4a4162
Show file tree
Hide file tree
Showing 6 changed files with 439 additions and 457 deletions.
18 changes: 14 additions & 4 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const remarkGfm = require('remark-gfm');

const prettierConfig = require('../.prettierrc.js');

module.exports = {
Expand All @@ -15,12 +17,21 @@ module.exports = {

addons: [
{
name: '@storybook/addon-docs',
options: {
mdxPluginOptions: {
mdxCompileOptions: {
remarkPlugins: [remarkGfm],
},
},
},
},
{
name: '@storybook/addon-storysource',
options: {
loaderOptions: {
prettierConfig: prettierConfig,
injectStoryParameters: false,
},
prettierConfig: { printWidth: 80, singleQuote: true },
},
},
},
{
Expand All @@ -36,7 +47,6 @@ module.exports = {
},
},
},
'@storybook/addon-mdx-gfm',
],

docs: {
Expand Down
Binary file modified .yarn/install-state.gz
Binary file not shown.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-data-table-component",
"version": "7.6.0",
"version": "7.6.1",
"description": "A simple to use declarative react based data table",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down Expand Up @@ -50,9 +50,7 @@
"@rollup/plugin-node-resolve": "^15.2.3",
"@storybook/addon-a11y": "^7.6.7",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-mdx-gfm": "^7.6.7",
"@storybook/addon-storysource": "^7.6.7",
"@storybook/addons": "^7.6.7",
"@storybook/react": "^7.6.7",
"@storybook/react-webpack5": "^7.6.7",
"@storybook/theming": "^7.6.7",
Expand Down Expand Up @@ -89,6 +87,7 @@
"react": "^18.2.0",
"react-app-polyfill": "^3.0.0",
"react-dom": "^18.2.0",
"remark-gfm": "^4.0.0",
"rimraf": "^5.0.5",
"rollup": "^2.61.1",
"rollup-plugin-terser": "^7.0.2",
Expand Down
4 changes: 2 additions & 2 deletions stories/props.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import { Meta } from '@storybook/addon-docs';
| 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 |
| 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 |
| 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. |
| 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 |
| 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 |

# Row Expander

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

| Property | Type | Required | Default | Description |
| ---------------------------- | ----------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ---------------------------- | ----------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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 |
| paginationServer | boolean | no | false | Changes the default pagination to work with server side pagination |
| 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) |
Expand Down
6 changes: 3 additions & 3 deletions stories/shared/users.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { faker } from '@faker-js/faker';

const createUser = () => ({
id: faker.datatype.uuid(),
name: faker.name.findName(),
id: faker.string.uuid(),
name: faker.internet.userName(),
email: faker.internet.email(),
address: faker.address.streetAddress(),
address: faker.location.streetAddress(),
bio: faker.lorem.sentence(),
image: faker.image.avatar(),
});
Expand Down
Loading

0 comments on commit f4a4162

Please sign in to comment.