@mui/x-data-grid-pro 6.1.0 → 6.2.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 +101 -1
- package/components/DataGridProVirtualScroller.js +44 -31
- package/index.js +1 -1
- package/legacy/components/DataGridProVirtualScroller.js +44 -32
- package/legacy/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/modern/components/DataGridProVirtualScroller.js +44 -31
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/components/DataGridProVirtualScroller.js +44 -31
- package/node/index.js +1 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +2 -2
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,109 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.2.1
|
|
7
|
+
|
|
8
|
+
_Apr 20, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Add virtualization to row detail panels (#7969) @yaredtsy
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 📚 Documentation improvements
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v6.2.1` / `@mui/x-data-grid-pro@v6.2.1` / `@mui/x-data-grid-premium@v6.2.1`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Add `getTogglableColumns` to `Hide all` and `Show all` actions (#8496) @MBilalShafi
|
|
21
|
+
- [DataGrid] Add Grid + Joy UI experiment page (#8067) @cherniavskii
|
|
22
|
+
- [DataGrid] Fix print style when rendering inside Shadow DOM (#8656) @Bwatermelon
|
|
23
|
+
- [DataGrid] Replace `GridAutoSizer` with `ResizeObserver` (#8091) @m4theushw
|
|
24
|
+
- [DataGrid] Use stable ID for the placeholder filter item (#8603) @m4theushw
|
|
25
|
+
- [DataGridPro] Virtualize row detail panels (#7969) @yaredtsy
|
|
26
|
+
|
|
27
|
+
### `@mui/x-date-pickers@v6.2.1` / `@mui/x-date-pickers-pro@v6.2.1`
|
|
28
|
+
|
|
29
|
+
#### Changes
|
|
30
|
+
|
|
31
|
+
- [pickers] Do not include the time in date components when going to today (#8657) @flaviendelangle
|
|
32
|
+
- [pickers] Sync internal state with controlled value (#8674) @alexfauquette
|
|
33
|
+
|
|
34
|
+
### `@mui/x-codemod@v6.0.6`
|
|
35
|
+
|
|
36
|
+
#### Changes
|
|
37
|
+
|
|
38
|
+
- [codemod] Avoid filter failures on object prototype properties (#8647) @LukasTy
|
|
39
|
+
|
|
40
|
+
### Docs
|
|
41
|
+
|
|
42
|
+
- [docs] Add no-op service worker to fix stale cache issue (#8598) @cherniavskii
|
|
43
|
+
- [docs] Clarify what `AdapterDayjs` is in the Getting Started page (#8219) @flaviendelangle
|
|
44
|
+
- [docs] Fix typo on picker page description (#8611) @maxolasersquad
|
|
45
|
+
- [docs] Improve section title in Getting Started page (#8648) @flaviendelangle
|
|
46
|
+
- [docs] Inform about input format modification (#8458) @alexfauquette
|
|
47
|
+
|
|
48
|
+
### Core
|
|
49
|
+
|
|
50
|
+
- [core] Fix release date (#8618) @flaviendelangle
|
|
51
|
+
- [core] Upgrade monorepo (#8668) @MBilalShafi
|
|
52
|
+
- [charts] Support Tooltip (#8356) @alexfauquette
|
|
53
|
+
|
|
54
|
+
## 6.2.0
|
|
55
|
+
|
|
56
|
+
_Apr 14, 2023_
|
|
57
|
+
|
|
58
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
59
|
+
|
|
60
|
+
- Add `@mui/base` as a `peerDependency` of `@mui/x-date-pickers` and `@mui/x-date-pickers-pro` (#8590) @LukasTy
|
|
61
|
+
|
|
62
|
+
Both libraries were not working correctly if used without `@mui/base`.
|
|
63
|
+
Most package manager should automatically use the `@mui/base` version installed for `@mui/material`.
|
|
64
|
+
|
|
65
|
+
- The value rendered in the picker or field input no longer has spaces around the `/` characters (#8425) @flaviendelangle
|
|
66
|
+
|
|
67
|
+
You can use the `formatDensity='spacious'` prop to add it back.
|
|
68
|
+
More information on [the dedicated doc section](https://mui.com/x/react-date-pickers/custom-field/#change-the-format-density)
|
|
69
|
+
|
|
70
|
+
- 🌍 Improve French (fr-FR) and Urdu (ur-PK) and locales.
|
|
71
|
+
- 🐞 Bugfixes
|
|
72
|
+
- 📚 Documentation improvements
|
|
73
|
+
|
|
74
|
+
### `@mui/x-data-grid@v6.2.0` / `@mui/x-data-grid-pro@v6.2.0` / `@mui/x-data-grid-premium@v6.2.0`
|
|
75
|
+
|
|
76
|
+
#### Changes
|
|
77
|
+
|
|
78
|
+
- [DataGrid] Reset selection state on `checkboxSelection` toggle (#8522) @MBilalShafi
|
|
79
|
+
- [DataGrid] Use `baseSelect` slot instead of `baseTextField` with `select={true}` (#8110) @cherniavskii
|
|
80
|
+
- [l10n] Improve French (fr-FR) locale (#8537) @vallereaugabriel
|
|
81
|
+
- [l10n] Improve Urdu (ur-PK) locale (#8513) @SFARPak
|
|
82
|
+
|
|
83
|
+
### `@mui/x-date-pickers@v6.2.0` / `@mui/x-date-pickers-pro@v6.2.0`
|
|
84
|
+
|
|
85
|
+
#### Changes
|
|
86
|
+
|
|
87
|
+
- [DateTimePicker] Fix `TimeClock` validation ignoring date by default (#8570) @LukasTy
|
|
88
|
+
- [fields] Fix reliance on section order (#8545) @LukasTy
|
|
89
|
+
- [fields] Make the space between format separators controllable (#8425) @flaviendelangle
|
|
90
|
+
- [pickers] Add `@mui/base` to `peerDependencies` (#8590) @LukasTy
|
|
91
|
+
- [pickers] Fix JSDoc for `formatDensity` prop (#8601) @flaviendelangle
|
|
92
|
+
- [pickers] Improve value lifecycle on non-controlled pickers (#8312) @flaviendelangle
|
|
93
|
+
- [pickers] Migrate `AdapterDayjs` to our repository (#8487) @flaviendelangle
|
|
94
|
+
|
|
95
|
+
### Docs
|
|
96
|
+
|
|
97
|
+
- [docs] Fix "Custom day rendering" demo alignment (#8541) @LukasTy
|
|
98
|
+
- [docs] Fix **below** typo (#8576) @alexfauquette
|
|
99
|
+
|
|
100
|
+
### Core
|
|
101
|
+
|
|
102
|
+
- [core] Optimize `renovate` rules (#8575) @LukasTy
|
|
103
|
+
- [core] Upgrade monorepo (#8578) @cherniavskii
|
|
104
|
+
- [core] Update last release date (#8569) @DanailH
|
|
105
|
+
|
|
6
106
|
## 6.1.0
|
|
7
107
|
|
|
8
|
-
_Apr
|
|
108
|
+
_Apr 10, 2023_
|
|
9
109
|
|
|
10
110
|
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
11
111
|
|
|
@@ -229,40 +229,41 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
229
229
|
firstColumnIndex: visibleColumnFields.length - rightPinnedColumns.length,
|
|
230
230
|
lastColumnIndex: visibleColumnFields.length
|
|
231
231
|
}) : null;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
|
|
233
|
+
// Create a lookup for faster check if the row is expanded
|
|
234
|
+
const expandedRowIdsLookup = React.useMemo(() => {
|
|
235
|
+
const lookup = {};
|
|
236
|
+
expandedRowIds.forEach(id => {
|
|
237
|
+
lookup[id] = true;
|
|
238
|
+
});
|
|
239
|
+
return lookup;
|
|
240
|
+
}, [expandedRowIds]);
|
|
241
|
+
const getDetailPanel = rowId => {
|
|
237
242
|
const rowsMeta = gridRowsMetaSelector(apiRef.current.state);
|
|
238
|
-
const
|
|
239
|
-
for (let i = 0; i < uniqueExpandedRowIds.length; i += 1) {
|
|
240
|
-
const id = uniqueExpandedRowIds[i];
|
|
241
|
-
const content = detailPanelsContent[id];
|
|
243
|
+
const content = detailPanelsContent[rowId];
|
|
242
244
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
245
|
+
// Check if the id exists in the current page
|
|
246
|
+
const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId);
|
|
247
|
+
const exists = rowIndex !== undefined;
|
|
248
|
+
if ( /*#__PURE__*/React.isValidElement(content) && exists) {
|
|
249
|
+
const hasAutoHeight = apiRef.current.detailPanelHasAutoHeight(rowId);
|
|
250
|
+
const height = hasAutoHeight ? 'auto' : detailPanelsHeights[rowId];
|
|
251
|
+
const sizes = apiRef.current.unstable_getRowInternalSizes(rowId);
|
|
252
|
+
const spacingTop = (sizes == null ? void 0 : sizes.spacingTop) || 0;
|
|
253
|
+
const top = rowsMeta.positions[rowIndex] + apiRef.current.unstable_getRowHeight(rowId) + spacingTop;
|
|
254
|
+
return /*#__PURE__*/_jsx(GridDetailPanel, {
|
|
255
|
+
rowId: rowId,
|
|
256
|
+
style: {
|
|
257
|
+
top
|
|
258
|
+
},
|
|
259
|
+
height: height,
|
|
260
|
+
className: classes.detailPanel,
|
|
261
|
+
children: content
|
|
262
|
+
}, rowId);
|
|
262
263
|
}
|
|
263
|
-
return
|
|
264
|
+
return null;
|
|
264
265
|
};
|
|
265
|
-
const detailPanels =
|
|
266
|
+
const detailPanels = [];
|
|
266
267
|
const topPinnedRows = getRows({
|
|
267
268
|
renderContext,
|
|
268
269
|
rows: topPinnedRowsData,
|
|
@@ -272,7 +273,19 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
272
273
|
const mainRows = getRows({
|
|
273
274
|
renderContext,
|
|
274
275
|
rowIndexOffset: topPinnedRowsData.length,
|
|
275
|
-
position: 'center'
|
|
276
|
+
position: 'center',
|
|
277
|
+
onRowRender: rowId => {
|
|
278
|
+
if (rootProps.getDetailPanelContent == null) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (!expandedRowIdsLookup[rowId]) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const detailPanel = getDetailPanel(rowId);
|
|
285
|
+
if (detailPanel) {
|
|
286
|
+
detailPanels.push(detailPanel);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
276
289
|
});
|
|
277
290
|
const bottomPinnedRows = getRows({
|
|
278
291
|
renderContext,
|
package/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
@@ -237,40 +236,41 @@ var DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGrid
|
|
|
237
236
|
firstColumnIndex: visibleColumnFields.length - rightPinnedColumns.length,
|
|
238
237
|
lastColumnIndex: visibleColumnFields.length
|
|
239
238
|
}) : null;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
|
|
240
|
+
// Create a lookup for faster check if the row is expanded
|
|
241
|
+
var expandedRowIdsLookup = React.useMemo(function () {
|
|
242
|
+
var lookup = {};
|
|
243
|
+
expandedRowIds.forEach(function (id) {
|
|
244
|
+
lookup[id] = true;
|
|
245
|
+
});
|
|
246
|
+
return lookup;
|
|
247
|
+
}, [expandedRowIds]);
|
|
248
|
+
var getDetailPanel = function getDetailPanel(rowId) {
|
|
245
249
|
var rowsMeta = gridRowsMetaSelector(apiRef.current.state);
|
|
246
|
-
var
|
|
247
|
-
for (var i = 0; i < uniqueExpandedRowIds.length; i += 1) {
|
|
248
|
-
var id = uniqueExpandedRowIds[i];
|
|
249
|
-
var content = detailPanelsContent[id];
|
|
250
|
+
var content = detailPanelsContent[rowId];
|
|
250
251
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
252
|
+
// Check if the id exists in the current page
|
|
253
|
+
var rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId);
|
|
254
|
+
var exists = rowIndex !== undefined;
|
|
255
|
+
if ( /*#__PURE__*/React.isValidElement(content) && exists) {
|
|
256
|
+
var hasAutoHeight = apiRef.current.detailPanelHasAutoHeight(rowId);
|
|
257
|
+
var height = hasAutoHeight ? 'auto' : detailPanelsHeights[rowId];
|
|
258
|
+
var sizes = apiRef.current.unstable_getRowInternalSizes(rowId);
|
|
259
|
+
var spacingTop = (sizes == null ? void 0 : sizes.spacingTop) || 0;
|
|
260
|
+
var top = rowsMeta.positions[rowIndex] + apiRef.current.unstable_getRowHeight(rowId) + spacingTop;
|
|
261
|
+
return /*#__PURE__*/_jsx(GridDetailPanel, {
|
|
262
|
+
rowId: rowId,
|
|
263
|
+
style: {
|
|
264
|
+
top: top
|
|
265
|
+
},
|
|
266
|
+
height: height,
|
|
267
|
+
className: classes.detailPanel,
|
|
268
|
+
children: content
|
|
269
|
+
}, rowId);
|
|
270
270
|
}
|
|
271
|
-
return
|
|
271
|
+
return null;
|
|
272
272
|
};
|
|
273
|
-
var detailPanels =
|
|
273
|
+
var detailPanels = [];
|
|
274
274
|
var topPinnedRows = getRows({
|
|
275
275
|
renderContext: renderContext,
|
|
276
276
|
rows: topPinnedRowsData,
|
|
@@ -280,7 +280,19 @@ var DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGrid
|
|
|
280
280
|
var mainRows = getRows({
|
|
281
281
|
renderContext: renderContext,
|
|
282
282
|
rowIndexOffset: topPinnedRowsData.length,
|
|
283
|
-
position: 'center'
|
|
283
|
+
position: 'center',
|
|
284
|
+
onRowRender: function onRowRender(rowId) {
|
|
285
|
+
if (rootProps.getDetailPanelContent == null) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
if (!expandedRowIdsLookup[rowId]) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
var detailPanel = getDetailPanel(rowId);
|
|
292
|
+
if (detailPanel) {
|
|
293
|
+
detailPanels.push(detailPanel);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
284
296
|
});
|
|
285
297
|
var bottomPinnedRows = getRows({
|
|
286
298
|
renderContext: renderContext,
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY4MTkzMDgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -226,40 +226,41 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
226
226
|
firstColumnIndex: visibleColumnFields.length - rightPinnedColumns.length,
|
|
227
227
|
lastColumnIndex: visibleColumnFields.length
|
|
228
228
|
}) : null;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
229
|
+
|
|
230
|
+
// Create a lookup for faster check if the row is expanded
|
|
231
|
+
const expandedRowIdsLookup = React.useMemo(() => {
|
|
232
|
+
const lookup = {};
|
|
233
|
+
expandedRowIds.forEach(id => {
|
|
234
|
+
lookup[id] = true;
|
|
235
|
+
});
|
|
236
|
+
return lookup;
|
|
237
|
+
}, [expandedRowIds]);
|
|
238
|
+
const getDetailPanel = rowId => {
|
|
234
239
|
const rowsMeta = gridRowsMetaSelector(apiRef.current.state);
|
|
235
|
-
const
|
|
236
|
-
for (let i = 0; i < uniqueExpandedRowIds.length; i += 1) {
|
|
237
|
-
const id = uniqueExpandedRowIds[i];
|
|
238
|
-
const content = detailPanelsContent[id];
|
|
240
|
+
const content = detailPanelsContent[rowId];
|
|
239
241
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
242
|
+
// Check if the id exists in the current page
|
|
243
|
+
const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId);
|
|
244
|
+
const exists = rowIndex !== undefined;
|
|
245
|
+
if ( /*#__PURE__*/React.isValidElement(content) && exists) {
|
|
246
|
+
const hasAutoHeight = apiRef.current.detailPanelHasAutoHeight(rowId);
|
|
247
|
+
const height = hasAutoHeight ? 'auto' : detailPanelsHeights[rowId];
|
|
248
|
+
const sizes = apiRef.current.unstable_getRowInternalSizes(rowId);
|
|
249
|
+
const spacingTop = sizes?.spacingTop || 0;
|
|
250
|
+
const top = rowsMeta.positions[rowIndex] + apiRef.current.unstable_getRowHeight(rowId) + spacingTop;
|
|
251
|
+
return /*#__PURE__*/_jsx(GridDetailPanel, {
|
|
252
|
+
rowId: rowId,
|
|
253
|
+
style: {
|
|
254
|
+
top
|
|
255
|
+
},
|
|
256
|
+
height: height,
|
|
257
|
+
className: classes.detailPanel,
|
|
258
|
+
children: content
|
|
259
|
+
}, rowId);
|
|
259
260
|
}
|
|
260
|
-
return
|
|
261
|
+
return null;
|
|
261
262
|
};
|
|
262
|
-
const detailPanels =
|
|
263
|
+
const detailPanels = [];
|
|
263
264
|
const topPinnedRows = getRows({
|
|
264
265
|
renderContext,
|
|
265
266
|
rows: topPinnedRowsData,
|
|
@@ -269,7 +270,19 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
269
270
|
const mainRows = getRows({
|
|
270
271
|
renderContext,
|
|
271
272
|
rowIndexOffset: topPinnedRowsData.length,
|
|
272
|
-
position: 'center'
|
|
273
|
+
position: 'center',
|
|
274
|
+
onRowRender: rowId => {
|
|
275
|
+
if (rootProps.getDetailPanelContent == null) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
if (!expandedRowIdsLookup[rowId]) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const detailPanel = getDetailPanel(rowId);
|
|
282
|
+
if (detailPanel) {
|
|
283
|
+
detailPanels.push(detailPanel);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
273
286
|
});
|
|
274
287
|
const bottomPinnedRows = getRows({
|
|
275
288
|
renderContext,
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY4MTkzMDgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -235,40 +235,41 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
235
235
|
firstColumnIndex: visibleColumnFields.length - rightPinnedColumns.length,
|
|
236
236
|
lastColumnIndex: visibleColumnFields.length
|
|
237
237
|
}) : null;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
238
|
+
|
|
239
|
+
// Create a lookup for faster check if the row is expanded
|
|
240
|
+
const expandedRowIdsLookup = React.useMemo(() => {
|
|
241
|
+
const lookup = {};
|
|
242
|
+
expandedRowIds.forEach(id => {
|
|
243
|
+
lookup[id] = true;
|
|
244
|
+
});
|
|
245
|
+
return lookup;
|
|
246
|
+
}, [expandedRowIds]);
|
|
247
|
+
const getDetailPanel = rowId => {
|
|
243
248
|
const rowsMeta = (0, _xDataGrid.gridRowsMetaSelector)(apiRef.current.state);
|
|
244
|
-
const
|
|
245
|
-
for (let i = 0; i < uniqueExpandedRowIds.length; i += 1) {
|
|
246
|
-
const id = uniqueExpandedRowIds[i];
|
|
247
|
-
const content = detailPanelsContent[id];
|
|
249
|
+
const content = detailPanelsContent[rowId];
|
|
248
250
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
251
|
+
// Check if the id exists in the current page
|
|
252
|
+
const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId);
|
|
253
|
+
const exists = rowIndex !== undefined;
|
|
254
|
+
if ( /*#__PURE__*/React.isValidElement(content) && exists) {
|
|
255
|
+
const hasAutoHeight = apiRef.current.detailPanelHasAutoHeight(rowId);
|
|
256
|
+
const height = hasAutoHeight ? 'auto' : detailPanelsHeights[rowId];
|
|
257
|
+
const sizes = apiRef.current.unstable_getRowInternalSizes(rowId);
|
|
258
|
+
const spacingTop = sizes?.spacingTop || 0;
|
|
259
|
+
const top = rowsMeta.positions[rowIndex] + apiRef.current.unstable_getRowHeight(rowId) + spacingTop;
|
|
260
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridDetailPanel.GridDetailPanel, {
|
|
261
|
+
rowId: rowId,
|
|
262
|
+
style: {
|
|
263
|
+
top
|
|
264
|
+
},
|
|
265
|
+
height: height,
|
|
266
|
+
className: classes.detailPanel,
|
|
267
|
+
children: content
|
|
268
|
+
}, rowId);
|
|
268
269
|
}
|
|
269
|
-
return
|
|
270
|
+
return null;
|
|
270
271
|
};
|
|
271
|
-
const detailPanels =
|
|
272
|
+
const detailPanels = [];
|
|
272
273
|
const topPinnedRows = getRows({
|
|
273
274
|
renderContext,
|
|
274
275
|
rows: topPinnedRowsData,
|
|
@@ -278,7 +279,19 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
278
279
|
const mainRows = getRows({
|
|
279
280
|
renderContext,
|
|
280
281
|
rowIndexOffset: topPinnedRowsData.length,
|
|
281
|
-
position: 'center'
|
|
282
|
+
position: 'center',
|
|
283
|
+
onRowRender: rowId => {
|
|
284
|
+
if (rootProps.getDetailPanelContent == null) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if (!expandedRowIdsLookup[rowId]) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const detailPanel = getDetailPanel(rowId);
|
|
291
|
+
if (detailPanel) {
|
|
292
|
+
detailPanels.push(detailPanel);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
282
295
|
});
|
|
283
296
|
const bottomPinnedRows = getRows({
|
|
284
297
|
renderContext,
|
package/node/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTY4MTkzMDgwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "6.1
|
|
3
|
+
"version": "6.2.1",
|
|
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,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.21.0",
|
|
35
35
|
"@mui/utils": "^5.11.13",
|
|
36
|
-
"@mui/x-data-grid": "6.1
|
|
36
|
+
"@mui/x-data-grid": "6.2.1",
|
|
37
37
|
"@mui/x-license-pro": "6.0.4",
|
|
38
38
|
"@types/format-util": "^1.0.2",
|
|
39
39
|
"clsx": "^1.2.1",
|
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 = "MTY4MTkzMDgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|