material-react-table 0.26.6 → 0.27.0

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.
@@ -175,7 +175,8 @@ var MRT_ExpandAllButton = function MRT_ExpandAllButton(_ref) {
175
175
  }, iconButtonProps, {
176
176
  sx: _extends({
177
177
  height: density === 'compact' ? '1.75rem' : '2.25rem',
178
- width: density === 'compact' ? '1.75rem' : '2.25rem'
178
+ width: density === 'compact' ? '1.75rem' : '2.25rem',
179
+ mt: density !== 'compact' ? '-0.25rem' : undefined
179
180
  }, iconButtonProps == null ? void 0 : iconButtonProps.sx)
180
181
  }), React.createElement(KeyboardDoubleArrowDownIcon, {
181
182
  style: {
@@ -232,7 +233,7 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
232
233
  };
233
234
 
234
235
  var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
235
- var _columnDef$enabledCol;
236
+ var _columnDef$columnFilt;
236
237
 
237
238
  var anchorEl = _ref.anchorEl,
238
239
  header = _ref.header,
@@ -242,7 +243,7 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
242
243
  var getState = table.getState,
243
244
  _table$options = table.options,
244
245
  enabledGlobalFilterOptions = _table$options.enabledGlobalFilterOptions,
245
- enabledColumnFilterOptions = _table$options.enabledColumnFilterOptions,
246
+ columnFilterModeOptions = _table$options.columnFilterModeOptions,
246
247
  localization = _table$options.localization,
247
248
  setCurrentFilterFns = table.setCurrentFilterFns,
248
249
  setCurrentGlobalFilterFn = table.setCurrentGlobalFilterFn;
@@ -258,7 +259,7 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
258
259
  var _ref3 = column != null ? column : {},
259
260
  columnDef = _ref3.columnDef;
260
261
 
261
- var allowedColumnFilterOptions = (_columnDef$enabledCol = columnDef == null ? void 0 : columnDef.enabledColumnFilterOptions) != null ? _columnDef$enabledCol : enabledColumnFilterOptions;
262
+ var allowedColumnFilterOptions = (_columnDef$columnFilt = columnDef == null ? void 0 : columnDef.columnFilterModeOptions) != null ? _columnDef$columnFilt : columnFilterModeOptions;
262
263
  var filterOptions = useMemo(function () {
263
264
  return [{
264
265
  option: 'fuzzy',
@@ -980,7 +981,7 @@ var commonListItemStyles = {
980
981
  alignItems: 'center'
981
982
  };
982
983
  var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
983
- var _columnDef$enabledCol, _localization$sortByC, _localization$sortByC2, _localization$filterB, _localization, _localization$hideCol, _localization$showAll;
984
+ var _columnDef$columnFilt, _localization$sortByC, _localization$sortByC2, _localization$filterB, _localization, _localization$hideCol, _localization$showAll;
984
985
 
985
986
  var anchorEl = _ref.anchorEl,
986
987
  header = _ref.header,
@@ -997,7 +998,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
997
998
  enableHiding = _table$options.enableHiding,
998
999
  enablePinning = _table$options.enablePinning,
999
1000
  enableSorting = _table$options.enableSorting,
1000
- enabledColumnFilterOptions = _table$options.enabledColumnFilterOptions,
1001
+ columnFilterModeOptions = _table$options.columnFilterModeOptions,
1001
1002
  _table$options$icons = _table$options.icons,
1002
1003
  ArrowRightIcon = _table$options$icons.ArrowRightIcon,
1003
1004
  ClearAllIcon = _table$options$icons.ClearAllIcon,
@@ -1098,7 +1099,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1098
1099
  };
1099
1100
 
1100
1101
  var isSelectFilter = !!columnDef.filterSelectOptions;
1101
- var allowedColumnFilterOptions = (_columnDef$enabledCol = columnDef == null ? void 0 : columnDef.enabledColumnFilterOptions) != null ? _columnDef$enabledCol : enabledColumnFilterOptions;
1102
+ var allowedColumnFilterOptions = (_columnDef$columnFilt = columnDef == null ? void 0 : columnDef.columnFilterModeOptions) != null ? _columnDef$columnFilt : columnFilterModeOptions;
1102
1103
  var showFilterModeSubMenu = enableColumnFilterChangeMode && columnDef.enableColumnFilterChangeMode !== false && !isSelectFilter && (allowedColumnFilterOptions === undefined || !!(allowedColumnFilterOptions != null && allowedColumnFilterOptions.length));
1103
1104
  return React.createElement(Menu, {
1104
1105
  anchorEl: anchorEl,
@@ -1445,9 +1446,9 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
1445
1446
  }, checkboxProps, {
1446
1447
  sx: function sx(theme) {
1447
1448
  return _extends({
1448
- height: density === 'compact' ? '1.5rem' : '2rem',
1449
- width: density === 'compact' ? '1.5rem' : '2rem',
1450
- m: '-1re.m'
1449
+ height: density === 'compact' ? '1.75rem' : '2.5rem',
1450
+ width: density === 'compact' ? '1.75rem' : '2.5rem',
1451
+ m: density !== 'compact' ? '-0.4rem' : undefined
1451
1452
  }, (checkboxProps == null ? void 0 : checkboxProps.sx) instanceof Function ? checkboxProps.sx(theme) : checkboxProps == null ? void 0 : checkboxProps.sx);
1452
1453
  }
1453
1454
  })));
@@ -2113,7 +2114,7 @@ var MRT_TableHeadCellColumnActionsButton = function MRT_TableHeadCellColumnActio
2113
2114
  };
2114
2115
 
2115
2116
  var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2116
- var _currentFilterOption$, _localization$filterB, _columnDef$enabledCol, _currentFilterOption$2, _localization$clearFi, _columnDef$filterSele;
2117
+ var _currentFilterOption$, _localization$filterB, _columnDef$columnFilt, _currentFilterOption$2, _localization$clearFi, _columnDef$filterSele;
2117
2118
 
2118
2119
  var header = _ref.header,
2119
2120
  inputIndex = _ref.inputIndex,
@@ -2121,7 +2122,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2121
2122
  var getState = table.getState,
2122
2123
  _table$options = table.options,
2123
2124
  enableColumnFilterChangeMode = _table$options.enableColumnFilterChangeMode,
2124
- enabledColumnFilterOptions = _table$options.enabledColumnFilterOptions,
2125
+ columnFilterModeOptions = _table$options.columnFilterModeOptions,
2125
2126
  _table$options$icons = _table$options.icons,
2126
2127
  FilterListIcon = _table$options$icons.FilterListIcon,
2127
2128
  CloseIcon = _table$options$icons.CloseIcon,
@@ -2218,7 +2219,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2218
2219
  var filterChipLabel = ['empty', 'notEmpty'].includes(currentFilterOption) ? //@ts-ignore
2219
2220
  localization["filter" + ((currentFilterOption == null ? void 0 : (_currentFilterOption$ = currentFilterOption.charAt(0)) == null ? void 0 : _currentFilterOption$.toUpperCase()) + (currentFilterOption == null ? void 0 : currentFilterOption.slice(1)))] : '';
2220
2221
  var filterPlaceholder = inputIndex === undefined ? (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(columnDef.header)) : inputIndex === 0 ? localization.min : inputIndex === 1 ? localization.max : '';
2221
- var allowedColumnFilterOptions = (_columnDef$enabledCol = columnDef == null ? void 0 : columnDef.enabledColumnFilterOptions) != null ? _columnDef$enabledCol : enabledColumnFilterOptions;
2222
+ var allowedColumnFilterOptions = (_columnDef$columnFilt = columnDef == null ? void 0 : columnDef.columnFilterModeOptions) != null ? _columnDef$columnFilt : columnFilterModeOptions;
2222
2223
  var showChangeModeButton = enableColumnFilterChangeMode && columnDef.enableColumnFilterChangeMode !== false && !isSelectFilter && !inputIndex && (allowedColumnFilterOptions === undefined || !!(allowedColumnFilterOptions != null && allowedColumnFilterOptions.length));
2223
2224
  return React.createElement(React.Fragment, null, React.createElement(TextField, Object.assign({
2224
2225
  fullWidth: true,
@@ -2290,7 +2291,6 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2290
2291
  }, textFieldProps, {
2291
2292
  sx: function sx(theme) {
2292
2293
  return _extends({
2293
- m: '-0.25rem',
2294
2294
  p: 0,
2295
2295
  minWidth: !filterChipLabel ? '8rem' : 'auto',
2296
2296
  width: 'calc(100% + 0.5rem)',
@@ -2623,7 +2623,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
2623
2623
  left: column.getIsPinned() === 'left' ? column.getStart('left') + "px" : undefined,
2624
2624
  overflow: 'visible',
2625
2625
  opacity: (currentDraggingColumn == null ? void 0 : currentDraggingColumn.id) === column.id || (currentHoveredColumn == null ? void 0 : currentHoveredColumn.id) === column.id ? 0.5 : 1,
2626
- p: density === 'compact' ? columnDefType === 'display' ? '0 0.5rem' : '0.5rem' : density === 'comfortable' ? columnDefType === 'display' ? '0.5rem 0.75rem' : '1rem' : columnDefType === 'display' ? '1rem 1.25rem' : '1.5rem',
2626
+ p: density === 'compact' ? '0.5rem' : density === 'comfortable' ? columnDefType === 'display' ? '0.75rem' : '1rem' : columnDefType === 'display' ? '1rem 1.25rem' : '1.5rem',
2627
2627
  pb: columnDefType === 'display' ? 0 : undefined,
2628
2628
  position: column.getIsPinned() && columnDefType !== 'group' ? 'sticky' : undefined,
2629
2629
  pt: columnDefType === 'group' ? 0 : density === 'compact' ? '0.25' : density === 'comfortable' ? '.75rem' : '1.25rem',
@@ -2924,6 +2924,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
2924
2924
  enableClickToCopy = _table$options.enableClickToCopy,
2925
2925
  enableColumnOrdering = _table$options.enableColumnOrdering,
2926
2926
  enableEditing = _table$options.enableEditing,
2927
+ enablePagination = _table$options.enablePagination,
2927
2928
  enableRowNumbers = _table$options.enableRowNumbers,
2928
2929
  muiTableBodyCellProps = _table$options.muiTableBodyCellProps,
2929
2930
  muiTableBodyCellSkeletonProps = _table$options.muiTableBodyCellSkeletonProps,
@@ -2998,7 +2999,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
2998
2999
  var draggingBorders = draggingBorder ? {
2999
3000
  borderLeft: draggingBorder,
3000
3001
  borderRight: draggingBorder,
3001
- borderBottom: row.index === table.getRowModel().rows.length - 1 ? draggingBorder : undefined
3002
+ borderBottom: row.index === (enablePagination ? table.getRowModel() : table.getPrePaginationRowModel()).rows.length - 1 ? draggingBorder : undefined
3002
3003
  } : undefined;
3003
3004
  return React.createElement(TableCell, Object.assign({
3004
3005
  onDoubleClick: handleDoubleClick,
@@ -3726,7 +3727,7 @@ var MaterialReactTable = (function (_ref) {
3726
3727
  _ref$enableColumnActi = _ref.enableColumnActions,
3727
3728
  enableColumnActions = _ref$enableColumnActi === void 0 ? true : _ref$enableColumnActi,
3728
3729
  _ref$enableColumnFilt = _ref.enableColumnFilterChangeMode,
3729
- enableColumnFilterChangeMode = _ref$enableColumnFilt === void 0 ? true : _ref$enableColumnFilt,
3730
+ enableColumnFilterChangeMode = _ref$enableColumnFilt === void 0 ? false : _ref$enableColumnFilt,
3730
3731
  _ref$enableColumnFilt2 = _ref.enableColumnFilters,
3731
3732
  enableColumnFilters = _ref$enableColumnFilt2 === void 0 ? true : _ref$enableColumnFilt2,
3732
3733
  _ref$enableColumnOrde = _ref.enableColumnOrdering,
@@ -3744,7 +3745,7 @@ var MaterialReactTable = (function (_ref) {
3744
3745
  _ref$enableGlobalFilt = _ref.enableGlobalFilter,
3745
3746
  enableGlobalFilter = _ref$enableGlobalFilt === void 0 ? true : _ref$enableGlobalFilt,
3746
3747
  _ref$enableGlobalFilt2 = _ref.enableGlobalFilterChangeMode,
3747
- enableGlobalFilterChangeMode = _ref$enableGlobalFilt2 === void 0 ? true : _ref$enableGlobalFilt2,
3748
+ enableGlobalFilterChangeMode = _ref$enableGlobalFilt2 === void 0 ? false : _ref$enableGlobalFilt2,
3748
3749
  _ref$enableGlobalFilt3 = _ref.enableGlobalFilterRankedResults,
3749
3750
  enableGlobalFilterRankedResults = _ref$enableGlobalFilt3 === void 0 ? true : _ref$enableGlobalFilt3,
3750
3751
  _ref$enableGrouping = _ref.enableGrouping,