material-react-table 0.26.0 → 0.26.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.
@@ -217,10 +217,12 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
217
217
  disabled: !row.getCanExpand() && !renderDetailPanel,
218
218
  onClick: handleToggleExpand
219
219
  }, iconButtonProps, {
220
- sx: _extends({
221
- height: density === 'compact' ? '1.75rem' : '2.25rem',
222
- width: density === 'compact' ? '1.75rem' : '2.25rem'
223
- }, 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
+ }
224
226
  }), React.createElement(ExpandMoreIcon, {
225
227
  style: {
226
228
  transform: "rotate(" + (!row.getCanExpand() && !renderDetailPanel ? -90 : row.getIsExpanded() ? -180 : 0) + "deg)",
@@ -265,7 +267,7 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
265
267
  divider: false
266
268
  }, {
267
269
  option: 'contains',
268
- symbol: '[]',
270
+ symbol: '*',
269
271
  label: localization.filterContains,
270
272
  divider: false
271
273
  }, {
@@ -1441,11 +1443,13 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
1441
1443
  onChange: !row ? selectAllMode === 'all' ? table.getToggleAllRowsSelectedHandler() : table.getToggleAllPageRowsSelectedHandler() : row.getToggleSelectedHandler(),
1442
1444
  size: density === 'compact' ? 'small' : 'medium'
1443
1445
  }, checkboxProps, {
1444
- sx: _extends({
1445
- height: density === 'compact' ? '1.5rem' : '2rem',
1446
- width: density === 'compact' ? '1.5rem' : '2rem',
1447
- m: '-1re.m'
1448
- }, 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
+ }
1449
1453
  })));
1450
1454
  };
1451
1455
 
@@ -1796,12 +1800,14 @@ var MRT_TablePagination = function MRT_TablePagination(_ref) {
1796
1800
  showFirstButton: showFirstLastPageButtons,
1797
1801
  showLastButton: showFirstLastPageButtons
1798
1802
  }, tablePaginationProps, {
1799
- sx: _extends({
1800
- m: '0 0.5rem',
1801
- mt: position === 'top' && enableToolbarInternalActions && !showGlobalFilter ? '3.5rem' : undefined,
1802
- position: 'relative',
1803
- zIndex: 2
1804
- }, 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
+ }
1805
1811
  }));
1806
1812
  };
1807
1813
 
@@ -1843,17 +1849,19 @@ var MRT_ToolbarAlertBanner = function MRT_ToolbarAlertBanner(_ref) {
1843
1849
  color: "info",
1844
1850
  icon: false
1845
1851
  }, alertProps, {
1846
- sx: _extends({
1847
- borderRadius: 0,
1848
- fontSize: '1rem',
1849
- left: 0,
1850
- p: 0,
1851
- position: 'relative',
1852
- right: 0,
1853
- top: 0,
1854
- width: '100%',
1855
- zIndex: 2
1856
- }, 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
+ }
1857
1865
  }), (alertProps == null ? void 0 : alertProps.title) && React.createElement(AlertTitle, null, alertProps.title), React.createElement(Box, {
1858
1866
  sx: {
1859
1867
  p: '0.5rem 1rem'
@@ -1942,7 +1950,7 @@ var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
1942
1950
  top: isFullScreen ? '0' : undefined
1943
1951
  }, commonToolbarStyles({
1944
1952
  theme: theme
1945
- }), toolbarProps == null ? void 0 : toolbarProps.sx);
1953
+ }), (toolbarProps == null ? void 0 : toolbarProps.sx) instanceof Function ? toolbarProps.sx(theme) : toolbarProps == null ? void 0 : toolbarProps.sx);
1946
1954
  }
1947
1955
  }), positionToolbarAlertBanner === 'top' && React.createElement(MRT_ToolbarAlertBanner, {
1948
1956
  stackAlertBanner: stackAlertBanner,
@@ -2008,7 +2016,7 @@ var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
2008
2016
  left: 0,
2009
2017
  position: isFullScreen ? 'fixed' : 'relative',
2010
2018
  right: 0
2011
- }, toolbarProps == null ? void 0 : toolbarProps.sx);
2019
+ }, (toolbarProps == null ? void 0 : toolbarProps.sx) instanceof Function ? toolbarProps.sx(theme) : toolbarProps == null ? void 0 : toolbarProps.sx);
2012
2020
  }
