material-react-table 0.25.0 → 0.26.2

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 (36) hide show
  1. package/README.md +13 -11
  2. package/dist/{utils.d.ts → column.utils.d.ts} +1 -1
  3. package/dist/filtersFns.d.ts +22 -54
  4. package/dist/localization.d.ts +3 -0
  5. package/dist/material-react-table.cjs.development.js +188 -103
  6. package/dist/material-react-table.cjs.development.js.map +1 -1
  7. package/dist/material-react-table.cjs.production.min.js +1 -1
  8. package/dist/material-react-table.cjs.production.min.js.map +1 -1
  9. package/dist/material-react-table.esm.js +188 -103
  10. package/dist/material-react-table.esm.js.map +1 -1
  11. package/dist/table/MRT_TableRoot.d.ts +1 -1
  12. package/package.json +1 -1
  13. package/src/body/MRT_TableBodyCell.tsx +3 -1
  14. package/src/body/MRT_TableBodyRow.tsx +3 -1
  15. package/src/body/MRT_TableDetailPanel.tsx +5 -3
  16. package/src/buttons/MRT_CopyButton.tsx +5 -3
  17. package/src/buttons/MRT_ExpandButton.tsx +5 -3
  18. package/src/{utils.ts → column.utils.ts} +0 -0
  19. package/src/filtersFns.ts +47 -13
  20. package/src/footer/MRT_TableFooterCell.tsx +3 -1
  21. package/src/head/MRT_TableHeadCell.tsx +5 -1
  22. package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +5 -3
  23. package/src/head/MRT_TableHeadCellGrabHandle.tsx +1 -1
  24. package/src/inputs/MRT_FilterTextField.tsx +9 -4
  25. package/src/inputs/MRT_SelectCheckbox.tsx +5 -3
  26. package/src/localization.ts +6 -0
  27. package/src/menus/MRT_FilterOptionMenu.tsx +105 -72
  28. package/src/menus/MRT_ShowHideColumnsMenu.tsx +1 -1
  29. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +1 -1
  30. package/src/table/MRT_Table.tsx +5 -3
  31. package/src/table/MRT_TableContainer.tsx +5 -3
  32. package/src/table/MRT_TableRoot.tsx +12 -12
  33. package/src/toolbar/MRT_TablePagination.tsx +5 -3
  34. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +5 -3
  35. package/src/toolbar/MRT_ToolbarBottom.tsx +3 -1
  36. package/src/toolbar/MRT_ToolbarTop.tsx +3 -1
@@ -53,6 +53,7 @@ var MRT_DefaultLocalization_EN = {
53
53
  expand: 'Expand',
54
54
  expandAll: 'Expand all',
55
55
  filterBetween: 'Between',
56
+ filterBetweenInclusive: 'Between Inclusive',
56
57
  filterByColumn: 'Filter by {column}',
57
58
  filterContains: 'Contains',
58
59
  filterEmpty: 'Empty',
@@ -60,7 +61,9 @@ var MRT_DefaultLocalization_EN = {
60
61
  filterEquals: 'Equals',
61
62
  filterFuzzy: 'Fuzzy',
62
63
  filterGreaterThan: 'Greater Than',
64
+ filterGreaterThanOrEqualTo: 'Greater Than Or Equal To',
63
65
  filterLessThan: 'Less Than',
66
+ filterLessThanOrEqualTo: 'Less Than Or Equal To',
64
67
  filterMode: 'Filter Mode: {filterType}',
65
68
  filterNotEmpty: 'Not Empty',
66
69
  filterNotEquals: 'Not Equals',
@@ -214,10 +217,12 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
214
217
  disabled: !row.getCanExpand() && !renderDetailPanel,
215
218
  onClick: handleToggleExpand
216
219
  }, iconButtonProps, {
217
- sx: _extends({
218
- height: density === 'compact' ? '1.75rem' : '2.25rem',
219
- width: density === 'compact' ? '1.75rem' : '2.25rem'
220
- }, iconButtonProps == null ? void 0 : iconButtonProps.sx)
220
+ sx: function sx(theme) {
221
+ return _extends({
222
+ height: density === 'compact' ? '1.75rem' : '2.25rem',
223
+ width: density === 'compact' ? '1.75rem' : '2.25rem'
224
+ }, (iconButtonProps == null ? void 0 : iconButtonProps.sx) instanceof Function ? iconButtonProps.sx(theme) : iconButtonProps == null ? void 0 : iconButtonProps.sx);
225
+ }
221
226
  }), React.createElement(ExpandMoreIcon, {
222
227
  style: {
223
228
  transform: "rotate(" + (!row.getCanExpand() && !renderDetailPanel ? -90 : row.getIsExpanded() ? -180 : 0) + "deg)",
@@ -226,11 +231,6 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
226
231
  }))));
