@mui/x-data-grid-pro 8.3.1 → 8.5.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +213 -0
  2. package/DataGridPro/DataGridPro.js +10 -1
  3. package/DataGridPro/useDataGridProProps.js +2 -1
  4. package/components/GridColumnHeaders.js +1 -0
  5. package/components/GridDetailPanelToggleCell.js +1 -0
  6. package/components/GridProColumnMenu.js +2 -1
  7. package/components/GridRowReorderCell.js +31 -4
  8. package/components/headerFiltering/GridHeaderFilterCell.js +8 -5
  9. package/components/headerFiltering/GridHeaderFilterMenu.js +4 -3
  10. package/components/headerFiltering/GridHeaderFilterMenuContainer.js +5 -4
  11. package/esm/DataGridPro/DataGridPro.js +10 -1
  12. package/esm/DataGridPro/useDataGridProProps.js +2 -1
  13. package/esm/components/GridColumnHeaders.js +1 -0
  14. package/esm/components/GridDetailPanelToggleCell.js +1 -0
  15. package/esm/components/GridProColumnMenu.js +2 -1
  16. package/esm/components/GridRowReorderCell.js +33 -6
  17. package/esm/components/headerFiltering/GridHeaderFilterCell.js +4 -1
  18. package/esm/components/headerFiltering/GridHeaderFilterMenu.js +2 -1
  19. package/esm/components/headerFiltering/GridHeaderFilterMenuContainer.js +2 -1
  20. package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -0
  21. package/esm/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +4 -4
  22. package/esm/hooks/features/columnReorder/useGridColumnReorder.js +44 -39
  23. package/esm/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +17 -11
  24. package/esm/index.js +1 -1
  25. package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -0
  26. package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +3 -3
  27. package/hooks/features/columnReorder/useGridColumnReorder.js +44 -39
  28. package/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +17 -11
  29. package/index.js +1 -1
  30. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -5,6 +5,219 @@
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.0
9
+
10
+ _May 29, 2025_
11
+
12
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 📊 Add support for exporting `RadarChartPro`, `FunnelChart` and `Heatmap` as image and PDF.
15
+ - 📊 `RadarChart` is now stable.
16
+
17
+ Special thanks go out to the community members for their valuable contributions:
18
+ @xBlizZer, @sai6855, @alisasanib.
19
+ Following are all team members who have contributed to this release:
20
+ @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @LukasTy, @oliviertassinari.
21
+
22
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
23
+
24
+ ### Data Grid
25
+
26
+ #### `@mui/x-data-grid@8.5.0`
27
+
28
+ - [DataGrid] Avoid ResizeObserver loop error (#17984) @cherniavskii
29
+ - [DataGrid] Fix column management `toggleColumn` event type (#18023) @KenanYusuf
30
+ - [DataGrid] Remove unnecessary `any` type (#17979) @sai6855
31
+
32
+ #### `@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')
33
+
34
+ Same changes as in `@mui/x-data-grid@8.5.0`, plus:
35
+
36
+ - [DataGridPro] Allow multi sorting without modifier key (#17925) @cherniavskii
37
+ - [DataGridPro] Row reordering icon improvements (#17947) @KenanYusuf
38
+ - [DataGridPro] Fix pinned columns order in column management (#17950) @alisasanib
39
+
40
+ #### `@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')
41
+
42
+ Same changes as in `@mui/x-data-grid-pro@8.5.0`, plus:
43
+
44
+ - [DataGridPremium] Export `GridApiPremium` type (#18037) @arminmeh
45
+
46
+ ### Date and Time Pickers
47
+
48
+ #### `@mui/x-date-pickers@8.5.0`
49
+
50
+ Internal changes.
51
+
52
+ #### `@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')
53
+
54
+ Same changes as in `@mui/x-date-pickers@8.5.0`, plus:
55
+
56
+ - [DateRangePicker] Allow to override the format in the field (#17972) @flaviendelangle
57
+
58
+ ### Charts
59
+
60
+ #### `@mui/x-charts@8.5.0`
61
+
62
+ - [charts] Add `render` prop to charts toolbar components (#17649) @bernardobelchior
63
+ - [charts] Add configurable slots to toolbar (#17712) @bernardobelchior
64
+ - [charts] Export `useFunnelSeries` and `useRadarSeries` (#18034) @JCQuintas
65
+ - [charts] Expose `ChartApi` through context (#18004) @bernardobelchior
66
+ - [charts] Mark Radar chart as stable (#17946) @alexfauquette
67
+ - [charts] Only update store if interaction item is different (#17851) @bernardobelchior
68
+ - [charts] Reuse shared date utils (#18014) @JCQuintas
69
+ - [charts] Use Map for string cache instead of object (#17982) @bernardobelchior
70
+ - [charts] Fix Population pyramid demo (#17987) @oliviertassinari
71
+
72
+ #### `@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')
73
+
74
+ Same changes as in `@mui/x-charts@8.5.0`, plus:
75
+
76
+ - [charts-pro] Add range selection to zoom slider (#17949) @bernardobelchior
77
+ - [charts-pro] Allow configuring zoom slider tooltip (#18030) @bernardobelchior
78
+ - [charts-pro] Allow exporting a funnel chart (#17957) @bernardobelchior
79
+ - [charts-pro] Allow exporting a heatmap chart (#17916) @bernardobelchior
80
+ - [charts-pro] Allow exporting a radar chart (#17968) @bernardobelchior
81
+ - [charts-pro] Always show both zoom slider tooltips (#18027) @bernardobelchior
82
+ - [charts-pro] Show zoom slider tooltip when selecting range (#18028) @bernardobelchior
83
+ - [charts-pro] Split `ChartAxisZoomSlider` into smaller files (#18011) @bernardobelchior
84
+ - [charts-pro] Update zoom slider range selection cursor (#17977) @bernardobelchior
85
+ - [charts-pro] Add support for Heatmap legend (#17943) @alexfauquette
86
+
87
+ ### Tree View
88
+
89
+ #### `@mui/x-tree-view@8.5.0`
90
+
91
+ Internal changes.
92
+
93
+ #### `@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')
94
+
95
+ Same changes as in `@mui/x-tree-view@8.5.0`.
96
+
97
+ ### Docs
98
+
99
+ - [docs] Fix derived column pivoting demo crash (#17944) @arminmeh
100
+ - [docs] Fix light/dark mode blink on pickers overview (#18002) @alexfauquette
101
+ - [docs] Fix scatter shape demo causing horizontal overflow (#17974) @bernardobelchior
102
+
103
+ ### Core
104
+
105
+ - [code-infra] Add bundle size monitor (#17754) @Janpot
106
+ - [code-infra] Enable `babel-plugin-display-name` in vitest (#17903) @JCQuintas
107
+ - [infra] Remove last deprecated `ponyfillGlobal` usage (#18003) @LukasTy
108
+ - [infra] Use `babel-plugin-display-name` from npm (#18040) @LukasTy
109
+ - [x-telemetry] Remove deprecated `ponyfillGlobal` (#17986) @xBlizZer
110
+
111
+ ## 8.4.0
112
+
113
+ _May 21, 2025_
114
+
115
+ We'd like to offer a big thanks to the 21 contributors who made this release possible. Here are some highlights ✨:
116
+
117
+ - 🔺 Support regular [`pyramid` variation in the `<FunnelChart />` component](https://mui.com/x/react-charts/funnel/#pyramid-chart):
118
+
119
+ <img width="398" alt="Pyramid funnel chart" src="https://github.com/user-attachments/assets/90ccb221-3a48-4ffa-8878-89c6db16da86" />
120
+
121
+ - 📚 Documentation improvements
122
+ - 🌎 Improve Icelandic (is-IS) locale on the Data Grid
123
+ - 🐞 Bugfixes
124
+
125
+ Special thanks go out to the community members for their valuable contributions:
126
+ @aizerin, @arminmeh, @campmarc, @jyash97, @mapache-salvaje, @noraleonte, @nusr, @ragnarr18, @romgrk, @whereisrmsqhs.
127
+ Following are all team members who have contributed to this release:
128
+ @alexfauquette, @bernardobelchior, @flaviendelangle, @JCQuintas, @KenanYusuf, @LukasTy, @MBilalShafi, @rita-codes.
129
+
130
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
131
+
132
+ ### Data Grid
133
+
134
+ #### `@mui/x-data-grid@8.4.0`
135
+
136
+ - [DataGrid] Fix content rendering for large rows while using automatic page size (#14737) @campmarc
137
+ - [DataGrid] Fix disabled typography variants crashing grid (#17934) @KenanYusuf
138
+ - [DataGrid] Fix tree data demo crash (#17904) @MBilalShafi
139
+ - [DataGrid] Use `exclude` selection model type if quick filter does not have actual values (#17899) @arminmeh
140
+ - [DataGrid] Fix clipboard copy behavior for cell ranges with empty cells (#16797) @nusr
141
+ - [l10n] Improve Icelandic (is-IS) locale (#17915) @ragnarr18
142
+
143
+ #### `@mui/x-data-grid-pro@8.4.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
144
+
145
+ Same changes as in `@mui/x-data-grid@8.4.0`, plus:
146
+
147
+ - [DataGridPro] Add `aria-expanded` attribute to the master detail toggle button (#17122) @whereisrmsqhs
148
+ - [DataGridPro] Preserve row state during server-side lazy loading (#17743) @arminmeh
149
+ - [DataGridPro] Prevent text selection when reordering rows (#16568) @jyash97
150
+
151
+ #### `@mui/x-data-grid-premium@8.4.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
152
+
153
+ Same changes as in `@mui/x-data-grid-pro@8.4.0`.
154
+
155
+ ### Date and Time Pickers
156
+
157
+ #### `@mui/x-date-pickers@8.4.0`
158
+
159
+ - [fields] Ensure fresh `disabled` value is used when focusing or clicking (#17914) @aizerin
160
+ - [fields] Improve the field controlled edition (#17816) @flaviendelangle
161
+ - [pickers] Fix `PickersTextField` overflow (#17942) @noraleonte
162
+
163
+ #### `@mui/x-date-pickers-pro@8.4.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
164
+
165
+ Same changes as in `@mui/x-date-pickers@8.4.0`.
166
+
167
+ ### Charts
168
+
169
+ #### `@mui/x-charts@8.4.0`
170
+
171
+ - [charts] Add grouped axes demo (#17848) @bernardobelchior
172
+ - [charts] Enable tooltip disable portal (#17871) @alexfauquette
173
+ - [charts] Improve performance in scatter chart (#17849) @bernardobelchior
174
+ - [charts] Recreate `isPointInside` less often (#17850) @bernardobelchior
175
+ - [charts] Try fix for flaky `useAnimate` test (#17777) @JCQuintas
176
+ - [charts] Add `isXInside` and `isYInside` (#17911) @bernardobelchior
177
+
178
+ #### `@mui/x-charts-pro@8.4.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
179
+
180
+ Same changes as in `@mui/x-charts@8.4.0`, plus:
181
+
182
+ - [charts-pro] Add size for zoom slider (#17736) @bernardobelchior
183
+ - [charts-pro] Add zoom slider tooltip (#17733) @bernardobelchior
184
+ - [charts-pro] Clean and document Heatmap Tooltip (#17933) @alexfauquette
185
+ - [charts-pro] Introduce `Pyramid` chart (#17783) @JCQuintas
186
+ - [charts-pro] Update zoom slider nomenclature (#17938) @bernardobelchior
187
+ - [charts-pro] Fix error when importing rasterizehtml (#17897) @bernardobelchior
188
+
189
+ ### Tree View
190
+
191
+ #### `@mui/x-tree-view@8.4.0`
192
+
193
+ - [TreeView] Add `getItemChildren` prop in `RichTreeView` (#17894) @rita-codes
194
+ - [TreeView] Add a method in the `apiRef` to toggle the editing status of an item (#17768) @rita-codes
195
+ - [TreeView] Add missing sx prop on the Tree Item component (#17930) @flaviendelangle
196
+
197
+ #### `@mui/x-tree-view-pro@8.4.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
198
+
199
+ Same changes as in `@mui/x-tree-view@8.4.0`.
200
+
201
+ ### Docs
202
+
203
+ - [docs] Add a recipe for drag and drop row grouping (#17638) @KenanYusuf
204
+ - [docs] Add introductory text to Data Grid component pages (#17902) @KenanYusuf
205
+ - [docs] Refactor embedded CodeSandbox on Data Grid—Quickstart page (#17749) @rita-codes
206
+ - [docs] Remove double border on Data Grid—Quickstart demo (#17932) @rita-codes
207
+ - [docs] Standardize `apiRef` copy (#17776) @mapache-salvaje
208
+ - [docs][DataGrid] Revise server-side data docs (#17007) @mapache-salvaje
209
+ - [docs][DataGrid] Audit and revise the tree data doc (#17650) @mapache-salvaje
210
+ - [docs][pickers] Fix migration guide references to range fields (#17861) @LukasTy
211
+ - [docs][charts] Reorganize the Tooltip documentation (#17917) @alexfauquette
212
+
213
+ ### Core
214
+
215
+ - [core] refactor: remove manual `displayName` (#17845) @romgrk
216
+ - [code-infra] Document how to use `vitest` cli (#17847) @JCQuintas
217
+ - [code-infra] Increase charts export test timeout (#17909) @JCQuintas
218
+ - [code-infra] Set `isolatedModules=true` in tsconfig (#17781) @JCQuintas
219
+ - [infra] Ensure proper docs preview path resolution (#17863) @LukasTy
220
+
8
221
  ## 8.3.1
9
222
 
10
223
  _May 14, 2025_
@@ -29,7 +29,7 @@ const configuration = {
29
29
  useCellAggregationResult: () => null
30
30
  }
31
31
  };
32
- const releaseInfo = "MTc0NzE3MzYwMDAwMA==";
32
+ const releaseInfo = "MTc0ODQ2OTYwMDAwMA==";
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/)
@@ -64,6 +65,7 @@ const DataGridProRaw = (0, _forwardRef.forwardRef)(function DataGridPro(inProps,
64
65
  * - [DataGridPro API](https://mui.com/x/api/data-grid/data-grid-pro/)
65
66
  */
66
67
  const DataGridPro = exports.DataGridPro = /*#__PURE__*/React.memo(DataGridProRaw);
68
+ if (process.env.NODE_ENV !== "production") DataGridPro.displayName = "DataGridPro";
67
69
  DataGridProRaw.propTypes = {
68
70
  // ----------------------------- Warning --------------------------------
69
71
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -531,6 +533,13 @@ DataGridProRaw.propTypes = {
531
533
  * @default "error" ("warn" in dev mode)
532
534
  */
533
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']),
534
543
  /**
535
544
  * Nonce of the inline styles for [Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#script-src-the-nonce-attribute).
536
545
  */
@@ -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 |
@@ -54,6 +54,7 @@ function GridDetailPanelToggleCell(props) {
54
54
  tabIndex: -1,
55
55
  disabled: !hasContent,
56
56
  className: classes.root,
57
+ "aria-expanded": isExpanded,
57
58
  "aria-label": isExpanded ? apiRef.current.getLocaleText('collapseDetailPanel') : apiRef.current.getLocaleText('expandDetailPanel')
58
59
  }, rootProps.slotProps?.baseIconButton, {
59
60
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
@@ -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)();
@@ -57,10 +65,23 @@ function GridRowReorderCell(params) {
57
65
  propHandler(event);
58
66
  }
59
67
  }, [apiRef, params.id]);
68
+ const handleMouseDown = React.useCallback(() => {
69
+ // Prevent text selection as it will block all the drag events. More context: https://github.com/mui/mui-x/issues/16303
70
+ apiRef.current.rootElementRef?.current?.classList.add(_xDataGrid.gridClasses['root--disableUserSelection']);
71
+ }, [apiRef]);
72
+ const handleMouseUp = React.useCallback(() => {
73
+ apiRef.current.rootElementRef?.current?.classList.remove(_xDataGrid.gridClasses['root--disableUserSelection']);
74
+ }, [apiRef]);
75
+ const handleDragEnd = React.useCallback(event => {
76
+ handleMouseUp();
77
+ publish('rowDragEnd')(event);
78
+ }, [publish, handleMouseUp]);
60
79
  const draggableEventHandlers = isDraggable ? {
61
80
  onDragStart: publish('rowDragStart'),
62
81
  onDragOver: publish('rowDragOver'),
63
- onDragEnd: publish('rowDragEnd')
82
+ onDragEnd: handleDragEnd,
83
+ onMouseDown: handleMouseDown,
84
+ onMouseUp: handleMouseUp
64
85
  } : null;
65
86
  if (params.rowNode.type === 'footer') {
66
87
  return null;
@@ -69,7 +90,12 @@ function GridRowReorderCell(params) {
69
90
  className: classes.root,
70
91
  draggable: isDraggable
71
92
  }, draggableEventHandlers, {
72
- 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", {
73
99
  className: classes.placeholder,
74
100
  children: cellValue
75
101
  })]
@@ -146,4 +172,5 @@ const renderRowReorderCell = params => {
146
172
  }
147
173
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridRowReorderCell, (0, _extends2.default)({}, params));
148
174
  };
149
- exports.renderRowReorderCell = renderRowReorderCell;
175
+ exports.renderRowReorderCell = renderRowReorderCell;
176
+ if (process.env.NODE_ENV !== "production") renderRowReorderCell.displayName = "renderRowReorderCell";
@@ -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 = "MTc0NzE3MzYwMDAwMA==";
25
+ const releaseInfo = "MTc0ODQ2OTYwMDAwMA==";
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/)
@@ -57,6 +58,7 @@ const DataGridProRaw = forwardRef(function DataGridPro(inProps, ref) {
57
58
  * - [DataGridPro API](https://mui.com/x/api/data-grid/data-grid-pro/)
58
59
  */
59
60
  export const DataGridPro = /*#__PURE__*/React.memo(DataGridProRaw);
61
+ if (process.env.NODE_ENV !== "production") DataGridPro.displayName = "DataGridPro";
60
62
  DataGridProRaw.propTypes = {
61
63
  // ----------------------------- Warning --------------------------------
62
64
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -524,6 +526,13 @@ DataGridProRaw.propTypes = {
524
526
  * @default "error" ("warn" in dev mode)
525
527
  */
526
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']),
527
536
  /**
528
537
  * Nonce of the inline styles for [Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#script-src-the-nonce-attribute).
529
538
  */
@@ -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 |
@@ -46,6 +46,7 @@ function GridDetailPanelToggleCell(props) {
46
46
  tabIndex: -1,
47
47
  disabled: !hasContent,
48
48
  className: classes.root,
49
+ "aria-expanded": isExpanded,
49
50
  "aria-label": isExpanded ? apiRef.current.getLocaleText('collapseDetailPanel') : apiRef.current.getLocaleText('expandDetailPanel')
50
51
  }, rootProps.slotProps?.baseIconButton, {
51
52
  children: /*#__PURE__*/_jsx(Icon, {
@@ -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
- import { gridRowMaximumTreeDepthSelector, gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
6
- import { gridEditRowsStateSelector, isEventTargetInPortal } from '@mui/x-data-grid/internals';
6
+ import { gridRowMaximumTreeDepthSelector, gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass, gridClasses } from '@mui/x-data-grid';
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();
@@ -48,10 +56,23 @@ function GridRowReorderCell(params) {
48
56
  propHandler(event);
49
57
  }
50
58
  }, [apiRef, params.id]);
59
+ const handleMouseDown = React.useCallback(() => {
60
+ // Prevent text selection as it will block all the drag events. More context: https://github.com/mui/mui-x/issues/16303
61
+ apiRef.current.rootElementRef?.current?.classList.add(gridClasses['root--disableUserSelection']);
62
+ }, [apiRef]);
63
+ const handleMouseUp = React.useCallback(() => {
64
+ apiRef.current.rootElementRef?.current?.classList.remove(gridClasses['root--disableUserSelection']);
65
+ }, [apiRef]);
66
+ const handleDragEnd = React.useCallback(event => {
67
+ handleMouseUp();
68
+ publish('rowDragEnd')(event);
69
+ }, [publish, handleMouseUp]);
51
70
  const draggableEventHandlers = isDraggable ? {
52
71
  onDragStart: publish('rowDragStart'),
53
72
  onDragOver: publish('rowDragOver'),
54
- onDragEnd: publish('rowDragEnd')
73
+ onDragEnd: handleDragEnd,
74
+ onMouseDown: handleMouseDown,
75
+ onMouseUp: handleMouseUp
55
76
  } : null;
56
77
  if (params.rowNode.type === 'footer') {
57
78
  return null;
@@ -60,7 +81,12 @@ function GridRowReorderCell(params) {
60
81
  className: classes.root,
61
82
  draggable: isDraggable
62
83
  }, draggableEventHandlers, {
63
- 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", {
64
90
  className: classes.placeholder,
65
91
  children: cellValue
66
92
  })]
@@ -137,4 +163,5 @@ export const renderRowReorderCell = params => {
137
163
  return null;
138
164
  }
139
165
  return /*#__PURE__*/_jsx(GridRowReorderCell, _extends({}, params));
140
- };
166
+ };
167
+ if (process.env.NODE_ENV !== "production") renderRowReorderCell.displayName = "renderRowReorderCell";
@@ -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";
@@ -137,6 +137,7 @@ export const useGridColumnHeaders = props => {
137
137
  })]
138
138
  });
139
139
  };
140
+ if (process.env.NODE_ENV !== "production") getColumnFiltersRow.displayName = "getColumnFiltersRow";
140
141
  return _extends({}, otherProps, {
141
142
  getColumnFiltersRow
142
143
  });
@@ -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 {
@@ -48,6 +48,44 @@ export const useGridColumnReorder = (apiRef, props) => {
48
48
  clearTimeout(removeDnDStylesTimeout.current);
49
49
  };
50
50
  }, []);
51
+ const handleDragEnd = React.useCallback((params, event) => {
52
+ const dragColField = gridColumnReorderDragColSelector(apiRef);
53
+ if (props.disableColumnReorder || !dragColField) {
54
+ return;
55
+ }
56
+ logger.debug('End dragging col');
57
+ event.preventDefault();
58
+ // Prevent drag events propagation.
59
+ // For more information check here https://github.com/mui/mui-x/issues/2680.
60
+ event.stopPropagation();
61
+ clearTimeout(removeDnDStylesTimeout.current);
62
+
63
+ // For more information check here https://github.com/mui/mui-x/issues/14678
64
+ if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
65
+ dragColNode.current.classList.remove(classes.columnHeaderDragging);
66
+ }
67
+ dragColNode.current = null;
68
+
69
+ // Check if the column was dropped outside the grid.
70
+ if (event.dataTransfer.dropEffect === 'none' && !props.keepColumnPositionIfDraggedOutside) {
71
+ // Accessing params.field may contain the wrong field as header elements are reused
72
+ apiRef.current.setColumnIndex(dragColField, originColumnIndex.current);
73
+ originColumnIndex.current = null;
74
+ } else {
75
+ // Emit the columnOrderChange event only once when the reordering stops.
76
+ const columnOrderChangeParams = {
77
+ column: apiRef.current.getColumn(dragColField),
78
+ targetIndex: apiRef.current.getColumnIndexRelativeToVisibleColumns(dragColField),
79
+ oldIndex: originColumnIndex.current
80
+ };
81
+ apiRef.current.publishEvent('columnOrderChange', columnOrderChangeParams);
82
+ }
83
+ apiRef.current.setState(state => _extends({}, state, {
84
+ columnReorder: _extends({}, state.columnReorder, {
85
+ dragCol: ''
86
+ })
87
+ }));
88
+ }, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
51
89
  const handleDragStart = React.useCallback((params, event) => {
52
90
  if (props.disableColumnReorder || params.colDef.disableReorder) {
53
91
  return;
@@ -58,6 +96,11 @@ export const useGridColumnReorder = (apiRef, props) => {
58
96
  event.stopPropagation();
59
97
  dragColNode.current = event.currentTarget;
60
98
  dragColNode.current.classList.add(classes.columnHeaderDragging);
99
+ const handleDragEndEvent = dragEndEvent => {
100
+ dragColNode.current.removeEventListener('dragend', handleDragEndEvent);
101
+ apiRef.current.publishEvent('columnHeaderDragEndNative', params, dragEndEvent);
102
+ };
103
+ dragColNode.current.addEventListener('dragend', handleDragEndEvent);
61
104
  if (event.dataTransfer) {
62
105
  event.dataTransfer.effectAllowed = 'move';
63
106
  }
@@ -194,48 +237,10 @@ export const useGridColumnReorder = (apiRef, props) => {
194
237
  cursorPosition.current = coordinates;
195
238
  }
196
239
  }, [apiRef, logger, isRtl]);
197
- const handleDragEnd = React.useCallback((params, event) => {
198
- const dragColField = gridColumnReorderDragColSelector(apiRef);
199
- if (props.disableColumnReorder || !dragColField) {
200
- return;
201
- }
202
- logger.debug('End dragging col');
203
- event.preventDefault();
204
- // Prevent drag events propagation.
205
- // For more information check here https://github.com/mui/mui-x/issues/2680.
206
- event.stopPropagation();
207
- clearTimeout(removeDnDStylesTimeout.current);
208
-
209
- // For more information check here https://github.com/mui/mui-x/issues/14678
210
- if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
211
- dragColNode.current.classList.remove(classes.columnHeaderDragging);
212
- }
213
- dragColNode.current = null;
214
-
215
- // Check if the column was dropped outside the grid.
216
- if (event.dataTransfer.dropEffect === 'none' && !props.keepColumnPositionIfDraggedOutside) {
217
- // Accessing params.field may contain the wrong field as header elements are reused
218
- apiRef.current.setColumnIndex(dragColField, originColumnIndex.current);
219
- originColumnIndex.current = null;
220
- } else {
221
- // Emit the columnOrderChange event only once when the reordering stops.
222
- const columnOrderChangeParams = {
223
- column: apiRef.current.getColumn(dragColField),
224
- targetIndex: apiRef.current.getColumnIndexRelativeToVisibleColumns(dragColField),
225
- oldIndex: originColumnIndex.current
226
- };
227
- apiRef.current.publishEvent('columnOrderChange', columnOrderChangeParams);
228
- }
229
- apiRef.current.setState(state => _extends({}, state, {
230
- columnReorder: _extends({}, state.columnReorder, {
231
- dragCol: ''
232
- })
233
- }));
234
- }, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
235
240
  useGridEvent(apiRef, 'columnHeaderDragStart', handleDragStart);
236
241
  useGridEvent(apiRef, 'columnHeaderDragEnter', handleDragEnter);
237
242
  useGridEvent(apiRef, 'columnHeaderDragOver', handleDragOver);
238
- useGridEvent(apiRef, 'columnHeaderDragEnd', handleDragEnd);
243
+ useGridEvent(apiRef, 'columnHeaderDragEndNative', handleDragEnd);
239
244
  useGridEvent(apiRef, 'cellDragEnter', handleDragEnter);
240
245
  useGridEvent(apiRef, 'cellDragOver', handleDragOver);
241
246
  useGridEventPriority(apiRef, 'columnOrderChange', props.onColumnOrderChange);
@@ -32,6 +32,7 @@ export const useGridDataSourceLazyLoader = (privateApiRef, props) => {
32
32
  const previousLastRowIndex = React.useRef(0);
33
33
  const loadingTrigger = React.useRef(null);
34
34
  const rowsStale = React.useRef(false);
35
+ const draggedRowId = React.useRef(null);
35
36
  const fetchRows = React.useCallback(params => {
36
37
  privateApiRef.current.dataSource.fetchRows(GRID_ROOT_GROUP_ID, params);
37
38
  }, [privateApiRef]);
@@ -87,7 +88,6 @@ export const useGridDataSourceLazyLoader = (privateApiRef, props) => {
87
88
  }, [privateApiRef, resetGrid]);
88
89
  const addSkeletonRows = React.useCallback(() => {
89
90
  const tree = privateApiRef.current.state.rows.tree;
90
- const dataRowIdToModelLookup = privateApiRef.current.state.rows.dataRowIdToModelLookup;
91
91
  const rootGroup = tree[GRID_ROOT_GROUP_ID];
92
92
  const rootGroupChildren = [...rootGroup.children];
93
93
  const pageRowCount = privateApiRef.current.state.pagination.rowCount;
@@ -111,21 +111,20 @@ export const useGridDataSourceLazyLoader = (privateApiRef, props) => {
111
111
  break;
112
112
  }
113
113
  // replace the rows not in the viewport with skeleton rows
114
- if (pageToSkip.start <= i && i <= pageToSkip.end || tree[rootGroupChildren[i]]?.type === 'skeletonRow') {
114
+ if (pageToSkip.start <= i && i <= pageToSkip.end || tree[rootGroupChildren[i]]?.type === 'skeletonRow' ||
115
+ // ignore rows that are already skeleton rows
116
+ tree[rootGroupChildren[i]]?.id === draggedRowId.current // ignore row that is being dragged (https://github.com/mui/mui-x/issues/17854)
117
+ ) {
115
118
  continue;
116
119
  }
117
- const skeletonId = getSkeletonRowId(i); // to avoid duplicate keys on rebuild
118
- const removedRow = rootGroupChildren[i];
119
- rootGroupChildren[i] = skeletonId;
120
+ const rowId = tree[rootGroupChildren[i]].id; // keep the id, so that row related state is maintained
120
121
  const skeletonRowNode = {
121
122
  type: 'skeletonRow',
122
- id: skeletonId,
123
+ id: rowId,
123
124
  parent: GRID_ROOT_GROUP_ID,
124
125
  depth: 0
125
126
  };
126
- tree[skeletonId] = skeletonRowNode;
127
- delete tree[removedRow];
128
- delete dataRowIdToModelLookup[removedRow];
127
+ tree[rowId] = skeletonRowNode;
129
128
  hasChanged = true;
130
129
  }
131
130
 
@@ -153,8 +152,7 @@ export const useGridDataSourceLazyLoader = (privateApiRef, props) => {
153
152
  });
154
153
  privateApiRef.current.setState(state => _extends({}, state, {
155
154
  rows: _extends({}, state.rows, {
156
- tree,
157
- dataRowIdToModelLookup
155
+ tree
158
156
  })
159
157
  }), 'addSkeletonRows');
160
158
  }, [privateApiRef, adjustRowParams]);
@@ -341,6 +339,12 @@ export const useGridDataSourceLazyLoader = (privateApiRef, props) => {
341
339
  privateApiRef.current.setLoading(true);
342
340
  debouncedFetchRows(getRowsParams);
343
341
  }, [privateApiRef, debouncedFetchRows, throttledHandleRenderedRowsIntervalChange]);
342
+ const handleDragStart = React.useCallback(row => {
343
+ draggedRowId.current = row.id;
344
+ }, []);
345
+ const handleDragEnd = React.useCallback(() => {
346
+ draggedRowId.current = null;
347
+ }, []);
344
348
  const handleStrategyActivityChange = React.useCallback(() => {
345
349
  setLazyLoadingRowsUpdateStrategyActive(privateApiRef.current.getActiveStrategy(GridStrategyGroup.DataSource) === DataSourceRowsUpdateStrategy.LazyLoading);
346
350
  }, [privateApiRef]);
@@ -351,6 +355,8 @@ export const useGridDataSourceLazyLoader = (privateApiRef, props) => {
351
355
  useGridEvent(privateApiRef, 'renderedRowsIntervalChange', runIf(lazyLoadingRowsUpdateStrategyActive, throttledHandleRenderedRowsIntervalChange));
352
356
  useGridEvent(privateApiRef, 'sortModelChange', runIf(lazyLoadingRowsUpdateStrategyActive, handleGridSortModelChange));
353
357
  useGridEvent(privateApiRef, 'filterModelChange', runIf(lazyLoadingRowsUpdateStrategyActive, handleGridFilterModelChange));
358
+ useGridEvent(privateApiRef, 'rowDragStart', runIf(lazyLoadingRowsUpdateStrategyActive, handleDragStart));
359
+ useGridEvent(privateApiRef, 'rowDragEnd', runIf(lazyLoadingRowsUpdateStrategyActive, handleDragEnd));
354
360
  React.useEffect(() => {
355
361
  setStrategyAvailability();
356
362
  }, [setStrategyAvailability]);
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v8.3.1
2
+ * @mui/x-data-grid-pro v8.5.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -145,6 +145,7 @@ const useGridColumnHeaders = props => {
145
145
  })]
146
146
  });
147
147
  };
148
+ if (process.env.NODE_ENV !== "production") getColumnFiltersRow.displayName = "getColumnFiltersRow";
148
149
  return (0, _extends2.default)({}, otherProps, {
149
150
  getColumnFiltersRow
150
151
  });
@@ -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 {
@@ -57,6 +57,44 @@ const useGridColumnReorder = (apiRef, props) => {
57
57
  clearTimeout(removeDnDStylesTimeout.current);
58
58
  };
59
59
  }, []);
60
+ const handleDragEnd = React.useCallback((params, event) => {
61
+ const dragColField = (0, _columnReorderSelector.gridColumnReorderDragColSelector)(apiRef);
62
+ if (props.disableColumnReorder || !dragColField) {
63
+ return;
64
+ }
65
+ logger.debug('End dragging col');
66
+ event.preventDefault();
67
+ // Prevent drag events propagation.
68
+ // For more information check here https://github.com/mui/mui-x/issues/2680.
69
+ event.stopPropagation();
70
+ clearTimeout(removeDnDStylesTimeout.current);
71
+
72
+ // For more information check here https://github.com/mui/mui-x/issues/14678
73
+ if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
74
+ dragColNode.current.classList.remove(classes.columnHeaderDragging);
75
+ }
76
+ dragColNode.current = null;
77
+
78
+ // Check if the column was dropped outside the grid.
79
+ if (event.dataTransfer.dropEffect === 'none' && !props.keepColumnPositionIfDraggedOutside) {
80
+ // Accessing params.field may contain the wrong field as header elements are reused
81
+ apiRef.current.setColumnIndex(dragColField, originColumnIndex.current);
82
+ originColumnIndex.current = null;
83
+ } else {
84
+ // Emit the columnOrderChange event only once when the reordering stops.
85
+ const columnOrderChangeParams = {
86
+ column: apiRef.current.getColumn(dragColField),
87
+ targetIndex: apiRef.current.getColumnIndexRelativeToVisibleColumns(dragColField),
88
+ oldIndex: originColumnIndex.current
89
+ };
90
+ apiRef.current.publishEvent('columnOrderChange', columnOrderChangeParams);
91
+ }
92
+ apiRef.current.setState(state => (0, _extends2.default)({}, state, {
93
+ columnReorder: (0, _extends2.default)({}, state.columnReorder, {
94
+ dragCol: ''
95
+ })
96
+ }));
97
+ }, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
60
98
  const handleDragStart = React.useCallback((params, event) => {
61
99
  if (props.disableColumnReorder || params.colDef.disableReorder) {
62
100
  return;
@@ -67,6 +105,11 @@ const useGridColumnReorder = (apiRef, props) => {
67
105
  event.stopPropagation();
68
106
  dragColNode.current = event.currentTarget;
69
107
  dragColNode.current.classList.add(classes.columnHeaderDragging);
108
+ const handleDragEndEvent = dragEndEvent => {
109
+ dragColNode.current.removeEventListener('dragend', handleDragEndEvent);
110
+ apiRef.current.publishEvent('columnHeaderDragEndNative', params, dragEndEvent);
111
+ };
112
+ dragColNode.current.addEventListener('dragend', handleDragEndEvent);
70
113
  if (event.dataTransfer) {
71
114
  event.dataTransfer.effectAllowed = 'move';
72
115
  }
@@ -203,48 +246,10 @@ const useGridColumnReorder = (apiRef, props) => {
203
246
  cursorPosition.current = coordinates;
204
247
  }
205
248
  }, [apiRef, logger, isRtl]);
206
- const handleDragEnd = React.useCallback((params, event) => {
207
- const dragColField = (0, _columnReorderSelector.gridColumnReorderDragColSelector)(apiRef);
208
- if (props.disableColumnReorder || !dragColField) {
209
- return;
210
- }
211
- logger.debug('End dragging col');
212
- event.preventDefault();
213
- // Prevent drag events propagation.
214
- // For more information check here https://github.com/mui/mui-x/issues/2680.
215
- event.stopPropagation();
216
- clearTimeout(removeDnDStylesTimeout.current);
217
-
218
- // For more information check here https://github.com/mui/mui-x/issues/14678
219
- if (dragColNode.current.classList.contains(classes.columnHeaderDragging)) {
220
- dragColNode.current.classList.remove(classes.columnHeaderDragging);
221
- }
222
- dragColNode.current = null;
223
-
224
- // Check if the column was dropped outside the grid.
225
- if (event.dataTransfer.dropEffect === 'none' && !props.keepColumnPositionIfDraggedOutside) {
226
- // Accessing params.field may contain the wrong field as header elements are reused
227
- apiRef.current.setColumnIndex(dragColField, originColumnIndex.current);
228
- originColumnIndex.current = null;
229
- } else {
230
- // Emit the columnOrderChange event only once when the reordering stops.
231
- const columnOrderChangeParams = {
232
- column: apiRef.current.getColumn(dragColField),
233
- targetIndex: apiRef.current.getColumnIndexRelativeToVisibleColumns(dragColField),
234
- oldIndex: originColumnIndex.current
235
- };
236
- apiRef.current.publishEvent('columnOrderChange', columnOrderChangeParams);
237
- }
238
- apiRef.current.setState(state => (0, _extends2.default)({}, state, {
239
- columnReorder: (0, _extends2.default)({}, state.columnReorder, {
240
- dragCol: ''
241
- })
242
- }));
243
- }, [apiRef, props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, classes.columnHeaderDragging]);
244
249
  (0, _xDataGrid.useGridEvent)(apiRef, 'columnHeaderDragStart', handleDragStart);
245
250
  (0, _xDataGrid.useGridEvent)(apiRef, 'columnHeaderDragEnter', handleDragEnter);
246
251
  (0, _xDataGrid.useGridEvent)(apiRef, 'columnHeaderDragOver', handleDragOver);
247
- (0, _xDataGrid.useGridEvent)(apiRef, 'columnHeaderDragEnd', handleDragEnd);
252
+ (0, _xDataGrid.useGridEvent)(apiRef, 'columnHeaderDragEndNative', handleDragEnd);
248
253
  (0, _xDataGrid.useGridEvent)(apiRef, 'cellDragEnter', handleDragEnter);
249
254
  (0, _xDataGrid.useGridEvent)(apiRef, 'cellDragOver', handleDragOver);
250
255
  (0, _xDataGrid.useGridEventPriority)(apiRef, 'columnOrderChange', props.onColumnOrderChange);
@@ -40,6 +40,7 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
40
40
  const previousLastRowIndex = React.useRef(0);
41
41
  const loadingTrigger = React.useRef(null);
42
42
  const rowsStale = React.useRef(false);
43
+ const draggedRowId = React.useRef(null);
43
44
  const fetchRows = React.useCallback(params => {
44
45
  privateApiRef.current.dataSource.fetchRows(_xDataGrid.GRID_ROOT_GROUP_ID, params);
45
46
  }, [privateApiRef]);
@@ -95,7 +96,6 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
95
96
  }, [privateApiRef, resetGrid]);
96
97
  const addSkeletonRows = React.useCallback(() => {
97
98
  const tree = privateApiRef.current.state.rows.tree;
98
- const dataRowIdToModelLookup = privateApiRef.current.state.rows.dataRowIdToModelLookup;
99
99
  const rootGroup = tree[_xDataGrid.GRID_ROOT_GROUP_ID];
100
100
  const rootGroupChildren = [...rootGroup.children];
101
101
  const pageRowCount = privateApiRef.current.state.pagination.rowCount;
@@ -119,21 +119,20 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
119
119
  break;
120
120
  }
121
121
  // replace the rows not in the viewport with skeleton rows
122
- if (pageToSkip.start <= i && i <= pageToSkip.end || tree[rootGroupChildren[i]]?.type === 'skeletonRow') {
122
+ if (pageToSkip.start <= i && i <= pageToSkip.end || tree[rootGroupChildren[i]]?.type === 'skeletonRow' ||
123
+ // ignore rows that are already skeleton rows
124
+ tree[rootGroupChildren[i]]?.id === draggedRowId.current // ignore row that is being dragged (https://github.com/mui/mui-x/issues/17854)
125
+ ) {
123
126
  continue;
124
127
  }
125
- const skeletonId = getSkeletonRowId(i); // to avoid duplicate keys on rebuild
126
- const removedRow = rootGroupChildren[i];
127
- rootGroupChildren[i] = skeletonId;
128
+ const rowId = tree[rootGroupChildren[i]].id; // keep the id, so that row related state is maintained
128
129
  const skeletonRowNode = {
129
130
  type: 'skeletonRow',
130
- id: skeletonId,
131
+ id: rowId,
131
132
  parent: _xDataGrid.GRID_ROOT_GROUP_ID,
132
133
  depth: 0
133
134
  };
134
- tree[skeletonId] = skeletonRowNode;
135
- delete tree[removedRow];
136
- delete dataRowIdToModelLookup[removedRow];
135
+ tree[rowId] = skeletonRowNode;
137
136
  hasChanged = true;
138
137
  }
139
138
 
@@ -161,8 +160,7 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
161
160
  });
162
161
  privateApiRef.current.setState(state => (0, _extends2.default)({}, state, {
163
162
  rows: (0, _extends2.default)({}, state.rows, {
164
- tree,
165
- dataRowIdToModelLookup
163
+ tree
166
164
  })
167
165
  }), 'addSkeletonRows');
168
166
  }, [privateApiRef, adjustRowParams]);
@@ -349,6 +347,12 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
349
347
  privateApiRef.current.setLoading(true);
350
348
  debouncedFetchRows(getRowsParams);
351
349
  }, [privateApiRef, debouncedFetchRows, throttledHandleRenderedRowsIntervalChange]);
350
+ const handleDragStart = React.useCallback(row => {
351
+ draggedRowId.current = row.id;
352
+ }, []);
353
+ const handleDragEnd = React.useCallback(() => {
354
+ draggedRowId.current = null;
355
+ }, []);
352
356
  const handleStrategyActivityChange = React.useCallback(() => {
353
357
  setLazyLoadingRowsUpdateStrategyActive(privateApiRef.current.getActiveStrategy(_internals.GridStrategyGroup.DataSource) === _internals.DataSourceRowsUpdateStrategy.LazyLoading);
354
358
  }, [privateApiRef]);
@@ -359,6 +363,8 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
359
363
  (0, _xDataGrid.useGridEvent)(privateApiRef, 'renderedRowsIntervalChange', (0, _internals.runIf)(lazyLoadingRowsUpdateStrategyActive, throttledHandleRenderedRowsIntervalChange));
360
364
  (0, _xDataGrid.useGridEvent)(privateApiRef, 'sortModelChange', (0, _internals.runIf)(lazyLoadingRowsUpdateStrategyActive, handleGridSortModelChange));
361
365
  (0, _xDataGrid.useGridEvent)(privateApiRef, 'filterModelChange', (0, _internals.runIf)(lazyLoadingRowsUpdateStrategyActive, handleGridFilterModelChange));
366
+ (0, _xDataGrid.useGridEvent)(privateApiRef, 'rowDragStart', (0, _internals.runIf)(lazyLoadingRowsUpdateStrategyActive, handleDragStart));
367
+ (0, _xDataGrid.useGridEvent)(privateApiRef, 'rowDragEnd', (0, _internals.runIf)(lazyLoadingRowsUpdateStrategyActive, handleDragEnd));
362
368
  React.useEffect(() => {
363
369
  setStrategyAvailability();
364
370
  }, [setStrategyAvailability]);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v8.3.1
2
+ * @mui/x-data-grid-pro v8.5.0
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.3.1",
3
+ "version": "8.5.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Pro plan edition of the MUI X Data Grid components.",
6
6
  "main": "./index.js",
@@ -41,9 +41,9 @@
41
41
  "clsx": "^2.1.1",
42
42
  "prop-types": "^15.8.1",
43
43
  "reselect": "^5.1.1",
44
- "@mui/x-license": "8.3.1",
45
- "@mui/x-data-grid": "8.3.1",
46
- "@mui/x-internals": "8.3.1"
44
+ "@mui/x-internals": "8.5.0",
45
+ "@mui/x-license": "8.5.0",
46
+ "@mui/x-data-grid": "8.5.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@emotion/react": "^11.9.0",