@mui/x-data-grid-premium 7.28.3 → 7.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,161 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.29.1
7
+
8
+ _Apr 23, 2025_
9
+
10
+ We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🐞 Bugfixes
13
+
14
+ Special thanks go out to the community contributors who have helped make this release possible:
15
+ @lhilgert9
16
+
17
+ Following are all team members who have contributed to this release:
18
+ @arminmeh, @cherniavskii, @flaviendelangle, @LukasTy, @romgrk.
19
+
20
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
21
+
22
+ ### Data Grid
23
+
24
+ #### `@mui/x-data-grid@7.29.1`
25
+
26
+ - [DataGrid] Prevent scrollbars from showing on top (#17410) @romgrk
27
+
28
+ #### `@mui/x-data-grid-pro@7.29.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
29
+
30
+ Same changes as in `@mui/x-data-grid@7.29.1`, plus:
31
+
32
+ - [DataGridPro] Avoid proptypes warnings with header filters in React 17 (#17492) @cherniavskii
33
+ - [DataGridPro] Fix expandable rows detail content height updates (#17509) @arminmeh
34
+ - [DataGridPro] Fix row virtualization not working in list view (#17404) @cherniavskii
35
+ - [DataGridPro] Move locales re-export to allow proper tree shaking (#17438) @lhilgert9
36
+
37
+ #### `@mui/x-data-grid-premium@7.29.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
38
+
39
+ Same changes as in `@mui/x-data-grid-pro@7.29.1`, plus:
40
+
41
+ - [DataGridPremium] Use `groupingValueGetter` for row grouping on the server (#17423) @cherniavskii
42
+
43
+ ### Date and Time Pickers
44
+
45
+ #### `@mui/x-date-pickers@7.29.1`
46
+
47
+ Internal changes.
48
+
49
+ #### `@mui/x-date-pickers-pro@7.29.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
50
+
51
+ Same changes as in `@mui/x-date-pickers@7.29.1`.
52
+
53
+ ### Charts
54
+
55
+ #### `@mui/x-charts@7.29.1`
56
+
57
+ Internal changes.
58
+
59
+ #### `@mui/x-charts-pro@7.29.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
60
+
61
+ Same changes as in `@mui/x-charts@7.29.1`.
62
+
63
+ ### Tree View
64
+
65
+ #### `@mui/x-tree-view@7.29.1`
66
+
67
+ Internal changes.
68
+
69
+ #### `@mui/x-tree-view-pro@7.29.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
70
+
71
+ Same changes as in `@mui/x-tree-view@7.29.1`, plus:
72
+
73
+ - [RichTreeViewPro] Fix drag and drop issue with label editing (#17415) @flaviendelangle
74
+
75
+ ### Docs
76
+
77
+ - [docs] Use MUI X v7 packages in CodeSandbox and StackBlitz (#17516) @cherniavskii
78
+
79
+ ### Core
80
+
81
+ - [core] Bump monorepo (#17437) @LukasTy
82
+
83
+ ## 7.29.0
84
+
85
+ _Apr 16, 2025_
86
+
87
+ We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
88
+
89
+ - 🐞 Bugfixes
90
+ - 🌍 Improve Hebrew (he-IL), Polish (pl-PL), and Swedish (sv-SE) locales on the Data Grid
91
+ - 🌍 Improve Czech (cs-CZ) and Slovak (sk-SK) locales on the Date and Time Pickers
92
+
93
+ Special thanks go out to the community contributors who have helped make this release possible:
94
+ @lubka272, @ptuukkan, @iddan, @sofortdagmbh
95
+
96
+ Following are all team members who have contributed to this release:
97
+ @michelengelen, @oliviertassinari, @michelengelen, @LukasTy.
98
+
99
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
100
+
101
+ ### Data Grid
102
+
103
+ #### `@mui/x-data-grid@7.29.0`
104
+
105
+ - [l10n] Improve Swedish (sv-SE) locale (#17306) @ptuukkan
106
+ - [l10n] Improve Hebrew (he-IL) locale (#16516) @iddan
107
+ - [l10n] Improve Polish (pl-PL) locale (#17306) @sofortdagmbh
108
+
109
+ #### `@mui/x-data-grid-pro@7.29.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
110
+
111
+ Same changes as in `@mui/x-data-grid@7.29.0`.
112
+
113
+ #### `@mui/x-data-grid-premium@7.29.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
114
+
115
+ Same changes as in `@mui/x-data-grid-pro@7.29.0`, plus:
116
+
117
+ - [DataGridPremium] Fix stale aggregation results after filtering (#17303) @cherniavskii
118
+ - [DataGridPremium] Fix aggregated values sorting (#17382) @cherniavskii
119
+
120
+ ### Date and Time Pickers
121
+
122
+ #### `@mui/x-date-pickers@7.29.0`
123
+
124
+ - [l10n] Improve Slovak (sk-SK) locale (#17204) @lubka272
125
+ - [l10n] Improve Czech (cs-CZ) locale (#17205) @lubka272
126
+
127
+ #### `@mui/x-date-pickers-pro@7.29.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
128
+
129
+ Same changes as in `@mui/x-date-pickers@7.29.0`.
130
+
131
+ ### Charts
132
+
133
+ #### `@mui/x-charts@7.29.0`
134
+
135
+ Internal changes.
136
+
137
+ #### `@mui/x-charts-pro@7.29.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
138
+
139
+ Same changes as in `@mui/x-charts@7.29.0`.
140
+
141
+ ### Tree View
142
+
143
+ #### `@mui/x-tree-view@7.29.0`
144
+
145
+ Internal changes.
146
+
147
+ #### `@mui/x-tree-view-pro@7.29.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
148
+
149
+ Same changes as in `@mui/x-tree-view@7.29.0`.
150
+
151
+ ### Core
152
+
153
+ - [core] Cleanup `@mui` dependency versions (#17390) @LukasTy
154
+
155
+ ### Docs
156
+
157
+ - [docs] Fix 404 link on the marketing page (#17276) @oliviertassinari
158
+ - [docs] Fix country columns throwing on grouping (#17317) @cherniavskii
159
+ - [release] Changes to v7 for major release (#17320) @michelengelen
160
+
6
161
  ## 7.28.3
7
162
 
8
163
  _Apr 3, 2025_
@@ -19,11 +19,20 @@ var _useDataGridPremiumProps = require("./useDataGridPremiumProps");
19
19
  var _releaseInfo = require("../utils/releaseInfo");
20
20
  var _useGridAriaAttributes = require("../hooks/utils/useGridAriaAttributes");
21
21
  var _useGridRowAriaAttributes = require("../hooks/features/rows/useGridRowAriaAttributes");
22
+ var _gridAggregationSelectors = require("../hooks/features/aggregation/gridAggregationSelectors");
23
+ var _useGridApiContext = require("../hooks/utils/useGridApiContext");
22
24
  var _jsxRuntime = require("react/jsx-runtime");
23
25
  const configuration = {
24
26
  hooks: {
25
27
  useGridAriaAttributes: _useGridAriaAttributes.useGridAriaAttributes,
26
- useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributes
28
+ useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributes,
29
+ useCellAggregationResult: (id, field) => {
30
+ const apiRef = (0, _useGridApiContext.useGridApiContext)();
31
+ return (0, _internals.useGridSelectorV8)(apiRef, _gridAggregationSelectors.gridCellAggregationResultSelector, {
32
+ id,
33
+ field
34
+ });
35
+ }
27
36
  }
28
37
  };
29
38
  const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
@@ -5,18 +5,27 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useLicenseVerifier, Watermark } from '@mui/x-license';
7
7
  import { GridRoot, GridContextProvider } from '@mui/x-data-grid-pro';
8
- import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps } from '@mui/x-data-grid-pro/internals';
8
+ import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps, useGridSelectorV8 } from '@mui/x-data-grid-pro/internals';
9
9
  import { forwardRef } from '@mui/x-internals/forwardRef';
10
10
  import { useDataGridPremiumComponent } from "./useDataGridPremiumComponent.js";
11
11
  import { useDataGridPremiumProps } from "./useDataGridPremiumProps.js";
12
12
  import { getReleaseInfo } from "../utils/releaseInfo.js";
13
13
  import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
14
14
  import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
15
+ import { gridCellAggregationResultSelector } from "../hooks/features/aggregation/gridAggregationSelectors.js";
16
+ import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
15
17
  import { jsx as _jsx } from "react/jsx-runtime";
16
18
  const configuration = {
17
19
  hooks: {
18
20
  useGridAriaAttributes,
19
- useGridRowAriaAttributes
21
+ useGridRowAriaAttributes,
22
+ useCellAggregationResult: (id, field) => {
23
+ const apiRef = useGridApiContext();
24
+ return useGridSelectorV8(apiRef, gridCellAggregationResultSelector, {
25
+ id,
26
+ field
27
+ });
28
+ }
20
29
  }
21
30
  };
22
31
  const releaseInfo = getReleaseInfo();
@@ -1,4 +1,5 @@
1
- import { createSelector } from '@mui/x-data-grid-pro/internals';
1
+ import { createSelector, createSelectorV8 } from '@mui/x-data-grid-pro/internals';
2
+ import { gridRowTreeSelector } from '@mui/x-data-grid';
2
3
  export const gridAggregationStateSelector = state => state.aggregation;
3
4
 
4
5
  /**
@@ -12,4 +13,30 @@ export const gridAggregationModelSelector = createSelector(gridAggregationStateS
12
13
  * Get the aggregation results as a lookup.
13
14
  * @category Aggregation
14
15
  */
15
- export const gridAggregationLookupSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
16
+ export const gridAggregationLookupSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
17
+ export const gridCellAggregationResultSelector = createSelectorV8(gridRowTreeSelector, gridAggregationLookupSelector, (rowTree, aggregationLookup, {
18
+ id,
19
+ field
20
+ }) => {
21
+ let cellAggregationPosition = null;
22
+ const rowNode = rowTree[id];
23
+ if (!rowNode) {
24
+ return null;
25
+ }
26
+ if (rowNode.type === 'group') {
27
+ cellAggregationPosition = 'inline';
28
+ } else if (id.toString().startsWith('auto-generated-group-footer-')) {
29
+ cellAggregationPosition = 'footer';
30
+ }
31
+ if (cellAggregationPosition == null) {
32
+ return null;
33
+ }
34
+
35
+ // TODO: Add custom root id
36
+ const groupId = cellAggregationPosition === 'inline' ? id : rowNode.parent ?? '';
37
+ const aggregationResult = aggregationLookup?.[groupId]?.[field];
38
+ if (!aggregationResult || aggregationResult.position !== cellAggregationPosition) {
39
+ return null;
40
+ }
41
+ return aggregationResult;
42
+ });
@@ -1,4 +1,4 @@
1
1
  export * from "./gridAggregationInterfaces.js";
2
- export * from "./gridAggregationSelectors.js";
2
+ export { gridAggregationStateSelector, gridAggregationLookupSelector, gridAggregationModelSelector } from "./gridAggregationSelectors.js";
3
3
  export * from "./gridAggregationFunctions.js";
4
4
  export { GRID_AGGREGATION_ROOT_FOOTER_ROW_ID, getAggregationFooterRowIdFromGroupId } from "./gridAggregationUtils.js";
@@ -22,10 +22,7 @@ export const useGridDataSourceRowGroupingPreProcessors = (apiRef, props) => {
22
22
  apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation = groupingRules;
23
23
  const getRowTreeBuilderNode = rowId => {
24
24
  const parentPath = params.updates.groupKeys ?? [];
25
- const row = params.dataRowIdToModelLookup[rowId];
26
- const groupingRule = groupingRules[parentPath.length];
27
- const groupingValueGetter = groupingRule?.groupingValueGetter;
28
- const leafKey = groupingValueGetter?.(row[groupingRule.field], row, columnsLookup[groupingRule.field], apiRef) ?? getGroupKey(params.dataRowIdToModelLookup[rowId]);
25
+ const leafKey = getGroupKey(params.dataRowIdToModelLookup[rowId]);
29
26
  return {
30
27
  id: rowId,
31
28
  path: [...parentPath, leafKey ?? rowId.toString()].map((key, i) => ({
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTc0MzYzMTIwMDAwMA==";
3
+ const releaseInfo = "MTc0NTM1OTIwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -1,4 +1,6 @@
1
+ import { GridRowId } from '@mui/x-data-grid';
1
2
  import { GridStatePremium } from '../../../models/gridStatePremium';
3
+ import { GridAggregationPosition } from './gridAggregationInterfaces';
2
4
  export declare const gridAggregationStateSelector: (state: GridStatePremium) => import("./gridAggregationInterfaces").GridAggregationState;
3
5
  /**
4
6
  * Get the aggregation model, containing the aggregation function of each column.
@@ -11,3 +13,10 @@ export declare const gridAggregationModelSelector: import("@mui/x-data-grid").Ou
11
13
  * @category Aggregation
12
14
  */
13
15
  export declare const gridAggregationLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationLookup>;
16
+ export declare const gridCellAggregationResultSelector: import("@mui/x-data-grid/utils/createSelector").OutputSelectorV8<GridStatePremium, {
17
+ id: GridRowId;
18
+ field: string;
19
+ }, {
20
+ position: GridAggregationPosition;
21
+ value: any;
22
+ } | null>;
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.gridAggregationStateSelector = exports.gridAggregationModelSelector = exports.gridAggregationLookupSelector = void 0;
6
+ exports.gridCellAggregationResultSelector = exports.gridAggregationStateSelector = exports.gridAggregationModelSelector = exports.gridAggregationLookupSelector = void 0;
7
7
  var _internals = require("@mui/x-data-grid-pro/internals");
8
+ var _xDataGrid = require("@mui/x-data-grid");
8
9
  const gridAggregationStateSelector = state => state.aggregation;
9
10
 
10
11
  /**
@@ -19,4 +20,30 @@ const gridAggregationModelSelector = exports.gridAggregationModelSelector = (0,
19
20
  * Get the aggregation results as a lookup.
20
21
  * @category Aggregation
21
22
  */
22
- const gridAggregationLookupSelector = exports.gridAggregationLookupSelector = (0, _internals.createSelector)(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
23
+ const gridAggregationLookupSelector = exports.gridAggregationLookupSelector = (0, _internals.createSelector)(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
24
+ const gridCellAggregationResultSelector = exports.gridCellAggregationResultSelector = (0, _internals.createSelectorV8)(_xDataGrid.gridRowTreeSelector, gridAggregationLookupSelector, (rowTree, aggregationLookup, {
25
+ id,
26
+ field
27
+ }) => {
28
+ let cellAggregationPosition = null;
29
+ const rowNode = rowTree[id];
30
+ if (!rowNode) {
31
+ return null;
32
+ }
33
+ if (rowNode.type === 'group') {
34
+ cellAggregationPosition = 'inline';
35
+ } else if (id.toString().startsWith('auto-generated-group-footer-')) {
36
+ cellAggregationPosition = 'footer';
37
+ }
38
+ if (cellAggregationPosition == null) {
39
+ return null;
40
+ }
41
+
42
+ // TODO: Add custom root id
43
+ const groupId = cellAggregationPosition === 'inline' ? id : rowNode.parent ?? '';
44
+ const aggregationResult = aggregationLookup?.[groupId]?.[field];
45
+ if (!aggregationResult || aggregationResult.position !== cellAggregationPosition) {
46
+ return null;
47
+ }
48
+ return aggregationResult;
49
+ });
@@ -1,4 +1,4 @@
1
1
  export * from './gridAggregationInterfaces';
2
- export * from './gridAggregationSelectors';
2
+ export { gridAggregationStateSelector, gridAggregationLookupSelector, gridAggregationModelSelector, } from './gridAggregationSelectors';
3
3
  export * from './gridAggregationFunctions';
4
4
  export { GRID_AGGREGATION_ROOT_FOOTER_ROW_ID, getAggregationFooterRowIdFromGroupId, } from './gridAggregationUtils';
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
+ gridAggregationStateSelector: true,
8
+ gridAggregationLookupSelector: true,
9
+ gridAggregationModelSelector: true,
7
10
  GRID_AGGREGATION_ROOT_FOOTER_ROW_ID: true,
8
11
  getAggregationFooterRowIdFromGroupId: true
9
12
  };
@@ -19,6 +22,24 @@ Object.defineProperty(exports, "getAggregationFooterRowIdFromGroupId", {
19
22
  return _gridAggregationUtils.getAggregationFooterRowIdFromGroupId;
20
23
  }
21
24
  });
25
+ Object.defineProperty(exports, "gridAggregationLookupSelector", {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _gridAggregationSelectors.gridAggregationLookupSelector;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "gridAggregationModelSelector", {
32
+ enumerable: true,
33
+ get: function () {
34
+ return _gridAggregationSelectors.gridAggregationModelSelector;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, "gridAggregationStateSelector", {
38
+ enumerable: true,
39
+ get: function () {
40
+ return _gridAggregationSelectors.gridAggregationStateSelector;
41
+ }
42
+ });
22
43
  var _gridAggregationInterfaces = require("./gridAggregationInterfaces");
23
44
  Object.keys(_gridAggregationInterfaces).forEach(function (key) {
24
45
  if (key === "default" || key === "__esModule") return;
@@ -32,17 +53,6 @@ Object.keys(_gridAggregationInterfaces).forEach(function (key) {
32
53
  });
33
54
  });
34
55
  var _gridAggregationSelectors = require("./gridAggregationSelectors");
35
- Object.keys(_gridAggregationSelectors).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
38
- if (key in exports && exports[key] === _gridAggregationSelectors[key]) return;
39
- Object.defineProperty(exports, key, {
40
- enumerable: true,
41
- get: function () {
42
- return _gridAggregationSelectors[key];
43
- }
44
- });
45
- });
46
56
  var _gridAggregationFunctions = require("./gridAggregationFunctions");
47
57
  Object.keys(_gridAggregationFunctions).forEach(function (key) {
48
58
  if (key === "default" || key === "__esModule") return;
@@ -29,10 +29,7 @@ const useGridDataSourceRowGroupingPreProcessors = (apiRef, props) => {
29
29
  apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation = groupingRules;
30
30
  const getRowTreeBuilderNode = rowId => {
31
31
  const parentPath = params.updates.groupKeys ?? [];
32
- const row = params.dataRowIdToModelLookup[rowId];
33
- const groupingRule = groupingRules[parentPath.length];
34
- const groupingValueGetter = groupingRule?.groupingValueGetter;
35
- const leafKey = groupingValueGetter?.(row[groupingRule.field], row, columnsLookup[groupingRule.field], apiRef) ?? getGroupKey(params.dataRowIdToModelLookup[rowId]);
32
+ const leafKey = getGroupKey(params.dataRowIdToModelLookup[rowId]);
36
33
  return {
37
34
  id: rowId,
38
35
  path: [...parentPath, leafKey ?? rowId.toString()].map((key, i) => ({
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v7.28.3
2
+ * @mui/x-data-grid-premium v7.29.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../esm/locales/index.js",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -5,18 +5,27 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useLicenseVerifier, Watermark } from '@mui/x-license';
7
7
  import { GridRoot, GridContextProvider } from '@mui/x-data-grid-pro';
8
- import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps } from '@mui/x-data-grid-pro/internals';
8
+ import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps, useGridSelectorV8 } from '@mui/x-data-grid-pro/internals';
9
9
  import { forwardRef } from '@mui/x-internals/forwardRef';
10
10
  import { useDataGridPremiumComponent } from "./useDataGridPremiumComponent.js";
11
11
  import { useDataGridPremiumProps } from "./useDataGridPremiumProps.js";
12
12
  import { getReleaseInfo } from "../utils/releaseInfo.js";
13
13
  import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
14
14
  import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
15
+ import { gridCellAggregationResultSelector } from "../hooks/features/aggregation/gridAggregationSelectors.js";
16
+ import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
15
17
  import { jsx as _jsx } from "react/jsx-runtime";
16
18
  const configuration = {
17
19
  hooks: {
18
20
  useGridAriaAttributes,
19
- useGridRowAriaAttributes
21
+ useGridRowAriaAttributes,
22
+ useCellAggregationResult: (id, field) => {
23
+ const apiRef = useGridApiContext();
24
+ return useGridSelectorV8(apiRef, gridCellAggregationResultSelector, {
25
+ id,
26
+ field
27
+ });
28
+ }
20
29
  }
21
30
  };
22
31
  const releaseInfo = getReleaseInfo();
@@ -1,4 +1,5 @@
1
- import { createSelector } from '@mui/x-data-grid-pro/internals';
1
+ import { createSelector, createSelectorV8 } from '@mui/x-data-grid-pro/internals';
2
+ import { gridRowTreeSelector } from '@mui/x-data-grid';
2
3
  export const gridAggregationStateSelector = state => state.aggregation;
3
4
 
4
5
  /**
@@ -12,4 +13,30 @@ export const gridAggregationModelSelector = createSelector(gridAggregationStateS
12
13
  * Get the aggregation results as a lookup.
13
14
  * @category Aggregation
14
15
  */
15
- export const gridAggregationLookupSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
16
+ export const gridAggregationLookupSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
17
+ export const gridCellAggregationResultSelector = createSelectorV8(gridRowTreeSelector, gridAggregationLookupSelector, (rowTree, aggregationLookup, {
18
+ id,
19
+ field
20
+ }) => {
21
+ let cellAggregationPosition = null;
22
+ const rowNode = rowTree[id];
23
+ if (!rowNode) {
24
+ return null;
25
+ }
26
+ if (rowNode.type === 'group') {
27
+ cellAggregationPosition = 'inline';
28
+ } else if (id.toString().startsWith('auto-generated-group-footer-')) {
29
+ cellAggregationPosition = 'footer';
30
+ }
31
+ if (cellAggregationPosition == null) {
32
+ return null;
33
+ }
34
+
35
+ // TODO: Add custom root id
36
+ const groupId = cellAggregationPosition === 'inline' ? id : rowNode.parent ?? '';
37
+ const aggregationResult = aggregationLookup?.[groupId]?.[field];
38
+ if (!aggregationResult || aggregationResult.position !== cellAggregationPosition) {
39
+ return null;
40
+ }
41
+ return aggregationResult;
42
+ });
@@ -1,4 +1,4 @@
1
1
  export * from "./gridAggregationInterfaces.js";
2
- export * from "./gridAggregationSelectors.js";
2
+ export { gridAggregationStateSelector, gridAggregationLookupSelector, gridAggregationModelSelector } from "./gridAggregationSelectors.js";
3
3
  export * from "./gridAggregationFunctions.js";
4
4
  export { GRID_AGGREGATION_ROOT_FOOTER_ROW_ID, getAggregationFooterRowIdFromGroupId } from "./gridAggregationUtils.js";
@@ -22,10 +22,7 @@ export const useGridDataSourceRowGroupingPreProcessors = (apiRef, props) => {
22
22
  apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation = groupingRules;
23
23
  const getRowTreeBuilderNode = rowId => {
24
24
  const parentPath = params.updates.groupKeys ?? [];
25
- const row = params.dataRowIdToModelLookup[rowId];
26
- const groupingRule = groupingRules[parentPath.length];
27
- const groupingValueGetter = groupingRule?.groupingValueGetter;
28
- const leafKey = groupingValueGetter?.(row[groupingRule.field], row, columnsLookup[groupingRule.field], apiRef) ?? getGroupKey(params.dataRowIdToModelLookup[rowId]);
25
+ const leafKey = getGroupKey(params.dataRowIdToModelLookup[rowId]);
29
26
  return {
30
27
  id: rowId,
31
28
  path: [...parentPath, leafKey ?? rowId.toString()].map((key, i) => ({
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v7.28.3
2
+ * @mui/x-data-grid-premium v7.29.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTc0MzYzMTIwMDAwMA==";
3
+ const releaseInfo = "MTc0NTM1OTIwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-premium",
3
- "version": "7.28.3",
3
+ "version": "7.29.1",
4
4
  "description": "The Premium plan edition of the Data Grid Components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -34,22 +34,22 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.25.7",
37
- "@mui/utils": "^5.16.6 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta",
37
+ "@mui/utils": "^5.16.6 || ^6.0.0 || ^7.0.0",
38
38
  "@types/format-util": "^1.0.4",
39
39
  "clsx": "^2.1.1",
40
40
  "exceljs": "^4.4.0",
41
41
  "prop-types": "^15.8.1",
42
42
  "reselect": "^5.1.1",
43
- "@mui/x-data-grid": "7.28.3",
44
- "@mui/x-data-grid-pro": "7.28.3",
45
- "@mui/x-license": "7.28.0",
46
- "@mui/x-internals": "7.28.0"
43
+ "@mui/x-data-grid-pro": "7.29.1",
44
+ "@mui/x-data-grid": "7.29.1",
45
+ "@mui/x-license": "7.29.1",
46
+ "@mui/x-internals": "7.29.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@emotion/react": "^11.9.0",
50
50
  "@emotion/styled": "^11.8.1",
51
- "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta",
52
- "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta",
51
+ "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0",
52
+ "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0",
53
53
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
54
54
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
55
55
  },
@@ -58,6 +58,7 @@ export interface GridColDefPremium<R extends GridValidRowModel = any, V = any, F
58
58
  availableAggregationFunctions?: string[];
59
59
  /**
60
60
  * Function that transforms a complex cell value into a key that be used for grouping the rows.
61
+ * Not supported with the server-side row grouping. Use `dataSource.getGroupKey()` instead.
61
62
  * @returns {GridKeyValue | null | undefined} The cell key.
62
63
  */
63
64
  groupingValueGetter?: GridGroupingValueGetter<R>;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getReleaseInfo = void 0;
7
7
  var _utils = require("@mui/utils");
8
8
  const getReleaseInfo = () => {
9
- const releaseInfo = "MTc0MzYzMTIwMDAwMA==";
9
+ const releaseInfo = "MTc0NTM1OTIwMDAwMA==";
10
10
  if (process.env.NODE_ENV !== 'production') {
11
11
  // A simple hack to set the value in the test environment (has no build step).
12
12
  // eslint-disable-next-line no-useless-concat
File without changes
File without changes
File without changes
File without changes