227
232
  };
228
233
 
229
- var commonMenuItemStyles = {
230
- py: '6px',
231
- my: 0,
232
- alignItems: 'center'
233
- };
234
234
  var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
235
235
  var _columnDef$enabledCol;
236
236
 
@@ -262,46 +262,72 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
262
262
  var filterOptions = useMemo(function () {
263
263
  return [{
264
264
  option: 'fuzzy',
265
+ symbol: '≈',
265
266
  label: localization.filterFuzzy,
266
267
  divider: false
267
268
  }, {
268
269
  option: 'contains',
270
+ symbol: '*',
269
271
  label: localization.filterContains,
270
272
  divider: false
271
273
  }, {
272
274
  option: 'startsWith',
275
+ symbol: 'a',
273
276
  label: localization.filterStartsWith,
274
277
  divider: false
275
278
  }, {
276
279
  option: 'endsWith',
280
+ symbol: 'z',
277
281
  label: localization.filterEndsWith,
278
282
  divider: true
279
283
  }, {
280
284
  option: 'equals',
285
+ symbol: '=',
281
286
  label: localization.filterEquals,
282
287
  divider: false
283
288
  }, {
284
289
  option: 'notEquals',
290
+ symbol: '≠',
285
291
  label: localization.filterNotEquals,
286
292
  divider: true
287
293
  }, {
288
294
  option: 'between',
295
+ symbol: '⇿',
289
296
  label: localization.filterBetween,
290
297
  divider: false
298
+ }, {
299
+ option: 'betweenInclusive',
300
+ symbol: '⬌',
301
+ label: localization.filterBetweenInclusive,
302
+ divider: true
291
303
  }, {
292
304
  option: 'greaterThan',
305
+ symbol: '>',
293
306
  label: localization.filterGreaterThan,
294
307
  divider: false
308
+ }, {
309
+ option: 'greaterThanOrEqualTo',
310
+ symbol: '≥',
311
+ label: localization.filterGreaterThanOrEqualTo,
312
+ divider: false
295
313
  }, {
296
314
  option: 'lessThan',
315
+ symbol: '<',
297
316
  label: localization.filterLessThan,
317
+ divider: false
318
+ }, {
319
+ option: 'lessThanOrEqualTo',
320
+ symbol: '≤',
321
+ label: localization.filterLessThanOrEqualTo,
298
322
  divider: true
299
323
  }, {
300
324
  option: 'empty',
325
+ symbol: '∅',
301
326
  label: localization.filterEmpty,
302
327
  divider: false
303
328
  }, {
304
329
  option: 'notEmpty',
330
+ symbol: '!∅',
305
331
  label: localization.filterNotEmpty,
306
332
  divider: false
307
333
  }].filter(function (filterType) {
@@ -349,7 +375,8 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
349
375
  }, filterOptions.map(function (_ref4, index) {
350
376
  var option = _ref4.option,
351
377
  label = _ref4.label,
352
- divider = _ref4.divider;
378
+ divider = _ref4.divider,
379
+ symbol = _ref4.symbol;
353
380
  return React.createElement(MenuItem, {
354
381
  divider: divider,
355
382
  key: index,
@@ -357,9 +384,20 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
357
384
  return handleSelectFilterType(option);
358
385
  },
359
386
  selected: option === filterOption,
360
- sx: commonMenuItemStyles,
387
+ sx: {
388
+ py: '6px',
389
+ my: 0,
390
+ alignItems: 'center',
391
+ display: 'flex',
392
+ gap: '2ch'
393
+ },
361
394
  value: option
362
- }, label);
395
+ }, React.createElement(Box, {
396
+ sx: {
397
+ fontSize: '1.25rem',
398
+ width: '2ch'
399
+ }
400
+ }, symbol), label);
363
401
  }));
364
402
  };
365
403
 
@@ -505,21 +543,37 @@ notEquals.autoRemove = function (val) {
505
543
  };
506
544
 
507
545
  var greaterThan = function greaterThan(row, id, filterValue) {
508
- return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) >= +filterValue : row.getValue(id).toString().toLowerCase().trim() > filterValue.toString().toLowerCase().trim();
546
+ return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) > +filterValue : row.getValue(id).toString().toLowerCase().trim() > filterValue.toString().toLowerCase().trim();
509
547
  };
510
548
 
511
549
  greaterThan.autoRemove = function (val) {
512
550
  return !val;
513
551
  };
514
552
 
