material-react-table 2.10.0 → 2.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +3 -2
  2. package/dist/index.d.ts +144 -125
  3. package/dist/index.esm.js +213 -154
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +213 -151
  6. package/dist/index.js.map +1 -1
  7. package/locales/ar/index.esm.js +1 -0
  8. package/locales/ar/index.js +1 -0
  9. package/locales/az/index.esm.js +1 -0
  10. package/locales/az/index.js +1 -0
  11. package/locales/bg/index.esm.js +1 -0
  12. package/locales/bg/index.js +1 -0
  13. package/locales/cs/index.esm.js +1 -0
  14. package/locales/cs/index.js +1 -0
  15. package/locales/da/index.esm.js +1 -0
  16. package/locales/da/index.js +1 -0
  17. package/locales/de/index.esm.js +1 -0
  18. package/locales/de/index.js +1 -0
  19. package/locales/en/index.esm.js +1 -0
  20. package/locales/en/index.js +1 -0
  21. package/locales/es/index.esm.js +1 -0
  22. package/locales/es/index.js +1 -0
  23. package/locales/et/index.esm.js +1 -0
  24. package/locales/et/index.js +1 -0
  25. package/locales/fa/index.esm.js +1 -0
  26. package/locales/fa/index.js +1 -0
  27. package/locales/fi/index.esm.js +1 -0
  28. package/locales/fi/index.js +1 -0
  29. package/locales/fr/index.esm.js +1 -0
  30. package/locales/fr/index.js +1 -0
  31. package/locales/he/index.esm.js +1 -0
  32. package/locales/he/index.js +1 -0
  33. package/locales/hu/index.esm.js +1 -0
  34. package/locales/hu/index.js +1 -0
  35. package/locales/hy/index.esm.js +1 -0
  36. package/locales/hy/index.js +1 -0
  37. package/locales/id/index.esm.js +1 -0
  38. package/locales/id/index.js +1 -0
  39. package/locales/it/index.esm.js +1 -0
  40. package/locales/it/index.js +1 -0
  41. package/locales/ja/index.esm.js +1 -0
  42. package/locales/ja/index.js +1 -0
  43. package/locales/ko/index.esm.js +1 -0
  44. package/locales/ko/index.js +1 -0
  45. package/locales/nl/index.esm.js +1 -0
  46. package/locales/nl/index.js +1 -0
  47. package/locales/no/index.esm.js +1 -0
  48. package/locales/no/index.js +1 -0
  49. package/locales/np/index.esm.js +1 -0
  50. package/locales/np/index.js +1 -0
  51. package/locales/pl/index.esm.js +1 -0
  52. package/locales/pl/index.js +1 -0
  53. package/locales/pt/index.esm.js +1 -0
  54. package/locales/pt/index.js +1 -0
  55. package/locales/pt-BR/index.esm.js +1 -0
  56. package/locales/pt-BR/index.js +1 -0
  57. package/locales/ro/index.esm.js +1 -0
  58. package/locales/ro/index.js +1 -0
  59. package/locales/ru/index.esm.js +1 -0
  60. package/locales/ru/index.js +1 -0
  61. package/locales/sk/index.esm.js +1 -0
  62. package/locales/sk/index.js +1 -0
  63. package/locales/sr-Cyrl-RS/index.esm.js +1 -0
  64. package/locales/sr-Cyrl-RS/index.js +1 -0
  65. package/locales/sr-Latn-RS/index.esm.js +1 -0
  66. package/locales/sr-Latn-RS/index.js +1 -0
  67. package/locales/sv/index.esm.js +1 -0
  68. package/locales/sv/index.js +1 -0
  69. package/locales/tr/index.esm.js +1 -0
  70. package/locales/tr/index.js +1 -0
  71. package/locales/uk/index.esm.js +1 -0
  72. package/locales/uk/index.js +1 -0
  73. package/locales/vi/index.esm.js +1 -0
  74. package/locales/vi/index.js +1 -0
  75. package/locales/zh-Hans/index.esm.js +1 -0
  76. package/locales/zh-Hans/index.js +1 -0
  77. package/locales/zh-Hant/index.esm.js +1 -0
  78. package/locales/zh-Hant/index.js +1 -0
  79. package/package.json +18 -18
  80. package/src/components/MaterialReactTable.tsx +3 -3
  81. package/src/components/body/MRT_TableBody.tsx +3 -2
  82. package/src/components/body/MRT_TableBodyCell.tsx +4 -2
  83. package/src/components/body/MRT_TableBodyCellValue.tsx +5 -2
  84. package/src/components/body/MRT_TableBodyRow.tsx +13 -8
  85. package/src/components/body/MRT_TableBodyRowGrabHandle.tsx +4 -3
  86. package/src/components/body/MRT_TableBodyRowPinButton.tsx +3 -2
  87. package/src/components/body/MRT_TableDetailPanel.tsx +3 -2
  88. package/src/components/buttons/MRT_ColumnPinningButtons.tsx +3 -2
  89. package/src/components/buttons/MRT_CopyButton.tsx +3 -2
  90. package/src/components/buttons/MRT_EditActionButtons.tsx +3 -2
  91. package/src/components/buttons/MRT_ExpandAllButton.tsx +3 -2
  92. package/src/components/buttons/MRT_ExpandButton.tsx +3 -2
  93. package/src/components/buttons/MRT_GrabHandleButton.tsx +9 -15
  94. package/src/components/buttons/MRT_RowPinButton.tsx +3 -2
  95. package/src/components/buttons/MRT_ShowHideColumnsButton.tsx +3 -2
  96. package/src/components/buttons/MRT_ToggleDensePaddingButton.tsx +3 -2
  97. package/src/components/buttons/MRT_ToggleFiltersButton.tsx +3 -2
  98. package/src/components/buttons/MRT_ToggleFullScreenButton.tsx +3 -2
  99. package/src/components/buttons/MRT_ToggleGlobalFilterButton.tsx +3 -2
  100. package/src/components/buttons/MRT_ToggleRowActionMenuButton.tsx +3 -2
  101. package/src/components/footer/MRT_TableFooter.tsx +3 -2
  102. package/src/components/footer/MRT_TableFooterCell.tsx +3 -2
  103. package/src/components/footer/MRT_TableFooterRow.tsx +5 -3
  104. package/src/components/head/MRT_TableHead.tsx +3 -2
  105. package/src/components/head/MRT_TableHeadCell.tsx +3 -5
  106. package/src/components/head/MRT_TableHeadCellColumnActionsButton.tsx +4 -2
  107. package/src/components/head/MRT_TableHeadCellFilterContainer.tsx +4 -2
  108. package/src/components/head/MRT_TableHeadCellFilterLabel.tsx +3 -2
  109. package/src/components/head/MRT_TableHeadCellGrabHandle.tsx +4 -3
  110. package/src/components/head/MRT_TableHeadCellResizeHandle.tsx +3 -2
  111. package/src/components/head/MRT_TableHeadCellSortLabel.tsx +3 -2
  112. package/src/components/head/MRT_TableHeadRow.tsx +3 -2
  113. package/src/components/inputs/MRT_EditCellTextField.tsx +3 -2
  114. package/src/components/inputs/MRT_FilterCheckbox.tsx +3 -2
  115. package/src/components/inputs/MRT_FilterRangeFields.tsx +3 -2
  116. package/src/components/inputs/MRT_FilterRangeSlider.tsx +3 -2
  117. package/src/components/inputs/MRT_FilterTextField.tsx +15 -6
  118. package/src/components/inputs/MRT_GlobalFilterTextField.tsx +3 -2
  119. package/src/components/inputs/MRT_SelectCheckbox.tsx +28 -35
  120. package/src/components/menus/MRT_ActionMenuItem.tsx +3 -2
  121. package/src/components/menus/MRT_CellActionMenu.tsx +5 -4
  122. package/src/components/menus/MRT_ColumnActionMenu.tsx +5 -4
  123. package/src/components/menus/MRT_FilterOptionMenu.tsx +3 -2
  124. package/src/components/menus/MRT_RowActionMenu.tsx +3 -2
  125. package/src/components/menus/MRT_ShowHideColumnsMenu.tsx +8 -2
  126. package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +7 -5
  127. package/src/components/modals/MRT_EditRowModal.tsx +3 -2
  128. package/src/components/table/MRT_Table.tsx +2 -2
  129. package/src/components/table/MRT_TableContainer.tsx +3 -2
  130. package/src/components/table/MRT_TableLoadingOverlay.tsx +11 -8
  131. package/src/components/table/MRT_TablePaper.tsx +3 -2
  132. package/src/components/toolbar/MRT_BottomToolbar.tsx +3 -2
  133. package/src/components/toolbar/MRT_LinearProgressBar.tsx +3 -2
  134. package/src/components/toolbar/MRT_TablePagination.tsx +2 -2
  135. package/src/components/toolbar/MRT_ToolbarAlertBanner.tsx +30 -13
  136. package/src/components/toolbar/MRT_ToolbarDropZone.tsx +3 -2
  137. package/src/components/toolbar/MRT_ToolbarInternalButtons.tsx +3 -2
  138. package/src/components/toolbar/MRT_TopToolbar.tsx +2 -2
  139. package/src/hooks/useMRT_Effects.ts +11 -11
  140. package/src/hooks/useMRT_Rows.ts +11 -79
  141. package/src/hooks/useMRT_TableInstance.ts +2 -0
  142. package/src/hooks/useMRT_TableOptions.ts +2 -0
  143. package/src/locales/ar.ts +1 -0
  144. package/src/locales/az.ts +1 -0
  145. package/src/locales/bg.ts +1 -0
  146. package/src/locales/cs.ts +1 -0
  147. package/src/locales/da.ts +1 -0
  148. package/src/locales/de.ts +1 -0
  149. package/src/locales/en.ts +1 -0
  150. package/src/locales/es.ts +1 -0
  151. package/src/locales/et.ts +1 -0
  152. package/src/locales/fa.ts +1 -0
  153. package/src/locales/fi.ts +1 -0
  154. package/src/locales/fr.ts +1 -0
  155. package/src/locales/he.ts +1 -0
  156. package/src/locales/hu.ts +1 -0
  157. package/src/locales/hy.ts +1 -0
  158. package/src/locales/id.ts +1 -0
  159. package/src/locales/it.ts +1 -0
  160. package/src/locales/ja.ts +1 -0
  161. package/src/locales/ko.ts +1 -0
  162. package/src/locales/nl.ts +1 -0
  163. package/src/locales/no.ts +1 -0
  164. package/src/locales/np.ts +1 -0
  165. package/src/locales/pl.ts +1 -0
  166. package/src/locales/pt-BR.ts +1 -0
  167. package/src/locales/pt.ts +1 -0
  168. package/src/locales/ro.ts +1 -0
  169. package/src/locales/ru.ts +1 -0
  170. package/src/locales/sk.ts +1 -0
  171. package/src/locales/sr-Cyrl-RS.ts +1 -0
  172. package/src/locales/sr-Latn-RS.ts +1 -0
  173. package/src/locales/sv.ts +1 -0
  174. package/src/locales/tr.ts +1 -0
  175. package/src/locales/uk.ts +1 -0
  176. package/src/locales/vi.ts +1 -0
  177. package/src/locales/zh-Hans.ts +1 -0
  178. package/src/locales/zh-Hant.ts +1 -0
  179. package/src/types.ts +10 -4
  180. package/src/utils/column.utils.ts +4 -6
  181. package/src/utils/displayColumn.utils.ts +1 -1
  182. package/src/utils/row.utils.ts +196 -21
  183. package/locales/am/index.d.ts +0 -3
  184. package/locales/am/index.esm.d.ts +0 -3
  185. package/locales/am/index.esm.js +0 -93
  186. package/locales/am/index.js +0 -97
  187. package/locales/am/package.json +0 -6
