@mui/x-data-grid-pro 5.9.0 → 5.11.1
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 +284 -10
- package/DataGridPro/DataGridPro.d.ts +1 -1
- package/DataGridPro/DataGridPro.js +50 -2
- package/DataGridPro/useDataGridProComponent.js +6 -2
- package/DataGridPro/useDataGridProProps.js +20 -5
- package/LICENSE +4 -4
- package/README.md +5 -4
- package/components/DataGridProColumnHeaders.js +2 -2
- package/components/DataGridProVirtualScroller.js +7 -4
- package/components/GridGroupingCriteriaCell.js +2 -2
- package/components/GridRowReorderCell.d.ts +5 -0
- package/components/GridRowReorderCell.js +72 -0
- package/components/GridTreeDataGroupingCell.js +2 -2
- package/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/hooks/features/columnReorder/useGridColumnReorder.d.ts +0 -1
- package/hooks/features/columnReorder/useGridColumnReorder.js +8 -9
- package/hooks/features/columnResize/useGridColumnResize.d.ts +0 -1
- package/hooks/features/columnResize/useGridColumnResize.js +13 -14
- package/hooks/features/detailPanel/useGridDetailPanel.js +4 -4
- package/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +1 -1
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +0 -1
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/hooks/features/rowGrouping/createGroupingColDef.d.ts +1 -1
- package/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +1 -1
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +0 -2
- package/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/hooks/features/rowReorder/gridRowReorderColDef.d.ts +2 -0
- package/hooks/features/rowReorder/gridRowReorderColDef.js +18 -0
- package/hooks/features/rowReorder/index.d.ts +1 -0
- package/hooks/features/rowReorder/index.js +1 -0
- package/hooks/features/rowReorder/useGridRowReorder.d.ts +8 -0
- package/hooks/features/rowReorder/useGridRowReorder.js +111 -0
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +4 -0
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +51 -0
- package/hooks/features/treeData/useGridTreeData.d.ts +0 -3
- package/hooks/features/treeData/useGridTreeData.js +2 -6
- package/index.d.ts +6 -1
- package/index.js +7 -3
- package/internals/index.d.ts +19 -0
- package/internals/index.js +17 -0
- package/internals/package.json +6 -0
- package/legacy/DataGridPro/DataGridPro.js +50 -2
- package/legacy/DataGridPro/useDataGridProComponent.js +6 -2
- package/legacy/DataGridPro/useDataGridProProps.js +20 -5
- package/legacy/components/DataGridProColumnHeaders.js +2 -2
- package/legacy/components/DataGridProVirtualScroller.js +7 -4
- package/legacy/components/GridGroupingCriteriaCell.js +2 -2
- package/legacy/components/GridRowReorderCell.js +74 -0
- package/legacy/components/GridTreeDataGroupingCell.js +2 -2
- package/legacy/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/legacy/hooks/features/columnReorder/useGridColumnReorder.js +8 -9
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +13 -14
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +4 -4
- package/legacy/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/legacy/hooks/features/index.js +1 -1
- package/legacy/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -5
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/legacy/hooks/features/rowReorder/gridRowReorderColDef.js +20 -0
- package/legacy/hooks/features/rowReorder/index.js +1 -0
- package/legacy/hooks/features/rowReorder/useGridRowReorder.js +115 -0
- package/legacy/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +52 -0
- package/legacy/hooks/features/treeData/useGridTreeData.js +2 -6
- package/legacy/index.js +7 -3
- package/legacy/internals/index.js +17 -0
- package/legacy/models/gridRowOrderChangeParams.js +1 -0
- package/legacy/models/index.js +1 -2
- package/legacy/typeOverloads/index.js +1 -0
- package/legacy/utils/index.js +1 -0
- package/legacy/utils/releaseInfo.js +1 -1
- package/legacy/utils/tree/buildRowTree.js +11 -4
- package/legacy/utils/tree/index.js +1 -0
- package/models/dataGridProProps.d.ts +36 -24
- package/models/gridApiPro.d.ts +3 -2
- package/models/gridRowOrderChangeParams.d.ts +18 -0
- package/models/gridRowOrderChangeParams.js +1 -0
- package/models/gridStatePro.d.ts +4 -3
- package/models/index.d.ts +1 -2
- package/models/index.js +1 -2
- package/modern/DataGridPro/DataGridPro.js +50 -2
- package/modern/DataGridPro/useDataGridProComponent.js +6 -2
- package/modern/DataGridPro/useDataGridProProps.js +16 -3
- package/modern/components/DataGridProColumnHeaders.js +2 -2
- package/modern/components/DataGridProVirtualScroller.js +7 -4
- package/modern/components/GridGroupingCriteriaCell.js +2 -2
- package/modern/components/GridRowReorderCell.js +72 -0
- package/modern/components/GridTreeDataGroupingCell.js +2 -2
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +8 -9
- package/modern/hooks/features/columnResize/useGridColumnResize.js +13 -14
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +4 -4
- package/modern/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/modern/hooks/features/index.js +1 -1
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/modern/hooks/features/rowReorder/gridRowReorderColDef.js +18 -0
- package/modern/hooks/features/rowReorder/index.js +1 -0
- package/modern/hooks/features/rowReorder/useGridRowReorder.js +111 -0
- package/modern/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +51 -0
- package/modern/hooks/features/treeData/useGridTreeData.js +2 -6
- package/modern/index.js +7 -3
- package/modern/internals/index.js +17 -0
- package/modern/models/gridRowOrderChangeParams.js +1 -0
- package/modern/models/index.js +1 -2
- package/modern/typeOverloads/index.js +1 -0
- package/modern/utils/index.js +1 -0
- package/modern/utils/releaseInfo.js +1 -1
- package/modern/utils/tree/buildRowTree.js +9 -2
- package/modern/utils/tree/index.js +1 -0
- package/node/DataGridPro/DataGridPro.js +50 -2
- package/node/DataGridPro/useDataGridProComponent.js +10 -4
- package/node/DataGridPro/useDataGridProProps.js +21 -5
- package/node/components/DataGridProColumnHeaders.js +1 -1
- package/node/components/DataGridProVirtualScroller.js +6 -3
- package/node/components/GridGroupingCriteriaCell.js +1 -1
- package/node/components/GridRowReorderCell.js +92 -0
- package/node/components/GridTreeDataGroupingCell.js +1 -1
- package/node/hooks/features/columnPinning/useGridColumnPinning.js +3 -3
- package/node/hooks/features/columnReorder/useGridColumnReorder.js +7 -8
- package/node/hooks/features/columnResize/useGridColumnResize.js +12 -13
- package/node/hooks/features/detailPanel/useGridDetailPanel.js +3 -3
- package/node/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -1
- package/node/hooks/features/index.js +4 -4
- package/node/hooks/features/infiniteLoader/useGridInfiniteLoader.js +3 -4
- package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +5 -7
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +4 -4
- package/node/hooks/features/rowReorder/gridRowReorderColDef.js +31 -0
- package/node/hooks/features/rowReorder/index.js +18 -0
- package/node/hooks/features/rowReorder/useGridRowReorder.js +126 -0
- package/node/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +70 -0
- package/node/hooks/features/treeData/useGridTreeData.js +1 -4
- package/node/index.js +45 -3
- package/node/internals/index.js +193 -0
- package/node/models/gridRowOrderChangeParams.js +5 -0
- package/node/models/index.js +4 -4
- package/node/typeOverloads/index.js +18 -0
- package/node/utils/index.js +18 -0
- package/node/utils/releaseInfo.js +1 -1
- package/node/utils/tree/buildRowTree.js +12 -2
- package/node/utils/tree/index.js +13 -0
- package/package.json +6 -5
- package/typeOverloads/index.d.ts +1 -0
- package/typeOverloads/index.js +1 -0
- package/typeOverloads/modules.d.ts +41 -15
- package/typeOverloads/package.json +6 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/package.json +6 -0
- package/utils/releaseInfo.js +1 -1
- package/utils/tree/buildRowTree.d.ts +1 -0
- package/utils/tree/buildRowTree.js +9 -2
- package/utils/tree/index.d.ts +1 -0
- package/utils/tree/index.js +1 -0
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import MuiDivider from '@mui/material/Divider';
|
|
7
|
-
import { useGridSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector, gridVisibleColumnFieldsSelector, gridClasses,
|
|
7
|
+
import { useGridSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector, gridVisibleColumnFieldsSelector, gridClasses, useGridApiMethod, useGridApiEventHandler } from '@mui/x-data-grid';
|
|
8
8
|
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
9
9
|
import { GridColumnPinningMenuItems } from '../../../components/GridColumnPinningMenuItems';
|
|
10
10
|
import { GridPinnedPosition } from './gridColumnPinningInterface';
|
|
@@ -94,8 +94,8 @@ export var useGridColumnPinning = function useGridColumnPinning(apiRef, props) {
|
|
|
94
94
|
var handleMouseLeave = React.useCallback(function (params, event) {
|
|
95
95
|
updateHoveredClassOnSiblingRows(event);
|
|
96
96
|
}, [updateHoveredClassOnSiblingRows]);
|
|
97
|
-
useGridApiEventHandler(apiRef,
|
|
98
|
-
useGridApiEventHandler(apiRef,
|
|
97
|
+
useGridApiEventHandler(apiRef, 'rowMouseEnter', handleMouseEnter);
|
|
98
|
+
useGridApiEventHandler(apiRef, 'rowMouseLeave', handleMouseLeave);
|
|
99
99
|
/**
|
|
100
100
|
* PRE-PROCESSING
|
|
101
101
|
*/
|
|
@@ -210,7 +210,7 @@ export var useGridColumnPinning = function useGridColumnPinning(apiRef, props) {
|
|
|
210
210
|
propModel: props.pinnedColumns,
|
|
211
211
|
propOnChange: props.onPinnedColumnsChange,
|
|
212
212
|
stateSelector: gridPinnedColumnsSelector,
|
|
213
|
-
changeEvent:
|
|
213
|
+
changeEvent: 'pinnedColumnsChange'
|
|
214
214
|
});
|
|
215
215
|
var checkIfEnabled = React.useCallback(function (methodName) {
|
|
216
216
|
if (props.disableColumnPinning) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
-
import { useGridApiEventHandler, getDataGridUtilityClass,
|
|
4
|
+
import { useGridApiEventHandler, getDataGridUtilityClass, useGridLogger } from '@mui/x-data-grid';
|
|
5
5
|
import { gridColumnReorderDragColSelector } from './columnReorderSelector';
|
|
6
6
|
var CURSOR_MOVE_DIRECTION_LEFT = 'left';
|
|
7
7
|
var CURSOR_MOVE_DIRECTION_RIGHT = 'right';
|
|
@@ -30,7 +30,6 @@ export var columnReorderStateInitializer = function columnReorderStateInitialize
|
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
* Only available in DataGridPro
|
|
34
33
|
* @requires useGridColumns (method)
|
|
35
34
|
*/
|
|
36
35
|
|
|
@@ -52,7 +51,7 @@ export var useGridColumnReorder = function useGridColumnReorder(apiRef, props) {
|
|
|
52
51
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
53
52
|
};
|
|
54
53
|
}, []);
|
|
55
|
-
var
|
|
54
|
+
var handleDragStart = React.useCallback(function (params, event) {
|
|
56
55
|
if (props.disableColumnReorder || params.colDef.disableReorder) {
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
@@ -162,10 +161,10 @@ export var useGridColumnReorder = function useGridColumnReorder(apiRef, props) {
|
|
|
162
161
|
});
|
|
163
162
|
apiRef.current.forceUpdate();
|
|
164
163
|
}, [props.disableColumnReorder, logger, apiRef]);
|
|
165
|
-
useGridApiEventHandler(apiRef,
|
|
166
|
-
useGridApiEventHandler(apiRef,
|
|
167
|
-
useGridApiEventHandler(apiRef,
|
|
168
|
-
useGridApiEventHandler(apiRef,
|
|
169
|
-
useGridApiEventHandler(apiRef,
|
|
170
|
-
useGridApiEventHandler(apiRef,
|
|
164
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', handleDragStart);
|
|
165
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragEnter', handleDragEnter);
|
|
166
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragOver', handleDragOver);
|
|
167
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', handleDragEnd);
|
|
168
|
+
useGridApiEventHandler(apiRef, 'cellDragEnter', handleDragEnter);
|
|
169
|
+
useGridApiEventHandler(apiRef, 'cellDragOver', handleDragOver);
|
|
171
170
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ownerDocument, useEventCallback } from '@mui/material/utils';
|
|
4
|
-
import {
|
|
4
|
+
import { gridClasses, GridColumnHeaderSeparatorSides, useGridApiEventHandler, useGridApiOptionHandler, useGridNativeEventListener, useGridLogger } from '@mui/x-data-grid';
|
|
5
5
|
import { clamp, findParentElementFromClassName } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { findGridCellElementsFromCol, getFieldFromHeaderElem, findHeaderElementFromField } from '../../../utils/domUtils';
|
|
7
7
|
// TODO: remove support for Safari < 13.
|
|
@@ -82,7 +82,6 @@ export var columnResizeStateInitializer = function columnResizeStateInitializer(
|
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
/**
|
|
85
|
-
* Only available in DataGridPro
|
|
86
85
|
* @requires useGridColumns (method, event)
|
|
87
86
|
* TODO: improve experience for last column
|
|
88
87
|
*/
|
|
@@ -134,12 +133,12 @@ export var useGridColumnResize = function useGridColumnResize(apiRef, props) {
|
|
|
134
133
|
apiRef.current.updateColumn(colDefRef.current);
|
|
135
134
|
clearTimeout(stopResizeEventTimeout.current);
|
|
136
135
|
stopResizeEventTimeout.current = setTimeout(function () {
|
|
137
|
-
apiRef.current.publishEvent(
|
|
136
|
+
apiRef.current.publishEvent('columnResizeStop', null, nativeEvent);
|
|
138
137
|
|
|
139
138
|
if (colDefRef.current) {
|
|
140
139
|
var _colDefRef$current;
|
|
141
140
|
|
|
142
|
-
apiRef.current.publishEvent(
|
|
141
|
+
apiRef.current.publishEvent('columnWidthChange', {
|
|
143
142
|
element: colElementRef.current,
|
|
144
143
|
colDef: colDefRef.current,
|
|
145
144
|
width: (_colDefRef$current = colDefRef.current) == null ? void 0 : _colDefRef$current.computedWidth
|
|
@@ -163,7 +162,7 @@ export var useGridColumnResize = function useGridColumnResize(apiRef, props) {
|
|
|
163
162
|
colDef: colDefRef.current,
|
|
164
163
|
width: newWidth
|
|
165
164
|
};
|
|
166
|
-
apiRef.current.publishEvent(
|
|
165
|
+
apiRef.current.publishEvent('columnResize', params, nativeEvent);
|
|
167
166
|
});
|
|
168
167
|
var handleColumnResizeMouseDown = useEventCallback(function (_ref, event) {
|
|
169
168
|
var _apiRef$current$colum;
|
|
@@ -183,7 +182,7 @@ export var useGridColumnResize = function useGridColumnResize(apiRef, props) {
|
|
|
183
182
|
|
|
184
183
|
event.preventDefault();
|
|
185
184
|
logger.debug("Start Resize on col ".concat(colDef.field));
|
|
186
|
-
apiRef.current.publishEvent(
|
|
185
|
+
apiRef.current.publishEvent('columnResizeStart', {
|
|
187
186
|
field: colDef.field
|
|
188
187
|
}, event);
|
|
189
188
|
colDefRef.current = colDef;
|
|
@@ -208,7 +207,7 @@ export var useGridColumnResize = function useGridColumnResize(apiRef, props) {
|
|
|
208
207
|
apiRef.current.updateColumn(colDefRef.current);
|
|
209
208
|
clearTimeout(stopResizeEventTimeout.current);
|
|
210
209
|
stopResizeEventTimeout.current = setTimeout(function () {
|
|
211
|
-
apiRef.current.publishEvent(
|
|
210
|
+
apiRef.current.publishEvent('columnResizeStop', null, nativeEvent);
|
|
212
211
|
});
|
|
213
212
|
logger.debug("Updating col ".concat(colDefRef.current.field, " with new width: ").concat(colDefRef.current.width));
|
|
214
213
|
});
|
|
@@ -233,7 +232,7 @@ export var useGridColumnResize = function useGridColumnResize(apiRef, props) {
|
|
|
233
232
|
colDef: colDefRef.current,
|
|
234
233
|
width: newWidth
|
|
235
234
|
};
|
|
236
|
-
apiRef.current.publishEvent(
|
|
235
|
+
apiRef.current.publishEvent('columnResize', params, nativeEvent);
|
|
237
236
|
});
|
|
238
237
|
var handleTouchStart = useEventCallback(function (event) {
|
|
239
238
|
var _apiRef$current$colum2;
|
|
@@ -260,7 +259,7 @@ export var useGridColumnResize = function useGridColumnResize(apiRef, props) {
|
|
|
260
259
|
var field = getFieldFromHeaderElem(colElementRef.current);
|
|
261
260
|
var colDef = apiRef.current.getColumn(field);
|
|
262
261
|
logger.debug("Start Resize on col ".concat(colDef.field));
|
|
263
|
-
apiRef.current.publishEvent(
|
|
262
|
+
apiRef.current.publishEvent('columnResizeStart', {
|
|
264
263
|
field: field
|
|
265
264
|
}, event);
|
|
266
265
|
colDefRef.current = colDef;
|
|
@@ -314,9 +313,9 @@ export var useGridColumnResize = function useGridColumnResize(apiRef, props) {
|
|
|
314
313
|
}, 'touchstart', handleTouchStart, {
|
|
315
314
|
passive: doesSupportTouchActionNone()
|
|
316
315
|
});
|
|
317
|
-
useGridApiEventHandler(apiRef,
|
|
318
|
-
useGridApiEventHandler(apiRef,
|
|
319
|
-
useGridApiEventHandler(apiRef,
|
|
320
|
-
useGridApiOptionHandler(apiRef,
|
|
321
|
-
useGridApiOptionHandler(apiRef,
|
|
316
|
+
useGridApiEventHandler(apiRef, 'columnSeparatorMouseDown', handleColumnResizeMouseDown);
|
|
317
|
+
useGridApiEventHandler(apiRef, 'columnResizeStart', handleResizeStart);
|
|
318
|
+
useGridApiEventHandler(apiRef, 'columnResizeStop', handleResizeStop);
|
|
319
|
+
useGridApiOptionHandler(apiRef, 'columnResize', props.onColumnResize);
|
|
320
|
+
useGridApiOptionHandler(apiRef, 'columnWidthChange', props.onColumnWidthChange);
|
|
322
321
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { useGridSelector, useGridApiEventHandler, useGridApiMethod } from '@mui/x-data-grid';
|
|
5
5
|
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from './gridDetailPanelToggleColDef';
|
|
7
7
|
import { gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector, gridDetailPanelExpandedRowsHeightCacheSelector } from './gridDetailPanelSelector';
|
|
@@ -50,8 +50,8 @@ export var useGridDetailPanel = function useGridDetailPanel(apiRef, props) {
|
|
|
50
50
|
apiRef.current.toggleDetailPanel(params.id);
|
|
51
51
|
}
|
|
52
52
|
}, [apiRef, props.getDetailPanelContent]);
|
|
53
|
-
useGridApiEventHandler(apiRef,
|
|
54
|
-
useGridApiEventHandler(apiRef,
|
|
53
|
+
useGridApiEventHandler(apiRef, 'cellClick', handleCellClick);
|
|
54
|
+
useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);
|
|
55
55
|
var addDetailHeight = React.useCallback(function (initialValue, row) {
|
|
56
56
|
var _heightCache$row$id;
|
|
57
57
|
|
|
@@ -73,7 +73,7 @@ export var useGridDetailPanel = function useGridDetailPanel(apiRef, props) {
|
|
|
73
73
|
propModel: props.detailPanelExpandedRowIds,
|
|
74
74
|
propOnChange: props.onDetailPanelExpandedRowIdsChange,
|
|
75
75
|
stateSelector: gridDetailPanelExpandedRowIdsSelector,
|
|
76
|
-
changeEvent:
|
|
76
|
+
changeEvent: 'detailPanelsExpandedRowIdsChange'
|
|
77
77
|
});
|
|
78
78
|
var toggleDetailPanel = React.useCallback(function (id) {
|
|
79
79
|
if (props.getDetailPanelContent == null) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useGridApiEventHandler, gridRowIdsSelector
|
|
3
|
+
import { useGridApiEventHandler, gridRowIdsSelector } from '@mui/x-data-grid';
|
|
4
4
|
|
|
5
5
|
function cacheContentAndHeight(apiRef, getDetailPanelContent, getDetailPanelHeight) {
|
|
6
6
|
if (typeof getDetailPanelContent !== 'function') {
|
|
@@ -39,7 +39,7 @@ export var useGridDetailPanelCache = function useGridDetailPanelCache(apiRef, pr
|
|
|
39
39
|
});
|
|
40
40
|
apiRef.current.forceUpdate();
|
|
41
41
|
}, [apiRef, props.getDetailPanelContent, props.getDetailPanelHeight]);
|
|
42
|
-
useGridApiEventHandler(apiRef,
|
|
42
|
+
useGridApiEventHandler(apiRef, 'sortedRowsSet', updateCaches);
|
|
43
43
|
var isFirstRender = React.useRef(true);
|
|
44
44
|
|
|
45
45
|
if (isFirstRender.current) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useGridSelector,
|
|
2
|
+
import { useGridSelector, useGridApiEventHandler, useGridApiOptionHandler, gridVisibleColumnDefinitionsSelector, gridRowsMetaSelector } from '@mui/x-data-grid';
|
|
3
3
|
import { useGridVisibleRows } from '@mui/x-data-grid/internals';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Only available in DataGridPro
|
|
7
6
|
* @requires useGridColumns (state)
|
|
8
7
|
* @requires useGridDimensions (method) - can be after
|
|
9
8
|
* @requires useGridScroll (method
|
|
@@ -34,7 +33,7 @@ export var useGridInfiniteLoader = function useGridInfiniteLoader(apiRef, props)
|
|
|
34
33
|
viewportPageSize: viewportPageSize,
|
|
35
34
|
virtualRowsCount: currentPage.rows.length
|
|
36
35
|
};
|
|
37
|
-
apiRef.current.publishEvent(
|
|
36
|
+
apiRef.current.publishEvent('rowsScrollEnd', rowScrollEndParam);
|
|
38
37
|
isInScrollBottomArea.current = true;
|
|
39
38
|
}
|
|
40
39
|
}, [contentHeight, props.scrollEndThreshold, visibleColumns, apiRef, currentPage.rows.length]);
|
|
@@ -46,6 +45,6 @@ export var useGridInfiniteLoader = function useGridInfiniteLoader(apiRef, props)
|
|
|
46
45
|
top: top
|
|
47
46
|
});
|
|
48
47
|
}, [handleRowsScrollEnd]);
|
|
49
|
-
useGridApiEventHandler(apiRef,
|
|
50
|
-
useGridApiOptionHandler(apiRef,
|
|
48
|
+
useGridApiEventHandler(apiRef, 'rowsScroll', handleGridScroll);
|
|
49
|
+
useGridApiOptionHandler(apiRef, 'rowsScrollEnd', props.onRowsScrollEnd);
|
|
51
50
|
};
|
|
@@ -25,12 +25,12 @@ export var isGroupingColumn = function isGroupingColumn(field) {
|
|
|
25
25
|
/**
|
|
26
26
|
* When filtering a group, we only want to filter according to the items related to this grouping column.
|
|
27
27
|
*/
|
|
28
|
-
var shouldApplyFilterItemOnGroup = function shouldApplyFilterItemOnGroup(
|
|
29
|
-
if (
|
|
28
|
+
var shouldApplyFilterItemOnGroup = function shouldApplyFilterItemOnGroup(columnField, node) {
|
|
29
|
+
if (columnField === GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD) {
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
var groupingCriteriaField = getRowGroupingCriteriaFromGroupingField(
|
|
33
|
+
var groupingCriteriaField = getRowGroupingCriteriaFromGroupingField(columnField);
|
|
34
34
|
return groupingCriteriaField === node.groupingField;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
@@ -56,8 +56,8 @@ export var filterRowTreeFromGroupingColumns = function filterRowTreeFromGrouping
|
|
|
56
56
|
if (!isRowMatchingFilters) {
|
|
57
57
|
isMatchingFilters = true;
|
|
58
58
|
} else {
|
|
59
|
-
var shouldApplyItem = node.isAutoGenerated ? function (
|
|
60
|
-
return shouldApplyFilterItemOnGroup(
|
|
59
|
+
var shouldApplyItem = node.isAutoGenerated ? function (columnField) {
|
|
60
|
+
return shouldApplyFilterItemOnGroup(columnField, node);
|
|
61
61
|
} : undefined;
|
|
62
62
|
isMatchingFilters = isRowMatchingFilters(node.id, shouldApplyItem);
|
|
63
63
|
}
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import Divider from '@mui/material/Divider';
|
|
5
|
-
import {
|
|
5
|
+
import { useGridApiEventHandler, useGridApiMethod, gridFilteredDescendantCountLookupSelector } from '@mui/x-data-grid';
|
|
6
6
|
import { useGridRegisterPipeProcessor, isDeepEqual } from '@mui/x-data-grid/internals';
|
|
7
7
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector, gridRowGroupingStateSelector } from './gridRowGroupingSelector';
|
|
8
8
|
import { getRowGroupingFieldFromGroupingCriteria, ROW_GROUPING_STRATEGY, isGroupingColumn, mergeStateWithRowGroupingModel, setStrategyAvailability } from './gridRowGroupingUtils';
|
|
@@ -20,11 +20,9 @@ export var rowGroupingStateInitializer = function rowGroupingStateInitializer(st
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* Only available in DataGridPro
|
|
24
23
|
* @requires useGridColumns (state, method) - can be after, async only
|
|
25
24
|
* @requires useGridRows (state, method) - can be after, async only
|
|
26
25
|
* @requires useGridParamsApi (method) - can be after, async only
|
|
27
|
-
* TODO: Move the the Premium plan once available and remove the `experimentalFeatures.rowGrouping` flag
|
|
28
26
|
*/
|
|
29
27
|
|
|
30
28
|
export var useGridRowGrouping = function useGridRowGrouping(apiRef, props) {
|
|
@@ -33,7 +31,7 @@ export var useGridRowGrouping = function useGridRowGrouping(apiRef, props) {
|
|
|
33
31
|
propModel: props.rowGroupingModel,
|
|
34
32
|
propOnChange: props.onRowGroupingModelChange,
|
|
35
33
|
stateSelector: gridRowGroupingModelSelector,
|
|
36
|
-
changeEvent:
|
|
34
|
+
changeEvent: 'rowGroupingModelChange'
|
|
37
35
|
});
|
|
38
36
|
/**
|
|
39
37
|
* API METHODS
|
|
@@ -189,13 +187,13 @@ export var useGridRowGrouping = function useGridRowGrouping(apiRef, props) {
|
|
|
189
187
|
// TODO: Add a clean way to re-run a strategy processing without publishing a private event
|
|
190
188
|
|
|
191
189
|
if (apiRef.current.unstable_getActiveStrategy('rowTree') === ROW_GROUPING_STRATEGY) {
|
|
192
|
-
apiRef.current.publishEvent(
|
|
190
|
+
apiRef.current.publishEvent('activeStrategyProcessorChange', 'rowTreeCreation');
|
|
193
191
|
}
|
|
194
192
|
}
|
|
195
193
|
}, [apiRef, props.disableRowGrouping]);
|
|
196
|
-
useGridApiEventHandler(apiRef,
|
|
197
|
-
useGridApiEventHandler(apiRef,
|
|
198
|
-
useGridApiEventHandler(apiRef,
|
|
194
|
+
useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);
|
|
195
|
+
useGridApiEventHandler(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
|
|
196
|
+
useGridApiEventHandler(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
|
|
199
197
|
/**
|
|
200
198
|
* EFFECTS
|
|
201
199
|
*/
|
|
@@ -3,11 +3,11 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { gridColumnLookupSelector, gridRowIdsSelector, gridRowTreeSelector, useFirstRender } from '@mui/x-data-grid';
|
|
5
5
|
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor } from '@mui/x-data-grid/internals';
|
|
6
|
+
import { sortRowTree } from '../../../utils/tree/sortRowTree';
|
|
7
|
+
import { buildRowTree } from '../../../utils/tree/buildRowTree';
|
|
6
8
|
import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from './gridRowGroupingSelector';
|
|
7
9
|
import { createGroupingColDefForAllGroupingCriteria, createGroupingColDefForOneGroupingCriteria } from './createGroupingColDef';
|
|
8
10
|
import { filterRowTreeFromGroupingColumns, getColDefOverrides, ROW_GROUPING_STRATEGY, isGroupingColumn, setStrategyAvailability } from './gridRowGroupingUtils';
|
|
9
|
-
import { buildRowTree } from '../../../utils/tree/buildRowTree';
|
|
10
|
-
import { sortRowTree } from '../../../utils/tree/sortRowTree';
|
|
11
11
|
export var useGridRowGroupingPreProcessors = function useGridRowGroupingPreProcessors(apiRef, props) {
|
|
12
12
|
var getGroupingColDefs = React.useCallback(function (columnsState) {
|
|
13
13
|
if (props.disableRowGrouping) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { GRID_STRING_COL_DEF } from '@mui/x-data-grid';
|
|
3
|
+
import { renderRowReorderCell } from '../../../components/GridRowReorderCell';
|
|
4
|
+
export var GRID_REORDER_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
5
|
+
field: '__reorder__',
|
|
6
|
+
type: 'reorder',
|
|
7
|
+
sortable: false,
|
|
8
|
+
filterable: false,
|
|
9
|
+
width: 50,
|
|
10
|
+
align: 'center',
|
|
11
|
+
headerAlign: 'center',
|
|
12
|
+
disableColumnMenu: true,
|
|
13
|
+
disableExport: true,
|
|
14
|
+
disableReorder: true,
|
|
15
|
+
resizable: false,
|
|
16
|
+
renderHeader: function renderHeader() {
|
|
17
|
+
return ' ';
|
|
18
|
+
},
|
|
19
|
+
renderCell: renderRowReorderCell
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './gridRowReorderColDef';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
+
import { useGridLogger, useGridApiEventHandler, getDataGridUtilityClass, useGridSelector, gridSortModelSelector, gridRowTreeDepthSelector, useGridApiOptionHandler, gridEditRowsStateSelector } from '@mui/x-data-grid';
|
|
5
|
+
|
|
6
|
+
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
7
|
+
var classes = ownerState.classes;
|
|
8
|
+
var slots = {
|
|
9
|
+
rowDragging: ['row--dragging']
|
|
10
|
+
};
|
|
11
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Only available in DataGridPro
|
|
15
|
+
* @requires useGridRows (method)
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export var useGridRowReorder = function useGridRowReorder(apiRef, props) {
|
|
20
|
+
var logger = useGridLogger(apiRef, 'useGridRowReorder');
|
|
21
|
+
var sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
22
|
+
var treeDepth = useGridSelector(apiRef, gridRowTreeDepthSelector);
|
|
23
|
+
var dragRowNode = React.useRef(null);
|
|
24
|
+
var originRowIndex = React.useRef(null);
|
|
25
|
+
var removeDnDStylesTimeout = React.useRef();
|
|
26
|
+
var ownerState = {
|
|
27
|
+
classes: props.classes
|
|
28
|
+
};
|
|
29
|
+
var classes = useUtilityClasses(ownerState);
|
|
30
|
+
|
|
31
|
+
var _React$useState = React.useState(''),
|
|
32
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
33
|
+
dragRowId = _React$useState2[0],
|
|
34
|
+
setDragRowId = _React$useState2[1];
|
|
35
|
+
|
|
36
|
+
React.useEffect(function () {
|
|
37
|
+
return function () {
|
|
38
|
+
clearTimeout(removeDnDStylesTimeout.current);
|
|
39
|
+
};
|
|
40
|
+
}, []); // TODO: remove sortModel check once row reorder is sorting compatible
|
|
41
|
+
// remove treeDepth once row reorder is tree compatible
|
|
42
|
+
|
|
43
|
+
var isRowReorderDisabled = React.useMemo(function () {
|
|
44
|
+
return !props.rowReordering || !!sortModel.length || treeDepth !== 1;
|
|
45
|
+
}, [props.rowReordering, sortModel, treeDepth]);
|
|
46
|
+
var handleDragStart = React.useCallback(function (params, event) {
|
|
47
|
+
// Call the gridEditRowsStateSelector directly to avoid infnite loop
|
|
48
|
+
var editRowsState = gridEditRowsStateSelector(apiRef.current.state);
|
|
49
|
+
|
|
50
|
+
if (isRowReorderDisabled || Object.keys(editRowsState).length !== 0) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
logger.debug("Start dragging row ".concat(params.id)); // Prevent drag events propagation.
|
|
55
|
+
// For more information check here https://github.com/mui/mui-x/issues/2680.
|
|
56
|
+
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
dragRowNode.current = event.currentTarget;
|
|
59
|
+
dragRowNode.current.classList.add(classes.rowDragging);
|
|
60
|
+
setDragRowId(params.id);
|
|
61
|
+
removeDnDStylesTimeout.current = setTimeout(function () {
|
|
62
|
+
dragRowNode.current.classList.remove(classes.rowDragging);
|
|
63
|
+
});
|
|
64
|
+
originRowIndex.current = apiRef.current.getRowIndex(params.id);
|
|
65
|
+
}, [isRowReorderDisabled, classes.rowDragging, logger, apiRef]);
|
|
66
|
+
var handleDragOver = React.useCallback(function (params, event) {
|
|
67
|
+
logger.debug("Dragging over row ".concat(params.id));
|
|
68
|
+
event.preventDefault(); // Prevent drag events propagation.
|
|
69
|
+
// For more information check here https://github.com/mui/mui-x/issues/2680.
|
|
70
|
+
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
|
|
73
|
+
if (params.id !== dragRowId) {
|
|
74
|
+
var targetRowIndex = apiRef.current.getRowIndex(params.id);
|
|
75
|
+
apiRef.current.setRowIndex(dragRowId, targetRowIndex);
|
|
76
|
+
}
|
|
77
|
+
}, [apiRef, logger, dragRowId]);
|
|
78
|
+
var handleDragEnd = React.useCallback(function (params, event) {
|
|
79
|
+
// Call the gridEditRowsStateSelector directly to avoid infnite loop
|
|
80
|
+
var editRowsState = gridEditRowsStateSelector(apiRef.current.state);
|
|
81
|
+
|
|
82
|
+
if (isRowReorderDisabled || Object.keys(editRowsState).length !== 0) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
logger.debug('End dragging row');
|
|
87
|
+
event.preventDefault(); // Prevent drag events propagation.
|
|
88
|
+
// For more information check here https://github.com/mui/mui-x/issues/2680.
|
|
89
|
+
|
|
90
|
+
event.stopPropagation();
|
|
91
|
+
clearTimeout(removeDnDStylesTimeout.current);
|
|
92
|
+
dragRowNode.current = null; // Check if the row was dropped outside the grid.
|
|
93
|
+
|
|
94
|
+
if (event.dataTransfer.dropEffect === 'none') {
|
|
95
|
+
// Accessing params.field may contain the wrong field as header elements are reused
|
|
96
|
+
apiRef.current.setRowIndex(dragRowId, originRowIndex.current);
|
|
97
|
+
originRowIndex.current = null;
|
|
98
|
+
} else {
|
|
99
|
+
// Emit the rowOrderChange event only once when the reordering stops.
|
|
100
|
+
var rowOrderChangeParams = {
|
|
101
|
+
row: apiRef.current.getRow(dragRowId),
|
|
102
|
+
targetIndex: apiRef.current.getRowIndex(params.id),
|
|
103
|
+
oldIndex: originRowIndex.current
|
|
104
|
+
};
|
|
105
|
+
apiRef.current.publishEvent('rowOrderChange', rowOrderChangeParams);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
setDragRowId('');
|
|
109
|
+
}, [isRowReorderDisabled, logger, apiRef, dragRowId]);
|
|
110
|
+
useGridApiEventHandler(apiRef, 'rowDragStart', handleDragStart);
|
|
111
|
+
useGridApiEventHandler(apiRef, 'rowDragOver', handleDragOver);
|
|
112
|
+
useGridApiEventHandler(apiRef, 'rowDragEnd', handleDragEnd);
|
|
113
|
+
useGridApiEventHandler(apiRef, 'cellDragOver', handleDragOver);
|
|
114
|
+
useGridApiOptionHandler(apiRef, 'rowOrderChange', props.onRowOrderChange);
|
|
115
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
5
|
+
import { getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
6
|
+
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
7
|
+
import { GRID_REORDER_COL_DEF } from './gridRowReorderColDef';
|
|
8
|
+
|
|
9
|
+
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
10
|
+
var classes = ownerState.classes;
|
|
11
|
+
return React.useMemo(function () {
|
|
12
|
+
var slots = {
|
|
13
|
+
rowReorderCellContainer: ['rowReorderCellContainer'],
|
|
14
|
+
columnHeaderReorder: ['columnHeaderReorder']
|
|
15
|
+
};
|
|
16
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
17
|
+
}, [classes]);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export var useGridRowReorderPreProcessors = function useGridRowReorderPreProcessors(apiRef, props) {
|
|
21
|
+
var ownerState = {
|
|
22
|
+
classes: props.classes
|
|
23
|
+
};
|
|
24
|
+
var classes = useUtilityClasses(ownerState);
|
|
25
|
+
var updateReorderColumn = React.useCallback(function (columnsState) {
|
|
26
|
+
var reorderColumn = _extends({}, GRID_REORDER_COL_DEF, {
|
|
27
|
+
cellClassName: classes.rowReorderCellContainer,
|
|
28
|
+
headerClassName: classes.columnHeaderReorder,
|
|
29
|
+
headerName: apiRef.current.getLocaleText('rowReorderingHeaderName')
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
var shouldHaveReorderColumn = props.rowReordering;
|
|
33
|
+
var haveReorderColumn = columnsState.lookup[reorderColumn.field] != null;
|
|
34
|
+
|
|
35
|
+
if (shouldHaveReorderColumn && haveReorderColumn) {
|
|
36
|
+
return columnsState;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (shouldHaveReorderColumn && !haveReorderColumn) {
|
|
40
|
+
columnsState.lookup[reorderColumn.field] = reorderColumn;
|
|
41
|
+
columnsState.all = [reorderColumn.field].concat(_toConsumableArray(columnsState.all));
|
|
42
|
+
} else if (!shouldHaveReorderColumn && haveReorderColumn) {
|
|
43
|
+
delete columnsState.lookup[reorderColumn.field];
|
|
44
|
+
columnsState.all = columnsState.all.filter(function (field) {
|
|
45
|
+
return field !== reorderColumn.field;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return columnsState;
|
|
50
|
+
}, [apiRef, classes, props.rowReordering]);
|
|
51
|
+
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateReorderColumn);
|
|
52
|
+
};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useGridApiEventHandler,
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Only available in DataGridPro
|
|
6
|
-
*/
|
|
2
|
+
import { useGridApiEventHandler, gridFilteredDescendantCountLookupSelector } from '@mui/x-data-grid';
|
|
7
3
|
export var useGridTreeData = function useGridTreeData(apiRef) {
|
|
8
4
|
/**
|
|
9
5
|
* EVENTS
|
|
@@ -23,5 +19,5 @@ export var useGridTreeData = function useGridTreeData(apiRef) {
|
|
|
23
19
|
apiRef.current.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
|
|
24
20
|
}
|
|
25
21
|
}, [apiRef]);
|
|
26
|
-
useGridApiEventHandler(apiRef,
|
|
22
|
+
useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);
|
|
27
23
|
};
|
package/legacy/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.11.1
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
5
5
|
*/
|
|
6
|
-
import './typeOverloads
|
|
6
|
+
import './typeOverloads';
|
|
7
7
|
export { LicenseInfo } from '@mui/x-license-pro';
|
|
8
8
|
export * from '@mui/x-data-grid/components';
|
|
9
9
|
export * from '@mui/x-data-grid/constants';
|
|
@@ -17,4 +17,8 @@ export * from './DataGridPro';
|
|
|
17
17
|
export * from './hooks';
|
|
18
18
|
export * from './models';
|
|
19
19
|
export * from './components';
|
|
20
|
-
export
|
|
20
|
+
export * from './utils';
|
|
21
|
+
export { useGridApiContext, useGridApiRef, useGridRootProps } from './typeOverloads/reexports';
|
|
22
|
+
// We export them from here to avoid export duplication between pro and premium
|
|
23
|
+
export * from './hooks/features/rowGrouping';
|
|
24
|
+
export * from './models/gridGroupingValueGetterParams';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from '@mui/x-data-grid/internals';
|
|
2
|
+
export { DataGridProVirtualScroller } from '../components/DataGridProVirtualScroller';
|
|
3
|
+
export { DataGridProColumnHeaders } from '../components/DataGridProColumnHeaders';
|
|
4
|
+
export { useGridColumnResize, columnResizeStateInitializer } from '../hooks/features/columnResize/useGridColumnResize';
|
|
5
|
+
export { useGridColumnPinning, columnPinningStateInitializer } from '../hooks/features/columnPinning/useGridColumnPinning';
|
|
6
|
+
export { useGridColumnPinningPreProcessors } from '../hooks/features/columnPinning/useGridColumnPinningPreProcessors';
|
|
7
|
+
export { useGridColumnReorder, columnReorderStateInitializer } from '../hooks/features/columnReorder/useGridColumnReorder';
|
|
8
|
+
export { useGridDetailPanel, detailPanelStateInitializer } from '../hooks/features/detailPanel/useGridDetailPanel';
|
|
9
|
+
export { useGridDetailPanelCache } from '../hooks/features/detailPanel/useGridDetailPanelCache';
|
|
10
|
+
export { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
|
|
11
|
+
export { useGridInfiniteLoader } from '../hooks/features/infiniteLoader/useGridInfiniteLoader';
|
|
12
|
+
export { useGridRowReorder } from '../hooks/features/rowReorder/useGridRowReorder';
|
|
13
|
+
export { useGridRowReorderPreProcessors } from '../hooks/features/rowReorder/useGridRowReorderPreProcessors';
|
|
14
|
+
export { useGridTreeData } from '../hooks/features/treeData/useGridTreeData';
|
|
15
|
+
export { useGridTreeDataPreProcessors } from '../hooks/features/treeData/useGridTreeDataPreProcessors';
|
|
16
|
+
export { buildRowTree } from '../utils/tree/buildRowTree';
|
|
17
|
+
export { sortRowTree } from '../utils/tree/sortRowTree';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/legacy/models/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './modules';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tree';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY1Mjk5NzYwMDAwMA==";
|
|
4
4
|
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
// A simple hack to set the value in the test environment (has no build step).
|