@mui/x-data-grid 5.15.2 → 5.17.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 +177 -2
- package/DataGrid/DataGrid.js +3 -1
- package/DataGrid/useDataGridComponent.js +5 -0
- package/README.md +2 -1
- package/components/DataGridColumnHeaders.js +4 -3
- package/components/ErrorBoundary.d.ts +1 -0
- package/components/GridAutoSizer.js +7 -0
- package/components/GridRow.d.ts +2 -1
- package/components/GridRow.js +136 -85
- package/components/base/GridBody.js +8 -5
- package/components/base/GridOverlays.js +4 -7
- package/components/cell/GridActionsCellItem.d.ts +2 -2
- package/components/cell/GridBooleanCell.js +2 -1
- package/components/cell/GridEditBooleanCell.js +2 -1
- package/components/cell/GridEditDateCell.js +3 -2
- package/components/cell/GridEditInputCell.js +2 -1
- package/components/cell/GridEditSingleSelectCell.js +11 -2
- package/components/cell/GridSkeletonCell.d.ts +12 -0
- package/components/cell/GridSkeletonCell.js +60 -0
- package/components/cell/index.d.ts +1 -0
- package/components/cell/index.js +2 -1
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +14 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +122 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +55 -71
- package/components/columnHeaders/GridColumnHeadersInner.js +2 -1
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +32 -0
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +104 -0
- package/components/columnSelection/GridCellCheckboxRenderer.js +2 -1
- package/components/containers/GridOverlay.js +7 -1
- package/components/containers/GridRoot.js +3 -3
- package/components/containers/GridRootStyles.js +16 -2
- package/components/menu/GridMenu.d.ts +3 -2
- package/components/menu/GridMenu.js +1 -0
- package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
- package/components/panel/GridColumnsPanel.d.ts +6 -1
- package/components/panel/GridColumnsPanel.js +38 -6
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanel.js +1 -0
- package/components/panel/filterPanel/GridFilterForm.d.ts +4 -0
- package/components/panel/filterPanel/GridFilterForm.js +5 -0
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterPanel.d.ts +4 -0
- package/components/panel/filterPanel/GridFilterPanel.js +5 -0
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/constants/defaultGridSlotsComponents.js +2 -1
- package/constants/gridClasses.d.ts +24 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +5 -1
- package/hooks/features/columnGrouping/gridColumnGroupsInterfaces.d.ts +7 -0
- package/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +1 -0
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +7 -0
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +8 -0
- package/hooks/features/columnGrouping/index.d.ts +2 -0
- package/hooks/features/columnGrouping/index.js +2 -0
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +24 -0
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +153 -0
- package/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.d.ts +4 -0
- package/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +35 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +7 -6
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +204 -9
- package/hooks/features/density/densitySelector.d.ts +2 -0
- package/hooks/features/density/densitySelector.js +3 -1
- package/hooks/features/density/densityState.d.ts +1 -0
- package/hooks/features/density/useGridDensity.d.ts +1 -1
- package/hooks/features/density/useGridDensity.js +45 -9
- package/hooks/features/dimensions/useGridDimensions.js +4 -4
- package/hooks/features/export/useGridPrintExport.js +3 -3
- package/hooks/features/filter/gridFilterSelector.d.ts +3 -3
- package/hooks/features/filter/gridFilterUtils.d.ts +1 -1
- package/hooks/features/filter/gridFilterUtils.js +55 -54
- package/hooks/features/filter/useGridFilter.js +1 -1
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/pagination/gridPaginationSelector.d.ts +1 -1
- package/hooks/features/rows/gridRowsSelector.d.ts +1 -1
- package/hooks/features/rows/useGridParamsApi.js +1 -1
- package/hooks/features/rows/useGridRows.js +65 -8
- package/hooks/features/rows/useGridRowsMeta.js +36 -16
- package/hooks/features/selection/gridSelectionSelector.d.ts +1 -1
- package/hooks/features/sorting/gridSortingSelector.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.js +17 -5
- package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridNativeEventListener.js +2 -2
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +2 -0
- package/legacy/DataGrid/DataGrid.js +3 -1
- package/legacy/DataGrid/useDataGridComponent.js +5 -0
- package/legacy/components/DataGridColumnHeaders.js +4 -3
- package/legacy/components/GridAutoSizer.js +7 -0
- package/legacy/components/GridRow.js +138 -85
- package/legacy/components/base/GridBody.js +8 -5
- package/legacy/components/base/GridOverlays.js +4 -7
- package/legacy/components/cell/GridBooleanCell.js +2 -1
- package/legacy/components/cell/GridEditBooleanCell.js +2 -1
- package/legacy/components/cell/GridEditDateCell.js +3 -2
- package/legacy/components/cell/GridEditInputCell.js +2 -1
- package/legacy/components/cell/GridEditSingleSelectCell.js +11 -2
- package/legacy/components/cell/GridSkeletonCell.js +57 -0
- package/legacy/components/cell/index.js +2 -1
- package/legacy/components/columnHeaders/GridColumnGroupHeader.js +120 -0
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +78 -88
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +2 -1
- package/legacy/components/columnHeaders/GridGenericColumnHeaderItem.js +112 -0
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +2 -1
- package/legacy/components/containers/GridOverlay.js +7 -1
- package/legacy/components/containers/GridRoot.js +3 -3
- package/legacy/components/containers/GridRootStyles.js +14 -5
- package/legacy/components/menu/GridMenu.js +1 -0
- package/legacy/components/panel/GridColumnsPanel.js +41 -6
- package/legacy/components/panel/GridPanel.js +1 -0
- package/legacy/components/panel/filterPanel/GridFilterForm.js +5 -0
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +5 -0
- package/legacy/constants/defaultGridSlotsComponents.js +2 -1
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +1 -0
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +12 -0
- package/legacy/hooks/features/columnGrouping/index.js +2 -0
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +151 -0
- package/legacy/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +35 -0
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +213 -12
- package/legacy/hooks/features/density/densitySelector.js +6 -0
- package/legacy/hooks/features/density/useGridDensity.js +44 -6
- package/legacy/hooks/features/dimensions/useGridDimensions.js +4 -4
- package/legacy/hooks/features/export/useGridPrintExport.js +3 -3
- package/legacy/hooks/features/filter/gridFilterUtils.js +61 -56
- package/legacy/hooks/features/filter/useGridFilter.js +1 -1
- package/legacy/hooks/features/index.js +1 -0
- package/legacy/hooks/features/rows/useGridParamsApi.js +1 -1
- package/legacy/hooks/features/rows/useGridRows.js +73 -8
- package/legacy/hooks/features/rows/useGridRowsMeta.js +45 -18
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +31 -13
- package/legacy/hooks/utils/useGridNativeEventListener.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +2 -0
- package/legacy/models/api/gridColumnGroupingApi.js +1 -0
- package/legacy/models/events/gridEvents.js +2 -0
- package/legacy/models/gridColumnGrouping.js +6 -0
- package/legacy/models/index.js +2 -1
- package/legacy/models/params/gridRenderedRowsIntervalChangeParams.js +1 -0
- package/legacy/models/params/index.js +2 -1
- package/legacy/utils/utils.js +18 -0
- package/models/api/gridApiCommon.d.ts +2 -1
- package/models/api/gridColumnGroupingApi.d.ts +19 -0
- package/models/api/gridColumnGroupingApi.js +1 -0
- package/models/api/gridDensityApi.d.ts +2 -1
- package/models/api/gridParamsApi.d.ts +1 -1
- package/models/api/gridRowApi.d.ts +6 -0
- package/models/api/gridRowsMetaApi.d.ts +6 -1
- package/models/colDef/gridColDef.d.ts +15 -1
- package/models/events/gridEventLookup.d.ts +7 -1
- package/models/events/gridEvents.d.ts +3 -1
- package/models/events/gridEvents.js +2 -0
- package/models/gridColumnGrouping.d.ts +67 -0
- package/models/gridColumnGrouping.js +6 -0
- package/models/gridRows.d.ts +5 -5
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridStateCommunity.d.ts +2 -1
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/models/params/gridCellParams.d.ts +7 -2
- package/models/params/gridMenuParams.d.ts +1 -2
- package/models/params/gridRenderedRowsIntervalChangeParams.d.ts +10 -0
- package/models/params/gridRenderedRowsIntervalChangeParams.js +1 -0
- package/models/params/index.d.ts +1 -0
- package/models/params/index.js +2 -1
- package/models/props/DataGridProps.d.ts +7 -1
- package/modern/DataGrid/DataGrid.js +3 -1
- package/modern/DataGrid/useDataGridComponent.js +5 -0
- package/modern/components/DataGridColumnHeaders.js +4 -3
- package/modern/components/GridAutoSizer.js +7 -0
- package/modern/components/GridRow.js +133 -84
- package/modern/components/base/GridBody.js +8 -5
- package/modern/components/base/GridOverlays.js +4 -7
- package/modern/components/cell/GridBooleanCell.js +2 -1
- package/modern/components/cell/GridEditBooleanCell.js +2 -1
- package/modern/components/cell/GridEditDateCell.js +3 -2
- package/modern/components/cell/GridEditInputCell.js +2 -1
- package/modern/components/cell/GridEditSingleSelectCell.js +11 -2
- package/modern/components/cell/GridSkeletonCell.js +60 -0
- package/modern/components/cell/index.js +2 -1
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +120 -0
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +53 -69
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +2 -1
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +104 -0
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -1
- package/modern/components/containers/GridOverlay.js +7 -1
- package/modern/components/containers/GridRoot.js +3 -3
- package/modern/components/containers/GridRootStyles.js +16 -2
- package/modern/components/menu/GridMenu.js +1 -0
- package/modern/components/panel/GridColumnsPanel.js +38 -6
- package/modern/components/panel/GridPanel.js +1 -0
- package/modern/components/panel/filterPanel/GridFilterForm.js +5 -0
- package/modern/components/panel/filterPanel/GridFilterPanel.js +5 -0
- package/modern/constants/defaultGridSlotsComponents.js +2 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +1 -0
- package/modern/hooks/features/columnGrouping/gridColumnGroupsSelector.js +8 -0
- package/modern/hooks/features/columnGrouping/index.js +2 -0
- package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +145 -0
- package/modern/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +29 -0
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +186 -9
- package/modern/hooks/features/density/densitySelector.js +3 -1
- package/modern/hooks/features/density/useGridDensity.js +37 -9
- package/modern/hooks/features/dimensions/useGridDimensions.js +4 -4
- package/modern/hooks/features/export/useGridPrintExport.js +3 -3
- package/modern/hooks/features/filter/gridFilterUtils.js +54 -53
- package/modern/hooks/features/filter/useGridFilter.js +1 -1
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/rows/useGridParamsApi.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +65 -8
- package/modern/hooks/features/rows/useGridRowsMeta.js +36 -16
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +17 -5
- package/modern/hooks/utils/useGridNativeEventListener.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -0
- package/modern/models/api/gridColumnGroupingApi.js +1 -0
- package/modern/models/events/gridEvents.js +2 -0
- package/modern/models/gridColumnGrouping.js +6 -0
- package/modern/models/index.js +2 -1
- package/modern/models/params/gridRenderedRowsIntervalChangeParams.js +1 -0
- package/modern/models/params/index.js +2 -1
- package/modern/utils/utils.js +16 -0
- package/node/DataGrid/DataGrid.js +3 -1
- package/node/DataGrid/useDataGridComponent.js +7 -0
- package/node/components/DataGridColumnHeaders.js +4 -3
- package/node/components/GridAutoSizer.js +7 -0
- package/node/components/GridRow.js +136 -77
- package/node/components/base/GridBody.js +7 -4
- package/node/components/base/GridOverlays.js +3 -6
- package/node/components/cell/GridBooleanCell.js +2 -1
- package/node/components/cell/GridEditBooleanCell.js +2 -1
- package/node/components/cell/GridEditDateCell.js +3 -2
- package/node/components/cell/GridEditInputCell.js +2 -1
- package/node/components/cell/GridEditSingleSelectCell.js +11 -2
- package/node/components/cell/GridSkeletonCell.js +81 -0
- package/node/components/cell/index.js +13 -0
- package/node/components/columnHeaders/GridColumnGroupHeader.js +141 -0
- package/node/components/columnHeaders/GridColumnHeaderItem.js +53 -72
- package/node/components/columnHeaders/GridColumnHeadersInner.js +2 -1
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +126 -0
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -1
- package/node/components/containers/GridOverlay.js +7 -1
- package/node/components/containers/GridRoot.js +4 -4
- package/node/components/containers/GridRootStyles.js +16 -2
- package/node/components/menu/GridMenu.js +1 -0
- package/node/components/panel/GridColumnsPanel.js +36 -5
- package/node/components/panel/GridPanel.js +1 -0
- package/node/components/panel/filterPanel/GridFilterForm.js +5 -0
- package/node/components/panel/filterPanel/GridFilterPanel.js +5 -0
- package/node/constants/defaultGridSlotsComponents.js +1 -0
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +5 -0
- package/node/hooks/features/columnGrouping/gridColumnGroupsSelector.js +18 -0
- package/node/hooks/features/columnGrouping/index.js +18 -0
- package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +182 -0
- package/node/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +55 -0
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +207 -8
- package/node/hooks/features/density/densitySelector.js +6 -2
- package/node/hooks/features/density/useGridDensity.js +48 -9
- package/node/hooks/features/dimensions/useGridDimensions.js +3 -3
- package/node/hooks/features/export/useGridPrintExport.js +2 -2
- package/node/hooks/features/filter/gridFilterUtils.js +55 -55
- package/node/hooks/features/filter/useGridFilter.js +1 -1
- package/node/hooks/features/index.js +13 -0
- package/node/hooks/features/rows/useGridParamsApi.js +1 -1
- package/node/hooks/features/rows/useGridRows.js +60 -7
- package/node/hooks/features/rows/useGridRowsMeta.js +35 -15
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +17 -5
- package/node/hooks/utils/useGridNativeEventListener.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/index.js +22 -0
- package/node/models/api/gridColumnGroupingApi.js +5 -0
- package/node/models/events/gridEvents.js +2 -0
- package/node/models/gridColumnGrouping.js +13 -0
- package/node/models/index.js +13 -0
- package/node/models/params/gridRenderedRowsIntervalChangeParams.js +5 -0
- package/node/models/params/index.js +13 -0
- package/node/utils/utils.js +18 -0
- package/package.json +3 -3
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +16 -0
|
@@ -238,8 +238,24 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
238
238
|
}, [renderContext, updateRenderZonePosition]);
|
|
239
239
|
var updateRenderContext = React.useCallback(function (nextRenderContext) {
|
|
240
240
|
setRenderContext(nextRenderContext);
|
|
241
|
+
|
|
242
|
+
var _getRenderableIndexes7 = getRenderableIndexes({
|
|
243
|
+
firstIndex: nextRenderContext.firstRowIndex,
|
|
244
|
+
lastIndex: nextRenderContext.lastRowIndex,
|
|
245
|
+
minFirstIndex: 0,
|
|
246
|
+
maxLastIndex: currentPage.rows.length,
|
|
247
|
+
buffer: rootProps.rowBuffer
|
|
248
|
+
}),
|
|
249
|
+
_getRenderableIndexes8 = _slicedToArray(_getRenderableIndexes7, 2),
|
|
250
|
+
firstRowToRender = _getRenderableIndexes8[0],
|
|
251
|
+
lastRowToRender = _getRenderableIndexes8[1];
|
|
252
|
+
|
|
253
|
+
apiRef.current.publishEvent('renderedRowsIntervalChange', {
|
|
254
|
+
firstRowToRender: firstRowToRender,
|
|
255
|
+
lastRowToRender: lastRowToRender
|
|
256
|
+
});
|
|
241
257
|
prevRenderContext.current = nextRenderContext;
|
|
242
|
-
}, [setRenderContext, prevRenderContext]);
|
|
258
|
+
}, [apiRef, setRenderContext, prevRenderContext, currentPage.rows.length, rootProps.rowBuffer]);
|
|
243
259
|
React.useEffect(function () {
|
|
244
260
|
if (containerWidth == null) {
|
|
245
261
|
return;
|
|
@@ -311,9 +327,10 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
311
327
|
maxLastColumn = _params$maxLastColumn === void 0 ? renderZoneMaxColumnIndex : _params$maxLastColumn,
|
|
312
328
|
_params$availableSpac = params.availableSpace,
|
|
313
329
|
availableSpace = _params$availableSpac === void 0 ? containerWidth : _params$availableSpac,
|
|
314
|
-
ignoreAutoHeight = params.ignoreAutoHeight,
|
|
315
330
|
_params$rowIndexOffse = params.rowIndexOffset,
|
|
316
|
-
rowIndexOffset = _params$rowIndexOffse === void 0 ? 0 : _params$rowIndexOffse
|
|
331
|
+
rowIndexOffset = _params$rowIndexOffse === void 0 ? 0 : _params$rowIndexOffse,
|
|
332
|
+
_params$position = params.position,
|
|
333
|
+
position = _params$position === void 0 ? 'center' : _params$position;
|
|
317
334
|
|
|
318
335
|
if (!nextRenderContext || availableSpace == null) {
|
|
319
336
|
return null;
|
|
@@ -322,16 +339,16 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
322
339
|
var rowBuffer = !disableVirtualization ? rootProps.rowBuffer : 0;
|
|
323
340
|
var columnBuffer = !disableVirtualization ? rootProps.columnBuffer : 0;
|
|
324
341
|
|
|
325
|
-
var
|
|
342
|
+
var _getRenderableIndexes9 = getRenderableIndexes({
|
|
326
343
|
firstIndex: nextRenderContext.firstRowIndex,
|
|
327
344
|
lastIndex: nextRenderContext.lastRowIndex,
|
|
328
345
|
minFirstIndex: 0,
|
|
329
346
|
maxLastIndex: currentPage.rows.length,
|
|
330
347
|
buffer: rowBuffer
|
|
331
348
|
}),
|
|
332
|
-
|
|
333
|
-
firstRowToRender =
|
|
334
|
-
lastRowToRender =
|
|
349
|
+
_getRenderableIndexes10 = _slicedToArray(_getRenderableIndexes9, 2),
|
|
350
|
+
firstRowToRender = _getRenderableIndexes10[0],
|
|
351
|
+
lastRowToRender = _getRenderableIndexes10[1];
|
|
335
352
|
|
|
336
353
|
var renderedRows = [];
|
|
337
354
|
|
|
@@ -362,16 +379,16 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
362
379
|
}
|
|
363
380
|
}
|
|
364
381
|
|
|
365
|
-
var
|
|
382
|
+
var _getRenderableIndexes11 = getRenderableIndexes({
|
|
366
383
|
firstIndex: nextRenderContext.firstColumnIndex,
|
|
367
384
|
lastIndex: nextRenderContext.lastColumnIndex,
|
|
368
385
|
minFirstIndex: minFirstColumn,
|
|
369
386
|
maxLastIndex: maxLastColumn,
|
|
370
387
|
buffer: columnBuffer
|
|
371
388
|
}),
|
|
372
|
-
|
|
373
|
-
initialFirstColumnToRender =
|
|
374
|
-
lastColumnToRender =
|
|
389
|
+
_getRenderableIndexes12 = _slicedToArray(_getRenderableIndexes11, 2),
|
|
390
|
+
initialFirstColumnToRender = _getRenderableIndexes12[0],
|
|
391
|
+
lastColumnToRender = _getRenderableIndexes12[1];
|
|
375
392
|
|
|
376
393
|
var firstColumnToRender = getFirstNonSpannedColumnToRender({
|
|
377
394
|
firstColumnToRender: initialFirstColumnToRender,
|
|
@@ -390,7 +407,7 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
390
407
|
_id = _renderedRows$i.id,
|
|
391
408
|
_model = _renderedRows$i.model;
|
|
392
409
|
var lastVisibleRowIndex = firstRowToRender + i === currentPage.rows.length - 1;
|
|
393
|
-
var baseRowHeight = !apiRef.current.unstable_rowHasAutoHeight(_id)
|
|
410
|
+
var baseRowHeight = !apiRef.current.unstable_rowHasAutoHeight(_id) ? apiRef.current.unstable_getRowHeight(_id) : 'auto';
|
|
394
411
|
var isSelected = void 0;
|
|
395
412
|
|
|
396
413
|
if (selectedRowsLookup[_id] == null) {
|
|
@@ -416,7 +433,8 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
416
433
|
selected: isSelected,
|
|
417
434
|
index: rowIndexOffset + ((currentPage == null ? void 0 : (_currentPage$range5 = currentPage.range) == null ? void 0 : _currentPage$range5.firstRowIndex) || 0) + firstRowToRender + i,
|
|
418
435
|
containerWidth: availableSpace,
|
|
419
|
-
isLastVisible: lastVisibleRowIndex
|
|
436
|
+
isLastVisible: lastVisibleRowIndex,
|
|
437
|
+
position: position
|
|
420
438
|
}, typeof getRowProps === 'function' ? getRowProps(_id, _model) : {}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.row), _id));
|
|
421
439
|
}
|
|
422
440
|
|
|
@@ -11,8 +11,8 @@ export var useGridNativeEventListener = function useGridNativeEventListener(apiR
|
|
|
11
11
|
setAdded = _React$useState2[1];
|
|
12
12
|
|
|
13
13
|
var handlerRef = React.useRef(handler);
|
|
14
|
-
var wrapHandler = React.useCallback(function (
|
|
15
|
-
return handlerRef.current && handlerRef.current(
|
|
14
|
+
var wrapHandler = React.useCallback(function (event) {
|
|
15
|
+
return handlerRef.current && handlerRef.current(event);
|
|
16
16
|
}, []);
|
|
17
17
|
React.useEffect(function () {
|
|
18
18
|
handlerRef.current = handler;
|
package/legacy/index.js
CHANGED
|
@@ -11,6 +11,8 @@ export { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridCol
|
|
|
11
11
|
export { useGridColumnMenu, columnMenuStateInitializer } from '../hooks/features/columnMenu/useGridColumnMenu';
|
|
12
12
|
export { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
|
|
13
13
|
export { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
|
|
14
|
+
export { useGridColumnGrouping, columnGroupsStateInitializer } from '../hooks/features/columnGrouping/useGridColumnGrouping';
|
|
15
|
+
export { useGridColumnGroupingPreProcessors } from '../hooks/features/columnGrouping/useGridColumnGroupingPreProcessors';
|
|
14
16
|
export { useGridDensity, densityStateInitializer } from '../hooks/features/density/useGridDensity';
|
|
15
17
|
export { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
|
|
16
18
|
export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -85,6 +85,8 @@ var GridEvents;
|
|
|
85
85
|
GridEvents["preferencePanelOpen"] = "preferencePanelOpen";
|
|
86
86
|
GridEvents["menuOpen"] = "menuOpen";
|
|
87
87
|
GridEvents["menuClose"] = "menuClose";
|
|
88
|
+
GridEvents["renderedRowsIntervalChange"] = "renderedRowsIntervalChange";
|
|
89
|
+
GridEvents["fetchRows"] = "fetchRows";
|
|
88
90
|
})(GridEvents || (GridEvents = {}));
|
|
89
91
|
|
|
90
92
|
export { GridEvents };
|
package/legacy/models/index.js
CHANGED
|
@@ -21,7 +21,8 @@ export * from './gridDensity';
|
|
|
21
21
|
export * from './logger';
|
|
22
22
|
export * from './muiEvent';
|
|
23
23
|
export * from './events';
|
|
24
|
-
export * from './gridSortModel';
|
|
24
|
+
export * from './gridSortModel';
|
|
25
|
+
export * from './gridColumnGrouping'; // Do not export GridExportFormat and GridExportExtension which are override in pro package
|
|
25
26
|
|
|
26
27
|
export * from './gridFilterOperator';
|
|
27
28
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,4 +11,5 @@ export * from './gridValueOptionsParams';
|
|
|
11
11
|
export * from './gridCellParams';
|
|
12
12
|
export * from './gridSortModelParams';
|
|
13
13
|
export * from './gridPreferencePanelParams';
|
|
14
|
-
export * from './gridMenuParams';
|
|
14
|
+
export * from './gridMenuParams';
|
|
15
|
+
export * from './gridRenderedRowsIntervalChangeParams';
|
package/legacy/utils/utils.js
CHANGED
|
@@ -180,4 +180,22 @@ export function isDeepEqual(a, b) {
|
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
return a !== a && b !== b;
|
|
183
|
+
} // Pseudo random number. See https://stackoverflow.com/a/47593316
|
|
184
|
+
|
|
185
|
+
function mulberry32(a) {
|
|
186
|
+
return function () {
|
|
187
|
+
/* eslint-disable */
|
|
188
|
+
var t = a += 0x6d2b79f5;
|
|
189
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
190
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
191
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
192
|
+
/* eslint-enable */
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function randomNumberBetween(seed, min, max) {
|
|
197
|
+
var random = mulberry32(seed);
|
|
198
|
+
return function () {
|
|
199
|
+
return min + (max - min) * random();
|
|
200
|
+
};
|
|
183
201
|
}
|
|
@@ -26,9 +26,10 @@ import type { GridStrategyProcessingApi } from '../../hooks/core/strategyProcess
|
|
|
26
26
|
import type { GridDimensionsApi } from '../../hooks/features/dimensions';
|
|
27
27
|
import type { GridPaginationApi } from '../../hooks/features/pagination';
|
|
28
28
|
import type { GridStatePersistenceApi } from '../../hooks/features/statePersistence';
|
|
29
|
+
import { GridColumnGroupingApi } from './gridColumnGroupingApi';
|
|
29
30
|
declare type GridStateApiUntyped = {
|
|
30
31
|
[key in keyof (GridStateApi<any> & GridStatePersistenceApi<any>)]: any;
|
|
31
32
|
};
|
|
32
|
-
export interface GridApiCommon extends GridCoreApi, GridLoggerApi, GridPipeProcessingApi, GridStrategyProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridVirtualScrollerApi, GridLocaleTextApi, GridClipboardApi, GridScrollApi, GridColumnSpanningApi, GridStateApiUntyped {
|
|
33
|
+
export interface GridApiCommon extends GridCoreApi, GridLoggerApi, GridPipeProcessingApi, GridStrategyProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridVirtualScrollerApi, GridLocaleTextApi, GridClipboardApi, GridScrollApi, GridColumnSpanningApi, GridStateApiUntyped, GridColumnGroupingApi {
|
|
33
34
|
}
|
|
34
35
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GridColumnGroupLookup } from '../../hooks/features/columnGrouping/gridColumnGroupsInterfaces';
|
|
2
|
+
import { GridColumnGroup } from '../gridColumnGrouping';
|
|
3
|
+
/**
|
|
4
|
+
* The column grouping API interface that is available in the grid [[apiRef]].
|
|
5
|
+
*/
|
|
6
|
+
export interface GridColumnGroupingApi {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the id of the groups leading to the requested column.
|
|
9
|
+
* The array is ordered by increasing depth (the last element is the direct parent of the column).
|
|
10
|
+
* @param {string} field The field of of the column requested.
|
|
11
|
+
* @returns {string[]} The id of the groups leading to the requested column.
|
|
12
|
+
*/
|
|
13
|
+
unstable_getColumnGroupPath: (field: string) => GridColumnGroup['groupId'][];
|
|
14
|
+
/**
|
|
15
|
+
* Returns the column group lookup.
|
|
16
|
+
* @returns {GridColumnGroupLookup} The column group lookup.
|
|
17
|
+
*/
|
|
18
|
+
unstable_getAllGroupDetails: () => GridColumnGroupLookup;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,6 +14,7 @@ export interface GridDensityApi {
|
|
|
14
14
|
* @param {string} density Can be: `"compact"`, `"standard"`, `"comfortable"`.
|
|
15
15
|
* @param {number} headerHeight The new header height.
|
|
16
16
|
* @param {number} rowHeight The new row height.
|
|
17
|
+
* @param {number} maxDepth The depth of maximal depth column header grouping tree.
|
|
17
18
|
*/
|
|
18
|
-
setDensity: (density: GridDensity, headerHeight?: number, rowHeight?: number) => void;
|
|
19
|
+
setDensity: (density: GridDensity, headerHeight?: number, rowHeight?: number, maxDepth?: number) => void;
|
|
19
20
|
}
|
|
@@ -24,7 +24,7 @@ export interface GridParamsApi {
|
|
|
24
24
|
* @param {string} field The column field.
|
|
25
25
|
* @returns {GridCellParams} The cell params.
|
|
26
26
|
*/
|
|
27
|
-
getCellParams: <V = any, R extends GridValidRowModel = any, F = V>(id: GridRowId, field: string) => GridCellParams<
|
|
27
|
+
getCellParams: <V = any, R extends GridValidRowModel = any, F = V>(id: GridRowId, field: string) => GridCellParams<V, R, F>;
|
|
28
28
|
/**
|
|
29
29
|
* Gets the [[GridRowParams]] object that is passed as argument in events.
|
|
30
30
|
* @param {GridRowId} id The id of the row.
|
|
@@ -86,4 +86,10 @@ export interface GridRowApi {
|
|
|
86
86
|
* @returns {GridRowId[]} The id of each row in the grouping criteria.
|
|
87
87
|
*/
|
|
88
88
|
getRowGroupChildren: (params: GridRowGroupChildrenGetterParams) => GridRowId[];
|
|
89
|
+
/**
|
|
90
|
+
* Replace a set of rows with new rows.
|
|
91
|
+
* @param {number} firstRowToReplace The index of the first row to be replaced.
|
|
92
|
+
* @param {GridRowModel[]} newRows The new rows.
|
|
93
|
+
*/
|
|
94
|
+
unstable_replaceRows: (firstRowToReplace: number, newRows: GridRowModel[]) => void;
|
|
89
95
|
}
|
|
@@ -28,9 +28,10 @@ export interface GridRowsMetaApi {
|
|
|
28
28
|
* Stores the row height measurement and triggers an hydration, if needed.
|
|
29
29
|
* @param {GridRowId} id The id of the row.
|
|
30
30
|
* @param {number} height The new height.
|
|
31
|
+
* @param {string} position The position to it the row belongs to.
|
|
31
32
|
* @ignore - do not document.
|
|
32
33
|
*/
|
|
33
|
-
unstable_storeRowHeightMeasurement: (id: GridRowId, height: number) => void;
|
|
34
|
+
unstable_storeRowHeightMeasurement: (id: GridRowId, height: number, position: 'left' | 'center' | 'right') => void;
|
|
34
35
|
/**
|
|
35
36
|
* Determines if the height of a row is "auto".
|
|
36
37
|
* @ignore - do not document.
|
|
@@ -48,4 +49,8 @@ export interface GridRowsMetaApi {
|
|
|
48
49
|
* @ignore - do not document.
|
|
49
50
|
*/
|
|
50
51
|
unstable_setLastMeasuredRowIndex: (index: number) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Forces the recalculation of the heights of all rows.
|
|
54
|
+
*/
|
|
55
|
+
resetRowHeights: () => void;
|
|
51
56
|
}
|
|
@@ -12,6 +12,7 @@ import { GridActionsCellItemProps } from '../../components/cell/GridActionsCellI
|
|
|
12
12
|
import { GridEditCellProps } from '../gridEditRowModel';
|
|
13
13
|
import type { GridValidRowModel } from '../gridRows';
|
|
14
14
|
import { GridApiCommunity } from '../api/gridApiCommunity';
|
|
15
|
+
import type { GridColumnGroup } from '../gridColumnGrouping';
|
|
15
16
|
/**
|
|
16
17
|
* Alignment used in position elements in Cells.
|
|
17
18
|
*/
|
|
@@ -61,7 +62,13 @@ export interface GridColDef<R extends GridValidRowModel = any, V = any, F = V> {
|
|
|
61
62
|
maxWidth?: number;
|
|
62
63
|
/**
|
|
63
64
|
* If `true`, hide the column.
|
|
64
|
-
* @deprecated Use the `
|
|
65
|
+
* @deprecated Use the `initialState` prop to hide columns:
|
|
66
|
+
* ```jsx
|
|
67
|
+
* // Hide `id` column, the other columns will remain visible
|
|
68
|
+
* <DataGrid initialState={{ columns: { columnVisibilityModel: { id: false } } }} />
|
|
69
|
+
* ```
|
|
70
|
+
* Or use `columnVisibilityModel` prop to fully control column visibility.
|
|
71
|
+
* @link https://mui.com/x/react-data-grid/column-visibility/
|
|
65
72
|
* @default false
|
|
66
73
|
*/
|
|
67
74
|
hide?: boolean;
|
|
@@ -257,6 +264,13 @@ export declare type GridStateColDef<R extends GridValidRowModel = any, V = any,
|
|
|
257
264
|
* If `true`, it means that at least one of the dimension's property of this column has been modified since the last time the column prop has changed.
|
|
258
265
|
*/
|
|
259
266
|
hasBeenResized?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* The id of the groups leading to the column.
|
|
269
|
+
* The array is ordered by increasing depth (the last element is the direct parent of the column).
|
|
270
|
+
* If not defined, the column is in no group (equivalent to a path equal to `[]`).
|
|
271
|
+
* This parameter is computed from the `columnGroupingModel` prop.
|
|
272
|
+
*/
|
|
273
|
+
groupPath?: GridColumnGroup['groupId'][];
|
|
260
274
|
};
|
|
261
275
|
/**
|
|
262
276
|
* Meta Info about columns.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { GridCellEditCommitParams, GridColumnHeaderParams, GridColumnOrderChangeParams, GridColumnResizeParams, GridColumnVisibilityChangeParams, GridEditCellPropsParams, GridHeaderSelectionCheckboxParams, GridMenuParams, GridPreferencePanelParams, GridRowParams, GridRowSelectionCheckboxParams, GridScrollParams } from '../params';
|
|
2
|
+
import type { GridCellEditCommitParams, GridColumnHeaderParams, GridColumnOrderChangeParams, GridColumnResizeParams, GridColumnVisibilityChangeParams, GridEditCellPropsParams, GridHeaderSelectionCheckboxParams, GridMenuParams, GridPreferencePanelParams, GridRenderedRowsIntervalChangeParams, GridRowParams, GridRowSelectionCheckboxParams, GridScrollParams } from '../params';
|
|
3
3
|
import { GridCellEditStartParams, GridCellEditStopParams } from '../params/gridEditCellParams';
|
|
4
4
|
import { GridCellParams } from '../params/gridCellParams';
|
|
5
5
|
import type { GridFilterModel } from '../gridFilterModel';
|
|
@@ -403,6 +403,12 @@ export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEve
|
|
|
403
403
|
rowExpansionChange: {
|
|
404
404
|
params: GridRowTreeNodeConfig;
|
|
405
405
|
};
|
|
406
|
+
/**
|
|
407
|
+
* Fired when the rendered rows index interval changes. Called with a [[GridRenderedRowsIntervalChangeParams]] object.
|
|
408
|
+
*/
|
|
409
|
+
renderedRowsIntervalChange: {
|
|
410
|
+
params: GridRenderedRowsIntervalChangeParams;
|
|
411
|
+
};
|
|
406
412
|
/**
|
|
407
413
|
* Fired when the mode of a cell changes.
|
|
408
414
|
* @ignore - do not document
|
|
@@ -83,7 +83,9 @@ declare enum GridEvents {
|
|
|
83
83
|
preferencePanelClose = "preferencePanelClose",
|
|
84
84
|
preferencePanelOpen = "preferencePanelOpen",
|
|
85
85
|
menuOpen = "menuOpen",
|
|
86
|
-
menuClose = "menuClose"
|
|
86
|
+
menuClose = "menuClose",
|
|
87
|
+
renderedRowsIntervalChange = "renderedRowsIntervalChange",
|
|
88
|
+
fetchRows = "fetchRows"
|
|
87
89
|
}
|
|
88
90
|
export declare type GridEventsStr = keyof GridEventLookup;
|
|
89
91
|
export { GridEvents };
|
|
@@ -85,6 +85,8 @@ var GridEvents;
|
|
|
85
85
|
GridEvents["preferencePanelOpen"] = "preferencePanelOpen";
|
|
86
86
|
GridEvents["menuOpen"] = "menuOpen";
|
|
87
87
|
GridEvents["menuClose"] = "menuClose";
|
|
88
|
+
GridEvents["renderedRowsIntervalChange"] = "renderedRowsIntervalChange";
|
|
89
|
+
GridEvents["fetchRows"] = "fetchRows";
|
|
88
90
|
})(GridEvents || (GridEvents = {}));
|
|
89
91
|
|
|
90
92
|
export { GridEvents };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridColDef } from './colDef';
|
|
3
|
+
export interface GridLeafColumn {
|
|
4
|
+
field: GridColDef['field'];
|
|
5
|
+
}
|
|
6
|
+
export declare type GridColumnNode = GridColumnGroup | GridLeafColumn;
|
|
7
|
+
export declare function isLeaf(node: GridColumnNode): node is GridLeafColumn;
|
|
8
|
+
/**
|
|
9
|
+
* A function used to process headerClassName params.
|
|
10
|
+
*/
|
|
11
|
+
export declare type GridColumnGroupHeaderClassFn = (params: GridColumnGroupHeaderParams) => string;
|
|
12
|
+
/**
|
|
13
|
+
* The union type representing the [[GridColDef]] column header class type.
|
|
14
|
+
*/
|
|
15
|
+
export declare type GridColumnGroupHeaderClassNamePropType = string | GridColumnGroupHeaderClassFn;
|
|
16
|
+
export interface GridColumnGroupHeaderParams extends Pick<GridColumnGroup, 'headerName' | 'description'> {
|
|
17
|
+
/**
|
|
18
|
+
* A unique string identifying the group.
|
|
19
|
+
*/
|
|
20
|
+
groupId: GridColumnGroup['groupId'] | null;
|
|
21
|
+
/**
|
|
22
|
+
* The number parent the group have.
|
|
23
|
+
*/
|
|
24
|
+
depth: number;
|
|
25
|
+
/**
|
|
26
|
+
* The maximal depth among visible columns.
|
|
27
|
+
*/
|
|
28
|
+
maxDepth: number;
|
|
29
|
+
/**
|
|
30
|
+
* The column fields included in the group (including nested ones).
|
|
31
|
+
*/
|
|
32
|
+
fields: string[];
|
|
33
|
+
/**
|
|
34
|
+
* The column index (0 based).
|
|
35
|
+
*/
|
|
36
|
+
colIndex: number;
|
|
37
|
+
/**
|
|
38
|
+
* Indicate if the group is the last one for the given depth.
|
|
39
|
+
*/
|
|
40
|
+
isLastColumn: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface GridColumnGroup extends Pick<GridColDef, 'headerName' | 'description' | 'headerAlign'> {
|
|
43
|
+
/**
|
|
44
|
+
* A unique string identifying the group.
|
|
45
|
+
*/
|
|
46
|
+
groupId: string;
|
|
47
|
+
/**
|
|
48
|
+
* The groups and columns included in this group.
|
|
49
|
+
*/
|
|
50
|
+
children: GridColumnNode[];
|
|
51
|
+
/**
|
|
52
|
+
* If `true`, allows reordering columns outside of the group.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
freeReordering?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Allows to render a component in the column group header cell.
|
|
58
|
+
* @param {GridColumnGroupHeaderParams} params Object containing parameters for the renderer.
|
|
59
|
+
* @returns {React.ReactNode} The element to be rendered.
|
|
60
|
+
*/
|
|
61
|
+
renderHeaderGroup?: (params: GridColumnGroupHeaderParams) => React.ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* Class name that will be added in the column group header cell.
|
|
64
|
+
*/
|
|
65
|
+
headerClassName?: GridColumnGroupHeaderClassNamePropType;
|
|
66
|
+
}
|
|
67
|
+
export declare type GridColumnGroupingModel = GridColumnGroup[];
|
package/models/gridRows.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { GridKeyValue } from './colDef/gridColDef';
|
|
|
2
2
|
export declare type GridValidRowModel = {
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
};
|
|
5
|
-
export declare type GridRowsProp<R =
|
|
5
|
+
export declare type GridRowsProp<R = GridValidRowModel> = Readonly<GridRowModel<R>[]>;
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated prefer GridRowModel.
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@ export declare type GridRowData = GridValidRowModel;
|
|
|
10
10
|
/**
|
|
11
11
|
* The key value object representing the data of a row.
|
|
12
12
|
*/
|
|
13
|
-
export declare type GridRowModel<R extends GridValidRowModel =
|
|
13
|
+
export declare type GridRowModel<R extends GridValidRowModel = GridValidRowModel> = R;
|
|
14
14
|
export declare type GridUpdateAction = 'delete';
|
|
15
15
|
export interface GridRowModelUpdate extends GridRowModel {
|
|
16
16
|
_action?: GridUpdateAction;
|
|
@@ -81,12 +81,12 @@ export interface GridRowsMeta {
|
|
|
81
81
|
positions: number[];
|
|
82
82
|
}
|
|
83
83
|
export declare type GridRowTreeConfig = Record<GridRowId, GridRowTreeNodeConfig>;
|
|
84
|
-
export declare type GridRowsLookup<R extends GridValidRowModel =
|
|
84
|
+
export declare type GridRowsLookup<R extends GridValidRowModel = GridValidRowModel> = Record<GridRowId, R>;
|
|
85
85
|
/**
|
|
86
86
|
* The type of Id supported by the grid.
|
|
87
87
|
*/
|
|
88
88
|
export declare type GridRowId = string | number;
|
|
89
|
-
export interface GridRowEntry<R extends GridValidRowModel =
|
|
89
|
+
export interface GridRowEntry<R extends GridValidRowModel = GridValidRowModel> {
|
|
90
90
|
/**
|
|
91
91
|
* The row id.
|
|
92
92
|
*/
|
|
@@ -99,4 +99,4 @@ export interface GridRowEntry<R extends GridValidRowModel = any> {
|
|
|
99
99
|
/**
|
|
100
100
|
* The function to retrieve the id of a [[GridRowModel]].
|
|
101
101
|
*/
|
|
102
|
-
export declare type GridRowIdGetter<R extends GridValidRowModel =
|
|
102
|
+
export declare type GridRowIdGetter<R extends GridValidRowModel = GridValidRowModel> = (row: R) => GridRowId;
|
|
@@ -50,6 +50,11 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
|
50
50
|
* @default GridCell
|
|
51
51
|
*/
|
|
52
52
|
Cell: React.JSXElementConstructor<any>;
|
|
53
|
+
/**
|
|
54
|
+
* Component rendered for each skeleton cell.
|
|
55
|
+
* @default GridSkeletonCell
|
|
56
|
+
*/
|
|
57
|
+
SkeletonCell: React.JSXElementConstructor<any>;
|
|
53
58
|
/**
|
|
54
59
|
* Filter icon component rendered in each column header.
|
|
55
60
|
* @default GridColumnHeaderFilterIconButton
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GridColumnMenuState, GridColumnsInitialState, GridColumnsState, GridDensityState, GridFilterInitialState, GridFilterState, GridFocusState, GridPaginationInitialState, GridPaginationState, GridPreferencePanelInitialState, GridPreferencePanelState, GridRowsState, GridSortingInitialState, GridSortingState, GridTabIndexState } from '../hooks';
|
|
1
|
+
import type { GridColumnMenuState, GridColumnsInitialState, GridColumnsState, GridColumnsGroupingState, GridDensityState, GridFilterInitialState, GridFilterState, GridFocusState, GridPaginationInitialState, GridPaginationState, GridPreferencePanelInitialState, GridPreferencePanelState, GridRowsState, GridSortingInitialState, GridSortingState, GridTabIndexState } from '../hooks';
|
|
2
2
|
import type { GridRowsMetaState } from '../hooks/features/rows/gridRowsMetaState';
|
|
3
3
|
import type { GridEditRowsModel } from './gridEditRowModel';
|
|
4
4
|
import type { GridSelectionModel } from './gridSelectionModel';
|
|
@@ -11,6 +11,7 @@ export interface GridStateCommunity {
|
|
|
11
11
|
editRows: GridEditRowsModel;
|
|
12
12
|
pagination: GridPaginationState;
|
|
13
13
|
columns: GridColumnsState;
|
|
14
|
+
columnGrouping: GridColumnsGroupingState;
|
|
14
15
|
columnMenu: GridColumnMenuState;
|
|
15
16
|
sorting: GridSortingState;
|
|
16
17
|
focus: GridFocusState;
|
package/models/index.d.ts
CHANGED
|
@@ -22,5 +22,6 @@ export * from './logger';
|
|
|
22
22
|
export * from './muiEvent';
|
|
23
23
|
export * from './events';
|
|
24
24
|
export * from './gridSortModel';
|
|
25
|
+
export * from './gridColumnGrouping';
|
|
25
26
|
export type { GridExportOptions, GridFileExportOptions, GridGetRowsToExportParams, GridCsvGetRowsToExportParams, GridCsvExportOptions, GridPrintExportOptions, } from './gridExport';
|
|
26
27
|
export * from './gridFilterOperator';
|
package/models/index.js
CHANGED
|
@@ -21,7 +21,8 @@ export * from './gridDensity';
|
|
|
21
21
|
export * from './logger';
|
|
22
22
|
export * from './muiEvent';
|
|
23
23
|
export * from './events';
|
|
24
|
-
export * from './gridSortModel';
|
|
24
|
+
export * from './gridSortModel';
|
|
25
|
+
export * from './gridColumnGrouping'; // Do not export GridExportFormat and GridExportExtension which are override in pro package
|
|
25
26
|
|
|
26
27
|
export * from './gridFilterOperator';
|
|
27
28
|
export {};
|
|
@@ -16,7 +16,8 @@ export interface GridCellParams<V = any, R extends GridValidRowModel = any, F =
|
|
|
16
16
|
*/
|
|
17
17
|
field: string;
|
|
18
18
|
/**
|
|
19
|
-
* The cell value
|
|
19
|
+
* The cell value.
|
|
20
|
+
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
20
21
|
*/
|
|
21
22
|
value?: V | undefined;
|
|
22
23
|
/**
|
|
@@ -92,12 +93,16 @@ export interface GridRenderEditCellParams<V = any, R extends GridValidRowModel =
|
|
|
92
93
|
/**
|
|
93
94
|
* Parameters passed to `colDef.valueGetter`.
|
|
94
95
|
*/
|
|
95
|
-
export interface GridValueGetterParams<V = any, R =
|
|
96
|
+
export interface GridValueGetterParams<V = any, R extends GridValidRowModel = GridValidRowModel> extends Omit<GridCellParams<V, R, any>, 'formattedValue' | 'isEditable'> {
|
|
96
97
|
/**
|
|
97
98
|
* GridApi that let you manipulate the grid.
|
|
98
99
|
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
99
100
|
*/
|
|
100
101
|
api: any;
|
|
102
|
+
/**
|
|
103
|
+
* The default value for the cell that the `valueGetter` is overriding.
|
|
104
|
+
*/
|
|
105
|
+
value: GridCellParams<V, R, any>['value'];
|
|
101
106
|
}
|
|
102
107
|
/**
|
|
103
108
|
* @deprecated Use `GridValueGetterParams` instead.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/params/index.d.ts
CHANGED
package/models/params/index.js
CHANGED
|
@@ -11,4 +11,5 @@ export * from './gridValueOptionsParams';
|
|
|
11
11
|
export * from './gridCellParams';
|
|
12
12
|
export * from './gridSortModelParams';
|
|
13
13
|
export * from './gridPreferencePanelParams';
|
|
14
|
-
export * from './gridMenuParams';
|
|
14
|
+
export * from './gridMenuParams';
|
|
15
|
+
export * from './gridRenderedRowsIntervalChangeParams';
|
|
@@ -23,6 +23,7 @@ import { GridInitialStateCommunity } from '../gridStateCommunity';
|
|
|
23
23
|
import { GridSlotsComponentsProps } from '../gridSlotsComponentsProps';
|
|
24
24
|
import { GridColumnVisibilityModel } from '../../hooks/features/columns/gridColumnsInterfaces';
|
|
25
25
|
import { GridCellModesModel, GridRowModesModel } from '../api/gridEditingApi';
|
|
26
|
+
import { GridColumnGroupingModel } from '../gridColumnGrouping';
|
|
26
27
|
export interface GridExperimentalFeatures {
|
|
27
28
|
/**
|
|
28
29
|
* Will be part of the premium-plan when fully ready.
|
|
@@ -32,6 +33,10 @@ export interface GridExperimentalFeatures {
|
|
|
32
33
|
* Enables the new API for cell editing and row editing.
|
|
33
34
|
*/
|
|
34
35
|
newEditingApi: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Enables the column grouping.
|
|
38
|
+
*/
|
|
39
|
+
columnGrouping: boolean;
|
|
35
40
|
/**
|
|
36
41
|
* Emits a warning if the cell receives focus without also syncing the focus state.
|
|
37
42
|
* Only works if NODE_ENV=test.
|
|
@@ -234,7 +239,7 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
234
239
|
logger: Logger;
|
|
235
240
|
/**
|
|
236
241
|
* Allows to pass the logging level or false to turn off logging.
|
|
237
|
-
* @default "
|
|
242
|
+
* @default "error" ("warn" in dev mode)
|
|
238
243
|
*/
|
|
239
244
|
logLevel: keyof Logger | false;
|
|
240
245
|
/**
|
|
@@ -741,4 +746,5 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
741
746
|
* @param {any} error The error thrown.
|
|
742
747
|
*/
|
|
743
748
|
onProcessRowUpdateError?: (error: any) => void;
|
|
749
|
+
columnGroupingModel?: GridColumnGroupingModel;
|
|
744
750
|
}
|