package/dist/index.js CHANGED
@@ -250,13 +250,12 @@ const reorderColumn = (draggedColumn, targetColumn, columnOrder) => {
250
250
  return newColumnOrder;
251
251
  };
252
252
  const getDefaultColumnFilterFn = (columnDef) => {
253
- var _a;
254
- if (columnDef.filterVariant === 'multi-select')
253
+ const { filterVariant } = columnDef;
254
+ if (filterVariant === 'multi-select')
255
255
  return 'arrIncludesSome';
256
- if ((_a = columnDef.filterVariant) === null || _a === void 0 ? void 0 : _a.includes('range'))
256
+ if (filterVariant === null || filterVariant === void 0 ? void 0 : filterVariant.includes('range'))
257
257
  return 'betweenInclusive';
258
- if (columnDef.filterVariant === 'select' ||
259
- columnDef.filterVariant === 'checkbox')
258
+ if (filterVariant === 'select' || filterVariant === 'checkbox')
260
259
  return 'equals';
261
260
  return 'fuzzy';
262
261
  };
@@ -359,7 +358,7 @@ const showRowDragColumn = (tableOptions) => {
359
358
  const showRowExpandColumn = (tableOptions) => {
360
359
  const { enableExpanding, enableGrouping, renderDetailPanel, state: { grouping }, } = tableOptions;
361
360
  return !!(enableExpanding ||
362
- (enableGrouping && (grouping === undefined || (grouping === null || grouping === void 0 ? void 0 : grouping.length))) ||
361
+ (enableGrouping && (grouping === null || grouping === void 0 ? void 0 : grouping.length)) ||
363
362
  renderDetailPanel);
364
363
  };
365
364
  const showRowActionsColumn = (tableOptions) => {
@@ -409,16 +408,65 @@ const getDefaultColumnOrderIds = (tableOptions, reset = false) => {
409
408
  ];
410
409
  };
411
410
 
412
- const getIsRowSelected = ({ row, table, }) => {
413
- const { options: { enableRowSelection }, } = table;
414
- return (row.getIsSelected() ||
415
- (parseFromValuesOrFunc(enableRowSelection, row) &&
416
- row.getCanSelectSubRows() &&
417
- row.getIsAllSubRowsSelected()));
411
+ const fuzzy$1 = (rowA, rowB, columnId) => {
412
+ let dir = 0;
413
+ if (rowA.columnFiltersMeta[columnId]) {
414
+ dir = matchSorterUtils.compareItems(rowA.columnFiltersMeta[columnId], rowB.columnFiltersMeta[columnId]);
415
+ }
416
+ // Provide a fallback for when the item ranks are equal
417
+ return dir === 0
418
+ ? reactTable.sortingFns.alphanumeric(rowA, rowB, columnId)
419
+ : dir;
420
+ };
421
+ const MRT_SortingFns = Object.assign(Object.assign({}, reactTable.sortingFns), { fuzzy: fuzzy$1 });
422
+ const rankGlobalFuzzy = (rowA, rowB) => Math.max(...Object.values(rowB.columnFiltersMeta).map((v) => v.rank)) -
423
+ Math.max(...Object.values(rowA.columnFiltersMeta).map((v) => v.rank));
424
+
425
+ const getMRT_Rows = (table, pinnedRowIds = [], all) => {
426
+ const { getBottomRows, getCenterRows, getPrePaginationRowModel, getRowModel, getState, getTopRows, options: { createDisplayMode, enablePagination, enableRowPinning, manualPagination, positionCreatingRow, rowPinningDisplayMode, }, } = table;
427
+ const { creatingRow, pagination } = getState();
428
+ const isRankingRows = getIsRankingRows(table);
429
+ let rows = [];
430
+ if (!isRankingRows) {
431
+ rows =
432
+ !enableRowPinning || (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky'))
433
+ ? all
434
+ ? getPrePaginationRowModel().rows
435
+ : getRowModel().rows
436
+ : getCenterRows();
437
+ }
438
+ else {
439
+ rows = getPrePaginationRowModel().rows.sort((a, b) => rankGlobalFuzzy(a, b));
440
+ if (enablePagination && !manualPagination && !all) {
441
+ const start = pagination.pageIndex * pagination.pageSize;
442
+ rows = rows.slice(start, start + pagination.pageSize);
443
+ }
444
+ }
445
+ if (enableRowPinning && (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky'))) {
446
+ rows = [
447
+ ...getTopRows().filter((row) => !pinnedRowIds.includes(row.id)),
448
+ ...rows,
449
+ ...getBottomRows().filter((row) => !pinnedRowIds.includes(row.id)),
450
+ ];
451
+ }
452
+ if (positionCreatingRow !== undefined &&
453
+ creatingRow &&
454
+ createDisplayMode === 'row') {
455
+ const creatingRowIndex = !isNaN(+positionCreatingRow)
456
+ ? +positionCreatingRow
457
+ : positionCreatingRow === 'top'
458
+ ? 0
459
+ : rows.length;
460
+ rows = [
461
+ ...rows.slice(0, creatingRowIndex),
462
+ creatingRow,
463
+ ...rows.slice(creatingRowIndex),
464
+ ];
465
+ }
466
+ return rows;
418
467
  };
419
468
  const getCanRankRows = (table) => {
420
- const { getState, options } = table;
421
- const { enableGlobalFilterRankedResults, manualExpanding, manualFiltering, manualGrouping, manualSorting, } = options;
469
+ const { getState, options: { enableGlobalFilterRankedResults, manualExpanding, manualFiltering, manualGrouping, manualSorting, }, } = table;
422
470
  const { expanded, globalFilterFn } = getState();
423
471
  return (!manualExpanding &&
424
472
  !manualFiltering &&
@@ -429,17 +477,77 @@ const getCanRankRows = (table) => {
429
477
  expanded !== true &&
430
478
  !Object.values(expanded).some(Boolean));
431
479
  };
480
+ const getIsRankingRows = (table) => {
481
+ const { globalFilter, sorting } = table.getState();
482
+ return (getCanRankRows(table) &&
483
+ globalFilter &&
484
+ !Object.values(sorting).some(Boolean));
485
+ };
486
+ const getIsRowSelected = ({ row, table, }) => {
487
+ const { options: { enableRowSelection }, } = table;
488
+ return (row.getIsSelected() ||
489
+ (parseFromValuesOrFunc(enableRowSelection, row) &&
490
+ row.getCanSelectSubRows() &&
491
+ row.getIsAllSubRowsSelected()));
492
+ };
493
+ const getMRT_RowSelectionHandler = () => ({ event, row, staticRowIndex = 0, table, }) => {
494
+ var _a;
495
+ const { getState, options: { enableBatchRowSelection, enableRowPinning, manualPagination, rowPinningDisplayMode, }, refs: { lastSelectedRowId: lastSelectedRowId }, } = table;
496
+ const { pagination: { pageIndex, pageSize }, } = getState();
497
+ const paginationOffset = manualPagination ? 0 : pageSize * pageIndex;
498
+ const isCurrentRowChecked = getIsRowSelected({ row, table });
499
+ const isStickySelection = enableRowPinning && (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('select'));
500
+ // toggle selection of this row
501
+ row.getToggleSelectedHandler()(event);
502
+ // if shift key is pressed, select all rows between last selected and this one
503
+ if (enableBatchRowSelection &&
504
+ event.nativeEvent.shiftKey &&
505
+ lastSelectedRowId.current !== null) {
506
+ const rows = getMRT_Rows(table, undefined, true);
507
+ const lastIndex = rows.findIndex((r) => r.id === lastSelectedRowId.current);
508
+ if (lastIndex !== -1) {
509
+ const isLastIndexChecked = getIsRowSelected({
510
+ row: rows === null || rows === void 0 ? void 0 : rows[lastIndex],
511
+ table,
512
+ });
513
+ const currentIndex = staticRowIndex + paginationOffset;
514
+ const [start, end] = lastIndex < currentIndex
515
+ ? [lastIndex, currentIndex]
516
+ : [currentIndex, lastIndex];
517
+ // toggle selection of all rows between last selected and this one
518
+ // but only if the last selected row is not the same as the current one
519
+ if (isCurrentRowChecked !== isLastIndexChecked) {
520
+ for (let i = start; i <= end; i++) {
521
+ rows[i].toggleSelected(!isCurrentRowChecked);
522
+ }
523
+ }
524
+ }
525
+ }
526
+ // record the last selected row id
527
+ lastSelectedRowId.current = row.id;
528
+ // if all sub rows were selected, unselect them
529
+ if (row.getCanSelectSubRows() && row.getIsAllSubRowsSelected()) {
530
+ (_a = row.subRows) === null || _a === void 0 ? void 0 : _a.forEach((r) => r.toggleSelected(false));
531
+ }
532
+ if (isStickySelection) {
533
+ row.pin(!row.getIsPinned() && isCurrentRowChecked
534
+ ? (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('bottom'))
535
+ ? 'bottom'
536
+ : 'top'
537
+ : false);
538
+ }
539
+ };
432
540
 
433
541
  const MRT_AggregationFns = Object.assign({}, reactTable.aggregationFns);
434
542
 
435
- const fuzzy$1 = (row, columnId, filterValue, addMeta) => {
543
+ const fuzzy = (row, columnId, filterValue, addMeta) => {
436
544
  const itemRank = matchSorterUtils.rankItem(row.getValue(columnId), filterValue, {
437
545
  threshold: matchSorterUtils.rankings.MATCHES,
438
546
  });
439
547
  addMeta(itemRank);
440
548
  return itemRank.passed;
441
549
  };
442
- fuzzy$1.autoRemove = (val) => !val;
550
+ fuzzy.autoRemove = (val) => !val;
443
551
  const contains = (row, id, filterValue) => row
444
552
  .getValue(id)
445
553
  .toString()
@@ -507,7 +615,7 @@ const MRT_FilterFns = Object.assign(Object.assign({}, reactTable.filterFns), { b
507
615
  empty,
508
616
  endsWith,
509
617
  equals,
510
- fuzzy: fuzzy$1,
618
+ fuzzy,
511
619
  greaterThan,
512
620
  greaterThanOrEqualTo,
513
621
  lessThan,
@@ -516,20 +624,6 @@ const MRT_FilterFns = Object.assign(Object.assign({}, reactTable.filterFns), { b
516
624
  notEquals,
517
625
  startsWith });
518
626
 
519
- const fuzzy = (rowA, rowB, columnId) => {
520
- let dir = 0;
521
- if (rowA.columnFiltersMeta[columnId]) {
522
- dir = matchSorterUtils.compareItems(rowA.columnFiltersMeta[columnId], rowB.columnFiltersMeta[columnId]);
523
- }
524
- // Provide a fallback for when the item ranks are equal
525
- return dir === 0
526
- ? reactTable.sortingFns.alphanumeric(rowA, rowB, columnId)
527
- : dir;
528
- };
529
- const MRT_SortingFns = Object.assign(Object.assign({}, reactTable.sortingFns), { fuzzy });
530
- const rankGlobalFuzzy = (rowA, rowB) => Math.max(...Object.values(rowB.columnFiltersMeta).map((v) => v.rank)) -
531
- Math.max(...Object.values(rowA.columnFiltersMeta).map((v) => v.rank));
532
-
533
627
  /******************************************************************************
534
628
  Copyright (c) Microsoft Corporation.
535
629
 
@@ -785,19 +879,18 @@ const getMRT_RowActionsColumnDef = (tableOptions) => {
785
879
 
786
880
  const MRT_GrabHandleButton = (_a) => {
787
881
  var _b, _c;
788
- var { iconButtonProps, location, onDragEnd, onDragStart, table } = _a, rest = __rest(_a, ["iconButtonProps", "location", "onDragEnd", "onDragStart", "table"]);
882
+ var { location, table } = _a, rest = __rest(_a, ["location", "table"]);
789
883
  const { options: { icons: { DragHandleIcon }, localization, }, } = table;
790
- const _iconButtonProps = Object.assign(Object.assign({}, iconButtonProps), rest);
791
- return (jsxRuntime.jsx(Tooltip__default["default"], Object.assign({}, getCommonTooltipProps('top'), { title: (_b = _iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.title) !== null && _b !== void 0 ? _b : localization.move, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": (_c = _iconButtonProps.title) !== null && _c !== void 0 ? _c : localization.move, disableRipple: true, draggable: "true", size: "small" }, _iconButtonProps, { onClick: (e) => {
884
+ return (jsxRuntime.jsx(Tooltip__default["default"], Object.assign({}, getCommonTooltipProps('top'), { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.move, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": (_c = rest.title) !== null && _c !== void 0 ? _c : localization.move, disableRipple: true, draggable: "true", size: "small" }, rest, { onClick: (e) => {
792
885
  var _a;
793
886
  e.stopPropagation();
794
- (_a = _iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(_iconButtonProps, e);
795
- }, onDragEnd: onDragEnd, onDragStart: onDragStart, sx: (theme) => (Object.assign({ '&:active': {
887
+ (_a = rest === null || rest === void 0 ? void 0 : rest.onClick) === null || _a === void 0 ? void 0 : _a.call(rest, e);
888
+ }, sx: (theme) => (Object.assign({ '&:active': {
796
889
  cursor: 'grabbing',
797
890
  }, '&:hover': {
798
891
  backgroundColor: 'transparent',
799
892
  opacity: 1,
800
- }, cursor: 'grab', m: '0 -0.1rem', opacity: location === 'row' ? 1 : 0.3, p: '2px', transition: 'all 150ms ease-in-out' }, parseFromValuesOrFunc(_iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.sx, theme))), title: undefined, children: jsxRuntime.jsx(DragHandleIcon, {}) })) })));
893
+ }, cursor: 'grab', m: '0 -0.1rem', opacity: location === 'row' ? 1 : 0.5, p: '2px', transition: 'all 150ms ease-in-out' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), title: undefined, children: jsxRuntime.jsx(DragHandleIcon, {}) })) })));
801
894
  };
802
895
 
803
896
  const MRT_TableBodyRowGrabHandle = (_a) => {
@@ -824,7 +917,7 @@ const MRT_TableBodyRowGrabHandle = (_a) => {
824
917
  table.setDraggingRow(null);
825
918
  table.setHoveredRow(null);
826
919
  };
827
- return (jsxRuntime.jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, location: "row", onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table }));
920
+ return (jsxRuntime.jsx(MRT_GrabHandleButton, Object.assign({}, iconButtonProps, { location: "row", onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })));
828
921
  };
829
922
 
830
923
  const getMRT_RowDragColumnDef = (tableOptions) => {
@@ -988,36 +1081,25 @@ const getMRT_RowPinningColumnDef = (tableOptions) => {
988
1081
  const MRT_SelectCheckbox = (_a) => {
989
1082
  var _b;
990
1083
  var { row, staticRowIndex, table } = _a, rest = __rest(_a, ["row", "staticRowIndex", "table"]);
991
- const { getState, options: { enableMultiRowSelection, enableRowPinning, localization, muiSelectAllCheckboxProps, muiSelectCheckboxProps, rowPinningDisplayMode, selectAllMode, }, } = table;
1084
+ const { getState, options: { enableMultiRowSelection, enableRowPinning, localization, muiSelectAllCheckboxProps, muiSelectCheckboxProps, rowPinningDisplayMode, selectAllMode, }, refs: { lastSelectedRowId }, } = table;
992
1085
  const { density, isLoading } = getState();
993
1086
  const selectAll = !row;
994
- const checkboxProps = Object.assign(Object.assign({}, (!row
995
- ? parseFromValuesOrFunc(muiSelectAllCheckboxProps, { table })
996
- : parseFromValuesOrFunc(muiSelectCheckboxProps, {
997
- row,
998
- staticRowIndex,
999
- table,
1000
- }))), rest);
1001
1087
  const isStickySelection = enableRowPinning && (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('select'));
1002
1088
  const allRowsSelected = selectAll
1003
1089
  ? selectAllMode === 'page'
1004
1090
  ? table.getIsAllPageRowsSelected()
1005
1091
  : table.getIsAllRowsSelected()
1006
1092
  : undefined;
1007
- const onSelectionChange = (event, row) => {
1008
- var _a;
1009
- if (row.getIsAllSubRowsSelected() && row.getCanSelectSubRows()) {
1010
- (_a = row.subRows) === null || _a === void 0 ? void 0 : _a.forEach((r) => r.toggleSelected(false));
1011
- }
1012
- row.getToggleSelectedHandler()(event);
1013
- if (isStickySelection) {
1014
- row.pin(!row.getIsPinned() && event.target.checked
1015
- ? (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('bottom'))
1016
- ? 'bottom'
1017
- : 'top'
1018
- : false);
1019
- }
1020
- };
1093
+ const isChecked = selectAll
1094
+ ? allRowsSelected
1095
+ : getIsRowSelected({ row, table });
1096
+ const checkboxProps = Object.assign(Object.assign({}, (selectAll
1097
+ ? parseFromValuesOrFunc(muiSelectAllCheckboxProps, { table })
1098
+ : parseFromValuesOrFunc(muiSelectCheckboxProps, {
1099
+ row,
1100
+ table,
1101
+ }))), rest);
1102
+ const onSelectionChange = getMRT_RowSelectionHandler();
1021
1103
  const onSelectAllChange = (event) => {
1022
1104
  selectAllMode === 'all'
1023
1105
  ? table.getToggleAllRowsSelectedHandler()(event)
@@ -1025,16 +1107,19 @@ const MRT_SelectCheckbox = (_a) => {
1025
1107
  if (isStickySelection) {
1026
1108
  table.setRowPinning({ bottom: [], top: [] });
1027
1109
  }
1110
+ lastSelectedRowId.current = null;
1028
1111
  };
1029
1112
  const commonProps = Object.assign(Object.assign({ 'aria-label': selectAll
1030
1113
  ? localization.toggleSelectAll
1031
- : localization.toggleSelectRow, checked: selectAll ? allRowsSelected : getIsRowSelected({ row, table }), disabled: isLoading || (row && !row.getCanSelect()) || (row === null || row === void 0 ? void 0 : row.id) === 'mrt-row-create', inputProps: {
1114
+ : localization.toggleSelectRow, checked: isChecked, disabled: isLoading || (row && !row.getCanSelect()) || (row === null || row === void 0 ? void 0 : row.id) === 'mrt-row-create', inputProps: {
1032
1115
  'aria-label': selectAll
1033
1116
  ? localization.toggleSelectAll
1034
1117
  : localization.toggleSelectRow,
1035
1118
  }, onChange: (event) => {
1036
1119
  event.stopPropagation();
1037
- row ? onSelectionChange(event, row) : onSelectAllChange(event);
1120
+ row
1121
+ ? onSelectionChange({ event, row, staticRowIndex, table })
1122
+ : onSelectAllChange(event);
1038
1123
  }, size: (density === 'compact' ? 'small' : 'medium') }, checkboxProps), { onClick: (e) => {
1039
1124
  var _a;
1040
1125
  e.stopPropagation();
@@ -1042,8 +1127,8 @@ const MRT_SelectCheckbox = (_a) => {
1042
1127
  }, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.5rem', m: density !== 'compact' ? '-0.4rem' : undefined, width: density === 'compact' ? '1.75rem' : '2.5rem', zIndex: 0 }, parseFromValuesOrFunc(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx, theme))), title: undefined });
1043
1128
  return (jsxRuntime.jsx(Tooltip__default["default"], Object.assign({}, getCommonTooltipProps(), { title: (_b = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _b !== void 0 ? _b : (selectAll
1044
1129
  ? localization.toggleSelectAll
1045
- : localization.toggleSelectRow), children: enableMultiRowSelection === false ? (jsxRuntime.jsx(Radio__default["default"], Object.assign({}, commonProps))) : (jsxRuntime.jsx(Checkbox__default["default"], Object.assign({ indeterminate: selectAll
1046
- ? table.getIsSomeRowsSelected() && !allRowsSelected
1130
+ : localization.toggleSelectRow), children: enableMultiRowSelection === false ? (jsxRuntime.jsx(Radio__default["default"], Object.assign({}, commonProps))) : (jsxRuntime.jsx(Checkbox__default["default"], Object.assign({ indeterminate: !isChecked && selectAll
1131
+ ? table.getIsSomeRowsSelected()
1047
1132
  : (row === null || row === void 0 ? void 0 : row.getIsSomeSelected()) && row.getCanSelectSubRows() }, commonProps))) })));
1048
1133
  };
1049
1134
 
@@ -1104,6 +1189,7 @@ const MRT_Localization_EN = {
1104
1189
  changeSearchMode: 'Change search mode',
1105
1190
  clearFilter: 'Clear filter',
1106
1191
  clearSearch: 'Clear search',
1192
+ clearSelection: 'Clear selection',
1107
1193
  clearSort: 'Clear sort',
1108
1194
  clickToCopy: 'Click to copy',
1109
1195
  copy: 'Copy',
@@ -1211,7 +1297,7 @@ const MRT_DefaultDisplayColumn = {
1211
1297
  };
1212
1298
  const useMRT_TableOptions = (_a) => {
1213
1299
  var _b;
1214
- var { aggregationFns, autoResetExpanded = false, columnFilterDisplayMode = 'subheader', columnResizeDirection, columnResizeMode = 'onChange', createDisplayMode = 'modal', defaultColumn, defaultDisplayColumn, editDisplayMode = 'modal', enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = false, enableColumnPinning = false, enableColumnResizing = false, enableColumnVirtualization, enableDensityToggle = true, enableExpandAll = true, enableExpanding, enableFacetedValues = false, enableFilterMatchHighlighting = true, enableFilters = true, enableFullScreenToggle = true, enableGlobalFilter = true, enableGlobalFilterRankedResults = true, enableGrouping = false, enableHiding = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enableRowPinning = false, enableRowSelection = false, enableRowVirtualization, enableSelectAll = true, enableSorting = true, enableStickyHeader = false, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, layoutMode, localization, manualFiltering, manualGrouping, manualPagination, manualSorting, paginationDisplayMode = 'default', positionActionsColumn = 'first', positionCreatingRow = 'top', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top', rowNumberDisplayMode = 'static', rowPinningDisplayMode = 'sticky', selectAllMode = 'page', sortingFns } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnFilterDisplayMode", "columnResizeDirection", "columnResizeMode", "createDisplayMode", "defaultColumn", "defaultDisplayColumn", "editDisplayMode", "enableBottomToolbar", "enableColumnActions", "enableColumnFilters", "enableColumnOrdering", "enableColumnPinning", "enableColumnResizing", "enableColumnVirtualization", "enableDensityToggle", "enableExpandAll", "enableExpanding", "enableFacetedValues", "enableFilterMatchHighlighting", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "enableGlobalFilterRankedResults", "enableGrouping", "enableHiding", "enableMultiRowSelection", "enableMultiSort", "enablePagination", "enableRowPinning", "enableRowSelection", "enableRowVirtualization", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarInternalActions", "enableTopToolbar", "filterFns", "icons", "layoutMode", "localization", "manualFiltering", "manualGrouping", "manualPagination", "manualSorting", "paginationDisplayMode", "positionActionsColumn", "positionCreatingRow", "positionExpandColumn", "positionGlobalFilter", "positionPagination", "positionToolbarAlertBanner", "positionToolbarDropZone", "rowNumberDisplayMode", "rowPinningDisplayMode", "selectAllMode", "sortingFns"]);
1300
+ var { aggregationFns, autoResetExpanded = false, columnFilterDisplayMode = 'subheader', columnResizeDirection, columnResizeMode = 'onChange', createDisplayMode = 'modal', defaultColumn, defaultDisplayColumn, editDisplayMode = 'modal', enableBatchRowSelection = true, enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = false, enableColumnPinning = false, enableColumnResizing = false, enableColumnVirtualization, enableDensityToggle = true, enableExpandAll = true, enableExpanding, enableFacetedValues = false, enableFilterMatchHighlighting = true, enableFilters = true, enableFullScreenToggle = true, enableGlobalFilter = true, enableGlobalFilterRankedResults = true, enableGrouping = false, enableHiding = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enableRowPinning = false, enableRowSelection = false, enableRowVirtualization, enableSelectAll = true, enableSorting = true, enableStickyHeader = false, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, layoutMode, localization, manualFiltering, manualGrouping, manualPagination, manualSorting, paginationDisplayMode = 'default', positionActionsColumn = 'first', positionCreatingRow = 'top', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top', rowNumberDisplayMode = 'static', rowPinningDisplayMode = 'sticky', selectAllMode = 'page', sortingFns } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnFilterDisplayMode", "columnResizeDirection", "columnResizeMode", "createDisplayMode", "defaultColumn", "defaultDisplayColumn", "editDisplayMode", "enableBatchRowSelection", "enableBottomToolbar", "enableColumnActions", "enableColumnFilters", "enableColumnOrdering", "enableColumnPinning", "enableColumnResizing", "enableColumnVirtualization", "enableDensityToggle", "enableExpandAll", "enableExpanding", "enableFacetedValues", "enableFilterMatchHighlighting", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "enableGlobalFilterRankedResults", "enableGrouping", "enableHiding", "enableMultiRowSelection", "enableMultiSort", "enablePagination", "enableRowPinning", "enableRowSelection", "enableRowVirtualization", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarInternalActions", "enableTopToolbar", "filterFns", "icons", "layoutMode", "localization", "manualFiltering", "manualGrouping", "manualPagination", "manualSorting", "paginationDisplayMode", "positionActionsColumn", "positionCreatingRow", "positionExpandColumn", "positionGlobalFilter", "positionPagination", "positionToolbarAlertBanner", "positionToolbarDropZone", "rowNumberDisplayMode", "rowPinningDisplayMode", "selectAllMode", "sortingFns"]);
1215
1301
  const theme = styles.useTheme();
1216
1302
  icons = react.useMemo(() => (Object.assign(Object.assign({}, MRT_Default_Icons), icons)), [icons]);
1217
1303
  localization = react.useMemo(() => (Object.assign(Object.assign({}, MRT_Localization_EN), localization)), [localization]);
@@ -1252,6 +1338,7 @@ const useMRT_TableOptions = (_a) => {
1252
1338
  defaultColumn,
1253
1339
  defaultDisplayColumn,
1254
1340
  editDisplayMode,
1341
+ enableBatchRowSelection,
1255
1342
  enableBottomToolbar,
1256
1343
  enableColumnActions,
1257
1344
  enableColumnFilters,
@@ -1334,7 +1421,6 @@ const useMRT_Effects = (table) => {
1334
1421
  const totalColumnCount = table.options.columns.length;
1335
1422
  const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length;
1336
1423
  const rerender = react.useReducer(() => ({}), {})[1];
1337
- const isMounted = react.useRef(false);
1338
1424
  const initialBodyHeight = react.useRef();
1339
1425
  const previousTop = react.useRef();
1340
1426
  react.useEffect(() => {
@@ -1342,11 +1428,12 @@ const useMRT_Effects = (table) => {
1342
1428
  initialBodyHeight.current = document.body.style.height;
1343
1429
  }
1344
1430
  }, []);
1431
+ //hide scrollbars when table is in full screen mode, preserve body scroll position after full screen exit
1345
1432
  react.useEffect(() => {
1346
- if (isMounted && typeof window !== 'undefined') {
1433
+ if (typeof window !== 'undefined') {
1347
1434
  if (isFullScreen) {
1348
1435
  previousTop.current = document.body.getBoundingClientRect().top; //save scroll position
1349
- document.body.style.height = '100vh'; //hide page scrollbars when table is in full screen mode
1436
+ document.body.style.height = '100dvh'; //hide page scrollbars when table is in full screen mode
1350
1437
  }
1351
1438
  else {
1352
1439
  document.body.style.height = initialBodyHeight.current;
@@ -1359,8 +1446,13 @@ const useMRT_Effects = (table) => {
1359
1446
  });
1360
1447
  }
1361
1448
  }
1362
- isMounted.current = true;
1363
1449
  }, [isFullScreen]);
1450
+ //recalculate column order when columns change or features are toggled on/off
1451
+ react.useEffect(() => {
1452
+ if (totalColumnCount !== columnOrder.length) {
1453
+ table.setColumnOrder(getDefaultColumnOrderIds(table.options));
1454
+ }
1455
+ }, [totalColumnCount]);
1364
1456
  //if page index is out of bounds, set it to the last page
1365
1457
  react.useEffect(() => {
1366
1458
  if (!enablePagination || isLoading || showSkeletons)
@@ -1388,6 +1480,7 @@ const useMRT_Effects = (table) => {
1388
1480
  table.setSorting(() => appliedSort.current || []);
1389
1481
  }
1390
1482
  }, [globalFilter]);
1483
+ //fix pinned row top style when density changes
1391
1484
  react.useEffect(() => {
1392
1485
  if (enableRowPinning && getIsSomeRowsPinned()) {
1393
1486
  setTimeout(() => {
@@ -1395,12 +1488,6 @@ const useMRT_Effects = (table) => {
1395
1488
  }, 150);
1396
1489
  }
1397
1490
  }, [density]);
1398
- //recalculate column order when columns change or features are toggled on/off
1399
- react.useEffect(() => {
1400
- if (totalColumnCount !== columnOrder.length) {
1401
- table.setColumnOrder(getDefaultColumnOrderIds(table.options));
1402
- }
1403
- }, [totalColumnCount]);
1404
1491
  };
1405
1492
 
1406
1493
  /**
@@ -1410,6 +1497,7 @@ const useMRT_Effects = (table) => {
1410
1497
  */
1411
1498
  const useMRT_TableInstance = (definedTableOptions) => {
1412
1499
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
1500
+ const lastSelectedRowId = react.useRef(null);
1413
1501
  const actionCellRef = react.useRef(null);
1414
1502
  const bottomToolbarRef = react.useRef(null);
1415
1503
  const editInputRefs = react.useRef({});
@@ -1536,6 +1624,7 @@ const useMRT_TableInstance = (definedTableOptions) => {
1536
1624
  bottomToolbarRef,
1537
1625
  editInputRefs,
1538
1626
  filterInputRefs,
1627
+ lastSelectedRowId,
1539
1628
  searchInputRef,
1540
1629
  tableContainerRef,
1541
1630
  tableFooterRef,
@@ -1691,71 +1780,26 @@ const useMRT_RowVirtualizer = (table, rows) => {
1691
1780
  };
1692
1781
 
1693
1782
  const useMRT_Rows = (table, pinnedRowIds = []) => {
1694
- const { getBottomRows, getCenterRows, getPrePaginationRowModel, getRowModel, getState, getTopRows, options: { createDisplayMode, enableGlobalFilterRankedResults, enablePagination, enableRowPinning, manualExpanding, manualFiltering, manualGrouping, manualPagination, manualSorting, positionCreatingRow, rowPinningDisplayMode, }, } = table;
1783
+ const { getRowModel, getState, options: { data, enableGlobalFilterRankedResults, positionCreatingRow }, } = table;
1695
1784
  const { creatingRow, expanded, globalFilter, pagination, rowPinning, sorting, } = getState();
1696
- const shouldRankRows = react.useMemo(() => getCanRankRows(table) &&
1697
- !Object.values(sorting).some(Boolean) &&
1698
- globalFilter, [
1785
+ const rows = react.useMemo(() => getMRT_Rows(table, pinnedRowIds), [
1786
+ creatingRow,
1787
+ data,
1699
1788
  enableGlobalFilterRankedResults,
1700
1789
  expanded,
1790
+ getRowModel().rows,
1701
1791
  globalFilter,
1702
- manualExpanding,
1703
- manualFiltering,
1704
- manualGrouping,
1705
- manualSorting,
1706
- sorting,
1707
- ]);
1708
- const rows = react.useMemo(() => {
1709
- let rows = [];
1710
- if (!shouldRankRows) {
1711
- rows =
1712
- !enableRowPinning || (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky'))
1713
- ? getRowModel().rows
1714
- : getCenterRows();
1715
- }
1716
- else {
1717
- rows = getPrePaginationRowModel().rows.sort((a, b) => rankGlobalFuzzy(a, b));
1718
- if (enablePagination && !manualPagination) {
1719
- const start = pagination.pageIndex * pagination.pageSize;
1720
- rows = rows.slice(start, start + pagination.pageSize);
1721
- }
1722
- }
1723
- if (enableRowPinning && (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky'))) {
1724
- rows = [
1725
- ...getTopRows().filter((row) => !pinnedRowIds.includes(row.id)),
1726
- ...rows,
1727
- ...getBottomRows().filter((row) => !pinnedRowIds.includes(row.id)),
1728
- ];
1729
- }
1730
- if (positionCreatingRow !== undefined &&
1731
- creatingRow &&
1732
- createDisplayMode === 'row') {
1733
- const creatingRowIndex = !isNaN(+positionCreatingRow)
1734
- ? +positionCreatingRow
1735
- : positionCreatingRow === 'top'
1736
- ? 0
1737
- : rows.length;
1738
- rows = [
1739
- ...rows.slice(0, creatingRowIndex),
1740
- creatingRow,
1741
- ...rows.slice(creatingRowIndex),
1742
- ];
1743
- }
1744
- return rows;
1745
- }, [
1746
- creatingRow,
1747
1792
  pagination.pageIndex,
1748
1793
  pagination.pageSize,
1749
1794
  positionCreatingRow,
1750
1795
  rowPinning,
1751
- shouldRankRows ? getPrePaginationRowModel().rows : getRowModel().rows,
1752
- shouldRankRows,
1796
+ sorting,
1753
1797
  ]);
1754
1798
  return rows;
1755
1799
  };
1756
1800
 
1757
1801
  const allowedTypes = ['string', 'number'];
1758
- const MRT_TableBodyCellValue = ({ cell, rowRef, staticRowIndex, table, }) => {
1802
+ const MRT_TableBodyCellValue = ({ cell, rowRef, staticColumnIndex, staticRowIndex, table, }) => {
1759
1803
  var _a, _b, _c;
1760
1804
  const { getState, options: { enableFilterMatchHighlighting }, } = table;
1761
1805
  const { column, row } = cell;
@@ -1818,6 +1862,7 @@ const MRT_TableBodyCellValue = ({ cell, rowRef, staticRowIndex, table, }) => {
1818
1862
  renderedCellValue,
1819
1863
  row,
1820
1864
  rowRef,
1865
+ staticColumnIndex,
1821
1866
  staticRowIndex,
1822
1867
  table,
1823
1868
  });
@@ -2104,6 +2149,7 @@ const MRT_TableBodyCell = (_a) => {
2104
2149
  renderedCellValue: cell.renderValue(),
2105
2150
  row,
2106
2151
  rowRef,
2152
+ staticColumnIndex,
2107
2153
  staticRowIndex,
2108
2154
  table,
2109
2155
  })) : isCreating || isEditing ? (jsxRuntime.jsx(MRT_EditCellTextField, { cell: cell, table: table })) : showClickToCopyButton && columnDef.enableClickToCopy !== false ? (jsxRuntime.jsx(MRT_CopyButton, { cell: cell, table: table, children: jsxRuntime.jsx(MRT_TableBodyCellValue, Object.assign({}, cellValueProps)) })) : (jsxRuntime.jsx(MRT_TableBodyCellValue, Object.assign({}, cellValueProps))), cell.getIsGrouped() && !columnDef.GroupedCell && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [" (", (_f = row.subRows) === null || _f === void 0 ? void 0 : _f.length, ")"] }))] })) })));
@@ -2144,8 +2190,9 @@ const MRT_TableDetailPanel = (_a) => {
2144
2190
  : undefined, width: `100%` }, parseFromValuesOrFunc(tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx, theme))), children: enableRowVirtualization ? (row.getIsExpanded() && DetailPanel) : (jsxRuntime.jsx(Collapse__default["default"], { in: row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true, children: DetailPanel })) })) })));
