@mui/x-data-grid-premium 8.8.0 → 8.9.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 (38) hide show
  1. package/CHANGELOG.md +101 -24
  2. package/DataGridPremium/DataGridPremium.js +1 -1
  3. package/DataGridPremium/useDataGridPremiumComponent.js +19 -7
  4. package/DataGridPremium/useDataGridPremiumProps.js +2 -1
  5. package/esm/DataGridPremium/DataGridPremium.js +1 -1
  6. package/esm/DataGridPremium/useDataGridPremiumComponent.js +21 -8
  7. package/esm/DataGridPremium/useDataGridPremiumProps.js +2 -1
  8. package/esm/hooks/features/aggregation/createAggregationLookup.d.ts +9 -4
  9. package/esm/hooks/features/aggregation/createAggregationLookup.js +78 -41
  10. package/esm/hooks/features/aggregation/gridAggregationFunctions.js +2 -2
  11. package/esm/hooks/features/aggregation/gridAggregationInterfaces.d.ts +13 -1
  12. package/esm/hooks/features/aggregation/gridAggregationUtils.d.ts +2 -1
  13. package/esm/hooks/features/aggregation/gridAggregationUtils.js +2 -1
  14. package/esm/hooks/features/aggregation/useGridAggregation.js +94 -18
  15. package/esm/hooks/features/pivoting/gridPivotingInterfaces.d.ts +12 -2
  16. package/esm/hooks/features/pivoting/useGridPivoting.d.ts +2 -1
  17. package/esm/hooks/features/pivoting/useGridPivoting.js +57 -35
  18. package/esm/hooks/features/pivoting/utils.d.ts +3 -1
  19. package/esm/hooks/features/pivoting/utils.js +22 -14
  20. package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -1
  21. package/esm/index.js +3 -3
  22. package/esm/typeOverloads/modules.d.ts +2 -1
  23. package/hooks/features/aggregation/createAggregationLookup.d.ts +9 -4
  24. package/hooks/features/aggregation/createAggregationLookup.js +79 -41
  25. package/hooks/features/aggregation/gridAggregationFunctions.js +2 -2
  26. package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +13 -1
  27. package/hooks/features/aggregation/gridAggregationUtils.d.ts +2 -1
  28. package/hooks/features/aggregation/gridAggregationUtils.js +4 -2
  29. package/hooks/features/aggregation/useGridAggregation.js +92 -16
  30. package/hooks/features/pivoting/gridPivotingInterfaces.d.ts +12 -2
  31. package/hooks/features/pivoting/useGridPivoting.d.ts +2 -1
  32. package/hooks/features/pivoting/useGridPivoting.js +60 -37
  33. package/hooks/features/pivoting/utils.d.ts +3 -1
  34. package/hooks/features/pivoting/utils.js +22 -14
  35. package/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -1
  36. package/index.js +3 -3
  37. package/package.json +4 -4
  38. package/typeOverloads/modules.d.ts +2 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,101 @@
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.9.0
9
+
10
+ _Jul 17, 2025_
11
+
12
+ We'd like to extend a big thank you to the 10 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - ✨ Improve the drag and drop interaction for Data Grid [row reordering](https://mui.com/x/react-data-grid/row-ordering/) feature. It uses a drop indicator to point to the position the row would be moving to.
15
+
16
+ https://github.com/user-attachments/assets/37284c4f-e8d4-4fc6-a6af-a780592905ef
17
+
18
+ - 🚀 Improve Data Grid Pivoting and Aggregation performance
19
+
20
+ - 📊 Add `minBarSize` to set a minimum height for bars
21
+
22
+ Special thanks go out to the community members for their valuable contributions:
23
+ @lauri865
24
+
25
+ The following are all team members who have contributed to this release:
26
+ @alexfauquette, @arminmeh, @bernardobelchior, @flaviendelangle, @JCQuintas, @LukasTy, @mapache-salvaje, @noraleonte, @MBilalShafi
27
+
28
+ ### Data Grid
29
+
30
+ #### `@mui/x-data-grid@8.9.0`
31
+
32
+ Internal changes.
33
+
34
+ #### `@mui/x-data-grid-pro@8.9.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
35
+
36
+ Same changes as in `@mui/x-data-grid@8.9.0`, plus:
37
+
38
+ - [DataGridPro] Row reorder using drop indicator (#18627) @MBilalShafi
39
+
40
+ #### `@mui/x-data-grid-premium@8.9.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.9.0`, plus:
43
+
44
+ - [DataGridPremium] Allow group column overrides with pivoting (#18765) @arminmeh
45
+ - [DataGridPremium] Support sort-dependent aggregation and improve performance (#18348) @lauri865
46
+
47
+ ### Date and Time Pickers
48
+
49
+ #### `@mui/x-date-pickers@8.9.0`
50
+
51
+ - [pickers] Avoid useless date creation in `AdapterDayjs` (#18429) @flaviendelangle
52
+ - [pickers] Fix `timeSteps` JSDoc (#18807) @LukasTy
53
+
54
+ #### `@mui/x-date-pickers-pro@8.9.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
55
+
56
+ Same changes as in `@mui/x-date-pickers@8.9.0`.
57
+
58
+ ### Charts
59
+
60
+ #### `@mui/x-charts@8.9.0`
61
+
62
+ - [charts] Add `minBarSize` to prevent bars from having 0 height (#18798) @JCQuintas
63
+ - [charts] Add click listener to radar charts (#18773) @alexfauquette
64
+ - [charts] Improve scatter chart pointer move performance (#18775) @bernardobelchior
65
+ - [charts] Simplify radar internal hooks (#18760) @alexfauquette
66
+ - [charts] `minBarSize` now ignores `0` and `null` values (#18816) @JCQuintas
67
+ - [charts] Fix y-axis tick label overlap when using log scale (#18744) @bernardobelchior
68
+ - [charts] Expose <ChartType>Series type for all chart types (#18805) @bernardobelchior
69
+
70
+ #### `@mui/x-charts-pro@8.9.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
71
+
72
+ Same changes as in `@mui/x-charts@8.9.0` plus:
73
+
74
+ [charts-pro] Fix issue where charts gestures weren't properly working when inside the shadow-dom (#18837) @JCQuintas
75
+
76
+ ### Tree View
77
+
78
+ #### `@mui/x-tree-view@8.9.0`
79
+
80
+ Internal changes.
81
+
82
+ #### `@mui/x-tree-view-pro@8.9.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
83
+
84
+ Same changes as in `@mui/x-tree-view@8.9.0`.
85
+
86
+ ### Codemod
87
+
88
+ #### `@mui/x-codemod@8.9.0`
89
+
90
+ Internal changes.
91
+
92
+ ### Docs
93
+
94
+ - [data grid][docs] Revise the Pro filter docs (#17929) @mapache-salvaje
95
+ - [charts][docs] Move mark outside clip-path (#18806) @alexfauquette
96
+
97
+ ### Miscellaneous
98
+
99
+ - [code-infra] Fix ESLint `import` restriction rule for test files (#18669) @LukasTy
100
+ - [code-infra] Remove charts benchmarks dependency on `@testing-library/jest-dom` (#18800) @bernardobelchior
101
+ - [code-infra] Remove duplicate dependency from `eslint-plugin-mui-x` (#18797) @bernardobelchior
102
+
8
103
  ## 8.8.0
9
104
 
10
105
  _Jul 11, 2025_
@@ -216,6 +311,7 @@ We'd like to extend a big thank you to the 12 contributors who made this release
216
311
  - 📅 Add `usePickerAdapter` hook to access the date adapter.
217
312
 
218
313
  You can use the adapter in your custom components if you need them to work with multiple date libraries — [Learn more](https://mui.com/x/react-date-pickers/custom-components/#access-date-adapter).
314
+
219
315
  - 🌎 Improve Danish (da-DK) locale
220
316
  - 🌎 Improve German (de-DE) locale
221
317
 
@@ -234,13 +330,13 @@ The following are all team members who have contributed to this release:
234
330
  - [l10n] Improve Danish (da-DK) locale (#18428) @ShahrazH
235
331
  - [l10n] Improve German (de-DE) locale (#18388) @omalyutin
236
332
 
237
- #### `@mui/x-data-grid-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
333
+ #### `@mui/x-data-grid-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
238
334
 
239
335
  Same changes as in `@mui/x-data-grid@8.6.0`, plus:
240
336
 
241
337
  - [DataGridPro] Fix lazy loading params calculated from rendering context (#18460) @arminmeh
242
338
 
243
- #### `@mui/x-data-grid-premium@8.6.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link "Premium plan")
339
+ #### `@mui/x-data-grid-premium@8.6.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
244
340
 
245
341
  Same changes as in `@mui/x-data-grid-pro@8.6.0`.
246
342
 
@@ -252,7 +348,7 @@ Same changes as in `@mui/x-data-grid-pro@8.6.0`.
252
348
  - [pickers] Fix to use latest `value` when updating `lastCommittedValue` in internal state (#18518) @LukasTy
253
349
  - [pickers] Use `usePickerAdapter` hook internally instead of `useUtils` (#18465) @LukasTy
254
350
 
255
- #### `@mui/x-date-pickers-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
351
+ #### `@mui/x-date-pickers-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
256
352
 
257
353
  Same changes as in `@mui/x-date-pickers@8.6.0`.
258
354
 
@@ -269,7 +365,7 @@ Same changes as in `@mui/x-date-pickers@8.6.0`.
269
365
  - [charts] Improve touch behavior for polar axis (#18531) @JCQuintas
270
366
  - [charts] Add `isElementInside` helper (#18530) @JCQuintas
271
367
 
272
- #### `@mui/x-charts-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
368
+ #### `@mui/x-charts-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
273
369
 
274
370
  Same changes as in `@mui/x-charts@8.6.0`, plus:
275
371
 
@@ -283,7 +379,7 @@ Same changes as in `@mui/x-charts@8.6.0`, plus:
283
379
 
284
380
  Internal changes.
285
381
 
286
- #### `@mui/x-tree-view-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
382
+ #### `@mui/x-tree-view-pro@8.6.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
287
383
 
288
384
  Same changes as in `@mui/x-tree-view@8.6.0`, plus:
289
385
 
@@ -1498,7 +1594,6 @@ Same changes as in `@mui/x-date-pickers@8.0.0-beta.3`.
1498
1594
 
1499
1595
  - Removed `react-spring` as a dependency of `@mui/x-charts`.
1500
1596
  A consequence of this change is that the props of some slots have been changed because the `SpringValue` wrapper has been removed. The affected slots and props are:
1501
-
1502
1597
  - the type of the `x`, `y`, `width` and `height` props of the `bar` slot are now `number`;
1503
1598
  - the type of `startAngle`, `endAngle`, `innerRadius`, `outerRadius`, `arcLabelRadius`, `cornerRadius` and `paddingAngle` props of `pieArc` and `pieArcLabel` slot are now `number`.
1504
1599
 
@@ -2066,7 +2161,6 @@ Following are all team members who have contributed to this release:
2066
2161
  - The `slots.baseFormControl` component was removed.
2067
2162
 
2068
2163
  - The "Reset" button in the column visibility panel now resets to the initial column visibility model. Previously it was reset to the model that was active at the time the panel was opened. The reset behavior follows these rules:
2069
-
2070
2164
  1. If an initial `columnVisibilityModel` is provided, it resets to that model.
2071
2165
  2. If a controlled `columnVisibilityModel` is provided, it resets to the first model value.
2072
2166
  3. When the columns are updated (via the `columns` prop or `updateColumns()` API method), the reset reference point updates to the current `columnVisibilityModel`.
@@ -2089,7 +2183,6 @@ Following are all team members who have contributed to this release:
2089
2183
  The `exclude` selection type allows to select all rows except the ones in the `ids` set.
2090
2184
 
2091
2185
  This change impacts the following props:
2092
-
2093
2186
  - `rowSelectionModel`
2094
2187
  - `onRowSelectionModelChange`
2095
2188
  - `initialState.rowSelectionModel`
@@ -2413,7 +2506,6 @@ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.12`, plus:
2413
2506
  - The `aria-label` on the `<Clock />` component and Time Picker opening button has been fixed to rely on the set `ampm` property instead of defaulting to the user's locale.
2414
2507
 
2415
2508
  - The following unused formats have been removed from the adapters and can no longer be overridden via the `dateFormats` prop on the `<LocalizationProvider />` component:
2416
-
2417
2509
  - `fullTime` - please use `fullTime12h` and `fullTime24h` instead:
2418
2510
  ```diff
2419
2511
  <LocalizationProvider
@@ -2628,7 +2720,6 @@ Following are all team members who have contributed to this release:
2628
2720
 
2629
2721
  - `viewportInnerSize.width` now includes pinned columns' widths (fixes recursive loops in updating dimensions <-> columns)
2630
2722
  - The Data Grid now has a default background color, and its customization has moved from `theme.mixins.MuiDataGrid` to `theme.palette.DataGrid` with the following properties:
2631
-
2632
2723
  - `bg`: Sets the background color of the entire grid (new property)
2633
2724
  - `headerBg`: Sets the background color of the header (previously named `containerBackground`)
2634
2725
  - `pinnedBg`: Sets the background color of pinned rows and columns (previously named `pinnedBackground`)
@@ -2657,7 +2748,6 @@ Following are all team members who have contributed to this release:
2657
2748
  Only the initial value and the type are updated. Logic that initializes the API and its availability remained the same, which means that if you could access API in a particular line of your code before, you are able to access it as well after this change.
2658
2749
 
2659
2750
  Depending on the context in which the API is being used, you can decide what is the best way to deal with `null` value. Some options are:
2660
-
2661
2751
  - Use optional chaining
2662
2752
  - Use non-null assertion operator if you are sure your code is always executed when the `apiRef` is not `null`
2663
2753
  - Return early if `apiRef` is `null`
@@ -3181,7 +3271,6 @@ Following are all team members who have contributed to this release:
3181
3271
  #### Breaking changes
3182
3272
 
3183
3273
  - Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`:
3184
-
3185
3274
  - For `.root` element, use `slotProps.root`.
3186
3275
  - For `.main` element (the one with `role="grid"`), use `slotProps.main`.
3187
3276
 
@@ -3698,14 +3787,12 @@ Same changes as in `@mui/x-date-pickers@v8.0.0-alpha.1`, plus:
3698
3787
  #### Breaking change
3699
3788
 
3700
3789
  - The DX of the Tooltip customization has been refactored
3701
-
3702
3790
  - The `tooltip` prop has been removed in favor of `slotProps.tooltip` for consistency.
3703
3791
  - The `popper`, `axisContent`, and `itemContent` slots have been removed in favor of the `tooltip` slot which overrides the entire tooltip.
3704
3792
  - To override the tooltip content, use the `useItemTooltip` or `useAxisTooltip` hook to get the data, and wrap your component in `ChartsTooltipContainer` to follow the pointer position.
3705
3793
  - To override the tooltip placement, use the `ChartsItemTooltipContent` or `ChartsItemTooltipContent` to get default data and place them in your custom tooltip.
3706
3794
 
3707
3795
  - The library now uses the SVG `filter` attribute instead of `d3-color` for color manipulation.
3708
-
3709
3796
  - This modification impacts the `LinePlot`, `AreaPlot`, and `BarPlot` components.
3710
3797
  If you've customized the `fill` of those elements, you might need to override it by using the CSS `filter`.
3711
3798
  - The `theme.styleOverride` is removed for `MuiLineElement`, `MuiAreaElement`, and `MuiBarElement` to improve performance.
@@ -3815,14 +3902,12 @@ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.0`, plus:
3815
3902
  #### Breaking changes
3816
3903
 
3817
3904
  - The default DOM structure of the field has changed [Learn more](https://mui.com/x/migration/migration-pickers-v7/#new-dom-structure-for-the-field).
3818
-
3819
3905
  - Before version `v8.x`, the fields' DOM structure consisted of an `<input />`, which held the whole value for the component, but unfortunately presents a few limitations in terms of accessibility when managing multiple section values.
3820
3906
  - Starting with version `v8.x`, all the field and picker components come with a new DOM structure that allows the field component to set aria attributes on individual sections, providing a far better experience with screen readers.
3821
3907
 
3822
3908
  - Some translation keys no longer require `utils` and the date object as parameters, but only the formatted value as a string. The keys affected by this changes are: `clockLabelText`, `openDatePickerDialogue` and `openTimePickerDialogue` — [Learn more](https://mui.com/x/migration/migration-pickers-v7/#stop-passing-utils-and-the-date-object-to-some-translation-keys).
3823
3909
 
3824
3910
  - The following types are no longer exported by `@mui/x-date-pickers` and `@mui/x-date-pickers-pro` — [Learn more](https://mui.com/x/migration/migration-pickers-v7/#removed-types).
3825
-
3826
3911
  - `UseDateFieldComponentProps`
3827
3912
  - `UseTimeFieldComponentProps`
3828
3913
  - `UseDateTimeFieldComponentProps`
@@ -3870,7 +3955,6 @@ Same changes as in `@mui/x-date-pickers@8.0.0-alpha.0`.
3870
3955
  - The `slots.legend` does not receive the `drawingArea` prop. You can still access your custom legend with the `useDrawingArea()` hook if your custom legend needs it.
3871
3956
 
3872
3957
  - Removed or renamed multiple props from Series — [Learn more](https://mui.com/x/migration/migration-charts-v7/#series-properties-renaming).
3873
-
3874
3958
  - The `highlighted` and `faded` properties of highlightScope have been deprecated in favor of `highlight` and `fade`.
3875
3959
  The deprecated ones are now removed.
3876
3960
  - The `xAxisKey`, `yAxisKey`, and `zAxisKey` properties have been deprecated in favor of `xAxisId`, `yAxisId`, and `zAxisId`.
@@ -6134,7 +6218,6 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
6134
6218
  <img width="287" src="https://github.com/user-attachments/assets/78bd83c5-7ce4-4ed7-acf9-be70b2dbce54" alt="Item reordering using drag and drop" />
6135
6219
 
6136
6220
  - 📦 Support CommonJS bundle out of the box on `@mui/x-charts` by adding vendored D3 dependencies.
6137
-
6138
6221
  - This modifies how the package imports D3.js. It will impact you if you use `d3` packages installed by `@mui/x-charts` and don't have them in your `package.json`. You shouldn't be affected otherwise.
6139
6222
  - For more context, the initial issue is caused by D3 only exporting ESM.
6140
6223
 
@@ -7669,7 +7752,6 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
7669
7752
  #### Breaking changes
7670
7753
 
7671
7754
  - The `density` is a [controlled prop](https://mui.com/x/react-data-grid/accessibility/#set-the-density-programmatically) now, if you were previously passing the `density` prop to the Data Grid, you will need to do one of the following:
7672
-
7673
7755
  1. Move it to the `initialState.density` to initialize it.
7674
7756
 
7675
7757
  ```diff
@@ -8175,7 +8257,6 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
8175
8257
  ```
8176
8258
 
8177
8259
  - The following internal types were exported by mistake and have been removed from the public API:
8178
-
8179
8260
  - `UseDateFieldDefaultizedProps`
8180
8261
  - `UseTimeFieldDefaultizedProps`
8181
8262
  - `UseDateTimeFieldDefaultizedProps`
@@ -8416,7 +8497,6 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
8416
8497
  - 🎁 The Line Chart component now has animation by default (#11620) @alexfauquette
8417
8498
  - 🚀 All charts have click handlers (#11411) @alexfauquette
8418
8499
  Test their respective documentation demonstrations to know more about the data format:
8419
-
8420
8500
  - [Scatter Chart](https://v7.mui.com/x/react-charts/scatter/#click-event)
8421
8501
  - [Line Chart](https://v7.mui.com/x/react-charts/lines/#click-event)
8422
8502
  - [Bar Chart](https://v7.mui.com/x/react-charts/bars/#click-event)
@@ -8696,7 +8776,6 @@ We'd like to offer a big thanks to the 11 contributors who made this release pos
8696
8776
  ```
8697
8777
 
8698
8778
  The most notable changes that might affect your application or tests are:
8699
-
8700
8779
  - The `role="grid"` attribute along with related ARIA attributes are now applied to the inner `div` element instead of the root `div` element:
8701
8780
 
8702
8781
  ```diff
@@ -9247,7 +9326,6 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
9247
9326
 
9248
9327
  - The filter panel no longer uses the native version of the [`Select`](https://mui.com/material-ui/react-select/) component for all components.
9249
9328
  - The `getOptionValue` and `getOptionLabel` props were removed from the following components:
9250
-
9251
9329
  - `GridEditSingleSelectCell`
9252
9330
  - `GridFilterInputSingleSelect`
9253
9331
  - `GridFilterInputMultipleSingleSelect`
@@ -9661,7 +9739,6 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.3`, plus:
9661
9739
  - Add new parameters to the `shortcuts` slot `onChange` callback
9662
9740
 
9663
9741
  The `onChange` callback fired when selecting a shortcut now requires two new parameters (previously they were optional):
9664
-
9665
9742
  - The [`changeImportance`](/x/react-date-pickers/shortcuts/#behavior-when-selecting-a-shortcut) of the shortcut.
9666
9743
  - The `item` containing the entire shortcut object.
9667
9744
 
@@ -40,7 +40,7 @@ const configuration = {
40
40
  }
41
41
  }
42
42
  };
43
- const releaseInfo = "MTc1MjE4NDgwMDAwMA==";
43
+ const releaseInfo = "MTc1Mjc4OTYwMDAwMA==";
44
44
  const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
45
45
  packageName: "x-data-grid-premium",
46
46
  releaseInfo: releaseInfo
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
@@ -28,11 +29,16 @@ const useDataGridPremiumComponent = (apiRef, inProps) => {
28
29
  const pivotPropsOverrides = (0, _xDataGridPro.useGridSelector)(apiRef, _gridPivotingSelectors.gridPivotPropsOverridesSelector);
29
30
  const props = React.useMemo(() => {
30
31
  if (pivotPropsOverrides) {
31
- return (0, _extends2.default)({}, inProps, pivotPropsOverrides);
32
+ return (0, _extends2.default)({}, inProps, pivotPropsOverrides, {
33
+ initialState: (0, _extends2.default)({}, inProps.initialState, {
34
+ columns: undefined
35
+ })
36
+ });
32
37
  }
33
38
  return inProps;
34
39
  }, [inProps, pivotPropsOverrides]);
35
40
  (0, _internals.useGridInitialization)(apiRef, props);
41
+ const key = pivotPropsOverrides ? 'pivoting' : undefined;
36
42
 
37
43
  /**
38
44
  * Register all pre-processors called during state initialization here.
@@ -60,14 +66,14 @@ const useDataGridPremiumComponent = (apiRef, inProps) => {
60
66
  * Register all state initializers here.
61
67
  */
62
68
  (0, _internals.useGridInitializeState)(_internals.propsStateInitializer, apiRef, props);
63
- (0, _internals.useGridInitializeState)(_internals.headerFilteringStateInitializer, apiRef, props);
64
- (0, _internals.useGridInitializeState)(_useGridRowGrouping.rowGroupingStateInitializer, apiRef, props);
65
- (0, _internals.useGridInitializeState)(_useGridAggregation.aggregationStateInitializer, apiRef, props);
69
+ (0, _internals.useGridInitializeState)(_internals.headerFilteringStateInitializer, apiRef, props, key);
70
+ (0, _internals.useGridInitializeState)(_useGridRowGrouping.rowGroupingStateInitializer, apiRef, props, key);
71
+ (0, _internals.useGridInitializeState)(_useGridAggregation.aggregationStateInitializer, apiRef, props, key);
66
72
  (0, _internals.useGridInitializeState)(_internals.rowSelectionStateInitializer, apiRef, props);
67
73
  (0, _internals.useGridInitializeState)(_useGridCellSelection.cellSelectionStateInitializer, apiRef, props);
68
74
  (0, _internals.useGridInitializeState)(_internals.detailPanelStateInitializer, apiRef, props);
69
- (0, _internals.useGridInitializeState)(_internals.columnPinningStateInitializer, apiRef, props);
70
- (0, _internals.useGridInitializeState)(_internals.columnsStateInitializer, apiRef, props);
75
+ (0, _internals.useGridInitializeState)(_internals.columnPinningStateInitializer, apiRef, props, key);
76
+ (0, _internals.useGridInitializeState)(_internals.columnsStateInitializer, apiRef, props, key);
71
77
  (0, _internals.useGridInitializeState)(_useGridPivoting.pivotingStateInitializer, apiRef, props);
72
78
  (0, _internals.useGridInitializeState)(_internals.rowPinningStateInitializer, apiRef, props);
73
79
  (0, _internals.useGridInitializeState)(_internals.rowsStateInitializer, apiRef, props);
@@ -82,7 +88,7 @@ const useDataGridPremiumComponent = (apiRef, inProps) => {
82
88
  (0, _internals.useGridInitializeState)(_internals.columnReorderStateInitializer, apiRef, props);
83
89
  (0, _internals.useGridInitializeState)(_internals.columnResizeStateInitializer, apiRef, props);
84
90
  (0, _internals.useGridInitializeState)(_internals.columnMenuStateInitializer, apiRef, props);
85
- (0, _internals.useGridInitializeState)(_internals.columnGroupsStateInitializer, apiRef, props);
91
+ (0, _internals.useGridInitializeState)(_internals.columnGroupsStateInitializer, apiRef, props, key);
86
92
  (0, _internals.useGridInitializeState)(_internals.virtualizationStateInitializer, apiRef, props);
87
93
  (0, _internals.useGridInitializeState)(_internals.dataSourceStateInitializer, apiRef, props);
88
94
  (0, _internals.useGridInitializeState)(_internals.dimensionsStateInitializer, apiRef, props);
@@ -135,6 +141,12 @@ const useDataGridPremiumComponent = (apiRef, inProps) => {
135
141
  (0, _internals.useGridVirtualization)(apiRef, props);
136
142
  (0, _internals.useGridListView)(apiRef, props);
137
143
  (0, _useGridAiAssistant.useGridAiAssistant)(apiRef, props);
144
+ (0, _useGridPivoting.useGridPivotingExportState)(apiRef);
145
+
146
+ // Should be the last thing to run, because all pre-processors should have been registered by now.
147
+ React.useEffect(() => {
148
+ apiRef.current.runAppliersForPendingProcessors();
149
+ });
138
150
  return props;
139
151
  };
140
152
  exports.useDataGridPremiumComponent = useDataGridPremiumComponent;
@@ -15,6 +15,7 @@ var _internals = require("@mui/x-data-grid-pro/internals");
15
15
  var _aggregation = require("../hooks/features/aggregation");
16
16
  var _dataGridPremiumDefaultSlotsComponents = require("../constants/dataGridPremiumDefaultSlotsComponents");
17
17
  var _utils = require("../hooks/features/pivoting/utils");
18
+ var _gridAggregationUtils = require("../hooks/features/aggregation/gridAggregationUtils");
18
19
  const getDataGridPremiumForcedProps = themedProps => (0, _extends2.default)({
19
20
  signature: _xDataGridPro.GridSignature.DataGridPremium
20
21
  }, themedProps.dataSource ? {
@@ -33,7 +34,7 @@ const DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PREMIUM_PROPS_D
33
34
  rowGroupingColumnMode: 'single',
34
35
  aggregationFunctions: _aggregation.GRID_AGGREGATION_FUNCTIONS,
35
36
  aggregationRowsScope: 'filtered',
36
- getAggregationPosition: groupNode => groupNode.depth === -1 ? 'footer' : 'inline',
37
+ getAggregationPosition: _gridAggregationUtils.defaultGetAggregationPosition,
37
38
  disableClipboardPaste: false,
38
39
  splitClipboardPastedText: (pastedText, delimiter = '\t') => {
39
40
  // Excel on Windows adds an empty line break at the end of the copied text.
@@ -33,7 +33,7 @@ const configuration = {
33
33
  }
34
34
  }
35
35
  };
36
- const releaseInfo = "MTc1MjE4NDgwMDAwMA==";
36
+ const releaseInfo = "MTc1Mjc4OTYwMDAwMA==";
37
37
  const watermark = /*#__PURE__*/_jsx(Watermark, {
38
38
  packageName: "x-data-grid-premium",
39
39
  releaseInfo: releaseInfo
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing, editingStateInitializer, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridRowSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, dimensionsStateInitializer, useGridDimensions, useGridStatePersistence, useGridRowSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, rowSelectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors, useGridDataSourceLazyLoader, useGridInfiniteLoadingIntersection, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer, propsStateInitializer } from '@mui/x-data-grid-pro/internals';
@@ -12,18 +14,23 @@ import { useGridDataSourceRowGroupingPreProcessors } from "../hooks/features/row
12
14
  import { useGridExcelExport } from "../hooks/features/export/useGridExcelExport.js";
13
15
  import { cellSelectionStateInitializer, useGridCellSelection } from "../hooks/features/cellSelection/useGridCellSelection.js";
14
16
  import { useGridClipboardImport } from "../hooks/features/clipboard/useGridClipboardImport.js";
15
- import { pivotingStateInitializer, useGridPivoting } from "../hooks/features/pivoting/useGridPivoting.js";
17
+ import { pivotingStateInitializer, useGridPivoting, useGridPivotingExportState } from "../hooks/features/pivoting/useGridPivoting.js";
16
18
  import { gridPivotPropsOverridesSelector } from "../hooks/features/pivoting/gridPivotingSelectors.js";
17
19
  import { useGridAiAssistant, aiAssistantStateInitializer } from "../hooks/features/aiAssistant/useGridAiAssistant.js";
18
20
  export const useDataGridPremiumComponent = (apiRef, inProps) => {
19
21
  const pivotPropsOverrides = useGridSelector(apiRef, gridPivotPropsOverridesSelector);
20
22
  const props = React.useMemo(() => {
21
23
  if (pivotPropsOverrides) {
22
- return _extends({}, inProps, pivotPropsOverrides);
24
+ return _extends({}, inProps, pivotPropsOverrides, {
25
+ initialState: _extends({}, inProps.initialState, {
26
+ columns: undefined
27
+ })
28
+ });
23
29
  }
24
30
  return inProps;
25
31
  }, [inProps, pivotPropsOverrides]);
26
32
  useGridInitialization(apiRef, props);
33
+ const key = pivotPropsOverrides ? 'pivoting' : undefined;
27
34
 
28
35
  /**
29
36
  * Register all pre-processors called during state initialization here.
@@ -51,14 +58,14 @@ export const useDataGridPremiumComponent = (apiRef, inProps) => {
51
58
  * Register all state initializers here.
52
59
  */
53
60
  useGridInitializeState(propsStateInitializer, apiRef, props);
54
- useGridInitializeState(headerFilteringStateInitializer, apiRef, props);
55
- useGridInitializeState(rowGroupingStateInitializer, apiRef, props);
56
- useGridInitializeState(aggregationStateInitializer, apiRef, props);
61
+ useGridInitializeState(headerFilteringStateInitializer, apiRef, props, key);
62
+ useGridInitializeState(rowGroupingStateInitializer, apiRef, props, key);
63
+ useGridInitializeState(aggregationStateInitializer, apiRef, props, key);
57
64
  useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
58
65
  useGridInitializeState(cellSelectionStateInitializer, apiRef, props);
59
66
  useGridInitializeState(detailPanelStateInitializer, apiRef, props);
60
- useGridInitializeState(columnPinningStateInitializer, apiRef, props);
61
- useGridInitializeState(columnsStateInitializer, apiRef, props);
67
+ useGridInitializeState(columnPinningStateInitializer, apiRef, props, key);
68
+ useGridInitializeState(columnsStateInitializer, apiRef, props, key);
62
69
  useGridInitializeState(pivotingStateInitializer, apiRef, props);
63
70
  useGridInitializeState(rowPinningStateInitializer, apiRef, props);
64
71
  useGridInitializeState(rowsStateInitializer, apiRef, props);
@@ -73,7 +80,7 @@ export const useDataGridPremiumComponent = (apiRef, inProps) => {
73
80
  useGridInitializeState(columnReorderStateInitializer, apiRef, props);
74
81
  useGridInitializeState(columnResizeStateInitializer, apiRef, props);
75
82
  useGridInitializeState(columnMenuStateInitializer, apiRef, props);
76
- useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
83
+ useGridInitializeState(columnGroupsStateInitializer, apiRef, props, key);
77
84
  useGridInitializeState(virtualizationStateInitializer, apiRef, props);
78
85
  useGridInitializeState(dataSourceStateInitializer, apiRef, props);
79
86
  useGridInitializeState(dimensionsStateInitializer, apiRef, props);
@@ -126,5 +133,11 @@ export const useDataGridPremiumComponent = (apiRef, inProps) => {
126
133
  useGridVirtualization(apiRef, props);
127
134
  useGridListView(apiRef, props);
128
135
  useGridAiAssistant(apiRef, props);
136
+ useGridPivotingExportState(apiRef);
137
+
138
+ // Should be the last thing to run, because all pre-processors should have been registered by now.
139
+ React.useEffect(() => {
140
+ apiRef.current.runAppliersForPendingProcessors();
141
+ });
129
142
  return props;
130
143
  };
@@ -7,6 +7,7 @@ import { computeSlots } from '@mui/x-data-grid-pro/internals';
7
7
  import { GRID_AGGREGATION_FUNCTIONS } from "../hooks/features/aggregation/index.js";
8
8
  import { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS } from "../constants/dataGridPremiumDefaultSlotsComponents.js";
9
9
  import { defaultGetPivotDerivedColumns } from "../hooks/features/pivoting/utils.js";
10
+ import { defaultGetAggregationPosition } from "../hooks/features/aggregation/gridAggregationUtils.js";
10
11
  const getDataGridPremiumForcedProps = themedProps => _extends({
11
12
  signature: GridSignature.DataGridPremium
12
13
  }, themedProps.dataSource ? {
@@ -25,7 +26,7 @@ export const DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PRO
25
26
  rowGroupingColumnMode: 'single',
26
27
  aggregationFunctions: GRID_AGGREGATION_FUNCTIONS,
27
28
  aggregationRowsScope: 'filtered',
28
- getAggregationPosition: groupNode => groupNode.depth === -1 ? 'footer' : 'inline',
29
+ getAggregationPosition: defaultGetAggregationPosition,
29
30
  disableClipboardPaste: false,
30
31
  splitClipboardPastedText: (pastedText, delimiter = '\t') => {
31
32
  // Excel on Windows adds an empty line break at the end of the copied text.
@@ -1,17 +1,22 @@
1
1
  import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
3
3
  import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
4
- import { GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationLookup } from "./gridAggregationInterfaces.js";
4
+ import { GridAggregationLookup, GridAggregationRules } from "./gridAggregationInterfaces.js";
5
+ export declare const shouldApplySorting: (aggregationRules: GridAggregationRules, aggregatedFields: string[]) => boolean;
5
6
  export declare const createAggregationLookup: ({
6
7
  apiRef,
7
- aggregationFunctions,
8
+ aggregationRules,
9
+ aggregatedFields,
8
10
  aggregationRowsScope,
9
11
  getAggregationPosition,
10
- isDataSource
12
+ isDataSource,
13
+ applySorting
11
14
  }: {
12
15
  apiRef: RefObject<GridPrivateApiPremium>;
13
- aggregationFunctions: Record<string, GridAggregationFunction> | Record<string, GridAggregationFunctionDataSource>;
16
+ aggregationRules: GridAggregationRules;
17
+ aggregatedFields: string[];
14
18
  aggregationRowsScope: DataGridPremiumProcessedProps["aggregationRowsScope"];
15
19
  getAggregationPosition: DataGridPremiumProcessedProps["getAggregationPosition"];
16
20
  isDataSource: boolean;
21
+ applySorting: boolean;
17
22
  }) => GridAggregationLookup;