material-react-table 0.26.5 → 0.28.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.
package/README.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # Material React Table
2
2
 
3
- <a href="https://npmjs.com/package/material-react-table" target="_blank_">
3
+ <a href="https://npmjs.com/package/material-react-table" target="_blank">
4
4
  <img alt="" src="https://badgen.net/npm/v/material-react-table" />
5
5
  </a>
6
- <a href="https://npmjs.com/package/material-react-table" target="_blank_">
6
+ <a href="https://npmjs.com/package/material-react-table" target="_blank">
7
7
  <img alt="" src="https://img.shields.io/npm/dm/material-react-table.svg" />
8
8
  </a>
9
- <a href="https://bundlephobia.com/result?p=material-react-table" target="_blank_">
9
+ <a href="https://bundlephobia.com/result?p=material-react-table" target="_blank">
10
10
  <img alt="" src="https://badgen.net/bundlephobia/minzip/material-react-table@latest" />
11
11
  </a>
12
- <a href="https://github.com/KevinVandy/material-react-table" target="_blank_">
12
+ <a href="https://github.com/KevinVandy/material-react-table" target="_blank">
13
13
  <img alt="" src="https://img.shields.io/github/stars/KevinVandy/material-react-table.svg?style=social&label=Star" />
14
14
  </a>
15
- <a href="http://makeapullrequest.com" target="_blank_">
15
+ <a href="http://makeapullrequest.com" target="_blank">
16
16
  <img alt="" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" />
17
17
  </a>
18
18
 
