@mui/x-data-grid-pro 5.17.20 → 5.17.22
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 +64 -0
- package/hooks/features/rowPinning/useGridRowPinningPreProcessors.d.ts +8 -2
- package/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +43 -4
- package/index.js +1 -1
- package/legacy/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +43 -4
- package/legacy/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/modern/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +41 -4
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +44 -4
- package/node/index.js +1 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +2 -2
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,70 @@
|
|
|
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
|
+
## v5.17.22
|
|
7
|
+
|
|
8
|
+
_Feb 2, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Add Urdu (ur-PK) locale
|
|
13
|
+
- 🌍 Improve French (fr-FR) and Italian (it-IT) locales
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v5.17.22` / `@mui/x-data-grid-pro@v5.17.22` / `@mui/x-data-grid-premium@v5.17.22`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Fix an error when deleting pinned row using the buttons in the `actions` column (#7767) @cherniavskii
|
|
21
|
+
- [DataGrid] Fix print preview regression in Chrome browser (#7405) @cherniavskii
|
|
22
|
+
- [l10n] Add Urdu (ur-PK) locale (#7778) @MBilalShafi
|
|
23
|
+
- [l10n] Improve French (fr-FR) locale (#7795) @Vivek-Prajapatii
|
|
24
|
+
|
|
25
|
+
### `@mui/x-date-pickers@v5.0.17` / `@mui/x-date-pickers-pro@v5.0.17`
|
|
26
|
+
|
|
27
|
+
#### Changes
|
|
28
|
+
|
|
29
|
+
- [TimePicker] Add missing `themeAugmentation` entry (#7732) @LukasTy
|
|
30
|
+
- [l10n] Improve Italian (it-IT) locale (#7761) @simonecervini
|
|
31
|
+
|
|
32
|
+
## v5.17.21
|
|
33
|
+
|
|
34
|
+
_Jan 27, 2023_
|
|
35
|
+
|
|
36
|
+
We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
37
|
+
|
|
38
|
+
- 🌍 Add Belarusian (be-BY), Czech (cs-CZ), and Russian (ru-RU) locales
|
|
39
|
+
- 🌍 Improve Slovak (sk-SK), Japanese (ja-JP), Vietnamese (vi-VN), and Spanish (es-ES) locales
|
|
40
|
+
- 🐞 Bugfixes
|
|
41
|
+
|
|
42
|
+
### `@mui/x-data-grid@v5.17.21` / `@mui/x-data-grid-pro@v5.17.21` / `@mui/x-data-grid-premium@v5.17.21`
|
|
43
|
+
|
|
44
|
+
#### Changes
|
|
45
|
+
|
|
46
|
+
- [DataGrid] Add `title` attribute to cells (#7695) @thupi
|
|
47
|
+
- [DataGrid] Fix grid state not being updated after print preview is closed (#7680) @cherniavskii
|
|
48
|
+
- [DataGrid] Fix non-hideable columns visibility toggling (#7716) @cherniavskii
|
|
49
|
+
- [DataGrid] Fix scrolling on resize for data grids inside shadow root (#7722) @cherniavskii
|
|
50
|
+
- [DataGridPremium] Create aggregation footer row with `isAutoGenerated: true` (#7681) @m4theushw
|
|
51
|
+
- [l10n] Add Belarusian (be-BY) locale (#7718) @volhalink
|
|
52
|
+
- [l10n] Add Slovak (sk-SK) translation for aggregation functions (#7690) @msidlo
|
|
53
|
+
- [l10n] Add missing core locales for `MuiTablePagination` (#7719) @MBilalShafi
|
|
54
|
+
- [l10n] Improve Japanese (ja-JP) locale (#7627) @makoto14
|
|
55
|
+
- [l10n] Improve Vietnamese (vi-VN) locale (#7601) @SpacerZ
|
|
56
|
+
|
|
57
|
+
### `@mui/x-date-pickers@v5.0.16` / `@mui/x-date-pickers-pro@v5.0.16`
|
|
58
|
+
|
|
59
|
+
#### Changes
|
|
60
|
+
|
|
61
|
+
- [pickers] Add missing components to `themeAugmentation` (#7677) @LukasTy
|
|
62
|
+
- [l10n] Add Czech (cs-CZ) locale (#7666) @OndrejHj04
|
|
63
|
+
- [l10n] Add Russian (ru-RU) locale (#7708) @rstmzh
|
|
64
|
+
- [l10n] Improve Spanish (es-ES) locale (#7614) @WiXSL
|
|
65
|
+
|
|
66
|
+
### Docs
|
|
67
|
+
|
|
68
|
+
- [docs] Add info callout about available component `slots` (#7723) @Vivek-Prajapatii
|
|
69
|
+
|
|
6
70
|
## 5.17.20
|
|
7
71
|
|
|
8
72
|
_Jan 19, 2023_
|
|
@@ -2,14 +2,15 @@ import * as React from 'react';
|
|
|
2
2
|
import { GridHydrateRowsValue } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GridRowEntry, GridRowId, GridRowModel } from '@mui/x-data-grid';
|
|
4
4
|
import { GridApiPro } from '../../../models/gridApiPro';
|
|
5
|
-
import { GridPinnedRowsProp } from './gridRowPinningInterface';
|
|
5
|
+
import type { GridPinnedRowsProp } from './gridRowPinningInterface';
|
|
6
6
|
declare type GridPinnedRowPosition = keyof GridPinnedRowsProp;
|
|
7
|
-
export declare function addPinnedRow({ groupingParams, rowModel, rowId, position, apiRef, }: {
|
|
7
|
+
export declare function addPinnedRow({ groupingParams, rowModel, rowId, position, apiRef, isAutoGenerated, }: {
|
|
8
8
|
groupingParams: GridHydrateRowsValue;
|
|
9
9
|
rowModel: GridRowModel;
|
|
10
10
|
rowId: GridRowId;
|
|
11
11
|
position: GridPinnedRowPosition;
|
|
12
12
|
apiRef: React.MutableRefObject<GridApiPro>;
|
|
13
|
+
isAutoGenerated: boolean;
|
|
13
14
|
}): {
|
|
14
15
|
idRowsLookup: {
|
|
15
16
|
[x: string]: import("@mui/x-data-grid").GridValidRowModel;
|
|
@@ -30,5 +31,10 @@ export declare function addPinnedRow({ groupingParams, rowModel, rowId, position
|
|
|
30
31
|
ids: GridRowId[];
|
|
31
32
|
idToIdLookup: Record<string, GridRowId>;
|
|
32
33
|
};
|
|
34
|
+
export declare function removePinnedRow({ groupingParams, rowId, apiRef, }: {
|
|
35
|
+
groupingParams: GridHydrateRowsValue;
|
|
36
|
+
rowId: GridRowId;
|
|
37
|
+
apiRef: React.MutableRefObject<GridApiPro>;
|
|
38
|
+
}): void;
|
|
33
39
|
export declare const useGridRowPinningPreProcessors: (apiRef: React.MutableRefObject<GridApiPro>) => void;
|
|
34
40
|
export {};
|
|
@@ -6,7 +6,8 @@ export function addPinnedRow({
|
|
|
6
6
|
rowModel,
|
|
7
7
|
rowId,
|
|
8
8
|
position,
|
|
9
|
-
apiRef
|
|
9
|
+
apiRef,
|
|
10
|
+
isAutoGenerated
|
|
10
11
|
}) {
|
|
11
12
|
var _groupingParams$addit;
|
|
12
13
|
|
|
@@ -20,7 +21,7 @@ export function addPinnedRow({
|
|
|
20
21
|
|
|
21
22
|
tree[rowId] = {
|
|
22
23
|
id: rowId,
|
|
23
|
-
isAutoGenerated
|
|
24
|
+
isAutoGenerated,
|
|
24
25
|
parent: null,
|
|
25
26
|
depth: 0,
|
|
26
27
|
groupingKey: null,
|
|
@@ -44,11 +45,28 @@ export function addPinnedRow({
|
|
|
44
45
|
})
|
|
45
46
|
});
|
|
46
47
|
}
|
|
48
|
+
export function removePinnedRow({
|
|
49
|
+
groupingParams,
|
|
50
|
+
rowId,
|
|
51
|
+
apiRef
|
|
52
|
+
}) {
|
|
53
|
+
const idRowsLookup = _extends({}, groupingParams.idRowsLookup);
|
|
54
|
+
|
|
55
|
+
const tree = _extends({}, groupingParams.tree);
|
|
56
|
+
|
|
57
|
+
delete idRowsLookup[rowId];
|
|
58
|
+
delete tree[rowId];
|
|
59
|
+
delete apiRef.current.unstable_caches.rows.idRowsLookup[rowId];
|
|
60
|
+
delete apiRef.current.unstable_caches.rows.idToIdLookup[rowId];
|
|
61
|
+
}
|
|
47
62
|
export const useGridRowPinningPreProcessors = apiRef => {
|
|
63
|
+
const previousPinnedRowsCacheRef = React.useRef(null);
|
|
48
64
|
const addPinnedRows = React.useCallback(groupingParams => {
|
|
49
65
|
var _pinnedRowsCache$topI, _pinnedRowsCache$bott;
|
|
50
66
|
|
|
51
67
|
const pinnedRowsCache = apiRef.current.unstable_caches.pinnedRows || {};
|
|
68
|
+
const previousPinnedRowsCache = previousPinnedRowsCacheRef.current;
|
|
69
|
+
previousPinnedRowsCacheRef.current = pinnedRowsCache;
|
|
52
70
|
|
|
53
71
|
let newGroupingParams = _extends({}, groupingParams, {
|
|
54
72
|
additionalRowGroups: _extends({}, groupingParams.additionalRowGroups, {
|
|
@@ -57,13 +75,33 @@ export const useGridRowPinningPreProcessors = apiRef => {
|
|
|
57
75
|
})
|
|
58
76
|
});
|
|
59
77
|
|
|
78
|
+
if (previousPinnedRowsCache) {
|
|
79
|
+
var _previousPinnedRowsCa, _previousPinnedRowsCa2;
|
|
80
|
+
|
|
81
|
+
(_previousPinnedRowsCa = previousPinnedRowsCache.topIds) == null ? void 0 : _previousPinnedRowsCa.forEach(rowId => {
|
|
82
|
+
removePinnedRow({
|
|
83
|
+
groupingParams: newGroupingParams,
|
|
84
|
+
rowId,
|
|
85
|
+
apiRef
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
(_previousPinnedRowsCa2 = previousPinnedRowsCache.bottomIds) == null ? void 0 : _previousPinnedRowsCa2.forEach(rowId => {
|
|
89
|
+
removePinnedRow({
|
|
90
|
+
groupingParams: newGroupingParams,
|
|
91
|
+
rowId,
|
|
92
|
+
apiRef
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
60
97
|
(_pinnedRowsCache$topI = pinnedRowsCache.topIds) == null ? void 0 : _pinnedRowsCache$topI.forEach(rowId => {
|
|
61
98
|
newGroupingParams = addPinnedRow({
|
|
62
99
|
groupingParams: newGroupingParams,
|
|
63
100
|
rowModel: pinnedRowsCache.idLookup[rowId],
|
|
64
101
|
rowId,
|
|
65
102
|
position: 'top',
|
|
66
|
-
apiRef
|
|
103
|
+
apiRef,
|
|
104
|
+
isAutoGenerated: false
|
|
67
105
|
});
|
|
68
106
|
});
|
|
69
107
|
(_pinnedRowsCache$bott = pinnedRowsCache.bottomIds) == null ? void 0 : _pinnedRowsCache$bott.forEach(rowId => {
|
|
@@ -72,7 +110,8 @@ export const useGridRowPinningPreProcessors = apiRef => {
|
|
|
72
110
|
rowModel: pinnedRowsCache.idLookup[rowId],
|
|
73
111
|
rowId,
|
|
74
112
|
position: 'bottom',
|
|
75
|
-
apiRef
|
|
113
|
+
apiRef,
|
|
114
|
+
isAutoGenerated: false
|
|
76
115
|
});
|
|
77
116
|
}); // If row with the same `id` is present both in `rows` and `pinnedRows` - remove it from `ids`
|
|
78
117
|
|
package/index.js
CHANGED
|
@@ -10,7 +10,8 @@ export function addPinnedRow(_ref) {
|
|
|
10
10
|
rowModel = _ref.rowModel,
|
|
11
11
|
rowId = _ref.rowId,
|
|
12
12
|
position = _ref.position,
|
|
13
|
-
apiRef = _ref.apiRef
|
|
13
|
+
apiRef = _ref.apiRef,
|
|
14
|
+
isAutoGenerated = _ref.isAutoGenerated;
|
|
14
15
|
|
|
15
16
|
var idRowsLookup = _extends({}, groupingParams.idRowsLookup);
|
|
16
17
|
|
|
@@ -22,7 +23,7 @@ export function addPinnedRow(_ref) {
|
|
|
22
23
|
|
|
23
24
|
tree[rowId] = {
|
|
24
25
|
id: rowId,
|
|
25
|
-
isAutoGenerated:
|
|
26
|
+
isAutoGenerated: isAutoGenerated,
|
|
26
27
|
parent: null,
|
|
27
28
|
depth: 0,
|
|
28
29
|
groupingKey: null,
|
|
@@ -44,11 +45,28 @@ export function addPinnedRow(_ref) {
|
|
|
44
45
|
})
|
|
45
46
|
});
|
|
46
47
|
}
|
|
48
|
+
export function removePinnedRow(_ref2) {
|
|
49
|
+
var groupingParams = _ref2.groupingParams,
|
|
50
|
+
rowId = _ref2.rowId,
|
|
51
|
+
apiRef = _ref2.apiRef;
|
|
52
|
+
|
|
53
|
+
var idRowsLookup = _extends({}, groupingParams.idRowsLookup);
|
|
54
|
+
|
|
55
|
+
var tree = _extends({}, groupingParams.tree);
|
|
56
|
+
|
|
57
|
+
delete idRowsLookup[rowId];
|
|
58
|
+
delete tree[rowId];
|
|
59
|
+
delete apiRef.current.unstable_caches.rows.idRowsLookup[rowId];
|
|
60
|
+
delete apiRef.current.unstable_caches.rows.idToIdLookup[rowId];
|
|
61
|
+
}
|
|
47
62
|
export var useGridRowPinningPreProcessors = function useGridRowPinningPreProcessors(apiRef) {
|
|
63
|
+
var previousPinnedRowsCacheRef = React.useRef(null);
|
|
48
64
|
var addPinnedRows = React.useCallback(function (groupingParams) {
|
|
49
65
|
var _pinnedRowsCache$topI, _pinnedRowsCache$bott;
|
|
50
66
|
|
|
51
67
|
var pinnedRowsCache = apiRef.current.unstable_caches.pinnedRows || {};
|
|
68
|
+
var previousPinnedRowsCache = previousPinnedRowsCacheRef.current;
|
|
69
|
+
previousPinnedRowsCacheRef.current = pinnedRowsCache;
|
|
52
70
|
|
|
53
71
|
var newGroupingParams = _extends({}, groupingParams, {
|
|
54
72
|
additionalRowGroups: _extends({}, groupingParams.additionalRowGroups, {
|
|
@@ -57,13 +75,33 @@ export var useGridRowPinningPreProcessors = function useGridRowPinningPreProcess
|
|
|
57
75
|
})
|
|
58
76
|
});
|
|
59
77
|
|
|
78
|
+
if (previousPinnedRowsCache) {
|
|
79
|
+
var _previousPinnedRowsCa, _previousPinnedRowsCa2;
|
|
80
|
+
|
|
81
|
+
(_previousPinnedRowsCa = previousPinnedRowsCache.topIds) == null ? void 0 : _previousPinnedRowsCa.forEach(function (rowId) {
|
|
82
|
+
removePinnedRow({
|
|
83
|
+
groupingParams: newGroupingParams,
|
|
84
|
+
rowId: rowId,
|
|
85
|
+
apiRef: apiRef
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
(_previousPinnedRowsCa2 = previousPinnedRowsCache.bottomIds) == null ? void 0 : _previousPinnedRowsCa2.forEach(function (rowId) {
|
|
89
|
+
removePinnedRow({
|
|
90
|
+
groupingParams: newGroupingParams,
|
|
91
|
+
rowId: rowId,
|
|
92
|
+
apiRef: apiRef
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
60
97
|
(_pinnedRowsCache$topI = pinnedRowsCache.topIds) == null ? void 0 : _pinnedRowsCache$topI.forEach(function (rowId) {
|
|
61
98
|
newGroupingParams = addPinnedRow({
|
|
62
99
|
groupingParams: newGroupingParams,
|
|
63
100
|
rowModel: pinnedRowsCache.idLookup[rowId],
|
|
64
101
|
rowId: rowId,
|
|
65
102
|
position: 'top',
|
|
66
|
-
apiRef: apiRef
|
|
103
|
+
apiRef: apiRef,
|
|
104
|
+
isAutoGenerated: false
|
|
67
105
|
});
|
|
68
106
|
});
|
|
69
107
|
(_pinnedRowsCache$bott = pinnedRowsCache.bottomIds) == null ? void 0 : _pinnedRowsCache$bott.forEach(function (rowId) {
|
|
@@ -72,7 +110,8 @@ export var useGridRowPinningPreProcessors = function useGridRowPinningPreProcess
|
|
|
72
110
|
rowModel: pinnedRowsCache.idLookup[rowId],
|
|
73
111
|
rowId: rowId,
|
|
74
112
|
position: 'bottom',
|
|
75
|
-
apiRef: apiRef
|
|
113
|
+
apiRef: apiRef,
|
|
114
|
+
isAutoGenerated: false
|
|
76
115
|
});
|
|
77
116
|
}); // If row with the same `id` is present both in `rows` and `pinnedRows` - remove it from `ids`
|
|
78
117
|
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY3NTI5MjQwMDAwMA==";
|
|
4
4
|
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
// A simple hack to set the value in the test environment (has no build step).
|
|
@@ -6,7 +6,8 @@ export function addPinnedRow({
|
|
|
6
6
|
rowModel,
|
|
7
7
|
rowId,
|
|
8
8
|
position,
|
|
9
|
-
apiRef
|
|
9
|
+
apiRef,
|
|
10
|
+
isAutoGenerated
|
|
10
11
|
}) {
|
|
11
12
|
const idRowsLookup = _extends({}, groupingParams.idRowsLookup);
|
|
12
13
|
|
|
@@ -18,7 +19,7 @@ export function addPinnedRow({
|
|
|
18
19
|
|
|
19
20
|
tree[rowId] = {
|
|
20
21
|
id: rowId,
|
|
21
|
-
isAutoGenerated
|
|
22
|
+
isAutoGenerated,
|
|
22
23
|
parent: null,
|
|
23
24
|
depth: 0,
|
|
24
25
|
groupingKey: null,
|
|
@@ -42,9 +43,26 @@ export function addPinnedRow({
|
|
|
42
43
|
})
|
|
43
44
|
});
|
|
44
45
|
}
|
|
46
|
+
export function removePinnedRow({
|
|
47
|
+
groupingParams,
|
|
48
|
+
rowId,
|
|
49
|
+
apiRef
|
|
50
|
+
}) {
|
|
51
|
+
const idRowsLookup = _extends({}, groupingParams.idRowsLookup);
|
|
52
|
+
|
|
53
|
+
const tree = _extends({}, groupingParams.tree);
|
|
54
|
+
|
|
55
|
+
delete idRowsLookup[rowId];
|
|
56
|
+
delete tree[rowId];
|
|
57
|
+
delete apiRef.current.unstable_caches.rows.idRowsLookup[rowId];
|
|
58
|
+
delete apiRef.current.unstable_caches.rows.idToIdLookup[rowId];
|
|
59
|
+
}
|
|
45
60
|
export const useGridRowPinningPreProcessors = apiRef => {
|
|
61
|
+
const previousPinnedRowsCacheRef = React.useRef(null);
|
|
46
62
|
const addPinnedRows = React.useCallback(groupingParams => {
|
|
47
63
|
const pinnedRowsCache = apiRef.current.unstable_caches.pinnedRows || {};
|
|
64
|
+
const previousPinnedRowsCache = previousPinnedRowsCacheRef.current;
|
|
65
|
+
previousPinnedRowsCacheRef.current = pinnedRowsCache;
|
|
48
66
|
|
|
49
67
|
let newGroupingParams = _extends({}, groupingParams, {
|
|
50
68
|
additionalRowGroups: _extends({}, groupingParams.additionalRowGroups, {
|
|
@@ -53,13 +71,31 @@ export const useGridRowPinningPreProcessors = apiRef => {
|
|
|
53
71
|
})
|
|
54
72
|
});
|
|
55
73
|
|
|
74
|
+
if (previousPinnedRowsCache) {
|
|
75
|
+
previousPinnedRowsCache.topIds?.forEach(rowId => {
|
|
76
|
+
removePinnedRow({
|
|
77
|
+
groupingParams: newGroupingParams,
|
|
78
|
+
rowId,
|
|
79
|
+
apiRef
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
previousPinnedRowsCache.bottomIds?.forEach(rowId => {
|
|
83
|
+
removePinnedRow({
|
|
84
|
+
groupingParams: newGroupingParams,
|
|
85
|
+
rowId,
|
|
86
|
+
apiRef
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
56
91
|
pinnedRowsCache.topIds?.forEach(rowId => {
|
|
57
92
|
newGroupingParams = addPinnedRow({
|
|
58
93
|
groupingParams: newGroupingParams,
|
|
59
94
|
rowModel: pinnedRowsCache.idLookup[rowId],
|
|
60
95
|
rowId,
|
|
61
96
|
position: 'top',
|
|
62
|
-
apiRef
|
|
97
|
+
apiRef,
|
|
98
|
+
isAutoGenerated: false
|
|
63
99
|
});
|
|
64
100
|
});
|
|
65
101
|
pinnedRowsCache.bottomIds?.forEach(rowId => {
|
|
@@ -68,7 +104,8 @@ export const useGridRowPinningPreProcessors = apiRef => {
|
|
|
68
104
|
rowModel: pinnedRowsCache.idLookup[rowId],
|
|
69
105
|
rowId,
|
|
70
106
|
position: 'bottom',
|
|
71
|
-
apiRef
|
|
107
|
+
apiRef,
|
|
108
|
+
isAutoGenerated: false
|
|
72
109
|
});
|
|
73
110
|
}); // If row with the same `id` is present both in `rows` and `pinnedRows` - remove it from `ids`
|
|
74
111
|
|
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 = "MTY3NTI5MjQwMDAwMA==";
|
|
4
4
|
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
// A simple hack to set the value in the test environment (has no build step).
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.addPinnedRow = addPinnedRow;
|
|
9
|
+
exports.removePinnedRow = removePinnedRow;
|
|
9
10
|
exports.useGridRowPinningPreProcessors = void 0;
|
|
10
11
|
|
|
11
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -23,7 +24,8 @@ function addPinnedRow({
|
|
|
23
24
|
rowModel,
|
|
24
25
|
rowId,
|
|
25
26
|
position,
|
|
26
|
-
apiRef
|
|
27
|
+
apiRef,
|
|
28
|
+
isAutoGenerated
|
|
27
29
|
}) {
|
|
28
30
|
var _groupingParams$addit;
|
|
29
31
|
|
|
@@ -35,7 +37,7 @@ function addPinnedRow({
|
|
|
35
37
|
|
|
36
38
|
tree[rowId] = {
|
|
37
39
|
id: rowId,
|
|
38
|
-
isAutoGenerated
|
|
40
|
+
isAutoGenerated,
|
|
39
41
|
parent: null,
|
|
40
42
|
depth: 0,
|
|
41
43
|
groupingKey: null,
|
|
@@ -60,24 +62,61 @@ function addPinnedRow({
|
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
function removePinnedRow({
|
|
66
|
+
groupingParams,
|
|
67
|
+
rowId,
|
|
68
|
+
apiRef
|
|
69
|
+
}) {
|
|
70
|
+
const idRowsLookup = (0, _extends2.default)({}, groupingParams.idRowsLookup);
|
|
71
|
+
const tree = (0, _extends2.default)({}, groupingParams.tree);
|
|
72
|
+
delete idRowsLookup[rowId];
|
|
73
|
+
delete tree[rowId];
|
|
74
|
+
delete apiRef.current.unstable_caches.rows.idRowsLookup[rowId];
|
|
75
|
+
delete apiRef.current.unstable_caches.rows.idToIdLookup[rowId];
|
|
76
|
+
}
|
|
77
|
+
|
|
63
78
|
const useGridRowPinningPreProcessors = apiRef => {
|
|
79
|
+
const previousPinnedRowsCacheRef = React.useRef(null);
|
|
64
80
|
const addPinnedRows = React.useCallback(groupingParams => {
|
|
65
81
|
var _pinnedRowsCache$topI, _pinnedRowsCache$bott;
|
|
66
82
|
|
|
67
83
|
const pinnedRowsCache = apiRef.current.unstable_caches.pinnedRows || {};
|
|
84
|
+
const previousPinnedRowsCache = previousPinnedRowsCacheRef.current;
|
|
85
|
+
previousPinnedRowsCacheRef.current = pinnedRowsCache;
|
|
68
86
|
let newGroupingParams = (0, _extends2.default)({}, groupingParams, {
|
|
69
87
|
additionalRowGroups: (0, _extends2.default)({}, groupingParams.additionalRowGroups, {
|
|
70
88
|
// reset pinned rows state
|
|
71
89
|
pinnedRows: {}
|
|
72
90
|
})
|
|
73
91
|
});
|
|
92
|
+
|
|
93
|
+
if (previousPinnedRowsCache) {
|
|
94
|
+
var _previousPinnedRowsCa, _previousPinnedRowsCa2;
|
|
95
|
+
|
|
96
|
+
(_previousPinnedRowsCa = previousPinnedRowsCache.topIds) == null ? void 0 : _previousPinnedRowsCa.forEach(rowId => {
|
|
97
|
+
removePinnedRow({
|
|
98
|
+
groupingParams: newGroupingParams,
|
|
99
|
+
rowId,
|
|
100
|
+
apiRef
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
(_previousPinnedRowsCa2 = previousPinnedRowsCache.bottomIds) == null ? void 0 : _previousPinnedRowsCa2.forEach(rowId => {
|
|
104
|
+
removePinnedRow({
|
|
105
|
+
groupingParams: newGroupingParams,
|
|
106
|
+
rowId,
|
|
107
|
+
apiRef
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
74
112
|
(_pinnedRowsCache$topI = pinnedRowsCache.topIds) == null ? void 0 : _pinnedRowsCache$topI.forEach(rowId => {
|
|
75
113
|
newGroupingParams = addPinnedRow({
|
|
76
114
|
groupingParams: newGroupingParams,
|
|
77
115
|
rowModel: pinnedRowsCache.idLookup[rowId],
|
|
78
116
|
rowId,
|
|
79
117
|
position: 'top',
|
|
80
|
-
apiRef
|
|
118
|
+
apiRef,
|
|
119
|
+
isAutoGenerated: false
|
|
81
120
|
});
|
|
82
121
|
});
|
|
83
122
|
(_pinnedRowsCache$bott = pinnedRowsCache.bottomIds) == null ? void 0 : _pinnedRowsCache$bott.forEach(rowId => {
|
|
@@ -86,7 +125,8 @@ const useGridRowPinningPreProcessors = apiRef => {
|
|
|
86
125
|
rowModel: pinnedRowsCache.idLookup[rowId],
|
|
87
126
|
rowId,
|
|
88
127
|
position: 'bottom',
|
|
89
|
-
apiRef
|
|
128
|
+
apiRef,
|
|
129
|
+
isAutoGenerated: false
|
|
90
130
|
});
|
|
91
131
|
}); // If row with the same `id` is present both in `rows` and `pinnedRows` - remove it from `ids`
|
|
92
132
|
|
package/node/index.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.getReleaseInfo = void 0;
|
|
|
8
8
|
var _utils = require("@mui/utils");
|
|
9
9
|
|
|
10
10
|
const getReleaseInfo = () => {
|
|
11
|
-
const releaseInfo = "
|
|
11
|
+
const releaseInfo = "MTY3NTI5MjQwMDAwMA==";
|
|
12
12
|
|
|
13
13
|
if (process.env.NODE_ENV !== 'production') {
|
|
14
14
|
// A simple hack to set the value in the test environment (has no build step).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "5.17.
|
|
3
|
+
"version": "5.17.22",
|
|
4
4
|
"description": "The Pro plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.18.9",
|
|
35
35
|
"@mui/utils": "^5.10.3",
|
|
36
|
-
"@mui/x-data-grid": "5.17.
|
|
36
|
+
"@mui/x-data-grid": "5.17.22",
|
|
37
37
|
"@mui/x-license-pro": "5.17.12",
|
|
38
38
|
"@types/format-util": "^1.0.2",
|
|
39
39
|
"clsx": "^1.2.1",
|
package/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY3NTI5MjQwMDAwMA==";
|
|
4
4
|
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
// A simple hack to set the value in the test environment (has no build step).
|