2013
2021
  }), React.createElement(MRT_LinearProgressBar, {
2014
2022
  isTopToolbar: false,
@@ -2083,16 +2091,18 @@ var MRT_TableHeadCellColumnActionsButton = function MRT_TableHeadCellColumnActio
2083
2091
  onClick: handleClick,
2084
2092
  size: "small"
2085
2093
  }, iconButtonProps, {
2086
- sx: _extends({
2087
- height: '2rem',
2088
- mt: '-0.2rem',
2089
- opacity: 0.5,
2090
- transition: 'opacity 0.2s',
2091
- width: '2rem',
2092
- '&:hover': {
2093
- opacity: 1
2094
- }
2095
- }, 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
+ }
2096
2106
  }), React.createElement(MoreVertIcon, null))), React.createElement(MRT_ColumnActionMenu, {
2097
2107
  anchorEl: anchorEl,
2098
2108
  header: header,
@@ -2277,15 +2287,17 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2277
2287
  }, React.createElement(CloseIcon, null)))))
2278
2288
  }
2279
2289
  }, textFieldProps, {
2280
- sx: _extends({
2281
- m: '-0.25rem',
2282
- p: 0,
2283
- minWidth: !filterChipLabel ? '8rem' : 'auto',
2284
- width: 'calc(100% + 0.5rem)',
2285
- '& .MuiSelect-icon': {
2286
- mr: '1.5rem'
2287
- }
2288
- }, 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
+ }
2289
2301
  }), isSelectFilter && React.createElement(MenuItem, {
2290
2302
  divider: true,
2291
2303
  disabled: !filterValue,
@@ -2619,7 +2631,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
2619
2631
  userSelect: enableMultiSort && column.getCanSort() ? 'none' : undefined,
2620
2632
  verticalAlign: 'top',
2621
2633
  zIndex: column.getIsResizing() || (currentDraggingColumn == null ? void 0 : currentDraggingColumn.id) === column.id ? 3 : column.getIsPinned() && columnDefType !== 'group' ? 2 : 1
2622
- }, 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, {
2623
2635
  maxWidth: "min(" + column.getSize() + "px, fit-content)",
2624
2636
  minWidth: "max(" + column.getSize() + "px, " + ((_columnDef$minSize = columnDef.minSize) != null ? _columnDef$minSize : 30) + "px)",
2625
2637
  width: header.getSize()
@@ -2841,19 +2853,21 @@ var MRT_CopyButton = function MRT_CopyButton(_ref) {
2841
2853
  type: "button",
2842
2854
  variant: "text"
2843
2855
  }, buttonProps, {
2844
- sx: _extends({
2845
- backgroundColor: 'transparent',
2846
- border: 'none',
2847
- color: 'inherit',
2848
- cursor: 'copy',
2849
- fontFamily: 'inherit',
2850
- fontSize: 'inherit',
2851
- letterSpacing: 'inherit',
2852
- m: '-0.25rem',
2853
- minWidth: 'unset',
2854
- textAlign: 'inherit',
2855
- textTransform: 'inherit'
2856
- }, buttonProps == null ? void 0 : buttonProps.sx)
2856
+ sx: function sx(theme) {
2857
+ return _extends({
2858
+ backgroundColor: 'transparent',
2859
+ border: 'none',
2860
+ color: 'inherit',
2861
+ cursor: 'copy',
2862
+ fontFamily: 'inherit',
2863
+ fontSize: 'inherit',
2864
+ letterSpacing: 'inherit',
2865
+ m: '-0.25rem',
2866
+ minWidth: 'unset',
2867
+ textAlign: 'inherit',
2868
+ textTransform: 'inherit'
2869
+ }, (buttonProps == null ? void 0 : buttonProps.sx) instanceof Function ? buttonProps.sx(theme) : buttonProps == null ? void 0 : buttonProps.sx);
2870
+ }
2857
2871
  }), children));
2858
2872
  };
2859
2873
 
@@ -3008,7 +3022,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
3008
3022
  '&:hover': {
3009
3023
  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
3010
3024
  }
3011
- }, tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
3025
+ }, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
3012
3026
  maxWidth: "min(" + column.getSize() + "px, fit-content)",
3013
3027
  minWidth: "max(" + column.getSize() + "px, " + ((_columnDef$minSize = columnDef.minSize) != null ? _columnDef$minSize : 30) + "px)",
3014
3028
  width: column.getSize()
