@mui/x-data-grid-pro 8.4.0 → 8.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +215 -0
  2. package/DataGridPro/DataGridPro.js +9 -1
  3. package/DataGridPro/useDataGridProComponent.js +9 -5
  4. package/DataGridPro/useDataGridProProps.js +2 -1
  5. package/components/GridColumnHeaders.js +1 -0
  6. package/components/GridDetailPanel.d.ts +1 -1
  7. package/components/GridDetailPanel.js +5 -0
  8. package/components/GridProColumnMenu.js +2 -1
  9. package/components/GridRowReorderCell.js +15 -2
  10. package/components/headerFiltering/GridHeaderFilterCell.js +8 -5
  11. package/components/headerFiltering/GridHeaderFilterMenu.js +4 -3
  12. package/components/headerFiltering/GridHeaderFilterMenuContainer.js +5 -4
  13. package/esm/DataGridPro/DataGridPro.js +9 -1
  14. package/esm/DataGridPro/useDataGridProComponent.js +9 -5
  15. package/esm/DataGridPro/useDataGridProProps.js +2 -1
  16. package/esm/components/GridColumnHeaders.js +1 -0
  17. package/esm/components/GridDetailPanel.d.ts +1 -1
  18. package/esm/components/GridDetailPanel.js +5 -0
  19. package/esm/components/GridProColumnMenu.js +2 -1
  20. package/esm/components/GridRowReorderCell.js +16 -3
  21. package/esm/components/headerFiltering/GridHeaderFilterCell.js +4 -1
  22. package/esm/components/headerFiltering/GridHeaderFilterMenu.js +2 -1
  23. package/esm/components/headerFiltering/GridHeaderFilterMenuContainer.js +2 -1
  24. package/esm/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +4 -4
  25. package/esm/hooks/features/detailPanel/useGridDetailPanel.js +1 -1
  26. package/esm/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +17 -19
  27. package/esm/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +10 -8
  28. package/esm/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.js +2 -3
  29. package/esm/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -3
  30. package/esm/index.js +1 -1
  31. package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +3 -3
  32. package/hooks/features/detailPanel/useGridDetailPanel.js +1 -1
  33. package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +17 -19
  34. package/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +10 -8
  35. package/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.js +1 -2
  36. package/hooks/features/treeData/useGridTreeDataPreProcessors.js +1 -2
  37. package/index.js +1 -1
  38. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -5,6 +5,221 @@
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.5.1
9
+
10
+ <!-- generated comparing v8.5.0..master -->
11
+
12
+ _Jun 5, 2025_
13
+
14
+ We'd like to extend a big thank you to the 9 contributors who made this release possible. Here are some highlights ✨:
15
+
16
+ - 📊 Allow exporting pie charts
17
+ - 📚 Documentation improvements
18
+ - 🌎 Improve Portuguese (ptPT) translations on the Data Grid
19
+ - 🌎 Improve Portuguese (ptPT, ptBR) translations on Charts
20
+ - 🌎 Improve Arabic (ar-SD) locale
21
+ - 🐞 Bugfixes
22
+
23
+ Special thanks go out to the community members for their valuable contributions: @moosekebab, @TiagoPortfolio.
24
+ The following are all team members who have contributed to this release:
25
+ @alexfauquette, @bernardobelchior, @JCQuintas, @KenanYusuf, @LukasTy, @michelengelen, @arminmeh.
26
+
27
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
28
+
29
+ ### Data Grid
30
+
31
+ #### `@mui/x-data-grid@8.5.1`
32
+
33
+ - [DataGrid] Fix `registerPipeProcessor()` for Node v20 (#18241) @arminmeh
34
+ - [DataGrid] Fix background color in column header filler cells (#18188) @KenanYusuf
35
+ - [DataGrid] Keep pipe pre-processors execution order when callback reference changes (#17558) @arminmeh
36
+ - [DataGrid] Use `useComponentRenderer` from x-internals (#18203) @bernardobelchior
37
+ - [l10n] Improve Arabic (ar-SD) locale (#17959) @moosekebab
38
+ - [l10n] Improve Portuguese from Portugal (pt-PT) locale (#18064) @TiagoPortfolio
39
+
40
+ #### `@mui/x-data-grid-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-data-grid@8.5.1`, plus:
43
+
44
+ - [DataGridPro] Skip rendering detail panels of the rows turned into skeleton rows with lazy loading (#17958) @arminmeh
45
+
46
+ #### `@mui/x-data-grid-premium@8.5.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
47
+
48
+ Same changes as in `@mui/x-data-grid-pro@8.5.1`.
49
+
50
+ ### Date and Time Pickers
51
+
52
+ #### `@mui/x-date-pickers@8.5.1`
53
+
54
+ - [pickers] Fix `transformOrigin` resolving based on popper `placement` (#18206) @LukasTy
55
+
56
+ #### `@mui/x-date-pickers-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
57
+
58
+ Same changes as in `@mui/x-date-pickers@8.5.1`.
59
+
60
+ ### Charts
61
+
62
+ #### `@mui/x-charts@8.5.1`
63
+
64
+ - [charts] Allow skipping tooltip render (#18050) @alexfauquette
65
+ - [charts] Fix act warnings in toolbar tests (#18212) @JCQuintas
66
+ - [charts] Fix prop typo in `extendVertically` (#18211) @JCQuintas
67
+ - [charts] Fix responsive height for ChartsWrapper (#18183) @alexfauquette
68
+ - [charts] Improve charts toolbar accessibility (#18056) @bernardobelchior
69
+ - [charts] Let line series propagate null from the dataset (#18223) @alexfauquette
70
+ - [l10n] Add Portuguese locales for charts (pt-PT, pt-BR) (#18069) @bernardobelchior
71
+
72
+ #### `@mui/x-charts-pro@8.5.1` [![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-charts@8.5.1`, plus:
75
+
76
+ - [charts-pro] Add `linear-sharp` curve as alternative to square edge (#17966) @JCQuintas
77
+ - [charts-pro] Add correct classes to `FunnelSectionLabel` (#18061) @JCQuintas
78
+ - [charts-pro] Allow exporting a pie chart (#18063) @bernardobelchior
79
+ - [charts-pro] Fix initial render for zoom slider selection (#18208) @bernardobelchior
80
+ - [charts-pro] Fix props being passed to DOM in FunnelChart (#18192) @JCQuintas
81
+ - [charts-pro] Show axis value in zoom slider tooltip (#18054) @bernardobelchior
82
+ - [charts-pro] Render the toolbar in the heatmap chart (#18247) @bernardobelchior
83
+
84
+ ### Tree View
85
+
86
+ #### `@mui/x-tree-view@8.5.1`
87
+
88
+ Internal changes.
89
+
90
+ #### `@mui/x-tree-view-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
91
+
92
+ Same changes as in `@mui/x-tree-view@8.5.1`.
93
+
94
+ ### Docs
95
+
96
+ - [docs] Update `valueFormatter` signature in migration guide (#18226) @michelengelen
97
+
98
+ ### Core
99
+
100
+ - chore(deps): bump @next/eslint-plugin-next to 15.3.3 (#18155) @renovate[bot]
101
+ - chore(deps): bump @types/lodash to ^4.17.17 (#17990) @renovate[bot]
102
+ - chore(deps): bump babel (#18157) @renovate[bot]
103
+ - chore(deps): bump eslint to ^9.28.0 (#17352) @renovate[bot]
104
+ - chore(deps): bump material ui (#17802) @renovate[bot]
105
+ - chore(deps): bump next to ^15.3.3 (#18159) @renovate[bot]
106
+ - chore(deps): bump ossf/scorecard-action action to v2.4.2 (#18160) @renovate[bot]
107
+ - chore(deps): bump react-router to ^7.6.1 (#18162) @renovate[bot]
108
+ - chore(deps): bump yargs to ^18.0.0 (#18169) @renovate[bot]
109
+ - [code-infra] Different approach to console testing for `processRowUpdate` (#18213) @JCQuintas
110
+ - [code-infra] Fix act warnings in DataGrid/toolbar (#18207) @JCQuintas
111
+ - [code-infra] Remove `istanbul` references (#18194) @JCQuintas
112
+ - [code-infra] Remove codesandbox:ci (#18179) @JCQuintas
113
+ - [code-infra] Replace `mocha` with `vitest` on e2e and regression tests (#18071) @JCQuintas
114
+ - [code-infra] Upgrade @mui/internal-test-utils (#18191) @JCQuintas
115
+ - [code-infra] Use vitest for `no-direct-state-access` tests (#18209) @JCQuintas
116
+ - [infra] Improve test setup (#18228) @LukasTy
117
+ - [infra] Update bug and feature request templates to standardize label types (#18198) @michelengelen
118
+ - [infra] Use `playwright` docker image (#18186) @LukasTy
119
+
120
+ ## 8.5.0
121
+
122
+ _May 29, 2025_
123
+
124
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
125
+
126
+ - 📊 Add support for exporting `RadarChartPro`, `FunnelChart` and `Heatmap` as image and PDF.
127
+ - 📊 `RadarChart` is now stable.
128
+
129
+ Special thanks go out to the community members for their valuable contributions:
130
+ @xBlizZer, @sai6855, @alisasanib.
131
+ Following are all team members who have contributed to this release:
132
+ @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @LukasTy, @oliviertassinari.
133
+
134
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
135
+
136
+ ### Data Grid
137
+
138
+ #### `@mui/x-data-grid@8.5.0`
139
+
140
+ - [DataGrid] Avoid ResizeObserver loop error (#17984) @cherniavskii
141
+ - [DataGrid] Fix column management `toggleColumn` event type (#18023) @KenanYusuf
142
+ - [DataGrid] Remove unnecessary `any` type (#17979) @sai6855
143
+
144
+ #### `@mui/x-data-grid-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
145
+
146
+ Same changes as in `@mui/x-data-grid@8.5.0`, plus:
147
+
148
+ - [DataGridPro] Allow multi sorting without modifier key (#17925) @cherniavskii
149
+ - [DataGridPro] Row reordering icon improvements (#17947) @KenanYusuf
150
+ - [DataGridPro] Fix pinned columns order in column management (#17950) @alisasanib
151
+
152
+ #### `@mui/x-data-grid-premium@8.5.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
153
+
154
+ Same changes as in `@mui/x-data-grid-pro@8.5.0`, plus:
155
+
156
+ - [DataGridPremium] Export `GridApiPremium` type (#18037) @arminmeh
157
+
158
+ ### Date and Time Pickers
159
+
160
+ #### `@mui/x-date-pickers@8.5.0`
161
+
162
+ Internal changes.
163
+
164
+ #### `@mui/x-date-pickers-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
165
+
166
+ Same changes as in `@mui/x-date-pickers@8.5.0`, plus:
167
+
168
+ - [DateRangePicker] Allow to override the format in the field (#17972) @flaviendelangle
169
+
170
+ ### Charts
171
+
172
+ #### `@mui/x-charts@8.5.0`
173
+
174
+ - [charts] Add `render` prop to charts toolbar components (#17649) @bernardobelchior
175
+ - [charts] Add configurable slots to toolbar (#17712) @bernardobelchior
176
+ - [charts] Export `useFunnelSeries` and `useRadarSeries` (#18034) @JCQuintas
177
+ - [charts] Expose `ChartApi` through context (#18004) @bernardobelchior
178
+ - [charts] Mark Radar chart as stable (#17946) @alexfauquette
179
+ - [charts] Only update store if interaction item is different (#17851) @bernardobelchior
180
+ - [charts] Reuse shared date utils (#18014) @JCQuintas
181
+ - [charts] Use Map for string cache instead of object (#17982) @bernardobelchior
182
+ - [charts] Fix Population pyramid demo (#17987) @oliviertassinari
183
+
184
+ #### `@mui/x-charts-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
185
+
186
+ Same changes as in `@mui/x-charts@8.5.0`, plus:
187
+
188
+ - [charts-pro] Add range selection to zoom slider (#17949) @bernardobelchior
189
+ - [charts-pro] Allow configuring zoom slider tooltip (#18030) @bernardobelchior
190
+ - [charts-pro] Allow exporting a funnel chart (#17957) @bernardobelchior
191
+ - [charts-pro] Allow exporting a heatmap chart (#17916) @bernardobelchior
192
+ - [charts-pro] Allow exporting a radar chart (#17968) @bernardobelchior
193
+ - [charts-pro] Always show both zoom slider tooltips (#18027) @bernardobelchior
194
+ - [charts-pro] Show zoom slider tooltip when selecting range (#18028) @bernardobelchior
195
+ - [charts-pro] Split `ChartAxisZoomSlider` into smaller files (#18011) @bernardobelchior
196
+ - [charts-pro] Update zoom slider range selection cursor (#17977) @bernardobelchior
197
+ - [charts-pro] Add support for Heatmap legend (#17943) @alexfauquette
198
+
199
+ ### Tree View
200
+
201
+ #### `@mui/x-tree-view@8.5.0`
202
+
203
+ Internal changes.
204
+
205
+ #### `@mui/x-tree-view-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
206
+
207
+ Same changes as in `@mui/x-tree-view@8.5.0`.
208
+
209
+ ### Docs
210
+
211
+ - [docs] Fix derived column pivoting demo crash (#17944) @arminmeh
212
+ - [docs] Fix light/dark mode blink on pickers overview (#18002) @alexfauquette
213
+ - [docs] Fix scatter shape demo causing horizontal overflow (#17974) @bernardobelchior
214
+
215
+ ### Core
216
+
217
+ - [code-infra] Add bundle size monitor (#17754) @Janpot
218
+ - [code-infra] Enable `babel-plugin-display-name` in vitest (#17903) @JCQuintas
219
+ - [infra] Remove last deprecated `ponyfillGlobal` usage (#18003) @LukasTy
220
+ - [infra] Use `babel-plugin-display-name` from npm (#18040) @LukasTy
221
+ - [x-telemetry] Remove deprecated `ponyfillGlobal` (#17986) @xBlizZer
222
+
8
223
  ## 8.4.0
9
224
 
10
225
  _May 21, 2025_
@@ -29,7 +29,7 @@ const configuration = {
29
29
  useCellAggregationResult: () => null
30
30
  }
31
31
  };
32
- const releaseInfo = "MTc0Nzc3ODQwMDAwMA==";
32
+ const releaseInfo = "MTc0OTA3MDgwMDAwMA==";
33
33
  const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
34
34
  packageName: "x-data-grid-pro",
35
35
  releaseInfo: releaseInfo
@@ -56,6 +56,7 @@ const DataGridProRaw = (0, _forwardRef.forwardRef)(function DataGridPro(inProps,
56
56
  }))
57
57
  });
58
58
  });
59
+ if (process.env.NODE_ENV !== "production") DataGridProRaw.displayName = "DataGridProRaw";
59
60
  /**
60
61
  * Features:
61
62
  * - [DataGridPro](https://mui.com/x/react-data-grid/features/)
@@ -532,6 +533,13 @@ DataGridProRaw.propTypes = {
532
533
  * @default "error" ("warn" in dev mode)
533
534
  */
534
535
  logLevel: _propTypes.default.oneOf(['debug', 'error', 'info', 'warn', false]),
536
+ /**
537
+ * If set to "always", the multi-sorting is applied without modifier key.
538
+ * Otherwise, the modifier key is required for multi-sorting to be applied.
539
+ * @see See https://mui.com/x/react-data-grid/sorting/#multi-sorting
540
+ * @default "withModifierKey"
541
+ */
542
+ multipleColumnsSortingMode: _propTypes.default.oneOf(['always', 'withModifierKey']),
535
543
  /**
536
544
  * Nonce of the inline styles for [Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#script-src-the-nonce-attribute).
537
545
  */
@@ -30,16 +30,20 @@ const useDataGridProComponent = (apiRef, props) => {
30
30
 
31
31
  /**
32
32
  * Register all pre-processors called during state initialization here.
33
+ * Some pre-processors are changing the same part of the state (like the order of the columns).
34
+ * Order them in descending order of priority.
35
+ * For example, left pinned columns should always render first from the left, so the `hydrateColumns` pre-processor from `useGridColumnPinningPreProcessors` should be called last (after all other `hydrateColumns` pre-processors).
36
+ * Similarly, the `hydrateColumns` pre-processor from `useGridRowSelectionPreProcessors` should be called after `useGridTreeDataPreProcessors` because the selection checkboxes should appear before the tree data.
37
+ * Desired autogenerated columns order is:
38
+ * left pinned columns -> row reordering column -> checkbox column -> tree data column -> master detail column -> rest of the columns
33
39
  */
34
- (0, _internals.useGridRowSelectionPreProcessors)(apiRef, props);
35
- (0, _useGridRowReorderPreProcessors.useGridRowReorderPreProcessors)(apiRef, props);
40
+ (0, _useGridDetailPanelPreProcessors.useGridDetailPanelPreProcessors)(apiRef, props);
36
41
  (0, _useGridTreeDataPreProcessors.useGridTreeDataPreProcessors)(apiRef, props);
37
42
  (0, _useGridDataSourceTreeDataPreProcessors.useGridDataSourceTreeDataPreProcessors)(apiRef, props);
43
+ (0, _internals.useGridRowSelectionPreProcessors)(apiRef, props);
38
44
  (0, _useGridLazyLoaderPreProcessors.useGridLazyLoaderPreProcessors)(apiRef, props);
39
45
  (0, _useGridRowPinningPreProcessors.useGridRowPinningPreProcessors)(apiRef);
40
- (0, _useGridDetailPanelPreProcessors.useGridDetailPanelPreProcessors)(apiRef, props);
41
- // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
42
- // Because it changes the order of the columns.
46
+ (0, _useGridRowReorderPreProcessors.useGridRowReorderPreProcessors)(apiRef, props);
43
47
  (0, _useGridColumnPinningPreProcessors.useGridColumnPinningPreProcessors)(apiRef, props);
44
48
  (0, _internals.useGridRowsPreProcessors)(apiRef);
45
49
 
@@ -41,7 +41,8 @@ const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PRO_PROPS_DEFAULT_V
41
41
  treeData: false,
42
42
  lazyLoading: false,
43
43
  lazyLoadingRequestThrottleMs: 500,
44
- listView: false
44
+ listView: false,
45
+ multipleColumnsSortingMode: 'withModifierKey'
45
46
  });
46
47
  const defaultSlots = _dataGridProDefaultSlotsComponents.DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS;
47
48
  const useDataGridProProps = inProps => {
@@ -63,6 +63,7 @@ const GridColumnHeaders = exports.GridColumnHeaders = (0, _forwardRef.forwardRef
63
63
  children: [getColumnGroupHeadersRows(), getColumnHeadersRow(), getColumnFiltersRow(), /*#__PURE__*/(0, _jsxRuntime.jsx)(Filler, {})]
64
64
  }));
65
65
  });
66
+ if (process.env.NODE_ENV !== "production") GridColumnHeaders.displayName = "GridColumnHeaders";
66
67
  process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
67
68
  // ----------------------------- Warning --------------------------------
68
69
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -10,5 +10,5 @@ interface GridDetailPanelProps extends Pick<React.HTMLAttributes<HTMLDivElement>
10
10
  */
11
11
  height: number | 'auto';
12
12
  }
13
- declare function GridDetailPanel(props: GridDetailPanelProps): React.JSX.Element;
13
+ declare function GridDetailPanel(props: GridDetailPanelProps): React.JSX.Element | null;
14
14
  export { GridDetailPanel };
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.GridDetailPanel = GridDetailPanel;
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
  var _styles = require("@mui/material/styles");
11
+ var _xDataGrid = require("@mui/x-data-grid");
11
12
  var _internals = require("@mui/x-data-grid/internals");
12
13
  var _useResizeObserver = require("@mui/x-internals/useResizeObserver");
13
14
  var _useGridRootProps = require("../hooks/utils/useGridRootProps");
@@ -33,6 +34,7 @@ function GridDetailPanel(props) {
33
34
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
34
35
  const ownerState = rootProps;
35
36
  const hasAutoHeight = height === 'auto';
37
+ const rowNode = (0, _xDataGrid.gridRowNodeSelector)(apiRef, rowId);
36
38
  React.useLayoutEffect(() => {
37
39
  if (hasAutoHeight && typeof ResizeObserver === 'undefined') {
38
40
  // Fallback for IE
@@ -44,6 +46,9 @@ function GridDetailPanel(props) {
44
46
  const observedHeight = entry.borderBoxSize && entry.borderBoxSize.length > 0 ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
45
47
  apiRef.current.storeDetailPanelHeight(rowId, observedHeight);
46
48
  }, hasAutoHeight);
49
+ if (rowNode?.type === 'skeletonRow') {
50
+ return null;
51
+ }
47
52
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(DetailPanel, {
48
53
  ref: ref,
49
54
  ownerState: ownerState,
@@ -26,4 +26,5 @@ const GridProColumnMenu = exports.GridProColumnMenu = (0, _forwardRef.forwardRef
26
26
  defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PRO,
27
27
  ref: ref
28
28
  }));
29
- });
29
+ });
30
+ if (process.env.NODE_ENV !== "production") GridProColumnMenu.displayName = "GridProColumnMenu";
@@ -10,6 +10,7 @@ exports.renderRowReorderCell = void 0;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _system = require("@mui/system");
13
14
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
14
15
  var _xDataGrid = require("@mui/x-data-grid");
15
16
  var _internals = require("@mui/x-data-grid/internals");
@@ -22,10 +23,17 @@ const useUtilityClasses = ownerState => {
22
23
  } = ownerState;
23
24
  const slots = {
24
25
  root: ['rowReorderCell', isDraggable && 'rowReorderCell--draggable'],
25
- placeholder: ['rowReorderCellPlaceholder']
26
+ placeholder: ['rowReorderCellPlaceholder'],
27
+ icon: ['rowReorderIcon']
26
28
  };
27
29
  return (0, _composeClasses.default)(slots, _xDataGrid.getDataGridUtilityClass, classes);
28
30
  };
31
+ const RowReorderIcon = (0, _system.styled)('svg', {
32
+ name: 'MuiDataGrid',
33
+ slot: 'RowReorderIcon'
34
+ })({
35
+ color: _internals.vars.colors.foreground.muted
36
+ });
29
37
  function GridRowReorderCell(params) {
30
38
  const apiRef = (0, _xDataGrid.useGridApiContext)();
31
39
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
@@ -82,7 +90,12 @@ function GridRowReorderCell(params) {
82
90
  className: classes.root,
83
91
  draggable: isDraggable
84
92
  }, draggableEventHandlers, {
85
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.rowReorderIcon, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
93
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(RowReorderIcon, {
94
+ as: rootProps.slots.rowReorderIcon,
95
+ ownerState: ownerState,
96
+ className: classes.icon,
97
+ fontSize: "small"
98
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
86
99
  className: classes.placeholder,
87
100
  children: cellValue
88
101
  })]
@@ -12,7 +12,9 @@ var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _clsx = _interopRequireDefault(require("clsx"));
14
14
  var _styles = require("@mui/material/styles");
15
- var _utils = require("@mui/utils");
15
+ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
16
+ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
17
+ var _capitalize = _interopRequireDefault(require("@mui/utils/capitalize"));
16
18
  var _fastMemo = require("@mui/x-internals/fastMemo");
17
19
  var _xDataGrid = require("@mui/x-data-grid");
18
20
  var _internals = require("@mui/x-data-grid/internals");
@@ -69,7 +71,7 @@ const useUtilityClasses = ownerState => {
69
71
  input: ['columnHeaderFilterInput'],
70
72
  operatorLabel: ['columnHeaderFilterOperatorLabel']
71
73
  };
72
- return (0, _utils.unstable_composeClasses)(slots, _xDataGrid.getDataGridUtilityClass, classes);
74
+ return (0, _composeClasses.default)(slots, _xDataGrid.getDataGridUtilityClass, classes);
73
75
  };
74
76
  const DEFAULT_INPUT_COMPONENTS = {
75
77
  string: _xDataGrid.GridFilterInputValue,
@@ -105,7 +107,7 @@ const GridHeaderFilterCell = (0, _forwardRef.forwardRef)((props, ref) => {
105
107
  const columnFields = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridVisibleColumnFieldsSelector);
106
108
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
107
109
  const cellRef = React.useRef(null);
108
- const handleRef = (0, _utils.unstable_useForkRef)(ref, cellRef);
110
+ const handleRef = (0, _useForkRef.default)(ref, cellRef);
109
111
  const inputRef = React.useRef(null);
110
112
  const buttonRef = React.useRef(null);
111
113
  const editingField = (0, _xDataGrid.useGridSelector)(apiRef, _internals.gridHeaderFilteringEditFieldSelector);
@@ -223,7 +225,7 @@ const GridHeaderFilterCell = (0, _forwardRef.forwardRef)((props, ref) => {
223
225
  showRightBorder
224
226
  });
225
227
  const classes = useUtilityClasses(ownerState);
226
- const label = currentOperator.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${(0, _utils.unstable_capitalize)(item.operator)}`);
228
+ const label = currentOperator.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${(0, _capitalize.default)(item.operator)}`);
227
229
  const isNoInputOperator = currentOperator.requiresFilterValue === false;
228
230
  const isApplied = item?.value !== undefined || isNoInputOperator;
229
231
  const isFilterActive = isApplied || hasFocus;
@@ -289,7 +291,7 @@ const GridHeaderFilterCell = (0, _forwardRef.forwardRef)((props, ref) => {
289
291
  slotProps: {
290
292
  root: {
291
293
  size: 'small',
292
- label: (0, _utils.unstable_capitalize)(label),
294
+ label: (0, _capitalize.default)(label),
293
295
  placeholder: ''
294
296
  }
295
297
  }
@@ -299,6 +301,7 @@ const GridHeaderFilterCell = (0, _forwardRef.forwardRef)((props, ref) => {
299
301
  }) : null]
300
302
  }));
301
303
  });
304
+ if (process.env.NODE_ENV !== "production") GridHeaderFilterCell.displayName = "GridHeaderFilterCell";
302
305
  process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
303
306
  // ----------------------------- Warning --------------------------------
304
307
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -9,7 +9,8 @@ exports.GridHeaderFilterMenu = GridHeaderFilterMenu;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
- var _utils = require("@mui/utils");
12
+ var _capitalize = _interopRequireDefault(require("@mui/utils/capitalize"));
13
+ var _HTMLElementType = _interopRequireDefault(require("@mui/utils/HTMLElementType"));
13
14
  var _xDataGrid = require("@mui/x-data-grid");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  function GridHeaderFilterMenu({
@@ -60,7 +61,7 @@ function GridHeaderFilterMenu({
60
61
  children: apiRef.current.getLocaleText('headerFilterClear')
61
62
  }, "filter-menu-clear-filter"), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseDivider, {}, "filter-menu-divider")], operators.map(op => {
62
63
  const selected = op.value === item.operator;
63
- const label = op?.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${(0, _utils.unstable_capitalize)(op.value)}`);
64
+ const label = op?.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${(0, _capitalize.default)(op.value)}`);
64
65
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
65
66
  iconStart: selected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.menuItemCheckIcon, {
66
67
  fontSize: "small"
@@ -140,5 +141,5 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenu.propTypes = {
140
141
  value: _propTypes.default.string.isRequired
141
142
  })).isRequired,
142
143
  showClearItem: _propTypes.default.bool.isRequired,
143
- target: _utils.HTMLElementType
144
+ target: _HTMLElementType.default
144
145
  } : void 0;
@@ -11,7 +11,8 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _xDataGrid = require("@mui/x-data-grid");
14
- var _utils = require("@mui/utils");
14
+ var _refType = _interopRequireDefault(require("@mui/utils/refType"));
15
+ var _useId = _interopRequireDefault(require("@mui/utils/useId"));
15
16
  var _internals = require("@mui/x-data-grid/internals");
16
17
  var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
17
18
  var _jsxRuntime = require("react/jsx-runtime");
@@ -28,8 +29,8 @@ function GridHeaderFilterMenuContainer(props) {
28
29
  clearFilterItem
29
30
  } = props,
30
31
  others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
31
- const buttonId = (0, _utils.unstable_useId)();
32
- const menuId = (0, _utils.unstable_useId)();
32
+ const buttonId = (0, _useId.default)();
33
+ const menuId = (0, _useId.default)();
33
34
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
34
35
  const apiRef = (0, _xDataGrid.useGridApiContext)();
35
36
  const menuOpenField = (0, _xDataGrid.useGridSelector)(apiRef, _internals.gridHeaderFilteringMenuSelector);
@@ -84,7 +85,7 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenuContainer.propTypes
84
85
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
85
86
  // ----------------------------------------------------------------------
86
87
  applyFilterChanges: _propTypes.default.func.isRequired,
87
- buttonRef: _utils.refType,
88
+ buttonRef: _refType.default,
88
89
  clearFilterItem: _propTypes.default.func,
89
90
  disabled: _propTypes.default.bool,
90
91
  field: _propTypes.default.string.isRequired,
@@ -22,7 +22,7 @@ const configuration = {
22
22
  useCellAggregationResult: () => null
23
23
  }
24
24
  };
25
- const releaseInfo = "MTc0Nzc3ODQwMDAwMA==";
25
+ const releaseInfo = "MTc0OTA3MDgwMDAwMA==";
26
26
  const watermark = /*#__PURE__*/_jsx(Watermark, {
27
27
  packageName: "x-data-grid-pro",
28
28
  releaseInfo: releaseInfo
@@ -49,6 +49,7 @@ const DataGridProRaw = forwardRef(function DataGridPro(inProps, ref) {
49
49
  }))
50
50
  });
51
51
  });
52
+ if (process.env.NODE_ENV !== "production") DataGridProRaw.displayName = "DataGridProRaw";
52
53
  /**
53
54
  * Features:
54
55
  * - [DataGridPro](https://mui.com/x/react-data-grid/features/)
@@ -525,6 +526,13 @@ DataGridProRaw.propTypes = {
525
526
  * @default "error" ("warn" in dev mode)
526
527
  */
527
528
  logLevel: PropTypes.oneOf(['debug', 'error', 'info', 'warn', false]),
529
+ /**
530
+ * If set to "always", the multi-sorting is applied without modifier key.
531
+ * Otherwise, the modifier key is required for multi-sorting to be applied.
532
+ * @see See https://mui.com/x/react-data-grid/sorting/#multi-sorting
533
+ * @default "withModifierKey"
534
+ */
535
+ multipleColumnsSortingMode: PropTypes.oneOf(['always', 'withModifierKey']),
528
536
  /**
529
537
  * Nonce of the inline styles for [Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#script-src-the-nonce-attribute).
530
538
  */
@@ -23,16 +23,20 @@ export const useDataGridProComponent = (apiRef, props) => {
23
23
 
24
24
  /**
25
25
  * Register all pre-processors called during state initialization here.
26
+ * Some pre-processors are changing the same part of the state (like the order of the columns).
27
+ * Order them in descending order of priority.
28
+ * For example, left pinned columns should always render first from the left, so the `hydrateColumns` pre-processor from `useGridColumnPinningPreProcessors` should be called last (after all other `hydrateColumns` pre-processors).
29
+ * Similarly, the `hydrateColumns` pre-processor from `useGridRowSelectionPreProcessors` should be called after `useGridTreeDataPreProcessors` because the selection checkboxes should appear before the tree data.
30
+ * Desired autogenerated columns order is:
31
+ * left pinned columns -> row reordering column -> checkbox column -> tree data column -> master detail column -> rest of the columns
26
32
  */
27
- useGridRowSelectionPreProcessors(apiRef, props);
28
- useGridRowReorderPreProcessors(apiRef, props);
33
+ useGridDetailPanelPreProcessors(apiRef, props);
29
34
  useGridTreeDataPreProcessors(apiRef, props);
30
35
  useGridDataSourceTreeDataPreProcessors(apiRef, props);
36
+ useGridRowSelectionPreProcessors(apiRef, props);
31
37
  useGridLazyLoaderPreProcessors(apiRef, props);
32
38
  useGridRowPinningPreProcessors(apiRef);
33
- useGridDetailPanelPreProcessors(apiRef, props);
34
- // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
35
- // Because it changes the order of the columns.
39
+ useGridRowReorderPreProcessors(apiRef, props);
36
40
  useGridColumnPinningPreProcessors(apiRef, props);
37
41
  useGridRowsPreProcessors(apiRef);
38
42
 
@@ -33,7 +33,8 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
33
33
  treeData: false,
34
34
  lazyLoading: false,
35
35
  lazyLoadingRequestThrottleMs: 500,
36
- listView: false
36
+ listView: false,
37
+ multipleColumnsSortingMode: 'withModifierKey'
37
38
  });
38
39
  const defaultSlots = DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS;
39
40
  export const useDataGridProProps = inProps => {
@@ -55,6 +55,7 @@ const GridColumnHeaders = forwardRef(function GridColumnHeaders(props, ref) {
55
55
  children: [getColumnGroupHeadersRows(), getColumnHeadersRow(), getColumnFiltersRow(), /*#__PURE__*/_jsx(Filler, {})]
56
56
  }));
57
57
  });
58
+ if (process.env.NODE_ENV !== "production") GridColumnHeaders.displayName = "GridColumnHeaders";
58
59
  process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
59
60
  // ----------------------------- Warning --------------------------------
60
61
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -10,5 +10,5 @@ interface GridDetailPanelProps extends Pick<React.HTMLAttributes<HTMLDivElement>
10
10
  */
11
11
  height: number | 'auto';
12
12
  }
13
- declare function GridDetailPanel(props: GridDetailPanelProps): React.JSX.Element;
13
+ declare function GridDetailPanel(props: GridDetailPanelProps): React.JSX.Element | null;
14
14
  export { GridDetailPanel };
@@ -2,6 +2,7 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import { styled } from '@mui/material/styles';
5
+ import { gridRowNodeSelector } from '@mui/x-data-grid';
5
6
  import { vars } from '@mui/x-data-grid/internals';
6
7
  import { useResizeObserver } from '@mui/x-internals/useResizeObserver';
7
8
  import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
@@ -27,6 +28,7 @@ function GridDetailPanel(props) {
27
28
  const rootProps = useGridRootProps();
28
29
  const ownerState = rootProps;
29
30
  const hasAutoHeight = height === 'auto';
31
+ const rowNode = gridRowNodeSelector(apiRef, rowId);
30
32
  React.useLayoutEffect(() => {
31
33
  if (hasAutoHeight && typeof ResizeObserver === 'undefined') {
32
34
  // Fallback for IE
@@ -38,6 +40,9 @@ function GridDetailPanel(props) {
38
40
  const observedHeight = entry.borderBoxSize && entry.borderBoxSize.length > 0 ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
39
41
  apiRef.current.storeDetailPanelHeight(rowId, observedHeight);
40
42
  }, hasAutoHeight);
43
+ if (rowNode?.type === 'skeletonRow') {
44
+ return null;
45
+ }
41
46
  return /*#__PURE__*/_jsx(DetailPanel, {
42
47
  ref: ref,
43
48
  ownerState: ownerState,
@@ -18,4 +18,5 @@ export const GridProColumnMenu = forwardRef(function GridProColumnMenu(props, re
18
18
  defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PRO,
19
19
  ref: ref
20
20
  }));
21
- });
21
+ });
22
+ if (process.env.NODE_ENV !== "production") GridProColumnMenu.displayName = "GridProColumnMenu";
@@ -1,9 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
+ import { styled } from '@mui/system';
4
5
  import composeClasses from '@mui/utils/composeClasses';
5
6
  import { gridRowMaximumTreeDepthSelector, gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass, gridClasses } from '@mui/x-data-grid';
6
- import { gridEditRowsStateSelector, isEventTargetInPortal } from '@mui/x-data-grid/internals';
7
+ import { gridEditRowsStateSelector, isEventTargetInPortal, vars } from '@mui/x-data-grid/internals';
7
8
  import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
8
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const useUtilityClasses = ownerState => {
@@ -13,10 +14,17 @@ const useUtilityClasses = ownerState => {
13
14
  } = ownerState;
14
15
  const slots = {
15
16
  root: ['rowReorderCell', isDraggable && 'rowReorderCell--draggable'],
16
- placeholder: ['rowReorderCellPlaceholder']
17
+ placeholder: ['rowReorderCellPlaceholder'],
18
+ icon: ['rowReorderIcon']
17
19
  };
18
20
  return composeClasses(slots, getDataGridUtilityClass, classes);
19
21
  };
22
+ const RowReorderIcon = styled('svg', {
23
+ name: 'MuiDataGrid',
24
+ slot: 'RowReorderIcon'
25
+ })({
26
+ color: vars.colors.foreground.muted
27
+ });
20
28
  function GridRowReorderCell(params) {
21
29
  const apiRef = useGridApiContext();
22
30
  const rootProps = useGridRootProps();
@@ -73,7 +81,12 @@ function GridRowReorderCell(params) {
73
81
  className: classes.root,
74
82
  draggable: isDraggable
75
83
  }, draggableEventHandlers, {
76
- children: [/*#__PURE__*/_jsx(rootProps.slots.rowReorderIcon, {}), /*#__PURE__*/_jsx("div", {
84
+ children: [/*#__PURE__*/_jsx(RowReorderIcon, {
85
+ as: rootProps.slots.rowReorderIcon,
86
+ ownerState: ownerState,
87
+ className: classes.icon,
88
+ fontSize: "small"
89
+ }), /*#__PURE__*/_jsx("div", {
77
90
  className: classes.placeholder,
78
91
  children: cellValue
79
92
  })]
@@ -5,7 +5,9 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
7
  import { styled } from '@mui/material/styles';
8
- import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';
8
+ import useForkRef from '@mui/utils/useForkRef';
9
+ import composeClasses from '@mui/utils/composeClasses';
10
+ import capitalize from '@mui/utils/capitalize';
9
11
  import { fastMemo } from '@mui/x-internals/fastMemo';
10
12
  import { gridVisibleColumnFieldsSelector, getDataGridUtilityClass, useGridSelector, GridFilterInputValue, GridFilterInputDate, GridFilterInputBoolean, GridFilterInputSingleSelect, gridFilterModelSelector, gridFilterableColumnLookupSelector, gridClasses } from '@mui/x-data-grid';
11
13
  import { PinnedColumnPosition, useGridPrivateApiContext, gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector, isNavigationKey, attachPinnedStyle, vars } from '@mui/x-data-grid/internals';
@@ -291,6 +293,7 @@ const GridHeaderFilterCell = forwardRef((props, ref) => {
291
293
  }) : null]
292
294
  }));
293
295
  });
296
+ if (process.env.NODE_ENV !== "production") GridHeaderFilterCell.displayName = "GridHeaderFilterCell";
294
297
  process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
295
298
  // ----------------------------- Warning --------------------------------
296
299
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -1,7 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { unstable_capitalize as capitalize, HTMLElementType } from '@mui/utils';
4
+ import capitalize from '@mui/utils/capitalize';
5
+ import HTMLElementType from '@mui/utils/HTMLElementType';
5
6
  import { useGridRootProps, useGridApiContext, GridMenu } from '@mui/x-data-grid';
6
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
8
  function GridHeaderFilterMenu({
@@ -4,7 +4,8 @@ const _excluded = ["operators", "item", "field", "buttonRef", "headerFilterMenuR
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useGridApiContext, useGridSelector } from '@mui/x-data-grid';
7
- import { refType, unstable_useId as useId } from '@mui/utils';
7
+ import refType from '@mui/utils/refType';
8
+ import useId from '@mui/utils/useId';
8
9
  import { gridHeaderFilteringMenuSelector } from '@mui/x-data-grid/internals';
9
10
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
10
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { useGridRegisterPipeProcessor, gridVisiblePinnedColumnDefinitionsSelector } from '@mui/x-data-grid/internals';
3
+ import { useGridRegisterPipeProcessor, gridExistingPinnedColumnSelector } from '@mui/x-data-grid/internals';
4
4
  export const useGridColumnPinningPreProcessors = (apiRef, props) => {
5
5
  const {
6
6
  disableColumnPinning
@@ -20,12 +20,12 @@ export const useGridColumnPinningPreProcessors = (apiRef, props) => {
20
20
  apiRef.current.state = _extends({}, savedState, {
21
21
  columns: columnsState
22
22
  });
23
- const visibleColumns = gridVisiblePinnedColumnDefinitionsSelector(apiRef);
23
+ const pinnedColumns = gridExistingPinnedColumnSelector(apiRef);
24
24
  apiRef.current.state = savedState;
25
25
  // HACK: Ends here //
26
26
 
27
- const leftPinnedColumns = visibleColumns.left.map(c => c.field);
28
- const rightPinnedColumns = visibleColumns.right.map(c => c.field);
27
+ const leftPinnedColumns = pinnedColumns.left;
28
+ const rightPinnedColumns = pinnedColumns.right;
29
29
  let newOrderedFields;
30
30
  const allPinnedColumns = [...leftPinnedColumns, ...rightPinnedColumns];
31
31
  const {
@@ -174,7 +174,7 @@ export const useGridDetailPanel = (apiRef, props) => {
174
174
  }
175
175
  updateCachesIfNeeded();
176
176
  const heightCache = gridDetailPanelRawHeightCacheSelector(apiRef);
177
- initialValue.detail = heightCache[row.id].height ?? 0; // Fallback to zero because the cache might not be ready yet (for example page was changed)
177
+ initialValue.detail = heightCache[row.id]?.height ?? 0; // Fallback to zero because the cache might not be ready yet (for example page was changed)
178
178
  return initialValue;
179
179
  }, [apiRef, updateCachesIfNeeded]);
180
180
  const enabled = props.getDetailPanelContent !== undefined;
@@ -6,28 +6,26 @@ import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_DETAIL_PANEL_TOGGLE_COL_DEF } from
6
6
  import { gridDetailPanelExpandedRowIdsSelector } from "./gridDetailPanelSelector.js";
7
7
  export const useGridDetailPanelPreProcessors = (privateApiRef, props) => {
8
8
  const addToggleColumn = React.useCallback(columnsState => {
9
- if (props.getDetailPanelContent == null) {
10
- // Remove the toggle column, when it exists
11
- if (columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD]) {
12
- delete columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD];
13
- columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== GRID_DETAIL_PANEL_TOGGLE_FIELD);
14
- }
15
- return columnsState;
16
- }
17
-
18
- // Don't add the toggle column if there's already one
19
- // The user might have manually added it to have it in a custom position
20
- if (columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD]) {
21
- return columnsState;
22
- }
23
-
24
- // Otherwise, add the toggle column at the beginning
25
- columnsState.orderedFields = [GRID_DETAIL_PANEL_TOGGLE_FIELD, ...columnsState.orderedFields];
26
- columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD] = _extends({}, GRID_DETAIL_PANEL_TOGGLE_COL_DEF, {
9
+ const detailPanelToggleColumn = _extends({}, GRID_DETAIL_PANEL_TOGGLE_COL_DEF, {
27
10
  headerName: privateApiRef.current.getLocaleText('detailPanelToggle')
28
11
  });
12
+ const shouldHaveToggleColumn = !!props.getDetailPanelContent;
13
+ const hasToggleColumn = columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD] != null;
14
+ if (shouldHaveToggleColumn && !hasToggleColumn) {
15
+ columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD] = detailPanelToggleColumn;
16
+ columnsState.orderedFields = [GRID_DETAIL_PANEL_TOGGLE_FIELD, ...columnsState.orderedFields];
17
+ } else if (!shouldHaveToggleColumn && hasToggleColumn) {
18
+ delete columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD];
19
+ columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== GRID_DETAIL_PANEL_TOGGLE_FIELD);
20
+ } else if (shouldHaveToggleColumn && hasToggleColumn) {
21
+ columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD] = _extends({}, detailPanelToggleColumn, columnsState.lookup[GRID_DETAIL_PANEL_TOGGLE_FIELD]);
22
+ // If the column is not in the columns array (not a custom detail panel toggle column), move it to the beginning of the column order
23
+ if (!props.columns.some(col => col.field === GRID_DETAIL_PANEL_TOGGLE_FIELD)) {
24
+ columnsState.orderedFields = [GRID_DETAIL_PANEL_TOGGLE_FIELD, ...columnsState.orderedFields.filter(field => field !== GRID_DETAIL_PANEL_TOGGLE_FIELD)];
25
+ }
26
+ }
29
27
  return columnsState;
30
- }, [privateApiRef, props.getDetailPanelContent]);
28
+ }, [privateApiRef, props.columns, props.getDetailPanelContent]);
31
29
  const addExpandedClassToRow = React.useCallback((classes, id) => {
32
30
  if (props.getDetailPanelContent == null) {
33
31
  return classes;
@@ -28,19 +28,21 @@ export const useGridRowReorderPreProcessors = (privateApiRef, props) => {
28
28
  headerName: privateApiRef.current.getLocaleText('rowReorderingHeaderName')
29
29
  });
30
30
  const shouldHaveReorderColumn = props.rowReordering;
31
- const haveReorderColumn = columnsState.lookup[reorderColumn.field] != null;
32
- if (shouldHaveReorderColumn && haveReorderColumn) {
33
- columnsState.lookup[reorderColumn.field] = _extends({}, reorderColumn, columnsState.lookup[reorderColumn.field]);
34
- return columnsState;
35
- }
36
- if (shouldHaveReorderColumn && !haveReorderColumn) {
31
+ const hasReorderColumn = columnsState.lookup[reorderColumn.field] != null;
32
+ if (shouldHaveReorderColumn && !hasReorderColumn) {
37
33
  columnsState.lookup[reorderColumn.field] = reorderColumn;
38
34
  columnsState.orderedFields = [reorderColumn.field, ...columnsState.orderedFields];
39
- } else if (!shouldHaveReorderColumn && haveReorderColumn) {
35
+ } else if (!shouldHaveReorderColumn && hasReorderColumn) {
40
36
  delete columnsState.lookup[reorderColumn.field];
41
37
  columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== reorderColumn.field);
38
+ } else if (shouldHaveReorderColumn && hasReorderColumn) {
39
+ columnsState.lookup[reorderColumn.field] = _extends({}, reorderColumn, columnsState.lookup[reorderColumn.field]);
40
+ // If the column is not in the columns array (not a custom reorder column), move it to the beginning of the column order
41
+ if (!props.columns.some(col => col.field === GRID_REORDER_COL_DEF.field)) {
42
+ columnsState.orderedFields = [reorderColumn.field, ...columnsState.orderedFields.filter(field => field !== reorderColumn.field)];
43
+ }
42
44
  }
43
45
  return columnsState;
44
- }, [privateApiRef, classes, props.rowReordering]);
46
+ }, [privateApiRef, classes, props.columns, props.rowReordering]);
45
47
  useGridRegisterPipeProcessor(privateApiRef, 'hydrateColumns', updateReorderColumn);
46
48
  };
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["hideDescendantCount"];
4
4
  import * as React from 'react';
5
- import { gridRowTreeSelector, useFirstRender, GRID_CHECKBOX_SELECTION_FIELD } from '@mui/x-data-grid';
5
+ import { gridRowTreeSelector, useFirstRender } from '@mui/x-data-grid';
6
6
  import { GridStrategyGroup, useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor } from '@mui/x-data-grid/internals';
7
7
  import { GRID_TREE_DATA_GROUPING_COL_DEF, GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES } from "../treeData/gridTreeDataGroupColDef.js";
8
8
  import { skipFiltering, skipSorting } from "./utils.js";
@@ -56,8 +56,7 @@ export const useGridDataSourceTreeDataPreProcessors = (privateApiRef, props) =>
56
56
  }
57
57
  columnsState.lookup[groupingColDefField] = newGroupingColumn;
58
58
  if (prevGroupingColumn == null) {
59
- const index = columnsState.orderedFields[0] === GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
60
- columnsState.orderedFields = [...columnsState.orderedFields.slice(0, index), groupingColDefField, ...columnsState.orderedFields.slice(index)];
59
+ columnsState.orderedFields = [groupingColDefField, ...columnsState.orderedFields];
61
60
  }
62
61
  } else if (!shouldHaveGroupingColumn && prevGroupingColumn) {
63
62
  delete columnsState.lookup[groupingColDefField];
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["hideDescendantCount"];
4
4
  import * as React from 'react';
5
- import { gridRowTreeSelector, useFirstRender, GRID_CHECKBOX_SELECTION_FIELD } from '@mui/x-data-grid';
5
+ import { gridRowTreeSelector, useFirstRender } from '@mui/x-data-grid';
6
6
  import { GridStrategyGroup, useGridRegisterPipeProcessor, useGridRegisterStrategyProcessor } from '@mui/x-data-grid/internals';
7
7
  import { GRID_TREE_DATA_GROUPING_COL_DEF, GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES } from "./gridTreeDataGroupColDef.js";
8
8
  import { filterRowTreeFromTreeData, TreeDataStrategy } from "./gridTreeDataUtils.js";
@@ -56,8 +56,7 @@ export const useGridTreeDataPreProcessors = (privateApiRef, props) => {
56
56
  }
57
57
  columnsState.lookup[groupingColDefField] = newGroupingColumn;
58
58
  if (prevGroupingColumn == null) {
59
- const index = columnsState.orderedFields[0] === GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
60
- columnsState.orderedFields = [...columnsState.orderedFields.slice(0, index), groupingColDefField, ...columnsState.orderedFields.slice(index)];
59
+ columnsState.orderedFields = [groupingColDefField, ...columnsState.orderedFields];
61
60
  }
62
61
  } else if (!shouldHaveGroupingColumn && prevGroupingColumn) {
63
62
  delete columnsState.lookup[groupingColDefField];
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v8.4.0
2
+ * @mui/x-data-grid-pro v8.5.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -28,12 +28,12 @@ const useGridColumnPinningPreProcessors = (apiRef, props) => {
28
28
  apiRef.current.state = (0, _extends2.default)({}, savedState, {
29
29
  columns: columnsState
30
30
  });
31
- const visibleColumns = (0, _internals.gridVisiblePinnedColumnDefinitionsSelector)(apiRef);
31
+ const pinnedColumns = (0, _internals.gridExistingPinnedColumnSelector)(apiRef);
32
32
  apiRef.current.state = savedState;
33
33
  // HACK: Ends here //
34
34
 
35
- const leftPinnedColumns = visibleColumns.left.map(c => c.field);
36
- const rightPinnedColumns = visibleColumns.right.map(c => c.field);
35
+ const leftPinnedColumns = pinnedColumns.left;
36
+ const rightPinnedColumns = pinnedColumns.right;
37
37
  let newOrderedFields;
38
38
  const allPinnedColumns = [...leftPinnedColumns, ...rightPinnedColumns];
39
39
  const {
@@ -183,7 +183,7 @@ const useGridDetailPanel = (apiRef, props) => {
183
183
  }
184
184
  updateCachesIfNeeded();
185
185
  const heightCache = (0, _gridDetailPanelSelector.gridDetailPanelRawHeightCacheSelector)(apiRef);
186
- initialValue.detail = heightCache[row.id].height ?? 0; // Fallback to zero because the cache might not be ready yet (for example page was changed)
186
+ initialValue.detail = heightCache[row.id]?.height ?? 0; // Fallback to zero because the cache might not be ready yet (for example page was changed)
187
187
  return initialValue;
188
188
  }, [apiRef, updateCachesIfNeeded]);
189
189
  const enabled = props.getDetailPanelContent !== undefined;
@@ -14,28 +14,26 @@ var _gridDetailPanelToggleColDef = require("./gridDetailPanelToggleColDef");
14
14
  var _gridDetailPanelSelector = require("./gridDetailPanelSelector");
15
15
  const useGridDetailPanelPreProcessors = (privateApiRef, props) => {
16
16
  const addToggleColumn = React.useCallback(columnsState => {
17
- if (props.getDetailPanelContent == null) {
18
- // Remove the toggle column, when it exists
19
- if (columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD]) {
20
- delete columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD];
21
- columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== _gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD);
22
- }
23
- return columnsState;
24
- }
25
-
26
- // Don't add the toggle column if there's already one
27
- // The user might have manually added it to have it in a custom position
28
- if (columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD]) {
29
- return columnsState;
30
- }
31
-
32
- // Otherwise, add the toggle column at the beginning
33
- columnsState.orderedFields = [_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD, ...columnsState.orderedFields];
34
- columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD] = (0, _extends2.default)({}, _gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_COL_DEF, {
17
+ const detailPanelToggleColumn = (0, _extends2.default)({}, _gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_COL_DEF, {
35
18
  headerName: privateApiRef.current.getLocaleText('detailPanelToggle')
36
19
  });
20
+ const shouldHaveToggleColumn = !!props.getDetailPanelContent;
21
+ const hasToggleColumn = columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD] != null;
22
+ if (shouldHaveToggleColumn && !hasToggleColumn) {
23
+ columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD] = detailPanelToggleColumn;
24
+ columnsState.orderedFields = [_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD, ...columnsState.orderedFields];
25
+ } else if (!shouldHaveToggleColumn && hasToggleColumn) {
26
+ delete columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD];
27
+ columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== _gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD);
28
+ } else if (shouldHaveToggleColumn && hasToggleColumn) {
29
+ columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD] = (0, _extends2.default)({}, detailPanelToggleColumn, columnsState.lookup[_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD]);
30
+ // If the column is not in the columns array (not a custom detail panel toggle column), move it to the beginning of the column order
31
+ if (!props.columns.some(col => col.field === _gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD)) {
32
+ columnsState.orderedFields = [_gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD, ...columnsState.orderedFields.filter(field => field !== _gridDetailPanelToggleColDef.GRID_DETAIL_PANEL_TOGGLE_FIELD)];
33
+ }
34
+ }
37
35
  return columnsState;
38
- }, [privateApiRef, props.getDetailPanelContent]);
36
+ }, [privateApiRef, props.columns, props.getDetailPanelContent]);
39
37
  const addExpandedClassToRow = React.useCallback((classes, id) => {
40
38
  if (props.getDetailPanelContent == null) {
41
39
  return classes;
@@ -36,20 +36,22 @@ const useGridRowReorderPreProcessors = (privateApiRef, props) => {
36
36
  headerName: privateApiRef.current.getLocaleText('rowReorderingHeaderName')
37
37
  });
38
38
  const shouldHaveReorderColumn = props.rowReordering;
39
- const haveReorderColumn = columnsState.lookup[reorderColumn.field] != null;
40
- if (shouldHaveReorderColumn && haveReorderColumn) {
41
- columnsState.lookup[reorderColumn.field] = (0, _extends2.default)({}, reorderColumn, columnsState.lookup[reorderColumn.field]);
42
- return columnsState;
43
- }
44
- if (shouldHaveReorderColumn && !haveReorderColumn) {
39
+ const hasReorderColumn = columnsState.lookup[reorderColumn.field] != null;
40
+ if (shouldHaveReorderColumn && !hasReorderColumn) {
45
41
  columnsState.lookup[reorderColumn.field] = reorderColumn;
46
42
  columnsState.orderedFields = [reorderColumn.field, ...columnsState.orderedFields];
47
- } else if (!shouldHaveReorderColumn && haveReorderColumn) {
43
+ } else if (!shouldHaveReorderColumn && hasReorderColumn) {
48
44
  delete columnsState.lookup[reorderColumn.field];
49
45
  columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== reorderColumn.field);
46
+ } else if (shouldHaveReorderColumn && hasReorderColumn) {
47
+ columnsState.lookup[reorderColumn.field] = (0, _extends2.default)({}, reorderColumn, columnsState.lookup[reorderColumn.field]);
48
+ // If the column is not in the columns array (not a custom reorder column), move it to the beginning of the column order
49
+ if (!props.columns.some(col => col.field === _gridRowReorderColDef.GRID_REORDER_COL_DEF.field)) {
50
+ columnsState.orderedFields = [reorderColumn.field, ...columnsState.orderedFields.filter(field => field !== reorderColumn.field)];
51
+ }
50
52
  }
51
53
  return columnsState;
52
- }, [privateApiRef, classes, props.rowReordering]);
54
+ }, [privateApiRef, classes, props.columns, props.rowReordering]);
53
55
  (0, _internals.useGridRegisterPipeProcessor)(privateApiRef, 'hydrateColumns', updateReorderColumn);
54
56
  };
55
57
  exports.useGridRowReorderPreProcessors = useGridRowReorderPreProcessors;
@@ -64,8 +64,7 @@ const useGridDataSourceTreeDataPreProcessors = (privateApiRef, props) => {
64
64
  }
65
65
  columnsState.lookup[groupingColDefField] = newGroupingColumn;
66
66
  if (prevGroupingColumn == null) {
67
- const index = columnsState.orderedFields[0] === _xDataGrid.GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
68
- columnsState.orderedFields = [...columnsState.orderedFields.slice(0, index), groupingColDefField, ...columnsState.orderedFields.slice(index)];
67
+ columnsState.orderedFields = [groupingColDefField, ...columnsState.orderedFields];
69
68
  }
70
69
  } else if (!shouldHaveGroupingColumn && prevGroupingColumn) {
71
70
  delete columnsState.lookup[groupingColDefField];
@@ -64,8 +64,7 @@ const useGridTreeDataPreProcessors = (privateApiRef, props) => {
64
64
  }
65
65
  columnsState.lookup[groupingColDefField] = newGroupingColumn;
66
66
  if (prevGroupingColumn == null) {
67
- const index = columnsState.orderedFields[0] === _xDataGrid.GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
68
- columnsState.orderedFields = [...columnsState.orderedFields.slice(0, index), groupingColDefField, ...columnsState.orderedFields.slice(index)];
67
+ columnsState.orderedFields = [groupingColDefField, ...columnsState.orderedFields];
69
68
  }
70
69
  } else if (!shouldHaveGroupingColumn && prevGroupingColumn) {
71
70
  delete columnsState.lookup[groupingColDefField];
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v8.4.0
2
+ * @mui/x-data-grid-pro v8.5.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial 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.4.0",
3
+ "version": "8.5.1",
4
4
  "author": "MUI Team",
5
5
  "description": "The Pro plan edition of the MUI X Data Grid components.",
6
6
  "main": "./index.js",
@@ -35,15 +35,15 @@
35
35
  "directory": "packages/x-data-grid-pro"
36
36
  },
37
37
  "dependencies": {
38
- "@babel/runtime": "^7.27.1",
39
- "@mui/utils": "^7.0.2",
38
+ "@babel/runtime": "^7.27.4",
39
+ "@mui/utils": "^7.1.1",
40
40
  "@types/format-util": "^1.0.4",
41
41
  "clsx": "^2.1.1",
42
42
  "prop-types": "^15.8.1",
43
43
  "reselect": "^5.1.1",
44
- "@mui/x-internals": "8.4.0",
45
- "@mui/x-license": "8.4.0",
46
- "@mui/x-data-grid": "8.4.0"
44
+ "@mui/x-internals": "8.5.1",
45
+ "@mui/x-data-grid": "8.5.1",
46
+ "@mui/x-license": "8.5.1"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@emotion/react": "^11.9.0",