@@ -40,6 +40,7 @@ See all [Props and Options](https://www.material-react-table.com/docs/api)
40
40
  - [Basic Table](https://www.material-react-table.com/docs/examples/basic/) (See Default Features)
41
41
  - [Minimal Table](https://www.material-react-table.com/docs/examples/minimal/) (Turn off Features)
42
42
  - [Advanced Table](https://www.material-react-table.com/docs/examples/advanced/) (See some of the Advanced Features)
43
+ - [Data Export Table](https://www.material-react-table.com/docs/examples/data-export/) (Export to CSV, Excel, etc.)
43
44
  - [Remote Data](https://www.material-react-table.com/docs/examples/remote/) (Server-side Pagination, Sorting, and Filtering)
44
45
  - [React Query](https://www.material-react-table.com/docs/examples/react-query/) (Server-side Pagination, Sorting, and Filtering)
45
46
  - [Virtualized Rows](https://www.material-react-table.com/docs/examples/virtualized/) (20,000 rows at once!)
@@ -52,7 +53,7 @@ View additional [storybook examples](https://www.material-react-table.dev/)
52
53
 
53
54
  _All features can easily be enabled/disabled_
54
55
 
55
- - [x] < 35kb gzipped - [Bundlephobia](https://bundlephobia.com/package/material-react-table)
56
+ - [x] < 36kb gzipped - [Bundlephobia](https://bundlephobia.com/package/material-react-table)
56
57
  - [x] Advanced TypeScript Generics Support (TypeScript Optional)
57
58
  - [x] Click To Copy Cell Values
58
59
  - [x] Column Action Dropdown Menu
@@ -134,8 +135,6 @@ export default function App() {
134
135
  [],
135
136
  );
136
137
 
137
- //simple data example
138
- //Check out https://www.material-react-table.com/docs/examples/remote for a more realistic example
139
138
  const data = useMemo(
140
139
  () => [
141
140
  {
@@ -1,7 +1,7 @@
1
1
  import { ChangeEvent, Dispatch, DragEvent, FC, FocusEvent, ReactNode, SetStateAction } from 'react';
2
2
  import type { AlertProps, ButtonProps, CheckboxProps, IconButtonProps, LinearProgressProps, PaperProps, SkeletonProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TextFieldProps, ToolbarProps } from '@mui/material';
3
3
  import type { Cell, Column, ColumnDef, FilterFn, Header, HeaderGroup, OnChangeFn, Row, SortingFn, Table, TableOptions, TableState } from '@tanstack/react-table';
4
- import type { Options as VirtualizerOptions } from 'react-virtual';
4
+ import type { VirtualizerOptions } from '@tanstack/react-virtual';
5
5
  import { MRT_Localization } from './localization';
6
6
  import { MRT_Icons } from './icons';
7
7
  import { MRT_FilterFns } from './filtersFns';
@@ -69,7 +69,7 @@ export declare type MRT_TableState<TData extends Record<string, any> = {}> = Tab
69
69
  showProgressBars: boolean;
70
70
  showSkeletons: boolean;
71
71
  };
72
- export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnDef<TData>, 'accessorFn' | 'accessorKey' | 'aggregatedCell' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'id' | 'sortingFn'> & {
72
+ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnDef<TData, unknown>, 'accessorFn' | 'accessorKey' | 'aggregatedCell' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'id' | 'sortingFn'> & {
73
73
  AggregatedCell?: ({ cell, table, }: {
74
74
  cell: MRT_Cell<TData>;
75
75
  table: MRT_TableInstance<TData>;
@@ -117,6 +117,7 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
117
117
  * @example columnDefType: 'display'
118
118
  */
119
119
  columnDefType?: 'data' | 'display' | 'group';
120
+ columnFilterModeOptions?: MRT_FilterOption[] | null;
120
121
  columns?: MRT_ColumnDef<TData>[];
121
122
  enableClickToCopy?: boolean;
122
123
  enableColumnActions?: boolean;
@@ -124,7 +125,6 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
124
125
  enableColumnFilterChangeMode?: boolean;
125
126
  enableColumnOrdering?: boolean;
126
127
  enableEditing?: boolean;
127
- enabledColumnFilterOptions?: MRT_FilterOption[] | null;
128
128
  filterFn?: MRT_FilterFn<TData>;
129
129
  filterSelectOptions?: (string | {
130
130
  text: string;
@@ -236,6 +236,7 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
236
236
  displayColumnDefOptions?: Partial<{
237
237
  [key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef>;
238
238
  }>;
239
+ columnFilterModeOptions?: (MRT_FilterOption | string)[] | null;
239
240
  columns: MRT_ColumnDef<TData>[];
240
241
  data: TData[];
241
242
  editingMode?: 'table' | 'row' | 'cell';
@@ -263,7 +264,6 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
263
264
  enableToolbarBottom?: boolean;
264
265
  enableToolbarInternalActions?: boolean;
265
266
  enableToolbarTop?: boolean;
266
- enabledColumnFilterOptions?: (MRT_FilterOption | string)[] | null;
267
267
  enabledGlobalFilterOptions?: (MRT_FilterOption | string)[] | null;
268
268
  expandRowsFn?: (dataRow: TData) => TData[];
269
269
  icons?: Partial<MRT_Icons>;
@@ -463,7 +463,7 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
463
463
  selectAllMode?: 'all' | 'page';
464
464
  state?: Partial<MRT_TableState<TData>>;
465
465
  tableId?: string;
466
- virtualizerProps?: Partial<VirtualizerOptions<HTMLDivElement>>;
466
+ virtualizerProps?: Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
467
467
  };
468
468
  declare const _default: <TData extends Record<string, any> = {}>({ autoResetExpanded, columnResizeMode, defaultColumn, editingMode, enableColumnActions, enableColumnFilterChangeMode, enableColumnFilters, enableColumnOrdering, enableColumnResizing, enableDensityToggle, enableExpandAll, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableGlobalFilterChangeMode, enableGlobalFilterRankedResults, enableGrouping, enableHiding, enableMultiRowSelection, enableMultiSort, enablePagination, enablePinning, enableRowSelection, enableSelectAll, enableSorting, enableStickyHeader, enableTableFooter, enableTableHead, enableToolbarBottom, enableToolbarInternalActions, enableToolbarTop, icons, localization, positionActionsColumn, positionExpandColumn, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, rowNumberMode, selectAllMode, ...rest }: MaterialReactTableProps<TData>) => JSX.Element;
469
469
  export default _default;
@@ -10,7 +10,7 @@ var iconsMaterial = require('@mui/icons-material');
10
10
  var reactTable = require('@tanstack/react-table');
11
11
  var material = require('@mui/material');
12
12
  var matchSorterUtils = require('@tanstack/match-sorter-utils');
13
- var reactVirtual = require('react-virtual');
13
+ var reactVirtual = require('@tanstack/react-virtual');
14
14
 
15
15
  function _extends() {
16
16
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -182,7 +182,8 @@ var MRT_ExpandAllButton = function MRT_ExpandAllButton(_ref) {
182
182
  }, iconButtonProps, {
183
183
  sx: _extends({
184
184
  height: density === 'compact' ? '1.75rem' : '2.25rem',
185
- width: density === 'compact' ? '1.75rem' : '2.25rem'
185
+ width: density === 'compact' ? '1.75rem' : '2.25rem',
186
+ mt: density !== 'compact' ? '-0.25rem' : undefined
186
187
  }, iconButtonProps == null ? void 0 : iconButtonProps.sx)
187
188
  }), React__default.createElement(KeyboardDoubleArrowDownIcon, {
188
189
  style: {
@@ -239,7 +240,7 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
239
240
  };
240
241
 
241
242
  var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
242
- var _columnDef$enabledCol;
243
+ var _columnDef$columnFilt;
243
244
 
244
245
  var anchorEl = _ref.anchorEl,
245
246
  header = _ref.header,
@@ -249,7 +250,7 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
249
250
  var getState = table.getState,
250
251
  _table$options = table.options,
251
252
  enabledGlobalFilterOptions = _table$options.enabledGlobalFilterOptions,
252
- enabledColumnFilterOptions = _table$options.enabledColumnFilterOptions,
253
+ columnFilterModeOptions = _table$options.columnFilterModeOptions,
253
254
  localization = _table$options.localization,
254
255
  setCurrentFilterFns = table.setCurrentFilterFns,
255
256
  setCurrentGlobalFilterFn = table.setCurrentGlobalFilterFn;
@@ -265,7 +266,7 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
265
266
  var _ref3 = column != null ? column : {},
266
267
  columnDef = _ref3.columnDef;
267
268
 
268
- var allowedColumnFilterOptions = (_columnDef$enabledCol = columnDef == null ? void 0 : columnDef.enabledColumnFilterOptions) != null ? _columnDef$enabledCol : enabledColumnFilterOptions;
269
+ var allowedColumnFilterOptions = (_columnDef$columnFilt = columnDef == null ? void 0 : columnDef.columnFilterModeOptions) != null ? _columnDef$columnFilt : columnFilterModeOptions;
269
270
  var filterOptions = React.useMemo(function () {
270
271
  return [{
271
272
  option: 'fuzzy',
@@ -987,7 +988,7 @@ var commonListItemStyles = {
987
988
  alignItems: 'center'
988
989
  };
989
990
  var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
990
- var _columnDef$enabledCol, _localization$sortByC, _localization$sortByC2, _localization$filterB, _localization, _localization$hideCol, _localization$showAll;
991
+ var _columnDef$columnFilt, _localization$sortByC, _localization$sortByC2, _localization$filterB, _localization, _localization$hideCol, _localization$showAll;
991
992
 
992
993
  var anchorEl = _ref.anchorEl,
993
994
  header = _ref.header,
@@ -1004,7 +1005,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1004
1005
  enableHiding = _table$options.enableHiding,
1005
1006
  enablePinning = _table$options.enablePinning,
1006
1007
  enableSorting = _table$options.enableSorting,
1007
- enabledColumnFilterOptions = _table$options.enabledColumnFilterOptions,
1008
+ columnFilterModeOptions = _table$options.columnFilterModeOptions,
1008
1009
  _table$options$icons = _table$options.icons,
1009
1010
  ArrowRightIcon = _table$options$icons.ArrowRightIcon,
1010
1011
  ClearAllIcon = _table$options$icons.ClearAllIcon,
@@ -1105,7 +1106,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
1105
1106
  };
1106
1107
 
1107
1108
  var isSelectFilter = !!columnDef.filterSelectOptions;
1108
- var allowedColumnFilterOptions = (_columnDef$enabledCol = columnDef == null ? void 0 : columnDef.enabledColumnFilterOptions) != null ? _columnDef$enabledCol : enabledColumnFilterOptions;
1109
+ var allowedColumnFilterOptions = (_columnDef$columnFilt = columnDef == null ? void 0 : columnDef.columnFilterModeOptions) != null ? _columnDef$columnFilt : columnFilterModeOptions;
1109
1110
  var showFilterModeSubMenu = enableColumnFilterChangeMode && columnDef.enableColumnFilterChangeMode !== false && !isSelectFilter && (allowedColumnFilterOptions === undefined || !!(allowedColumnFilterOptions != null && allowedColumnFilterOptions.length));
1110
1111
  return React__default.createElement(material.Menu, {
1111
1112
  anchorEl: anchorEl,
@@ -1452,9 +1453,9 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
1452
1453
  }, checkboxProps, {
1453
1454
  sx: function sx(theme) {
1454
1455
  return _extends({
1455
- height: density === 'compact' ? '1.5rem' : '2rem',
1456
- width: density === 'compact' ? '1.5rem' : '2rem',
1457
- m: '-1re.m'
1456
+ height: density === 'compact' ? '1.75rem' : '2.5rem',
1457
+ width: density === 'compact' ? '1.75rem' : '2.5rem',
1458
+ m: density !== 'compact' ? '-0.4rem' : undefined
1458
1459
  }, (checkboxProps == null ? void 0 : checkboxProps.sx) instanceof Function ? checkboxProps.sx(theme) : checkboxProps == null ? void 0 : checkboxProps.sx);
1459
1460
  }
1460
1461
  })));
@@ -1947,7 +1948,7 @@ var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
1947
1948
  var toolbarProps = muiTableToolbarTopProps instanceof Function ? muiTableToolbarTopProps({
1948
1949
  table: table
1949
1950
  }) : muiTableToolbarTopProps;
1950
- var stackAlertBanner = isMobile || positionToolbarAlertBanner === 'top' && (!!renderToolbarTopCustomActions || showGlobalFilter);
1951
+ var stackAlertBanner = isMobile || !!renderToolbarTopCustomActions || showGlobalFilter;
1951
1952
  return React__default.createElement(material.Toolbar, Object.assign({
1952
1953
  id: "mrt-" + tableId + "-toolbar-top",
1953
1954
  variant: "dense"
@@ -2010,7 +2011,7 @@ var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
2010
2011
  var toolbarProps = muiTableToolbarBottomProps instanceof Function ? muiTableToolbarBottomProps({
2011
2012
  table: table
2012
2013
  }) : muiTableToolbarBottomProps;
2013
- var stackAlertBanner = isMobile || positionToolbarAlertBanner === 'bottom' && !!renderToolbarBottomCustomActions;
2014
+ var stackAlertBanner = isMobile || !!renderToolbarBottomCustomActions;
2014
2015
  return React__default.createElement(material.Toolbar, Object.assign({
2015
2016
  id: "mrt-" + tableId + "-toolbar-bottom",
2016
2017
  variant: "dense"
@@ -2120,7 +2121,7 @@ var MRT_TableHeadCellColumnActionsButton = function MRT_TableHeadCellColumnActio
2120
2121
  };
2121
2122
 
2122
2123
  var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2123
- var _currentFilterOption$, _localization$filterB, _columnDef$enabledCol, _currentFilterOption$2, _localization$clearFi, _columnDef$filterSele;
2124
+ var _currentFilterOption$, _localization$filterB, _columnDef$columnFilt, _currentFilterOption$2, _localization$clearFi, _columnDef$filterSele;
2124
2125
 
2125
2126
  var header = _ref.header,
2126
2127
  inputIndex = _ref.inputIndex,
@@ -2128,7 +2129,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2128
2129
  var getState = table.getState,
2129
2130
  _table$options = table.options,
2130
2131
  enableColumnFilterChangeMode = _table$options.enableColumnFilterChangeMode,
2131
- enabledColumnFilterOptions = _table$options.enabledColumnFilterOptions,
2132
+ columnFilterModeOptions = _table$options.columnFilterModeOptions,
2132
2133
  _table$options$icons = _table$options.icons,
2133
2134
  FilterListIcon = _table$options$icons.FilterListIcon,
2134
2135
  CloseIcon = _table$options$icons.CloseIcon,
@@ -2225,7 +2226,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2225
2226
  var filterChipLabel = ['empty', 'notEmpty'].includes(currentFilterOption) ? //@ts-ignore
2226
2227
  localization["filter" + ((currentFilterOption == null ? void 0 : (_currentFilterOption$ = currentFilterOption.charAt(0)) == null ? void 0 : _currentFilterOption$.toUpperCase()) + (currentFilterOption == null ? void 0 : currentFilterOption.slice(1)))] : '';
2227
2228
  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 : '';
2228
- var allowedColumnFilterOptions = (_columnDef$enabledCol = columnDef == null ? void 0 : columnDef.enabledColumnFilterOptions) != null ? _columnDef$enabledCol : enabledColumnFilterOptions;
2229
+ var allowedColumnFilterOptions = (_columnDef$columnFilt = columnDef == null ? void 0 : columnDef.columnFilterModeOptions) != null ? _columnDef$columnFilt : columnFilterModeOptions;
2229
2230
  var showChangeModeButton = enableColumnFilterChangeMode && columnDef.enableColumnFilterChangeMode !== false && !isSelectFilter && !inputIndex && (allowedColumnFilterOptions === undefined || !!(allowedColumnFilterOptions != null && allowedColumnFilterOptions.length));
2230
2231
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.TextField, Object.assign({
2231
2232
  fullWidth: true,
@@ -2297,7 +2298,6 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
2297
2298
  }, textFieldProps, {
2298
2299
  sx: function sx(theme) {
2299
2300
  return _extends({
2300
- m: '-0.25rem',
2301
2301
  p: 0,
2302
2302
  minWidth: !filterChipLabel ? '8rem' : 'auto',
2303
2303
  width: 'calc(100% + 0.5rem)',
@@ -2630,7 +2630,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
2630
2630
  left: column.getIsPinned() === 'left' ? column.getStart('left') + "px" : undefined,
2631
2631
  overflow: 'visible',
2632
2632
  opacity: (currentDraggingColumn == null ? void 0 : currentDraggingColumn.id) === column.id || (currentHoveredColumn == null ? void 0 : currentHoveredColumn.id) === column.id ? 0.5 : 1,
2633
- 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',
2633
+ p: density === 'compact' ? '0.5rem' : density === 'comfortable' ? columnDefType === 'display' ? '0.75rem' : '1rem' : columnDefType === 'display' ? '1rem 1.25rem' : '1.5rem',
2634
2634
  pb: columnDefType === 'display' ? 0 : undefined,
2635
2635
  position: column.getIsPinned() && columnDefType !== 'group' ? 'sticky' : undefined,
2636
2636
  pt: columnDefType === 'group' ? 0 : density === 'compact' ? '0.25' : density === 'comfortable' ? '.75rem' : '1.25rem',
@@ -2931,6 +2931,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
2931
2931
  enableClickToCopy = _table$options.enableClickToCopy,
2932
2932
  enableColumnOrdering = _table$options.enableColumnOrdering,
2933
2933
  enableEditing = _table$options.enableEditing,
2934
+ enablePagination = _table$options.enablePagination,
2934
2935
  enableRowNumbers = _table$options.enableRowNumbers,
2935
2936
  muiTableBodyCellProps = _table$options.muiTableBodyCellProps,
2936
2937
  muiTableBodyCellSkeletonProps = _table$options.muiTableBodyCellSkeletonProps,
@@ -3005,7 +3006,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
3005
3006
  var draggingBorders = draggingBorder ? {
3006
3007
  borderLeft: draggingBorder,
3007
3008
  borderRight: draggingBorder,
3008
- borderBottom: row.index === table.getRowModel().rows.length - 1 ? draggingBorder : undefined
3009
+ borderBottom: row.index === (enablePagination ? table.getRowModel() : table.getPrePaginationRowModel()).rows.length - 1 ? draggingBorder : undefined
3009
3010
  } : undefined;
3010
3011
  return React__default.createElement(material.TableCell, Object.assign({
3011
3012
  onDoubleClick: handleDoubleClick,
@@ -3208,19 +3209,23 @@ var MRT_TableBody = function MRT_TableBody(_ref) {
3208
3209
 
3209
3210
  return enablePagination ? getRowModel().rows : getPrePaginationRowModel().rows;
3210
3211
  }, [enableGlobalFilterRankedResults, enableGlobalFilterRankedResults && globalFilter || !enablePagination ? getPrePaginationRowModel().rows : getRowModel().rows, globalFilter]);
3211
- var rowVirtualizer = enableRowVirtualization ? reactVirtual.useVirtual(_extends({
3212
- // estimateSize: () => (density === 'compact' ? 25 : 50),
3212
+ var rowVirtualizer = enableRowVirtualization ? reactVirtual.useVirtualizer(_extends({
3213
+ estimateSize: function estimateSize() {
3214
+ return density === 'compact' ? 25 : 50;
3215
+ },
3213
3216
  overscan: density === 'compact' ? 30 : 10,
3214
- parentRef: tableContainerRef,
3215
- size: rows.length
3217
+ getScrollElement: function getScrollElement() {
3218
+ return tableContainerRef.current;
3219
+ },
3220
+ count: rows.length
3216
3221
  }, virtualizerProps)) : {};
3217
- var virtualRows = enableRowVirtualization ? rowVirtualizer.virtualItems : [];
3222
+ var virtualRows = enableRowVirtualization ? rowVirtualizer.getVirtualItems() : [];
3218
3223
  var paddingTop = 0;
3219
3224
  var paddingBottom = 0;
3220
3225
 
3221
3226
  if (enableRowVirtualization) {
3222
- paddingTop = virtualRows.length > 0 ? virtualRows[0].start : 0;
3223
- paddingBottom = virtualRows.length > 0 ? rowVirtualizer.totalSize - virtualRows[virtualRows.length - 1].end : 0;
3227
+ paddingTop = !!virtualRows.length ? virtualRows[0].start : 0;
3228
+ paddingBottom = !!virtualRows.length ? rowVirtualizer.getTotalSize() - virtualRows[virtualRows.length - 1].end : 0;
3224
3229
  }
3225
3230
 
3226
3231
  return React__default.createElement(material.TableBody, Object.assign({}, tableBodyProps), enableRowVirtualization && paddingTop > 0 && React__default.createElement("tr", null, React__default.createElement("td", {
@@ -3733,7 +3738,7 @@ var MaterialReactTable = (function (_ref) {
3733
3738
  _ref$enableColumnActi = _ref.enableColumnActions,
3734
3739
  enableColumnActions = _ref$enableColumnActi === void 0 ? true : _ref$enableColumnActi,
3735
3740
  _ref$enableColumnFilt = _ref.enableColumnFilterChangeMode,
3736
- enableColumnFilterChangeMode = _ref$enableColumnFilt === void 0 ? true : _ref$enableColumnFilt,
3741
+ enableColumnFilterChangeMode = _ref$enableColumnFilt === void 0 ? false : _ref$enableColumnFilt,
3737
3742
  _ref$enableColumnFilt2 = _ref.enableColumnFilters,
3738
3743
  enableColumnFilters = _ref$enableColumnFilt2 === void 0 ? true : _ref$enableColumnFilt2,
3739
3744
  _ref$enableColumnOrde = _ref.enableColumnOrdering,
@@ -3751,7 +3756,7 @@ var MaterialReactTable = (function (_ref) {
3751
3756
  _ref$enableGlobalFilt = _ref.enableGlobalFilter,
3752
3757
  enableGlobalFilter = _ref$enableGlobalFilt === void 0 ? true : _ref$enableGlobalFilt,
3753
3758
  _ref$enableGlobalFilt2 = _ref.enableGlobalFilterChangeMode,
3754
- enableGlobalFilterChangeMode = _ref$enableGlobalFilt2 === void 0 ? true : _ref$enableGlobalFilt2,
3759
+ enableGlobalFilterChangeMode = _ref$enableGlobalFilt2 === void 0 ? false : _ref$enableGlobalFilt2,
3755
3760
  _ref$enableGlobalFilt3 = _ref.enableGlobalFilterRankedResults,
3756
3761
  enableGlobalFilterRankedResults = _ref$enableGlobalFilt3 === void 0 ? true : _ref$enableGlobalFilt3,
3757
3762
  _ref$enableGrouping = _ref.enableGrouping,