-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tables): toggle header cells only on the first row or column (#2120
- Loading branch information
Showing
4 changed files
with
201 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@remirror/react': patch | ||
--- | ||
|
||
Bump the package for the changes included in https://github.com/remirror/remirror/pull/2119 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
'@remirror/extension-tables': minor | ||
--- | ||
|
||
Expose a `toggleTableHeader` command, which only toggles the first row or column in a table. | ||
|
||
```tsx | ||
const { toggleTableHeader } = useCommands(); | ||
|
||
const handleClick = useCallback(() => { | ||
toggleTableHeader(); // row by default | ||
|
||
// Or | ||
toggleTableHeader('column'); | ||
}, [toggleTableHeader]); | ||
``` | ||
|
||
Expose a `tableHasHeader` helper, which returns a boolean stating if the first column or row in a table is a header. | ||
|
||
```tsx | ||
const { tableHasHeader } = useHelpers(true); | ||
|
||
console.log('first row is header', tableHasHeader()); | ||
|
||
console.log('first column is header', tableHasHeader('column')); | ||
``` |
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
2ff2a02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://remirror.io as production
🚀 Deployed on https://64b12605be2b3500a1a6ebe9--remirror.netlify.app