@mui/x-data-grid-premium 7.24.1 → 7.26.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 +148 -0
- package/DataGridPremium/DataGridPremium.js +5 -4
- package/DataGridPremium/useDataGridPremiumComponent.js +2 -2
- package/components/GridAggregationHeader.js +6 -1
- package/esm/DataGridPremium/DataGridPremium.js +5 -4
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +2 -2
- package/esm/components/GridAggregationHeader.js +6 -1
- package/esm/hooks/features/aggregation/gridAggregationUtils.js +1 -1
- package/esm/hooks/features/aggregation/useGridAggregation.js +0 -2
- package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +1 -0
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +13 -10
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/aggregation/gridAggregationUtils.js +1 -1
- package/hooks/features/aggregation/useGridAggregation.js +0 -2
- package/hooks/features/aggregation/useGridAggregationPreProcessors.js +1 -0
- package/hooks/features/cellSelection/useGridCellSelection.js +11 -8
- package/hooks/utils/useGridApiContext.d.ts +3 -1
- package/hooks/utils/useGridApiRef.d.ts +3 -1
- package/index.js +1 -1
- package/modern/DataGridPremium/DataGridPremium.js +5 -4
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +2 -2
- package/modern/components/GridAggregationHeader.js +6 -1
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +1 -1
- package/modern/hooks/features/aggregation/useGridAggregation.js +0 -2
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +1 -0
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +13 -10
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,154 @@
|
|
|
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.26.0
|
|
7
|
+
|
|
8
|
+
_Feb 7, 2025_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ⚡ Mount and resize performance improvements for the Data Grid
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
|
|
15
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
16
|
+
@lauri865.
|
|
17
|
+
Following are all team members who have contributed to this release:
|
|
18
|
+
@arminmeh, @noraleonte, @LukasTy, @KenanYusuf, @flaviendelangle.
|
|
19
|
+
|
|
20
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
21
|
+
|
|
22
|
+
### Data Grid
|
|
23
|
+
|
|
24
|
+
#### `@mui/x-data-grid@7.26.0`
|
|
25
|
+
|
|
26
|
+
- [DataGrid] Avoid `<GridRoot />` double-render pass on mount in SPA mode (#16480) @lauri865
|
|
27
|
+
|
|
28
|
+
#### `@mui/x-data-grid-pro@7.26.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
29
|
+
|
|
30
|
+
Same changes as in `@mui/x-data-grid@7.26.0`, plus:
|
|
31
|
+
|
|
32
|
+
- [DataGridPro] Fix the return type of `useGridApiContext()` for Pro and Premium packages on React < 19 (#16446) @arminmeh
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-data-grid-premium@7.26.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-data-grid-pro@7.26.0`, plus:
|
|
37
|
+
|
|
38
|
+
- [DataGridPremium] Fix "no rows" overlay not showing with active aggregation (#16468) @KenanYusuf
|
|
39
|
+
|
|
40
|
+
### Date and Time Pickers
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-date-pickers@7.26.0`
|
|
43
|
+
|
|
44
|
+
Internal changes.
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-date-pickers-pro@7.26.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
47
|
+
|
|
48
|
+
Same changes as in `@mui/x-date-pickers@7.26.0`, plus:
|
|
49
|
+
|
|
50
|
+
- [DateRangePicker] Fix `currentMonthCalendarPosition` prop behavior on mobile (#16457) @LukasTy
|
|
51
|
+
- [DateRangePicker] Fix vertical alignment for multi input fields (#16490) @noraleonte
|
|
52
|
+
|
|
53
|
+
### Charts
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-charts@7.26.0`
|
|
56
|
+
|
|
57
|
+
Internal changes.
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-charts-pro@7.26.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
60
|
+
|
|
61
|
+
Same changes as in `@mui/x-charts@7.26.0`.
|
|
62
|
+
|
|
63
|
+
### Tree View
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-tree-view@7.26.0`
|
|
66
|
+
|
|
67
|
+
Internal changes.
|
|
68
|
+
|
|
69
|
+
#### `@mui/x-tree-view-pro@7.26.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
70
|
+
|
|
71
|
+
Same changes as in `@mui/x-tree-view@7.26.0`.
|
|
72
|
+
|
|
73
|
+
### Core
|
|
74
|
+
|
|
75
|
+
- [core] Fix corepack and pnpm installation in CircleCI (#16452) @flaviendelangle
|
|
76
|
+
|
|
77
|
+
## 7.25.0
|
|
78
|
+
|
|
79
|
+
_Jan 31, 2025_
|
|
80
|
+
|
|
81
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
82
|
+
|
|
83
|
+
- 🐞 Bugfixes
|
|
84
|
+
|
|
85
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
86
|
+
@k-rajat19, @lauri865.
|
|
87
|
+
Following are all team members who have contributed to this release:
|
|
88
|
+
@KenanYusuf, @MBilalShafi, @arminmeh.
|
|
89
|
+
|
|
90
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
91
|
+
|
|
92
|
+
### Data Grid
|
|
93
|
+
|
|
94
|
+
#### `@mui/x-data-grid@7.25.0`
|
|
95
|
+
|
|
96
|
+
- [DataGrid] Fix `renderContext` calculation with scroll bounce / over-scroll (#16368) @lauri865
|
|
97
|
+
- [DataGrid] Refactor row state propagation (#16351) @lauri865
|
|
98
|
+
- [DataGrid] Add missing style overrides (#16272) (#16358) @KenanYusuf
|
|
99
|
+
- [DataGrid] Fix header filters keyboard navigation when there are no rows (#16369) @k-rajat19
|
|
100
|
+
- [DataGrid] Fix order of `onClick` prop on toolbar buttons (#16364) @KenanYusuf
|
|
101
|
+
- [DataGrid] Improve test coverage of server side data source (#15988) @MBilalShafi
|
|
102
|
+
- [DataGrid] Remove outdated warning (#16370) @MBilalShafi
|
|
103
|
+
- [DataGrid] Respect width of `iconContainer` during autosizing (#16409) @michelengelen
|
|
104
|
+
|
|
105
|
+
#### `@mui/x-data-grid-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
106
|
+
|
|
107
|
+
Same changes as in `@mui/x-data-grid@7.25.0`, plus:
|
|
108
|
+
|
|
109
|
+
- [DataGridPro] Fix the return type of `useGridApiRef` for Pro and Premium packages on React < 19 (#16348) @arminmeh
|
|
110
|
+
- [DataGridPro] Fetch new rows only once when multiple models are changed in one cycle (#16382) @arminmeh
|
|
111
|
+
|
|
112
|
+
#### `@mui/x-data-grid-premium@7.25.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
113
|
+
|
|
114
|
+
Same changes as in `@mui/x-data-grid-pro@7.25.0`.
|
|
115
|
+
|
|
116
|
+
### Date and Time Pickers
|
|
117
|
+
|
|
118
|
+
#### `@mui/x-date-pickers@7.25.0`
|
|
119
|
+
|
|
120
|
+
Internal changes.
|
|
121
|
+
|
|
122
|
+
#### `@mui/x-date-pickers-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
123
|
+
|
|
124
|
+
Same changes as in `@mui/x-date-pickers@7.25.0`.
|
|
125
|
+
|
|
126
|
+
### Charts
|
|
127
|
+
|
|
128
|
+
#### `@mui/x-charts@7.25.0`
|
|
129
|
+
|
|
130
|
+
Internal changes.
|
|
131
|
+
|
|
132
|
+
#### `@mui/x-charts-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
133
|
+
|
|
134
|
+
Same changes as in `@mui/x-charts@7.25.0`.
|
|
135
|
+
|
|
136
|
+
### Tree View
|
|
137
|
+
|
|
138
|
+
#### `@mui/x-tree-view@7.25.0`
|
|
139
|
+
|
|
140
|
+
Internal changes.
|
|
141
|
+
|
|
142
|
+
#### `@mui/x-tree-view-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
143
|
+
|
|
144
|
+
Same changes as in `@mui/x-tree-view@7.25.0`.
|
|
145
|
+
|
|
146
|
+
### Docs
|
|
147
|
+
|
|
148
|
+
- [docs] Improve release documentation (#16322) @MBilalShafi
|
|
149
|
+
|
|
150
|
+
### Core
|
|
151
|
+
|
|
152
|
+
- [test] Fix flaky data source tests in DataGrid (#16382) @lauri865
|
|
153
|
+
|
|
6
154
|
## 7.24.1
|
|
7
155
|
|
|
8
156
|
_Jan 24, 2025_
|
|
@@ -27,6 +27,10 @@ const configuration = {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
|
|
30
|
+
const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
31
|
+
packageName: "x-data-grid-premium",
|
|
32
|
+
releaseInfo: releaseInfo
|
|
33
|
+
});
|
|
30
34
|
let dataGridPremiumPropValidators;
|
|
31
35
|
if (process.env.NODE_ENV !== 'production') {
|
|
32
36
|
dataGridPremiumPropValidators = [..._internals.propValidatorsDataGrid, ..._internals.propValidatorsDataGridPro];
|
|
@@ -48,10 +52,7 @@ const DataGridPremiumRaw = (0, _forwardRef.forwardRef)(function DataGridPremium(
|
|
|
48
52
|
sx: props.sx
|
|
49
53
|
}, props.forwardedProps, props.slotProps?.root, {
|
|
50
54
|
ref: ref,
|
|
51
|
-
children:
|
|
52
|
-
packageName: "x-data-grid-premium",
|
|
53
|
-
releaseInfo: releaseInfo
|
|
54
|
-
})
|
|
55
|
+
children: watermark
|
|
55
56
|
}))
|
|
56
57
|
});
|
|
57
58
|
});
|
|
@@ -39,7 +39,6 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
39
39
|
/**
|
|
40
40
|
* Register all state initializers here.
|
|
41
41
|
*/
|
|
42
|
-
(0, _internals.useGridInitializeState)(_internals.dimensionsStateInitializer, apiRef, props);
|
|
43
42
|
(0, _internals.useGridInitializeState)(_internals.headerFilteringStateInitializer, apiRef, props);
|
|
44
43
|
(0, _internals.useGridInitializeState)(_useGridRowGrouping.rowGroupingStateInitializer, apiRef, props);
|
|
45
44
|
(0, _internals.useGridInitializeState)(_useGridAggregation.aggregationStateInitializer, apiRef, props);
|
|
@@ -60,11 +59,12 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
60
59
|
(0, _internals.useGridInitializeState)(_internals.densityStateInitializer, apiRef, props);
|
|
61
60
|
(0, _internals.useGridInitializeState)(_internals.columnReorderStateInitializer, apiRef, props);
|
|
62
61
|
(0, _internals.useGridInitializeState)(_internals.columnResizeStateInitializer, apiRef, props);
|
|
63
|
-
(0, _internals.useGridInitializeState)(_internals.rowsMetaStateInitializer, apiRef, props);
|
|
64
62
|
(0, _internals.useGridInitializeState)(_internals.columnMenuStateInitializer, apiRef, props);
|
|
65
63
|
(0, _internals.useGridInitializeState)(_internals.columnGroupsStateInitializer, apiRef, props);
|
|
66
64
|
(0, _internals.useGridInitializeState)(_internals.virtualizationStateInitializer, apiRef, props);
|
|
67
65
|
(0, _internals.useGridInitializeState)(_internals.dataSourceStateInitializer, apiRef, props);
|
|
66
|
+
(0, _internals.useGridInitializeState)(_internals.dimensionsStateInitializer, apiRef, props);
|
|
67
|
+
(0, _internals.useGridInitializeState)(_internals.rowsMetaStateInitializer, apiRef, props);
|
|
68
68
|
(0, _internals.useGridInitializeState)(_internals.listViewStateInitializer, apiRef, props);
|
|
69
69
|
(0, _useGridRowGrouping.useGridRowGrouping)(apiRef, props);
|
|
70
70
|
(0, _internals.useGridHeaderFiltering)(apiRef, props);
|
|
@@ -20,7 +20,12 @@ const _excluded = ["renderHeader"];
|
|
|
20
20
|
const GridAggregationHeaderRoot = (0, _styles.styled)('div', {
|
|
21
21
|
name: 'MuiDataGrid',
|
|
22
22
|
slot: 'AggregationColumnHeader',
|
|
23
|
-
overridesResolver: (
|
|
23
|
+
overridesResolver: (props, styles) => {
|
|
24
|
+
const {
|
|
25
|
+
ownerState
|
|
26
|
+
} = props;
|
|
27
|
+
return [styles.aggregationColumnHeader, ownerState.colDef.headerAlign === 'left' && styles['aggregationColumnHeader--alignLeft'], ownerState.colDef.headerAlign === 'center' && styles['aggregationColumnHeader--alignCenter'], ownerState.colDef.headerAlign === 'right' && styles['aggregationColumnHeader--alignRight']];
|
|
28
|
+
}
|
|
24
29
|
})({
|
|
25
30
|
display: 'flex',
|
|
26
31
|
flexDirection: 'column',
|
|
@@ -20,6 +20,10 @@ const configuration = {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
const releaseInfo = getReleaseInfo();
|
|
23
|
+
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
24
|
+
packageName: "x-data-grid-premium",
|
|
25
|
+
releaseInfo: releaseInfo
|
|
26
|
+
});
|
|
23
27
|
let dataGridPremiumPropValidators;
|
|
24
28
|
if (process.env.NODE_ENV !== 'production') {
|
|
25
29
|
dataGridPremiumPropValidators = [...propValidatorsDataGrid, ...propValidatorsDataGridPro];
|
|
@@ -41,10 +45,7 @@ const DataGridPremiumRaw = forwardRef(function DataGridPremium(inProps, ref) {
|
|
|
41
45
|
sx: props.sx
|
|
42
46
|
}, props.forwardedProps, props.slotProps?.root, {
|
|
43
47
|
ref: ref,
|
|
44
|
-
children:
|
|
45
|
-
packageName: "x-data-grid-premium",
|
|
46
|
-
releaseInfo: releaseInfo
|
|
47
|
-
})
|
|
48
|
+
children: watermark
|
|
48
49
|
}))
|
|
49
50
|
});
|
|
50
51
|
});
|
|
@@ -32,7 +32,6 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
32
32
|
/**
|
|
33
33
|
* Register all state initializers here.
|
|
34
34
|
*/
|
|
35
|
-
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
36
35
|
useGridInitializeState(headerFilteringStateInitializer, apiRef, props);
|
|
37
36
|
useGridInitializeState(rowGroupingStateInitializer, apiRef, props);
|
|
38
37
|
useGridInitializeState(aggregationStateInitializer, apiRef, props);
|
|
@@ -53,11 +52,12 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
53
52
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
54
53
|
useGridInitializeState(columnReorderStateInitializer, apiRef, props);
|
|
55
54
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
56
|
-
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
57
55
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
58
56
|
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
59
57
|
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
|
|
60
58
|
useGridInitializeState(dataSourceStateInitializer, apiRef, props);
|
|
59
|
+
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
60
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
61
61
|
useGridInitializeState(listViewStateInitializer, apiRef, props);
|
|
62
62
|
useGridRowGrouping(apiRef, props);
|
|
63
63
|
useGridHeaderFiltering(apiRef, props);
|
|
@@ -12,7 +12,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
const GridAggregationHeaderRoot = styled('div', {
|
|
13
13
|
name: 'MuiDataGrid',
|
|
14
14
|
slot: 'AggregationColumnHeader',
|
|
15
|
-
overridesResolver: (
|
|
15
|
+
overridesResolver: (props, styles) => {
|
|
16
|
+
const {
|
|
17
|
+
ownerState
|
|
18
|
+
} = props;
|
|
19
|
+
return [styles.aggregationColumnHeader, ownerState.colDef.headerAlign === 'left' && styles['aggregationColumnHeader--alignLeft'], ownerState.colDef.headerAlign === 'center' && styles['aggregationColumnHeader--alignCenter'], ownerState.colDef.headerAlign === 'right' && styles['aggregationColumnHeader--alignRight']];
|
|
20
|
+
}
|
|
16
21
|
})({
|
|
17
22
|
display: 'flex',
|
|
18
23
|
flexDirection: 'column',
|
|
@@ -107,7 +107,7 @@ export const addFooterRows = ({
|
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
const updateRootGroupFooter = groupNode => {
|
|
110
|
-
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer';
|
|
110
|
+
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer' && groupNode.children.length > 0;
|
|
111
111
|
if (shouldHaveFooter) {
|
|
112
112
|
const rowId = getAggregationFooterRowIdFromGroupId(null);
|
|
113
113
|
newGroupingParams = addPinnedRow({
|
|
@@ -31,7 +31,6 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
31
31
|
const currentModel = gridAggregationModelSelector(apiRef);
|
|
32
32
|
if (currentModel !== model) {
|
|
33
33
|
apiRef.current.setState(mergeStateWithAggregationModel(model));
|
|
34
|
-
apiRef.current.forceUpdate();
|
|
35
34
|
}
|
|
36
35
|
}, [apiRef]);
|
|
37
36
|
const applyAggregation = React.useCallback(() => {
|
|
@@ -74,7 +73,6 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
74
73
|
|
|
75
74
|
// Re-apply the column hydration to wrap / unwrap the aggregated columns
|
|
76
75
|
if (!areAggregationRulesEqual(rulesOnLastColumnHydration, aggregationRules)) {
|
|
77
|
-
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
78
76
|
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
79
77
|
}
|
|
80
78
|
}, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation]);
|
|
@@ -34,6 +34,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
34
34
|
columnsState.lookup[field] = column;
|
|
35
35
|
});
|
|
36
36
|
rulesOnLastColumnHydration.current = aggregationRules;
|
|
37
|
+
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
37
38
|
return columnsState;
|
|
38
39
|
}, [apiRef, props.aggregationFunctions, props.disableAggregation]);
|
|
39
40
|
const addGroupFooterRows = React.useCallback(value => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ownerDocument, useEventCallback } from '@mui/material/utils';
|
|
4
|
-
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor
|
|
5
|
-
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF,
|
|
4
|
+
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
5
|
+
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { gridCellSelectionStateSelector } from "./gridCellSelectionSelector.js";
|
|
7
7
|
export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
|
|
8
8
|
cellSelection: _extends({}, props.cellSelectionModel ?? props.initialState?.cellSelection)
|
|
@@ -15,13 +15,10 @@ const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the s
|
|
|
15
15
|
|
|
16
16
|
export const useGridCellSelection = (apiRef, props) => {
|
|
17
17
|
const hasRootReference = apiRef.current.rootElementRef.current !== null;
|
|
18
|
-
const visibleRows = useGridVisibleRows(apiRef, props);
|
|
19
18
|
const cellWithVirtualFocus = React.useRef(null);
|
|
20
19
|
const lastMouseDownCell = React.useRef(null);
|
|
21
20
|
const mousePosition = React.useRef(null);
|
|
22
21
|
const autoScrollRAF = React.useRef(null);
|
|
23
|
-
const sortedRowIds = useGridSelector(apiRef, gridSortedRowIdsSelector);
|
|
24
|
-
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
25
22
|
const totalHeaderHeight = getTotalHeaderHeight(apiRef, props);
|
|
26
23
|
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
27
24
|
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
@@ -75,6 +72,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
75
72
|
finalEndColumnIndex = startColumnIndex;
|
|
76
73
|
}
|
|
77
74
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
75
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
78
76
|
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
79
77
|
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
80
78
|
const newModel = keepOtherSelected ? _extends({}, apiRef.current.getCellSelectionModel()) : {};
|
|
@@ -87,7 +85,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
87
85
|
}, {});
|
|
88
86
|
});
|
|
89
87
|
apiRef.current.setCellSelectionModel(newModel);
|
|
90
|
-
}, [apiRef
|
|
88
|
+
}, [apiRef]);
|
|
91
89
|
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
92
90
|
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
93
91
|
const idToIdLookup = gridRowsDataRowIdToIdLookupSelector(apiRef);
|
|
@@ -186,6 +184,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
186
184
|
if (!mousePosition.current || !apiRef.current.virtualScrollerRef?.current) {
|
|
187
185
|
return;
|
|
188
186
|
}
|
|
187
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
189
188
|
const {
|
|
190
189
|
x: mouseX,
|
|
191
190
|
y: mouseY
|
|
@@ -228,7 +227,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
228
227
|
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
229
228
|
}
|
|
230
229
|
autoScroll();
|
|
231
|
-
}, [apiRef,
|
|
230
|
+
}, [apiRef, totalHeaderHeight]);
|
|
232
231
|
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
233
232
|
if (!lastMouseDownCell.current) {
|
|
234
233
|
return;
|
|
@@ -245,6 +244,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
245
244
|
if (!virtualScrollerRect) {
|
|
246
245
|
return;
|
|
247
246
|
}
|
|
247
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
248
248
|
const {
|
|
249
249
|
x,
|
|
250
250
|
y
|
|
@@ -270,7 +270,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
270
270
|
// Mouse has left the sensitivity area while auto scroll is on
|
|
271
271
|
stopAutoScroll();
|
|
272
272
|
}
|
|
273
|
-
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight
|
|
273
|
+
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight]);
|
|
274
274
|
const handleCellClick = useEventCallback((params, event) => {
|
|
275
275
|
const {
|
|
276
276
|
id,
|
|
@@ -330,6 +330,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
330
330
|
} else if (event.key === 'ArrowLeft') {
|
|
331
331
|
endColumnIndex -= 1;
|
|
332
332
|
}
|
|
333
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
333
334
|
if (endRowIndex < 0 || endRowIndex >= visibleRows.rows.length) {
|
|
334
335
|
return;
|
|
335
336
|
}
|
|
@@ -382,6 +383,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
382
383
|
id,
|
|
383
384
|
field
|
|
384
385
|
}) => {
|
|
386
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
385
387
|
if (!visibleRows.range || !apiRef.current.isCellSelected(id, field)) {
|
|
386
388
|
return classes;
|
|
387
389
|
}
|
|
@@ -430,7 +432,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
430
432
|
newClasses.push(gridClasses['cell--rangeRight']);
|
|
431
433
|
}
|
|
432
434
|
return newClasses;
|
|
433
|
-
}, [apiRef
|
|
435
|
+
}, [apiRef]);
|
|
434
436
|
const canUpdateFocus = React.useCallback((initialValue, {
|
|
435
437
|
event,
|
|
436
438
|
cell
|
|
@@ -451,6 +453,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
451
453
|
if (apiRef.current.getSelectedCellsAsArray().length <= 1) {
|
|
452
454
|
return value;
|
|
453
455
|
}
|
|
456
|
+
const sortedRowIds = gridSortedRowIdsSelector(apiRef);
|
|
454
457
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
455
458
|
const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
|
|
456
459
|
const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
|
|
@@ -476,7 +479,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
476
479
|
return acc === '' ? rowString : [acc, rowString].join('\r\n');
|
|
477
480
|
}, '');
|
|
478
481
|
return copyData;
|
|
479
|
-
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter
|
|
482
|
+
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
|
|
480
483
|
useGridRegisterPipeProcessor(apiRef, 'isCellSelected', checkIfCellIsSelected);
|
|
481
484
|
useGridRegisterPipeProcessor(apiRef, 'cellClassName', addClassesToCells);
|
|
482
485
|
useGridRegisterPipeProcessor(apiRef, 'canUpdateFocus', canUpdateFocus);
|
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 = "MTczODg4MjgwMDAwMA==";
|
|
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
|
|
@@ -119,7 +119,7 @@ const addFooterRows = ({
|
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
const updateRootGroupFooter = groupNode => {
|
|
122
|
-
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer';
|
|
122
|
+
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer' && groupNode.children.length > 0;
|
|
123
123
|
if (shouldHaveFooter) {
|
|
124
124
|
const rowId = getAggregationFooterRowIdFromGroupId(null);
|
|
125
125
|
newGroupingParams = (0, _internals2.addPinnedRow)({
|
|
@@ -40,7 +40,6 @@ const useGridAggregation = (apiRef, props) => {
|
|
|
40
40
|
const currentModel = (0, _gridAggregationSelectors.gridAggregationModelSelector)(apiRef);
|
|
41
41
|
if (currentModel !== model) {
|
|
42
42
|
apiRef.current.setState((0, _gridAggregationUtils.mergeStateWithAggregationModel)(model));
|
|
43
|
-
apiRef.current.forceUpdate();
|
|
44
43
|
}
|
|
45
44
|
}, [apiRef]);
|
|
46
45
|
const applyAggregation = React.useCallback(() => {
|
|
@@ -83,7 +82,6 @@ const useGridAggregation = (apiRef, props) => {
|
|
|
83
82
|
|
|
84
83
|
// Re-apply the column hydration to wrap / unwrap the aggregated columns
|
|
85
84
|
if (!(0, _gridAggregationUtils.areAggregationRulesEqual)(rulesOnLastColumnHydration, aggregationRules)) {
|
|
86
|
-
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
87
85
|
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
88
86
|
}
|
|
89
87
|
}, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation]);
|
|
@@ -42,6 +42,7 @@ const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
42
42
|
columnsState.lookup[field] = column;
|
|
43
43
|
});
|
|
44
44
|
rulesOnLastColumnHydration.current = aggregationRules;
|
|
45
|
+
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
45
46
|
return columnsState;
|
|
46
47
|
}, [apiRef, props.aggregationFunctions, props.disableAggregation]);
|
|
47
48
|
const addGroupFooterRows = React.useCallback(value => {
|
|
@@ -24,13 +24,10 @@ const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the s
|
|
|
24
24
|
|
|
25
25
|
const useGridCellSelection = (apiRef, props) => {
|
|
26
26
|
const hasRootReference = apiRef.current.rootElementRef.current !== null;
|
|
27
|
-
const visibleRows = (0, _internals.useGridVisibleRows)(apiRef, props);
|
|
28
27
|
const cellWithVirtualFocus = React.useRef(null);
|
|
29
28
|
const lastMouseDownCell = React.useRef(null);
|
|
30
29
|
const mousePosition = React.useRef(null);
|
|
31
30
|
const autoScrollRAF = React.useRef(null);
|
|
32
|
-
const sortedRowIds = (0, _xDataGridPro.useGridSelector)(apiRef, _xDataGridPro.gridSortedRowIdsSelector);
|
|
33
|
-
const dimensions = (0, _xDataGridPro.useGridSelector)(apiRef, _xDataGridPro.gridDimensionsSelector);
|
|
34
31
|
const totalHeaderHeight = (0, _internals.getTotalHeaderHeight)(apiRef, props);
|
|
35
32
|
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
36
33
|
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
@@ -84,6 +81,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
84
81
|
finalEndColumnIndex = startColumnIndex;
|
|
85
82
|
}
|
|
86
83
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
84
|
+
const visibleRows = (0, _internals.getVisibleRows)(apiRef);
|
|
87
85
|
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
88
86
|
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
89
87
|
const newModel = keepOtherSelected ? (0, _extends2.default)({}, apiRef.current.getCellSelectionModel()) : {};
|
|
@@ -96,7 +94,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
96
94
|
}, {});
|
|
97
95
|
});
|
|
98
96
|
apiRef.current.setCellSelectionModel(newModel);
|
|
99
|
-
}, [apiRef
|
|
97
|
+
}, [apiRef]);
|
|
100
98
|
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
101
99
|
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
102
100
|
const idToIdLookup = (0, _xDataGridPro.gridRowsDataRowIdToIdLookupSelector)(apiRef);
|
|
@@ -195,6 +193,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
195
193
|
if (!mousePosition.current || !apiRef.current.virtualScrollerRef?.current) {
|
|
196
194
|
return;
|
|
197
195
|
}
|
|
196
|
+
const dimensions = (0, _xDataGridPro.gridDimensionsSelector)(apiRef.current.state);
|
|
198
197
|
const {
|
|
199
198
|
x: mouseX,
|
|
200
199
|
y: mouseY
|
|
@@ -237,7 +236,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
237
236
|
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
238
237
|
}
|
|
239
238
|
autoScroll();
|
|
240
|
-
}, [apiRef,
|
|
239
|
+
}, [apiRef, totalHeaderHeight]);
|
|
241
240
|
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
242
241
|
if (!lastMouseDownCell.current) {
|
|
243
242
|
return;
|
|
@@ -254,6 +253,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
254
253
|
if (!virtualScrollerRect) {
|
|
255
254
|
return;
|
|
256
255
|
}
|
|
256
|
+
const dimensions = (0, _xDataGridPro.gridDimensionsSelector)(apiRef.current.state);
|
|
257
257
|
const {
|
|
258
258
|
x,
|
|
259
259
|
y
|
|
@@ -279,7 +279,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
279
279
|
// Mouse has left the sensitivity area while auto scroll is on
|
|
280
280
|
stopAutoScroll();
|
|
281
281
|
}
|
|
282
|
-
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight
|
|
282
|
+
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight]);
|
|
283
283
|
const handleCellClick = (0, _utils.useEventCallback)((params, event) => {
|
|
284
284
|
const {
|
|
285
285
|
id,
|
|
@@ -339,6 +339,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
339
339
|
} else if (event.key === 'ArrowLeft') {
|
|
340
340
|
endColumnIndex -= 1;
|
|
341
341
|
}
|
|
342
|
+
const visibleRows = (0, _internals.getVisibleRows)(apiRef);
|
|
342
343
|
if (endRowIndex < 0 || endRowIndex >= visibleRows.rows.length) {
|
|
343
344
|
return;
|
|
344
345
|
}
|
|
@@ -391,6 +392,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
391
392
|
id,
|
|
392
393
|
field
|
|
393
394
|
}) => {
|
|
395
|
+
const visibleRows = (0, _internals.getVisibleRows)(apiRef);
|
|
394
396
|
if (!visibleRows.range || !apiRef.current.isCellSelected(id, field)) {
|
|
395
397
|
return classes;
|
|
396
398
|
}
|
|
@@ -439,7 +441,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
439
441
|
newClasses.push(_xDataGridPro.gridClasses['cell--rangeRight']);
|
|
440
442
|
}
|
|
441
443
|
return newClasses;
|
|
442
|
-
}, [apiRef
|
|
444
|
+
}, [apiRef]);
|
|
443
445
|
const canUpdateFocus = React.useCallback((initialValue, {
|
|
444
446
|
event,
|
|
445
447
|
cell
|
|
@@ -460,6 +462,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
460
462
|
if (apiRef.current.getSelectedCellsAsArray().length <= 1) {
|
|
461
463
|
return value;
|
|
462
464
|
}
|
|
465
|
+
const sortedRowIds = (0, _xDataGridPro.gridSortedRowIdsSelector)(apiRef);
|
|
463
466
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
464
467
|
const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
|
|
465
468
|
const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
|
|
@@ -485,7 +488,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
485
488
|
return acc === '' ? rowString : [acc, rowString].join('\r\n');
|
|
486
489
|
}, '');
|
|
487
490
|
return copyData;
|
|
488
|
-
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter
|
|
491
|
+
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
|
|
489
492
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'isCellSelected', checkIfCellIsSelected);
|
|
490
493
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'cellClassName', addClassesToCells);
|
|
491
494
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'canUpdateFocus', canUpdateFocus);
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import { GridApiCommon } from '@mui/x-data-grid';
|
|
1
3
|
import { GridApiPremium } from '../../models/gridApiPremium';
|
|
2
|
-
export declare const useGridApiContext: () =>
|
|
4
|
+
export declare const useGridApiContext: <Api extends GridApiCommon = GridApiPremium>() => RefObject<Api>;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import { GridApiCommon } from '@mui/x-data-grid';
|
|
1
3
|
import { GridApiPremium } from '../../models/gridApiPremium';
|
|
2
|
-
export declare const useGridApiRef: () =>
|
|
4
|
+
export declare const useGridApiRef: <Api extends GridApiCommon = GridApiPremium>() => RefObject<Api>;
|
package/index.js
CHANGED
|
@@ -20,6 +20,10 @@ const configuration = {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
const releaseInfo = getReleaseInfo();
|
|
23
|
+
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
24
|
+
packageName: "x-data-grid-premium",
|
|
25
|
+
releaseInfo: releaseInfo
|
|
26
|
+
});
|
|
23
27
|
let dataGridPremiumPropValidators;
|
|
24
28
|
if (process.env.NODE_ENV !== 'production') {
|
|
25
29
|
dataGridPremiumPropValidators = [...propValidatorsDataGrid, ...propValidatorsDataGridPro];
|
|
@@ -41,10 +45,7 @@ const DataGridPremiumRaw = forwardRef(function DataGridPremium(inProps, ref) {
|
|
|
41
45
|
sx: props.sx
|
|
42
46
|
}, props.forwardedProps, props.slotProps?.root, {
|
|
43
47
|
ref: ref,
|
|
44
|
-
children:
|
|
45
|
-
packageName: "x-data-grid-premium",
|
|
46
|
-
releaseInfo: releaseInfo
|
|
47
|
-
})
|
|
48
|
+
children: watermark
|
|
48
49
|
}))
|
|
49
50
|
});
|
|
50
51
|
});
|
|
@@ -32,7 +32,6 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
32
32
|
/**
|
|
33
33
|
* Register all state initializers here.
|
|
34
34
|
*/
|
|
35
|
-
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
36
35
|
useGridInitializeState(headerFilteringStateInitializer, apiRef, props);
|
|
37
36
|
useGridInitializeState(rowGroupingStateInitializer, apiRef, props);
|
|
38
37
|
useGridInitializeState(aggregationStateInitializer, apiRef, props);
|
|
@@ -53,11 +52,12 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
53
52
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
54
53
|
useGridInitializeState(columnReorderStateInitializer, apiRef, props);
|
|
55
54
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
56
|
-
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
57
55
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
58
56
|
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
59
57
|
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
|
|
60
58
|
useGridInitializeState(dataSourceStateInitializer, apiRef, props);
|
|
59
|
+
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
60
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
61
61
|
useGridInitializeState(listViewStateInitializer, apiRef, props);
|
|
62
62
|
useGridRowGrouping(apiRef, props);
|
|
63
63
|
useGridHeaderFiltering(apiRef, props);
|
|
@@ -12,7 +12,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
const GridAggregationHeaderRoot = styled('div', {
|
|
13
13
|
name: 'MuiDataGrid',
|
|
14
14
|
slot: 'AggregationColumnHeader',
|
|
15
|
-
overridesResolver: (
|
|
15
|
+
overridesResolver: (props, styles) => {
|
|
16
|
+
const {
|
|
17
|
+
ownerState
|
|
18
|
+
} = props;
|
|
19
|
+
return [styles.aggregationColumnHeader, ownerState.colDef.headerAlign === 'left' && styles['aggregationColumnHeader--alignLeft'], ownerState.colDef.headerAlign === 'center' && styles['aggregationColumnHeader--alignCenter'], ownerState.colDef.headerAlign === 'right' && styles['aggregationColumnHeader--alignRight']];
|
|
20
|
+
}
|
|
16
21
|
})({
|
|
17
22
|
display: 'flex',
|
|
18
23
|
flexDirection: 'column',
|
|
@@ -107,7 +107,7 @@ export const addFooterRows = ({
|
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
const updateRootGroupFooter = groupNode => {
|
|
110
|
-
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer';
|
|
110
|
+
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer' && groupNode.children.length > 0;
|
|
111
111
|
if (shouldHaveFooter) {
|
|
112
112
|
const rowId = getAggregationFooterRowIdFromGroupId(null);
|
|
113
113
|
newGroupingParams = addPinnedRow({
|
|
@@ -31,7 +31,6 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
31
31
|
const currentModel = gridAggregationModelSelector(apiRef);
|
|
32
32
|
if (currentModel !== model) {
|
|
33
33
|
apiRef.current.setState(mergeStateWithAggregationModel(model));
|
|
34
|
-
apiRef.current.forceUpdate();
|
|
35
34
|
}
|
|
36
35
|
}, [apiRef]);
|
|
37
36
|
const applyAggregation = React.useCallback(() => {
|
|
@@ -74,7 +73,6 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
74
73
|
|
|
75
74
|
// Re-apply the column hydration to wrap / unwrap the aggregated columns
|
|
76
75
|
if (!areAggregationRulesEqual(rulesOnLastColumnHydration, aggregationRules)) {
|
|
77
|
-
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
78
76
|
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
79
77
|
}
|
|
80
78
|
}, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation]);
|
|
@@ -34,6 +34,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
34
34
|
columnsState.lookup[field] = column;
|
|
35
35
|
});
|
|
36
36
|
rulesOnLastColumnHydration.current = aggregationRules;
|
|
37
|
+
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
37
38
|
return columnsState;
|
|
38
39
|
}, [apiRef, props.aggregationFunctions, props.disableAggregation]);
|
|
39
40
|
const addGroupFooterRows = React.useCallback(value => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ownerDocument, useEventCallback } from '@mui/material/utils';
|
|
4
|
-
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor
|
|
5
|
-
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF,
|
|
4
|
+
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
5
|
+
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { gridCellSelectionStateSelector } from "./gridCellSelectionSelector.js";
|
|
7
7
|
export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
|
|
8
8
|
cellSelection: _extends({}, props.cellSelectionModel ?? props.initialState?.cellSelection)
|
|
@@ -15,13 +15,10 @@ const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the s
|
|
|
15
15
|
|
|
16
16
|
export const useGridCellSelection = (apiRef, props) => {
|
|
17
17
|
const hasRootReference = apiRef.current.rootElementRef.current !== null;
|
|
18
|
-
const visibleRows = useGridVisibleRows(apiRef, props);
|
|
19
18
|
const cellWithVirtualFocus = React.useRef(null);
|
|
20
19
|
const lastMouseDownCell = React.useRef(null);
|
|
21
20
|
const mousePosition = React.useRef(null);
|
|
22
21
|
const autoScrollRAF = React.useRef(null);
|
|
23
|
-
const sortedRowIds = useGridSelector(apiRef, gridSortedRowIdsSelector);
|
|
24
|
-
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
25
22
|
const totalHeaderHeight = getTotalHeaderHeight(apiRef, props);
|
|
26
23
|
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
27
24
|
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
@@ -75,6 +72,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
75
72
|
finalEndColumnIndex = startColumnIndex;
|
|
76
73
|
}
|
|
77
74
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
75
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
78
76
|
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
79
77
|
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
80
78
|
const newModel = keepOtherSelected ? _extends({}, apiRef.current.getCellSelectionModel()) : {};
|
|
@@ -87,7 +85,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
87
85
|
}, {});
|
|
88
86
|
});
|
|
89
87
|
apiRef.current.setCellSelectionModel(newModel);
|
|
90
|
-
}, [apiRef
|
|
88
|
+
}, [apiRef]);
|
|
91
89
|
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
92
90
|
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
93
91
|
const idToIdLookup = gridRowsDataRowIdToIdLookupSelector(apiRef);
|
|
@@ -186,6 +184,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
186
184
|
if (!mousePosition.current || !apiRef.current.virtualScrollerRef?.current) {
|
|
187
185
|
return;
|
|
188
186
|
}
|
|
187
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
189
188
|
const {
|
|
190
189
|
x: mouseX,
|
|
191
190
|
y: mouseY
|
|
@@ -228,7 +227,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
228
227
|
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
229
228
|
}
|
|
230
229
|
autoScroll();
|
|
231
|
-
}, [apiRef,
|
|
230
|
+
}, [apiRef, totalHeaderHeight]);
|
|
232
231
|
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
233
232
|
if (!lastMouseDownCell.current) {
|
|
234
233
|
return;
|
|
@@ -245,6 +244,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
245
244
|
if (!virtualScrollerRect) {
|
|
246
245
|
return;
|
|
247
246
|
}
|
|
247
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
248
248
|
const {
|
|
249
249
|
x,
|
|
250
250
|
y
|
|
@@ -270,7 +270,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
270
270
|
// Mouse has left the sensitivity area while auto scroll is on
|
|
271
271
|
stopAutoScroll();
|
|
272
272
|
}
|
|
273
|
-
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight
|
|
273
|
+
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight]);
|
|
274
274
|
const handleCellClick = useEventCallback((params, event) => {
|
|
275
275
|
const {
|
|
276
276
|
id,
|
|
@@ -330,6 +330,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
330
330
|
} else if (event.key === 'ArrowLeft') {
|
|
331
331
|
endColumnIndex -= 1;
|
|
332
332
|
}
|
|
333
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
333
334
|
if (endRowIndex < 0 || endRowIndex >= visibleRows.rows.length) {
|
|
334
335
|
return;
|
|
335
336
|
}
|
|
@@ -382,6 +383,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
382
383
|
id,
|
|
383
384
|
field
|
|
384
385
|
}) => {
|
|
386
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
385
387
|
if (!visibleRows.range || !apiRef.current.isCellSelected(id, field)) {
|
|
386
388
|
return classes;
|
|
387
389
|
}
|
|
@@ -430,7 +432,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
430
432
|
newClasses.push(gridClasses['cell--rangeRight']);
|
|
431
433
|
}
|
|
432
434
|
return newClasses;
|
|
433
|
-
}, [apiRef
|
|
435
|
+
}, [apiRef]);
|
|
434
436
|
const canUpdateFocus = React.useCallback((initialValue, {
|
|
435
437
|
event,
|
|
436
438
|
cell
|
|
@@ -451,6 +453,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
451
453
|
if (apiRef.current.getSelectedCellsAsArray().length <= 1) {
|
|
452
454
|
return value;
|
|
453
455
|
}
|
|
456
|
+
const sortedRowIds = gridSortedRowIdsSelector(apiRef);
|
|
454
457
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
455
458
|
const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
|
|
456
459
|
const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
|
|
@@ -476,7 +479,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
476
479
|
return acc === '' ? rowString : [acc, rowString].join('\r\n');
|
|
477
480
|
}, '');
|
|
478
481
|
return copyData;
|
|
479
|
-
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter
|
|
482
|
+
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
|
|
480
483
|
useGridRegisterPipeProcessor(apiRef, 'isCellSelected', checkIfCellIsSelected);
|
|
481
484
|
useGridRegisterPipeProcessor(apiRef, 'cellClassName', addClassesToCells);
|
|
482
485
|
useGridRegisterPipeProcessor(apiRef, 'canUpdateFocus', canUpdateFocus);
|
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 = "MTczODg4MjgwMDAwMA==";
|
|
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.26.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",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"exceljs": "^4.4.0",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
42
|
"reselect": "^5.1.1",
|
|
43
|
-
"@mui/x-data-grid-pro": "7.
|
|
44
|
-
"@mui/x-license": "7.
|
|
45
|
-
"@mui/x-
|
|
46
|
-
"@mui/x-
|
|
43
|
+
"@mui/x-data-grid-pro": "7.26.0",
|
|
44
|
+
"@mui/x-license": "7.26.0",
|
|
45
|
+
"@mui/x-data-grid": "7.26.0",
|
|
46
|
+
"@mui/x-internals": "7.26.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.0",
|
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 = "MTczODg4MjgwMDAwMA==";
|
|
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
|