material-react-table 0.19.0-alpha.1 → 0.21.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/dist/MaterialReactTable.d.ts +5 -2
- package/dist/material-react-table.cjs.development.js +13 -6
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +13 -6
- package/dist/material-react-table.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/MaterialReactTable.tsx +6 -2
- package/src/body/MRT_TableBody.tsx +17 -10
|
@@ -3019,13 +3019,20 @@ var MRT_TableBody = function MRT_TableBody(_ref) {
|
|
|
3019
3019
|
return enablePagination ? getRowModel().rows : getPrePaginationRowModel().rows;
|
|
3020
3020
|
}, [enableGlobalFilterRankedResults, enableGlobalFilterRankedResults && globalFilter || !enablePagination ? getPrePaginationRowModel().rows : getRowModel().rows, globalFilter]);
|
|
3021
3021
|
var rowVirtualizer = enableRowVirtualization ? useVirtual(_extends({
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
parentRef: tableContainerRef
|
|
3022
|
+
// estimateSize: () => (density === 'compact' ? 25 : 50),
|
|
3023
|
+
overscan: density === 'compact' ? 30 : 10,
|
|
3024
|
+
parentRef: tableContainerRef,
|
|
3025
|
+
size: rows.length
|
|
3025
3026
|
}, virtualizerProps)) : {};
|
|
3026
|
-
var virtualRows = rowVirtualizer.virtualItems;
|
|
3027
|
-
var paddingTop =
|
|
3028
|
-
var paddingBottom =
|
|
3027
|
+
var virtualRows = enableRowVirtualization ? rowVirtualizer.virtualItems : [];
|
|
3028
|
+
var paddingTop = 0;
|
|
3029
|
+
var paddingBottom = 0;
|
|
3030
|
+
|
|
3031
|
+
if (enableRowVirtualization) {
|
|
3032
|
+
paddingTop = virtualRows.length > 0 ? virtualRows[0].start : 0;
|
|
3033
|
+
paddingBottom = virtualRows.length > 0 ? rowVirtualizer.totalSize - virtualRows[virtualRows.length - 1].end : 0;
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3029
3036
|
return React.createElement(TableBody, Object.assign({}, tableBodyProps), enableRowVirtualization && paddingTop > 0 && React.createElement("tr", null, React.createElement("td", {
|
|
3030
3037
|
style: {
|
|
3031
3038
|
height: paddingTop + "px"
|