553
+ var greaterThanOrEqualTo = function greaterThanOrEqualTo(row, id, filterValue) {
554
+ return equals(row, id, filterValue) || greaterThan(row, id, filterValue);
555
+ };
556
+
557
+ greaterThanOrEqualTo.autoRemove = function (val) {
558
+ return !val;
559
+ };
560
+
515
561
  var lessThan = function lessThan(row, id, filterValue) {
516
- return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) <= +filterValue : row.getValue(id).toString().toLowerCase().trim() < filterValue.toString().toLowerCase().trim();
562
+ return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) < +filterValue : row.getValue(id).toString().toLowerCase().trim() < filterValue.toString().toLowerCase().trim();
517
563
  };
518
564
 
519
565
  lessThan.autoRemove = function (val) {
520
566
  return !val;
521
567
  };
522
568
 
569
+ var lessThanOrEqualTo = function lessThanOrEqualTo(row, id, filterValue) {
570
+ return equals(row, id, filterValue) || lessThan(row, id, filterValue);
571
+ };
572
+
573
+ lessThanOrEqualTo.autoRemove = function (val) {
574
+ return !val;
575
+ };
576
+
523
577
  var between = function between(row, id, filterValues) {
524
578
  return (['', undefined].includes(filterValues[0]) || greaterThan(row, id, filterValues[0])) && (!isNaN(+filterValues[0]) && !isNaN(+filterValues[1]) && +filterValues[0] > +filterValues[1] || ['', undefined].includes(filterValues[1]) || lessThan(row, id, filterValues[1]));
525
579
  };
@@ -528,6 +582,14 @@ between.autoRemove = function (val) {
528
582
  return !val;
529
583
  };
530
584
 
585
+ var betweenInclusive = function betweenInclusive(row, id, filterValues) {
586
+ return (['', undefined].includes(filterValues[0]) || greaterThanOrEqualTo(row, id, filterValues[0])) && (!isNaN(+filterValues[0]) && !isNaN(+filterValues[1]) && +filterValues[0] > +filterValues[1] || ['', undefined].includes(filterValues[1]) || lessThanOrEqualTo(row, id, filterValues[1]));
587
+ };
588
+
589
+ betweenInclusive.autoRemove = function (val) {
590
+ return !val;
591
+ };
592
+
531
593
  var empty = function empty(row, id, _filterValue) {
532
594
  return !row.getValue(id).toString().trim();
533
595
  };
@@ -546,13 +608,16 @@ notEmpty.autoRemove = function (val) {
546
608
 
547
609
  var MRT_FilterFns = /*#__PURE__*/_extends({}, filterFns, {
548
610
  between: between,
611
+ betweenInclusive: betweenInclusive,
549
612
  contains: contains,
550
613
  empty: empty,
551
614
  endsWith: endsWith,
552
615
  equals: equals,
553
616
  fuzzy: fuzzy,
554
617
  greaterThan: greaterThan,
618
+ greaterThanOrEqualTo: greaterThanOrEqualTo,
555
619
  lessThan: lessThan,
620
+ lessThanOrEqualTo: lessThanOrEqualTo,
556
621
  notEmpty: notEmpty,
557
622
  notEquals: notEquals,
558
623
  startsWith: startsWith
@@ -904,7 +969,7 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
904
969
  }));
905
970
  };
906
971
 
