@mui/x-data-grid-premium 8.0.0-alpha.5 → 8.0.0-alpha.7

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 (71) hide show
  1. package/CHANGELOG.md +206 -1
  2. package/DataGridPremium/DataGridPremium.js +6 -4
  3. package/DataGridPremium/useDataGridPremiumComponent.d.ts +1 -1
  4. package/DataGridPremium/useDataGridPremiumComponent.js +2 -1
  5. package/DataGridPremium/useDataGridPremiumProps.js +3 -1
  6. package/components/GridColumnMenuAggregationItem.js +53 -20
  7. package/components/GridDataSourceGroupingCriteriaCell.js +1 -2
  8. package/components/GridPremiumColumnMenu.d.ts +1 -1
  9. package/components/GridPremiumColumnMenu.js +5 -5
  10. package/esm/DataGridPremium/DataGridPremium.js +6 -4
  11. package/esm/DataGridPremium/useDataGridPremiumComponent.js +3 -2
  12. package/esm/DataGridPremium/useDataGridPremiumProps.js +3 -1
  13. package/esm/components/GridColumnMenuAggregationItem.js +51 -18
  14. package/esm/components/GridDataSourceGroupingCriteriaCell.js +1 -2
  15. package/esm/components/GridPremiumColumnMenu.js +5 -5
  16. package/esm/hooks/features/aggregation/createAggregationLookup.js +52 -55
  17. package/esm/hooks/features/aggregation/gridAggregationUtils.js +17 -13
  18. package/esm/hooks/features/aggregation/index.js +0 -1
  19. package/esm/hooks/features/aggregation/useGridAggregation.js +22 -10
  20. package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +7 -14
  21. package/esm/hooks/features/cellSelection/useGridCellSelection.js +3 -3
  22. package/esm/hooks/features/dataSource/cache.js +3 -0
  23. package/esm/hooks/features/dataSource/models.js +1 -0
  24. package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +53 -0
  25. package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
  26. package/esm/utils/releaseInfo.js +1 -1
  27. package/hooks/features/aggregation/createAggregationLookup.d.ts +6 -5
  28. package/hooks/features/aggregation/createAggregationLookup.js +52 -55
  29. package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +18 -5
  30. package/hooks/features/aggregation/gridAggregationUtils.d.ts +9 -10
  31. package/hooks/features/aggregation/gridAggregationUtils.js +17 -13
  32. package/hooks/features/aggregation/index.d.ts +1 -1
  33. package/hooks/features/aggregation/index.js +0 -12
  34. package/hooks/features/aggregation/useGridAggregation.d.ts +1 -1
  35. package/hooks/features/aggregation/useGridAggregation.js +22 -10
  36. package/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +1 -1
  37. package/hooks/features/aggregation/useGridAggregationPreProcessors.js +7 -14
  38. package/hooks/features/cellSelection/useGridCellSelection.d.ts +1 -1
  39. package/hooks/features/cellSelection/useGridCellSelection.js +3 -3
  40. package/hooks/features/dataSource/cache.d.ts +2 -0
  41. package/hooks/features/dataSource/cache.js +9 -0
  42. package/hooks/features/dataSource/models.d.ts +47 -0
  43. package/hooks/features/dataSource/models.js +5 -0
  44. package/hooks/features/dataSource/useGridDataSourcePremium.d.ts +4 -0
  45. package/hooks/features/dataSource/useGridDataSourcePremium.js +62 -0
  46. package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
  47. package/hooks/utils/useGridApiRef.d.ts +1 -1
  48. package/index.d.ts +2 -0
  49. package/index.js +1 -1
  50. package/models/dataGridPremiumProps.d.ts +6 -4
  51. package/models/gridApiPremium.d.ts +5 -3
  52. package/modern/DataGridPremium/DataGridPremium.js +6 -4
  53. package/modern/DataGridPremium/useDataGridPremiumComponent.js +3 -2
  54. package/modern/DataGridPremium/useDataGridPremiumProps.js +3 -1
  55. package/modern/components/GridColumnMenuAggregationItem.js +51 -18
  56. package/modern/components/GridDataSourceGroupingCriteriaCell.js +1 -2
  57. package/modern/components/GridPremiumColumnMenu.js +5 -5
  58. package/modern/hooks/features/aggregation/createAggregationLookup.js +52 -55
  59. package/modern/hooks/features/aggregation/gridAggregationUtils.js +17 -13
  60. package/modern/hooks/features/aggregation/index.js +0 -1
  61. package/modern/hooks/features/aggregation/useGridAggregation.js +22 -10
  62. package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +7 -14
  63. package/modern/hooks/features/cellSelection/useGridCellSelection.js +3 -3
  64. package/modern/hooks/features/dataSource/cache.js +3 -0
  65. package/modern/hooks/features/dataSource/models.js +1 -0
  66. package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +53 -0
  67. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
  68. package/modern/index.js +1 -1
  69. package/modern/utils/releaseInfo.js +1 -1
  70. package/package.json +5 -5
  71. package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,211 @@
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.0.0-alpha.7
9
+
10
+ _Jan 9, 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
+ - 📊 Charts legend is now an HTML element which can be styled more easily
15
+ - 💫 Support [aggregation with server-side data](/x/react-data-grid/server-side-data/aggregation/)
16
+ - 🏎️ Improve Data Grid aggregation performance
17
+ - 🌍 Add Chinese (Taiwan) (zh-TW) locale on the Date and Time Pickers
18
+ - 🌍 Improve Norwegian (nb-NO) locale on the Date and Time Pickers
19
+ - 🐞 Bugfixes
20
+
21
+ Special thanks go out to the community contributors who have helped make this release possible:
22
+ @derek-0000, @josteinjhauge, @k-rajat19, @nusr, @tomashauser.
23
+ Following are all team members who have contributed to this release:
24
+ @cherniavskii, @flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @arminmeh, @romgrk, @oliviertassinari.
25
+
26
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
27
+
28
+ ### Data Grid
29
+
30
+ #### `@mui/x-data-grid@8.0.0-alpha.7`
31
+
32
+ - [DataGrid] Improve React 19 support (#15769) @LukasTy
33
+ - [DataGrid] Add `name` attribute to the checkbox selection column (#15178) @derek-0000
34
+ - [DataGrid] Fix number filter field formatting values while typing (#16062) @arminmeh
35
+ - [DataGrid] Fix select all checkbox state reset with server side data (#16034) @MBilalShafi
36
+ - [DataGrid] Refactor: create base button props (#15930) @romgrk
37
+ - [DataGrid] Refactor: create tooltip props (#16086) @romgrk
38
+ - [DataGrid] Fix TS error (#16046) @cherniavskii
39
+
40
+ #### `@mui/x-data-grid-pro@8.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-data-grid@8.0.0-alpha.7`.
43
+
44
+ #### `@mui/x-data-grid-premium@8.0.0-alpha.7` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
45
+
46
+ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.7`, plus:
47
+
48
+ - [DataGridPremium] Improve aggregation performance for multiple columns (#16097) @cherniavskii
49
+ - [DataGridPremium] Make Aggregation keyboard accessible in the column menu (#15934) @k-rajat19
50
+ - [DataGridPremium] Server-side aggregation with data source (#15741) @MBilalShafi
51
+
52
+ ### Date and Time Pickers
53
+
54
+ #### Breaking changes
55
+
56
+ - The `date-fns` and `date-fns-jalali` date library adapters have been renamed to better align with the current stable major versions — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#✅-rename-date-fns-adapter-imports)
57
+ - Update default `closeOnSelect` and Action Bar `actions` values - [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#update-default-closeonselect-and-action-bar-actions-values)
58
+ - The component passed to the `layout` slot no longer receives the `value`, `onChange` and `onSelectShortcut` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
59
+ - The component passed to the `toolbar` slot no longer receives the `value`, `onChange` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
60
+ - The component passed to the `shortcuts` slot no longer receives the `onChange`, `isValid` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-shortcuts).
61
+ - The `PickerShortcutChangeImportance` type has been renamed `PickerChangeImportance` — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#renamed-variables-and-types).
62
+ - The component passed to the `layout` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
63
+ - The component passed to the `toolbar` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
64
+ - The component passed to the `tabs` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-tabs).
65
+
66
+ #### `@mui/x-date-pickers@8.0.0-alpha.7`
67
+
68
+ - [fields] Handle focusing container with `inputRef.current.focus` on `accessibleFieldDOMStructure` (#15985) @LukasTy
69
+ - [pickers] Always use `setValue` internally to update the picker value (#16056) @flaviendelangle
70
+ - [pickers] Create a new context to pass the range position props to the layout components and to the views (#15846) @flaviendelangle
71
+ - [pickers] Introduce a new concept of `manager` (#15339) @flaviendelangle
72
+ - [pickers] Improve React 19 support (#15769) @LukasTy
73
+ - [pickers] Memoize `<PickersActionBar />` (#16071) @LukasTy
74
+ - [pickers] Remove `NonEmptyDateRange` type (#16035) @flaviendelangle
75
+ - [pickers] Rename `AdapterDateFns` into `AdapterDateFnsV2` and `AdapterDateFnsV3` into `AdapterDateFns` (#16082) @LukasTy
76
+ - [pickers] Rename `ctx.onViewChange` to `ctx.setView` and add it to the actions context (#16044) @flaviendelangle
77
+ - [pickers] Support `date-fns-jalali` v4 (#16011) @LukasTy
78
+ - [pickers] Update `closeOnSelect` and `actionBar.actions` default values (#15944) @LukasTy
79
+ - [pickers] Use `usePickerContext()` and `usePickerActionsContext()` instead of passing props to the `shortcuts` and `toolbar` slots (#15948) @flaviendelangle
80
+ - [l10n] Add Chinese (Taiwan) (zh-TW) locale (#16033) @nusr
81
+ - [l10n] Improve Norwegian (nb-NO) locale (#16089) @josteinjhauge
82
+
83
+ #### `@mui/x-date-pickers-pro@8.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
84
+
85
+ Same changes as in `@mui/x-date-pickers@8.0.0-alpha.7`.
86
+
87
+ ### Charts
88
+
89
+ #### Breaking changes
90
+
91
+ - Removed `DefaultChartsLegend` component, since it is now easier to create custom legends — [Learn more](https://next.mui.com/x/react-charts/components/#html-components).
92
+ - The default legend is now an HTML element and can be styled more easily.
93
+ - The `width` and `height` properties of the charts now only apply to the `svg` element, and not their wrappers, this might cause some layout shifts.
94
+ - `slotProps.legend.direction` now accepts `'horizontal' | 'vertical'` instead of `'row' | 'column'` — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#legend-direction-value-change-✅).
95
+ - The `getSeriesToDisplay` function was removed in favor of the `useLegend` hook. — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#the-getseriestodisplay-function-was-removed).
96
+
97
+ #### `@mui/x-charts@8.0.0-alpha.7`
98
+
99
+ - [charts] New HTML legend & styles (#15733) @JCQuintas
100
+ - [charts] Improve React 19 support (#15769) @LukasTy
101
+ - [charts] Fix 301 redirection in the API documentation @oliviertassinari
102
+
103
+ #### `@mui/x-charts-pro@8.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
104
+
105
+ Same changes as in `@mui/x-charts@8.0.0-alpha.7`.
106
+
107
+ ### Tree View
108
+
109
+ #### `@mui/x-tree-view@8.0.0-alpha.7`
110
+
111
+ - [TreeView] Improve React 19 support (#15769) @LukasTy
112
+
113
+ #### `@mui/x-tree-view-pro@8.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
114
+
115
+ Same changes as in `@mui/x-tree-view@8.0.0-alpha.7`.
116
+
117
+ ### Docs
118
+
119
+ - [docs] Fix `EditingWithDatePickers` demo (#15967) @k-rajat19
120
+ - [docs] Fix inconsistent multi input range field separators (#16043) @flaviendelangle
121
+ - [docs] Fix non-existing "adapter" property of `LocalizationProvider` (#16084) @tomashauser
122
+ - [docs] Refactor Data Grid with Date Pickers example (#15992) @LukasTy
123
+ - [docs] Unify the wording of the pickers slots breaking changes (#16036) @flaviendelangle
124
+
125
+ ### Core
126
+
127
+ - [core] Clarify the release strategy (#16014) @MBilalShafi
128
+ - [core] Small fixes on docs @oliviertassinari
129
+ - [core] Sync with other repos @oliviertassinari
130
+ - [core] Update the `release:version` docs (#16038) @cherniavskii
131
+ - [code-infra] Add `testSkipIf` and `describeSkipIf` (#16049) @JCQuintas
132
+ - [test] Stabilize flaky Data Grid tests (#16053) @LukasTy
133
+
134
+ ## 8.0.0-alpha.6
135
+
136
+ _Dec 26, 2024_
137
+
138
+ We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
139
+
140
+ - 🏎️ Improve Data Grid scrolling performance
141
+ - 🌍 Improve Dutch (nl-NL) locale on the Data Grid
142
+ - 🐞 Bugfixes
143
+
144
+ Special thanks go out to the community contributors who have helped make this release possible:
145
+ @JoepVerkoelen, @k-rajat19, @lauri865.
146
+ Following are all team members who have contributed to this release:
147
+ @flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @romgrk.
148
+
149
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
150
+
151
+ ### Data Grid
152
+
153
+ #### Breaking changes
154
+
155
+ - The `sanitizeFilterItemValue()` utility is not exported anymore.
156
+
157
+ #### `@mui/x-data-grid@8.0.0-alpha.6`
158
+
159
+ - [DataGrid] Avoid subscribing to `renderContext` state in grid root for better scroll performance (#15986) @lauri865
160
+ - [DataGrid] Fix header filters showing clear button while empty (#15829) @k-rajat19
161
+ - [DataGrid] Improve test coverage of server side data source (#15942) @MBilalShafi
162
+ - [DataGrid] Move progress components to leaf import (#15914) @romgrk
163
+ - [DataGrid] Move skeleton to leaf import (#15931) @romgrk
164
+ - [DataGrid] Replace `forwardRef` with a shim for forward compatibility (#15955) @lauri865
165
+ - [l10n] Improve Dutch (nl-NL) locale (#15994) @JoepVerkoelen
166
+
167
+ #### `@mui/x-data-grid-pro@8.0.0-alpha.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
168
+
169
+ Same changes as in `@mui/x-data-grid@8.0.0-alpha.6`.
170
+
171
+ #### `@mui/x-data-grid-premium@8.0.0-alpha.6` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
172
+
173
+ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.6`, plus:
174
+
175
+ - [DataGridPremium] Fix column unpinning with row grouping (#15908) @k-rajat19
176
+
177
+ ### Date and Time Pickers
178
+
179
+ #### `@mui/x-date-pickers@8.0.0-alpha.6`
180
+
181
+ - [pickers] Use `usePickerContext()` and `usePickerActionsContext()` to get the actions in the `actionBar` slot and in internal components (#15843) @flaviendelangle
182
+ - [pickers] Use `usePickerContext()` to get the view-related props in the layout, toolbar and tabs slots (#15606) @flaviendelangle
183
+
184
+ #### `@mui/x-date-pickers-pro@8.0.0-alpha.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
185
+
186
+ Same changes as in `@mui/x-date-pickers@8.0.0-alpha.6`.
187
+
188
+ ### Charts
189
+
190
+ #### `@mui/x-charts@8.0.0-alpha.6`
191
+
192
+ No changes since `@mui/x-charts@v8.0.0-alpha.5`.
193
+
194
+ #### `@mui/x-charts-pro@8.0.0-alpha.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
195
+
196
+ Same changes as in `@mui/x-charts@8.0.0-alpha.6`.
197
+
198
+ ### Tree View
199
+
200
+ #### `@mui/x-tree-view@8.0.0-alpha.6`
201
+
202
+ No changes since `@mui/x-tree-view-pro@v8.0.0-alpha.5`.
203
+
204
+ #### `@mui/x-tree-view-pro@8.0.0-alpha.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
205
+
206
+ Same changes as in `@mui/x-tree-view@8.0.0-alpha.6`.
207
+
208
+ ### Docs
209
+
210
+ - [docs] Remove production profiler from docs build (#15959) @lauri865
211
+ - [code-infra] Add new `next-env.d.ts` changes (#15947) @JCQuintas
212
+
8
213
  ## 8.0.0-alpha.5
9
214
 
10
215
  _Dec 19, 2024_
@@ -25,7 +230,7 @@ Following are all team members who have contributed to this release:
25
230
 
26
231
  #### Breaking changes
27
232
 
28
- - Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`.
233
+ - Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`:
29
234
 
30
235
  - For `.root` element, use `slotProps.root`.
31
236
  - For `.main` element (the one with `role="grid"`), use `slotProps.main`.
@@ -13,6 +13,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _xLicense = require("@mui/x-license");
14
14
  var _xDataGridPro = require("@mui/x-data-grid-pro");
15
15
  var _internals = require("@mui/x-data-grid-pro/internals");
16
+ var _forwardRef = require("@mui/x-internals/forwardRef");
16
17
  var _useDataGridPremiumComponent = require("./useDataGridPremiumComponent");
17
18
  var _useDataGridPremiumProps = require("./useDataGridPremiumProps");
18
19
  var _releaseInfo = require("../utils/releaseInfo");
@@ -30,7 +31,7 @@ let dataGridPremiumPropValidators;
30
31
  if (process.env.NODE_ENV !== 'production') {
31
32
  dataGridPremiumPropValidators = [..._internals.propValidatorsDataGrid, ..._internals.propValidatorsDataGridPro];
32
33
  }
33
- const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremium(inProps, ref) {
34
+ const DataGridPremiumRaw = (0, _forwardRef.forwardRef)(function DataGridPremium(inProps, ref) {
34
35
  const props = (0, _useDataGridPremiumProps.useDataGridPremiumProps)(inProps);
35
36
  const privateApiRef = (0, _useDataGridPremiumComponent.useDataGridPremiumComponent)(props.apiRef, props);
36
37
  (0, _xLicense.useLicenseVerifier)('x-data-grid-premium', releaseInfo);
@@ -44,9 +45,9 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
44
45
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_xDataGridPro.GridRoot, (0, _extends2.default)({
45
46
  className: props.className,
46
47
  style: props.style,
47
- sx: props.sx,
48
- ref: ref
48
+ sx: props.sx
49
49
  }, props.slotProps?.root, {
50
+ ref: ref,
50
51
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridHeader, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridBody, {
51
52
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
52
53
  packageName: "x-data-grid-premium",
@@ -63,7 +64,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
63
64
  // ----------------------------------------------------------------------
64
65
  /**
65
66
  * Aggregation functions available on the grid.
66
- * @default GRID_AGGREGATION_FUNCTIONS
67
+ * @default GRID_AGGREGATION_FUNCTIONS when `unstable_dataSource` is not provided, `{}` when `unstable_dataSource` is provided
67
68
  */
68
69
  aggregationFunctions: _propTypes.default.object,
69
70
  /**
@@ -1043,6 +1044,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1043
1044
  */
1044
1045
  treeData: _propTypes.default.bool,
1045
1046
  unstable_dataSource: _propTypes.default.shape({
1047
+ getAggregatedValue: _propTypes.default.func,
1046
1048
  getChildrenCount: _propTypes.default.func,
1047
1049
  getGroupKey: _propTypes.default.func,
1048
1050
  getRows: _propTypes.default.func.isRequired,
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { GridApiPremium, GridPrivateApiPremium } from '../models/gridApiPremium';
3
3
  import { DataGridPremiumProcessedProps } from '../models/dataGridPremiumProps';
4
- export declare const useDataGridPremiumComponent: (inputApiRef: React.MutableRefObject<GridApiPremium> | undefined, props: DataGridPremiumProcessedProps) => React.MutableRefObject<GridPrivateApiPremium>;
4
+ export declare const useDataGridPremiumComponent: (inputApiRef: React.MutableRefObject<GridApiPremium> | undefined, props: DataGridPremiumProcessedProps) => React.RefObject<GridPrivateApiPremium>;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useDataGridPremiumComponent = void 0;
7
7
  var _internals = require("@mui/x-data-grid-pro/internals");
8
+ var _useGridDataSourcePremium = require("../hooks/features/dataSource/useGridDataSourcePremium");
8
9
  var _useGridAggregation = require("../hooks/features/aggregation/useGridAggregation");
9
10
  var _useGridAggregationPreProcessors = require("../hooks/features/aggregation/useGridAggregationPreProcessors");
10
11
  var _useGridRowGrouping = require("../hooks/features/rowGrouping/useGridRowGrouping");
@@ -69,6 +70,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
69
70
  (0, _useGridRowGrouping.useGridRowGrouping)(apiRef, props);
70
71
  (0, _internals.useGridHeaderFiltering)(apiRef, props);
71
72
  (0, _internals.useGridTreeData)(apiRef, props);
73
+ (0, _useGridDataSourcePremium.useGridDataSourcePremium)(apiRef, props);
72
74
  (0, _useGridAggregation.useGridAggregation)(apiRef, props);
73
75
  (0, _internals.useGridKeyboardNavigation)(apiRef, props);
74
76
  (0, _internals.useGridRowSelection)(apiRef, props);
@@ -106,7 +108,6 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
106
108
  (0, _internals.useGridDimensions)(apiRef, props);
107
109
  (0, _internals.useGridEvents)(apiRef, props);
108
110
  (0, _internals.useGridStatePersistence)(apiRef);
109
- (0, _internals.useGridDataSource)(apiRef, props);
110
111
  (0, _internals.useGridVirtualization)(apiRef, props);
111
112
  (0, _internals.useGridListView)(apiRef, props);
112
113
  return apiRef;
@@ -53,7 +53,9 @@ const useDataGridPremiumProps = inProps => {
53
53
  defaultSlots,
54
54
  slots: themedProps.slots
55
55
  }), [themedProps.slots]);
56
- return React.useMemo(() => (0, _extends2.default)({}, DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES, themedProps, {
56
+ return React.useMemo(() => (0, _extends2.default)({}, DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES, themedProps.unstable_dataSource ? {
57
+ aggregationFunctions: {}
58
+ } : {}, themedProps, {
57
59
  localeText,
58
60
  slots
59
61
  }, getDataGridPremiumForcedProps(themedProps)), [themedProps, localeText, slots]);
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.GridColumnMenuAggregationItem = GridColumnMenuAggregationItem;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
10
  var _toPropertyKey2 = _interopRequireDefault(require("@babel/runtime/helpers/toPropertyKey"));
12
- var React = _interopRequireWildcard(require("react"));
11
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
+ var _react = _interopRequireWildcard(require("react"));
13
+ var React = _react;
13
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
14
15
  var _xDataGridPro = require("@mui/x-data-grid-pro");
15
16
  var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
@@ -20,18 +21,27 @@ var _useGridRootProps = require("../hooks/utils/useGridRootProps");
20
21
  var _gridAggregationUtils = require("../hooks/features/aggregation/gridAggregationUtils");
21
22
  var _gridAggregationSelectors = require("../hooks/features/aggregation/gridAggregationSelectors");
22
23
  var _jsxRuntime = require("react/jsx-runtime");
24
+ const _excluded = ["native"];
23
25
  function GridColumnMenuAggregationItem(props) {
24
26
  const {
25
27
  colDef
26
28
  } = props;
27
29
  const apiRef = (0, _useGridApiContext.useGridApiContext)();
30
+ const inputRef = React.useRef(null);
28
31
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
29
32
  const id = (0, _utils.unstable_useId)();
30
33
  const aggregationModel = (0, _xDataGridPro.useGridSelector)(apiRef, _gridAggregationSelectors.gridAggregationModelSelector);
31
34
  const availableAggregationFunctions = React.useMemo(() => (0, _gridAggregationUtils.getAvailableAggregationFunctions)({
32
35
  aggregationFunctions: rootProps.aggregationFunctions,
33
- colDef
34
- }), [colDef, rootProps.aggregationFunctions]);
36
+ colDef,
37
+ isDataSource: !!rootProps.unstable_dataSource
38
+ }), [colDef, rootProps.aggregationFunctions, rootProps.unstable_dataSource]);
39
+ const _ref = rootProps.slotProps?.baseSelect || {},
40
+ {
41
+ native: isBaseSelectNative = false
42
+ } = _ref,
43
+ baseSelectProps = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
44
+ const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
35
45
  const selectedAggregationRule = React.useMemo(() => {
36
46
  if (!colDef || !aggregationModel[colDef.field]) {
37
47
  return '';
@@ -40,12 +50,13 @@ function GridColumnMenuAggregationItem(props) {
40
50
  if ((0, _gridAggregationUtils.canColumnHaveAggregationFunction)({
41
51
  colDef,
42
52
  aggregationFunctionName,
43
- aggregationFunction: rootProps.aggregationFunctions[aggregationFunctionName]
53
+ aggregationFunction: rootProps.aggregationFunctions[aggregationFunctionName],
54
+ isDataSource: !!rootProps.unstable_dataSource
44
55
  })) {
45
56
  return aggregationFunctionName;
46
57
  }
47
58
  return '';
48
- }, [rootProps.aggregationFunctions, aggregationModel, colDef]);
59
+ }, [rootProps.aggregationFunctions, rootProps.unstable_dataSource, aggregationModel, colDef]);
49
60
  const handleAggregationItemChange = event => {
50
61
  const newAggregationItem = event.target?.value || undefined;
51
62
  const currentModel = (0, _gridAggregationSelectors.gridAggregationModelSelector)(apiRef);
@@ -58,11 +69,22 @@ function GridColumnMenuAggregationItem(props) {
58
69
  apiRef.current.hideColumnMenu();
59
70
  };
60
71
  const label = apiRef.current.getLocaleText('aggregationMenuItemHeader');
72
+ const handleMenuItemKeyDown = React.useCallback(event => {
73
+ if (event.key === 'Enter' || event.key === ' ') {
74
+ inputRef.current.focus();
75
+ }
76
+ }, []);
77
+ const handleSelectKeyDown = React.useCallback(event => {
78
+ if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === ' ') {
79
+ event.stopPropagation();
80
+ }
81
+ }, []);
61
82
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
62
83
  inert: true,
63
84
  iconStart: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnMenuAggregationIcon, {
64
85
  fontSize: "small"
65
86
  }),
87
+ onKeyDown: handleMenuItemKeyDown,
66
88
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_FormControl.default, {
67
89
  size: "small",
68
90
  fullWidth: true,
@@ -71,30 +93,41 @@ function GridColumnMenuAggregationItem(props) {
71
93
  },
72
94
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
73
95
  id: `${id}-label`,
96
+ htmlFor: `${id}-input`,
74
97
  children: label
75
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseSelect, {
98
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseSelect, (0, _extends2.default)({
76
99
  labelId: `${id}-label`,
100
+ inputRef: inputRef,
77
101
  id: `${id}-input`,
78
102
  value: selectedAggregationRule,
79
103
  label: label,
80
104
  color: "primary",
81
105
  onChange: handleAggregationItemChange,
106
+ MenuProps: {
107
+ PaperProps: {
108
+ onKeyDown: handleSelectKeyDown
109
+ }
110
+ },
82
111
  onBlur: event => event.stopPropagation(),
83
- fullWidth: true,
84
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
112
+ native: isBaseSelectNative,
113
+ fullWidth: true
114
+ }, baseSelectProps, {
115
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
116
+ native: isBaseSelectNative,
85
117
  value: "",
86
118
  children: "..."
87
- }), availableAggregationFunctions.map(aggFunc => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
119
+ })), availableAggregationFunctions.map(aggFunc => /*#__PURE__*/(0, _react.createElement)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
120
+ key: aggFunc,
88
121
  value: aggFunc,
89
- children: (0, _gridAggregationUtils.getAggregationFunctionLabel)({
90
- apiRef,
91
- aggregationRule: {
92
- aggregationFunctionName: aggFunc,
93
- aggregationFunction: rootProps.aggregationFunctions[aggFunc]
94
- }
95
- })
96
- }, aggFunc))]
97
- })]
122
+ native: isBaseSelectNative
123
+ }), (0, _gridAggregationUtils.getAggregationFunctionLabel)({
124
+ apiRef,
125
+ aggregationRule: {
126
+ aggregationFunctionName: aggFunc,
127
+ aggregationFunction: rootProps.aggregationFunctions[aggFunc]
128
+ }
129
+ })))]
130
+ }))]
98
131
  })
99
132
  });
100
133
  }
@@ -10,7 +10,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _utils = require("@mui/utils");
12
12
  var _Box = _interopRequireDefault(require("@mui/material/Box"));
13
- var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
14
13
  var _internals = require("@mui/x-data-grid-pro/internals");
15
14
  var _xDataGridPro = require("@mui/x-data-grid-pro");
16
15
  var _useGridApiContext = require("../hooks/utils/useGridApiContext");
@@ -55,7 +54,7 @@ function GridGroupingCriteriaCellIcon(props) {
55
54
  if (isDataLoading) {
56
55
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
57
56
  className: classes.loadingContainer,
58
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
57
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseCircularProgress, {
59
58
  size: "1rem",
60
59
  color: "inherit"
61
60
  })
@@ -30,4 +30,4 @@ export declare const GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM: {
30
30
  displayOrder: number;
31
31
  };
32
32
  };
33
- export declare const GridPremiumColumnMenu: React.ForwardRefExoticComponent<GridColumnMenuProps & React.RefAttributes<HTMLUListElement>>;
33
+ export declare const GridPremiumColumnMenu: React.ForwardRefExoticComponent<GridColumnMenuProps> | React.ForwardRefExoticComponent<GridColumnMenuProps & React.RefAttributes<HTMLUListElement>>;
@@ -11,6 +11,7 @@ exports.GridPremiumColumnMenu = void 0;
11
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
13
  var _xDataGridPro = require("@mui/x-data-grid-pro");
14
+ var _forwardRef = require("@mui/x-internals/forwardRef");
14
15
  var _GridColumnMenuAggregationItem = require("./GridColumnMenuAggregationItem");
15
16
  var _rowGrouping = require("../hooks/features/rowGrouping");
16
17
  var _GridColumnMenuRowGroupItem = require("./GridColumnMenuRowGroupItem");
@@ -37,11 +38,10 @@ const GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM = exports.GRID_COLUMN_MENU_SLOT_PROPS_
37
38
  displayOrder: 27
38
39
  }
39
40
  });
40
- const GridPremiumColumnMenu = exports.GridPremiumColumnMenu = /*#__PURE__*/React.forwardRef(function GridPremiumColumnMenuSimple(props, ref) {
41
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridGenericColumnMenu, (0, _extends2.default)({
42
- ref: ref
43
- }, props, {
41
+ const GridPremiumColumnMenu = exports.GridPremiumColumnMenu = (0, _forwardRef.forwardRef)(function GridPremiumColumnMenuSimple(props, ref) {
42
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridGenericColumnMenu, (0, _extends2.default)({}, props, {
44
43
  defaultSlots: GRID_COLUMN_MENU_SLOTS_PREMIUM,
45
- defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM
44
+ defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM,
45
+ ref: ref
46
46
  }));
47
47
  });
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
6
6
  import { useLicenseVerifier, Watermark } from '@mui/x-license';
7
7
  import { GridBody, GridFooterPlaceholder, GridHeader, GridRoot, GridContextProvider } from '@mui/x-data-grid-pro';
8
8
  import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps } from '@mui/x-data-grid-pro/internals';
9
+ import { forwardRef } from '@mui/x-internals/forwardRef';
9
10
  import { useDataGridPremiumComponent } from "./useDataGridPremiumComponent.js";
10
11
  import { useDataGridPremiumProps } from "./useDataGridPremiumProps.js";
11
12
  import { getReleaseInfo } from "../utils/releaseInfo.js";
@@ -23,7 +24,7 @@ let dataGridPremiumPropValidators;
23
24
  if (process.env.NODE_ENV !== 'production') {
24
25
  dataGridPremiumPropValidators = [...propValidatorsDataGrid, ...propValidatorsDataGridPro];
25
26
  }
26
- const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremium(inProps, ref) {
27
+ const DataGridPremiumRaw = forwardRef(function DataGridPremium(inProps, ref) {
27
28
  const props = useDataGridPremiumProps(inProps);
28
29
  const privateApiRef = useDataGridPremiumComponent(props.apiRef, props);
29
30
  useLicenseVerifier('x-data-grid-premium', releaseInfo);
@@ -37,9 +38,9 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
37
38
  children: /*#__PURE__*/_jsxs(GridRoot, _extends({
38
39
  className: props.className,
39
40
  style: props.style,
40
- sx: props.sx,
41
- ref: ref
41
+ sx: props.sx
42
42
  }, props.slotProps?.root, {
43
+ ref: ref,
43
44
  children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
44
45
  children: /*#__PURE__*/_jsx(Watermark, {
45
46
  packageName: "x-data-grid-premium",
@@ -56,7 +57,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
56
57
  // ----------------------------------------------------------------------
57
58
  /**
58
59
  * Aggregation functions available on the grid.
59
- * @default GRID_AGGREGATION_FUNCTIONS
60
+ * @default GRID_AGGREGATION_FUNCTIONS when `unstable_dataSource` is not provided, `{}` when `unstable_dataSource` is provided
60
61
  */
61
62
  aggregationFunctions: PropTypes.object,
62
63
  /**
@@ -1036,6 +1037,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1036
1037
  */
1037
1038
  treeData: PropTypes.bool,
1038
1039
  unstable_dataSource: PropTypes.shape({
1040
+ getAggregatedValue: PropTypes.func,
1039
1041
  getChildrenCount: PropTypes.func,
1040
1042
  getGroupKey: PropTypes.func,
1041
1043
  getRows: PropTypes.func.isRequired,
@@ -1,4 +1,5 @@
1
- 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, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, useGridDataSource, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer } from '@mui/x-data-grid-pro/internals';
1
+ 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, headerFilteringStateInitializer, useGridHeaderFiltering, virtualizationStateInitializer, useGridVirtualization, useGridDataSourceTreeDataPreProcessors, dataSourceStateInitializer, useGridRowSpanning, rowSpanningStateInitializer, useGridListView, listViewStateInitializer } from '@mui/x-data-grid-pro/internals';
2
+ import { useGridDataSourcePremium as useGridDataSource } from "../hooks/features/dataSource/useGridDataSourcePremium.js";
2
3
  // Premium-only features
3
4
  import { useGridAggregation, aggregationStateInitializer } from "../hooks/features/aggregation/useGridAggregation.js";
4
5
  import { useGridAggregationPreProcessors } from "../hooks/features/aggregation/useGridAggregationPreProcessors.js";
@@ -62,6 +63,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
62
63
  useGridRowGrouping(apiRef, props);
63
64
  useGridHeaderFiltering(apiRef, props);
64
65
  useGridTreeData(apiRef, props);
66
+ useGridDataSource(apiRef, props);
65
67
  useGridAggregation(apiRef, props);
66
68
  useGridKeyboardNavigation(apiRef, props);
67
69
  useGridRowSelection(apiRef, props);
@@ -99,7 +101,6 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
99
101
  useGridDimensions(apiRef, props);
100
102
  useGridEvents(apiRef, props);
101
103
  useGridStatePersistence(apiRef);
102
- useGridDataSource(apiRef, props);
103
104
  useGridVirtualization(apiRef, props);
104
105
  useGridListView(apiRef, props);
105
106
  return apiRef;
@@ -45,7 +45,9 @@ export const useDataGridPremiumProps = inProps => {
45
45
  defaultSlots,
46
46
  slots: themedProps.slots
47
47
  }), [themedProps.slots]);
48
- return React.useMemo(() => _extends({}, DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES, themedProps, {
48
+ return React.useMemo(() => _extends({}, DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES, themedProps.unstable_dataSource ? {
49
+ aggregationFunctions: {}
50
+ } : {}, themedProps, {
49
51
  localeText,
50
52
  slots
51
53
  }, getDataGridPremiumForcedProps(themedProps)), [themedProps, localeText, slots]);