@mui/x-data-grid-premium 5.17.14 → 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 +54 -0
- package/DataGridPremium/useDataGridPremiumComponent.js +3 -1
- package/hooks/features/aggregation/createAggregationLookup.js +4 -1
- package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +3 -1
- 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/DataGridPremium/useDataGridPremiumComponent.js +3 -1
- package/legacy/hooks/features/aggregation/createAggregationLookup.js +4 -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/DataGridPremium/useDataGridPremiumComponent.js +3 -1
- package/modern/hooks/features/aggregation/createAggregationLookup.js +4 -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/DataGridPremium/useDataGridPremiumComponent.js +2 -0
- package/node/hooks/features/aggregation/createAggregationLookup.js +4 -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,60 @@
|
|
|
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
|
+
|
|
32
|
+
## 5.17.15
|
|
33
|
+
|
|
34
|
+
_Dec 8, 2022_
|
|
35
|
+
|
|
36
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
37
|
+
|
|
38
|
+
- ✨ Fix lazy-loading not working in `DataGridPremium` (#7130) @m4theushw
|
|
39
|
+
- 🐞 Bugfixes
|
|
40
|
+
|
|
41
|
+
### `@mui/x-data-grid@v5.17.15` / `@mui/x-data-grid-pro@v5.17.15` / `@mui/x-data-grid-premium@v5.17.15`
|
|
42
|
+
|
|
43
|
+
#### Changes
|
|
44
|
+
|
|
45
|
+
- [DataGridPremium] Add support for lazy-loading (#7130) @m4theushw
|
|
46
|
+
- [DataGridPremium] Pass `groupId` to the aggregation function (#7143) @m4theushw
|
|
47
|
+
|
|
48
|
+
### `@mui/x-date-pickers@v5.0.10` / `@mui/x-date-pickers-pro@v5.0.10`
|
|
49
|
+
|
|
50
|
+
#### Changes
|
|
51
|
+
|
|
52
|
+
- [pickers] Initialize date without time when selecting year or month (#7136) @LukasTy
|
|
53
|
+
|
|
54
|
+
### Docs
|
|
55
|
+
|
|
56
|
+
- [docs] Fix the nested import on the api pages (#7134) @flaviendelangle
|
|
57
|
+
- [docs] Keep track of the localization completion (#7099) @alexfauquette
|
|
58
|
+
- [docs] Update localization doc to use existing locale (#7104) @LukasTy
|
|
59
|
+
|
|
6
60
|
## 5.17.14
|
|
7
61
|
|
|
8
62
|
_Dec 1, 2022_
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridColumnGroupingPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer } 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_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridColumnGroupingPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors } from '@mui/x-data-grid-pro/internals';
|
|
2
2
|
// Premium-only features
|
|
3
3
|
import { useGridAggregation, aggregationStateInitializer } from '../hooks/features/aggregation/useGridAggregation';
|
|
4
4
|
import { useGridAggregationPreProcessors } from '../hooks/features/aggregation/useGridAggregationPreProcessors';
|
|
@@ -18,6 +18,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
18
18
|
useGridRowReorderPreProcessors(apiRef, props);
|
|
19
19
|
useGridRowGroupingPreProcessors(apiRef, props);
|
|
20
20
|
useGridTreeDataPreProcessors(apiRef, props);
|
|
21
|
+
useGridLazyLoaderPreProcessors(apiRef, props);
|
|
21
22
|
useGridRowPinningPreProcessors(apiRef);
|
|
22
23
|
useGridAggregationPreProcessors(apiRef, props);
|
|
23
24
|
useGridDetailPanelPreProcessors(apiRef, props); // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
|
|
@@ -76,6 +77,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
76
77
|
useGridRowReorder(apiRef, props);
|
|
77
78
|
useGridScroll(apiRef, props);
|
|
78
79
|
useGridInfiniteLoader(apiRef, props);
|
|
80
|
+
useGridLazyLoader(apiRef, props);
|
|
79
81
|
useGridColumnMenu(apiRef);
|
|
80
82
|
useGridCsvExport(apiRef);
|
|
81
83
|
useGridPrintExport(apiRef, props);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridValueFormatterParams, GridRowId, GridRowModel } from '@mui/x-data-grid-pro';
|
|
1
|
+
import { GridValueFormatterParams, GridRowId, GridRowModel, GridColDef } from '@mui/x-data-grid-pro';
|
|
2
2
|
export interface GridAggregationState {
|
|
3
3
|
model: GridAggregationModel;
|
|
4
4
|
lookup: GridAggregationLookup;
|
|
@@ -70,6 +70,8 @@ export interface GridAggregationFunction<V = any, AV = V, FAV = AV> {
|
|
|
70
70
|
}
|
|
71
71
|
interface GridAggregationParams<V = any> {
|
|
72
72
|
values: (V | undefined)[];
|
|
73
|
+
groupId: GridRowId;
|
|
74
|
+
field: GridColDef['field'];
|
|
73
75
|
}
|
|
74
76
|
export declare type GridAggregationModel = {
|
|
75
77
|
[field: string]: string;
|
|
@@ -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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridColumnGroupingPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer } 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_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridColumnGroupingPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors } from '@mui/x-data-grid-pro/internals';
|
|
2
2
|
// Premium-only features
|
|
3
3
|
import { useGridAggregation, aggregationStateInitializer } from '../hooks/features/aggregation/useGridAggregation';
|
|
4
4
|
import { useGridAggregationPreProcessors } from '../hooks/features/aggregation/useGridAggregationPreProcessors';
|
|
@@ -18,6 +18,7 @@ export var useDataGridPremiumComponent = function useDataGridPremiumComponent(in
|
|
|
18
18
|
useGridRowReorderPreProcessors(apiRef, props);
|
|
19
19
|
useGridRowGroupingPreProcessors(apiRef, props);
|
|
20
20
|
useGridTreeDataPreProcessors(apiRef, props);
|
|
21
|
+
useGridLazyLoaderPreProcessors(apiRef, props);
|
|
21
22
|
useGridRowPinningPreProcessors(apiRef);
|
|
22
23
|
useGridAggregationPreProcessors(apiRef, props);
|
|
23
24
|
useGridDetailPanelPreProcessors(apiRef, props); // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
|
|
@@ -76,6 +77,7 @@ export var useDataGridPremiumComponent = function useDataGridPremiumComponent(in
|
|
|
76
77
|
useGridRowReorder(apiRef, props);
|
|
77
78
|
useGridScroll(apiRef, props);
|
|
78
79
|
useGridInfiniteLoader(apiRef, props);
|
|
80
|
+
useGridLazyLoader(apiRef, props);
|
|
79
81
|
useGridColumnMenu(apiRef);
|
|
80
82
|
useGridCsvExport(apiRef);
|
|
81
83
|
useGridPrintExport(apiRef, props);
|
|
@@ -53,7 +53,10 @@ var getAggregationCellValue = function getAggregationCellValue(_ref) {
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
return aggregationFunction.apply({
|
|
56
|
-
values: values
|
|
56
|
+
values: values,
|
|
57
|
+
groupId: groupId,
|
|
58
|
+
field: field // Added per user request in https://github.com/mui/mui-x/issues/6995#issuecomment-1327423455
|
|
59
|
+
|
|
57
60
|
});
|
|
58
61
|
};
|
|
59
62
|
|
|
@@ -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,4 @@
|
|
|
1
|
-
import { useGridInitialization, useGridInitializeState, useGridClipboard, useGridColumnMenu, useGridColumns, columnsStateInitializer, useGridDensity, useGridCsvExport, useGridPrintExport, useGridFilter, filterStateInitializer, useGridFocus, useGridKeyboardNavigation, useGridPagination, paginationStateInitializer, useGridPreferencesPanel, useGridEditing_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridColumnGroupingPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer } 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_new, useGridEditing_old, editingStateInitializer_old, editingStateInitializer_new, useGridRows, useGridRowsPreProcessors, rowsStateInitializer, useGridRowsMeta, useGridParamsApi, useGridSelection, useGridSorting, sortingStateInitializer, useGridScroll, useGridEvents, useGridDimensions, useGridStatePersistence, useGridSelectionPreProcessors, columnMenuStateInitializer, densityStateInitializer, focusStateInitializer, preferencePanelStateInitializer, rowsMetaStateInitializer, selectionStateInitializer, useGridColumnReorder, columnReorderStateInitializer, useGridColumnResize, columnResizeStateInitializer, useGridTreeData, useGridTreeDataPreProcessors, useGridColumnPinning, columnPinningStateInitializer, useGridColumnPinningPreProcessors, useGridDetailPanel, detailPanelStateInitializer, useGridDetailPanelPreProcessors, useGridInfiniteLoader, useGridColumnSpanning, useGridRowReorder, useGridRowReorderPreProcessors, useGridColumnGroupingPreProcessors, useGridRowPinning, useGridRowPinningPreProcessors, rowPinningStateInitializer, useGridColumnGrouping, columnGroupsStateInitializer, useGridLazyLoader, useGridLazyLoaderPreProcessors } from '@mui/x-data-grid-pro/internals';
|
|
2
2
|
// Premium-only features
|
|
3
3
|
import { useGridAggregation, aggregationStateInitializer } from '../hooks/features/aggregation/useGridAggregation';
|
|
4
4
|
import { useGridAggregationPreProcessors } from '../hooks/features/aggregation/useGridAggregationPreProcessors';
|
|
@@ -16,6 +16,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
16
16
|
useGridRowReorderPreProcessors(apiRef, props);
|
|
17
17
|
useGridRowGroupingPreProcessors(apiRef, props);
|
|
18
18
|
useGridTreeDataPreProcessors(apiRef, props);
|
|
19
|
+
useGridLazyLoaderPreProcessors(apiRef, props);
|
|
19
20
|
useGridRowPinningPreProcessors(apiRef);
|
|
20
21
|
useGridAggregationPreProcessors(apiRef, props);
|
|
21
22
|
useGridDetailPanelPreProcessors(apiRef, props); // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
|
|
@@ -74,6 +75,7 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
74
75
|
useGridRowReorder(apiRef, props);
|
|
75
76
|
useGridScroll(apiRef, props);
|
|
76
77
|
useGridInfiniteLoader(apiRef, props);
|
|
78
|
+
useGridLazyLoader(apiRef, props);
|
|
77
79
|
useGridColumnMenu(apiRef);
|
|
78
80
|
useGridCsvExport(apiRef);
|
|
79
81
|
useGridPrintExport(apiRef, props);
|
|
@@ -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).
|
|
@@ -31,6 +31,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
31
31
|
(0, _internals.useGridRowReorderPreProcessors)(apiRef, props);
|
|
32
32
|
(0, _useGridRowGroupingPreProcessors.useGridRowGroupingPreProcessors)(apiRef, props);
|
|
33
33
|
(0, _internals.useGridTreeDataPreProcessors)(apiRef, props);
|
|
34
|
+
(0, _internals.useGridLazyLoaderPreProcessors)(apiRef, props);
|
|
34
35
|
(0, _internals.useGridRowPinningPreProcessors)(apiRef);
|
|
35
36
|
(0, _useGridAggregationPreProcessors.useGridAggregationPreProcessors)(apiRef, props);
|
|
36
37
|
(0, _internals.useGridDetailPanelPreProcessors)(apiRef, props); // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
|
|
@@ -89,6 +90,7 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
89
90
|
(0, _internals.useGridRowReorder)(apiRef, props);
|
|
90
91
|
(0, _internals.useGridScroll)(apiRef, props);
|
|
91
92
|
(0, _internals.useGridInfiniteLoader)(apiRef, props);
|
|
93
|
+
(0, _internals.useGridLazyLoader)(apiRef, props);
|
|
92
94
|
(0, _internals.useGridColumnMenu)(apiRef);
|
|
93
95
|
(0, _internals.useGridCsvExport)(apiRef);
|
|
94
96
|
(0, _internals.useGridPrintExport)(apiRef, props);
|
|
@@ -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).
|