907
- var commonMenuItemStyles$1 = {
972
+ var commonMenuItemStyles = {
908
973
  py: '6px',
909
974
  my: 0,
910
975
  justifyContent: 'space-between',
@@ -1048,14 +1113,14 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1048
1113
  disabled: !column.getIsSorted(),
1049
1114
  key: 0,
1050
1115
  onClick: handleClearSort,
1051
- sx: commonMenuItemStyles$1
1116
+ sx: commonMenuItemStyles
1052
1117
  }, React.createElement(Box, {
1053
1118
  sx: commonListItemStyles
1054
1119
  }, React.createElement(ListItemIcon, null, React.createElement(ClearAllIcon, null)), localization.clearSort)), React.createElement(MenuItem, {
1055
1120
  disabled: column.getIsSorted() === 'asc',
1056
1121
  key: 1,
1057
1122
  onClick: handleSortAsc,
1058
- sx: commonMenuItemStyles$1
1123
+ sx: commonMenuItemStyles
1059
1124
  }, React.createElement(Box, {
1060
1125
  sx: commonListItemStyles
1061
1126
  }, React.createElement(ListItemIcon, null, React.createElement(SortIcon, null)), (_localization$sortByC = localization.sortByColumnAsc) == null ? void 0 : _localization$sortByC.replace('{column}', String(columnDef.header)))), React.createElement(MenuItem, {
@@ -1063,7 +1128,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1063
1128
  key: 2,
1064
1129
  disabled: column.getIsSorted() === 'desc',
1065
1130
  onClick: handleSortDesc,
1066
- sx: commonMenuItemStyles$1
1131
+ sx: commonMenuItemStyles
1067
1132
  }, React.createElement(Box, {
1068
1133
  sx: commonListItemStyles
1069
1134
  }, React.createElement(ListItemIcon, null, React.createElement(SortIcon, {
@@ -1074,14 +1139,14 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1074
1139
  disabled: !column.getFilterValue(),
1075
1140
  key: 0,
1076
1141
  onClick: handleClearFilter,
1077
- sx: commonMenuItemStyles$1
1142
+ sx: commonMenuItemStyles
1078
1143
  }, React.createElement(Box, {
1079
1144
  sx: commonListItemStyles
1080
1145
  }, React.createElement(ListItemIcon, null, React.createElement(FilterListOffIcon, null)), localization.clearFilter)), React.createElement(MenuItem, {
1081
1146
  divider: enableGrouping || enableHiding,
1082
1147
  key: 1,
1083
1148
  onClick: handleFilterByColumn,
1084
- sx: commonMenuItemStyles$1
1149
+ sx: commonMenuItemStyles
1085
1150
  }, React.createElement(Box, {
1086
1151
  sx: commonListItemStyles
1087
1152
  }, React.createElement(ListItemIcon, null, React.createElement(FilterListIcon, null)), (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(columnDef.header))), showFilterModeSubMenu && React.createElement(IconButton, {
@@ -1102,7 +1167,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1102
1167
  divider: enablePinning,
1103
1168
  key: 0,
1104
1169
  onClick: handleGroupByColumn,
1105
- sx: commonMenuItemStyles$1
1170
+ sx: commonMenuItemStyles
1106
1171
  }, React.createElement(Box, {
1107
1172
  sx: commonListItemStyles
1108
1173
  }, React.createElement(ListItemIcon, null, React.createElement(DynamicFeedIcon, null)), (_localization = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) == null ? void 0 : _localization.replace('{column}', String(columnDef.header))))], enablePinning && column.getCanPin() && [React.createElement(MenuItem, {
@@ -1111,7 +1176,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1111
1176
  onClick: function onClick() {
1112
1177
  return handlePinColumn('left');
1113
1178
  },
1114
- sx: commonMenuItemStyles$1
1179
+ sx: commonMenuItemStyles
1115
1180
  }, React.createElement(Box, {
1116
1181
  sx: commonListItemStyles
1117
1182
  }, React.createElement(ListItemIcon, null, React.createElement(PushPinIcon, {
@@ -1124,7 +1189,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1124
1189
  onClick: function onClick() {
1125
1190
  return handlePinColumn('right');
1126
1191
  },
1127
- sx: commonMenuItemStyles$1
1192
+ sx: commonMenuItemStyles
1128
1193
  }, React.createElement(Box, {
1129
1194
  sx: commonListItemStyles
1130
1195
  }, React.createElement(ListItemIcon, null, React.createElement(PushPinIcon, {
@@ -1138,21 +1203,21 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1138
1203
  onClick: function onClick() {
1139
1204
  return handlePinColumn(false);
1140
1205
  },
1141
- sx: commonMenuItemStyles$1
1206
+ sx: commonMenuItemStyles
1142
1207
  }, React.createElement(Box, {
1143
1208
  sx: commonListItemStyles
1144
1209
  }, React.createElement(ListItemIcon, null, React.createElement(PushPinIcon, null)), localization.unpin))], enableColumnResizing && column.getCanResize() && [React.createElement(MenuItem, {
1145
1210
  disabled: !columnSizing[column.id],
1146
1211
  key: 0,
1147
1212
  onClick: handleResetColumnSize,
1148
- sx: commonMenuItemStyles$1
1213
+ sx: commonMenuItemStyles
1149
1214
  }, React.createElement(Box, {
1150
1215
  sx: commonListItemStyles
1151
1216
  }, React.createElement(ListItemIcon, null, React.createElement(RestartAltIcon, null)), localization.resetColumnSize))], enableHiding && [React.createElement(MenuItem, {
1152
1217
  disabled: columnDef.enableHiding === false,
1153
1218
  key: 0,
1154
1219
  onClick: handleHideColumn,
1155
- sx: commonMenuItemStyles$1
1220
+ sx: commonMenuItemStyles
1156
1221
  }, React.createElement(Box, {
1157
1222
  sx: commonListItemStyles
1158
1223
  }, React.createElement(ListItemIcon, null, React.createElement(VisibilityOffIcon, null)), (_localization$hideCol = localization.hideColumn) == null ? void 0 : _localization$hideCol.replace('{column}', String(columnDef.header)))), React.createElement(MenuItem, {
@@ -1161,7 +1226,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1161
1226
  }).length,
1162
1227
  key: 1,
1163
1228
  onClick: handleShowAllColumns,
1164
- sx: commonMenuItemStyles$1
1229
+ sx: commonMenuItemStyles
1165
1230
  }, React.createElement(Box, {
1166
1231
  sx: commonListItemStyles
1167
1232
  }, React.createElement(ListItemIcon, null, React.createElement(ViewColumnIcon, null)), (_localization$showAll = localization.showAllColumns) == null ? void 0 : _localization$showAll.replace('{column}', String(columnDef.header))), React.createElement(IconButton, {
@@ -1207,7 +1272,7 @@ var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
1207
1272
  }
1208
1273
  }, enableEditing && React.createElement(MenuItem, {
1209
1274
  onClick: handleEdit,
1210
- sx: commonMenuItemStyles$1
1275
+ sx: commonMenuItemStyles
1211
1276
  }, React.createElement(Box, {
1212
1277
  sx: commonListItemStyles
1213
1278
  }, React.createElement(ListItemIcon, null, React.createElement(EditIcon, null)), localization.edit)), renderRowActionMenuItems == null ? void 0 : renderRowActionMenuItems({
@@ -1378,11 +1443,13 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
1378
1443
  onChange: !row ? selectAllMode === 'all' ? table.getToggleAllRowsSelectedHandler() : table.getToggleAllPageRowsSelectedHandler() : row.getToggleSelectedHandler(),
1379
1444
  size: density === 'compact' ? 'small' : 'medium'
1380
1445
  }, checkboxProps, {
1381
- sx: _extends({
1382
- height: density === 'compact' ? '1.5rem' : '2rem',
1383
- width: density === 'compact' ? '1.5rem' : '2rem',
1384
- m: '-1re.m'
1385
- }, checkboxProps == null ? void 0 : checkboxProps.sx)
1446
+ sx: function sx(theme) {
1447
+ return _extends({
1448
+ height: density === 'compact' ? '1.5rem' : '2rem',
1449
+ width: density === 'compact' ? '1.5rem' : '2rem',
1450
+ m: '-1re.m'
1451
+ }, (checkboxProps == null ? void 0 : checkboxProps.sx) instanceof Function ? checkboxProps.sx(theme) : checkboxProps == null ? void 0 : checkboxProps.sx);
1452
+ }
1386
1453
  })));
1387
1454
  };
1388
1455
 
@@ -1733,12 +1800,14 @@ var MRT_TablePagination = function MRT_TablePagination(_ref) {
1733
1800
  showFirstButton: showFirstLastPageButtons,
1734
1801
  showLastButton: showFirstLastPageButtons
1735
1802
  }, tablePaginationProps, {
1736
- sx: _extends({
1737
- m: '0 0.5rem',
1738
- mt: position === 'top' && enableToolbarInternalActions && !showGlobalFilter ? '3.5rem' : undefined,
1739
- position: 'relative',
1740
- zIndex: 2
1741
- }, tablePaginationProps == null ? void 0 : tablePaginationProps.sx)
1803
+ sx: function sx(theme) {
1804
+ return _extends({
1805
+ m: '0 0.5rem',
1806
+ mt: position === 'top' && enableToolbarInternalActions && !showGlobalFilter ? '3.5rem' : undefined,
1807
+ position: 'relative',
1808
+ zIndex: 2
1809
+ }, (tablePaginationProps == null ? void 0 : tablePaginationProps.sx) instanceof Function ? tablePaginationProps.sx(theme) : tablePaginationProps == null ? void 0 : tablePaginationProps.sx);
1810
+ }
1742
1811
  }));
1743
1812
  };
1744
1813
 
@@ -1780,17 +1849,19 @@ var MRT_ToolbarAlertBanner = function MRT_ToolbarAlertBanner(_ref) {
1780
1849
  color: "info",
1781
1850
  icon: false
1782
1851
  }, alertProps, {
1783
- sx: _extends({
1784
- borderRadius: 0,
1785
- fontSize: '1rem',
1786
- left: 0,
1787
- p: 0,
1788
- position: 'relative',
1789
- right: 0,
1790
- top: 0,
1791
- width: '100%',
1792
- zIndex: 2
1793
- }, alertProps == null ? void 0 : alertProps.sx)
1852
+ sx: function sx(theme) {
1853
+ return _extends({
1854
+ borderRadius: 0,
1855
+ fontSize: '1rem',
1856
+ left: 0,
1857
+ p: 0,
1858
+ position: 'relative',
1859
+ right: 0,
1860
+ top: 0,
1861
+ width: '100%',
1862
+ zIndex: 2
1863
+ }, (alertProps == null ? void 0 : alertProps.sx) instanceof Function ? alertProps.sx(theme) : alertProps == null ? void 0 : alertProps.sx);
1864
+ }
1794
1865
  }), (alertProps == null ? void 0 : alertProps.title) && React.createElement(AlertTitle, null, alertProps.title), React.createElement(Box, {
1795
1866
  sx: {
1796
1867
  p: '0.5rem 1rem'
@@ -1879,7 +1950,7 @@ var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
1879
1950
  top: isFullScreen ? '0' : undefined
1880
1951
  }, commonToolbarStyles({
1881
1952
  theme: theme
1882
- }), toolbarProps == null ? void 0 : toolbarProps.sx);
1953
+ }), (toolbarProps == null ? void 0 : toolbarProps.sx) instanceof Function ? toolbarProps.sx(theme) : toolbarProps == null ? void 0 : toolbarProps.sx);
1883
1954
  }
