@mui/x-data-grid-premium 5.17.15 → 5.17.16
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 +26 -0
- package/hooks/features/aggregation/gridAggregationSelectors.d.ts +9 -0
- package/hooks/features/aggregation/gridAggregationSelectors.js +11 -0
- package/hooks/features/aggregation/useGridAggregationPreProcessors.js +5 -4
- package/index.js +1 -1
- package/legacy/hooks/features/aggregation/gridAggregationSelectors.js +11 -0
- package/legacy/hooks/features/aggregation/useGridAggregationPreProcessors.js +5 -2
- package/legacy/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/modern/hooks/features/aggregation/gridAggregationSelectors.js +11 -0
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +5 -4
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/hooks/features/aggregation/gridAggregationSelectors.js +11 -0
- package/node/hooks/features/aggregation/useGridAggregationPreProcessors.js +5 -4
- package/node/index.js +1 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +3 -3
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,32 @@
|
|
|
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
|
+
## 5.17.16
|
|
7
|
+
|
|
8
|
+
_Dec 16, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🐞 Bugfixes
|
|
13
|
+
|
|
14
|
+
### `@mui/x-data-grid@v5.17.16` / `@mui/x-data-grid-pro@v5.17.16` / `@mui/x-data-grid-premium@v5.17.16`
|
|
15
|
+
|
|
16
|
+
#### Changes
|
|
17
|
+
|
|
18
|
+
- [DataGrid] Display sort column menu items as per `sortingOrder` prop (#7125) @hanbin9775
|
|
19
|
+
- [DataGrid] Fix flickering on mount (#7155) @cherniavskii
|
|
20
|
+
- [DataGridPremium] Use separate cache for aggregation columns pre-processor (#7174) @m4theushw
|
|
21
|
+
|
|
22
|
+
### `@mui/x-date-pickers@v5.0.11` / `@mui/x-date-pickers-pro@v5.0.11`
|
|
23
|
+
|
|
24
|
+
#### Changes
|
|
25
|
+
|
|
26
|
+
- [DateTimePicker] Update export pattern (#7172) @kealjones-wk
|
|
27
|
+
|
|
28
|
+
### Docs
|
|
29
|
+
|
|
30
|
+
- [docs] Document aggregation selectors (#7151) @cherniavskii
|
|
31
|
+
|
|
6
32
|
## 5.17.15
|
|
7
33
|
|
|
8
34
|
_Dec 8, 2022_
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { GridStatePremium } from '../../../models/gridStatePremium';
|
|
2
2
|
export declare const gridAggregationStateSelector: (state: GridStatePremium) => import("./gridAggregationInterfaces").GridAggregationState;
|
|
3
|
+
/**
|
|
4
|
+
* Get the aggregation model, containing the aggregation function of each column.
|
|
5
|
+
* If a column is not in the model, it is not aggregated.
|
|
6
|
+
* @category Aggregation
|
|
7
|
+
*/
|
|
3
8
|
export declare const gridAggregationModelSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationModel>;
|
|
9
|
+
/**
|
|
10
|
+
* Get the aggregation results as a lookup.
|
|
11
|
+
* @category Aggregation
|
|
12
|
+
*/
|
|
4
13
|
export declare const gridAggregationLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationLookup>;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { createSelector } from '@mui/x-data-grid-pro/internals';
|
|
2
2
|
export const gridAggregationStateSelector = state => state.aggregation;
|
|
3
|
+
/**
|
|
4
|
+
* Get the aggregation model, containing the aggregation function of each column.
|
|
5
|
+
* If a column is not in the model, it is not aggregated.
|
|
6
|
+
* @category Aggregation
|
|
7
|
+
*/
|
|
8
|
+
|
|
3
9
|
export const gridAggregationModelSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.model);
|
|
10
|
+
/**
|
|
11
|
+
* Get the aggregation results as a lookup.
|
|
12
|
+
* @category Aggregation
|
|
13
|
+
*/
|
|
14
|
+
|
|
4
15
|
export const gridAggregationLookupSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
|
|
@@ -14,10 +14,10 @@ const Divider = () => /*#__PURE__*/_jsx(MuiDivider, {
|
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
17
|
+
// apiRef.current.caches.aggregation.rulesOnLastColumnHydration is not used because by the time
|
|
18
|
+
// that the pre-processor is called it will already have been updated with the current rules.
|
|
19
|
+
const rulesOnLastColumnHydration = React.useRef({});
|
|
17
20
|
const updateAggregatedColumns = React.useCallback(columnsState => {
|
|
18
|
-
const {
|
|
19
|
-
rulesOnLastColumnHydration
|
|
20
|
-
} = apiRef.current.unstable_caches.aggregation;
|
|
21
21
|
const aggregationRules = props.disableAggregation ? {} : getAggregationRules({
|
|
22
22
|
columnsLookup: columnsState.lookup,
|
|
23
23
|
aggregationModel: gridAggregationModelSelector(apiRef),
|
|
@@ -25,7 +25,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
25
25
|
});
|
|
26
26
|
columnsState.all.forEach(field => {
|
|
27
27
|
const shouldHaveAggregationValue = !!aggregationRules[field];
|
|
28
|
-
const haveAggregationColumnValue = !!rulesOnLastColumnHydration[field];
|
|
28
|
+
const haveAggregationColumnValue = !!rulesOnLastColumnHydration.current[field];
|
|
29
29
|
let column = columnsState.lookup[field];
|
|
30
30
|
|
|
31
31
|
if (haveAggregationColumnValue) {
|
|
@@ -44,6 +44,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
44
44
|
|
|
45
45
|
columnsState.lookup[field] = column;
|
|
46
46
|
});
|
|
47
|
+
rulesOnLastColumnHydration.current = aggregationRules;
|
|
47
48
|
return columnsState;
|
|
48
49
|
}, [apiRef, props.aggregationFunctions, props.disableAggregation]);
|
|
49
50
|
const addGroupFooterRows = React.useCallback(groupingParams => {
|
package/index.js
CHANGED
|
@@ -2,9 +2,20 @@ import { createSelector } from '@mui/x-data-grid-pro/internals';
|
|
|
2
2
|
export var gridAggregationStateSelector = function gridAggregationStateSelector(state) {
|
|
3
3
|
return state.aggregation;
|
|
4
4
|
};
|
|
5
|
+
/**
|
|
6
|
+
* Get the aggregation model, containing the aggregation function of each column.
|
|
7
|
+
* If a column is not in the model, it is not aggregated.
|
|
8
|
+
* @category Aggregation
|
|
9
|
+
*/
|
|
10
|
+
|
|
5
11
|
export var gridAggregationModelSelector = createSelector(gridAggregationStateSelector, function (aggregationState) {
|
|
6
12
|
return aggregationState.model;
|
|
7
13
|
});
|
|
14
|
+
/**
|
|
15
|
+
* Get the aggregation results as a lookup.
|
|
16
|
+
* @category Aggregation
|
|
17
|
+
*/
|
|
18
|
+
|
|
8
19
|
export var gridAggregationLookupSelector = createSelector(gridAggregationStateSelector, function (aggregationState) {
|
|
9
20
|
return aggregationState.lookup;
|
|
10
21
|
});
|
|
@@ -19,8 +19,10 @@ var Divider = function Divider() {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export var useGridAggregationPreProcessors = function useGridAggregationPreProcessors(apiRef, props) {
|
|
22
|
+
// apiRef.current.caches.aggregation.rulesOnLastColumnHydration is not used because by the time
|
|
23
|
+
// that the pre-processor is called it will already have been updated with the current rules.
|
|
24
|
+
var rulesOnLastColumnHydration = React.useRef({});
|
|
22
25
|
var updateAggregatedColumns = React.useCallback(function (columnsState) {
|
|
23
|
-
var rulesOnLastColumnHydration = apiRef.current.unstable_caches.aggregation.rulesOnLastColumnHydration;
|
|
24
26
|
var aggregationRules = props.disableAggregation ? {} : getAggregationRules({
|
|
25
27
|
columnsLookup: columnsState.lookup,
|
|
26
28
|
aggregationModel: gridAggregationModelSelector(apiRef),
|
|
@@ -28,7 +30,7 @@ export var useGridAggregationPreProcessors = function useGridAggregationPreProce
|
|
|
28
30
|
});
|
|
29
31
|
columnsState.all.forEach(function (field) {
|
|
30
32
|
var shouldHaveAggregationValue = !!aggregationRules[field];
|
|
31
|
-
var haveAggregationColumnValue = !!rulesOnLastColumnHydration[field];
|
|
33
|
+
var haveAggregationColumnValue = !!rulesOnLastColumnHydration.current[field];
|
|
32
34
|
var column = columnsState.lookup[field];
|
|
33
35
|
|
|
34
36
|
if (haveAggregationColumnValue) {
|
|
@@ -47,6 +49,7 @@ export var useGridAggregationPreProcessors = function useGridAggregationPreProce
|
|
|
47
49
|
|
|
48
50
|
columnsState.lookup[field] = column;
|
|
49
51
|
});
|
|
52
|
+
rulesOnLastColumnHydration.current = aggregationRules;
|
|
50
53
|
return columnsState;
|
|
51
54
|
}, [apiRef, props.aggregationFunctions, props.disableAggregation]);
|
|
52
55
|
var addGroupFooterRows = React.useCallback(function (groupingParams) {
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY3MTE0NTIwMDAwMA==";
|
|
4
4
|
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
// A simple hack to set the value in the test environment (has no build step).
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { createSelector } from '@mui/x-data-grid-pro/internals';
|
|
2
2
|
export const gridAggregationStateSelector = state => state.aggregation;
|
|
3
|
+
/**
|
|
4
|
+
* Get the aggregation model, containing the aggregation function of each column.
|
|
5
|
+
* If a column is not in the model, it is not aggregated.
|
|
6
|
+
* @category Aggregation
|
|
7
|
+
*/
|
|
8
|
+
|
|
3
9
|
export const gridAggregationModelSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.model);
|
|
10
|
+
/**
|
|
11
|
+
* Get the aggregation results as a lookup.
|
|
12
|
+
* @category Aggregation
|
|
13
|
+
*/
|
|
14
|
+
|
|
4
15
|
export const gridAggregationLookupSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
|
|
@@ -14,10 +14,10 @@ const Divider = () => /*#__PURE__*/_jsx(MuiDivider, {
|
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
17
|
+
// apiRef.current.caches.aggregation.rulesOnLastColumnHydration is not used because by the time
|
|
18
|
+
// that the pre-processor is called it will already have been updated with the current rules.
|
|
19
|
+
const rulesOnLastColumnHydration = React.useRef({});
|
|
17
20
|
const updateAggregatedColumns = React.useCallback(columnsState => {
|
|
18
|
-
const {
|
|
19
|
-
rulesOnLastColumnHydration
|
|
20
|
-
} = apiRef.current.unstable_caches.aggregation;
|
|
21
21
|
const aggregationRules = props.disableAggregation ? {} : getAggregationRules({
|
|
22
22
|
columnsLookup: columnsState.lookup,
|
|
23
23
|
aggregationModel: gridAggregationModelSelector(apiRef),
|
|
@@ -25,7 +25,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
25
25
|
});
|
|
26
26
|
columnsState.all.forEach(field => {
|
|
27
27
|
const shouldHaveAggregationValue = !!aggregationRules[field];
|
|
28
|
-
const haveAggregationColumnValue = !!rulesOnLastColumnHydration[field];
|
|
28
|
+
const haveAggregationColumnValue = !!rulesOnLastColumnHydration.current[field];
|
|
29
29
|
let column = columnsState.lookup[field];
|
|
30
30
|
|
|
31
31
|
if (haveAggregationColumnValue) {
|
|
@@ -44,6 +44,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
44
44
|
|
|
45
45
|
columnsState.lookup[field] = column;
|
|
46
46
|
});
|
|
47
|
+
rulesOnLastColumnHydration.current = aggregationRules;
|
|
47
48
|
return columnsState;
|
|
48
49
|
}, [apiRef, props.aggregationFunctions, props.disableAggregation]);
|
|
49
50
|
const addGroupFooterRows = React.useCallback(groupingParams => {
|
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 = "MTY3MTE0NTIwMDAwMA==";
|
|
4
4
|
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
// A simple hack to set the value in the test environment (has no build step).
|
|
@@ -8,9 +8,20 @@ exports.gridAggregationStateSelector = exports.gridAggregationModelSelector = ex
|
|
|
8
8
|
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
9
9
|
|
|
10
10
|
const gridAggregationStateSelector = state => state.aggregation;
|
|
11
|
+
/**
|
|
12
|
+
* Get the aggregation model, containing the aggregation function of each column.
|
|
13
|
+
* If a column is not in the model, it is not aggregated.
|
|
14
|
+
* @category Aggregation
|
|
15
|
+
*/
|
|
16
|
+
|
|
11
17
|
|
|
12
18
|
exports.gridAggregationStateSelector = gridAggregationStateSelector;
|
|
13
19
|
const gridAggregationModelSelector = (0, _internals.createSelector)(gridAggregationStateSelector, aggregationState => aggregationState.model);
|
|
20
|
+
/**
|
|
21
|
+
* Get the aggregation results as a lookup.
|
|
22
|
+
* @category Aggregation
|
|
23
|
+
*/
|
|
24
|
+
|
|
14
25
|
exports.gridAggregationModelSelector = gridAggregationModelSelector;
|
|
15
26
|
const gridAggregationLookupSelector = (0, _internals.createSelector)(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
|
|
16
27
|
exports.gridAggregationLookupSelector = gridAggregationLookupSelector;
|
|
@@ -36,10 +36,10 @@ const Divider = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
39
|
+
// apiRef.current.caches.aggregation.rulesOnLastColumnHydration is not used because by the time
|
|
40
|
+
// that the pre-processor is called it will already have been updated with the current rules.
|
|
41
|
+
const rulesOnLastColumnHydration = React.useRef({});
|
|
39
42
|
const updateAggregatedColumns = React.useCallback(columnsState => {
|
|
40
|
-
const {
|
|
41
|
-
rulesOnLastColumnHydration
|
|
42
|
-
} = apiRef.current.unstable_caches.aggregation;
|
|
43
43
|
const aggregationRules = props.disableAggregation ? {} : (0, _gridAggregationUtils.getAggregationRules)({
|
|
44
44
|
columnsLookup: columnsState.lookup,
|
|
45
45
|
aggregationModel: (0, _gridAggregationSelectors.gridAggregationModelSelector)(apiRef),
|
|
@@ -47,7 +47,7 @@ const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
47
47
|
});
|
|
48
48
|
columnsState.all.forEach(field => {
|
|
49
49
|
const shouldHaveAggregationValue = !!aggregationRules[field];
|
|
50
|
-
const haveAggregationColumnValue = !!rulesOnLastColumnHydration[field];
|
|
50
|
+
const haveAggregationColumnValue = !!rulesOnLastColumnHydration.current[field];
|
|
51
51
|
let column = columnsState.lookup[field];
|
|
52
52
|
|
|
53
53
|
if (haveAggregationColumnValue) {
|
|
@@ -66,6 +66,7 @@ const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
66
66
|
|
|
67
67
|
columnsState.lookup[field] = column;
|
|
68
68
|
});
|
|
69
|
+
rulesOnLastColumnHydration.current = aggregationRules;
|
|
69
70
|
return columnsState;
|
|
70
71
|
}, [apiRef, props.aggregationFunctions, props.disableAggregation]);
|
|
71
72
|
const addGroupFooterRows = React.useCallback(groupingParams => {
|
package/node/index.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.getReleaseInfo = void 0;
|
|
|
8
8
|
var _utils = require("@mui/utils");
|
|
9
9
|
|
|
10
10
|
const getReleaseInfo = () => {
|
|
11
|
-
const releaseInfo = "
|
|
11
|
+
const releaseInfo = "MTY3MTE0NTIwMDAwMA==";
|
|
12
12
|
|
|
13
13
|
if (process.env.NODE_ENV !== 'production') {
|
|
14
14
|
// A simple hack to set the value in the test environment (has no build step).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-premium",
|
|
3
|
-
"version": "5.17.
|
|
3
|
+
"version": "5.17.16",
|
|
4
4
|
"description": "The Premium plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.18.9",
|
|
35
35
|
"@mui/utils": "^5.10.3",
|
|
36
|
-
"@mui/x-data-grid": "5.17.
|
|
37
|
-
"@mui/x-data-grid-pro": "5.17.
|
|
36
|
+
"@mui/x-data-grid": "5.17.16",
|
|
37
|
+
"@mui/x-data-grid-pro": "5.17.16",
|
|
38
38
|
"@mui/x-license-pro": "5.17.12",
|
|
39
39
|
"@types/format-util": "^1.0.2",
|
|
40
40
|
"clsx": "^1.2.1",
|
package/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 = "MTY3MTE0NTIwMDAwMA==";
|
|
4
4
|
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
// A simple hack to set the value in the test environment (has no build step).
|