@mui/x-data-grid-pro 7.18.0 → 7.19.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,6 +3,116 @@
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
+ ## 7.19.0
7
+
8
+ _Oct 4, 2024_
9
+
10
+ We'd like to offer a big thanks to the 26 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🔁 Automatic parents and children selection for Data Grid ["tree data"](https://mui.com/x/react-data-grid/tree-data/) and ["row grouping"](https://mui.com/x/react-data-grid/row-grouping/) features
13
+ - 💫 Support `minHeight` and `maxHeight` on flex parent container for the Data Grid component
14
+ - 🎁 Export `publicAPI` from the `useTreeItem2Utils` hook for the Tree View
15
+ - 🌍 Improve Bulgarian (bg-BG), Croatian (hr-HR), French (fr-FR), German (de-DE), Japanese (ja-JP) and Vietnamese (vi-VN) locales and add Portuguese (pt-PT) locale on the Data Grid component
16
+ - 🌏 Improve Czech (cs-CZ) and Portuguese (pt-BR) locales and add Bulgarian (bg-BG), Croatian (hr-HR) and Portuguese (pt-PT) locales on the Pickers components
17
+ - 🐞 Bugfixes
18
+ - 📚 Documentation improvements
19
+
20
+ Special thanks goes out to our community contributors who have helped make this release possible:
21
+ @AWAIS97, @chucamphong, @GMchris, @JakubSveda, @k-rajat19, @k725, @lhilgert9, @ruiaraujo012, @Sanderand, @thomasmoon, @vallereaugabriel.
22
+ Following are all team members who have contributed to this release:
23
+ @alexfauquette, @arminmeh, @arthurbalduini, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @MBilalShafi, @michelengelen, @noraleonte, @oliviertassinari, @romgrk, @sai6855, @samuelsycamore.
24
+
25
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
26
+
27
+ ### Data Grid
28
+
29
+ #### `@mui/x-data-grid@7.19.0`
30
+
31
+ - [DataGrid] Fix column definition `undefined` value (#14456) @sai6855
32
+ - [DataGrid] Fix `checkboxSelectionVisibleOnly` reset the selection on filtering (#14677) @MBilalShafi
33
+ - [DataGrid] Fix background colors when `CSSVarsProvider` is used (#12901) @cherniavskii
34
+ - [DataGrid] Fix error when initializing aggregation with row spanning (#14710) @MBilalShafi
35
+ - [DataGrid] Fix scroll to cell logic for keyboard navigating cells and drag selection with pinned columns (#14550) @KenanYusuf
36
+ - [DataGrid] Support `minHeight` and `maxHeight` on flex parent container (#14614) @cherniavskii
37
+ - [l10n] Add missing Portuguese (pt-PT) translations (#14707) @ruiaraujo012
38
+ - [l10n] Improve Bulgarian (bg-BG) locale (#14451) @GMchris
39
+ - [l10n] Improve Croatian (hr-HR) locale (#14794) @arminmeh
40
+ - [l10n] Improve French (fr-FR) locale (#14750) @vallereaugabriel
41
+ - [l10n] Improve German (de-DE) locale (#14755) @lhilgert9
42
+ - [l10n] Improve Japanese (ja-JP) locale (#14381) @k725
43
+ - [l10n] Improve Vietnamese (vi-VN) locale (#14769) @chucamphong
44
+
45
+ #### `@mui/x-data-grid-pro@7.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
46
+
47
+ Same changes as in `@mui/x-data-grid@7.19.0`, plus:
48
+
49
+ - [DataGridPro] Fix dragging styles removal in column reorder (#14680) @k-rajat19
50
+ - [DataGridPro] Fix row pre-processing running with a stale data source (#14810) @MBilalShafi
51
+ - [DataGridPro] Fix `onRowsScrollEnd` not firing on very fast scrolling (#14171) @arminmeh
52
+
53
+ #### `@mui/x-data-grid-premium@7.19.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
54
+
55
+ Same changes as in `@mui/x-data-grid-pro@7.19.0`, plus:
56
+
57
+ - [DataGridPremium] Automatic parents and children selection (#13757) @MBilalShafi
58
+
59
+ ### Date and Time Pickers
60
+
61
+ #### `@mui/x-date-pickers@7.19.0`
62
+
63
+ - [pickers] Fix left-right keyboard nav with `yearsOrder="desc"` and `direction="rtl"` (#14682) @thomasmoon
64
+ - [pickers] Improve `PickerValidDate` type (#14771) @flaviendelangle
65
+ - [pickers] Improve typing of the range pickers (#14716) @flaviendelangle
66
+ - [l10n] Add Bulgarian (bg-BG) locale (#14469) @GMchris
67
+ - [l10n] Add Croatian (hr-HR) locale (#14795) @arminmeh
68
+ - [l10n] Add Portuguese (pt-PT) locale (#14722) @ruiaraujo012
69
+ - [l10n] Improve Czech (cs-CZ) locale (#14732) @JakubSveda
70
+ - [l10n] Improve Portuguese (pt-BR) locale (#14725) @arthurbalduini
71
+
72
+ #### `@mui/x-date-pickers-pro@7.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
73
+
74
+ Same changes as in `@mui/x-date-pickers@7.19.0`.
75
+
76
+ ### Charts
77
+
78
+ #### `@mui/x-charts@7.19.0`
79
+
80
+ - [charts] Fix `LineChart` area animation being stuck when resizing container (#14711) @alexfauquette
81
+ - [charts] Improve types and start using `warnOnce` (#14792) @JCQuintas
82
+
83
+ #### `@mui/x-charts-pro@7.0.0-beta.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
84
+
85
+ Same changes as in `@mui/x-charts@7.19.0`.
86
+
87
+ ### Tree View
88
+
89
+ #### `@mui/x-tree-view@7.19.0`
90
+
91
+ - [TreeView] Apply experimental features in `getDefaultizedParams` instead of in the plugin render (#14661) @flaviendelangle
92
+ - [TreeView] Export `publicAPI` form `useTreeItem2Utils` (#14729) @noraleonte
93
+ - [TreeView] Fix cursor navigation interfering with browser shortcut keys (#14798) @sai6855
94
+ - [TreeView] Fix invalid test for items reordering (#14665) @flaviendelangle
95
+ - [TreeView] Remove `instance.getTreeItemIdAttribute` (#14667) @flaviendelangle
96
+
97
+ ### Docs
98
+
99
+ - [docs] Added warning callout for Firefox reordering bug (#14516) @michelengelen
100
+ - [docs] Copyedit `pages.ts` navigation (#14782) @samuelsycamore
101
+ - [docs] Fix typo in row spanning doc (#14770) @flaviendelangle
102
+ - [docs] Fix typo in the Tree View migration guide to v7 (#14727) @Sanderand
103
+ - [docs] Fix typo in usage of Moment guide for UTC and timezones (#14780) @AWAIS97
104
+ - [docs] Fix what's new link to use absolute URL (#14543) @oliviertassinari
105
+
106
+ ### Core
107
+
108
+ - [core] Fix class name composition order (#14775) @oliviertassinari
109
+ - [core] Replace minWidth, maxWidth with width (#14776) @oliviertassinari
110
+ - [code-infra] Remove custom playwright installation steps (#14728) @Janpot
111
+ - [code-infra] Replace or remove all instances of `e` identifier (#14724) @samuelsycamore
112
+ - [infra] Adds community contribution section to the changelog script (#14799) @michelengelen
113
+ - [infra] Fix line break in Stack Overflow message @oliviertassinari
114
+ - [test] Fix `Escape` event firing event (#14797) @oliviertassinari
115
+
6
116
  ## 7.18.0
7
117
 
8
118
  _Sep 20, 2024_
@@ -83,6 +83,11 @@ DataGridProRaw.propTypes = {
83
83
  /**
84
84
  * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
85
85
  * @default false
86
+ * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
87
+ * @example
88
+ * <div style={{ display: 'flex', flexDirection: 'column' }}>
89
+ * <DataGrid />
90
+ * </div>
86
91
  */
87
92
  autoHeight: _propTypes.default.bool,
88
93
  /**
@@ -371,7 +376,7 @@ DataGridProRaw.propTypes = {
371
376
  */
372
377
  headerFilterHeight: _propTypes.default.number,
373
378
  /**
374
- * If `true`, enables the data grid filtering on header feature.
379
+ * If `true`, the header filters feature is enabled.
375
380
  * @default false
376
381
  */
377
382
  headerFilters: _propTypes.default.bool,
@@ -856,6 +861,22 @@ DataGridProRaw.propTypes = {
856
861
  * Sets the row selection model of the Data Grid.
857
862
  */
858
863
  rowSelectionModel: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired), _propTypes.default.number, _propTypes.default.string]),
864
+ /**
865
+ * When `rowSelectionPropagation.descendants` is set to `true`.
866
+ * - Selecting a parent will auto-select all its filtered descendants.
867
+ * - Deselecting a parent will auto-deselect all its filtered descendants.
868
+ *
869
+ * When `rowSelectionPropagation.parents=true`
870
+ * - Selecting all descendants of a parent would auto-select it.
871
+ * - Deselecting a descendant of a selected parent would deselect the parent.
872
+ *
873
+ * Works with tree data and row grouping on the client-side only.
874
+ * @default { parents: false, descendants: false }
875
+ */
876
+ rowSelectionPropagation: _propTypes.default.shape({
877
+ descendants: _propTypes.default.bool,
878
+ parents: _propTypes.default.bool
879
+ }),
859
880
  /**
860
881
  * Loading rows can be processed on the server or client-side.
861
882
  * Set it to 'client' if you would like enable infnite loading.
@@ -33,6 +33,7 @@ const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PRO_PROPS_DEFAULT_V
33
33
  getDetailPanelHeight: () => 500,
34
34
  headerFilters: false,
35
35
  keepColumnPositionIfDraggedOutside: false,
36
+ rowSelectionPropagation: _internals.ROW_SELECTION_PROPAGATION_DEFAULT,
36
37
  rowReordering: false,
37
38
  rowsLoadingMode: 'client',
38
39
  scrollEndThreshold: 80,
@@ -76,6 +76,11 @@ DataGridProRaw.propTypes = {
76
76
  /**
77
77
  * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
78
78
  * @default false
79
+ * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
80
+ * @example
81
+ * <div style={{ display: 'flex', flexDirection: 'column' }}>
82
+ * <DataGrid />
83
+ * </div>
79
84
  */
80
85
  autoHeight: PropTypes.bool,
81
86
  /**
@@ -364,7 +369,7 @@ DataGridProRaw.propTypes = {
364
369
  */
365
370
  headerFilterHeight: PropTypes.number,
366
371
  /**
367
- * If `true`, enables the data grid filtering on header feature.
372
+ * If `true`, the header filters feature is enabled.
368
373
  * @default false
369
374
  */
370
375
  headerFilters: PropTypes.bool,
@@ -849,6 +854,22 @@ DataGridProRaw.propTypes = {
849
854
  * Sets the row selection model of the Data Grid.
850
855
  */
851
856
  rowSelectionModel: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired), PropTypes.number, PropTypes.string]),
857
+ /**
858
+ * When `rowSelectionPropagation.descendants` is set to `true`.
859
+ * - Selecting a parent will auto-select all its filtered descendants.
860
+ * - Deselecting a parent will auto-deselect all its filtered descendants.
861
+ *
862
+ * When `rowSelectionPropagation.parents=true`
863
+ * - Selecting all descendants of a parent would auto-select it.
864
+ * - Deselecting a descendant of a selected parent would deselect the parent.
865
+ *
866
+ * Works with tree data and row grouping on the client-side only.
867
+ * @default { parents: false, descendants: false }
868
+ */
869
+ rowSelectionPropagation: PropTypes.shape({
870
+ descendants: PropTypes.bool,
871
+ parents: PropTypes.bool
872
+ }),
852
873
  /**
853
874
  * Loading rows can be processed on the server or client-side.
854
875
  * Set it to 'client' if you would like enable infnite loading.
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { useThemeProps } from '@mui/material/styles';
4
4
  import { GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
5
- import { computeSlots, useProps } from '@mui/x-data-grid/internals';
5
+ import { computeSlots, useProps, ROW_SELECTION_PROPAGATION_DEFAULT } from '@mui/x-data-grid/internals';
6
6
  import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from "../constants/dataGridProDefaultSlotsComponents.js";
7
7
  const getDataGridProForcedProps = themedProps => _extends({
8
8
  signature: 'DataGridPro'
@@ -25,6 +25,7 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
25
25
  getDetailPanelHeight: () => 500,
26
26
  headerFilters: false,
27
27
  keepColumnPositionIfDraggedOutside: false,
28
+ rowSelectionPropagation: ROW_SELECTION_PROPAGATION_DEFAULT,
28
29
  rowReordering: false,
29
30
  rowsLoadingMode: 'client',
30
31
  scrollEndThreshold: 80,
@@ -206,6 +206,11 @@ export const useGridColumnReorder = (apiRef, props) => {
206
206
  // For more information check here https://github.com/mui/mui-x/issues/2680.
207
207
  event.stopPropagation();
208
208
  clearTimeout(removeDnDStylesTimeout.current);
209
+
210
+ // For more information check here https://github.com/mui/mui-x/issues/14678
211
+ if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
212
+ dragColNode.current.classList.remove(classes.columnHeaderDragging);
213
+ }
209
214
  dragColNode.current = null;
210
215
 
211
216
  // Check if the column was dropped outside the grid.
@@ -228,7 +233,7 @@ export const useGridColumnReorder = (apiRef, props) => {
228
233
  })
229
234
  }));
230
235
  apiRef.current.forceUpdate();
231
- }, [props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, apiRef]);
236
+ }, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
232
237
  useGridApiEventHandler(apiRef, 'columnHeaderDragStart', handleDragStart);
233
238
  useGridApiEventHandler(apiRef, 'columnHeaderDragEnter', handleDragEnter);
234
239
  useGridApiEventHandler(apiRef, 'columnHeaderDragOver', handleDragOver);
@@ -128,9 +128,9 @@ export const useGridDataSource = (apiRef, props) => {
128
128
  apiRef.current.updateServerRows(getRowsResponse.rows, rowNode.path);
129
129
  apiRef.current.setRowChildrenExpansion(id, true);
130
130
  } catch (error) {
131
- const e = error;
132
- apiRef.current.unstable_dataSource.setChildrenFetchError(id, e);
133
- onError?.(e, fetchParams);
131
+ const childrenFetchError = error;
132
+ apiRef.current.unstable_dataSource.setChildrenFetchError(id, childrenFetchError);
133
+ onError?.(childrenFetchError, fetchParams);
134
134
  } finally {
135
135
  apiRef.current.unstable_dataSource.setChildrenLoading(id, false);
136
136
  nestedDataManager.setRequestSettled(id);
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useGridSelector, useGridApiOptionHandler, gridVisibleColumnDefinitionsSelector, useGridApiMethod, gridDimensionsSelector } from '@mui/x-data-grid';
3
- import { useGridVisibleRows } from '@mui/x-data-grid/internals';
3
+ import { useGridVisibleRows, useTimeout } from '@mui/x-data-grid/internals';
4
4
  import useEventCallback from '@mui/utils/useEventCallback';
5
5
  import { styled } from '@mui/system';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -20,6 +20,7 @@ export const useGridInfiniteLoader = (apiRef, props) => {
20
20
  const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
21
21
  const currentPage = useGridVisibleRows(apiRef, props);
22
22
  const observer = React.useRef();
23
+ const updateTargetTimeout = useTimeout();
23
24
  const triggerElement = React.useRef(null);
24
25
  const isEnabled = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
25
26
  const handleLoadMoreRows = useEventCallback(([entry]) => {
@@ -58,11 +59,7 @@ export const useGridInfiniteLoader = (apiRef, props) => {
58
59
  observer.current.observe(triggerElement.current);
59
60
  }
60
61
  }, [virtualScroller, handleLoadMoreRows, isEnabled, marginBottom]);
61
- const triggerRef = React.useCallback(node => {
62
- // Prevent the infite loading working in combination with lazy loading
63
- if (!isEnabled) {
64
- return;
65
- }
62
+ const updateTarget = node => {
66
63
  if (triggerElement.current !== node) {
67
64
  observer.current?.disconnect();
68
65
  triggerElement.current = node;
@@ -70,7 +67,23 @@ export const useGridInfiniteLoader = (apiRef, props) => {
70
67
  observer.current?.observe(triggerElement.current);
71
68
  }
72
69
  }
73
- }, [isEnabled]);
70
+ };
71
+ const triggerRef = React.useCallback(node => {
72
+ // Prevent the infite loading working in combination with lazy loading
73
+ if (!isEnabled) {
74
+ return;
75
+ }
76
+
77
+ // If the user scrolls through the grid too fast it might happen that the observer is connected to the trigger element
78
+ // that will be intersecting the root inside the same render cycle (but not intersecting at the time of the connection).
79
+ // This will cause the observer to not call the callback with `isIntersecting` set to `true`.
80
+ // https://www.w3.org/TR/intersection-observer/#event-loop
81
+ // Delaying the connection to the next cycle helps since the observer will always call the callback the first time it is connected.
82
+ // https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/observe
83
+ // Related to
84
+ // https://github.com/mui/mui-x/issues/14116
85
+ updateTargetTimeout.start(0, () => updateTarget(node));
86
+ }, [isEnabled, updateTargetTimeout]);
74
87
  const getInfiniteLoadingTriggerElement = React.useCallback(({
75
88
  lastRowId
76
89
  }) => {
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcyNjc4NjgwMDAwMA==";
3
+ const releaseInfo = "MTcyNzk4OTIwMDAwMA==";
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
@@ -215,6 +215,11 @@ const useGridColumnReorder = (apiRef, props) => {
215
215
  // For more information check here https://github.com/mui/mui-x/issues/2680.
216
216
  event.stopPropagation();
217
217
  clearTimeout(removeDnDStylesTimeout.current);
218
+
219
+ // For more information check here https://github.com/mui/mui-x/issues/14678
220
+ if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
221
+ dragColNode.current.classList.remove(classes.columnHeaderDragging);
222
+ }
218
223
  dragColNode.current = null;
219
224
 
220
225
  // Check if the column was dropped outside the grid.
@@ -237,7 +242,7 @@ const useGridColumnReorder = (apiRef, props) => {
237
242
  })
238
243
  }));
239
244
  apiRef.current.forceUpdate();
240
- }, [props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, apiRef]);
245
+ }, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
241
246
  (0, _xDataGrid.useGridApiEventHandler)(apiRef, 'columnHeaderDragStart', handleDragStart);
242
247
  (0, _xDataGrid.useGridApiEventHandler)(apiRef, 'columnHeaderDragEnter', handleDragEnter);
243
248
  (0, _xDataGrid.useGridApiEventHandler)(apiRef, 'columnHeaderDragOver', handleDragOver);
@@ -137,9 +137,9 @@ const useGridDataSource = (apiRef, props) => {
137
137
  apiRef.current.updateServerRows(getRowsResponse.rows, rowNode.path);
138
138
  apiRef.current.setRowChildrenExpansion(id, true);
139
139
  } catch (error) {
140
- const e = error;
141
- apiRef.current.unstable_dataSource.setChildrenFetchError(id, e);
142
- onError?.(e, fetchParams);
140
+ const childrenFetchError = error;
141
+ apiRef.current.unstable_dataSource.setChildrenFetchError(id, childrenFetchError);
142
+ onError?.(childrenFetchError, fetchParams);
143
143
  } finally {
144
144
  apiRef.current.unstable_dataSource.setChildrenLoading(id, false);
145
145
  nestedDataManager.setRequestSettled(id);
@@ -28,6 +28,7 @@ const useGridInfiniteLoader = (apiRef, props) => {
28
28
  const visibleColumns = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridVisibleColumnDefinitionsSelector);
29
29
  const currentPage = (0, _internals.useGridVisibleRows)(apiRef, props);
30
30
  const observer = React.useRef();
31
+ const updateTargetTimeout = (0, _internals.useTimeout)();
31
32
  const triggerElement = React.useRef(null);
32
33
  const isEnabled = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
33
34
  const handleLoadMoreRows = (0, _useEventCallback.default)(([entry]) => {
@@ -66,11 +67,7 @@ const useGridInfiniteLoader = (apiRef, props) => {
66
67
  observer.current.observe(triggerElement.current);
67
68
  }
68
69
  }, [virtualScroller, handleLoadMoreRows, isEnabled, marginBottom]);
69
- const triggerRef = React.useCallback(node => {
70
- // Prevent the infite loading working in combination with lazy loading
71
- if (!isEnabled) {
72
- return;
73
- }
70
+ const updateTarget = node => {
74
71
  if (triggerElement.current !== node) {
75
72
  observer.current?.disconnect();
76
73
  triggerElement.current = node;
@@ -78,7 +75,23 @@ const useGridInfiniteLoader = (apiRef, props) => {
78
75
  observer.current?.observe(triggerElement.current);
79
76
  }
80
77
  }
81
- }, [isEnabled]);
78
+ };
79
+ const triggerRef = React.useCallback(node => {
80
+ // Prevent the infite loading working in combination with lazy loading
81
+ if (!isEnabled) {
82
+ return;
83
+ }
84
+
85
+ // If the user scrolls through the grid too fast it might happen that the observer is connected to the trigger element
86
+ // that will be intersecting the root inside the same render cycle (but not intersecting at the time of the connection).
87
+ // This will cause the observer to not call the callback with `isIntersecting` set to `true`.
88
+ // https://www.w3.org/TR/intersection-observer/#event-loop
89
+ // Delaying the connection to the next cycle helps since the observer will always call the callback the first time it is connected.
90
+ // https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/observe
91
+ // Related to
92
+ // https://github.com/mui/mui-x/issues/14116
93
+ updateTargetTimeout.start(0, () => updateTarget(node));
94
+ }, [isEnabled, updateTargetTimeout]);
82
95
  const getInfiniteLoadingTriggerElement = React.useCallback(({
83
96
  lastRowId
84
97
  }) => {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v7.18.0
2
+ * @mui/x-data-grid-pro v7.19.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,5 +1,5 @@
1
1
  declare const materialSlots: {
2
- columnMenuPinLeftIcon: import("react").JSXElementConstructor<any>;
3
- columnMenuPinRightIcon: import("react").JSXElementConstructor<any>;
2
+ columnMenuPinLeftIcon: React.JSXElementConstructor<any>;
3
+ columnMenuPinRightIcon: React.JSXElementConstructor<any>;
4
4
  };
5
5
  export default materialSlots;
@@ -76,6 +76,11 @@ DataGridProRaw.propTypes = {
76
76
  /**
77
77
  * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
78
78
  * @default false
79
+ * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
80
+ * @example
81
+ * <div style={{ display: 'flex', flexDirection: 'column' }}>
82
+ * <DataGrid />
83
+ * </div>
79
84
  */
80
85
  autoHeight: PropTypes.bool,
81
86
  /**
@@ -364,7 +369,7 @@ DataGridProRaw.propTypes = {
364
369
  */
365
370
  headerFilterHeight: PropTypes.number,
366
371
  /**
367
- * If `true`, enables the data grid filtering on header feature.
372
+ * If `true`, the header filters feature is enabled.
368
373
  * @default false
369
374
  */
370
375
  headerFilters: PropTypes.bool,
@@ -849,6 +854,22 @@ DataGridProRaw.propTypes = {
849
854
  * Sets the row selection model of the Data Grid.
850
855
  */
851
856
  rowSelectionModel: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired), PropTypes.number, PropTypes.string]),
857
+ /**
858
+ * When `rowSelectionPropagation.descendants` is set to `true`.
859
+ * - Selecting a parent will auto-select all its filtered descendants.
860
+ * - Deselecting a parent will auto-deselect all its filtered descendants.
861
+ *
862
+ * When `rowSelectionPropagation.parents=true`
863
+ * - Selecting all descendants of a parent would auto-select it.
864
+ * - Deselecting a descendant of a selected parent would deselect the parent.
865
+ *
866
+ * Works with tree data and row grouping on the client-side only.
867
+ * @default { parents: false, descendants: false }
868
+ */
869
+ rowSelectionPropagation: PropTypes.shape({
870
+ descendants: PropTypes.bool,
871
+ parents: PropTypes.bool
872
+ }),
852
873
  /**
853
874
  * Loading rows can be processed on the server or client-side.
854
875
  * Set it to 'client' if you would like enable infnite loading.
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { useThemeProps } from '@mui/material/styles';
4
4
  import { GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
5
- import { computeSlots, useProps } from '@mui/x-data-grid/internals';
5
+ import { computeSlots, useProps, ROW_SELECTION_PROPAGATION_DEFAULT } from '@mui/x-data-grid/internals';
6
6
  import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from "../constants/dataGridProDefaultSlotsComponents.js";
7
7
  const getDataGridProForcedProps = themedProps => _extends({
8
8
  signature: 'DataGridPro'
@@ -25,6 +25,7 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
25
25
  getDetailPanelHeight: () => 500,
26
26
  headerFilters: false,
27
27
  keepColumnPositionIfDraggedOutside: false,
28
+ rowSelectionPropagation: ROW_SELECTION_PROPAGATION_DEFAULT,
28
29
  rowReordering: false,
29
30
  rowsLoadingMode: 'client',
30
31
  scrollEndThreshold: 80,
@@ -206,6 +206,11 @@ export const useGridColumnReorder = (apiRef, props) => {
206
206
  // For more information check here https://github.com/mui/mui-x/issues/2680.
207
207
  event.stopPropagation();
208
208
  clearTimeout(removeDnDStylesTimeout.current);
209
+
210
+ // For more information check here https://github.com/mui/mui-x/issues/14678
211
+ if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
212
+ dragColNode.current.classList.remove(classes.columnHeaderDragging);
213
+ }
209
214
  dragColNode.current = null;
210
215
 
211
216
  // Check if the column was dropped outside the grid.
@@ -228,7 +233,7 @@ export const useGridColumnReorder = (apiRef, props) => {
228
233
  })
229
234
  }));
230
235
  apiRef.current.forceUpdate();
231
- }, [props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, apiRef]);
236
+ }, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
232
237
  useGridApiEventHandler(apiRef, 'columnHeaderDragStart', handleDragStart);
233
238
  useGridApiEventHandler(apiRef, 'columnHeaderDragEnter', handleDragEnter);
234
239
  useGridApiEventHandler(apiRef, 'columnHeaderDragOver', handleDragOver);
@@ -128,9 +128,9 @@ export const useGridDataSource = (apiRef, props) => {
128
128
  apiRef.current.updateServerRows(getRowsResponse.rows, rowNode.path);
129
129
  apiRef.current.setRowChildrenExpansion(id, true);
130
130
  } catch (error) {
131
- const e = error;
132
- apiRef.current.unstable_dataSource.setChildrenFetchError(id, e);
133
- onError?.(e, fetchParams);
131
+ const childrenFetchError = error;
132
+ apiRef.current.unstable_dataSource.setChildrenFetchError(id, childrenFetchError);
133
+ onError?.(childrenFetchError, fetchParams);
134
134
  } finally {
135
135
  apiRef.current.unstable_dataSource.setChildrenLoading(id, false);
136
136
  nestedDataManager.setRequestSettled(id);
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useGridSelector, useGridApiOptionHandler, gridVisibleColumnDefinitionsSelector, useGridApiMethod, gridDimensionsSelector } from '@mui/x-data-grid';
3
- import { useGridVisibleRows } from '@mui/x-data-grid/internals';
3
+ import { useGridVisibleRows, useTimeout } from '@mui/x-data-grid/internals';
4
4
  import useEventCallback from '@mui/utils/useEventCallback';
5
5
  import { styled } from '@mui/system';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -20,6 +20,7 @@ export const useGridInfiniteLoader = (apiRef, props) => {
20
20
  const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
21
21
  const currentPage = useGridVisibleRows(apiRef, props);
22
22
  const observer = React.useRef();
23
+ const updateTargetTimeout = useTimeout();
23
24
  const triggerElement = React.useRef(null);
24
25
  const isEnabled = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
25
26
  const handleLoadMoreRows = useEventCallback(([entry]) => {
@@ -58,11 +59,7 @@ export const useGridInfiniteLoader = (apiRef, props) => {
58
59
  observer.current.observe(triggerElement.current);
59
60
  }
60
61
  }, [virtualScroller, handleLoadMoreRows, isEnabled, marginBottom]);
61
- const triggerRef = React.useCallback(node => {
62
- // Prevent the infite loading working in combination with lazy loading
63
- if (!isEnabled) {
64
- return;
65
- }
62
+ const updateTarget = node => {
66
63
  if (triggerElement.current !== node) {
67
64
  observer.current?.disconnect();
68
65
  triggerElement.current = node;
@@ -70,7 +67,23 @@ export const useGridInfiniteLoader = (apiRef, props) => {
70
67
  observer.current?.observe(triggerElement.current);
71
68
  }
72
69
  }
73
- }, [isEnabled]);
70
+ };
71
+ const triggerRef = React.useCallback(node => {
72
+ // Prevent the infite loading working in combination with lazy loading
73
+ if (!isEnabled) {
74
+ return;
75
+ }
76
+
77
+ // If the user scrolls through the grid too fast it might happen that the observer is connected to the trigger element
78
+ // that will be intersecting the root inside the same render cycle (but not intersecting at the time of the connection).
79
+ // This will cause the observer to not call the callback with `isIntersecting` set to `true`.
80
+ // https://www.w3.org/TR/intersection-observer/#event-loop
81
+ // Delaying the connection to the next cycle helps since the observer will always call the callback the first time it is connected.
82
+ // https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/observe
83
+ // Related to
84
+ // https://github.com/mui/mui-x/issues/14116
85
+ updateTargetTimeout.start(0, () => updateTarget(node));
86
+ }, [isEnabled, updateTargetTimeout]);
74
87
  const getInfiniteLoadingTriggerElement = React.useCallback(({
75
88
  lastRowId
76
89
  }) => {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v7.18.0
2
+ * @mui/x-data-grid-pro v7.19.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 = "MTcyNjc4NjgwMDAwMA==";
3
+ const releaseInfo = "MTcyNzk4OTIwMDAwMA==";
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-pro",
3
- "version": "7.18.0",
3
+ "version": "7.19.0",
4
4
  "description": "The Pro plan edition of the Data Grid components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -39,7 +39,7 @@
39
39
  "clsx": "^2.1.1",
40
40
  "prop-types": "^15.8.1",
41
41
  "reselect": "^5.1.1",
42
- "@mui/x-data-grid": "7.18.0",
42
+ "@mui/x-data-grid": "7.19.0",
43
43
  "@mui/x-internals": "7.18.0",
44
44
  "@mui/x-license": "7.18.0"
45
45
  },
@@ -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 = "MTcyNjc4NjgwMDAwMA==";
9
+ const releaseInfo = "MTcyNzk4OTIwMDAwMA==";
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