1884
1955
  }), positionToolbarAlertBanner === 'top' && React.createElement(MRT_ToolbarAlertBanner, {
1885
1956
  stackAlertBanner: stackAlertBanner,
@@ -1945,7 +2016,7 @@ var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
1945
2016
  left: 0,
1946
2017
  position: isFullScreen ? 'fixed' : 'relative',
1947
2018
  right: 0
1948
- }, toolbarProps == null ? void 0 : toolbarProps.sx);
2019
+ }, (toolbarProps == null ? void 0 : toolbarProps.sx) instanceof Function ? toolbarProps.sx(theme) : toolbarProps == null ? void 0 : toolbarProps.sx);
1949
2020
  }
1950
2021
  }), React.createElement(MRT_LinearProgressBar, {
1951
2022
  isTopToolbar: false,
@@ -2020,16 +2091,18 @@ var MRT_TableHeadCellColumnActionsButton = function MRT_TableHeadCellColumnActio
2020
2091
  onClick: handleClick,
2021
2092
  size: "small"
2022
2093
  }, iconButtonProps, {
2023
- sx: _extends({
2024
- height: '2rem',
2025
- mt: '-0.2rem',
2026
- opacity: 0.5,
2027
- transition: 'opacity 0.2s',
2028
- width: '2rem',
2029
- '&:hover': {
2030
- opacity: 1
2031
- }
2032
- }, iconButtonProps.sx)
2094
+ sx: function sx(theme) {
2095
+ return _extends({
2096
+ height: '2rem',
2097
+ mt: '-0.2rem',
2098
+ opacity: 0.5,
2099
+ transition: 'opacity 0.2s',
2100
+ width: '2rem',
2101
+ '&:hover': {
2102
+ opacity: 1
2103
+ }
2104
+ }, (iconButtonProps == null ? void 0 : iconButtonProps.sx) instanceof Function ? iconButtonProps.sx(theme) : iconButtonProps == null ? void 0 : iconButtonProps.sx);
2105
+ }
2033
2106
  }), React.createElement(MoreVertIcon, null))), React.createElement(MRT_ColumnActionMenu, {
2034
2107
  anchorEl: anchorEl,
2035
2108
  header: header,
@@ -2214,15 +2287,17 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2214
2287
  }, React.createElement(CloseIcon, null)))))
