@mui/x-data-grid 6.14.0 → 6.16.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/CHANGELOG.md +167 -0
- package/DataGrid/useDataGridComponent.js +43 -40
- package/components/DataGridVirtualScroller.d.ts +1 -4
- package/components/DataGridVirtualScroller.js +3 -5
- package/components/GridRow.js +4 -2
- package/components/base/GridBody.d.ts +0 -1
- package/components/base/GridBody.js +2 -22
- package/components/cell/GridActionsCell.js +2 -2
- package/components/cell/GridActionsCellItem.d.ts +6 -0
- package/components/cell/GridCell.js +4 -2
- package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/components/menu/GridMenu.d.ts +1 -2
- package/components/menu/GridMenu.js +21 -5
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -3
- package/hooks/features/export/useGridPrintExport.js +37 -7
- package/hooks/features/filter/gridFilterUtils.js +10 -6
- package/hooks/features/focus/useGridFocus.js +0 -1
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +2 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +16 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +18 -0
- package/hooks/features/virtualization/index.d.ts +2 -0
- package/hooks/features/virtualization/index.js +2 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +53 -36
- package/hooks/features/virtualization/useGridVirtualization.d.ts +12 -0
- package/hooks/features/virtualization/useGridVirtualization.js +47 -0
- package/index.js +1 -1
- package/internals/index.d.ts +4 -0
- package/internals/index.js +4 -0
- package/legacy/DataGrid/useDataGridComponent.js +43 -40
- package/legacy/components/DataGridVirtualScroller.js +2 -4
- package/legacy/components/GridRow.js +4 -2
- package/legacy/components/base/GridBody.js +2 -26
- package/legacy/components/cell/GridActionsCell.js +2 -2
- package/legacy/components/cell/GridCell.js +4 -2
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/legacy/components/menu/GridMenu.js +21 -5
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +2 -1
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +2 -1
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/legacy/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -3
- package/legacy/hooks/features/export/useGridPrintExport.js +44 -12
- package/legacy/hooks/features/filter/gridFilterUtils.js +10 -6
- package/legacy/hooks/features/focus/useGridFocus.js +0 -1
- package/legacy/hooks/features/index.js +2 -1
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +24 -0
- package/legacy/hooks/features/virtualization/index.js +2 -0
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +61 -39
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +51 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +4 -0
- package/legacy/locales/ruRU.js +26 -28
- package/legacy/models/api/index.js +1 -2
- package/legacy/utils/createControllablePromise.js +11 -0
- package/locales/ruRU.js +26 -28
- package/models/api/gridApiCommon.d.ts +3 -4
- package/models/api/gridVirtualizationApi.d.ts +20 -0
- package/models/api/index.d.ts +1 -2
- package/models/api/index.js +1 -2
- package/models/events/gridEventLookup.d.ts +8 -0
- package/models/gridExport.d.ts +17 -4
- package/models/gridStateCommunity.d.ts +2 -1
- package/models/index.d.ts +1 -1
- package/modern/DataGrid/useDataGridComponent.js +43 -40
- package/modern/components/DataGridVirtualScroller.js +3 -5
- package/modern/components/GridRow.js +4 -2
- package/modern/components/base/GridBody.js +2 -22
- package/modern/components/cell/GridActionsCell.js +2 -2
- package/modern/components/cell/GridCell.js +4 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/modern/components/menu/GridMenu.js +20 -5
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +11 -8
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/modern/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -3
- package/modern/hooks/features/export/useGridPrintExport.js +37 -7
- package/modern/hooks/features/filter/gridFilterUtils.js +10 -6
- package/modern/hooks/features/focus/useGridFocus.js +0 -1
- package/modern/hooks/features/index.js +2 -1
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +18 -0
- package/modern/hooks/features/virtualization/index.js +2 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +52 -36
- package/modern/hooks/features/virtualization/useGridVirtualization.js +47 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +4 -0
- package/modern/locales/ruRU.js +26 -28
- package/modern/models/api/index.js +1 -2
- package/modern/utils/createControllablePromise.js +11 -0
- package/node/DataGrid/useDataGridComponent.js +43 -40
- package/node/components/DataGridVirtualScroller.js +3 -5
- package/node/components/GridRow.js +4 -2
- package/node/components/base/GridBody.js +2 -22
- package/node/components/cell/GridActionsCell.js +2 -2
- package/node/components/cell/GridCell.js +4 -2
- package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/node/components/menu/GridMenu.js +19 -4
- package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +10 -7
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -7
- package/node/components/toolbar/GridToolbarExportContainer.js +1 -9
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -5
- package/node/hooks/features/export/useGridPrintExport.js +37 -7
- package/node/hooks/features/filter/gridFilterUtils.js +9 -6
- package/node/hooks/features/focus/useGridFocus.js +0 -1
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +27 -0
- package/node/hooks/features/virtualization/index.js +27 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +51 -37
- package/node/hooks/features/virtualization/useGridVirtualization.js +58 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +44 -0
- package/node/locales/ruRU.js +26 -28
- package/node/models/api/index.js +4 -15
- package/node/utils/createControllablePromise.js +17 -0
- package/package.json +1 -1
- package/utils/createControllablePromise.d.ts +5 -0
- package/utils/createControllablePromise.js +11 -0
- package/models/api/gridDisableVirtualizationApi.d.ts +0 -15
- package/models/api/gridVirtualScrollerApi.d.ts +0 -8
- package/models/api/gridVirtualScrollerApi.js +0 -1
- package/modern/models/api/gridDisableVirtualizationApi.js +0 -1
- package/modern/models/api/gridVirtualScrollerApi.js +0 -1
- package/node/models/api/gridVirtualScrollerApi.js +0 -5
- /package/legacy/models/api/{gridDisableVirtualizationApi.js → gridVirtualizationApi.js} +0 -0
- /package/{legacy/models/api/gridVirtualScrollerApi.js → models/api/gridVirtualizationApi.js} +0 -0
- /package/{models/api/gridDisableVirtualizationApi.js → modern/models/api/gridVirtualizationApi.js} +0 -0
- /package/node/models/api/{gridDisableVirtualizationApi.js → gridVirtualizationApi.js} +0 -0
|
@@ -19,6 +19,7 @@ var _useGridPagination = require("../pagination/useGridPagination");
|
|
|
19
19
|
var _pipeProcessing = require("../../core/pipeProcessing");
|
|
20
20
|
var _GridToolbarExport = require("../../../components/toolbar/GridToolbarExport");
|
|
21
21
|
var _gridColumnsUtils = require("../columns/gridColumnsUtils");
|
|
22
|
+
var _gridCheckboxSelectionColDef = require("../../../colDef/gridCheckboxSelectionColDef");
|
|
22
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -49,13 +50,14 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
49
50
|
const doc = React.useRef(null);
|
|
50
51
|
const previousGridState = React.useRef(null);
|
|
51
52
|
const previousColumnVisibility = React.useRef({});
|
|
53
|
+
const previousRows = React.useRef([]);
|
|
52
54
|
React.useEffect(() => {
|
|
53
55
|
doc.current = (0, _utils.unstable_ownerDocument)(apiRef.current.rootElementRef.current);
|
|
54
56
|
}, [apiRef]);
|
|
55
57
|
|
|
56
58
|
// Returns a promise because updateColumns triggers state update and
|
|
57
59
|
// the new state needs to be in place before the grid can be sized correctly
|
|
58
|
-
const updateGridColumnsForPrint = React.useCallback((fields, allColumns) => new Promise(resolve => {
|
|
60
|
+
const updateGridColumnsForPrint = React.useCallback((fields, allColumns, includeCheckboxes) => new Promise(resolve => {
|
|
59
61
|
const exportedColumnFields = (0, _utils2.getColumnsToExport)({
|
|
60
62
|
apiRef,
|
|
61
63
|
options: {
|
|
@@ -68,14 +70,25 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
68
70
|
columns.forEach(column => {
|
|
69
71
|
newColumnVisibilityModel[column.field] = exportedColumnFields.includes(column.field);
|
|
70
72
|
});
|
|
73
|
+
if (includeCheckboxes) {
|
|
74
|
+
newColumnVisibilityModel[_gridCheckboxSelectionColDef.GRID_CHECKBOX_SELECTION_COL_DEF.field] = true;
|
|
75
|
+
}
|
|
71
76
|
apiRef.current.setColumnVisibilityModel(newColumnVisibilityModel);
|
|
72
77
|
resolve();
|
|
73
78
|
}), [apiRef]);
|
|
79
|
+
const updateGridRowsForPrint = React.useCallback(getRowsToExport => {
|
|
80
|
+
const rowsToExportIds = getRowsToExport({
|
|
81
|
+
apiRef
|
|
82
|
+
});
|
|
83
|
+
const newRows = rowsToExportIds.map(id => apiRef.current.getRow(id));
|
|
84
|
+
apiRef.current.setRows(newRows);
|
|
85
|
+
}, [apiRef]);
|
|
74
86
|
const handlePrintWindowLoad = React.useCallback((printWindow, options) => {
|
|
75
87
|
const normalizeOptions = (0, _extends2.default)({
|
|
76
88
|
copyStyles: true,
|
|
77
89
|
hideToolbar: false,
|
|
78
|
-
hideFooter: false
|
|
90
|
+
hideFooter: false,
|
|
91
|
+
includeCheckboxes: false
|
|
79
92
|
}, options);
|
|
80
93
|
const printDoc = printWindow.contentDocument;
|
|
81
94
|
if (!printDoc) {
|
|
@@ -106,10 +119,21 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
106
119
|
}
|
|
107
120
|
|
|
108
121
|
// Expand container height to accommodate all rows
|
|
109
|
-
|
|
122
|
+
const computedTotalHeight = rowsMeta.currentPageTotalHeight + (0, _gridColumnsUtils.getTotalHeaderHeight)(apiRef, props.columnHeaderHeight) + gridToolbarElementHeight + gridFooterElementHeight;
|
|
123
|
+
gridClone.style.height = `${computedTotalHeight}px`;
|
|
110
124
|
// The height above does not include grid border width, so we need to exclude it
|
|
111
125
|
gridClone.style.boxSizing = 'content-box';
|
|
112
126
|
|
|
127
|
+
// the footer is always being placed at the bottom of the page as if all rows are exported
|
|
128
|
+
// so if getRowsToExport is being used to only export a subset of rows then we need to
|
|
129
|
+
// adjust the footer position to be correctly placed at the bottom of the grid
|
|
130
|
+
if (options?.getRowsToExport) {
|
|
131
|
+
const gridFooterElement = gridClone.querySelector(`.${_gridClasses.gridClasses.footerContainer}`);
|
|
132
|
+
gridFooterElement.style.position = 'absolute';
|
|
133
|
+
gridFooterElement.style.width = '100%';
|
|
134
|
+
gridFooterElement.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;
|
|
135
|
+
}
|
|
136
|
+
|
|
113
137
|
// printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari
|
|
114
138
|
// prevents us to do it
|
|
115
139
|
const container = document.createElement('div');
|
|
@@ -182,11 +206,13 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
182
206
|
// if the apiRef.current.exportState(); did not exported the column visibility, we update it
|
|
183
207
|
apiRef.current.setColumnVisibilityModel(previousColumnVisibility.current);
|
|
184
208
|
}
|
|
185
|
-
apiRef.current.
|
|
209
|
+
apiRef.current.unstable_setVirtualization(true);
|
|
210
|
+
apiRef.current.setRows(previousRows.current);
|
|
186
211
|
|
|
187
212
|
// Clear local state
|
|
188
213
|
previousGridState.current = null;
|
|
189
214
|
previousColumnVisibility.current = {};
|
|
215
|
+
previousRows.current = [];
|
|
190
216
|
}, [apiRef]);
|
|
191
217
|
const exportDataAsPrint = React.useCallback(async options => {
|
|
192
218
|
logger.debug(`Export data as Print`);
|
|
@@ -196,6 +222,7 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
196
222
|
previousGridState.current = apiRef.current.exportState();
|
|
197
223
|
// It appends that the visibility model is not exported, especially if columnVisibility is not controlled
|
|
198
224
|
previousColumnVisibility.current = (0, _gridColumnsSelector.gridColumnVisibilityModelSelector)(apiRef);
|
|
225
|
+
previousRows.current = apiRef.current.getSortedRows();
|
|
199
226
|
if (props.pagination) {
|
|
200
227
|
const visibleRowCount = (0, _gridFilterSelector.gridExpandedRowCountSelector)(apiRef);
|
|
201
228
|
const paginationModel = {
|
|
@@ -207,8 +234,11 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
207
234
|
(0, _useGridPagination.mergeStateWithPaginationModel)(visibleRowCount, 'DataGridPro', paginationModel));
|
|
208
235
|
apiRef.current.forceUpdate();
|
|
209
236
|
}
|
|
210
|
-
await updateGridColumnsForPrint(options?.fields, options?.allColumns);
|
|
211
|
-
|
|
237
|
+
await updateGridColumnsForPrint(options?.fields, options?.allColumns, options?.includeCheckboxes);
|
|
238
|
+
if (options?.getRowsToExport) {
|
|
239
|
+
updateGridRowsForPrint(options.getRowsToExport);
|
|
240
|
+
}
|
|
241
|
+
apiRef.current.unstable_setVirtualization(false);
|
|
212
242
|
await raf(); // wait for the state changes to take action
|
|
213
243
|
const printWindow = buildPrintWindow(options?.fileName);
|
|
214
244
|
if (process.env.NODE_ENV === 'test') {
|
|
@@ -229,7 +259,7 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
229
259
|
};
|
|
230
260
|
doc.current.body.appendChild(printWindow);
|
|
231
261
|
}
|
|
232
|
-
}, [props, logger, apiRef, handlePrintWindowLoad, handlePrintWindowAfterPrint, updateGridColumnsForPrint]);
|
|
262
|
+
}, [props, logger, apiRef, handlePrintWindowLoad, handlePrintWindowAfterPrint, updateGridColumnsForPrint, updateGridRowsForPrint]);
|
|
233
263
|
const printExportApi = {
|
|
234
264
|
exportDataAsPrint
|
|
235
265
|
};
|
|
@@ -11,10 +11,12 @@ var _utils = require("../../../colDef/utils");
|
|
|
11
11
|
var _gridFilterState = require("./gridFilterState");
|
|
12
12
|
var _warning = require("../../../utils/warning");
|
|
13
13
|
var _columns = require("../columns");
|
|
14
|
+
// Fixes https://github.com/mui/mui-x/issues/10056
|
|
15
|
+
const globalScope = typeof window === 'undefined' ? globalThis : window;
|
|
16
|
+
const evalCode = globalScope[atob('ZXZhbA==')];
|
|
14
17
|
let hasEval;
|
|
15
18
|
try {
|
|
16
|
-
|
|
17
|
-
hasEval = eval('true');
|
|
19
|
+
hasEval = evalCode('true');
|
|
18
20
|
} catch (_) {
|
|
19
21
|
hasEval = false;
|
|
20
22
|
}
|
|
@@ -167,7 +169,7 @@ const buildAggregatedFilterItemsApplier = (getRowId, filterModel, apiRef, disabl
|
|
|
167
169
|
|
|
168
170
|
// We generate a new function with `eval()` to avoid expensive patterns for JS engines
|
|
169
171
|
// such as a dynamic object assignment, e.g. `{ [dynamicKey]: value }`.
|
|
170
|
-
const filterItemTemplate = `(function filterItem$$(row, shouldApplyFilter) {
|
|
172
|
+
const filterItemTemplate = `(function filterItem$$(appliers, row, shouldApplyFilter) {
|
|
171
173
|
${appliers.map((applier, i) => `const shouldApply${i} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(applier.item.field)});`).join('\n')}
|
|
172
174
|
|
|
173
175
|
const result$$ = {
|
|
@@ -179,9 +181,10 @@ const buildAggregatedFilterItemsApplier = (getRowId, filterModel, apiRef, disabl
|
|
|
179
181
|
|
|
180
182
|
return result$$;
|
|
181
183
|
})`;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
const filterItemCore = evalCode(filterItemTemplate.replaceAll('$$', String(filterItemsApplierId)));
|
|
185
|
+
const filterItem = (row, shouldApplyItem) => {
|
|
186
|
+
return filterItemCore(appliers, row, shouldApplyItem);
|
|
187
|
+
};
|
|
185
188
|
filterItemsApplierId += 1;
|
|
186
189
|
return filterItem;
|
|
187
190
|
};
|
|
@@ -392,7 +392,6 @@ const useGridFocus = (apiRef, props) => {
|
|
|
392
392
|
};
|
|
393
393
|
}, [apiRef, handleDocumentClick]);
|
|
394
394
|
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'columnHeaderBlur', handleBlur);
|
|
395
|
-
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'headerFilterBlur', handleBlur);
|
|
396
395
|
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'cellDoubleClick', handleCellDoubleClick);
|
|
397
396
|
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'cellMouseDown', handleCellMouseDown);
|
|
398
397
|
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'cellKeyDown', handleCellKeyDown);
|
|
@@ -156,4 +156,15 @@ Object.keys(_headerFiltering).forEach(function (key) {
|
|
|
156
156
|
return _headerFiltering[key];
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
+
});
|
|
160
|
+
var _virtualization = require("./virtualization");
|
|
161
|
+
Object.keys(_virtualization).forEach(function (key) {
|
|
162
|
+
if (key === "default" || key === "__esModule") return;
|
|
163
|
+
if (key in exports && exports[key] === _virtualization[key]) return;
|
|
164
|
+
Object.defineProperty(exports, key, {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function () {
|
|
167
|
+
return _virtualization[key];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
159
170
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.gridVirtualizationSelector = exports.gridVirtualizationEnabledSelector = exports.gridVirtualizationColumnEnabledSelector = void 0;
|
|
7
|
+
var _createSelector = require("../../../utils/createSelector");
|
|
8
|
+
/**
|
|
9
|
+
* Get the columns state
|
|
10
|
+
* @category Virtualization
|
|
11
|
+
*/
|
|
12
|
+
const gridVirtualizationSelector = state => state.virtualization;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Get the enabled state for virtualization
|
|
16
|
+
* @category Virtualization
|
|
17
|
+
*/
|
|
18
|
+
exports.gridVirtualizationSelector = gridVirtualizationSelector;
|
|
19
|
+
const gridVirtualizationEnabledSelector = (0, _createSelector.createSelector)(gridVirtualizationSelector, state => state.enabled);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get the enabled state for virtualization
|
|
23
|
+
* @category Virtualization
|
|
24
|
+
*/
|
|
25
|
+
exports.gridVirtualizationEnabledSelector = gridVirtualizationEnabledSelector;
|
|
26
|
+
const gridVirtualizationColumnEnabledSelector = (0, _createSelector.createSelector)(gridVirtualizationSelector, state => state.enabledForColumns);
|
|
27
|
+
exports.gridVirtualizationColumnEnabledSelector = gridVirtualizationColumnEnabledSelector;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _useGridVirtualization = require("./useGridVirtualization");
|
|
7
|
+
Object.keys(_useGridVirtualization).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _useGridVirtualization[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _useGridVirtualization[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _gridVirtualizationSelectors = require("./gridVirtualizationSelectors");
|
|
18
|
+
Object.keys(_gridVirtualizationSelectors).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _gridVirtualizationSelectors[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _gridVirtualizationSelectors[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -26,12 +26,12 @@ var _gridRowSelectionSelector = require("../rowSelection/gridRowSelectionSelecto
|
|
|
26
26
|
var _gridRowsMetaSelector = require("../rows/gridRowsMetaSelector");
|
|
27
27
|
var _gridColumnsUtils = require("../columns/gridColumnsUtils");
|
|
28
28
|
var _gridRowsUtils = require("../rows/gridRowsUtils");
|
|
29
|
+
var _gridVirtualizationSelectors = require("./gridVirtualizationSelectors");
|
|
29
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
31
|
const _excluded = ["style"],
|
|
31
|
-
_excluded2 = ["style"];
|
|
32
|
+
_excluded2 = ["style"]; // Uses binary search to avoid looping through all possible positions
|
|
32
33
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
34
|
-
// Uses binary search to avoid looping through all possible positions
|
|
35
35
|
function binarySearch(offset, positions, sliceStart = 0, sliceEnd = positions.length) {
|
|
36
36
|
if (positions.length <= 0) {
|
|
37
37
|
return -1;
|
|
@@ -77,9 +77,10 @@ const useGridVirtualScroller = props => {
|
|
|
77
77
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
78
78
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
79
79
|
const visibleColumns = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector);
|
|
80
|
+
const enabled = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationEnabledSelector);
|
|
81
|
+
const enabledForColumns = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationColumnEnabledSelector);
|
|
80
82
|
const {
|
|
81
83
|
ref,
|
|
82
|
-
disableVirtualization,
|
|
83
84
|
onRenderZonePositioning,
|
|
84
85
|
renderZoneMinColumnIndex = 0,
|
|
85
86
|
renderZoneMaxColumnIndex = visibleColumns.length,
|
|
@@ -96,7 +97,7 @@ const useGridVirtualScroller = props => {
|
|
|
96
97
|
const renderZoneRef = React.useRef(null);
|
|
97
98
|
const rootRef = React.useRef(null);
|
|
98
99
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, rootRef);
|
|
99
|
-
const [renderContext,
|
|
100
|
+
const [renderContext, setRenderContextState] = React.useState(null);
|
|
100
101
|
const prevRenderContext = React.useRef(renderContext);
|
|
101
102
|
const scrollPosition = React.useRef({
|
|
102
103
|
top: 0,
|
|
@@ -107,6 +108,12 @@ const useGridVirtualScroller = props => {
|
|
|
107
108
|
height: null
|
|
108
109
|
});
|
|
109
110
|
const prevTotalWidth = React.useRef(columnsTotalWidth);
|
|
111
|
+
// Each visible row (not to be confused with a filter result) is composed of a central row element
|
|
112
|
+
// and up to two additional row elements for pinned columns (left and right).
|
|
113
|
+
// When hovering any of these elements, the :hover styles are applied only to the row element that
|
|
114
|
+
// was actually hovered, not its additional siblings. To make it look like a contiguous row,
|
|
115
|
+
// we add/remove the .Mui-hovered class to all of the row elements inside one visible row.
|
|
116
|
+
const [hoveredRowId, setHoveredRowId] = React.useState(null);
|
|
110
117
|
const rowStyleCache = React.useRef(Object.create(null));
|
|
111
118
|
const prevGetRowProps = React.useRef();
|
|
112
119
|
const prevRootRowStyle = React.useRef();
|
|
@@ -158,7 +165,7 @@ const useGridVirtualScroller = props => {
|
|
|
158
165
|
return exponentialSearch(offset, rowsMeta.positions, lastMeasuredIndexRelativeToCurrentPage);
|
|
159
166
|
}, [apiRef, currentPage.range?.firstRowIndex, currentPage.range?.lastRowIndex, rowsMeta.positions]);
|
|
160
167
|
const computeRenderContext = React.useCallback(() => {
|
|
161
|
-
if (
|
|
168
|
+
if (!enabled) {
|
|
162
169
|
return {
|
|
163
170
|
firstRowIndex: 0,
|
|
164
171
|
lastRowIndex: currentPage.rows.length,
|
|
@@ -175,23 +182,25 @@ const useGridVirtualScroller = props => {
|
|
|
175
182
|
// In the last index, this is not needed because Array.slice doesn't include it.
|
|
176
183
|
const firstRowIndex = Math.min(getNearestIndexToRender(top), rowsMeta.positions.length - 1);
|
|
177
184
|
const lastRowIndex = rootProps.autoHeight ? firstRowIndex + currentPage.rows.length : getNearestIndexToRender(top + containerDimensions.height);
|
|
178
|
-
let hasRowWithAutoHeight = false;
|
|
179
185
|
let firstColumnIndex = 0;
|
|
180
186
|
let lastColumnIndex = columnPositions.length;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
187
|
+
if (enabledForColumns) {
|
|
188
|
+
let hasRowWithAutoHeight = false;
|
|
189
|
+
const [firstRowToRender, lastRowToRender] = getRenderableIndexes({
|
|
190
|
+
firstIndex: firstRowIndex,
|
|
191
|
+
lastIndex: lastRowIndex,
|
|
192
|
+
minFirstIndex: 0,
|
|
193
|
+
maxLastIndex: currentPage.rows.length,
|
|
194
|
+
buffer: rootProps.rowBuffer
|
|
195
|
+
});
|
|
196
|
+
for (let i = firstRowToRender; i < lastRowToRender && !hasRowWithAutoHeight; i += 1) {
|
|
197
|
+
const row = currentPage.rows[i];
|
|
198
|
+
hasRowWithAutoHeight = apiRef.current.rowHasAutoHeight(row.id);
|
|
199
|
+
}
|
|
200
|
+
if (!hasRowWithAutoHeight) {
|
|
201
|
+
firstColumnIndex = binarySearch(Math.abs(left), columnPositions);
|
|
202
|
+
lastColumnIndex = binarySearch(Math.abs(left) + containerDimensions.width, columnPositions);
|
|
203
|
+
}
|
|
195
204
|
}
|
|
196
205
|
return {
|
|
197
206
|
firstRowIndex,
|
|
@@ -199,16 +208,16 @@ const useGridVirtualScroller = props => {
|
|
|
199
208
|
firstColumnIndex,
|
|
200
209
|
lastColumnIndex
|
|
201
210
|
};
|
|
202
|
-
}, [
|
|
211
|
+
}, [enabled, enabledForColumns, getNearestIndexToRender, rowsMeta.positions.length, rootProps.autoHeight, rootProps.rowBuffer, currentPage.rows, columnPositions, visibleColumns.length, apiRef, containerDimensions]);
|
|
203
212
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
204
|
-
if (
|
|
205
|
-
renderZoneRef.current.style.transform = `translate3d(0px, 0px, 0px)`;
|
|
206
|
-
} else {
|
|
213
|
+
if (enabled) {
|
|
207
214
|
// TODO a scroll reset should not be necessary
|
|
208
215
|
rootRef.current.scrollLeft = 0;
|
|
209
216
|
rootRef.current.scrollTop = 0;
|
|
217
|
+
} else {
|
|
218
|
+
renderZoneRef.current.style.transform = `translate3d(0px, 0px, 0px)`;
|
|
210
219
|
}
|
|
211
|
-
}, [
|
|
220
|
+
}, [enabled]);
|
|
212
221
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
213
222
|
setContainerDimensions({
|
|
214
223
|
width: rootRef.current.clientWidth,
|
|
@@ -257,12 +266,13 @@ const useGridVirtualScroller = props => {
|
|
|
257
266
|
});
|
|
258
267
|
}
|
|
259
268
|
}, [apiRef, currentPage.rows, onRenderZonePositioning, renderZoneMinColumnIndex, renderZoneMaxColumnIndex, rootProps.columnBuffer, rootProps.rowBuffer, theme.direction]);
|
|
260
|
-
const
|
|
269
|
+
const getRenderContext = React.useCallback(() => prevRenderContext.current, []);
|
|
270
|
+
const setRenderContext = React.useCallback(nextRenderContext => {
|
|
261
271
|
if (prevRenderContext.current && areRenderContextsEqual(nextRenderContext, prevRenderContext.current)) {
|
|
262
272
|
updateRenderZonePosition(nextRenderContext);
|
|
263
273
|
return;
|
|
264
274
|
}
|
|
265
|
-
|
|
275
|
+
setRenderContextState(nextRenderContext);
|
|
266
276
|
updateRenderZonePosition(nextRenderContext);
|
|
267
277
|
const [firstRowToRender, lastRowToRender] = getRenderableIndexes({
|
|
268
278
|
firstIndex: nextRenderContext.firstRowIndex,
|
|
@@ -276,13 +286,13 @@ const useGridVirtualScroller = props => {
|
|
|
276
286
|
lastRowToRender
|
|
277
287
|
});
|
|
278
288
|
prevRenderContext.current = nextRenderContext;
|
|
279
|
-
}, [apiRef,
|
|
289
|
+
}, [apiRef, setRenderContextState, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer, updateRenderZonePosition]);
|
|
280
290
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
281
291
|
if (containerDimensions.width == null) {
|
|
282
292
|
return;
|
|
283
293
|
}
|
|
284
294
|
const initialRenderContext = computeRenderContext();
|
|
285
|
-
|
|
295
|
+
setRenderContext(initialRenderContext);
|
|
286
296
|
const {
|
|
287
297
|
top,
|
|
288
298
|
left
|
|
@@ -293,7 +303,7 @@ const useGridVirtualScroller = props => {
|
|
|
293
303
|
renderContext: initialRenderContext
|
|
294
304
|
};
|
|
295
305
|
apiRef.current.publishEvent('scrollPositionChange', params);
|
|
296
|
-
}, [apiRef, computeRenderContext, containerDimensions.width,
|
|
306
|
+
}, [apiRef, computeRenderContext, containerDimensions.width, setRenderContext]);
|
|
297
307
|
const handleScroll = (0, _utils.unstable_useEventCallback)(event => {
|
|
298
308
|
const {
|
|
299
309
|
scrollTop,
|
|
@@ -318,7 +328,7 @@ const useGridVirtualScroller = props => {
|
|
|
318
328
|
}
|
|
319
329
|
|
|
320
330
|
// When virtualization is disabled, the context never changes during scroll
|
|
321
|
-
const nextRenderContext =
|
|
331
|
+
const nextRenderContext = enabled ? computeRenderContext() : prevRenderContext.current;
|
|
322
332
|
const topRowsScrolledSincePreviousRender = Math.abs(nextRenderContext.firstRowIndex - prevRenderContext.current.firstRowIndex);
|
|
323
333
|
const bottomRowsScrolledSincePreviousRender = Math.abs(nextRenderContext.lastRowIndex - prevRenderContext.current.lastRowIndex);
|
|
324
334
|
const topColumnsScrolledSincePreviousRender = Math.abs(nextRenderContext.firstColumnIndex - prevRenderContext.current.firstColumnIndex);
|
|
@@ -332,7 +342,7 @@ const useGridVirtualScroller = props => {
|
|
|
332
342
|
if (shouldSetState) {
|
|
333
343
|
// Prevents batching render context changes
|
|
334
344
|
ReactDOM.flushSync(() => {
|
|
335
|
-
|
|
345
|
+
setRenderContext(nextRenderContext);
|
|
336
346
|
});
|
|
337
347
|
prevTotalWidth.current = columnsTotalWidth;
|
|
338
348
|
}
|
|
@@ -349,6 +359,12 @@ const useGridVirtualScroller = props => {
|
|
|
349
359
|
}
|
|
350
360
|
return -1;
|
|
351
361
|
}, [cellFocus, currentPage.rows]);
|
|
362
|
+
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'rowMouseEnter', params => {
|
|
363
|
+
setHoveredRowId(params.id ?? null);
|
|
364
|
+
});
|
|
365
|
+
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'rowMouseLeave', () => {
|
|
366
|
+
setHoveredRowId(null);
|
|
367
|
+
});
|
|
352
368
|
const getRows = (params = {
|
|
353
369
|
renderContext
|
|
354
370
|
}) => {
|
|
@@ -364,8 +380,8 @@ const useGridVirtualScroller = props => {
|
|
|
364
380
|
if (!nextRenderContext || availableSpace == null) {
|
|
365
381
|
return null;
|
|
366
382
|
}
|
|
367
|
-
const rowBuffer =
|
|
368
|
-
const columnBuffer =
|
|
383
|
+
const rowBuffer = enabled ? rootProps.rowBuffer : 0;
|
|
384
|
+
const columnBuffer = enabled ? rootProps.columnBuffer : 0;
|
|
369
385
|
const [firstRowToRender, lastRowToRender] = getRenderableIndexes({
|
|
370
386
|
firstIndex: nextRenderContext.firstRowIndex,
|
|
371
387
|
lastIndex: nextRenderContext.lastRowIndex,
|
|
@@ -505,6 +521,7 @@ const useGridVirtualScroller = props => {
|
|
|
505
521
|
isLastVisible: lastVisibleRowIndex,
|
|
506
522
|
position: position
|
|
507
523
|
}, rowProps, rootRowProps, {
|
|
524
|
+
hovered: hoveredRowId === id,
|
|
508
525
|
style: rowStyleCache.current[id]
|
|
509
526
|
}), id));
|
|
510
527
|
}
|
|
@@ -546,9 +563,6 @@ const useGridVirtualScroller = props => {
|
|
|
546
563
|
}
|
|
547
564
|
return style;
|
|
548
565
|
}, [needsHorizontalScrollbar, rootProps.autoHeight]);
|
|
549
|
-
const getRenderContext = React.useCallback(() => {
|
|
550
|
-
return prevRenderContext.current;
|
|
551
|
-
}, []);
|
|
552
566
|
apiRef.current.register('private', {
|
|
553
567
|
getRenderContext
|
|
554
568
|
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useGridVirtualization = useGridVirtualization;
|
|
8
|
+
exports.virtualizationStateInitializer = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _useGridApiMethod = require("../../utils/useGridApiMethod");
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
const virtualizationStateInitializer = (state, props) => {
|
|
15
|
+
const virtualization = {
|
|
16
|
+
enabled: !props.disableVirtualization,
|
|
17
|
+
enabledForColumns: true
|
|
18
|
+
};
|
|
19
|
+
return (0, _extends2.default)({}, state, {
|
|
20
|
+
virtualization
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
exports.virtualizationStateInitializer = virtualizationStateInitializer;
|
|
24
|
+
function useGridVirtualization(apiRef, props) {
|
|
25
|
+
/*
|
|
26
|
+
* API METHODS
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
const setVirtualization = enabled => {
|
|
30
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
31
|
+
virtualization: (0, _extends2.default)({}, state.virtualization, {
|
|
32
|
+
enabled
|
|
33
|
+
})
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
const setColumnVirtualization = enabled => {
|
|
37
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
38
|
+
virtualization: (0, _extends2.default)({}, state.virtualization, {
|
|
39
|
+
enabledForColumns: enabled
|
|
40
|
+
})
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
const api = {
|
|
44
|
+
unstable_setVirtualization: setVirtualization,
|
|
45
|
+
unstable_setColumnVirtualization: setColumnVirtualization
|
|
46
|
+
};
|
|
47
|
+
(0, _useGridApiMethod.useGridApiMethod)(apiRef, api, 'public');
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
* EFFECTS
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
54
|
+
React.useEffect(() => {
|
|
55
|
+
setVirtualization(!props.disableVirtualization);
|
|
56
|
+
}, [props.disableVirtualization]);
|
|
57
|
+
/* eslint-enable react-hooks/exhaustive-deps */
|
|
58
|
+
}
|
package/node/index.js
CHANGED
package/node/internals/index.js
CHANGED
|
@@ -26,6 +26,7 @@ var _exportNames = {
|
|
|
26
26
|
columnsStateInitializer: true,
|
|
27
27
|
getTotalHeaderHeight: true,
|
|
28
28
|
useGridColumnSpanning: true,
|
|
29
|
+
gridColumnsStateSelector: true,
|
|
29
30
|
useGridColumnGrouping: true,
|
|
30
31
|
columnGroupsStateInitializer: true,
|
|
31
32
|
useGridDensity: true,
|
|
@@ -292,6 +293,12 @@ Object.defineProperty(exports, "gridAdditionalRowGroupsSelector", {
|
|
|
292
293
|
return _gridRowsSelector.gridAdditionalRowGroupsSelector;
|
|
293
294
|
}
|
|
294
295
|
});
|
|
296
|
+
Object.defineProperty(exports, "gridColumnsStateSelector", {
|
|
297
|
+
enumerable: true,
|
|
298
|
+
get: function () {
|
|
299
|
+
return _gridColumnsSelector.gridColumnsStateSelector;
|
|
300
|
+
}
|
|
301
|
+
});
|
|
295
302
|
Object.defineProperty(exports, "gridEditRowsStateSelector", {
|
|
296
303
|
enumerable: true,
|
|
297
304
|
get: function () {
|
|
@@ -646,6 +653,7 @@ var _useGridColumnMenu = require("../hooks/features/columnMenu/useGridColumnMenu
|
|
|
646
653
|
var _useGridColumns = require("../hooks/features/columns/useGridColumns");
|
|
647
654
|
var _gridColumnsUtils = require("../hooks/features/columns/gridColumnsUtils");
|
|
648
655
|
var _useGridColumnSpanning = require("../hooks/features/columns/useGridColumnSpanning");
|
|
656
|
+
var _gridColumnsSelector = require("../hooks/features/columns/gridColumnsSelector");
|
|
649
657
|
var _useGridColumnGrouping = require("../hooks/features/columnGrouping/useGridColumnGrouping");
|
|
650
658
|
var _useGridDensity = require("../hooks/features/density/useGridDensity");
|
|
651
659
|
var _useGridCsvExport = require("../hooks/features/export/useGridCsvExport");
|
|
@@ -674,10 +682,34 @@ var _useGridEvents = require("../hooks/features/events/useGridEvents");
|
|
|
674
682
|
var _useGridDimensions = require("../hooks/features/dimensions/useGridDimensions");
|
|
675
683
|
var _useGridStatePersistence = require("../hooks/features/statePersistence/useGridStatePersistence");
|
|
676
684
|
var _useGridVirtualScroller = require("../hooks/features/virtualization/useGridVirtualScroller");
|
|
685
|
+
var _virtualization = require("../hooks/features/virtualization");
|
|
686
|
+
Object.keys(_virtualization).forEach(function (key) {
|
|
687
|
+
if (key === "default" || key === "__esModule") return;
|
|
688
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
689
|
+
if (key in exports && exports[key] === _virtualization[key]) return;
|
|
690
|
+
Object.defineProperty(exports, key, {
|
|
691
|
+
enumerable: true,
|
|
692
|
+
get: function () {
|
|
693
|
+
return _virtualization[key];
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
});
|
|
677
697
|
var _useTimeout = require("../hooks/utils/useTimeout");
|
|
678
698
|
var _useGridVisibleRows = require("../hooks/utils/useGridVisibleRows");
|
|
679
699
|
var _useGridInitializeState = require("../hooks/utils/useGridInitializeState");
|
|
680
700
|
var _utils = require("../hooks/features/export/utils");
|
|
701
|
+
var _createControllablePromise = require("../utils/createControllablePromise");
|
|
702
|
+
Object.keys(_createControllablePromise).forEach(function (key) {
|
|
703
|
+
if (key === "default" || key === "__esModule") return;
|
|
704
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
705
|
+
if (key in exports && exports[key] === _createControllablePromise[key]) return;
|
|
706
|
+
Object.defineProperty(exports, key, {
|
|
707
|
+
enumerable: true,
|
|
708
|
+
get: function () {
|
|
709
|
+
return _createControllablePromise[key];
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
});
|
|
681
713
|
var _createSelector = require("../utils/createSelector");
|
|
682
714
|
var _domUtils = require("../utils/domUtils");
|
|
683
715
|
var _keyboardUtils = require("../utils/keyboardUtils");
|
|
@@ -685,6 +717,18 @@ var _utils2 = require("../utils/utils");
|
|
|
685
717
|
var _warning = require("../utils/warning");
|
|
686
718
|
var _exportAs = require("../utils/exportAs");
|
|
687
719
|
var _useGridPrivateApiContext = require("../hooks/utils/useGridPrivateApiContext");
|
|
720
|
+
var _useOnMount = require("../hooks/utils/useOnMount");
|
|
721
|
+
Object.keys(_useOnMount).forEach(function (key) {
|
|
722
|
+
if (key === "default" || key === "__esModule") return;
|
|
723
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
724
|
+
if (key in exports && exports[key] === _useOnMount[key]) return;
|
|
725
|
+
Object.defineProperty(exports, key, {
|
|
726
|
+
enumerable: true,
|
|
727
|
+
get: function () {
|
|
728
|
+
return _useOnMount[key];
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
});
|
|
688
732
|
var _csvSerializer = require("../hooks/features/export/serializers/csvSerializer");
|
|
689
733
|
var _utils3 = require("../colDef/utils");
|
|
690
734
|
Object.keys(_utils3).forEach(function (key) {
|