@mui/x-data-grid-pro 8.18.0 → 8.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
@@ -5,6 +5,119 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.19.0
9
+
10
+ _Nov 20, 2025_
11
+
12
+ We'd like to extend a big thank you to the 15 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🔎 Add pan on `wheel` to the charts zoom
15
+ - ⌨️ Allow opt-in to [tab navigation](https://mui.com/x/react-data-grid/accessibility/#tab-navigation) inside the Data Grid.
16
+ - ⚙️ New way of defining [action columns](https://mui.com/x/react-data-grid/column-definition/#ActionsWithModalGrid.tsx) in the Data Grid that makes it easier to keep `columns` prop stable.
17
+ - 🐞 Bugfixes
18
+ - 📚 Documentation improvements
19
+
20
+ Special thanks go out to these community members for their valuable contributions:
21
+ @lauri865, @noobyogi0010, @sai6855
22
+
23
+ The following team members contributed to this release:
24
+ @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @mj12albert, @noraleonte, @rita-codes, @siriwatknp, @ZeeshanTamboli
25
+
26
+ ### Data Grid
27
+
28
+ #### `@mui/x-data-grid@8.19.0`
29
+
30
+ - [DataGrid] Add `tabNavigation` prop to control tab navigation in the grid (#20286) @arminmeh
31
+ - [DataGrid] Allow to focus disabled checkbox cells (#19959) @mj12albert
32
+ - [DataGrid] Alternative actions column definition API (#15041) @cherniavskii
33
+ - [DataGrid] Fix failing tests (#20332) @cherniavskii
34
+ - [DataGrid] Prevent Safari 26 error in the event handler (#20369) @arminmeh
35
+ - [DataGrid] Undeprecate the `autoHeight` prop (#20363) @cherniavskii
36
+ - [DataGrid] Fix print export grid dimensions with dynamic row height and print styles (#19835) @cherniavskii
37
+
38
+ #### `@mui/x-data-grid-pro@8.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
39
+
40
+ Same changes as in `@mui/x-data-grid@8.19.0`.
41
+
42
+ #### `@mui/x-data-grid-premium@8.19.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
43
+
44
+ Same changes as in `@mui/x-data-grid-pro@8.19.0`, plus:
45
+
46
+ - [DataGridPremium] Fix aggregation with sorting (#19892) @lauri865
47
+ - [DataGridPremium] Lock `ExcelJS` version (#20329) @cherniavskii
48
+
49
+ ### Date and Time Pickers
50
+
51
+ #### `@mui/x-date-pickers@8.19.0`
52
+
53
+ - [pickers] Do not loose `slotProps.field.slotProps` (#20322) @flaviendelangle
54
+
55
+ #### `@mui/x-date-pickers-pro@8.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
56
+
57
+ Same changes as in `@mui/x-date-pickers@8.19.0`.
58
+
59
+ ### Charts
60
+
61
+ #### `@mui/x-charts@8.19.0`
62
+
63
+ - [charts] Expose `niceDomain` utility (#20250) @bernardobelchior
64
+ - [charts] Fix benchmark regression by downgrading to JSDOM v26 (#20405) @bernardobelchior
65
+ - [charts] Fix Pie Chart keyboard focus highlight (#20358) @JCQuintas
66
+ - [charts] Memoize series selectors (#20326) @JCQuintas
67
+ - [charts] Relax dataset type (#20294) @bernardobelchior
68
+ - [charts] Remove `touch-action: pan-y` when zoom is disabled (#20204) @bernardobelchior
69
+ - [charts] Use `getBBox()` for correct SVG sizes in firefox (#20309) @JCQuintas
70
+ - [charts] Use directly selector from `@mui/x-internals` (#20365) @alexfauquette
71
+ - [charts] Fix unnecessary errors in dev mode (#20380) @JCQuintas
72
+
73
+ #### `@mui/x-charts-pro@8.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
74
+
75
+ Same changes as in `@mui/x-charts@8.19.0`, plus:
76
+
77
+ - [charts-pro] Add pan on `wheel` to zoom (#19998) @JCQuintas
78
+ - [charts-pro] Fix zoom slider preview having an opaque background in dark mode (#20367) @bernardobelchior
79
+
80
+ #### `@mui/x-charts-premium@8.19.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
81
+
82
+ Same changes as in `@mui/x-charts-pro@8.19.0`.
83
+
84
+ ### Tree View
85
+
86
+ #### `@mui/x-tree-view@8.19.0`
87
+
88
+ - [tree view] Enable lazy load when children count is not know in tree view (#18680) @noobyogi0010
89
+ - [tree view] Fix unwanted behaviors on the item re-ordering (#20368) @flaviendelangle
90
+
91
+ #### `@mui/x-tree-view-pro@8.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
92
+
93
+ Same changes as in `@mui/x-tree-view@8.19.0`.
94
+
95
+ ### Codemod
96
+
97
+ #### `@mui/x-codemod@8.19.0`
98
+
99
+ Internal changes.
100
+
101
+ ### Docs
102
+
103
+ - [docs] Add minimum Typescript version to migration guide (#20320) @siriwatknp
104
+ - [docs] Fix Autosizing documentation (#20348) @siriwatknp
105
+ - [docs] Fix separator opacity in demo (#20293) @sai6855
106
+ - [docs] Replace deprecated `LoadingButton` with `Button` component (#20208) @Janpot
107
+
108
+ ### Core
109
+
110
+ - [code-infra] Add new broken links checker (#20120) @Janpot
111
+ - [code-infra] Disable Codspeed pipeline (#20370) @JCQuintas
112
+ - [code-infra] Optimize `checkMaterialVersion` (#20307) @Janpot
113
+ - [code-infra] Use utils from code-infra for changelog and PR creation (#20406) @brijeshb42
114
+ - [docs-infra] Revert `@docsearch/react` (#20313) @Janpot
115
+
116
+ ### Miscellaneous
117
+
118
+ - [test] Fix browser tests skipping some projects (#20318) @cherniavskii
119
+ - [test] Update `use-react-version` pnpm script (#20319) @cherniavskii
120
+
8
121
  ## 8.18.0
9
122
 
10
123
  <!-- generated comparing v8.17.0..master -->
@@ -33,7 +33,7 @@ const configuration = {
33
33
  useFilterValueGetter: apiRef => apiRef.current.getRowValue
34
34
  }
35
35
  };
36
- const releaseInfo = "MTc2Mjk5MjAwMDAwMA==";
36
+ const releaseInfo = "MTc2MzU5NjgwMDAwMA==";
37
37
  const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
38
38
  packageName: "x-data-grid-pro",
39
39
  releaseInfo: releaseInfo
@@ -90,13 +90,11 @@ DataGridProRaw.propTypes = {
90
90
  */
91
91
  'aria-labelledby': _propTypes.default.string,
92
92
  /**
93
- * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
93
+ * If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
94
+ * Use it instead of a flex parent container approach, if:
95
+ * - you don't need to set a minimum or maximum height for the Data Grid
96
+ * - you want to avoid the scrollbar flickering when the content changes
94
97
  * @default false
95
- * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
96
- * @example
97
- * <div style={{ display: 'flex', flexDirection: 'column' }}>
98
- * <DataGrid />
99
- * </div>
100
98
  */
101
99
  autoHeight: _propTypes.default.bool,
102
100
  /**
@@ -1039,6 +1037,15 @@ DataGridProRaw.propTypes = {
1039
1037
  * The system prop that allows defining system overrides as well as additional CSS styles.
1040
1038
  */
1041
1039
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
1040
+ /**
1041
+ * Sets the tab navigation behavior for the Data Grid.
1042
+ * - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
1043
+ * - "content": Pressing the tab key will move the focus to the next cell in the same row or the first cell in the next row. Shift+Tab will move the focus to the previous cell in the same row or the last cell in the previous row. Tab navigation is not enabled for the header.
1044
+ * - "header": Pressing the tab key will move the focus to the next column group, column header or header filter. Shift+Tab will move the focus to the previous column group, column header or header filter. Tab navigation is not enabled for the content.
1045
+ * - "all": Combines the "content" and "header" behavior.
1046
+ * @default "none"
1047
+ */
1048
+ tabNavigation: _propTypes.default.oneOf(['all', 'content', 'header', 'none']),
1042
1049
  /**
1043
1050
  * If positive, the Data Grid will throttle updates coming from `apiRef.current.updateRows` and `apiRef.current.setRows`.
1044
1051
  * It can be useful if you have a high update rate but do not want to do heavy work like filtering / sorting or rendering on each individual update.
@@ -79,7 +79,6 @@ const useDataGridProComponent = (apiRef, props, configuration) => {
79
79
  (0, _internals.useGridInitializeState)(_internals.dimensionsStateInitializer, apiRef, props);
80
80
  (0, _internals.useGridInitializeState)(_internals.rowsMetaStateInitializer, apiRef, props);
81
81
  (0, _internals.useGridInitializeState)(_internals.listViewStateInitializer, apiRef, props);
82
- (0, _internals.useGridVirtualizer)(apiRef, props);
83
82
  (0, _internals.useGridHeaderFiltering)(apiRef, props);
84
83
  (0, _useGridTreeData.useGridTreeData)(apiRef, props);
85
84
  (0, _internals.useGridKeyboardNavigation)(apiRef, props);
@@ -102,7 +101,6 @@ const useDataGridProComponent = (apiRef, props, configuration) => {
102
101
  (0, _useGridColumnReorder.useGridColumnReorder)(apiRef, props);
103
102
  (0, _internals.useGridColumnResize)(apiRef, props);
104
103
  (0, _internals.useGridPagination)(apiRef, props);
105
- (0, _internals.useGridRowsMeta)(apiRef, props);
106
104
  (0, _useGridRowReorder.useGridRowReorder)(apiRef, props);
107
105
  (0, _internals.useGridScroll)(apiRef, props);
108
106
  (0, _useGridInfiniteLoader.useGridInfiniteLoader)(apiRef, props);
@@ -121,6 +119,9 @@ const useDataGridProComponent = (apiRef, props, configuration) => {
121
119
  (0, _internals.useGridListView)(apiRef, props);
122
120
 
123
121
  // Should be the last thing to run, because all pre-processors should have been registered by now.
122
+ (0, _internals.useFirstRender)(() => {
123
+ apiRef.current.runAppliersForPendingProcessors();
124
+ });
124
125
  React.useEffect(() => {
125
126
  apiRef.current.runAppliersForPendingProcessors();
126
127
  });
@@ -83,16 +83,6 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
83
83
  * The column field of the cell that triggered the event.
84
84
  */
85
85
  field: _propTypes.default.string.isRequired,
86
- /**
87
- * A ref allowing to set imperative focus.
88
- * It can be passed to the element that should receive focus.
89
- * @ignore - do not document.
90
- */
91
- focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
92
- current: _propTypes.default.shape({
93
- focus: _propTypes.default.func.isRequired
94
- })
95
- })]),
96
86
  /**
97
87
  * The cell value formatted with the column valueFormatter.
98
88
  */
@@ -137,16 +137,6 @@ process.env.NODE_ENV !== "production" ? GridRowReorderCell.propTypes = {
137
137
  * The column field of the cell that triggered the event.
138
138
  */
139
139
  field: _propTypes.default.string.isRequired,
140
- /**
141
- * A ref allowing to set imperative focus.
142
- * It can be passed to the element that should receive focus.
143
- * @ignore - do not document.
144
- */
145
- focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
146
- current: _propTypes.default.shape({
147
- focus: _propTypes.default.func.isRequired
148
- })
149
- })]),
150
140
  /**
151
141
  * The cell value formatted with the column valueFormatter.
152
142
  */
@@ -88,16 +88,6 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
88
88
  * The column field of the cell that triggered the event.
89
89
  */
90
90
  field: _propTypes.default.string.isRequired,
91
- /**
92
- * A ref allowing to set imperative focus.
93
- * It can be passed to the element that should receive focus.
94
- * @ignore - do not document.
95
- */
96
- focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
97
- current: _propTypes.default.shape({
98
- focus: _propTypes.default.func.isRequired
99
- })
100
- })]),
101
91
  /**
102
92
  * The cell value formatted with the column valueFormatter.
103
93
  */
@@ -26,7 +26,7 @@ const configuration = {
26
26
  useFilterValueGetter: apiRef => apiRef.current.getRowValue
27
27
  }
28
28
  };
29
- const releaseInfo = "MTc2Mjk5MjAwMDAwMA==";
29
+ const releaseInfo = "MTc2MzU5NjgwMDAwMA==";
30
30
  const watermark = /*#__PURE__*/_jsx(Watermark, {
31
31
  packageName: "x-data-grid-pro",
32
32
  releaseInfo: releaseInfo
@@ -83,13 +83,11 @@ DataGridProRaw.propTypes = {
83
83
  */
84
84
  'aria-labelledby': PropTypes.string,
85
85
  /**
86
- * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
86
+ * If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
87
+ * Use it instead of a flex parent container approach, if:
88
+ * - you don't need to set a minimum or maximum height for the Data Grid
89
+ * - you want to avoid the scrollbar flickering when the content changes
87
90
  * @default false
88
- * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
89
- * @example
90
- * <div style={{ display: 'flex', flexDirection: 'column' }}>
91
- * <DataGrid />
92
- * </div>
93
91
  */
94
92
  autoHeight: PropTypes.bool,
95
93
  /**
@@ -1032,6 +1030,15 @@ DataGridProRaw.propTypes = {
1032
1030
  * The system prop that allows defining system overrides as well as additional CSS styles.
1033
1031
  */
1034
1032
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
1033
+ /**
1034
+ * Sets the tab navigation behavior for the Data Grid.
1035
+ * - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
1036
+ * - "content": Pressing the tab key will move the focus to the next cell in the same row or the first cell in the next row. Shift+Tab will move the focus to the previous cell in the same row or the last cell in the previous row. Tab navigation is not enabled for the header.
1037
+ * - "header": Pressing the tab key will move the focus to the next column group, column header or header filter. Shift+Tab will move the focus to the previous column group, column header or header filter. Tab navigation is not enabled for the content.
1038
+ * - "all": Combines the "content" and "header" behavior.
1039
+ * @default "none"
1040
+ */
1041
+ tabNavigation: PropTypes.oneOf(['all', 'content', 'header', 'none']),
1035
1042
  /**
1036
1043
  * If positive, the Data Grid will throttle updates coming from `apiRef.current.updateRows` and `apiRef.current.setRows`.
1037
1044
  * It can be useful if you have a high update rate but do not want to do heavy work like filtering / sorting or rendering on each individual update.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import { useGridInitialization, useGridInitializeState, useGridVirtualizer, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, useGridColumnSpanning, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridColumnResize, columnResizeStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer, propsStateInitializer } from '@mui/x-data-grid/internals';
4
+ import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, useGridColumnSpanning, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridColumnResize, columnResizeStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer, propsStateInitializer, useFirstRender } from '@mui/x-data-grid/internals';
5
5
  // Pro-only features
6
6
  import { useGridInfiniteLoader } from "../hooks/features/infiniteLoader/useGridInfiniteLoader.js";
7
7
  import { useGridColumnReorder, columnReorderStateInitializer } from "../hooks/features/columnReorder/useGridColumnReorder.js";
@@ -72,7 +72,6 @@ export const useDataGridProComponent = (apiRef, props, configuration) => {
72
72
  useGridInitializeState(dimensionsStateInitializer, apiRef, props);
73
73
  useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
74
74
  useGridInitializeState(listViewStateInitializer, apiRef, props);
75
- useGridVirtualizer(apiRef, props);
76
75
  useGridHeaderFiltering(apiRef, props);
77
76
  useGridTreeData(apiRef, props);
78
77
  useGridKeyboardNavigation(apiRef, props);
@@ -95,7 +94,6 @@ export const useDataGridProComponent = (apiRef, props, configuration) => {
95
94
  useGridColumnReorder(apiRef, props);
96
95
  useGridColumnResize(apiRef, props);
97
96
  useGridPagination(apiRef, props);
98
- useGridRowsMeta(apiRef, props);
99
97
  useGridRowReorder(apiRef, props);
100
98
  useGridScroll(apiRef, props);
101
99
  useGridInfiniteLoader(apiRef, props);
@@ -114,6 +112,9 @@ export const useDataGridProComponent = (apiRef, props, configuration) => {
114
112
  useGridListView(apiRef, props);
115
113
 
116
114
  // Should be the last thing to run, because all pre-processors should have been registered by now.
115
+ useFirstRender(() => {
116
+ apiRef.current.runAppliersForPendingProcessors();
117
+ });
117
118
  React.useEffect(() => {
118
119
  apiRef.current.runAppliersForPendingProcessors();
119
120
  });
@@ -75,16 +75,6 @@ process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
75
75
  * The column field of the cell that triggered the event.
76
76
  */
77
77
  field: PropTypes.string.isRequired,
78
- /**
79
- * A ref allowing to set imperative focus.
80
- * It can be passed to the element that should receive focus.
81
- * @ignore - do not document.
82
- */
83
- focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
84
- current: PropTypes.shape({
85
- focus: PropTypes.func.isRequired
86
- })
87
- })]),
88
78
  /**
89
79
  * The cell value formatted with the column valueFormatter.
90
80
  */
@@ -128,16 +128,6 @@ process.env.NODE_ENV !== "production" ? GridRowReorderCell.propTypes = {
128
128
  * The column field of the cell that triggered the event.
129
129
  */
130
130
  field: PropTypes.string.isRequired,
131
- /**
132
- * A ref allowing to set imperative focus.
133
- * It can be passed to the element that should receive focus.
134
- * @ignore - do not document.
135
- */
136
- focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
137
- current: PropTypes.shape({
138
- focus: PropTypes.func.isRequired
139
- })
140
- })]),
141
131
  /**
142
132
  * The cell value formatted with the column valueFormatter.
143
133
  */
@@ -80,16 +80,6 @@ process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
80
80
  * The column field of the cell that triggered the event.
81
81
  */
82
82
  field: PropTypes.string.isRequired,
83
- /**
84
- * A ref allowing to set imperative focus.
85
- * It can be passed to the element that should receive focus.
86
- * @ignore - do not document.
87
- */
88
- focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
89
- current: PropTypes.shape({
90
- focus: PropTypes.func.isRequired
91
- })
92
- })]),
93
83
  /**
94
84
  * The cell value formatted with the column valueFormatter.
95
85
  */
@@ -88,6 +88,10 @@ export const useGridColumnPinningPreProcessors = (apiRef, props) => {
88
88
  });
89
89
  apiRef.current.caches.columnPinning.orderedFieldsBeforePinningColumns = newOrderedFieldsBeforePinningColumns;
90
90
  } else {
91
+ if (allPinnedColumns.length === 0) {
92
+ prevAllPinnedColumns.current = allPinnedColumns;
93
+ return columnsState;
94
+ }
91
95
  newOrderedFields = [...columnsState.orderedFields];
92
96
  apiRef.current.caches.columnPinning.orderedFieldsBeforePinningColumns = [...columnsState.orderedFields];
93
97
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
- import { useGridSelector, useGridEvent, useGridApiMethod, gridDataRowIdsSelector } from '@mui/x-data-grid';
5
+ import { useGridEvent, useGridApiMethod, gridDataRowIdsSelector } from '@mui/x-data-grid';
6
6
  import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
7
7
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "./gridDetailPanelToggleColDef.js";
8
8
  import { gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector, gridDetailPanelRawHeightCacheSelector } from "./gridDetailPanelSelector.js";
@@ -46,11 +46,11 @@ function cacheContentAndHeight(apiRef, getDetailPanelContent, getDetailPanelHeig
46
46
  };
47
47
  }
48
48
  export const useGridDetailPanel = (apiRef, props) => {
49
- const contentCache = useGridSelector(apiRef, gridDetailPanelExpandedRowsContentCacheSelector);
50
49
  const handleCellClick = React.useCallback((params, event) => {
51
50
  if (params.field !== GRID_DETAIL_PANEL_TOGGLE_FIELD || props.getDetailPanelContent == null) {
52
51
  return;
53
52
  }
53
+ const contentCache = gridDetailPanelExpandedRowsContentCacheSelector(apiRef);
54
54
  const content = contentCache[params.id];
55
55
  if (! /*#__PURE__*/React.isValidElement(content)) {
56
56
  return;
@@ -61,7 +61,7 @@ export const useGridDetailPanel = (apiRef, props) => {
61
61
  return;
62
62
  }
63
63
  apiRef.current.toggleDetailPanel(params.id);
64
- }, [apiRef, contentCache, props.getDetailPanelContent]);
64
+ }, [apiRef, props.getDetailPanelContent]);
65
65
  const handleCellKeyDown = React.useCallback((params, event) => {
66
66
  if (props.getDetailPanelContent == null) {
67
67
  return;
@@ -83,6 +83,7 @@ export const useGridDetailPanel = (apiRef, props) => {
83
83
  if (props.getDetailPanelContent == null) {
84
84
  return;
85
85
  }
86
+ const contentCache = gridDetailPanelExpandedRowsContentCacheSelector(apiRef);
86
87
  const content = contentCache[id];
87
88
  if (! /*#__PURE__*/React.isValidElement(content)) {
88
89
  return;
@@ -95,7 +96,7 @@ export const useGridDetailPanel = (apiRef, props) => {
95
96
  newIds.add(id);
96
97
  }
97
98
  apiRef.current.setExpandedDetailPanels(newIds);
98
- }, [apiRef, contentCache, props.getDetailPanelContent]);
99
+ }, [apiRef, props.getDetailPanelContent]);
99
100
  const getExpandedDetailPanels = React.useCallback(() => gridDetailPanelExpandedRowIdsSelector(apiRef), [apiRef]);
100
101
  const setExpandedDetailPanels = React.useCallback(ids => {
101
102
  apiRef.current.setState(state => {
@@ -157,7 +158,7 @@ export const useGridDetailPanel = (apiRef, props) => {
157
158
  const previousGetDetailPanelContentProp = React.useRef(undefined);
158
159
  const previousGetDetailPanelHeightProp = React.useRef(undefined);
159
160
  const updateCachesIfNeeded = React.useCallback(() => {
160
- if (props.getDetailPanelContent === previousGetDetailPanelContentProp.current && props.getDetailPanelHeight === previousGetDetailPanelHeightProp.current) {
161
+ if (props.getDetailPanelContent === previousGetDetailPanelContentProp.current && props.getDetailPanelHeight === previousGetDetailPanelHeightProp.current || !props.getDetailPanelContent) {
161
162
  return;
162
163
  }
163
164
  apiRef.current.setState(state => {
@@ -1,5 +1,5 @@
1
- import { useGridSelector, useGridEventPriority, gridVisibleColumnDefinitionsSelector, useGridEvent } from '@mui/x-data-grid';
2
- import { useGridVisibleRows, runIf } from '@mui/x-data-grid/internals';
1
+ import { useGridEventPriority, gridVisibleColumnDefinitionsSelector, useGridEvent } from '@mui/x-data-grid';
2
+ import { runIf, getVisibleRows } from '@mui/x-data-grid/internals';
3
3
  import useEventCallback from '@mui/utils/useEventCallback';
4
4
  /**
5
5
  * @requires useGridColumns (state)
@@ -7,10 +7,10 @@ import useEventCallback from '@mui/utils/useEventCallback';
7
7
  * @requires useGridScroll (method
8
8
  */
9
9
  export const useGridInfiniteLoader = (apiRef, props) => {
10
- const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
11
- const currentPage = useGridVisibleRows(apiRef, props);
12
10
  const isEnabled = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
13
11
  const handleLoadMoreRows = useEventCallback(() => {
12
+ const visibleColumns = gridVisibleColumnDefinitionsSelector(apiRef);
13
+ const currentPage = getVisibleRows(apiRef);
14
14
  const viewportPageSize = apiRef.current.getViewportPageSize();
15
15
  const rowScrollEndParams = {
16
16
  visibleColumns,
@@ -46,7 +46,6 @@ export const useGridRowReorder = (apiRef, props) => {
46
46
  };
47
47
  const classes = useUtilityClasses(ownerState);
48
48
  const [dragRowId, setDragRowId] = React.useState('');
49
- const sortedRowIndexLookup = useGridSelector(apiRef, gridExpandedSortedRowIndexLookupSelector);
50
49
  const timeoutRowId = React.useRef('');
51
50
  const timeout = useTimeout();
52
51
  const previousReorderState = React.useRef(EMPTY_REORDER_STATE);
@@ -172,9 +171,10 @@ export const useGridRowReorder = (apiRef, props) => {
172
171
  removeDnDStylesTimeout.current = setTimeout(() => {
173
172
  dragRowNode.current.classList.remove(classes.rowDragging);
174
173
  });
174
+ const sortedRowIndexLookup = gridExpandedSortedRowIndexLookupSelector(apiRef);
175
175
  originRowIndex.current = sortedRowIndexLookup[params.id];
176
176
  apiRef.current.setCellFocus(params.id, GRID_REORDER_COL_DEF.field);
177
- }, [apiRef, isRowReorderDisabled, logger, classes.rowDragging, applyDraggedState, sortedRowIndexLookup, timeout]);
177
+ }, [apiRef, isRowReorderDisabled, logger, classes.rowDragging, applyDraggedState, timeout]);
178
178
  const handleDragOver = React.useCallback((params, event) => {
179
179
  if (dragRowId === '') {
180
180
  return;
@@ -207,6 +207,7 @@ export const useGridRowReorder = (apiRef, props) => {
207
207
  timeoutRowId.current = params.id;
208
208
  return;
209
209
  }
210
+ const sortedRowIndexLookup = gridExpandedSortedRowIndexLookupSelector(apiRef);
210
211
  const targetRowIndex = sortedRowIndexLookup[params.id];
211
212
  const sourceRowIndex = sortedRowIndexLookup[dragRowId];
212
213
 
@@ -257,7 +258,7 @@ export const useGridRowReorder = (apiRef, props) => {
257
258
  } else {
258
259
  event.dataTransfer.dropEffect = 'copy';
259
260
  }
260
- }, [dragRowId, apiRef, logger, timeout, sortedRowIndexLookup, applyDropIndicator]);
261
+ }, [dragRowId, apiRef, logger, timeout, applyDropIndicator]);
261
262
  const handleDragEnd = React.useCallback((_, event) => {
262
263
  // Call the gridEditRowsStateSelector directly to avoid infnite loop
263
264
  const editRowsState = gridEditRowsStateSelector(apiRef);
@@ -336,6 +337,7 @@ export const useGridRowReorder = (apiRef, props) => {
336
337
  if (gridRowMaximumTreeDepthSelector(apiRef) > 1) {
337
338
  return initialValue;
338
339
  }
340
+ const sortedRowIndexLookup = gridExpandedSortedRowIndexLookupSelector(apiRef);
339
341
  const targetRowIndex = sortedRowIndexLookup[targetRowId];
340
342
  const sourceRowIndex = sortedRowIndexLookup[sourceRowId];
341
343
 
@@ -355,7 +357,7 @@ export const useGridRowReorder = (apiRef, props) => {
355
357
  finalTargetIndex = dropPosition === 'above' ? targetRowIndex - 1 : targetRowIndex;
356
358
  }
357
359
  return finalTargetIndex;
358
- }, [apiRef, sortedRowIndexLookup]);
360
+ }, [apiRef]);
359
361
  useGridRegisterPipeProcessor(apiRef, 'getRowReorderTargetIndex', getRowReorderTargetIndex);
360
362
  useGridEvent(apiRef, 'rowDragStart', handleDragStart);
361
363
  useGridEvent(apiRef, 'rowDragOver', handleDragOver);
@@ -17,13 +17,13 @@ const InfiniteLoadingTriggerElement = styled('div')({
17
17
  * @requires useGridDimensions (method) - can be after
18
18
  */
19
19
  export const useGridInfiniteLoadingIntersection = (apiRef, props) => {
20
- const isReady = useGridSelector(apiRef, gridDimensionsSelector).isReady;
21
20
  const observer = React.useRef(null);
22
21
  const updateTargetTimeout = useTimeout();
23
22
  const triggerElement = React.useRef(null);
24
23
  const isEnabledClientSide = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
25
24
  const isEnabledServerSide = props.dataSource && props.lazyLoading;
26
25
  const isEnabled = isEnabledClientSide || isEnabledServerSide;
26
+ const isEnabledAndReady = useGridSelector(apiRef, () => isEnabled && gridDimensionsSelector(apiRef).isReady);
27
27
  const handleIntersectionChange = useEventCallback(([entry]) => {
28
28
  const currentRatio = entry.intersectionRatio;
29
29
  const isIntersecting = entry.isIntersecting;
@@ -36,7 +36,7 @@ export const useGridInfiniteLoadingIntersection = (apiRef, props) => {
36
36
  });
37
37
  React.useEffect(() => {
38
38
  const virtualScroller = apiRef.current.virtualScrollerRef.current;
39
- if (!isEnabled || !isReady || !virtualScroller) {
39
+ if (!isEnabledAndReady || !virtualScroller) {
40
40
  return;
41
41
  }
42
42
  observer.current?.disconnect();
@@ -50,7 +50,7 @@ export const useGridInfiniteLoadingIntersection = (apiRef, props) => {
50
50
  if (triggerElement.current) {
51
51
  observer.current.observe(triggerElement.current);
52
52
  }
53
- }, [apiRef, isReady, handleIntersectionChange, isEnabled, props.scrollEndThreshold]);
53
+ }, [apiRef, handleIntersectionChange, isEnabledAndReady, props.scrollEndThreshold]);
54
54
  const updateTarget = node => {
55
55
  if (triggerElement.current !== node) {
56
56
  observer.current?.disconnect();
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v8.18.0
2
+ * @mui/x-data-grid-pro v8.19.0
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
@@ -96,6 +96,10 @@ const useGridColumnPinningPreProcessors = (apiRef, props) => {
96
96
  });
97
97
  apiRef.current.caches.columnPinning.orderedFieldsBeforePinningColumns = newOrderedFieldsBeforePinningColumns;
98
98
  } else {
99
+ if (allPinnedColumns.length === 0) {
100
+ prevAllPinnedColumns.current = allPinnedColumns;
101
+ return columnsState;
102
+ }
99
103
  newOrderedFields = [...columnsState.orderedFields];
100
104
  apiRef.current.caches.columnPinning.orderedFieldsBeforePinningColumns = [...columnsState.orderedFields];
101
105
  }
@@ -54,11 +54,11 @@ function cacheContentAndHeight(apiRef, getDetailPanelContent, getDetailPanelHeig
54
54
  };
55
55
  }
56
56
  const useGridDetailPanel = (apiRef, props) => {
57
- const contentCache = (0, _xDataGrid.useGridSelector)(apiRef, _gridDetailPanelSelector.gridDetailPanelExpandedRowsContentCacheSelector);
58
57
  const handleCellClick = React.useCallback((params, event) => {
59
58
  if (params.field !== _gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD || props.getDetailPanelContent == null) {
60
59
  return;
61
60
  }
61
+ const contentCache = (0, _gridDetailPanelSelector.gridDetailPanelExpandedRowsContentCacheSelector)(apiRef);
62
62
  const content = contentCache[params.id];
63
63
  if (! /*#__PURE__*/React.isValidElement(content)) {
64
64
  return;
@@ -69,7 +69,7 @@ const useGridDetailPanel = (apiRef, props) => {
69
69
  return;
70
70
  }
71
71
  apiRef.current.toggleDetailPanel(params.id);
72
- }, [apiRef, contentCache, props.getDetailPanelContent]);
72
+ }, [apiRef, props.getDetailPanelContent]);
73
73
  const handleCellKeyDown = React.useCallback((params, event) => {
74
74
  if (props.getDetailPanelContent == null) {
75
75
  return;
@@ -91,6 +91,7 @@ const useGridDetailPanel = (apiRef, props) => {
91
91
  if (props.getDetailPanelContent == null) {
92
92
  return;
93
93
  }
94
+ const contentCache = (0, _gridDetailPanelSelector.gridDetailPanelExpandedRowsContentCacheSelector)(apiRef);
94
95
  const content = contentCache[id];
95
96
  if (! /*#__PURE__*/React.isValidElement(content)) {
96
97
  return;
@@ -103,7 +104,7 @@ const useGridDetailPanel = (apiRef, props) => {
103
104
  newIds.add(id);
104
105
  }
105
106
  apiRef.current.setExpandedDetailPanels(newIds);
106
- }, [apiRef, contentCache, props.getDetailPanelContent]);
107
+ }, [apiRef, props.getDetailPanelContent]);
107
108
  const getExpandedDetailPanels = React.useCallback(() => (0, _gridDetailPanelSelector.gridDetailPanelExpandedRowIdsSelector)(apiRef), [apiRef]);
108
109
  const setExpandedDetailPanels = React.useCallback(ids => {
109
110
  apiRef.current.setState(state => {
@@ -165,7 +166,7 @@ const useGridDetailPanel = (apiRef, props) => {
165
166
  const previousGetDetailPanelContentProp = React.useRef(undefined);
166
167
  const previousGetDetailPanelHeightProp = React.useRef(undefined);
167
168
  const updateCachesIfNeeded = React.useCallback(() => {
168
- if (props.getDetailPanelContent === previousGetDetailPanelContentProp.current && props.getDetailPanelHeight === previousGetDetailPanelHeightProp.current) {
169
+ if (props.getDetailPanelContent === previousGetDetailPanelContentProp.current && props.getDetailPanelHeight === previousGetDetailPanelHeightProp.current || !props.getDetailPanelContent) {
169
170
  return;
170
171
  }
171
172
  apiRef.current.setState(state => {
@@ -14,10 +14,10 @@ var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallb
14
14
  * @requires useGridScroll (method
15
15
  */
16
16
  const useGridInfiniteLoader = (apiRef, props) => {
17
- const visibleColumns = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridVisibleColumnDefinitionsSelector);
18
- const currentPage = (0, _internals.useGridVisibleRows)(apiRef, props);
19
17
  const isEnabled = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
20
18
  const handleLoadMoreRows = (0, _useEventCallback.default)(() => {
19
+ const visibleColumns = (0, _xDataGrid.gridVisibleColumnDefinitionsSelector)(apiRef);
20
+ const currentPage = (0, _internals.getVisibleRows)(apiRef);
21
21
  const viewportPageSize = apiRef.current.getViewportPageSize();
22
22
  const rowScrollEndParams = {
23
23
  visibleColumns,
@@ -54,7 +54,6 @@ const useGridRowReorder = (apiRef, props) => {
54
54
  };
55
55
  const classes = useUtilityClasses(ownerState);
56
56
  const [dragRowId, setDragRowId] = React.useState('');
57
- const sortedRowIndexLookup = (0, _xDataGrid.useGridSelector)(apiRef, _internals.gridExpandedSortedRowIndexLookupSelector);
58
57
  const timeoutRowId = React.useRef('');
59
58
  const timeout = (0, _useTimeout.default)();
60
59
  const previousReorderState = React.useRef(EMPTY_REORDER_STATE);
@@ -180,9 +179,10 @@ const useGridRowReorder = (apiRef, props) => {
180
179
  removeDnDStylesTimeout.current = setTimeout(() => {
181
180
  dragRowNode.current.classList.remove(classes.rowDragging);
182
181
  });
182
+ const sortedRowIndexLookup = (0, _internals.gridExpandedSortedRowIndexLookupSelector)(apiRef);
183
183
  originRowIndex.current = sortedRowIndexLookup[params.id];
184
184
  apiRef.current.setCellFocus(params.id, _gridRowReorderColDef.GRID_REORDER_COL_DEF.field);
185
- }, [apiRef, isRowReorderDisabled, logger, classes.rowDragging, applyDraggedState, sortedRowIndexLookup, timeout]);
185
+ }, [apiRef, isRowReorderDisabled, logger, classes.rowDragging, applyDraggedState, timeout]);
186
186
  const handleDragOver = React.useCallback((params, event) => {
187
187
  if (dragRowId === '') {
188
188
  return;
@@ -215,6 +215,7 @@ const useGridRowReorder = (apiRef, props) => {
215
215
  timeoutRowId.current = params.id;
216
216
  return;
217
217
  }
218
+ const sortedRowIndexLookup = (0, _internals.gridExpandedSortedRowIndexLookupSelector)(apiRef);
218
219
  const targetRowIndex = sortedRowIndexLookup[params.id];
219
220
  const sourceRowIndex = sortedRowIndexLookup[dragRowId];
220
221
 
@@ -265,7 +266,7 @@ const useGridRowReorder = (apiRef, props) => {
265
266
  } else {
266
267
  event.dataTransfer.dropEffect = 'copy';
267
268
  }
268
- }, [dragRowId, apiRef, logger, timeout, sortedRowIndexLookup, applyDropIndicator]);
269
+ }, [dragRowId, apiRef, logger, timeout, applyDropIndicator]);
269
270
  const handleDragEnd = React.useCallback((_, event) => {
270
271
  // Call the gridEditRowsStateSelector directly to avoid infnite loop
271
272
  const editRowsState = (0, _internals.gridEditRowsStateSelector)(apiRef);
@@ -344,6 +345,7 @@ const useGridRowReorder = (apiRef, props) => {
344
345
  if ((0, _xDataGrid.gridRowMaximumTreeDepthSelector)(apiRef) > 1) {
345
346
  return initialValue;
346
347
  }
348
+ const sortedRowIndexLookup = (0, _internals.gridExpandedSortedRowIndexLookupSelector)(apiRef);
347
349
  const targetRowIndex = sortedRowIndexLookup[targetRowId];
348
350
  const sourceRowIndex = sortedRowIndexLookup[sourceRowId];
349
351
 
@@ -363,7 +365,7 @@ const useGridRowReorder = (apiRef, props) => {
363
365
  finalTargetIndex = dropPosition === 'above' ? targetRowIndex - 1 : targetRowIndex;
364
366
  }
365
367
  return finalTargetIndex;
366
- }, [apiRef, sortedRowIndexLookup]);
368
+ }, [apiRef]);
367
369
  (0, _internals.useGridRegisterPipeProcessor)(apiRef, 'getRowReorderTargetIndex', getRowReorderTargetIndex);
368
370
  (0, _xDataGrid.useGridEvent)(apiRef, 'rowDragStart', handleDragStart);
369
371
  (0, _xDataGrid.useGridEvent)(apiRef, 'rowDragOver', handleDragOver);
@@ -24,13 +24,13 @@ const InfiniteLoadingTriggerElement = (0, _system.styled)('div')({
24
24
  * @requires useGridDimensions (method) - can be after
25
25
  */
26
26
  const useGridInfiniteLoadingIntersection = (apiRef, props) => {
27
- const isReady = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridDimensionsSelector).isReady;
28
27
  const observer = React.useRef(null);
29
28
  const updateTargetTimeout = (0, _internals.useTimeout)();
30
29
  const triggerElement = React.useRef(null);
31
30
  const isEnabledClientSide = props.rowsLoadingMode === 'client' && !!props.onRowsScrollEnd;
32
31
  const isEnabledServerSide = props.dataSource && props.lazyLoading;
33
32
  const isEnabled = isEnabledClientSide || isEnabledServerSide;
33
+ const isEnabledAndReady = (0, _xDataGrid.useGridSelector)(apiRef, () => isEnabled && (0, _xDataGrid.gridDimensionsSelector)(apiRef).isReady);
34
34
  const handleIntersectionChange = (0, _useEventCallback.default)(([entry]) => {
35
35
  const currentRatio = entry.intersectionRatio;
36
36
  const isIntersecting = entry.isIntersecting;
@@ -43,7 +43,7 @@ const useGridInfiniteLoadingIntersection = (apiRef, props) => {
43
43
  });
44
44
  React.useEffect(() => {
45
45
  const virtualScroller = apiRef.current.virtualScrollerRef.current;
46
- if (!isEnabled || !isReady || !virtualScroller) {
46
+ if (!isEnabledAndReady || !virtualScroller) {
47
47
  return;
48
48
  }
49
49
  observer.current?.disconnect();
@@ -57,7 +57,7 @@ const useGridInfiniteLoadingIntersection = (apiRef, props) => {
57
57
  if (triggerElement.current) {
58
58
  observer.current.observe(triggerElement.current);
59
59
  }
60
- }, [apiRef, isReady, handleIntersectionChange, isEnabled, props.scrollEndThreshold]);
60
+ }, [apiRef, handleIntersectionChange, isEnabledAndReady, props.scrollEndThreshold]);
61
61
  const updateTarget = node => {
62
62
  if (triggerElement.current !== node) {
63
63
  observer.current?.disconnect();
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v8.18.0
2
+ * @mui/x-data-grid-pro v8.19.0
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-pro",
3
- "version": "8.18.0",
3
+ "version": "8.19.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Pro plan edition of the MUI X Data Grid components.",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -37,9 +37,9 @@
37
37
  "@mui/utils": "^7.3.5",
38
38
  "clsx": "^2.1.1",
39
39
  "prop-types": "^15.8.1",
40
- "@mui/x-data-grid": "8.18.0",
41
- "@mui/x-license": "8.18.0",
42
- "@mui/x-internals": "8.18.0"
40
+ "@mui/x-data-grid": "8.19.0",
41
+ "@mui/x-internals": "8.19.0",
42
+ "@mui/x-license": "8.19.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@emotion/react": "^11.9.0",