2215
2288
  }
2216
2289
  }, textFieldProps, {
2217
- sx: _extends({
2218
- m: '-0.25rem',
2219
- p: 0,
2220
- minWidth: !filterChipLabel ? '8rem' : 'auto',
2221
- width: 'calc(100% + 0.5rem)',
2222
- '& .MuiSelect-icon': {
2223
- mr: '1.5rem'
2224
- }
2225
- }, textFieldProps == null ? void 0 : textFieldProps.sx)
2290
+ sx: function sx(theme) {
2291
+ return _extends({
2292
+ m: '-0.25rem',
2293
+ p: 0,
2294
+ minWidth: !filterChipLabel ? '8rem' : 'auto',
2295
+ width: 'calc(100% + 0.5rem)',
2296
+ '& .MuiSelect-icon': {
2297
+ mr: '1.5rem'
2298
+ }
2299
+ }, (textFieldProps == null ? void 0 : textFieldProps.sx) instanceof Function ? textFieldProps.sx(theme) : textFieldProps == null ? void 0 : textFieldProps.sx);
2300
+ }
2226
2301
  }), isSelectFilter && React.createElement(MenuItem, {
2227
2302
  divider: true,
2228
2303
  disabled: !filterValue,
@@ -2556,7 +2631,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
2556
2631
  userSelect: enableMultiSort && column.getCanSort() ? 'none' : undefined,
2557
2632
  verticalAlign: 'top',
2558
2633
  zIndex: column.getIsResizing() || (currentDraggingColumn == null ? void 0 : currentDraggingColumn.id) === column.id ? 3 : column.getIsPinned() && columnDefType !== 'group' ? 2 : 1
2559
- }, tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
2634
+ }, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
2560
2635
  maxWidth: "min(" + column.getSize() + "px, fit-content)",
