-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to use DataTable rowDetails in a controlled way. Ex…
…tended `rowDetails` property to be oneOf function or a shape that may contain four functions, `render`, `isExpanded`, `isExpandable` and `expandClick`. `render` is the equivalent of the current function `rowDetails` rendering the row details. `isExpanded` is the function which determines if the row details should be expanded `isExpandable` is a function which allows certain rows to be expandable or not (i.e. not expandable means no expand button or expand/collapse events) `expandClick` is a function which is fired when the expand/collapse button is clicked. `render` and `isExpanded` are mandatory. `expandClick` can be handled using `onClickRow` or similar and the absence of `isExpandable` the default is that the row _is_ expandable. The change is fully backwards compatible (all previous tests for rowDetails are untouched as well as storybook). Storybook example is provided.
- Loading branch information
Showing
6 changed files
with
1,538 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.