@mui/x-data-grid-premium 7.28.3 → 7.29.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.
- package/CHANGELOG.md +78 -0
- package/DataGridPremium/DataGridPremium.js +10 -1
- package/esm/DataGridPremium/DataGridPremium.js +11 -2
- package/esm/hooks/features/aggregation/gridAggregationSelectors.js +29 -2
- package/esm/hooks/features/aggregation/index.js +1 -1
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/aggregation/gridAggregationSelectors.d.ts +9 -0
- package/hooks/features/aggregation/gridAggregationSelectors.js +29 -2
- package/hooks/features/aggregation/index.d.ts +1 -1
- package/hooks/features/aggregation/index.js +21 -11
- package/index.js +1 -1
- package/modern/DataGridPremium/DataGridPremium.js +11 -2
- package/modern/hooks/features/aggregation/gridAggregationSelectors.js +29 -2
- package/modern/hooks/features/aggregation/index.js +1 -1
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +8 -8
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,84 @@
|
|
|
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.0
|
|
7
|
+
|
|
8
|
+
_Apr 16, 2025_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🐞 Bugfixes
|
|
13
|
+
- 🌍 Improve Hebrew (he-IL), Polish (pl-PL), and Swedish (sv-SE) locales on the Data Grid
|
|
14
|
+
- 🌍 Improve Czech (cs-CZ) and Slovak (sk-SK) locales on the Date and Time Pickers
|
|
15
|
+
|
|
16
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
17
|
+
@lubka272, @ptuukkan, @iddan, @sofortdagmbh
|
|
18
|
+
|
|
19
|
+
Following are all team members who have contributed to this release:
|
|
20
|
+
@michelengelen, @oliviertassinari, @michelengelen, @LukasTy.
|
|
21
|
+
|
|
22
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
23
|
+
|
|
24
|
+
### Data Grid
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid@7.29.0`
|
|
27
|
+
|
|
28
|
+
- [l10n] Improve Swedish (sv-SE) locale (#17306) @ptuukkan
|
|
29
|
+
- [l10n] Improve Hebrew (he-IL) locale (#16516) @iddan
|
|
30
|
+
- [l10n] Improve Polish (pl-PL) locale (#17306) @sofortdagmbh
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid-pro@7.29.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
33
|
+
|
|
34
|
+
Same changes as in `@mui/x-data-grid@7.29.0`.
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-premium@7.29.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid-pro@7.29.0`, plus:
|
|
39
|
+
|
|
40
|
+
- [DataGridPremium] Fix stale aggregation results after filtering (#17303) @cherniavskii
|
|
41
|
+
- [DataGridPremium] Fix aggregated values sorting (#17382) @cherniavskii
|
|
42
|
+
|
|
43
|
+
### Date and Time Pickers
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-date-pickers@7.29.0`
|
|
46
|
+
|
|
47
|
+
- [l10n] Improve Slovak (sk-SK) locale (#17204) @lubka272
|
|
48
|
+
- [l10n] Improve Czech (cs-CZ) locale (#17205) @lubka272
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-date-pickers-pro@7.29.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
51
|
+
|
|
52
|
+
Same changes as in `@mui/x-date-pickers@7.29.0`.
|
|
53
|
+
|
|
54
|
+
### Charts
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-charts@7.29.0`
|
|
57
|
+
|
|
58
|
+
Internal changes.
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-charts-pro@7.29.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
61
|
+
|
|
62
|
+
Same changes as in `@mui/x-charts@7.29.0`.
|
|
63
|
+
|
|
64
|
+
### Tree View
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-tree-view@7.29.0`
|
|
67
|
+
|
|
68
|
+
Internal changes.
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-tree-view-pro@7.29.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
71
|
+
|
|
72
|
+
Same changes as in `@mui/x-tree-view@7.29.0`.
|
|
73
|
+
|
|
74
|
+
### Core
|
|
75
|
+
|
|
76
|
+
- [core] Cleanup `@mui` dependency versions (#17390) @LukasTy
|
|
77
|
+
|
|
78
|
+
### Docs
|
|
79
|
+
|
|
80
|
+
- [docs] Fix 404 link on the marketing page (#17276) @oliviertassinari
|
|
81
|
+
- [docs] Fix country columns throwing on grouping (#17317) @cherniavskii
|
|
82
|
+
- [release] Changes to v7 for major release (#17320) @michelengelen
|
|
83
|
+
|
|
6
84
|
## 7.28.3
|
|
7
85
|
|
|
8
86
|
_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
|
|
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";
|
package/esm/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTc0NDc1NDQwMDAwMA==";
|
|
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
|
|
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;
|
package/index.js
CHANGED
|
@@ -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
|
|
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";
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTc0NDc1NDQwMDAwMA==";
|
|
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.
|
|
3
|
+
"version": "7.29.0",
|
|
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
|
|
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-
|
|
44
|
-
"@mui/x-data-grid-pro": "7.
|
|
45
|
-
"@mui/x-
|
|
46
|
-
"@mui/x-
|
|
43
|
+
"@mui/x-license": "7.29.0",
|
|
44
|
+
"@mui/x-data-grid-pro": "7.29.0",
|
|
45
|
+
"@mui/x-internals": "7.29.0",
|
|
46
|
+
"@mui/x-data-grid": "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
|
|
52
|
-
"@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0
|
|
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
|
},
|
package/utils/releaseInfo.js
CHANGED
|
@@ -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 = "
|
|
9
|
+
const releaseInfo = "MTc0NDc1NDQwMDAwMA==";
|
|
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
|