2561
2636
  minWidth: "max(" + column.getSize() + "px, " + ((_columnDef$minSize = columnDef.minSize) != null ? _columnDef$minSize : 30) + "px)",
2562
2637
  width: header.getSize()
@@ -2577,6 +2652,8 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
2577
2652
  cursor: column.getCanSort() && columnDefType !== 'group' ? 'pointer' : undefined,
2578
2653
  display: 'flex',
2579
2654
  flexWrap: 'nowrap',
2655
+ m: (tableCellProps == null ? void 0 : tableCellProps.align) === 'center' ? 'auto' : undefined,
2656
+ pl: (tableCellProps == null ? void 0 : tableCellProps.align) === 'center' ? '1rem' : undefined,
2580
2657
  whiteSpace: ((_columnDef$header$len = (_columnDef$header = columnDef.header) == null ? void 0 : _columnDef$header.length) != null ? _columnDef$header$len : 0) < 24 ? 'nowrap' : 'normal'
2581
2658
  }
2582
2659
  }, headerElement, column.getCanSort() && React.createElement(MRT_TableHeadCellSortLabel, {
@@ -2778,19 +2855,21 @@ var MRT_CopyButton = function MRT_CopyButton(_ref) {
2778
2855
  type: "button",
2779
2856
  variant: "text"
2780
2857
  }, buttonProps, {
2781
- sx: _extends({
2782
- backgroundColor: 'transparent',
2783
- border: 'none',
2784
- color: 'inherit',
2785
- cursor: 'copy',
2786
- fontFamily: 'inherit',
2787
- fontSize: 'inherit',
2788
- letterSpacing: 'inherit',
2789
- m: '-0.25rem',
2790
- minWidth: 'unset',
2791
- textAlign: 'inherit',
2792
- textTransform: 'inherit'
2793
- }, buttonProps == null ? void 0 : buttonProps.sx)
2858
+ sx: function sx(theme) {
2859
+ return _extends({
2860
+ backgroundColor: 'transparent',
2861
+ border: 'none',
2862
+ color: 'inherit',
2863
+ cursor: 'copy',
2864
+ fontFamily: 'inherit',
2865
+ fontSize: 'inherit',
2866
+ letterSpacing: 'inherit',
2867
+ m: '-0.25rem',
2868
+ minWidth: 'unset',
2869
+ textAlign: 'inherit',
2870
+ textTransform: 'inherit'
2871
+ }, (buttonProps == null ? void 0 : buttonProps.sx) instanceof Function ? buttonProps.sx(theme) : buttonProps == null ? void 0 : buttonProps.sx);
2872
+ }
2794
2873
  }), children));
2795
2874
  };
2796
2875
 
@@ -2945,7 +3024,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
2945
3024
  '&:hover': {
2946
3025
  backgroundColor: enableHover && enableEditing && editingMode !== 'row' ? theme.palette.mode === 'dark' ? lighten(theme.palette.background["default"], 0.13) + " !important" : darken(theme.palette.background["default"], 0.07) + " !important" : undefined
2947
3026
  }
2948
- }, tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
3027
+ }, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
2949
3028
  maxWidth: "min(" + column.getSize() + "px, fit-content)",
2950
3029
  minWidth: "max(" + column.getSize() + "px, " + ((_columnDef$minSize = columnDef.minSize) != null ? _columnDef$minSize : 30) + "px)",
2951
3030
  width: column.getSize()
