@mui/x-data-grid-premium 7.25.0 → 7.27.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 +133 -0
- package/DataGridPremium/DataGridPremium.js +11 -4
- package/DataGridPremium/useDataGridPremiumComponent.js +3 -3
- package/esm/DataGridPremium/DataGridPremium.js +11 -4
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +3 -3
- package/esm/hooks/features/aggregation/gridAggregationUtils.js +1 -1
- package/esm/hooks/features/aggregation/useGridAggregation.js +0 -2
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +13 -10
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +2 -2
- package/esm/hooks/features/export/index.js +1 -1
- package/esm/hooks/features/export/serializer/excelSerializer.js +69 -180
- package/esm/hooks/features/export/serializer/setupExcelExportWebWorker.js +53 -0
- package/esm/hooks/features/export/serializer/utils.js +93 -0
- package/esm/hooks/features/export/useGridExcelExport.js +11 -5
- package/esm/setupExcelExportWebWorker.js +1 -0
- 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/cellSelection/useGridCellSelection.js +11 -8
- package/hooks/features/clipboard/useGridClipboardImport.js +2 -2
- package/hooks/features/export/index.d.ts +1 -1
- package/hooks/features/export/index.js +2 -2
- package/hooks/features/export/serializer/excelSerializer.d.ts +3 -31
- package/hooks/features/export/serializer/excelSerializer.js +74 -187
- package/hooks/features/export/serializer/setupExcelExportWebWorker.d.ts +2 -0
- package/hooks/features/export/serializer/setupExcelExportWebWorker.js +59 -0
- package/hooks/features/export/serializer/utils.d.ts +36 -0
- package/hooks/features/export/serializer/utils.js +106 -0
- package/hooks/features/export/useGridExcelExport.js +10 -3
- package/hooks/utils/useGridApiContext.d.ts +3 -1
- package/index.js +1 -1
- package/modern/DataGridPremium/DataGridPremium.js +11 -4
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +3 -3
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +1 -1
- package/modern/hooks/features/aggregation/useGridAggregation.js +0 -2
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +13 -10
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +2 -2
- package/modern/hooks/features/export/index.js +1 -1
- package/modern/hooks/features/export/serializer/excelSerializer.js +69 -180
- package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.js +53 -0
- package/modern/hooks/features/export/serializer/utils.js +93 -0
- package/modern/hooks/features/export/useGridExcelExport.js +11 -5
- package/modern/index.js +1 -1
- package/modern/setupExcelExportWebWorker.js +1 -0
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
- package/setupExcelExportWebWorker.d.ts +1 -0
- package/setupExcelExportWebWorker.js +12 -0
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,139 @@
|
|
|
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.27.0
|
|
7
|
+
|
|
8
|
+
_Feb 17, 2025_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ⚡ Improve Data Grid Excel export serialization performance
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 🌍 Improve Polish (pl-PL) and Ukrainian (uk-UA) locale on the Data Grid
|
|
15
|
+
|
|
16
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
17
|
+
@pawelkula, @Neonin.
|
|
18
|
+
Following are all team members who have contributed to this release:
|
|
19
|
+
@cherniavskii, @JCQuintas, @oliviertassinari, @arminmeh and @LukasTy
|
|
20
|
+
|
|
21
|
+
### Data Grid
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid@7.27.0`
|
|
24
|
+
|
|
25
|
+
- [DataGrid] Add `resetPageOnSortFilter` prop that resets the page after sorting and filtering (#16580) @arminmeh
|
|
26
|
+
- [DataGrid] Avoid `undefined` value for pagination `rowCount` (#16558) @cherniavskii
|
|
27
|
+
- [l10n] Improve Polish (pl-PL) locale (#16594) @pawelkula
|
|
28
|
+
- [l10n] Improve Ukrainian (uk-UA) locale (#16593) @Neonin
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@7.27.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@7.27.0`.
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-data-grid-premium@7.27.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-data-grid-pro@7.27.0`, plus:
|
|
37
|
+
|
|
38
|
+
- [DataGridPremium] Fix Excel export Web Worker demo not working in dev mode (#16532) @cherniavskii
|
|
39
|
+
- [DataGridPremium] Improve Excel export serialization performance (#16545) @cherniavskii
|
|
40
|
+
- [DataGridPremium] Namespace Excel export worker (#16539) @oliviertassinari
|
|
41
|
+
|
|
42
|
+
### Date and Time Pickers
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers@7.27.0`
|
|
45
|
+
|
|
46
|
+
Internal changes.
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers-pro@7.27.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
|
+
|
|
50
|
+
Same changes as in `@mui/x-date-pickers@7.27.0`, plus:
|
|
51
|
+
|
|
52
|
+
- [DateRangePicker] Avoid unnecessary field section focusing (#16569) @LukasTy
|
|
53
|
+
|
|
54
|
+
### Charts
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-charts@7.27.0`
|
|
57
|
+
|
|
58
|
+
Internal changes.
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-charts-pro@7.27.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
61
|
+
|
|
62
|
+
- [charts-pro] Fix automatic type overloads (#16579) @JCQuintas
|
|
63
|
+
|
|
64
|
+
### Core
|
|
65
|
+
|
|
66
|
+
- [test] Fix Data Grid data source error test on React 18 (#16565) @arminmeh
|
|
67
|
+
|
|
68
|
+
## 7.26.0
|
|
69
|
+
|
|
70
|
+
_Feb 7, 2025_
|
|
71
|
+
|
|
72
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
73
|
+
|
|
74
|
+
- ⚡ Mount and resize performance improvements for the Data Grid
|
|
75
|
+
- 🐞 Bugfixes
|
|
76
|
+
|
|
77
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
78
|
+
@lauri865.
|
|
79
|
+
Following are all team members who have contributed to this release:
|
|
80
|
+
@arminmeh, @noraleonte, @LukasTy, @KenanYusuf, @flaviendelangle.
|
|
81
|
+
|
|
82
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
83
|
+
|
|
84
|
+
### Data Grid
|
|
85
|
+
|
|
86
|
+
#### `@mui/x-data-grid@7.26.0`
|
|
87
|
+
|
|
88
|
+
- [DataGrid] Avoid `<GridRoot />` double-render pass on mount in SPA mode (#16480) @lauri865
|
|
89
|
+
|
|
90
|
+
#### `@mui/x-data-grid-pro@7.26.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
91
|
+
|
|
92
|
+
Same changes as in `@mui/x-data-grid@7.26.0`, plus:
|
|
93
|
+
|
|
94
|
+
- [DataGridPro] Fix the return type of `useGridApiContext()` for Pro and Premium packages on React < 19 (#16446) @arminmeh
|
|
95
|
+
|
|
96
|
+
#### `@mui/x-data-grid-premium@7.26.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
97
|
+
|
|
98
|
+
Same changes as in `@mui/x-data-grid-pro@7.26.0`, plus:
|
|
99
|
+
|
|
100
|
+
- [DataGridPremium] Fix "no rows" overlay not showing with active aggregation (#16468) @KenanYusuf
|
|
101
|
+
|
|
102
|
+
### Date and Time Pickers
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-date-pickers@7.26.0`
|
|
105
|
+
|
|
106
|
+
Internal changes.
|
|
107
|
+
|
|
108
|
+
#### `@mui/x-date-pickers-pro@7.26.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
109
|
+
|
|
110
|
+
Same changes as in `@mui/x-date-pickers@7.26.0`, plus:
|
|
111
|
+
|
|
112
|
+
- [DateRangePicker] Fix `currentMonthCalendarPosition` prop behavior on mobile (#16457) @LukasTy
|
|
113
|
+
- [DateRangePicker] Fix vertical alignment for multi input fields (#16490) @noraleonte
|
|
114
|
+
|
|
115
|
+
### Charts
|
|
116
|
+
|
|
117
|
+
#### `@mui/x-charts@7.26.0`
|
|
118
|
+
|
|
119
|
+
Internal changes.
|
|
120
|
+
|
|
121
|
+
#### `@mui/x-charts-pro@7.26.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
122
|
+
|
|
123
|
+
Same changes as in `@mui/x-charts@7.26.0`.
|
|
124
|
+
|
|
125
|
+
### Tree View
|
|
126
|
+
|
|
127
|
+
#### `@mui/x-tree-view@7.26.0`
|
|
128
|
+
|
|
129
|
+
Internal changes.
|
|
130
|
+
|
|
131
|
+
#### `@mui/x-tree-view-pro@7.26.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
132
|
+
|
|
133
|
+
Same changes as in `@mui/x-tree-view@7.26.0`.
|
|
134
|
+
|
|
135
|
+
### Core
|
|
136
|
+
|
|
137
|
+
- [core] Fix corepack and pnpm installation in CircleCI (#16452) @flaviendelangle
|
|
138
|
+
|
|
6
139
|
## 7.25.0
|
|
7
140
|
|
|
8
141
|
_Jan 31, 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
|
});
|
|
@@ -900,6 +901,12 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
900
901
|
* @returns {Promise<R> | R} The final values to update the row.
|
|
901
902
|
*/
|
|
902
903
|
processRowUpdate: _propTypes.default.func,
|
|
904
|
+
/**
|
|
905
|
+
* If `true`, the page is set to 0 after each sorting or filtering.
|
|
906
|
+
* This prop will be removed in the next major version and resetting the page will become the default behavior.
|
|
907
|
+
* @default false
|
|
908
|
+
*/
|
|
909
|
+
resetPageOnSortFilter: _propTypes.default.bool,
|
|
903
910
|
/**
|
|
904
911
|
* The milliseconds throttle delay for resizing the grid.
|
|
905
912
|
* @default 60
|
|
@@ -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);
|
|
@@ -49,8 +48,8 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
49
48
|
(0, _internals.useGridInitializeState)(_internals.columnPinningStateInitializer, apiRef, props);
|
|
50
49
|
(0, _internals.useGridInitializeState)(_internals.columnsStateInitializer, apiRef, props);
|
|
51
50
|
(0, _internals.useGridInitializeState)(_internals.rowPinningStateInitializer, apiRef, props);
|
|
52
|
-
(0, _internals.useGridInitializeState)(_internals.paginationStateInitializer, apiRef, props);
|
|
53
51
|
(0, _internals.useGridInitializeState)(_internals.rowsStateInitializer, apiRef, props);
|
|
52
|
+
(0, _internals.useGridInitializeState)(_internals.paginationStateInitializer, apiRef, props);
|
|
54
53
|
(0, _internals.useGridInitializeState)(_internals.editingStateInitializer, apiRef, props);
|
|
55
54
|
(0, _internals.useGridInitializeState)(_internals.focusStateInitializer, apiRef, props);
|
|
56
55
|
(0, _internals.useGridInitializeState)(_internals.sortingStateInitializer, 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,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
|
});
|
|
@@ -893,6 +894,12 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
893
894
|
* @returns {Promise<R> | R} The final values to update the row.
|
|
894
895
|
*/
|
|
895
896
|
processRowUpdate: PropTypes.func,
|
|
897
|
+
/**
|
|
898
|
+
* If `true`, the page is set to 0 after each sorting or filtering.
|
|
899
|
+
* This prop will be removed in the next major version and resetting the page will become the default behavior.
|
|
900
|
+
* @default false
|
|
901
|
+
*/
|
|
902
|
+
resetPageOnSortFilter: PropTypes.bool,
|
|
896
903
|
/**
|
|
897
904
|
* The milliseconds throttle delay for resizing the grid.
|
|
898
905
|
* @default 60
|
|
@@ -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);
|
|
@@ -42,8 +41,8 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
42
41
|
useGridInitializeState(columnPinningStateInitializer, apiRef, props);
|
|
43
42
|
useGridInitializeState(columnsStateInitializer, apiRef, props);
|
|
44
43
|
useGridInitializeState(rowPinningStateInitializer, apiRef, props);
|
|
45
|
-
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
46
44
|
useGridInitializeState(rowsStateInitializer, apiRef, props);
|
|
45
|
+
useGridInitializeState(paginationStateInitializer, apiRef, props);
|
|
47
46
|
useGridInitializeState(editingStateInitializer, apiRef, props);
|
|
48
47
|
useGridInitializeState(focusStateInitializer, apiRef, props);
|
|
49
48
|
useGridInitializeState(sortingStateInitializer, 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);
|
|
@@ -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]);
|
|
@@ -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);
|
|
@@ -255,7 +255,6 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
255
255
|
const onProcessRowUpdateError = props.onProcessRowUpdateError;
|
|
256
256
|
const getRowId = props.getRowId;
|
|
257
257
|
const enableClipboardPaste = !props.disableClipboardPaste;
|
|
258
|
-
const rootEl = apiRef.current.rootElementRef?.current;
|
|
259
258
|
const logger = useGridLogger(apiRef, 'useGridClipboardImport');
|
|
260
259
|
const splitClipboardPastedText = props.splitClipboardPastedText;
|
|
261
260
|
const {
|
|
@@ -278,6 +277,7 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
278
277
|
return;
|
|
279
278
|
}
|
|
280
279
|
}
|
|
280
|
+
const rootEl = apiRef.current.rootElementRef?.current;
|
|
281
281
|
if (!rootEl) {
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
@@ -318,7 +318,7 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
318
318
|
paginationMode
|
|
319
319
|
});
|
|
320
320
|
cellUpdater.applyUpdates();
|
|
321
|
-
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste,
|
|
321
|
+
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, splitClipboardPastedText, pagination, paginationMode, onBeforeClipboardPasteStart, logger]);
|
|
322
322
|
const checkIfCanStartEditing = React.useCallback((initialValue, {
|
|
323
323
|
event
|
|
324
324
|
}) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./gridExcelExportInterface.js";
|
|
2
|
-
export { setupExcelExportWebWorker } from "./serializer/
|
|
2
|
+
export { setupExcelExportWebWorker } from "./serializer/setupExcelExportWebWorker.js";
|