@@ -3059,13 +3073,15 @@ var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref) {
3059
3073
  return React.createElement(TableRow, Object.assign({}, tableRowProps), React.createElement(TableCell, Object.assign({
3060
3074
  colSpan: getVisibleLeafColumns().length
3061
3075
  }, tableCellProps, {
3062
- sx: _extends({
3063
- borderBottom: !row.getIsExpanded() ? 'none' : undefined,
3064
- pb: row.getIsExpanded() ? '1rem' : 0,
3065
- pt: row.getIsExpanded() ? '1rem' : 0,
3066
- transition: 'all 0.2s ease-in-out',
3067
- width: table.getTotalSize() + "px"
3068
- }, tableCellProps == null ? void 0 : tableCellProps.sx)
3076
+ sx: function sx(theme) {
3077
+ return _extends({
3078
+ borderBottom: !row.getIsExpanded() ? 'none' : undefined,
3079
+ pb: row.getIsExpanded() ? '1rem' : 0,
3080
+ pt: row.getIsExpanded() ? '1rem' : 0,
3081
+ transition: 'all 0.2s ease-in-out',
3082
+ width: table.getTotalSize() + "px"
3083
+ }, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx);
3084
+ }
3069
3085
  }), renderDetailPanel && React.createElement(Collapse, {
3070
3086
  "in": row.getIsExpanded()
3071
3087
  }, renderDetailPanel({
@@ -3123,7 +3139,7 @@ var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
3123
3139
  '&:hover td': {
3124
3140
  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
3125
3141
  }
3126
- }, tableRowProps == null ? void 0 : tableRowProps.sx, draggingBorders);
3142
+ }, (tableRowProps == null ? void 0 : tableRowProps.sx) instanceof Function ? tableRowProps.sx(theme) : tableRowProps == null ? void 0 : tableRowProps.sx, draggingBorders);
3127
3143
  }
3128
3144
  }), row == null ? void 0 : (_row$getVisibleCells = row.getVisibleCells()) == null ? void 0 : _row$getVisibleCells.map == null ? void 0 : _row$getVisibleCells.map(function (cell) {
3129
3145
  return React.createElement(MRT_TableBodyCell, {
@@ -3259,7 +3275,7 @@ var MRT_TableFooterCell = function MRT_TableFooterCell(_ref) {
3259
3275
  transition: "all " + (enableColumnResizing ? '10ms' : '0.2s') + " ease-in-out",
3260
3276
  width: column.getSize(),
3261
3277
  verticalAlign: 'text-top'
3262
- }, tableCellProps == null ? void 0 : tableCellProps.sx);
3278
+ }, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx);
3263
3279
  }
3264
3280
  }), React.createElement(React.Fragment, null, footer.isPlaceholder ? null : (_ref2 = (_ref3 = columnDef.Footer instanceof Function ? columnDef.Footer == null ? void 0 : columnDef.Footer({
3265
3281
  footer: footer,
@@ -3327,9 +3343,11 @@ var MRT_Table = function MRT_Table(_ref) {
3327
3343
  return React.createElement(Table, Object.assign({
3328
3344
  stickyHeader: enableStickyHeader || enableRowVirtualization || isFullScreen
3329
3345
  }, tableProps, {
3330
- sx: _extends({
3331
- tableLayout: enableColumnResizing || enableRowVirtualization ? 'fixed' : 'auto'
3332
- }, tableProps == null ? void 0 : tableProps.sx)
3346
+ sx: function sx(theme) {
3347
+ return _extends({
3348
+ tableLayout: enableColumnResizing || enableRowVirtualization ? 'fixed' : 'auto'
3349
+ }, (tableProps == null ? void 0 : tableProps.sx) instanceof Function ? tableProps.sx(theme) : tableProps == null ? void 0 : tableProps.sx);
3350
+ }
3333
3351
  }), enableTableHead && React.createElement(MRT_TableHead, {
3334
3352
  table: table
3335
3353
  }), React.createElement(MRT_TableBody, {
@@ -3371,11 +3389,13 @@ var MRT_TableContainer = function MRT_TableContainer(_ref) {
3371
3389
  return React.createElement(TableContainer, Object.assign({
3372
3390
  ref: tableContainerRef
3373
3391
  }, tableContainerProps, {
3374
- sx: _extends({
3375
- maxWidth: '100%',
3376
- maxHeight: enableStickyHeader || enableRowVirtualization ? "clamp(350px, calc(100vh - " + totalToolbarHeight + "px), 9999px)" : undefined,
3377
- overflow: 'auto'
3378
- }, tableContainerProps == null ? void 0 : tableContainerProps.sx),
3392
+ sx: function sx(theme) {
3393
+ return _extends({
3394
+ maxWidth: '100%',
3395
+ maxHeight: enableStickyHeader || enableRowVirtualization ? "clamp(350px, calc(100vh - " + totalToolbarHeight + "px), 9999px)" : undefined,
3396
+ overflow: 'auto'
3397
+ }, (tableContainerProps == null ? void 0 : tableContainerProps.sx) instanceof Function ? tableContainerProps.sx(theme) : tableContainerProps == null ? void 0 : tableContainerProps.sx);
3398
+ },
3379
3399
  style: _extends({
3380
3400
  maxHeight: isFullScreen ? "calc(100vh - " + totalToolbarHeight + "px)" : undefined
3381
3401
  }, tableContainerProps == null ? void 0 : tableContainerProps.style)