@@ -2996,13 +3075,15 @@ var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref) {
2996
3075
  return React.createElement(TableRow, Object.assign({}, tableRowProps), React.createElement(TableCell, Object.assign({
2997
3076
  colSpan: getVisibleLeafColumns().length
2998
3077
  }, tableCellProps, {
2999
- sx: _extends({
3000
- borderBottom: !row.getIsExpanded() ? 'none' : undefined,
3001
- pb: row.getIsExpanded() ? '1rem' : 0,
3002
- pt: row.getIsExpanded() ? '1rem' : 0,
3003
- transition: 'all 0.2s ease-in-out',
3004
- width: table.getTotalSize() + "px"
3005
- }, tableCellProps == null ? void 0 : tableCellProps.sx)
3078
+ sx: function sx(theme) {
3079
+ return _extends({
3080
+ borderBottom: !row.getIsExpanded() ? 'none' : undefined,
3081
+ pb: row.getIsExpanded() ? '1rem' : 0,
3082
+ pt: row.getIsExpanded() ? '1rem' : 0,
3083
+ transition: 'all 0.2s ease-in-out',
3084
+ width: table.getTotalSize() + "px"
3085
+ }, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx);
3086
+ }
3006
3087
  }), renderDetailPanel && React.createElement(Collapse, {
3007
3088
  "in": row.getIsExpanded()
3008
3089
  }, renderDetailPanel({
@@ -3060,7 +3141,7 @@ var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
3060
3141
  '&:hover td': {
3061
3142
  backgroundColor: (tableRowProps == null ? void 0 : tableRowProps.hover) !== false && getIsSomeColumnsPinned() ? theme.palette.mode === 'dark' ? "" + lighten(theme.palette.background["default"], 0.12) : "" + darken(theme.palette.background["default"], 0.05) : undefined
3062
3143
  }
3063
- }, tableRowProps == null ? void 0 : tableRowProps.sx, draggingBorders);
3144
+ }, (tableRowProps == null ? void 0 : tableRowProps.sx) instanceof Function ? tableRowProps.sx(theme) : tableRowProps == null ? void 0 : tableRowProps.sx, draggingBorders);
3064
3145
  }
3065
3146
  }), row == null ? void 0 : (_row$getVisibleCells = row.getVisibleCells()) == null ? void 0 : _row$getVisibleCells.map == null ? void 0 : _row$getVisibleCells.map(function (cell) {
3066
3147
  return React.createElement(MRT_TableBodyCell, {
@@ -3196,7 +3277,7 @@ var MRT_TableFooterCell = function MRT_TableFooterCell(_ref) {
3196
3277
  transition: "all " + (enableColumnResizing ? '10ms' : '0.2s') + " ease-in-out",
3197
3278
  width: column.getSize(),
3198
3279
  verticalAlign: 'text-top'
3199
- }, tableCellProps == null ? void 0 : tableCellProps.sx);
3280
+ }, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx);
3200
3281
  }
3201
3282
  }), React.createElement(React.Fragment, null, footer.isPlaceholder ? null : (_ref2 = (_ref3 = columnDef.Footer instanceof Function ? columnDef.Footer == null ? void 0 : columnDef.Footer({
3202
3283
  footer: footer,
@@ -3264,9 +3345,11 @@ var MRT_Table = function MRT_Table(_ref) {
3264
3345
  return React.createElement(Table, Object.assign({
3265
3346
  stickyHeader: enableStickyHeader || enableRowVirtualization || isFullScreen
3266
3347
  }, tableProps, {
3267
- sx: _extends({
3268
- tableLayout: enableColumnResizing || enableRowVirtualization ? 'fixed' : 'auto'
3269
- }, tableProps == null ? void 0 : tableProps.sx)
3348
+ sx: function sx(theme) {
3349
+ return _extends({
3350
+ tableLayout: enableColumnResizing || enableRowVirtualization ? 'fixed' : 'auto'
3351
+ }, (tableProps == null ? void 0 : tableProps.sx) instanceof Function ? tableProps.sx(theme) : tableProps == null ? void 0 : tableProps.sx);
3352
+ }
3270
3353
  }), enableTableHead && React.createElement(MRT_TableHead, {
3271
3354
  table: table
3272
3355
  }), React.createElement(MRT_TableBody, {
@@ -3308,11 +3391,13 @@ var MRT_TableContainer = function MRT_TableContainer(_ref) {
3308
3391
  return React.createElement(TableContainer, Object.assign({
3309
3392
  ref: tableContainerRef
3310
3393
  }, tableContainerProps, {
3311
- sx: _extends({
3312
- maxWidth: '100%',
3313
- maxHeight: enableStickyHeader || enableRowVirtualization ? "clamp(350px, calc(100vh - " + totalToolbarHeight + "px), 9999px)" : undefined,
3314
- overflow: 'auto'
3315
- }, tableContainerProps == null ? void 0 : tableContainerProps.sx),
3394
+ sx: function sx(theme) {
3395
+ return _extends({
3396
+ maxWidth: '100%',
3397
+ maxHeight: enableStickyHeader || enableRowVirtualization ? "clamp(350px, calc(100vh - " + totalToolbarHeight + "px), 9999px)" : undefined,
3398
+ overflow: 'auto'
3399
+ }, (tableContainerProps == null ? void 0 : tableContainerProps.sx) instanceof Function ? tableContainerProps.sx(theme) : tableContainerProps == null ? void 0 : tableContainerProps.sx);
3400
+ },
3316
3401
  style: _extends({
3317
3402
  maxHeight: isFullScreen ? "calc(100vh - " + totalToolbarHeight + "px)" : undefined
3318
3403
  }, tableContainerProps == null ? void 0 : tableContainerProps.style)