Commit 88f50fa
authored
Changes in this PR:
- adds `allVisibleRowsSelected` to the `onRowSelect` event detail. When
all visible rows in a filtered table (all not filtered-out rows) are
selected, this property is `true`.
- refactors how the `onRowSelect` event is fired. Now, the original
event is persisted on the mutable table instance and only enriched and
fired after the respective table state is finalized.
- forks the `useRowSelect` react-table hook
- Early exit when `selectionMode` is 'None'
- Skips `selectedFlatRows` computation, `isAllRowsSelected` checks, and
`prepareRow` overhead when selection is disabled
- `isAllRowsSelected` computation is memoized
- Uses stable noop references when disabled
- Fixes select-all indeterminate state considering filtered-out rows
(now only visible rows are considered)
- Fixes indeterminate state of select-all checkbox when the table is
filtered.
- `useIndeterminateRowSelection`: parent row is now also included in
`selectedRowIds` when all sub rows are selected
- improves `stateReducer` type
1 parent 2f52b2d commit 88f50fa
13 files changed
Lines changed: 809 additions & 162 deletions
File tree
- packages/main/src/components/AnalyticalTable
- hooks
- pluginHooks
- tableReducer
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
Lines changed: 229 additions & 24 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
380 | 386 | | |
381 | 387 | | |
382 | 388 | | |
| |||
0 commit comments