@mui/x-data-grid-premium 6.0.0-alpha.6 → 6.0.0-alpha.8
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 +168 -0
- package/DataGridPremium/DataGrid.d.ts +8 -0
- package/DataGridPremium/DataGrid.js +21 -0
- package/DataGridPremium/DataGridPremium.js +15 -8
- package/DataGridPremium/index.d.ts +1 -0
- package/DataGridPremium/index.js +1 -0
- package/components/GridAggregationColumnMenuItem.js +1 -1
- package/components/GridFooterCell.js +1 -1
- package/hooks/features/aggregation/createAggregationLookup.js +8 -1
- package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +15 -1
- package/hooks/features/aggregation/gridAggregationUtils.d.ts +2 -2
- package/hooks/features/aggregation/useGridAggregation.d.ts +2 -2
- package/hooks/features/aggregation/useGridAggregation.js +4 -4
- package/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +2 -2
- package/hooks/features/aggregation/useGridAggregationPreProcessors.js +4 -4
- package/hooks/features/export/serializer/excelSerializer.d.ts +3 -2
- package/hooks/features/export/serializer/excelSerializer.js +1 -1
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +2 -2
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -3
- package/hooks/features/rowGrouping/useGridRowGrouping.js +5 -5
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +2 -2
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/legacy/DataGridPremium/DataGrid.js +21 -0
- package/legacy/DataGridPremium/DataGridPremium.js +15 -8
- package/legacy/DataGridPremium/index.js +1 -0
- package/legacy/components/GridAggregationColumnMenuItem.js +1 -1
- package/legacy/components/GridFooterCell.js +1 -2
- package/legacy/hooks/features/aggregation/createAggregationLookup.js +8 -1
- package/legacy/hooks/features/aggregation/useGridAggregation.js +6 -6
- package/legacy/hooks/features/aggregation/useGridAggregationPreProcessors.js +4 -4
- package/legacy/hooks/features/export/serializer/excelSerializer.js +1 -1
- package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -3
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +5 -5
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/models/dataGridPremiumProps.d.ts +11 -11
- package/models/gridApiPremium.d.ts +2 -2
- package/modern/DataGridPremium/DataGrid.js +21 -0
- package/modern/DataGridPremium/DataGridPremium.js +15 -8
- package/modern/DataGridPremium/index.js +1 -0
- package/modern/components/GridAggregationColumnMenuItem.js +1 -1
- package/modern/components/GridFooterCell.js +1 -1
- package/modern/hooks/features/aggregation/createAggregationLookup.js +8 -1
- package/modern/hooks/features/aggregation/useGridAggregation.js +4 -4
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +4 -4
- package/modern/hooks/features/export/serializer/excelSerializer.js +1 -1
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -3
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +5 -5
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +1 -1
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/DataGridPremium/DataGrid.js +30 -0
- package/node/DataGridPremium/DataGridPremium.js +15 -8
- package/node/DataGridPremium/index.js +14 -0
- package/node/components/GridAggregationColumnMenuItem.js +1 -1
- package/node/components/GridFooterCell.js +1 -1
- package/node/hooks/features/aggregation/createAggregationLookup.js +8 -1
- package/node/hooks/features/aggregation/useGridAggregation.js +4 -4
- package/node/hooks/features/aggregation/useGridAggregationPreProcessors.js +4 -4
- package/node/hooks/features/export/serializer/excelSerializer.js +1 -1
- package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -3
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +5 -5
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +1 -1
- package/node/index.js +1 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +6 -6
- package/typeOverloads/reexports.d.ts +0 -5
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,118 @@
|
|
|
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
|
+
## 6.0.0-alpha.8
|
|
7
|
+
|
|
8
|
+
_Nov 17, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Support aggregating data from multiple row fields (#6656) @cherniavskii
|
|
13
|
+
- 📚 Documentation improvements
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v6.0.0-alpha.8` / `@mui/x-data-grid-pro@v6.0.0-alpha.8` / `@mui/x-data-grid-premium@v6.0.0-alpha.8`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Fix `ErrorOverlay` not receiving defined input props (#6819) @banoth-ravinder
|
|
21
|
+
- [DataGrid] Fix conflict with the latest version of `@types/react` (#6797) @vizv
|
|
22
|
+
- [DataGrid] Make more `apiRef` methods private (#6700) @cherniavskii
|
|
23
|
+
- [DataGrid] Provide a clear error message when upgrading (#6685) @oliviertassinari
|
|
24
|
+
- [DataGridPremium] Allow to customize the indent of group expansion toggle (#6837) @MBilalShafi
|
|
25
|
+
- [DataGridPremium] Support aggregating data from multiple row fields (#6656) @cherniavskii
|
|
26
|
+
- [DataGridPro] Fix detail panel not working with `getRowSpacing` prop (#6707) @cherniavskii
|
|
27
|
+
- [DataGridPro] Opt-out for column jump back on re-order (#6733) @gavbrennan
|
|
28
|
+
- [l10n] Improve Finnish (fi-FI) locale (#6859) @RainoPikkarainen
|
|
29
|
+
|
|
30
|
+
### `@mui/x-date-pickers@v6.0.0-alpha.8` / `@mui/x-date-pickers-pro@v6.0.0-alpha.8`
|
|
31
|
+
|
|
32
|
+
#### Breaking changes
|
|
33
|
+
|
|
34
|
+
- The `ClockPicker` view component has been renamed to `TimeClock` to better fit its usage:
|
|
35
|
+
|
|
36
|
+
```diff
|
|
37
|
+
-<ClockPicker {...props} />
|
|
38
|
+
+<TimeClock {...props} />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Component name in the theme has changed as well:
|
|
42
|
+
|
|
43
|
+
```diff
|
|
44
|
+
-MuiClockPicker: {
|
|
45
|
+
+MuiTimeClock: {
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### Changes
|
|
49
|
+
|
|
50
|
+
- [pickers] Fix typing and prop drilling on `DateRangeCalendar` and multi input range fields (#6852) @flaviendelangle
|
|
51
|
+
- [pickers] Pass the `ampm` prop from the new pickers to their field (#6868) @flaviendelangle
|
|
52
|
+
- [pickers] Rename `CalendarPickerView`, `ClockPickerView` and `CalendarOrClockPickerView` (#6855) @flaviendelangle
|
|
53
|
+
- [pickers] Rename `ClockPicker` into `TimeClock` (#6851) @flaviendelangle
|
|
54
|
+
|
|
55
|
+
### Docs
|
|
56
|
+
|
|
57
|
+
- [docs] Add `dayjs` to the dependencies (#6862) @m4theushw
|
|
58
|
+
- [docs] Clarify how the Row Pinning works with other features of the DataGrid (#6853) @cherniavskii
|
|
59
|
+
- [docs] Fix typo in Export page (#6848) @m4theushw
|
|
60
|
+
- [docs] Group picker pages (#6369) @flaviendelangle
|
|
61
|
+
- [docs] Remove default prop and improve format (#6781) @oliviertassinari
|
|
62
|
+
- [docs] Sync prism-okaidia.css with source (#6820) @oliviertassinari
|
|
63
|
+
|
|
64
|
+
### Core
|
|
65
|
+
|
|
66
|
+
- [core] Convert scripts to ESM (#6789) @LukasTy
|
|
67
|
+
- [core] Feedback on branch protection @oliviertassinari
|
|
68
|
+
- [core] Fix `test-types` out of memory error (#6850) @LukasTy
|
|
69
|
+
- [core] Import from `@mui/utils` instead of `@mui/material/utils` (#6816) @cherniavskii
|
|
70
|
+
- [core] Show the whole version to make blame easier @oliviertassinari
|
|
71
|
+
- [core] Small changes on new pickers internals (#6840) @flaviendelangle
|
|
72
|
+
- [core] Remove prettier scripts (#6815) @Janpot
|
|
73
|
+
- [license] Polish error messages (#6881) @oliviertassinari
|
|
74
|
+
- [test] Verify `onError` call on the pickers (#6771) @alexfauquette
|
|
75
|
+
|
|
76
|
+
## 6.0.0-alpha.7
|
|
77
|
+
|
|
78
|
+
_Nov 10, 2022_
|
|
79
|
+
|
|
80
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
81
|
+
|
|
82
|
+
- ⚙️ Removed everything marked as `@deprecated`
|
|
83
|
+
- 📚 Documentation improvements
|
|
84
|
+
- 🐞 Bugfixes
|
|
85
|
+
|
|
86
|
+
### `@mui/x-data-grid@v6.0.0-alpha.7` / `@mui/x-data-grid-pro@v6.0.0-alpha.7` / `@mui/x-data-grid-premium@v6.0.0-alpha.7`
|
|
87
|
+
|
|
88
|
+
#### Changes
|
|
89
|
+
|
|
90
|
+
- [DataGrid] Fix cell focus causing scroll jump when virtualization enabled (#6785) @yaredtsy
|
|
91
|
+
- [DataGrid] Remove items marked as `@deprecated` (#6505) @DanailH
|
|
92
|
+
|
|
93
|
+
### `@mui/x-date-pickers@v6.0.0-alpha.7` / `@mui/x-date-pickers-pro@v6.0.0-alpha.7`
|
|
94
|
+
|
|
95
|
+
#### Changes
|
|
96
|
+
|
|
97
|
+
- [fields] Rename section names to match the picker view nomenclature (#6779) @flaviendelangle
|
|
98
|
+
- [pickers] Fix pickers toolbar styling (#6793) @LukasTy
|
|
99
|
+
- [pickers] Improve validation JSDoc descriptions (#6777) @flaviendelangle
|
|
100
|
+
- [pickers] New `MobileDateTimePicker`, `DesktopDateTimePicker`, `DateTimePicker` and `StaticDateTimePicker` based on `DateTimeField` (#6767) @flaviendelangle
|
|
101
|
+
- [pickers] New `MobileTimePicker`, `DesktopTimePicker`, `TimePicker` and `StaticTimePicker` based on `TimeField` (#6728) @flaviendelangle
|
|
102
|
+
- [pickers] Support the `onError` prop and add context on the `onChange` prop (#6731) @flaviendelangle
|
|
103
|
+
|
|
104
|
+
### Docs
|
|
105
|
+
|
|
106
|
+
- [docs] Add missing Pro header suffix (#6775) @oliviertassinari
|
|
107
|
+
- [docs] Upgrade to Next.js 13 (#6790) @cherniavskii
|
|
108
|
+
|
|
109
|
+
### Core
|
|
110
|
+
|
|
111
|
+
- [core] Add OSSF Scorecard action (#6760) @oliviertassinari
|
|
112
|
+
- [core] Fix Pinned-Dependencies @oliviertassinari
|
|
113
|
+
- [core] Fix Scorecard fail Action @oliviertassinari
|
|
114
|
+
- [core] Pin GitHub Action dependencies (#6739) @renovate[bot]
|
|
115
|
+
- [core] Remove default access to GitHub action scopes @oliviertassinari
|
|
116
|
+
- [test] Fix test case name: Pro-> Premium @oliviertassinari
|
|
117
|
+
|
|
6
118
|
## 6.0.0-alpha.6
|
|
7
119
|
|
|
8
120
|
_Nov 4, 2022_
|
|
@@ -907,6 +1019,62 @@ You can find more information about the new api, including how to set those tran
|
|
|
907
1019
|
- [test] Skip tests for column pinning and dynamic row height (#5997) @m4theushw
|
|
908
1020
|
- [website] Improve security header @oliviertassinari
|
|
909
1021
|
|
|
1022
|
+
## 5.17.12
|
|
1023
|
+
|
|
1024
|
+
_Nov 17, 2022_
|
|
1025
|
+
|
|
1026
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
1027
|
+
|
|
1028
|
+
- 🌍 Improve Finnish (fi-FI) locale (#6859) @RainoPikkarainen
|
|
1029
|
+
- 🐞 Bugfixes
|
|
1030
|
+
|
|
1031
|
+
### `@mui/x-data-grid@v5.17.12` / `@mui/x-data-grid-pro@v5.17.12` / `@mui/x-data-grid-premium@v5.17.12`
|
|
1032
|
+
|
|
1033
|
+
#### Changes
|
|
1034
|
+
|
|
1035
|
+
- [DataGrid] Fix conflict with the latest version of `@types/react` (#6883) @vizv
|
|
1036
|
+
- [DataGridPremium] Support aggregating data from multiple row fields (#6844) @cherniavskii
|
|
1037
|
+
- [DataGridPro] Fix detail panel not working with `getRowSpacing` prop (#6858) @cherniavskii
|
|
1038
|
+
- [l10n] Improve Finnish (fi-FI) locale (#6859) @RainoPikkarainen
|
|
1039
|
+
|
|
1040
|
+
### Docs
|
|
1041
|
+
|
|
1042
|
+
- [docs] Clarify DataGrid Row Pinning docs (#6891) @cherniavskii
|
|
1043
|
+
|
|
1044
|
+
### Core
|
|
1045
|
+
|
|
1046
|
+
- [core] Upgrade monorepo (#6864) @m4theushw
|
|
1047
|
+
- [license] Polish error messages (#6881) @oliviertassinari
|
|
1048
|
+
|
|
1049
|
+
## 5.17.11
|
|
1050
|
+
|
|
1051
|
+
_Nov 10, 2022_
|
|
1052
|
+
|
|
1053
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
1054
|
+
|
|
1055
|
+
- 🐞 Bugfixes
|
|
1056
|
+
|
|
1057
|
+
### `@mui/x-data-grid@v5.17.11` / `@mui/x-data-grid-pro@v5.17.11` / `@mui/x-data-grid-premium@v5.17.11`
|
|
1058
|
+
|
|
1059
|
+
#### Changes
|
|
1060
|
+
|
|
1061
|
+
- [DataGrid] Fix for cell focus preventing scroll when virtualization enabled (#6622) @yaredtsy
|
|
1062
|
+
- [DataGridPro] Opt-out for column jump back on re-order (#6697) @gavbrennan
|
|
1063
|
+
|
|
1064
|
+
### `@mui/x-date-pickers@v5.0.8` / `@mui/x-date-pickers-pro@v5.0.8`
|
|
1065
|
+
|
|
1066
|
+
#### Changes
|
|
1067
|
+
|
|
1068
|
+
- [pickers] Fix pickers toolbar styling (#6793) @LukasTy
|
|
1069
|
+
|
|
1070
|
+
### Docs
|
|
1071
|
+
|
|
1072
|
+
- [docs] Fix link to localization page (#6766) @alexfauquette
|
|
1073
|
+
|
|
1074
|
+
### Core
|
|
1075
|
+
|
|
1076
|
+
- [license] Add new license status 'Out of scope' (#6774) @oliviertassinari
|
|
1077
|
+
|
|
910
1078
|
## 5.17.10
|
|
911
1079
|
|
|
912
1080
|
_Nov 4, 2022_
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import DataGridPremium instead.
|
|
3
|
+
*/
|
|
4
|
+
export function DataGrid() {
|
|
5
|
+
if (process.env.NODE_ENV === 'production') {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
throw new Error(["You try to import `DataGrid` from @mui/x-data-grid-premium but this module doesn't exist.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`."].join('\n'));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Import DataGridPremium instead.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export function DataGridPro() {
|
|
16
|
+
if (process.env.NODE_ENV === 'production') {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
throw new Error(["You try to import `DataGridPro` from @mui/x-data-grid-premium but this module doesn't exist.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`."].join('\n'));
|
|
21
|
+
}
|
|
@@ -55,8 +55,8 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Rows used to generate the aggregated value.
|
|
58
|
-
* If `filtered`, the aggregated values
|
|
59
|
-
* If `all`, the aggregated values
|
|
58
|
+
* If `filtered`, the aggregated values are generated using only the rows currently passing the filtering process.
|
|
59
|
+
* If `all`, the aggregated values are generated using all the rows.
|
|
60
60
|
* @default "filtered"
|
|
61
61
|
*/
|
|
62
62
|
aggregationRowsScope: PropTypes.oneOf(['all', 'filtered']),
|
|
@@ -295,8 +295,8 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
295
295
|
error: PropTypes.any,
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
|
-
*
|
|
299
|
-
* For each feature, if the flag is not explicitly set to `true`, the feature
|
|
298
|
+
* Unstable features, breaking changes might be introduced.
|
|
299
|
+
* For each feature, if the flag is not explicitly set to `true`, then the feature is fully disabled, and neither property nor method calls will have any effect.
|
|
300
300
|
*/
|
|
301
301
|
experimentalFeatures: PropTypes.shape({
|
|
302
302
|
columnGrouping: PropTypes.bool,
|
|
@@ -336,7 +336,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
336
336
|
/**
|
|
337
337
|
* Determines the position of an aggregated value.
|
|
338
338
|
* @param {GridGroupNode} groupNode The current group.
|
|
339
|
-
* @returns {GridAggregationPosition | null} Position of the aggregated value (if `null`, the group
|
|
339
|
+
* @returns {GridAggregationPosition | null} Position of the aggregated value (if `null`, the group isn't aggregated).
|
|
340
340
|
* @default `(groupNode) => groupNode == null ? 'footer' : 'inline'`
|
|
341
341
|
*/
|
|
342
342
|
getAggregationPosition: PropTypes.func,
|
|
@@ -452,7 +452,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
452
452
|
|
|
453
453
|
/**
|
|
454
454
|
* The initial state of the DataGridPremium.
|
|
455
|
-
* The data in it
|
|
455
|
+
* The data in it is set in the state on initialization but isn't controlled.
|
|
456
456
|
* If one of the data in `initialState` is also being controlled, then the control state wins.
|
|
457
457
|
*/
|
|
458
458
|
initialState: PropTypes.object,
|
|
@@ -479,6 +479,13 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
479
479
|
*/
|
|
480
480
|
isRowSelectable: PropTypes.func,
|
|
481
481
|
|
|
482
|
+
/**
|
|
483
|
+
* If `true`, moving the mouse pointer outside the grid before releasing the mouse button
|
|
484
|
+
* in a column re-order action will not cause the column to jump back to its original position.
|
|
485
|
+
* @default false
|
|
486
|
+
*/
|
|
487
|
+
keepColumnPositionIfDraggedOutside: PropTypes.bool,
|
|
488
|
+
|
|
482
489
|
/**
|
|
483
490
|
* If `true`, the selection model will retain selected rows that do not exist.
|
|
484
491
|
* Useful when using server side pagination and row selections need to be retained
|
|
@@ -919,8 +926,8 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
919
926
|
rowCount: PropTypes.number,
|
|
920
927
|
|
|
921
928
|
/**
|
|
922
|
-
* If `single`, all
|
|
923
|
-
* If `multiple`, each column
|
|
929
|
+
* If `single`, all the columns that are grouped are represented in the same grid column.
|
|
930
|
+
* If `multiple`, each column that is grouped is represented in its own grid column.
|
|
924
931
|
* @default 'single'
|
|
925
932
|
*/
|
|
926
933
|
rowGroupingColumnMode: PropTypes.oneOf(['multiple', 'single']),
|
package/DataGridPremium/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { useGridSelector } from '@mui/x-data-grid-pro';
|
|
|
6
6
|
import MenuItem from '@mui/material/MenuItem';
|
|
7
7
|
import FormControl from '@mui/material/FormControl';
|
|
8
8
|
import InputLabel from '@mui/material/InputLabel';
|
|
9
|
-
import { unstable_useId as useId } from '@mui/
|
|
9
|
+
import { unstable_useId as useId } from '@mui/utils';
|
|
10
10
|
import Select from '@mui/material/Select';
|
|
11
11
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
12
12
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "
|
|
3
|
+
const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "id", "value", "rowNode", "field", "focusElementRef", "hasFocus", "tabIndex", "isEditable"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
@@ -32,7 +32,14 @@ const getAggregationCellValue = ({
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
if (typeof aggregationFunction.getCellValue === 'function') {
|
|
36
|
+
const row = apiRef.current.getRow(rowId);
|
|
37
|
+
values.push(aggregationFunction.getCellValue({
|
|
38
|
+
row
|
|
39
|
+
}));
|
|
40
|
+
} else {
|
|
41
|
+
values.push(apiRef.current.getCellValue(rowId, field));
|
|
42
|
+
}
|
|
36
43
|
});
|
|
37
44
|
return aggregationFunction.apply({
|
|
38
45
|
values
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridValueFormatterParams, GridRowId } from '@mui/x-data-grid-pro';
|
|
1
|
+
import { GridValueFormatterParams, GridRowId, GridRowModel } from '@mui/x-data-grid-pro';
|
|
2
2
|
export interface GridAggregationState {
|
|
3
3
|
model: GridAggregationModel;
|
|
4
4
|
lookup: GridAggregationLookup;
|
|
@@ -17,6 +17,12 @@ export interface GridAggregationApi {
|
|
|
17
17
|
*/
|
|
18
18
|
setAggregationModel: (model: GridAggregationModel) => void;
|
|
19
19
|
}
|
|
20
|
+
export interface GridAggregationGetCellValueParams {
|
|
21
|
+
/**
|
|
22
|
+
* The row model of the row that the current cell belongs to.
|
|
23
|
+
*/
|
|
24
|
+
row: GridRowModel;
|
|
25
|
+
}
|
|
20
26
|
/**
|
|
21
27
|
* Grid aggregation function definition interface.
|
|
22
28
|
*/
|
|
@@ -53,6 +59,14 @@ export interface GridAggregationFunction<V = any, AV = V, FAV = AV> {
|
|
|
53
59
|
* @default `true`
|
|
54
60
|
*/
|
|
55
61
|
hasCellUnit?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Function that allows to transform the value of the cell passed to the aggregation function applier.
|
|
64
|
+
* Useful for aggregating data from multiple row fields.
|
|
65
|
+
* @demo https://mui.com/x/react-data-grid/aggregation/#aggregating-data-from-multiple-row-fields
|
|
66
|
+
* @param {GridAggregationGetCellValueParams} params The params of the current cell
|
|
67
|
+
* @returns {V} The value of the cell that will be passed to the aggregation `apply` function
|
|
68
|
+
*/
|
|
69
|
+
getCellValue?: (params: GridAggregationGetCellValueParams) => V;
|
|
56
70
|
}
|
|
57
71
|
interface GridAggregationParams<V = any> {
|
|
58
72
|
values: (V | undefined)[];
|
|
@@ -4,7 +4,7 @@ import { GridColumnRawLookup, GridHydrateRowsValue } from '@mui/x-data-grid-pro/
|
|
|
4
4
|
import { GridAggregationFunction, GridAggregationModel, GridAggregationRule, GridAggregationRules } from './gridAggregationInterfaces';
|
|
5
5
|
import { GridStatePremium } from '../../../models/gridStatePremium';
|
|
6
6
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
7
|
-
import { GridApiPremium } from '../../../models/gridApiPremium';
|
|
7
|
+
import { GridApiPremium, GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
8
8
|
export declare const GRID_AGGREGATION_ROOT_FOOTER_ROW_ID = "auto-generated-group-footer-root";
|
|
9
9
|
export declare const getAggregationFooterRowIdFromGroupId: (groupId: GridRowId | null) => string;
|
|
10
10
|
export declare const canColumnHaveAggregationFunction: ({ column, aggregationFunctionName, aggregationFunction, }: {
|
|
@@ -29,7 +29,7 @@ interface AddFooterRowsParams {
|
|
|
29
29
|
* If `true`, there are some aggregation rules to apply
|
|
30
30
|
*/
|
|
31
31
|
hasAggregationRule: boolean;
|
|
32
|
-
apiRef: React.MutableRefObject<
|
|
32
|
+
apiRef: React.MutableRefObject<GridPrivateApiPremium>;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Add a footer for each group that has at least one column with an aggregated value.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
3
3
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
4
|
-
import {
|
|
5
|
-
export declare const aggregationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'aggregationModel' | 'initialState'>,
|
|
4
|
+
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
5
|
+
export declare const aggregationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'aggregationModel' | 'initialState'>, GridPrivateApiPremium>;
|
|
6
6
|
export declare const useGridAggregation: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, 'onAggregationModelChange' | 'initialState' | 'aggregationModel' | 'getAggregationPosition' | 'aggregationFunctions' | 'aggregationRowsScope' | 'disableAggregation' | 'rowGroupingColumnMode'>) => void;
|
|
@@ -7,7 +7,7 @@ import { createAggregationLookup } from './createAggregationLookup';
|
|
|
7
7
|
export const aggregationStateInitializer = (state, props, apiRef) => {
|
|
8
8
|
var _ref, _props$aggregationMod, _props$initialState, _props$initialState$a;
|
|
9
9
|
|
|
10
|
-
apiRef.current.
|
|
10
|
+
apiRef.current.caches.aggregation = {
|
|
11
11
|
rulesOnLastColumnHydration: {},
|
|
12
12
|
rulesOnLastRowHydration: {}
|
|
13
13
|
};
|
|
@@ -62,7 +62,7 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
62
62
|
const {
|
|
63
63
|
rulesOnLastRowHydration,
|
|
64
64
|
rulesOnLastColumnHydration
|
|
65
|
-
} = apiRef.current.
|
|
65
|
+
} = apiRef.current.caches.aggregation;
|
|
66
66
|
const aggregationRules = props.disableAggregation ? {} : getAggregationRules({
|
|
67
67
|
columnsLookup: gridColumnLookupSelector(apiRef),
|
|
68
68
|
aggregationModel: gridAggregationModelSelector(apiRef),
|
|
@@ -70,13 +70,13 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
70
70
|
}); // Re-apply the row hydration to add / remove the aggregation footers
|
|
71
71
|
|
|
72
72
|
if (!areAggregationRulesEqual(rulesOnLastRowHydration, aggregationRules)) {
|
|
73
|
-
apiRef.current.
|
|
73
|
+
apiRef.current.requestPipeProcessorsApplication('hydrateRows');
|
|
74
74
|
applyAggregation();
|
|
75
75
|
} // Re-apply the column hydration to wrap / unwrap the aggregated columns
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
if (!areAggregationRulesEqual(rulesOnLastColumnHydration, aggregationRules)) {
|
|
79
|
-
apiRef.current.
|
|
79
|
+
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
80
80
|
}
|
|
81
81
|
}, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation]);
|
|
82
82
|
useGridApiEventHandler(apiRef, 'aggregationModelChange', checkAggregationRulesDiff);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
3
3
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
4
|
-
export declare const useGridAggregationPreProcessors: (apiRef: React.MutableRefObject<
|
|
4
|
+
export declare const useGridAggregationPreProcessors: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, 'aggregationFunctions' | 'disableAggregation' | 'getAggregationPosition'>) => void;
|
|
@@ -19,7 +19,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
19
19
|
const updateAggregatedColumns = React.useCallback(columnsState => {
|
|
20
20
|
const {
|
|
21
21
|
rulesOnLastColumnHydration
|
|
22
|
-
} = apiRef.current.
|
|
22
|
+
} = apiRef.current.caches.aggregation;
|
|
23
23
|
const aggregationRules = props.disableAggregation ? {} : getAggregationRules({
|
|
24
24
|
columnsLookup: columnsState.lookup,
|
|
25
25
|
aggregationModel: gridAggregationModelSelector(apiRef),
|
|
@@ -46,7 +46,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
46
46
|
|
|
47
47
|
columnsState.lookup[field] = column;
|
|
48
48
|
});
|
|
49
|
-
apiRef.current.
|
|
49
|
+
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
50
50
|
return columnsState;
|
|
51
51
|
}, [apiRef, props.aggregationFunctions, props.disableAggregation]);
|
|
52
52
|
const addGroupFooterRows = React.useCallback(value => {
|
|
@@ -58,11 +58,11 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
|
|
|
58
58
|
const hasAggregationRule = Object.keys(aggregationRules).length > 0; // If we did not have any aggregation footer before, and we still don't have any,
|
|
59
59
|
// Then we can skip this step
|
|
60
60
|
|
|
61
|
-
if (Object.keys(apiRef.current.
|
|
61
|
+
if (Object.keys(apiRef.current.caches.aggregation.rulesOnLastRowHydration).length === 0 && !hasAggregationRule) {
|
|
62
62
|
return value;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
apiRef.current.
|
|
65
|
+
apiRef.current.caches.aggregation.rulesOnLastRowHydration = aggregationRules;
|
|
66
66
|
return addFooterRows({
|
|
67
67
|
apiRef,
|
|
68
68
|
groupingParams: value,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as Excel from 'exceljs';
|
|
2
|
-
import { GridStateColDef, GridRowId
|
|
2
|
+
import { GridStateColDef, GridRowId } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridExceljsProcessInput, ColumnsStylesInterface } from '../gridExcelExportInterface';
|
|
4
|
+
import { GridPrivateApiPremium } from '../../../../models/gridApiPremium';
|
|
4
5
|
interface BuildExcelOptions {
|
|
5
6
|
columns: GridStateColDef[];
|
|
6
7
|
rowIds: GridRowId[];
|
|
@@ -11,5 +12,5 @@ interface BuildExcelOptions {
|
|
|
11
12
|
exceljsPostProcess?: (processInput: GridExceljsProcessInput) => Promise<void>;
|
|
12
13
|
columnsStyles?: ColumnsStylesInterface;
|
|
13
14
|
}
|
|
14
|
-
export declare function buildExcel(options: BuildExcelOptions, api:
|
|
15
|
+
export declare function buildExcel(options: BuildExcelOptions, api: GridPrivateApiPremium): Promise<Excel.Workbook>;
|
|
15
16
|
export {};
|
|
@@ -43,7 +43,7 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
43
43
|
const firstCellParams = api.getCellParams(id, columns[0].field);
|
|
44
44
|
const outlineLevel = firstCellParams.rowNode.depth; // `colSpan` is only calculated for rendered rows, so we need to calculate it during export for every row
|
|
45
45
|
|
|
46
|
-
api.
|
|
46
|
+
api.calculateColSpan({
|
|
47
47
|
rowId: id,
|
|
48
48
|
minFirstColumn: 0,
|
|
49
49
|
maxLastColumn: columns.length,
|
|
@@ -4,7 +4,7 @@ import { GridAggregatedFilterItemApplier, GridColumnRawLookup, GridApiCommunity
|
|
|
4
4
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
5
5
|
import { GridGroupingRule, GridGroupingRules, GridRowGroupingModel } from './gridRowGroupingInterfaces';
|
|
6
6
|
import { GridStatePremium } from '../../../models/gridStatePremium';
|
|
7
|
-
import {
|
|
7
|
+
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
8
8
|
export declare const GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = "__row_group_by_columns_group__";
|
|
9
9
|
export declare const ROW_GROUPING_STRATEGY = "grouping-columns";
|
|
10
10
|
export declare const getRowGroupingFieldFromGroupingCriteria: (groupingCriteria: string | null) => string;
|
|
@@ -25,7 +25,7 @@ interface FilterRowTreeFromTreeDataParams {
|
|
|
25
25
|
export declare const filterRowTreeFromGroupingColumns: (params: FilterRowTreeFromTreeDataParams) => Omit<GridFilterState, 'filterModel'>;
|
|
26
26
|
export declare const getColDefOverrides: (groupingColDefProp: DataGridPremiumProcessedProps['groupingColDef'], fields: string[]) => import("@mui/x-data-grid-pro").GridGroupingColDefOverride<any> | null | undefined;
|
|
27
27
|
export declare const mergeStateWithRowGroupingModel: (rowGroupingModel: GridRowGroupingModel) => (state: GridStatePremium) => GridStatePremium;
|
|
28
|
-
export declare const setStrategyAvailability: (
|
|
28
|
+
export declare const setStrategyAvailability: (privateApiRef: React.MutableRefObject<GridPrivateApiPremium>, disableRowGrouping: boolean) => void;
|
|
29
29
|
export declare const getCellGroupingCriteria: ({ row, id, colDef, groupingRule, }: {
|
|
30
30
|
row: GridRowModel;
|
|
31
31
|
id: GridRowId;
|
|
@@ -135,19 +135,19 @@ export const mergeStateWithRowGroupingModel = rowGroupingModel => state => _exte
|
|
|
135
135
|
model: rowGroupingModel
|
|
136
136
|
})
|
|
137
137
|
});
|
|
138
|
-
export const setStrategyAvailability = (
|
|
138
|
+
export const setStrategyAvailability = (privateApiRef, disableRowGrouping) => {
|
|
139
139
|
let isAvailable;
|
|
140
140
|
|
|
141
141
|
if (disableRowGrouping) {
|
|
142
142
|
isAvailable = () => false;
|
|
143
143
|
} else {
|
|
144
144
|
isAvailable = () => {
|
|
145
|
-
const rowGroupingSanitizedModel = gridRowGroupingSanitizedModelSelector(
|
|
145
|
+
const rowGroupingSanitizedModel = gridRowGroupingSanitizedModelSelector(privateApiRef);
|
|
146
146
|
return rowGroupingSanitizedModel.length > 0;
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
privateApiRef.current.setStrategyAvailability('rowTree', ROW_GROUPING_STRATEGY, isAvailable);
|
|
151
151
|
};
|
|
152
152
|
export const getCellGroupingCriteria = ({
|
|
153
153
|
row,
|
|
@@ -18,7 +18,7 @@ function Divider() {
|
|
|
18
18
|
export const rowGroupingStateInitializer = (state, props, apiRef) => {
|
|
19
19
|
var _ref, _props$rowGroupingMod, _props$initialState, _props$initialState$r;
|
|
20
20
|
|
|
21
|
-
apiRef.current.
|
|
21
|
+
apiRef.current.caches.rowGrouping = {
|
|
22
22
|
rulesOnLastRowTreeCreation: []
|
|
23
23
|
};
|
|
24
24
|
return _extends({}, state, {
|
|
@@ -184,19 +184,19 @@ export const useGridRowGrouping = (apiRef, props) => {
|
|
|
184
184
|
}, [apiRef, props.rowGroupingColumnMode]);
|
|
185
185
|
const checkGroupingColumnsModelDiff = React.useCallback(() => {
|
|
186
186
|
const sanitizedRowGroupingModel = gridRowGroupingSanitizedModelSelector(apiRef);
|
|
187
|
-
const rulesOnLastRowTreeCreation = apiRef.current.
|
|
187
|
+
const rulesOnLastRowTreeCreation = apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation;
|
|
188
188
|
const groupingRules = getGroupingRules({
|
|
189
189
|
sanitizedRowGroupingModel,
|
|
190
190
|
columnsLookup: gridColumnLookupSelector(apiRef)
|
|
191
191
|
});
|
|
192
192
|
|
|
193
193
|
if (!areGroupingRulesEqual(rulesOnLastRowTreeCreation, groupingRules)) {
|
|
194
|
-
apiRef.current.
|
|
195
|
-
apiRef.current.
|
|
194
|
+
apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation = groupingRules;
|
|
195
|
+
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
196
196
|
setStrategyAvailability(apiRef, props.disableRowGrouping); // Refresh the row tree creation strategy processing
|
|
197
197
|
// TODO: Add a clean way to re-run a strategy processing without publishing a private event
|
|
198
198
|
|
|
199
|
-
if (apiRef.current.
|
|
199
|
+
if (apiRef.current.getActiveStrategy('rowTree') === ROW_GROUPING_STRATEGY) {
|
|
200
200
|
apiRef.current.publishEvent('activeStrategyProcessorChange', 'rowTreeCreation');
|
|
201
201
|
}
|
|
202
202
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
3
|
-
import {
|
|
4
|
-
export declare const useGridRowGroupingPreProcessors: (apiRef: React.MutableRefObject<
|
|
3
|
+
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
4
|
+
export declare const useGridRowGroupingPreProcessors: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, 'disableRowGrouping' | 'groupingColDef' | 'rowGroupingColumnMode' | 'defaultGroupingExpansionDepth' | 'isGroupExpandedByDefault'>) => void;
|
|
@@ -80,7 +80,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
80
80
|
sanitizedRowGroupingModel,
|
|
81
81
|
columnsLookup
|
|
82
82
|
});
|
|
83
|
-
apiRef.current.
|
|
83
|
+
apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation = groupingRules;
|
|
84
84
|
|
|
85
85
|
const getRowTreeBuilderNode = rowId => {
|
|
86
86
|
const row = params.dataRowIdToModelLookup[rowId];
|
package/index.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ export * from './models';
|
|
|
18
18
|
export * from './components';
|
|
19
19
|
export type { DataGridPremiumProps, GridExperimentalPremiumFeatures, } from './models/dataGridPremiumProps';
|
|
20
20
|
export { useGridApiContext, useGridApiRef, useGridRootProps } from './typeOverloads/reexports';
|
|
21
|
-
export type {
|
|
21
|
+
export type { GridApi, GridInitialState, GridState } from './typeOverloads/reexports';
|
package/index.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import DataGridPremium instead.
|
|
3
|
+
*/
|
|
4
|
+
export function DataGrid() {
|
|
5
|
+
if (process.env.NODE_ENV === 'production') {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
throw new Error(["You try to import `DataGrid` from @mui/x-data-grid-premium but this module doesn't exist.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`."].join('\n'));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Import DataGridPremium instead.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export function DataGridPro() {
|
|
16
|
+
if (process.env.NODE_ENV === 'production') {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
throw new Error(["You try to import `DataGridPro` from @mui/x-data-grid-premium but this module doesn't exist.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`."].join('\n'));
|
|
21
|
+
}
|