@mui/x-data-grid-pro 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,9 +3,126 @@
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.3.0
7
+
8
+ _Apr 28, 2023_
9
+
10
+ We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🚀 New [time-picking UI](https://mui.com/x/react-date-pickers/digital-clock/) designed for desktops (#7958) @LukasTy
13
+
14
+ <img src="https://user-images.githubusercontent.com/4941090/235072007-de39a397-e4a4-4c98-8e10-5ee4ad440108.gif" width="494" />
15
+
16
+ - ✨ Picker fields [now always include a leading zero](https://mui.com/x/react-date-pickers/adapters-locale/#respect-leading-zeros-in-fields) on digit sections (#8527) @flaviendelangle
17
+ - 🌍 Improve Chinese (zh-CN), French (fr-FR), and Turkish (tr-TR) locales
18
+ - 🐞 Bugfixes
19
+ - 📚 Documentation improvements
20
+
21
+ ### `@mui/x-data-grid@v6.3.0` / `@mui/x-data-grid-pro@v6.3.0` / `@mui/x-data-grid-premium@v6.3.0`
22
+
23
+ #### Changes
24
+
25
+ - [DataGrid] Add overlay classes to `gridClasses` (#8686) @lindapaiste
26
+ - [DataGrid] Avoid passing `api` prop to div (#8679) @someden
27
+ - [DataGrid] Fix 'ResizeObserver loop limit exceeded' error (#8744) @m4theushw
28
+ - [DataGrid] Add Joy UI slots (button and switch) (#8699) @siriwatknp
29
+ - [DataGrid] Fix aggregation label alignment (#8694) @joserodolfofreitas
30
+ - [DataGridPremium] Fix infinite loop when updating grouped rows (#8693) @cherniavskii
31
+ - [DataGridPro] Fix error after updating `columns` and `columnGroupingModel` at once (#8730) @cherniavskii
32
+ - [l10n] Improve Chinese (zh-CN) locale (#8753) @SakumyZ
33
+ - [l10n] Improve French (fr-FR) locale (#8704) @Jul13nT
34
+ - [l10n] Improve Turkish (tr-TR) locale (#8783) @cccaaannn
35
+
36
+ ### `@mui/x-date-pickers@v6.3.0` / `@mui/x-date-pickers-pro@v6.3.0`
37
+
38
+ #### Changes
39
+
40
+ - [fields] Always add leading zeroes on digit sections (#8527) @flaviendelangle
41
+ - [fields] Pass the `readOnly` prop to `InputProps` instead of `inputProps` (#8659) @flaviendelangle
42
+ - [pickers] Add missing export for `caES` locale (#8782) @flaviendelangle
43
+ - [pickers] Add new `DigitalClock` desktop time picking experience (#7958) @LukasTy
44
+ - [pickers] Do not use `instanceOf DateTime` in `AdapterLuxon` (#8734) @flaviendelangle
45
+ - [pickers] Fix date calendar `selected` & `disabled` day style (#8773) @LukasTy
46
+ - [pickers] Migrate `AdapterDateFns` to our repository (#8736) @flaviendelangle
47
+ - [pickers] Migrate `AdapterLuxon` to our repository (#8600) @flaviendelangle
48
+ - [pickers] Migrate `AdapterMomentHijri` to our repository (#8776) @flaviendelangle
49
+ - [pickers] Migrate `AdapterMomentJalaali` and `AdapterDateFnsJalali` to our repository (#8741) @flaviendelangle
50
+ - [pickers] Migrate `AdapterMoment` to our repository (#8700) @flaviendelangle
51
+ - [pickers] Refactor the validation files (#8622) @flaviendelangle
52
+ - [pickers] Use `en dash` instead of `em dash` in multi input range fields (#8738) @flaviendelangle
53
+ - [l10n] Improve Chinese (zh-CN) locale (#8753) @SakumyZ
54
+ - [l10n] Improve Turkish (tr-TR) locale (#8783) @cccaaannn
55
+
56
+ ### Docs
57
+
58
+ - [docs] Add icons for charts menu (#8752) @alexfauquette
59
+ - [docs] Document the supported formats (#8746) @flaviendelangle
60
+ - [docs] Fix Hijri demo (#8698) @alexfauquette
61
+ - [docs] Fix `x-codemod` package version in changelog (#8690) @MBilalShafi
62
+ - [docs] Fix columns special properties code example (#8414) @mikkelhl
63
+ - [docs] Fix error in `minDateTime` `validation` page section (#8777) @LukasTy
64
+ - [docs] Update custom field pickers using theme scoping (#8609) @siriwatknp
65
+ - [docs] Use community version of data grid for column grouping demo (#7346) @ASchwad
66
+ - [docs] Use new `slots` / `slotProps` props in the pickers migration guide (#8341) @flaviendelangle
67
+
68
+ ### Core
69
+
70
+ - [core] Cleanup picker tests (#8652) @flaviendelangle
71
+ - [core] Use `adapter.lib` instead of `adapterName` in `describeAdapters` (#8779) @flaviendelangle
72
+ - [charts] Adapt line and scatter plot to the "band" scale type (#8701) @alexfauquette
73
+ - [charts] Link the Gantt Charts issue in the docs (#8739) @flaviendelangle
74
+
75
+ ## 6.2.1
76
+
77
+ _Apr 20, 2023_
78
+
79
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
80
+
81
+ - 🚀 Add virtualization to row detail panels (#7969) @yaredtsy
82
+ - 🐞 Bugfixes
83
+ - 📚 Documentation improvements
84
+
85
+ ### `@mui/x-data-grid@v6.2.1` / `@mui/x-data-grid-pro@v6.2.1` / `@mui/x-data-grid-premium@v6.2.1`
86
+
87
+ #### Changes
88
+
89
+ - [DataGrid] Add `getTogglableColumns` to `Hide all` and `Show all` actions (#8496) @MBilalShafi
90
+ - [DataGrid] Add Grid + Joy UI experiment page (#8067) @cherniavskii
91
+ - [DataGrid] Fix print style when rendering inside Shadow DOM (#8656) @Bwatermelon
92
+ - [DataGrid] Replace `GridAutoSizer` with `ResizeObserver` (#8091) @m4theushw
93
+ - [DataGrid] Use stable ID for the placeholder filter item (#8603) @m4theushw
94
+ - [DataGridPro] Virtualize row detail panels (#7969) @yaredtsy
95
+
96
+ ### `@mui/x-date-pickers@v6.2.1` / `@mui/x-date-pickers-pro@v6.2.1`
97
+
98
+ #### Changes
99
+
100
+ - [pickers] Do not include the time in date components when going to today (#8657) @flaviendelangle
101
+ - [pickers] Sync internal state with controlled value (#8674) @alexfauquette
102
+
103
+ ### `@mui/x-codemod@v6.2.1`
104
+
105
+ #### Changes
106
+
107
+ - [codemod] Avoid filter failures on object prototype properties (#8647) @LukasTy
108
+
109
+ ### Docs
110
+
111
+ - [docs] Add no-op service worker to fix stale cache issue (#8598) @cherniavskii
112
+ - [docs] Clarify what `AdapterDayjs` is in the Getting Started page (#8219) @flaviendelangle
113
+ - [docs] Fix typo on picker page description (#8611) @maxolasersquad
114
+ - [docs] Improve section title in Getting Started page (#8648) @flaviendelangle
115
+ - [docs] Inform about input format modification (#8458) @alexfauquette
116
+
117
+ ### Core
118
+
119
+ - [core] Fix release date (#8618) @flaviendelangle
120
+ - [core] Upgrade monorepo (#8668) @MBilalShafi
121
+ - [charts] Support Tooltip (#8356) @alexfauquette
122
+
6
123
  ## 6.2.0
7
124
 
8
- _Apr 13, 2023_
125
+ _Apr 14, 2023_
9
126
 
10
127
  We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
11
128
 
@@ -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
- const getDetailPanels = () => {
233
- const panels = [];
234
- if (rootProps.getDetailPanelContent == null) {
235
- return panels;
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 uniqueExpandedRowIds = Array.from(new Set([...expandedRowIds]).values());
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
- // Check if the id exists in the current page
244
- const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(id);
245
- const exists = rowIndex !== undefined;
246
- if ( /*#__PURE__*/React.isValidElement(content) && exists) {
247
- const hasAutoHeight = apiRef.current.detailPanelHasAutoHeight(id);
248
- const height = hasAutoHeight ? 'auto' : detailPanelsHeights[id];
249
- const sizes = apiRef.current.unstable_getRowInternalSizes(id);
250
- const spacingTop = (sizes == null ? void 0 : sizes.spacingTop) || 0;
251
- const top = rowsMeta.positions[rowIndex] + apiRef.current.unstable_getRowHeight(id) + spacingTop;
252
- panels.push( /*#__PURE__*/_jsx(GridDetailPanel, {
253
- rowId: id,
254
- style: {
255
- top
256
- },
257
- height: height,
258
- className: classes.detailPanel,
259
- children: content
260
- }, id));
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 panels;
264
+ return null;
264
265
  };
265
- const detailPanels = getDetailPanels();
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,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v6.2.0
2
+ * @mui/x-data-grid-pro v6.3.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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
- var getDetailPanels = function getDetailPanels() {
241
- var panels = [];
242
- if (rootProps.getDetailPanelContent == null) {
243
- return panels;
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 uniqueExpandedRowIds = Array.from(new Set(_toConsumableArray(expandedRowIds)).values());
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
- // Check if the id exists in the current page
252
- var rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(id);
253
- var exists = rowIndex !== undefined;
254
- if ( /*#__PURE__*/React.isValidElement(content) && exists) {
255
- var hasAutoHeight = apiRef.current.detailPanelHasAutoHeight(id);
256
- var height = hasAutoHeight ? 'auto' : detailPanelsHeights[id];
257
- var sizes = apiRef.current.unstable_getRowInternalSizes(id);
258
- var spacingTop = (sizes == null ? void 0 : sizes.spacingTop) || 0;
259
- var top = rowsMeta.positions[rowIndex] + apiRef.current.unstable_getRowHeight(id) + spacingTop;
260
- panels.push( /*#__PURE__*/_jsx(GridDetailPanel, {
261
- rowId: id,
262
- style: {
263
- top: top
264
- },
265
- height: height,
266
- className: classes.detailPanel,
267
- children: content
268
- }, id));
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 panels;
271
+ return null;
272
272
  };
273
- var detailPanels = getDetailPanels();
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,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v6.2.0
2
+ * @mui/x-data-grid-pro v6.3.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export var getReleaseInfo = function getReleaseInfo() {
3
- var releaseInfo = "MTY4MTQyMzIwMDAwMA==";
3
+ var releaseInfo = "MTY4MjYyOTIwMDAwMA==";
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
@@ -23,7 +23,7 @@ var removeNodeAndCleanParent = function removeNodeAndCleanParent(_ref) {
23
23
  if (shouldDeleteGroup) {
24
24
  if (parentNode.isAutoGenerated) {
25
25
  removeNodeAndCleanParent({
26
- node: node,
26
+ node: parentNode,
27
27
  tree: tree,
28
28
  treeDepths: treeDepths
29
29
  });
@@ -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
- const getDetailPanels = () => {
230
- const panels = [];
231
- if (rootProps.getDetailPanelContent == null) {
232
- return panels;
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 uniqueExpandedRowIds = Array.from(new Set([...expandedRowIds]).values());
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
- // Check if the id exists in the current page
241
- const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(id);
242
- const exists = rowIndex !== undefined;
243
- if ( /*#__PURE__*/React.isValidElement(content) && exists) {
244
- const hasAutoHeight = apiRef.current.detailPanelHasAutoHeight(id);
245
- const height = hasAutoHeight ? 'auto' : detailPanelsHeights[id];
246
- const sizes = apiRef.current.unstable_getRowInternalSizes(id);
247
- const spacingTop = sizes?.spacingTop || 0;
248
- const top = rowsMeta.positions[rowIndex] + apiRef.current.unstable_getRowHeight(id) + spacingTop;
249
- panels.push( /*#__PURE__*/_jsx(GridDetailPanel, {
250
- rowId: id,
251
- style: {
252
- top
253
- },
254
- height: height,
255
- className: classes.detailPanel,
256
- children: content
257
- }, id));
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 panels;
261
+ return null;
261
262
  };
262
- const detailPanels = getDetailPanels();
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,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v6.2.0
2
+ * @mui/x-data-grid-pro v6.3.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTY4MTQyMzIwMDAwMA==";
3
+ const releaseInfo = "MTY4MjYyOTIwMDAwMA==";
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
@@ -24,7 +24,7 @@ const removeNodeAndCleanParent = ({
24
24
  if (shouldDeleteGroup) {
25
25
  if (parentNode.isAutoGenerated) {
26
26
  removeNodeAndCleanParent({
27
- node,
27
+ node: parentNode,
28
28
  tree,
29
29
  treeDepths
30
30
  });
@@ -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
- const getDetailPanels = () => {
239
- const panels = [];
240
- if (rootProps.getDetailPanelContent == null) {
241
- return panels;
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 uniqueExpandedRowIds = Array.from(new Set([...expandedRowIds]).values());
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
- // Check if the id exists in the current page
250
- const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(id);
251
- const exists = rowIndex !== undefined;
252
- if ( /*#__PURE__*/React.isValidElement(content) && exists) {
253
- const hasAutoHeight = apiRef.current.detailPanelHasAutoHeight(id);
254
- const height = hasAutoHeight ? 'auto' : detailPanelsHeights[id];
255
- const sizes = apiRef.current.unstable_getRowInternalSizes(id);
256
- const spacingTop = sizes?.spacingTop || 0;
257
- const top = rowsMeta.positions[rowIndex] + apiRef.current.unstable_getRowHeight(id) + spacingTop;
258
- panels.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridDetailPanel.GridDetailPanel, {
259
- rowId: id,
260
- style: {
261
- top
262
- },
263
- height: height,
264
- className: classes.detailPanel,
265
- children: content
266
- }, id));
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 panels;
270
+ return null;
270
271
  };
271
- const detailPanels = getDetailPanels();
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v6.2.0
2
+ * @mui/x-data-grid-pro v6.3.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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 = "MTY4MTQyMzIwMDAwMA==";
9
+ const releaseInfo = "MTY4MjYyOTIwMDAwMA==";
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
@@ -30,7 +30,7 @@ const removeNodeAndCleanParent = ({
30
30
  if (shouldDeleteGroup) {
31
31
  if (parentNode.isAutoGenerated) {
32
32
  removeNodeAndCleanParent({
33
- node,
33
+ node: parentNode,
34
34
  tree,
35
35
  treeDepths
36
36
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-pro",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
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",
@@ -32,13 +32,13 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.21.0",
35
- "@mui/utils": "^5.11.13",
36
- "@mui/x-data-grid": "6.2.0",
35
+ "@mui/utils": "^5.12.0",
36
+ "@mui/x-data-grid": "6.3.0",
37
37
  "@mui/x-license-pro": "6.0.4",
38
38
  "@types/format-util": "^1.0.2",
39
39
  "clsx": "^1.2.1",
40
40
  "prop-types": "^15.8.1",
41
- "reselect": "^4.1.7"
41
+ "reselect": "^4.1.8"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@mui/material": "^5.4.1",
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTY4MTQyMzIwMDAwMA==";
3
+ const releaseInfo = "MTY4MjYyOTIwMDAwMA==";
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
@@ -24,7 +24,7 @@ const removeNodeAndCleanParent = ({
24
24
  if (shouldDeleteGroup) {
25
25
  if (parentNode.isAutoGenerated) {
26
26
  removeNodeAndCleanParent({
27
- node,
27
+ node: parentNode,
28
28
  tree,
29
29
  treeDepths
30
30
  });