@mui/x-data-grid-pro 5.12.0 → 5.12.3
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 +160 -7
- package/DataGridPro/useDataGridProComponent.js +1 -3
- package/components/DataGridProColumnHeaders.js +10 -7
- package/components/GridRowReorderCell.js +3 -3
- package/hooks/features/columnPinning/useGridColumnPinning.d.ts +1 -1
- package/hooks/features/columnPinning/useGridColumnPinning.js +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +32 -15
- package/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +2 -2
- package/hooks/features/detailPanel/useGridDetailPanel.d.ts +1 -1
- package/hooks/features/detailPanel/useGridDetailPanel.js +78 -18
- package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +5 -2
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +2 -2
- package/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +0 -1
- package/internals/index.js +0 -1
- package/legacy/DataGridPro/useDataGridProComponent.js +1 -3
- package/legacy/components/DataGridProColumnHeaders.js +10 -7
- package/legacy/components/GridRowReorderCell.js +3 -3
- package/legacy/hooks/features/columnPinning/useGridColumnPinning.js +1 -1
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +32 -15
- package/legacy/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +3 -1
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +78 -18
- package/legacy/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +5 -2
- package/legacy/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +0 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/modern/DataGridPro/useDataGridProComponent.js +1 -3
- package/modern/components/DataGridProColumnHeaders.js +11 -6
- package/modern/components/GridRowReorderCell.js +3 -3
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +1 -1
- package/modern/hooks/features/columnResize/useGridColumnResize.js +32 -15
- package/modern/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +2 -2
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +76 -16
- package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +5 -2
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/index.js +0 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/DataGridPro/useDataGridProComponent.js +1 -4
- package/node/components/DataGridProColumnHeaders.js +11 -7
- package/node/components/GridRowReorderCell.js +3 -3
- package/node/hooks/features/columnPinning/useGridColumnPinning.js +1 -1
- package/node/hooks/features/columnResize/useGridColumnResize.js +32 -14
- package/node/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +2 -2
- package/node/hooks/features/detailPanel/useGridDetailPanel.js +76 -17
- package/node/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +8 -2
- package/node/hooks/features/treeData/useGridTreeDataPreProcessors.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +0 -9
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +6 -5
- package/utils/releaseInfo.js +1 -1
- package/hooks/features/detailPanel/useGridDetailPanelCache.d.ts +0 -4
- package/hooks/features/detailPanel/useGridDetailPanelCache.js +0 -57
- package/legacy/hooks/features/detailPanel/useGridDetailPanelCache.js +0 -57
- package/modern/hooks/features/detailPanel/useGridDetailPanelCache.js +0 -57
- package/node/hooks/features/detailPanel/useGridDetailPanelCache.js +0 -74
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useGridSelector, useGridApiEventHandler, useGridApiMethod } from '@mui/x-data-grid';
|
|
3
|
+
import { useGridSelector, useGridApiEventHandler, useGridApiMethod, gridRowIdsSelector } from '@mui/x-data-grid';
|
|
4
4
|
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
5
5
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from './gridDetailPanelToggleColDef';
|
|
6
6
|
import { gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector, gridDetailPanelExpandedRowsHeightCacheSelector } from './gridDetailPanelSelector';
|
|
@@ -11,6 +11,35 @@ export const detailPanelStateInitializer = (state, props) => {
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
|
+
|
|
15
|
+
function cacheContentAndHeight(apiRef, getDetailPanelContent, getDetailPanelHeight) {
|
|
16
|
+
if (typeof getDetailPanelContent !== 'function') {
|
|
17
|
+
return {};
|
|
18
|
+
} // TODO change to lazy approach using a Proxy
|
|
19
|
+
// only call getDetailPanelContent when asked for an id
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const rowIds = gridRowIdsSelector(apiRef);
|
|
23
|
+
const contentCache = rowIds.reduce((acc, id) => {
|
|
24
|
+
const params = apiRef.current.getRowParams(id);
|
|
25
|
+
acc[id] = getDetailPanelContent(params);
|
|
26
|
+
return acc;
|
|
27
|
+
}, {});
|
|
28
|
+
const heightCache = rowIds.reduce((acc, id) => {
|
|
29
|
+
if (contentCache[id] == null) {
|
|
30
|
+
return acc;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const params = apiRef.current.getRowParams(id);
|
|
34
|
+
acc[id] = getDetailPanelHeight(params);
|
|
35
|
+
return acc;
|
|
36
|
+
}, {});
|
|
37
|
+
return {
|
|
38
|
+
contentCache,
|
|
39
|
+
heightCache
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
14
43
|
export const useGridDetailPanel = (apiRef, props) => {
|
|
15
44
|
const expandedRowIds = useGridSelector(apiRef, gridDetailPanelExpandedRowIdsSelector);
|
|
16
45
|
const contentCache = useGridSelector(apiRef, gridDetailPanelExpandedRowsContentCacheSelector);
|
|
@@ -49,21 +78,7 @@ export const useGridDetailPanel = (apiRef, props) => {
|
|
|
49
78
|
}, [apiRef, props.getDetailPanelContent]);
|
|
50
79
|
useGridApiEventHandler(apiRef, 'cellClick', handleCellClick);
|
|
51
80
|
useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);
|
|
52
|
-
|
|
53
|
-
if (expandedRowIds.length === 0 || !expandedRowIds.includes(row.id)) {
|
|
54
|
-
return _extends({}, initialValue, {
|
|
55
|
-
detail: 0
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const heightCache = gridDetailPanelExpandedRowsHeightCacheSelector(apiRef.current.state);
|
|
60
|
-
return _extends({}, initialValue, {
|
|
61
|
-
detail: heightCache[row.id] ?? 0 // Fallback to zero because the cache might not be ready yet (e.g. page was changed)
|
|
62
|
-
|
|
63
|
-
});
|
|
64
|
-
}, [apiRef, expandedRowIds]);
|
|
65
|
-
useGridRegisterPipeProcessor(apiRef, 'rowHeight', addDetailHeight);
|
|
66
|
-
apiRef.current.unstable_updateControlState({
|
|
81
|
+
apiRef.current.unstable_registerControlState({
|
|
67
82
|
stateId: 'detailPanels',
|
|
68
83
|
propModel: props.detailPanelExpandedRowIds,
|
|
69
84
|
propOnChange: props.onDetailPanelExpandedRowIdsChange,
|
|
@@ -110,4 +125,49 @@ export const useGridDetailPanel = (apiRef, props) => {
|
|
|
110
125
|
}
|
|
111
126
|
}
|
|
112
127
|
}, [apiRef, props.detailPanelExpandedRowIds]);
|
|
128
|
+
const updateCachesAndForceUpdate = React.useCallback(() => {
|
|
129
|
+
apiRef.current.setState(state => {
|
|
130
|
+
return _extends({}, state, {
|
|
131
|
+
detailPanel: _extends({}, state.detailPanel, cacheContentAndHeight(apiRef, props.getDetailPanelContent, props.getDetailPanelHeight))
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
apiRef.current.forceUpdate();
|
|
135
|
+
}, [apiRef, props.getDetailPanelContent, props.getDetailPanelHeight]);
|
|
136
|
+
useGridApiEventHandler(apiRef, 'sortedRowsSet', updateCachesAndForceUpdate);
|
|
137
|
+
const previousGetDetailPanelContentProp = React.useRef();
|
|
138
|
+
const previousGetDetailPanelHeightProp = React.useRef();
|
|
139
|
+
const updateCachesIfNeeded = React.useCallback(() => {
|
|
140
|
+
if (props.getDetailPanelContent === previousGetDetailPanelContentProp.current && props.getDetailPanelHeight === previousGetDetailPanelHeightProp.current) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
apiRef.current.setState(state => {
|
|
145
|
+
return _extends({}, state, {
|
|
146
|
+
detailPanel: _extends({}, state.detailPanel, cacheContentAndHeight(apiRef, props.getDetailPanelContent, props.getDetailPanelHeight))
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
previousGetDetailPanelContentProp.current = props.getDetailPanelContent;
|
|
150
|
+
previousGetDetailPanelHeightProp.current = props.getDetailPanelHeight;
|
|
151
|
+
}, [apiRef, props.getDetailPanelContent, props.getDetailPanelHeight]);
|
|
152
|
+
const addDetailHeight = React.useCallback((initialValue, row) => {
|
|
153
|
+
if (!expandedRowIds || expandedRowIds.length === 0 || !expandedRowIds.includes(row.id)) {
|
|
154
|
+
return _extends({}, initialValue, {
|
|
155
|
+
detail: 0
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
updateCachesIfNeeded();
|
|
160
|
+
const heightCache = gridDetailPanelExpandedRowsHeightCacheSelector(apiRef.current.state);
|
|
161
|
+
return _extends({}, initialValue, {
|
|
162
|
+
detail: heightCache[row.id] ?? 0 // Fallback to zero because the cache might not be ready yet (e.g. page was changed)
|
|
163
|
+
|
|
164
|
+
});
|
|
165
|
+
}, [apiRef, expandedRowIds, updateCachesIfNeeded]);
|
|
166
|
+
useGridRegisterPipeProcessor(apiRef, 'rowHeight', addDetailHeight);
|
|
167
|
+
const isFirstRender = React.useRef(true);
|
|
168
|
+
|
|
169
|
+
if (isFirstRender.current) {
|
|
170
|
+
isFirstRender.current = false;
|
|
171
|
+
updateCachesIfNeeded();
|
|
172
|
+
}
|
|
113
173
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
3
4
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_DETAIL_PANEL_TOGGLE_COL_DEF } from './gridDetailPanelToggleColDef';
|
|
@@ -21,8 +22,10 @@ export const useGridDetailPanelPreProcessors = (apiRef, props) => {
|
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
columnsState.all = [GRID_DETAIL_PANEL_TOGGLE_FIELD, ...columnsState.all];
|
|
24
|
-
columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD] = GRID_DETAIL_PANEL_TOGGLE_COL_DEF
|
|
25
|
+
columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD] = _extends({}, GRID_DETAIL_PANEL_TOGGLE_COL_DEF, {
|
|
26
|
+
headerName: apiRef.current.getLocaleText('detailPanelToggle')
|
|
27
|
+
});
|
|
25
28
|
return columnsState;
|
|
26
|
-
}, [props.getDetailPanelContent]);
|
|
29
|
+
}, [apiRef, props.getDetailPanelContent]);
|
|
27
30
|
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', addToggleColumn);
|
|
28
31
|
};
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["hideDescendantCount"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { gridRowIdsSelector, gridRowTreeSelector, useFirstRender } from '@mui/x-data-grid';
|
|
5
|
+
import { gridRowIdsSelector, gridRowTreeSelector, useFirstRender, GRID_CHECKBOX_SELECTION_FIELD } from '@mui/x-data-grid';
|
|
6
6
|
import { useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor } from '@mui/x-data-grid/internals';
|
|
7
7
|
import { GRID_TREE_DATA_GROUPING_COL_DEF, GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES } from './gridTreeDataGroupColDef';
|
|
8
8
|
import { filterRowTreeFromTreeData, TREE_DATA_STRATEGY } from './gridTreeDataUtils';
|
|
@@ -59,7 +59,7 @@ export const useGridTreeDataPreProcessors = (apiRef, props) => {
|
|
|
59
59
|
columnsState.lookup[groupingColDefField] = newGroupingColumn;
|
|
60
60
|
|
|
61
61
|
if (prevGroupingColumn == null) {
|
|
62
|
-
const index = columnsState.all[0] ===
|
|
62
|
+
const index = columnsState.all[0] === GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
|
|
63
63
|
columnsState.all = [...columnsState.all.slice(0, index), groupingColDefField, ...columnsState.all.slice(index)];
|
|
64
64
|
}
|
|
65
65
|
} else if (!shouldHaveGroupingColumn && prevGroupingColumn) {
|
package/modern/index.js
CHANGED
|
@@ -6,7 +6,6 @@ export { useGridColumnPinning, columnPinningStateInitializer } from '../hooks/fe
|
|
|
6
6
|
export { useGridColumnPinningPreProcessors } from '../hooks/features/columnPinning/useGridColumnPinningPreProcessors';
|
|
7
7
|
export { useGridColumnReorder, columnReorderStateInitializer } from '../hooks/features/columnReorder/useGridColumnReorder';
|
|
8
8
|
export { useGridDetailPanel, detailPanelStateInitializer } from '../hooks/features/detailPanel/useGridDetailPanel';
|
|
9
|
-
export { useGridDetailPanelCache } from '../hooks/features/detailPanel/useGridDetailPanelCache';
|
|
10
9
|
export { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
|
|
11
10
|
export { useGridInfiniteLoader } from '../hooks/features/infiniteLoader/useGridInfiniteLoader';
|
|
12
11
|
export { useGridRowReorder } from '../hooks/features/rowReorder/useGridRowReorder';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY1NjAyMTYwMDAwMA==";
|
|
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).
|
|
@@ -23,8 +23,6 @@ var _useGridColumnPinningPreProcessors = require("../hooks/features/columnPinnin
|
|
|
23
23
|
|
|
24
24
|
var _useGridDetailPanel = require("../hooks/features/detailPanel/useGridDetailPanel");
|
|
25
25
|
|
|
26
|
-
var _useGridDetailPanelCache = require("../hooks/features/detailPanel/useGridDetailPanelCache");
|
|
27
|
-
|
|
28
26
|
var _useGridDetailPanelPreProcessors = require("../hooks/features/detailPanel/useGridDetailPanelPreProcessors");
|
|
29
27
|
|
|
30
28
|
var _useGridRowReorder = require("../hooks/features/rowReorder/useGridRowReorder");
|
|
@@ -71,13 +69,12 @@ const useDataGridProComponent = (inputApiRef, props) => {
|
|
|
71
69
|
(0, _useGridTreeData.useGridTreeData)(apiRef);
|
|
72
70
|
(0, _internals.useGridKeyboardNavigation)(apiRef, props);
|
|
73
71
|
(0, _internals.useGridSelection)(apiRef, props);
|
|
74
|
-
(0, _useGridDetailPanel.useGridDetailPanel)(apiRef, props);
|
|
75
72
|
(0, _useGridColumnPinning.useGridColumnPinning)(apiRef, props);
|
|
76
73
|
(0, _internals.useGridColumns)(apiRef, props);
|
|
77
74
|
(0, _internals.useGridRows)(apiRef, props);
|
|
78
75
|
(0, _internals.useGridParamsApi)(apiRef);
|
|
76
|
+
(0, _useGridDetailPanel.useGridDetailPanel)(apiRef, props);
|
|
79
77
|
(0, _internals.useGridColumnSpanning)(apiRef);
|
|
80
|
-
(0, _useGridDetailPanelCache.useGridDetailPanelCache)(apiRef, props);
|
|
81
78
|
const useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? _internals.useGridEditing_new : _internals.useGridEditing_old;
|
|
82
79
|
useGridEditing(apiRef, props);
|
|
83
80
|
(0, _internals.useGridFocus)(apiRef, props);
|
|
@@ -17,6 +17,8 @@ var _material = require("@mui/material");
|
|
|
17
17
|
|
|
18
18
|
var _styles = require("@mui/material/styles");
|
|
19
19
|
|
|
20
|
+
var _utils = require("@mui/material/utils");
|
|
21
|
+
|
|
20
22
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
21
23
|
|
|
22
24
|
var _internals = require("@mui/x-data-grid/internals");
|
|
@@ -99,17 +101,19 @@ const DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function DataGrid
|
|
|
99
101
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
100
102
|
const visibleColumnFields = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridVisibleColumnFieldsSelector);
|
|
101
103
|
const [scrollbarSize, setScrollbarSize] = React.useState(0);
|
|
102
|
-
const handleContentSizeChange =
|
|
103
|
-
|
|
104
|
+
const handleContentSizeChange = (0, _utils.useEventCallback)(() => {
|
|
105
|
+
const rootDimensions = apiRef.current.getRootDimensions();
|
|
104
106
|
|
|
105
|
-
if (!
|
|
107
|
+
if (!rootDimensions) {
|
|
106
108
|
return;
|
|
107
|
-
}
|
|
109
|
+
}
|
|
108
110
|
|
|
111
|
+
const newScrollbarSize = rootDimensions.hasScrollY ? rootDimensions.scrollBarSize : 0;
|
|
109
112
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
if (scrollbarSize !== newScrollbarSize) {
|
|
114
|
+
setScrollbarSize(newScrollbarSize);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
113
117
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'virtualScrollerContentSizeChange', handleContentSizeChange);
|
|
114
118
|
const pinnedColumns = (0, _xDataGrid.useGridSelector)(apiRef, _columnPinning.gridPinnedColumnsSelector);
|
|
115
119
|
const [leftPinnedColumns, rightPinnedColumns] = (0, _DataGridProVirtualScroller.filterColumns)(pinnedColumns, visibleColumnFields);
|
|
@@ -59,16 +59,16 @@ const GridRowReorderCell = params => {
|
|
|
59
59
|
} // The row might have been deleted
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
if (!apiRef.current.getRow(params.
|
|
62
|
+
if (!apiRef.current.getRow(params.id)) {
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
apiRef.current.publishEvent(eventName, apiRef.current.getRowParams(params.
|
|
66
|
+
apiRef.current.publishEvent(eventName, apiRef.current.getRowParams(params.id), event);
|
|
67
67
|
|
|
68
68
|
if (propHandler) {
|
|
69
69
|
propHandler(event);
|
|
70
70
|
}
|
|
71
|
-
}, [apiRef, params.
|
|
71
|
+
}, [apiRef, params.id]);
|
|
72
72
|
const draggableEventHandlers = isDraggable ? {
|
|
73
73
|
onDragStart: publish('rowDragStart'),
|
|
74
74
|
onDragOver: publish('rowDragOver'),
|
|
@@ -213,7 +213,7 @@ const useGridColumnPinning = (apiRef, props) => {
|
|
|
213
213
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'canBeReordered', checkIfCanBeReordered);
|
|
214
214
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'exportState', stateExportPreProcessing);
|
|
215
215
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
216
|
-
apiRef.current.
|
|
216
|
+
apiRef.current.unstable_registerControlState({
|
|
217
217
|
stateId: 'pinnedColumns',
|
|
218
218
|
propModel: props.pinnedColumns,
|
|
219
219
|
propOnChange: props.onPinnedColumnsChange,
|
|
@@ -17,6 +17,8 @@ var _xDataGrid = require("@mui/x-data-grid");
|
|
|
17
17
|
|
|
18
18
|
var _internals = require("@mui/x-data-grid/internals");
|
|
19
19
|
|
|
20
|
+
var _styles = require("@mui/material/styles");
|
|
21
|
+
|
|
20
22
|
var _domUtils = require("../../../utils/domUtils");
|
|
21
23
|
|
|
22
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); }
|
|
@@ -69,10 +71,10 @@ function trackFinger(event, currentTouchId) {
|
|
|
69
71
|
};
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
function computeNewWidth(initialOffsetToSeparator, clickX, columnBounds,
|
|
74
|
+
function computeNewWidth(initialOffsetToSeparator, clickX, columnBounds, resizeDirection) {
|
|
73
75
|
let newWidth = initialOffsetToSeparator;
|
|
74
76
|
|
|
75
|
-
if (
|
|
77
|
+
if (resizeDirection === 'Right') {
|
|
76
78
|
newWidth += clickX - columnBounds.left;
|
|
77
79
|
} else {
|
|
78
80
|
newWidth += columnBounds.right - clickX;
|
|
@@ -81,16 +83,31 @@ function computeNewWidth(initialOffsetToSeparator, clickX, columnBounds, separat
|
|
|
81
83
|
return newWidth;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
function computeOffsetToSeparator(clickX, columnBounds,
|
|
85
|
-
if (
|
|
86
|
+
function computeOffsetToSeparator(clickX, columnBounds, resizeDirection) {
|
|
87
|
+
if (resizeDirection === 'Left') {
|
|
86
88
|
return clickX - columnBounds.left;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
return columnBounds.right - clickX;
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
function
|
|
93
|
-
|
|
94
|
+
function flipResizeDirection(side) {
|
|
95
|
+
if (side === 'Right') {
|
|
96
|
+
return 'Left';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return 'Right';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function getResizeDirection(element, direction) {
|
|
103
|
+
const side = element.classList.contains(_xDataGrid.gridClasses['columnSeparator--sideRight']) ? 'Right' : 'Left';
|
|
104
|
+
|
|
105
|
+
if (direction === 'rtl') {
|
|
106
|
+
// Resizing logic should be mirrored in the RTL case
|
|
107
|
+
return flipResizeDirection(side);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return side;
|
|
94
111
|
}
|
|
95
112
|
|
|
96
113
|
const columnResizeStateInitializer = state => (0, _extends2.default)({}, state, {
|
|
@@ -110,12 +127,13 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
110
127
|
const logger = (0, _xDataGrid.useGridLogger)(apiRef, 'useGridColumnResize');
|
|
111
128
|
const colDefRef = React.useRef();
|
|
112
129
|
const colElementRef = React.useRef();
|
|
113
|
-
const colCellElementsRef = React.useRef();
|
|
130
|
+
const colCellElementsRef = React.useRef();
|
|
131
|
+
const theme = (0, _styles.useTheme)(); // To improve accessibility, the separator has padding on both sides.
|
|
114
132
|
// Clicking inside the padding area should be treated as a click in the separator.
|
|
115
133
|
// This ref stores the offset between the click and the separator.
|
|
116
134
|
|
|
117
135
|
const initialOffsetToSeparator = React.useRef();
|
|
118
|
-
const
|
|
136
|
+
const resizeDirection = React.useRef();
|
|
119
137
|
const stopResizeEventTimeout = React.useRef();
|
|
120
138
|
const touchId = React.useRef();
|
|
121
139
|
|
|
@@ -174,7 +192,7 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
174
192
|
return;
|
|
175
193
|
}
|
|
176
194
|
|
|
177
|
-
let newWidth = computeNewWidth(initialOffsetToSeparator.current, nativeEvent.clientX, colElementRef.current.getBoundingClientRect(),
|
|
195
|
+
let newWidth = computeNewWidth(initialOffsetToSeparator.current, nativeEvent.clientX, colElementRef.current.getBoundingClientRect(), resizeDirection.current);
|
|
178
196
|
newWidth = (0, _internals.clamp)(newWidth, colDefRef.current.minWidth, colDefRef.current.maxWidth);
|
|
179
197
|
updateWidth(newWidth);
|
|
180
198
|
const params = {
|
|
@@ -210,8 +228,8 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
210
228
|
colCellElementsRef.current = (0, _domUtils.findGridCellElementsFromCol)(colElementRef.current, apiRef.current);
|
|
211
229
|
const doc = (0, _utils.ownerDocument)(apiRef.current.rootElementRef.current);
|
|
212
230
|
doc.body.style.cursor = 'col-resize';
|
|
213
|
-
|
|
214
|
-
initialOffsetToSeparator.current = computeOffsetToSeparator(event.clientX, colElementRef.current.getBoundingClientRect(),
|
|
231
|
+
resizeDirection.current = getResizeDirection(event.currentTarget, theme.direction);
|
|
232
|
+
initialOffsetToSeparator.current = computeOffsetToSeparator(event.clientX, colElementRef.current.getBoundingClientRect(), resizeDirection.current);
|
|
215
233
|
doc.addEventListener('mousemove', handleResizeMouseMove);
|
|
216
234
|
doc.addEventListener('mouseup', handleResizeMouseUp);
|
|
217
235
|
});
|
|
@@ -244,7 +262,7 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
244
262
|
return;
|
|
245
263
|
}
|
|
246
264
|
|
|
247
|
-
let newWidth = computeNewWidth(initialOffsetToSeparator.current, finger.x, colElementRef.current.getBoundingClientRect(),
|
|
265
|
+
let newWidth = computeNewWidth(initialOffsetToSeparator.current, finger.x, colElementRef.current.getBoundingClientRect(), resizeDirection.current);
|
|
248
266
|
newWidth = (0, _internals.clamp)(newWidth, colDefRef.current.minWidth, colDefRef.current.maxWidth);
|
|
249
267
|
updateWidth(newWidth);
|
|
250
268
|
const params = {
|
|
@@ -285,8 +303,8 @@ const useGridColumnResize = (apiRef, props) => {
|
|
|
285
303
|
colDefRef.current = colDef;
|
|
286
304
|
colElementRef.current = (0, _domUtils.findHeaderElementFromField)((_apiRef$current$colum2 = apiRef.current.columnHeadersElementRef) == null ? void 0 : _apiRef$current$colum2.current, colDef.field);
|
|
287
305
|
colCellElementsRef.current = (0, _domUtils.findGridCellElementsFromCol)(colElementRef.current, apiRef.current);
|
|
288
|
-
|
|
289
|
-
initialOffsetToSeparator.current = computeOffsetToSeparator(touch.clientX, colElementRef.current.getBoundingClientRect(),
|
|
306
|
+
resizeDirection.current = getResizeDirection(event.target, theme.direction);
|
|
307
|
+
initialOffsetToSeparator.current = computeOffsetToSeparator(touch.clientX, colElementRef.current.getBoundingClientRect(), resizeDirection.current);
|
|
290
308
|
const doc = (0, _utils.ownerDocument)(event.currentTarget);
|
|
291
309
|
doc.addEventListener('touchmove', handleTouchMove);
|
|
292
310
|
doc.addEventListener('touchend', handleTouchEnd);
|
|
@@ -27,7 +27,6 @@ const GRID_DETAIL_PANEL_TOGGLE_FIELD = '__detail_panel_toggle__';
|
|
|
27
27
|
exports.GRID_DETAIL_PANEL_TOGGLE_FIELD = GRID_DETAIL_PANEL_TOGGLE_FIELD;
|
|
28
28
|
const GRID_DETAIL_PANEL_TOGGLE_COL_DEF = (0, _extends2.default)({}, _xDataGrid.GRID_STRING_COL_DEF, {
|
|
29
29
|
field: GRID_DETAIL_PANEL_TOGGLE_FIELD,
|
|
30
|
-
headerName: '',
|
|
31
30
|
type: 'detailPanelToggle',
|
|
32
31
|
editable: false,
|
|
33
32
|
sortable: false,
|
|
@@ -42,6 +41,7 @@ const GRID_DETAIL_PANEL_TOGGLE_COL_DEF = (0, _extends2.default)({}, _xDataGrid.G
|
|
|
42
41
|
const expandedRowIds = (0, _gridDetailPanelSelector.gridDetailPanelExpandedRowIdsSelector)(params.api.state);
|
|
43
42
|
return expandedRowIds.includes(params.id);
|
|
44
43
|
},
|
|
45
|
-
renderCell: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridDetailPanelToggleCell.GridDetailPanelToggleCell, (0, _extends2.default)({}, params))
|
|
44
|
+
renderCell: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridDetailPanelToggleCell.GridDetailPanelToggleCell, (0, _extends2.default)({}, params)),
|
|
45
|
+
renderHeader: () => null
|
|
46
46
|
});
|
|
47
47
|
exports.GRID_DETAIL_PANEL_TOGGLE_COL_DEF = GRID_DETAIL_PANEL_TOGGLE_COL_DEF;
|
|
@@ -35,6 +35,34 @@ const detailPanelStateInitializer = (state, props) => {
|
|
|
35
35
|
|
|
36
36
|
exports.detailPanelStateInitializer = detailPanelStateInitializer;
|
|
37
37
|
|
|
38
|
+
function cacheContentAndHeight(apiRef, getDetailPanelContent, getDetailPanelHeight) {
|
|
39
|
+
if (typeof getDetailPanelContent !== 'function') {
|
|
40
|
+
return {};
|
|
41
|
+
} // TODO change to lazy approach using a Proxy
|
|
42
|
+
// only call getDetailPanelContent when asked for an id
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
const rowIds = (0, _xDataGrid.gridRowIdsSelector)(apiRef);
|
|
46
|
+
const contentCache = rowIds.reduce((acc, id) => {
|
|
47
|
+
const params = apiRef.current.getRowParams(id);
|
|
48
|
+
acc[id] = getDetailPanelContent(params);
|
|
49
|
+
return acc;
|
|
50
|
+
}, {});
|
|
51
|
+
const heightCache = rowIds.reduce((acc, id) => {
|
|
52
|
+
if (contentCache[id] == null) {
|
|
53
|
+
return acc;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const params = apiRef.current.getRowParams(id);
|
|
57
|
+
acc[id] = getDetailPanelHeight(params);
|
|
58
|
+
return acc;
|
|
59
|
+
}, {});
|
|
60
|
+
return {
|
|
61
|
+
contentCache,
|
|
62
|
+
heightCache
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
38
66
|
const useGridDetailPanel = (apiRef, props) => {
|
|
39
67
|
const expandedRowIds = (0, _xDataGrid.useGridSelector)(apiRef, _gridDetailPanelSelector.gridDetailPanelExpandedRowIdsSelector);
|
|
40
68
|
const contentCache = (0, _xDataGrid.useGridSelector)(apiRef, _gridDetailPanelSelector.gridDetailPanelExpandedRowsContentCacheSelector);
|
|
@@ -73,23 +101,7 @@ const useGridDetailPanel = (apiRef, props) => {
|
|
|
73
101
|
}, [apiRef, props.getDetailPanelContent]);
|
|
74
102
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'cellClick', handleCellClick);
|
|
75
103
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'cellKeyDown', handleCellKeyDown);
|
|
76
|
-
|
|
77
|
-
var _heightCache$row$id;
|
|
78
|
-
|
|
79
|
-
if (expandedRowIds.length === 0 || !expandedRowIds.includes(row.id)) {
|
|
80
|
-
return (0, _extends2.default)({}, initialValue, {
|
|
81
|
-
detail: 0
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const heightCache = (0, _gridDetailPanelSelector.gridDetailPanelExpandedRowsHeightCacheSelector)(apiRef.current.state);
|
|
86
|
-
return (0, _extends2.default)({}, initialValue, {
|
|
87
|
-
detail: (_heightCache$row$id = heightCache[row.id]) != null ? _heightCache$row$id : 0 // Fallback to zero because the cache might not be ready yet (e.g. page was changed)
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
}, [apiRef, expandedRowIds]);
|
|
91
|
-
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'rowHeight', addDetailHeight);
|
|
92
|
-
apiRef.current.unstable_updateControlState({
|
|
104
|
+
apiRef.current.unstable_registerControlState({
|
|
93
105
|
stateId: 'detailPanels',
|
|
94
106
|
propModel: props.detailPanelExpandedRowIds,
|
|
95
107
|
propOnChange: props.onDetailPanelExpandedRowIdsChange,
|
|
@@ -136,6 +148,53 @@ const useGridDetailPanel = (apiRef, props) => {
|
|
|
136
148
|
}
|
|
137
149
|
}
|
|
138
150
|
}, [apiRef, props.detailPanelExpandedRowIds]);
|
|
151
|
+
const updateCachesAndForceUpdate = React.useCallback(() => {
|
|
152
|
+
apiRef.current.setState(state => {
|
|
153
|
+
return (0, _extends2.default)({}, state, {
|
|
154
|
+
detailPanel: (0, _extends2.default)({}, state.detailPanel, cacheContentAndHeight(apiRef, props.getDetailPanelContent, props.getDetailPanelHeight))
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
apiRef.current.forceUpdate();
|
|
158
|
+
}, [apiRef, props.getDetailPanelContent, props.getDetailPanelHeight]);
|
|
159
|
+
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'sortedRowsSet', updateCachesAndForceUpdate);
|
|
160
|
+
const previousGetDetailPanelContentProp = React.useRef();
|
|
161
|
+
const previousGetDetailPanelHeightProp = React.useRef();
|
|
162
|
+
const updateCachesIfNeeded = React.useCallback(() => {
|
|
163
|
+
if (props.getDetailPanelContent === previousGetDetailPanelContentProp.current && props.getDetailPanelHeight === previousGetDetailPanelHeightProp.current) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
apiRef.current.setState(state => {
|
|
168
|
+
return (0, _extends2.default)({}, state, {
|
|
169
|
+
detailPanel: (0, _extends2.default)({}, state.detailPanel, cacheContentAndHeight(apiRef, props.getDetailPanelContent, props.getDetailPanelHeight))
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
previousGetDetailPanelContentProp.current = props.getDetailPanelContent;
|
|
173
|
+
previousGetDetailPanelHeightProp.current = props.getDetailPanelHeight;
|
|
174
|
+
}, [apiRef, props.getDetailPanelContent, props.getDetailPanelHeight]);
|
|
175
|
+
const addDetailHeight = React.useCallback((initialValue, row) => {
|
|
176
|
+
var _heightCache$row$id;
|
|
177
|
+
|
|
178
|
+
if (!expandedRowIds || expandedRowIds.length === 0 || !expandedRowIds.includes(row.id)) {
|
|
179
|
+
return (0, _extends2.default)({}, initialValue, {
|
|
180
|
+
detail: 0
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
updateCachesIfNeeded();
|
|
185
|
+
const heightCache = (0, _gridDetailPanelSelector.gridDetailPanelExpandedRowsHeightCacheSelector)(apiRef.current.state);
|
|
186
|
+
return (0, _extends2.default)({}, initialValue, {
|
|
187
|
+
detail: (_heightCache$row$id = heightCache[row.id]) != null ? _heightCache$row$id : 0 // Fallback to zero because the cache might not be ready yet (e.g. page was changed)
|
|
188
|
+
|
|
189
|
+
});
|
|
190
|
+
}, [apiRef, expandedRowIds, updateCachesIfNeeded]);
|
|
191
|
+
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'rowHeight', addDetailHeight);
|
|
192
|
+
const isFirstRender = React.useRef(true);
|
|
193
|
+
|
|
194
|
+
if (isFirstRender.current) {
|
|
195
|
+
isFirstRender.current = false;
|
|
196
|
+
updateCachesIfNeeded();
|
|
197
|
+
}
|
|
139
198
|
};
|
|
140
199
|
|
|
141
200
|
exports.useGridDetailPanel = useGridDetailPanel;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.useGridDetailPanelPreProcessors = void 0;
|
|
7
9
|
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
8
12
|
var React = _interopRequireWildcard(require("react"));
|
|
9
13
|
|
|
10
14
|
var _internals = require("@mui/x-data-grid/internals");
|
|
@@ -35,9 +39,11 @@ const useGridDetailPanelPreProcessors = (apiRef, props) => {
|
|
|
35
39
|
|
|
36
40
|
|
|
37
41
|
columnsState.all = [_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD, ...columnsState.all];
|
|
38
|
-
columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD] = _gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_COL_DEF
|
|
42
|
+
columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD] = (0, _extends2.default)({}, _gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_COL_DEF, {
|
|
43
|
+
headerName: apiRef.current.getLocaleText('detailPanelToggle')
|
|
44
|
+
});
|
|
39
45
|
return columnsState;
|
|
40
|
-
}, [props.getDetailPanelContent]);
|
|
46
|
+
}, [apiRef, props.getDetailPanelContent]);
|
|
41
47
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'hydrateColumns', addToggleColumn);
|
|
42
48
|
};
|
|
43
49
|
|
|
@@ -85,7 +85,7 @@ const useGridTreeDataPreProcessors = (apiRef, props) => {
|
|
|
85
85
|
columnsState.lookup[groupingColDefField] = newGroupingColumn;
|
|
86
86
|
|
|
87
87
|
if (prevGroupingColumn == null) {
|
|
88
|
-
const index = columnsState.all[0] ===
|
|
88
|
+
const index = columnsState.all[0] === _xDataGrid.GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
|
|
89
89
|
columnsState.all = [...columnsState.all.slice(0, index), groupingColDefField, ...columnsState.all.slice(index)];
|
|
90
90
|
}
|
|
91
91
|
} else if (!shouldHaveGroupingColumn && prevGroupingColumn) {
|
package/node/index.js
CHANGED
package/node/internals/index.js
CHANGED
|
@@ -15,7 +15,6 @@ var _exportNames = {
|
|
|
15
15
|
columnReorderStateInitializer: true,
|
|
16
16
|
useGridDetailPanel: true,
|
|
17
17
|
detailPanelStateInitializer: true,
|
|
18
|
-
useGridDetailPanelCache: true,
|
|
19
18
|
useGridDetailPanelPreProcessors: true,
|
|
20
19
|
useGridInfiniteLoader: true,
|
|
21
20
|
useGridRowReorder: true,
|
|
@@ -103,12 +102,6 @@ Object.defineProperty(exports, "useGridDetailPanel", {
|
|
|
103
102
|
return _useGridDetailPanel.useGridDetailPanel;
|
|
104
103
|
}
|
|
105
104
|
});
|
|
106
|
-
Object.defineProperty(exports, "useGridDetailPanelCache", {
|
|
107
|
-
enumerable: true,
|
|
108
|
-
get: function () {
|
|
109
|
-
return _useGridDetailPanelCache.useGridDetailPanelCache;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
105
|
Object.defineProperty(exports, "useGridDetailPanelPreProcessors", {
|
|
113
106
|
enumerable: true,
|
|
114
107
|
get: function () {
|
|
@@ -174,8 +167,6 @@ var _useGridColumnReorder = require("../hooks/features/columnReorder/useGridColu
|
|
|
174
167
|
|
|
175
168
|
var _useGridDetailPanel = require("../hooks/features/detailPanel/useGridDetailPanel");
|
|
176
169
|
|
|
177
|
-
var _useGridDetailPanelCache = require("../hooks/features/detailPanel/useGridDetailPanelCache");
|
|
178
|
-
|
|
179
170
|
var _useGridDetailPanelPreProcessors = require("../hooks/features/detailPanel/useGridDetailPanelPreProcessors");
|
|
180
171
|
|
|
181
172
|
var _useGridInfiniteLoader = require("../hooks/features/infiniteLoader/useGridInfiniteLoader");
|
|
@@ -8,7 +8,7 @@ exports.getReleaseInfo = void 0;
|
|
|
8
8
|
var _utils = require("@mui/utils");
|
|
9
9
|
|
|
10
10
|
const getReleaseInfo = () => {
|
|
11
|
-
const releaseInfo = "
|
|
11
|
+
const releaseInfo = "MTY1NjAyMTYwMDAwMA==";
|
|
12
12
|
|
|
13
13
|
if (process.env.NODE_ENV !== 'production') {
|
|
14
14
|
// A simple hack to set the value in the test environment (has no build step).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "5.12.
|
|
3
|
+
"version": "5.12.3",
|
|
4
4
|
"description": "The Pro plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -33,17 +33,18 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.17.2",
|
|
35
35
|
"@mui/utils": "^5.4.1",
|
|
36
|
-
"@mui/x-data-grid": "5.12.
|
|
37
|
-
"@mui/x-license-pro": "5.12.
|
|
36
|
+
"@mui/x-data-grid": "5.12.3",
|
|
37
|
+
"@mui/x-license-pro": "5.12.3",
|
|
38
38
|
"@types/format-util": "^1.0.2",
|
|
39
39
|
"clsx": "^1.0.4",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
|
-
"reselect": "^4.1.
|
|
41
|
+
"reselect": "^4.1.6"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@mui/material": "^5.4.1",
|
|
45
45
|
"@mui/system": "^5.4.1",
|
|
46
|
-
"react": "^17.0.2 || ^18.0.0"
|
|
46
|
+
"react": "^17.0.2 || ^18.0.0",
|
|
47
|
+
"react-dom": "^17.0.2 || ^18.0.0"
|
|
47
48
|
},
|
|
48
49
|
"setupFiles": [
|
|
49
50
|
"<rootDir>/src/setupTests.js"
|
package/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY1NjAyMTYwMDAwMA==";
|
|
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).
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { GridApiPro } from '../../../models/gridApiPro';
|
|
3
|
-
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
4
|
-
export declare const useGridDetailPanelCache: (apiRef: React.MutableRefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, 'getDetailPanelContent' | 'getDetailPanelHeight'>) => void;
|