2145
2191
  };
2146
2192
 
2147
- const MRT_TableBodyRow = ({ columnVirtualizer, numRows, pinnedRowIds, row, rowVirtualizer, staticRowIndex, table, virtualRow, }) => {
2148
- var _a, _b, _c, _d;
2193
+ const MRT_TableBodyRow = (_a) => {
2194
+ var _b, _c, _d, _f;
2195
+ var { columnVirtualizer, numRows, pinnedRowIds, row, rowVirtualizer, staticRowIndex, table, virtualRow } = _a, rest = __rest(_a, ["columnVirtualizer", "numRows", "pinnedRowIds", "row", "rowVirtualizer", "staticRowIndex", "table", "virtualRow"]);
2149
2196
  const theme = styles.useTheme();
2150
2197
  const { getState, options: { enableRowOrdering, enableRowPinning, enableStickyFooter, enableStickyHeader, layoutMode, memoMode, muiTableBodyRowProps, renderDetailPanel, rowPinningDisplayMode, }, refs: { tableFooterRef, tableHeadRef }, setHoveredRow, } = table;
2151
2198
  const { density, draggingColumn, draggingRow, editingCell, editingRow, hoveredRow, isFullScreen, rowPinning, } = getState();
@@ -2155,11 +2202,11 @@ const MRT_TableBodyRow = ({ columnVirtualizer, numRows, pinnedRowIds, row, rowVi
2155
2202
  const isRowPinned = enableRowPinning && row.getIsPinned();
2156
2203
  const isDraggingRow = (draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.id) === row.id;
2157
2204
  const isHoveredRow = (hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.id) === row.id;
2158
- const tableRowProps = parseFromValuesOrFunc(muiTableBodyRowProps, {
2205
+ const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableBodyRowProps, {
2159
2206
  row,
2160
2207
  staticRowIndex,
2161
2208
  table,
2162
- });
2209
+ })), rest);
2163
2210
  const [bottomPinnedIndex, topPinnedIndex] = react.useMemo(() => {
2164
2211
  if (!enableRowPinning ||
2165
2212
  !(rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky')) ||
@@ -2172,14 +2219,14 @@ const MRT_TableBodyRow = ({ columnVirtualizer, numRows, pinnedRowIds, row, rowVi
2172
2219
  ];
2173
2220
  }, [pinnedRowIds, rowPinning]);
2174
2221
  const tableHeadHeight = ((enableStickyHeader || isFullScreen) &&
2175
- ((_a = tableHeadRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight)) ||
2222
+ ((_b = tableHeadRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight)) ||
2176
2223
  0;
2177
- const tableFooterHeight = (enableStickyFooter && ((_b = tableFooterRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight)) || 0;
2224
+ const tableFooterHeight = (enableStickyFooter && ((_c = tableFooterRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight)) || 0;
2178
2225
  const sx = parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme);
2179
2226
  const defaultRowHeight = density === 'compact' ? 37 : density === 'comfortable' ? 53 : 69;
2180
2227
  const customRowHeight =
2181
2228
  // @ts-ignore
2182
- parseInt((_d = (_c = tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.style) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : sx === null || sx === void 0 ? void 0 : sx.height, 10) || undefined;
2229
+ parseInt((_f = (_d = tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.style) === null || _d === void 0 ? void 0 : _d.height) !== null && _f !== void 0 ? _f : sx === null || sx === void 0 ? void 0 : sx.height, 10) || undefined;
2183
2230
  const rowHeight = customRowHeight || defaultRowHeight;
2184
2231
  const handleDragEnter = (_e) => {
2185
2232
  if (enableRowOrdering && draggingRow) {
@@ -2369,8 +2416,9 @@ const MRT_TableFooterRow = (_a) => {
2369
2416
  // if no content in row, skip row
2370
2417
  if (!((_b = footerGroup.headers) === null || _b === void 0 ? void 0 : _b.some((header) => (typeof header.column.columnDef.footer === 'string' &&
2371
2418
  !!header.column.columnDef.footer) ||
2372
- header.column.columnDef.Footer)))
2419
+ header.column.columnDef.Footer))) {
2373
2420
  return null;
2421
+ }
2374
2422
  const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterRowProps, {
2375
2423
  footerGroup,
2376
2424
  table,
@@ -2612,7 +2660,7 @@ const MRT_FilterOptionMenu = (_a) => {
2612
2660
  const MRT_ColumnActionMenu = (_a) => {
2613
2661
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
2614
2662
  var { anchorEl, header, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "header", "setAnchorEl", "table"]);
2615
- const { getState, getAllLeafColumns, options: { columnFilterDisplayMode, columnFilterModeOptions, enableColumnFilterModes, enableColumnFilters, enableColumnPinning, enableColumnResizing, enableGrouping, enableHiding, enableSorting, enableSortingRemoval, icons: { ClearAllIcon, DynamicFeedIcon, FilterListIcon, FilterListOffIcon, PushPinIcon, RestartAltIcon, SortIcon, ViewColumnIcon, VisibilityOffIcon, }, localization, renderColumnActionsMenuItems, }, refs: { filterInputRefs }, setColumnFilterFns, setColumnOrder, setColumnSizingInfo, setShowColumnFilters, } = table;
2663
+ const { getAllLeafColumns, getState, options: { columnFilterDisplayMode, columnFilterModeOptions, enableColumnFilterModes, enableColumnFilters, enableColumnPinning, enableColumnResizing, enableGrouping, enableHiding, enableSorting, enableSortingRemoval, icons: { ClearAllIcon, DynamicFeedIcon, FilterListIcon, FilterListOffIcon, PushPinIcon, RestartAltIcon, SortIcon, ViewColumnIcon, VisibilityOffIcon, }, localization, renderColumnActionsMenuItems, }, refs: { filterInputRefs }, setColumnFilterFns, setColumnOrder, setColumnSizingInfo, setShowColumnFilters, } = table;
2616
2664
  const { column } = header;
2617
2665
  const { columnDef } = column;
2618
2666
  const { columnSizing, columnVisibility, density, showColumnFilters } = getState();
@@ -2860,6 +2908,7 @@ const MRT_FilterTextField = (_a) => {
2860
2908
  ? ((_a = column.getFilterValue()) === null || _a === void 0 ? void 0 : _a[rangeFilterIndex]) || ''
2861
2909
  : (_b = column.getFilterValue()) !== null && _b !== void 0 ? _b : '';
2862
2910
  });
2911
+ const [autocompleteValue, setAutocompleteValue] = react.useState(isAutocompleteFilter ? filterValue : null);
2863
2912
  const handleChangeDebounced = react.useCallback(utils.debounce((newValue) => {
2864
2913
  if (isRangeFilter) {
2865
2914
  column.setFilterValue((old) => {
@@ -2886,6 +2935,10 @@ const MRT_FilterTextField = (_a) => {
2886
2935
  handleChange(newValue);
2887
2936
  (_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.onChange) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, event);
2888
2937
  };
2938
+ const handleAutocompleteChange = (newValue) => {
2939
+ setAutocompleteValue(newValue);
2940
+ handleChange(getValueAndLabel(newValue).value);
2941
+ };
2889
2942
  const handleClear = () => {
2890
2943
  if (isMultiSelectFilter) {
2891
2944
  setFilterValue([]);
@@ -3006,10 +3059,10 @@ const MRT_FilterTextField = (_a) => {
3006
3059
  } }))) : (filterVariant === null || filterVariant === void 0 ? void 0 : filterVariant.startsWith('date')) ? (jsxRuntime.jsx(DatePicker.DatePicker, Object.assign({}, commonDatePickerProps, datePickerProps, { slotProps: {
3007
3060
  field: Object.assign({ clearable: true, onClear: () => handleClear() }, (_r = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _r === void 0 ? void 0 : _r.field),
3008
3061
  textField: Object.assign(Object.assign({}, commonTextFieldProps), (_s = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _s === void 0 ? void 0 : _s.textField),
3009
- } }))) : isAutocompleteFilter ? (jsxRuntime.jsx(Autocomplete__default["default"], Object.assign({ freeSolo: true, getOptionLabel: (option) => getValueAndLabel(option).label, onChange: (_e, newValue) => handleChange(getValueAndLabel(newValue).value), options: (_t = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option) => getValueAndLabel(option))) !== null && _t !== void 0 ? _t : [] }, autocompleteProps, { renderInput: (builtinTextFieldProps) => {
3062
+ } }))) : isAutocompleteFilter ? (jsxRuntime.jsx(Autocomplete__default["default"], Object.assign({ freeSolo: true, getOptionLabel: (option) => getValueAndLabel(option).label, onChange: (_e, newValue) => handleAutocompleteChange(newValue), options: (_t = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option) => getValueAndLabel(option))) !== null && _t !== void 0 ? _t : [] }, autocompleteProps, { renderInput: (builtinTextFieldProps) => {
3010
3063
  var _a;
3011
3064
  return (jsxRuntime.jsx(TextField__default["default"], Object.assign({}, builtinTextFieldProps, commonTextFieldProps, { InputProps: Object.assign(Object.assign({}, builtinTextFieldProps.InputProps), { startAdornment: (_a = commonTextFieldProps === null || commonTextFieldProps === void 0 ? void 0 : commonTextFieldProps.InputProps) === null || _a === void 0 ? void 0 : _a.startAdornment }), inputProps: Object.assign(Object.assign({}, builtinTextFieldProps.inputProps), commonTextFieldProps === null || commonTextFieldProps === void 0 ? void 0 : commonTextFieldProps.inputProps), onChange: handleTextFieldChange, onClick: (e) => e.stopPropagation() })));
3012
- }, value: filterValue }))) : (jsxRuntime.jsx(TextField__default["default"], Object.assign({ select: isSelectFilter || isMultiSelectFilter }, commonTextFieldProps, { SelectProps: Object.assign({ MenuProps: { disableScrollLock: true }, displayEmpty: true, multiple: isMultiSelectFilter, renderValue: isMultiSelectFilter
3065
+ }, value: autocompleteValue }))) : (jsxRuntime.jsx(TextField__default["default"], Object.assign({ select: isSelectFilter || isMultiSelectFilter }, commonTextFieldProps, { SelectProps: Object.assign({ MenuProps: { disableScrollLock: true }, displayEmpty: true, multiple: isMultiSelectFilter, renderValue: isMultiSelectFilter
3013
3066
  ? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (jsxRuntime.jsx(Box__default["default"], { sx: { opacity: 0.5 }, children: filterPlaceholder })) : (jsxRuntime.jsx(Box__default["default"], { sx: { display: 'flex', flexWrap: 'wrap', gap: '2px' }, children: selected === null || selected === void 0 ? void 0 : selected.map((value) => {
3014
3067
  const selectedValue = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.find((option) => getValueAndLabel(option).value === value);
3015
3068
  return (jsxRuntime.jsx(Chip__default["default"], { label: getValueAndLabel(selectedValue).label }, value));
@@ -3209,7 +3262,7 @@ const MRT_TableHeadCellGrabHandle = (_a) => {
3209
3262
  setDraggingColumn(null);
3210
3263
  setHoveredColumn(null);
3211
3264
  };
3212
- return (jsxRuntime.jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table }));
3265
+ return (jsxRuntime.jsx(MRT_GrabHandleButton, Object.assign({}, iconButtonProps, { onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })));
3213
3266
  };
3214
3267
 
3215
3268
  const MRT_TableHeadCellResizeHandle = (_a) => {
@@ -3431,7 +3484,7 @@ const MRT_TableHeadCell = (_a) => {
3431
3484
  whiteSpace: ((_h = (_g = columnDef.header) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) < 20
3432
3485
  ? 'nowrap'
3433
3486
  : 'normal',
3434
- }, title: columnDefType === 'data' ? columnDef.header : undefined, children: HeaderElement }), column.getCanFilter() && (jsxRuntime.jsx(MRT_TableHeadCellFilterLabel, { header: header, table: table })), column.getCanSort() && (jsxRuntime.jsx(MRT_TableHeadCellSortLabel, { header: header, table: table }))] }), columnDefType !== 'group' && (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content-Actions", sx: {
3487
+ }, children: HeaderElement }), column.getCanFilter() && (jsxRuntime.jsx(MRT_TableHeadCellFilterLabel, { header: header, table: table })), column.getCanSort() && (jsxRuntime.jsx(MRT_TableHeadCellSortLabel, { header: header, table: table }))] }), columnDefType !== 'group' && (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content-Actions", sx: {
3435
3488
  whiteSpace: 'nowrap',
3436
3489
  }, children: [showDragHandle && (jsxRuntime.jsx(MRT_TableHeadCellGrabHandle, { column: column, table: table, tableHeadCellRef: {
3437
3490
  current: tableHeadCellRefs.current[column.id],
@@ -3462,7 +3515,7 @@ const MRT_TableHeadRow = (_a) => {
3462
3515
  const MRT_ToolbarAlertBanner = (_a) => {
3463
3516
  var _b, _c, _d;
3464
3517
  var { stackAlertBanner, table } = _a, rest = __rest(_a, ["stackAlertBanner", "table"]);
3465
- const { getPrePaginationRowModel, getState, options: { enableRowSelection, enableSelectAll, localization, muiToolbarAlertBannerChipProps, muiToolbarAlertBannerProps, positionToolbarAlertBanner, renderToolbarAlertBannerContent, rowCount, }, refs: { tablePaperRef }, } = table;
3518
+ const { getFilteredSelectedRowModel, getPrePaginationRowModel, getState, options: { enableRowSelection, enableSelectAll, localization, manualPagination, muiToolbarAlertBannerChipProps, muiToolbarAlertBannerProps, positionToolbarAlertBanner, renderToolbarAlertBannerContent, rowCount, }, refs: { lastSelectedRowId, tablePaperRef }, } = table;
3466
3519
  const { density, grouping, rowSelection, showAlertBanner } = getState();
3467
3520
  const alertProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiToolbarAlertBannerProps, {
3468
3521
  table,
@@ -3470,10 +3523,14 @@ const MRT_ToolbarAlertBanner = (_a) => {
3470
3523
  const chipProps = parseFromValuesOrFunc(muiToolbarAlertBannerChipProps, {
3471
3524
  table,
3472
3525
  });
3473
- const selectedRowCount = react.useMemo(() => Object.values(rowSelection).filter(Boolean).length, [rowSelection]);
3474
- const selectedAlert = selectedRowCount > 0
3475
- ? (_c = (_b = localization.selectedCountOfRowCountRowsSelected) === null || _b === void 0 ? void 0 : _b.replace('{selectedCount}', selectedRowCount.toLocaleString())) === null || _c === void 0 ? void 0 : _c.replace('{rowCount}', (rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length).toString())
3476
- : null;
3526
+ const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length;
3527
+ const selectedRowCount = react.useMemo(() => manualPagination
3528
+ ? Object.values(rowSelection).filter(Boolean).length
3529
+ : getFilteredSelectedRowModel().rows.length, [rowSelection, totalRowCount, manualPagination]);
3530
+ const selectedAlert = selectedRowCount > 0 ? (jsxRuntime.jsxs(Stack__default["default"], { alignItems: "center", direction: "row", gap: "16px", children: [(_c = (_b = localization.selectedCountOfRowCountRowsSelected) === null || _b === void 0 ? void 0 : _b.replace('{selectedCount}', selectedRowCount.toLocaleString())) === null || _c === void 0 ? void 0 : _c.replace('{rowCount}', totalRowCount.toString()), jsxRuntime.jsx(Button__default["default"], { onClick: () => {
3531
+ table.toggleAllRowsSelected(false);
3532
+ lastSelectedRowId.current = null;
3533
+ }, size: "small", sx: { p: '2px' }, children: localization.clearSelection })] })) : null;
3477
3534
  const groupedAlert = grouping.length > 0 ? (jsxRuntime.jsxs("span", { children: [localization.groupedBy, ' ', grouping.map((columnId, index) => (jsxRuntime.jsxs(react.Fragment, { children: [index > 0 ? localization.thenBy : '', jsxRuntime.jsx(Chip__default["default"], Object.assign({ label: table.getColumn(columnId).columnDef.header, onDelete: () => table.getColumn(columnId).toggleGrouping() }, chipProps))] }, `${index}-${columnId}`)))] })) : null;
3478
3535
  return (jsxRuntime.jsx(Collapse__default["default"], { in: showAlertBanner || !!selectedAlert || !!groupedAlert, timeout: stackAlertBanner ? 200 : 0, children: jsxRuntime.jsx(Alert__default["default"], Object.assign({ color: "info", icon: false }, alertProps, { sx: (theme) => {
3479
3536
  var _a, _b;
@@ -3549,6 +3606,7 @@ const MRT_Table = (_a) => {
3549
3606
  };
3550
3607
 
3551
3608
  const MRT_TableLoadingOverlay = (_a) => {
3609
+ var _b;
3552
3610
  var { table } = _a, rest = __rest(_a, ["table"]);
3553
3611
  const { options: { localization, muiCircularProgressProps }, } = table;
3554
3612
  const circularProgressProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCircularProgressProps, { table })), rest);
@@ -3564,8 +3622,8 @@ const MRT_TableLoadingOverlay = (_a) => {
3564
3622
  right: 0,
3565
3623
  top: 0,
3566
3624
  width: '100%',
3567
- zIndex: 2,
3568
- }), children: jsxRuntime.jsx(CircularProgress__default["default"], Object.assign({ "aria-label": localization.noRecordsToDisplay, id: "mrt-progress" }, circularProgressProps)) }));
3625
+ zIndex: 3,
3626
+ }), children: (_b = circularProgressProps === null || circularProgressProps === void 0 ? void 0 : circularProgressProps.Component) !== null && _b !== void 0 ? _b : (jsxRuntime.jsx(CircularProgress__default["default"], Object.assign({ "aria-label": localization.noRecordsToDisplay, id: "mrt-progress" }, circularProgressProps))) }));
3569
3627
  };
3570
3628
 
3571
3629
  const MRT_CellActionMenu = (_a) => {
@@ -3829,7 +3887,7 @@ const MRT_ColumnPinningButtons = (_a) => {
3829
3887
 
3830
3888
  const MRT_ShowHideColumnsMenuItems = (_a) => {
3831
3889
  var _b;
3832
- var { allColumns, column, hoveredColumn, setHoveredColumn, table } = _a, rest = __rest(_a, ["allColumns", "column", "hoveredColumn", "setHoveredColumn", "table"]);
3890
+ var { allColumns, column, hoveredColumn, isNestedColumns, setHoveredColumn, table } = _a, rest = __rest(_a, ["allColumns", "column", "hoveredColumn", "isNestedColumns", "setHoveredColumn", "table"]);
3833
3891
  const { getState, options: { enableColumnOrdering, enableColumnPinning, enableHiding, localization, }, setColumnOrder, } = table;
3834
3892
  const { columnOrder } = getState();
3835
3893
  const { columnDef } = column;
@@ -3884,7 +3942,7 @@ const MRT_ShowHideColumnsMenuItems = (_a) => {
3884
3942
  gap: '8px',
3885
3943
  }, children: [columnDefType !== 'group' &&
3886
3944
  enableColumnOrdering &&
3887
- !allColumns.some((col) => col.columnDef.columnDefType === 'group') &&
3945
+ !isNestedColumns &&
3888
3946
  (columnDef.enableColumnOrdering !== false ? (jsxRuntime.jsx(MRT_GrabHandleButton, { onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })) : (jsxRuntime.jsx(Box__default["default"], { sx: { width: '28px' } }))), enableColumnPinning &&
3889
3947
  (column.getCanPin() ? (jsxRuntime.jsx(MRT_ColumnPinningButtons, { column: column, table: table })) : (jsxRuntime.jsx(Box__default["default"], { sx: { width: '70px' } }))), enableHiding ? (jsxRuntime.jsx(FormControlLabel__default["default"], { checked: switchChecked, componentsProps: {
3890
3948
  typography: {
@@ -3893,7 +3951,7 @@ const MRT_ShowHideColumnsMenuItems = (_a) => {
3893
3951
  opacity: columnDefType !== 'display' ? 1 : 0.5,
3894
3952
  },
3895
3953
  },
3896
- }, control: jsxRuntime.jsx(Tooltip__default["default"], Object.assign({}, getCommonTooltipProps(), { title: localization.toggleVisibility, children: jsxRuntime.jsx(Switch__default["default"], {}) })), disabled: !column.getCanHide(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (jsxRuntime.jsx(Typography__default["default"], { sx: { alignSelf: 'center' }, children: columnDef.header }))] }) })), (_b = column.columns) === null || _b === void 0 ? void 0 : _b.map((c, i) => (jsxRuntime.jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${i}-${c.id}`)))] }));
3954
+ }, control: jsxRuntime.jsx(Tooltip__default["default"], Object.assign({}, getCommonTooltipProps(), { title: localization.toggleVisibility, children: jsxRuntime.jsx(Switch__default["default"], {}) })), disabled: !column.getCanHide(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (jsxRuntime.jsx(Typography__default["default"], { sx: { alignSelf: 'center' }, children: columnDef.header }))] }) })), (_b = column.columns) === null || _b === void 0 ? void 0 : _b.map((c, i) => (jsxRuntime.jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, isNestedColumns: isNestedColumns, setHoveredColumn: setHoveredColumn, table: table }, `${i}-${c.id}`)))] }));
3897
3955
  };
3898
3956
 
3899
3957
  const MRT_ShowHideColumnsMenu = (_a) => {
@@ -3924,6 +3982,7 @@ const MRT_ShowHideColumnsMenu = (_a) => {
3924
3982
  getLeftLeafColumns(),
3925
3983
  getRightLeafColumns(),
3926
3984
  ]);
3985
+ const isNestedColumns = allColumns.some((col) => col.columnDef.columnDefType === 'group');
3927
3986
  const [hoveredColumn, setHoveredColumn] = react.useState(null);
3928
3987
  const theme = styles.useTheme();
3929
3988
  const { menuBackgroundColor } = getMRTTheme(table, theme);
@@ -3937,7 +3996,7 @@ const MRT_ShowHideColumnsMenu = (_a) => {
3937
3996
  justifyContent: 'space-between',
3938
3997
  p: '0.5rem',
3939
3998
  pt: 0,
3940
- }, children: [enableHiding && (jsxRuntime.jsx(Button__default["default"], { disabled: !getIsSomeColumnsVisible(), onClick: () => handleToggleAllColumns(false), children: localization.hideAll })), enableColumnOrdering && (jsxRuntime.jsx(Button__default["default"], { onClick: () => table.setColumnOrder(getDefaultColumnOrderIds(table.options, true)), children: localization.resetOrder })), enableColumnPinning && (jsxRuntime.jsx(Button__default["default"], { disabled: !getIsSomeColumnsPinned(), onClick: () => table.resetColumnPinning(true), children: localization.unpinAll })), enableHiding && (jsxRuntime.jsx(Button__default["default"], { disabled: getIsAllColumnsVisible(), onClick: () => handleToggleAllColumns(true), children: localization.showAll }))] }), jsxRuntime.jsx(Divider__default["default"], {}), allColumns.map((column, index) => (jsxRuntime.jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${index}-${column.id}`)))] })));
3999
+ }, children: [enableHiding && (jsxRuntime.jsx(Button__default["default"], { disabled: !getIsSomeColumnsVisible(), onClick: () => handleToggleAllColumns(false), children: localization.hideAll })), enableColumnOrdering && (jsxRuntime.jsx(Button__default["default"], { onClick: () => table.setColumnOrder(getDefaultColumnOrderIds(table.options, true)), children: localization.resetOrder })), enableColumnPinning && (jsxRuntime.jsx(Button__default["default"], { disabled: !getIsSomeColumnsPinned(), onClick: () => table.resetColumnPinning(true), children: localization.unpinAll })), enableHiding && (jsxRuntime.jsx(Button__default["default"], { disabled: getIsAllColumnsVisible(), onClick: () => handleToggleAllColumns(true), children: localization.showAll }))] }), jsxRuntime.jsx(Divider__default["default"], {}), allColumns.map((column, index) => (jsxRuntime.jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, hoveredColumn: hoveredColumn, isNestedColumns: isNestedColumns, setHoveredColumn: setHoveredColumn, table: table }, `${index}-${column.id}`)))] })));
3941
4000
  };
3942
4001
 
3943
4002
  const MRT_ShowHideColumnsButton = (_a) => {
@@ -4233,8 +4292,11 @@ exports.getIsFirstColumn = getIsFirstColumn;
4233
4292
  exports.getIsFirstRightPinnedColumn = getIsFirstRightPinnedColumn;
4234
4293
  exports.getIsLastColumn = getIsLastColumn;
4235
4294
  exports.getIsLastLeftPinnedColumn = getIsLastLeftPinnedColumn;
4295
+ exports.getIsRankingRows = getIsRankingRows;
4236
4296
  exports.getIsRowSelected = getIsRowSelected;
4237
4297
  exports.getLeadingDisplayColumnIds = getLeadingDisplayColumnIds;
4298
+ exports.getMRT_RowSelectionHandler = getMRT_RowSelectionHandler;
4299
+ exports.getMRT_Rows = getMRT_Rows;
4238
4300
  exports.getTotalRight = getTotalRight;
4239
4301
  exports.getTrailingDisplayColumnIds = getTrailingDisplayColumnIds;
4240
4302
  exports.isCellEditable = isCellEditable;