@mui/x-data-grid-pro 8.12.0 → 8.13.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 +145 -0
- package/DataGridPro/DataGridPro.js +12 -2
- package/DataGridPro/useDataGridProComponent.js +2 -2
- package/DataGridPro/useDataGridProProps.js +3 -1
- package/esm/DataGridPro/DataGridPro.js +13 -3
- package/esm/DataGridPro/useDataGridProComponent.js +2 -2
- package/esm/DataGridPro/useDataGridProProps.js +3 -1
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/esm/index.js +1 -1
- package/esm/utils/tree/insertDataRowInTree.js +3 -3
- package/esm/utils/tree/utils.d.ts +2 -2
- package/esm/utils/tree/utils.js +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/index.js +1 -1
- package/package.json +3 -3
- package/utils/tree/insertDataRowInTree.js +3 -3
- package/utils/tree/utils.d.ts +2 -2
- package/utils/tree/utils.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,151 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.13.0
|
|
9
|
+
|
|
10
|
+
_Oct 1, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 📊 The chart zoom now supports the `tapAndDrag` gesture. Zoom in/out by tapping twice and dragging vertically.
|
|
15
|
+
- 🔎 Charts now allow [fine-grained control for zoom interactions](https://mui.com/x/react-charts/zoom-and-pan/#zoom-interactions-configuration).
|
|
16
|
+
```jsx
|
|
17
|
+
<BarChartPro
|
|
18
|
+
zoomInteractionConfig={{
|
|
19
|
+
// Only zoom when Control key is pressed
|
|
20
|
+
zoom: [{ type: 'wheel', keys: ['Control'] }],
|
|
21
|
+
// Only pan when Shift key is pressed
|
|
22
|
+
pan: [{ type: 'drag', keys: ['Shift'] }],
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
26
|
+
- ➡️ Data Grid grouping rows now persist their expansion state when the rows are updated.
|
|
27
|
+
- 📜 Updated Data Grid vertical scrollbar to include pinned rows and aggregation sections.
|
|
28
|
+
- 📌 Improved the appearance of [pinned columns](https://mui.com/x/react-data-grid/column-pinning/#pinned-columns-appearance) and [pinned rows](https://mui.com/x/react-data-grid/row-pinning/#pinned-rows-appearance) sections in the Data Grid.
|
|
29
|
+
- 🚀 Tree View now fetches the children of expanded items on mount when using lazy loading.
|
|
30
|
+
- 🐞 Bugfixes
|
|
31
|
+
- 📚 Documentation improvements
|
|
32
|
+
|
|
33
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
34
|
+
@sai6855
|
|
35
|
+
|
|
36
|
+
The following are all team members who have contributed to this release:
|
|
37
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @flaviendelangle, @hasdfa, @Janpot, @JCQuintas, @KenanYusuf, @mapache-salvaje, @MBilalShafi, @mnajdova, @rita-codes, @siriwatknp
|
|
38
|
+
|
|
39
|
+
### Data Grid
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-data-grid@8.13.0`
|
|
42
|
+
|
|
43
|
+
- [DataGrid] Add scroll shadows and fix scrollbar overlap (#16476) @KenanYusuf
|
|
44
|
+
- [DataGrid] Fix row spanning stale state issue (#19733) @MBilalShafi
|
|
45
|
+
- [DataGrid] Fix toolbar `slotProps` not being applied (#19769) @sai6855
|
|
46
|
+
- [DataGrid] Skip calling `fetchRows()` when strategy is not initialized (#19728) @MBilalShafi
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-data-grid-pro@8.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
|
+
|
|
50
|
+
Same changes as in `@mui/x-data-grid@8.13.0`, plus:
|
|
51
|
+
|
|
52
|
+
- [DataGridPro] Retain expansion state on rows update (#19697) @MBilalShafi
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-data-grid-premium@8.13.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
55
|
+
|
|
56
|
+
Same changes as in `@mui/x-data-grid-pro@8.13.0`, plus:
|
|
57
|
+
|
|
58
|
+
- [DataGridPremium] Add `metadata.referenceId` to AI assistant prompt resolver (#19695) @hasdfa
|
|
59
|
+
- [DataGridPremium] Fix aggregation value retrieval (#19724) @arminmeh
|
|
60
|
+
- [DataGridPremium] Get correct active chart id while rebuilding data (#19720) @arminmeh
|
|
61
|
+
|
|
62
|
+
### Date and Time Pickers
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-date-pickers@8.12.0`
|
|
65
|
+
|
|
66
|
+
Internal changes.
|
|
67
|
+
|
|
68
|
+
#### `@mui/x-date-pickers-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
69
|
+
|
|
70
|
+
Same changes as in `@mui/x-date-pickers@8.12.0`.
|
|
71
|
+
|
|
72
|
+
### Charts
|
|
73
|
+
|
|
74
|
+
#### `@mui/x-charts@8.13.0`
|
|
75
|
+
|
|
76
|
+
- [charts] Add `tapAndDrag` zoom gesture (#19727) @JCQuintas
|
|
77
|
+
- [charts] Add arc focus indicator that follows the arc form (#19696) @mnajdova
|
|
78
|
+
- [charts] Fix outline color (#19752) @alexfauquette
|
|
79
|
+
- [charts] Improve tooltip doc (#19731) @JCQuintas
|
|
80
|
+
- [charts] Make axis highlight reflect the keyboard interaction (#19631) @alexfauquette
|
|
81
|
+
- [charts] Prevent horizontal scroll on keyboard navigation (#19704) @alexfauquette
|
|
82
|
+
- [charts] Simplify gestures by removing bindings (#19767) @JCQuintas
|
|
83
|
+
|
|
84
|
+
#### `@mui/x-charts-pro@8.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
85
|
+
|
|
86
|
+
Same changes as in `@mui/x-charts@8.13.0`, plus:
|
|
87
|
+
|
|
88
|
+
- [charts-pro] Allow zoom interactions to be configured (#18646) @JCQuintas
|
|
89
|
+
- [charts-pro] Fix zoom preview having wrong domain in some cases (#19723) @bernardobelchior
|
|
90
|
+
|
|
91
|
+
#### `@mui/x-charts-premium@8.13.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
92
|
+
|
|
93
|
+
Same changes as in `@mui/x-charts-pro@8.13.0`.
|
|
94
|
+
|
|
95
|
+
### Tree View
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-tree-view@8.13.0`
|
|
98
|
+
|
|
99
|
+
- [tree view] Export the `apiRef` type of each Tree View component (#19543) @flaviendelangle
|
|
100
|
+
- [tree view] Fix indeterminate checkbox state (#19544) @flaviendelangle
|
|
101
|
+
- [tree view] Improve the lazy loading initial expansion (#19284) @flaviendelangle
|
|
102
|
+
- [tree view] Use Base UI utils whenever possible (#19502) @flaviendelangle
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-tree-view-pro@8.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
105
|
+
|
|
106
|
+
Same changes as in `@mui/x-tree-view@8.13.0`.
|
|
107
|
+
|
|
108
|
+
### Codemod
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-codemod@8.12.0`
|
|
111
|
+
|
|
112
|
+
Internal changes.
|
|
113
|
+
|
|
114
|
+
### Docs
|
|
115
|
+
|
|
116
|
+
- [docs] Add a recipe to customize editing component with Autocomplete (#19651) @siriwatknp
|
|
117
|
+
- [docs] Refine the electricity scatter tooltip (#19689) @alexfauquette
|
|
118
|
+
- [docs] Revise the Axis doc (#19052) @mapache-salvaje
|
|
119
|
+
- [docs] Remove reference to nonexistent `FocusedMark` API page (#19773) @bernardobelchior
|
|
120
|
+
|
|
121
|
+
### Core
|
|
122
|
+
|
|
123
|
+
- [code-infra] Change charts codspeed integration to use walltime (#19729) @JCQuintas
|
|
124
|
+
- [code-infra] Port stylelint from core repo (#19633) @Janpot
|
|
125
|
+
- [code-infra] Stabilize fake timers in regression tests (#19719) @Janpot
|
|
126
|
+
- [code-infra] Stabilize size for bundles with `releaseInfo` (#19674) @Janpot
|
|
127
|
+
- [code-infra] Fix `pnpm-lock.yaml` broken lockfile (#19755) @bernardobelchior
|
|
128
|
+
|
|
129
|
+
## 8.12.1
|
|
130
|
+
|
|
131
|
+
_Sep 25, 2025_
|
|
132
|
+
|
|
133
|
+
Release highlight ✨:
|
|
134
|
+
|
|
135
|
+
- 🐞 Hotfix for Grid-Charts integration issue with aggregated values
|
|
136
|
+
|
|
137
|
+
### Data Grid
|
|
138
|
+
|
|
139
|
+
#### `@mui/x-data-grid@8.12.1`
|
|
140
|
+
|
|
141
|
+
Internal changes.
|
|
142
|
+
|
|
143
|
+
#### `@mui/x-data-grid-pro@8.12.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
144
|
+
|
|
145
|
+
Same changes as in `@mui/x-data-grid@8.12.1`.
|
|
146
|
+
|
|
147
|
+
#### `@mui/x-data-grid-premium@8.12.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
148
|
+
|
|
149
|
+
Same changes as in `@mui/x-data-grid-pro@8.12.1`, plus:
|
|
150
|
+
|
|
151
|
+
- [DataGridPremium] Collect aggregated values properly for the charts integration context (#19714) @arminmeh
|
|
152
|
+
|
|
8
153
|
## 8.12.0
|
|
9
154
|
|
|
10
155
|
_Sep 25, 2025_
|
|
@@ -27,12 +27,12 @@ const configuration = {
|
|
|
27
27
|
useGridAriaAttributes: _useGridAriaAttributes.useGridAriaAttributesPro,
|
|
28
28
|
useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributesPro,
|
|
29
29
|
useGridRowsOverridableMethods: _internals.useGridRowsOverridableMethods,
|
|
30
|
+
useGridParamsOverridableMethods: _internals.useGridParamsOverridableMethods,
|
|
30
31
|
useCellAggregationResult: () => null,
|
|
31
|
-
useSortValueGetter: apiRef => apiRef.current.getCellValue,
|
|
32
32
|
useFilterValueGetter: apiRef => apiRef.current.getRowValue
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
const releaseInfo = "
|
|
35
|
+
const releaseInfo = "MTc1OTI3NjgwMDAwMA==";
|
|
36
36
|
const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
37
37
|
packageName: "x-data-grid-pro",
|
|
38
38
|
releaseInfo: releaseInfo
|
|
@@ -874,6 +874,11 @@ DataGridProRaw.propTypes = {
|
|
|
874
874
|
* The column fields to display pinned to left or right.
|
|
875
875
|
*/
|
|
876
876
|
pinnedColumns: _propTypes.default.object,
|
|
877
|
+
/**
|
|
878
|
+
* Sets the type of separator between pinned columns and non-pinned columns.
|
|
879
|
+
* @default 'border-and-shadow'
|
|
880
|
+
*/
|
|
881
|
+
pinnedColumnsSectionSeparator: _propTypes.default.oneOf(['border-and-shadow', 'border', 'shadow']),
|
|
877
882
|
/**
|
|
878
883
|
* Rows data to pin on top or bottom.
|
|
879
884
|
*/
|
|
@@ -881,6 +886,11 @@ DataGridProRaw.propTypes = {
|
|
|
881
886
|
bottom: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
882
887
|
top: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
883
888
|
}),
|
|
889
|
+
/**
|
|
890
|
+
* Sets the type of separator between pinned rows and non-pinned rows.
|
|
891
|
+
* @default 'border-and-shadow'
|
|
892
|
+
*/
|
|
893
|
+
pinnedRowsSectionSeparator: _propTypes.default.oneOf(['border-and-shadow', 'border']),
|
|
884
894
|
/**
|
|
885
895
|
* Callback called before updating a row with new values in the row and cell editing.
|
|
886
896
|
* @template R
|
|
@@ -89,7 +89,7 @@ const useDataGridProComponent = (apiRef, props, configuration) => {
|
|
|
89
89
|
(0, _internals.useGridColumns)(apiRef, props);
|
|
90
90
|
(0, _internals.useGridRows)(apiRef, props, configuration);
|
|
91
91
|
(0, _internals.useGridRowSpanning)(apiRef, props);
|
|
92
|
-
(0, _internals.useGridParamsApi)(apiRef, props);
|
|
92
|
+
(0, _internals.useGridParamsApi)(apiRef, props, configuration);
|
|
93
93
|
(0, _useGridDetailPanel.useGridDetailPanel)(apiRef, props);
|
|
94
94
|
(0, _internals.useGridColumnSpanning)(apiRef);
|
|
95
95
|
(0, _internals.useGridColumnGrouping)(apiRef, props);
|
|
@@ -97,7 +97,7 @@ const useDataGridProComponent = (apiRef, props, configuration) => {
|
|
|
97
97
|
(0, _internals.useGridFocus)(apiRef, props);
|
|
98
98
|
(0, _internals.useGridPreferencesPanel)(apiRef, props);
|
|
99
99
|
(0, _internals.useGridFilter)(apiRef, props, configuration);
|
|
100
|
-
(0, _internals.useGridSorting)(apiRef, props
|
|
100
|
+
(0, _internals.useGridSorting)(apiRef, props);
|
|
101
101
|
(0, _internals.useGridDensity)(apiRef, props);
|
|
102
102
|
(0, _useGridColumnReorder.useGridColumnReorder)(apiRef, props);
|
|
103
103
|
(0, _internals.useGridColumnResize)(apiRef, props);
|
|
@@ -42,7 +42,9 @@ const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PRO_PROPS_DEFAULT_V
|
|
|
42
42
|
lazyLoading: false,
|
|
43
43
|
lazyLoadingRequestThrottleMs: 500,
|
|
44
44
|
listView: false,
|
|
45
|
-
multipleColumnsSortingMode: 'withModifierKey'
|
|
45
|
+
multipleColumnsSortingMode: 'withModifierKey',
|
|
46
|
+
pinnedColumnsSectionSeparator: 'border-and-shadow',
|
|
47
|
+
pinnedRowsSectionSeparator: 'border-and-shadow'
|
|
46
48
|
});
|
|
47
49
|
const defaultSlots = _dataGridProDefaultSlotsComponents.DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS;
|
|
48
50
|
const useDataGridProProps = inProps => {
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useLicenseVerifier, Watermark } from '@mui/x-license';
|
|
7
7
|
import { GridRoot, GridContextProvider } from '@mui/x-data-grid';
|
|
8
|
-
import { validateProps, useGridApiInitialization, useGridRowsOverridableMethods } from '@mui/x-data-grid/internals';
|
|
8
|
+
import { validateProps, useGridApiInitialization, useGridRowsOverridableMethods, useGridParamsOverridableMethods } from '@mui/x-data-grid/internals';
|
|
9
9
|
import { useMaterialCSSVariables } from '@mui/x-data-grid/material';
|
|
10
10
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
11
11
|
import { useDataGridProComponent } from "./useDataGridProComponent.js";
|
|
@@ -20,12 +20,12 @@ const configuration = {
|
|
|
20
20
|
useGridAriaAttributes: useGridAriaAttributesPro,
|
|
21
21
|
useGridRowAriaAttributes: useGridRowAriaAttributesPro,
|
|
22
22
|
useGridRowsOverridableMethods,
|
|
23
|
+
useGridParamsOverridableMethods,
|
|
23
24
|
useCellAggregationResult: () => null,
|
|
24
|
-
useSortValueGetter: apiRef => apiRef.current.getCellValue,
|
|
25
25
|
useFilterValueGetter: apiRef => apiRef.current.getRowValue
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
const releaseInfo = "
|
|
28
|
+
const releaseInfo = "MTc1OTI3NjgwMDAwMA==";
|
|
29
29
|
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
30
30
|
packageName: "x-data-grid-pro",
|
|
31
31
|
releaseInfo: releaseInfo
|
|
@@ -867,6 +867,11 @@ DataGridProRaw.propTypes = {
|
|
|
867
867
|
* The column fields to display pinned to left or right.
|
|
868
868
|
*/
|
|
869
869
|
pinnedColumns: PropTypes.object,
|
|
870
|
+
/**
|
|
871
|
+
* Sets the type of separator between pinned columns and non-pinned columns.
|
|
872
|
+
* @default 'border-and-shadow'
|
|
873
|
+
*/
|
|
874
|
+
pinnedColumnsSectionSeparator: PropTypes.oneOf(['border-and-shadow', 'border', 'shadow']),
|
|
870
875
|
/**
|
|
871
876
|
* Rows data to pin on top or bottom.
|
|
872
877
|
*/
|
|
@@ -874,6 +879,11 @@ DataGridProRaw.propTypes = {
|
|
|
874
879
|
bottom: PropTypes.arrayOf(PropTypes.object),
|
|
875
880
|
top: PropTypes.arrayOf(PropTypes.object)
|
|
876
881
|
}),
|
|
882
|
+
/**
|
|
883
|
+
* Sets the type of separator between pinned rows and non-pinned rows.
|
|
884
|
+
* @default 'border-and-shadow'
|
|
885
|
+
*/
|
|
886
|
+
pinnedRowsSectionSeparator: PropTypes.oneOf(['border-and-shadow', 'border']),
|
|
877
887
|
/**
|
|
878
888
|
* Callback called before updating a row with new values in the row and cell editing.
|
|
879
889
|
* @template R
|
|
@@ -82,7 +82,7 @@ export const useDataGridProComponent = (apiRef, props, configuration) => {
|
|
|
82
82
|
useGridColumns(apiRef, props);
|
|
83
83
|
useGridRows(apiRef, props, configuration);
|
|
84
84
|
useGridRowSpanning(apiRef, props);
|
|
85
|
-
useGridParamsApi(apiRef, props);
|
|
85
|
+
useGridParamsApi(apiRef, props, configuration);
|
|
86
86
|
useGridDetailPanel(apiRef, props);
|
|
87
87
|
useGridColumnSpanning(apiRef);
|
|
88
88
|
useGridColumnGrouping(apiRef, props);
|
|
@@ -90,7 +90,7 @@ export const useDataGridProComponent = (apiRef, props, configuration) => {
|
|
|
90
90
|
useGridFocus(apiRef, props);
|
|
91
91
|
useGridPreferencesPanel(apiRef, props);
|
|
92
92
|
useGridFilter(apiRef, props, configuration);
|
|
93
|
-
useGridSorting(apiRef, props
|
|
93
|
+
useGridSorting(apiRef, props);
|
|
94
94
|
useGridDensity(apiRef, props);
|
|
95
95
|
useGridColumnReorder(apiRef, props);
|
|
96
96
|
useGridColumnResize(apiRef, props);
|
|
@@ -34,7 +34,9 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
|
|
|
34
34
|
lazyLoading: false,
|
|
35
35
|
lazyLoadingRequestThrottleMs: 500,
|
|
36
36
|
listView: false,
|
|
37
|
-
multipleColumnsSortingMode: 'withModifierKey'
|
|
37
|
+
multipleColumnsSortingMode: 'withModifierKey',
|
|
38
|
+
pinnedColumnsSectionSeparator: 'border-and-shadow',
|
|
39
|
+
pinnedRowsSectionSeparator: 'border-and-shadow'
|
|
38
40
|
});
|
|
39
41
|
const defaultSlots = DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS;
|
|
40
42
|
export const useDataGridProProps = inProps => {
|
|
@@ -94,8 +94,8 @@ export const useGridColumnHeadersPro = props => {
|
|
|
94
94
|
const pinnedOffset = getPinnedCellOffset(pinnedPosition, colDef.computedWidth, columnIndex, columnPositions, columnsTotalWidth, scrollbarWidth);
|
|
95
95
|
const indexInSection = i;
|
|
96
96
|
const sectionLength = renderedColumns.length;
|
|
97
|
-
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
98
|
-
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);
|
|
97
|
+
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection, rootProps.showColumnVerticalBorder, rootProps.pinnedColumnsSectionSeparator);
|
|
98
|
+
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller, rootProps.pinnedColumnsSectionSeparator);
|
|
99
99
|
filters.push(/*#__PURE__*/_jsx(rootProps.slots.headerFilterCell, _extends({
|
|
100
100
|
colIndex: columnIndex,
|
|
101
101
|
height: headerFilterHeight,
|
package/esm/index.js
CHANGED
|
@@ -51,7 +51,7 @@ export const insertDataRowInTree = ({
|
|
|
51
51
|
childrenExpanded: false,
|
|
52
52
|
serverChildrenCount
|
|
53
53
|
};
|
|
54
|
-
const shouldFetchChildren = checkGroupChildrenExpansion(node, defaultGroupingExpansionDepth, isGroupExpandedByDefault);
|
|
54
|
+
const shouldFetchChildren = checkGroupChildrenExpansion(node, defaultGroupingExpansionDepth, isGroupExpandedByDefault, previousTree?.[id]?.childrenExpanded);
|
|
55
55
|
if (shouldFetchChildren) {
|
|
56
56
|
groupsToFetch?.add(id);
|
|
57
57
|
}
|
|
@@ -111,7 +111,7 @@ export const insertDataRowInTree = ({
|
|
|
111
111
|
childrenExpanded: false
|
|
112
112
|
};
|
|
113
113
|
updatedGroupsManager?.addAction(parentNodeId, 'insertChildren');
|
|
114
|
-
insertNodeInTree(updateGroupDefaultExpansion(autoGeneratedGroupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault), tree, treeDepths, previousTree);
|
|
114
|
+
insertNodeInTree(updateGroupDefaultExpansion(autoGeneratedGroupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault, previousTree?.[nodeId]?.childrenExpanded), tree, treeDepths, previousTree);
|
|
115
115
|
parentNodeId = nodeId;
|
|
116
116
|
}
|
|
117
117
|
// For the intermediary steps of the path
|
|
@@ -133,7 +133,7 @@ export const insertDataRowInTree = ({
|
|
|
133
133
|
childrenFromPath: {},
|
|
134
134
|
childrenExpanded: false
|
|
135
135
|
};
|
|
136
|
-
tree[existingNodeIdWithPartialPath] = updateGroupDefaultExpansion(groupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault);
|
|
136
|
+
tree[existingNodeIdWithPartialPath] = updateGroupDefaultExpansion(groupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault, previousTree?.[currentGroupNode.id]?.childrenExpanded);
|
|
137
137
|
}
|
|
138
138
|
parentNodeId = currentGroupNode.id;
|
|
139
139
|
}
|
|
@@ -10,8 +10,8 @@ export declare const getNodePathInTree: ({
|
|
|
10
10
|
id: GridRowId;
|
|
11
11
|
tree: GridRowTreeConfig;
|
|
12
12
|
}) => RowTreeBuilderGroupingCriterion[];
|
|
13
|
-
export declare const checkGroupChildrenExpansion: (node: GridGroupNode, defaultGroupingExpansionDepth: number, isGroupExpandedByDefault?: DataGridProProps["isGroupExpandedByDefault"]) => boolean;
|
|
14
|
-
export declare const updateGroupDefaultExpansion: (node: GridGroupNode, defaultGroupingExpansionDepth: number, isGroupExpandedByDefault?: DataGridProProps["isGroupExpandedByDefault"]) => GridGroupNode;
|
|
13
|
+
export declare const checkGroupChildrenExpansion: (node: GridGroupNode, defaultGroupingExpansionDepth: number, isGroupExpandedByDefault?: DataGridProProps["isGroupExpandedByDefault"], prevChildrenExpanded?: boolean) => boolean;
|
|
14
|
+
export declare const updateGroupDefaultExpansion: (node: GridGroupNode, defaultGroupingExpansionDepth: number, isGroupExpandedByDefault?: DataGridProProps["isGroupExpandedByDefault"], prevChildrenExpanded?: boolean) => GridGroupNode;
|
|
15
15
|
/**
|
|
16
16
|
* Insert a node in the tree
|
|
17
17
|
*/
|
package/esm/utils/tree/utils.js
CHANGED
|
@@ -20,19 +20,19 @@ export const getNodePathInTree = ({
|
|
|
20
20
|
path.reverse();
|
|
21
21
|
return path;
|
|
22
22
|
};
|
|
23
|
-
export const checkGroupChildrenExpansion = (node, defaultGroupingExpansionDepth, isGroupExpandedByDefault) => {
|
|
23
|
+
export const checkGroupChildrenExpansion = (node, defaultGroupingExpansionDepth, isGroupExpandedByDefault, prevChildrenExpanded) => {
|
|
24
24
|
let childrenExpanded;
|
|
25
25
|
if (node.id === GRID_ROOT_GROUP_ID) {
|
|
26
26
|
childrenExpanded = true;
|
|
27
27
|
} else if (isGroupExpandedByDefault) {
|
|
28
28
|
childrenExpanded = isGroupExpandedByDefault(node);
|
|
29
29
|
} else {
|
|
30
|
-
childrenExpanded = defaultGroupingExpansionDepth === -1 || defaultGroupingExpansionDepth > node.depth;
|
|
30
|
+
childrenExpanded = defaultGroupingExpansionDepth === -1 || defaultGroupingExpansionDepth > node.depth || (prevChildrenExpanded ?? false);
|
|
31
31
|
}
|
|
32
32
|
return childrenExpanded;
|
|
33
33
|
};
|
|
34
|
-
export const updateGroupDefaultExpansion = (node, defaultGroupingExpansionDepth, isGroupExpandedByDefault) => {
|
|
35
|
-
const childrenExpanded = checkGroupChildrenExpansion(node, defaultGroupingExpansionDepth, isGroupExpandedByDefault);
|
|
34
|
+
export const updateGroupDefaultExpansion = (node, defaultGroupingExpansionDepth, isGroupExpandedByDefault, prevChildrenExpanded) => {
|
|
35
|
+
const childrenExpanded = checkGroupChildrenExpansion(node, defaultGroupingExpansionDepth, isGroupExpandedByDefault, prevChildrenExpanded);
|
|
36
36
|
node.childrenExpanded = childrenExpanded;
|
|
37
37
|
return node;
|
|
38
38
|
};
|
|
@@ -102,8 +102,8 @@ const useGridColumnHeadersPro = props => {
|
|
|
102
102
|
const pinnedOffset = getPinnedCellOffset(pinnedPosition, colDef.computedWidth, columnIndex, columnPositions, columnsTotalWidth, scrollbarWidth);
|
|
103
103
|
const indexInSection = i;
|
|
104
104
|
const sectionLength = renderedColumns.length;
|
|
105
|
-
const showLeftBorder = (0, _internals.shouldCellShowLeftBorder)(pinnedPosition, indexInSection);
|
|
106
|
-
const showRightBorder = (0, _internals.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);
|
|
105
|
+
const showLeftBorder = (0, _internals.shouldCellShowLeftBorder)(pinnedPosition, indexInSection, rootProps.showColumnVerticalBorder, rootProps.pinnedColumnsSectionSeparator);
|
|
106
|
+
const showRightBorder = (0, _internals.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller, rootProps.pinnedColumnsSectionSeparator);
|
|
107
107
|
filters.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.headerFilterCell, (0, _extends2.default)({
|
|
108
108
|
colIndex: columnIndex,
|
|
109
109
|
height: headerFilterHeight,
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Pro plan edition of the MUI X Data Grid components.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"directory": "packages/x-data-grid-pro"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@babel/runtime": "^7.28.
|
|
36
|
+
"@babel/runtime": "^7.28.4",
|
|
37
37
|
"@mui/utils": "^7.3.2",
|
|
38
38
|
"@types/format-util": "^1.0.4",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
|
-
"@mui/x-data-grid": "8.
|
|
41
|
+
"@mui/x-data-grid": "8.13.0",
|
|
42
42
|
"@mui/x-internals": "8.12.0",
|
|
43
43
|
"@mui/x-license": "8.12.0"
|
|
44
44
|
},
|
|
@@ -57,7 +57,7 @@ const insertDataRowInTree = ({
|
|
|
57
57
|
childrenExpanded: false,
|
|
58
58
|
serverChildrenCount
|
|
59
59
|
};
|
|
60
|
-
const shouldFetchChildren = (0, _utils.checkGroupChildrenExpansion)(node, defaultGroupingExpansionDepth, isGroupExpandedByDefault);
|
|
60
|
+
const shouldFetchChildren = (0, _utils.checkGroupChildrenExpansion)(node, defaultGroupingExpansionDepth, isGroupExpandedByDefault, previousTree?.[id]?.childrenExpanded);
|
|
61
61
|
if (shouldFetchChildren) {
|
|
62
62
|
groupsToFetch?.add(id);
|
|
63
63
|
}
|
|
@@ -117,7 +117,7 @@ const insertDataRowInTree = ({
|
|
|
117
117
|
childrenExpanded: false
|
|
118
118
|
};
|
|
119
119
|
updatedGroupsManager?.addAction(parentNodeId, 'insertChildren');
|
|
120
|
-
(0, _utils.insertNodeInTree)((0, _utils.updateGroupDefaultExpansion)(autoGeneratedGroupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault), tree, treeDepths, previousTree);
|
|
120
|
+
(0, _utils.insertNodeInTree)((0, _utils.updateGroupDefaultExpansion)(autoGeneratedGroupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault, previousTree?.[nodeId]?.childrenExpanded), tree, treeDepths, previousTree);
|
|
121
121
|
parentNodeId = nodeId;
|
|
122
122
|
}
|
|
123
123
|
// For the intermediary steps of the path
|
|
@@ -139,7 +139,7 @@ const insertDataRowInTree = ({
|
|
|
139
139
|
childrenFromPath: {},
|
|
140
140
|
childrenExpanded: false
|
|
141
141
|
};
|
|
142
|
-
tree[existingNodeIdWithPartialPath] = (0, _utils.updateGroupDefaultExpansion)(groupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault);
|
|
142
|
+
tree[existingNodeIdWithPartialPath] = (0, _utils.updateGroupDefaultExpansion)(groupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault, previousTree?.[currentGroupNode.id]?.childrenExpanded);
|
|
143
143
|
}
|
|
144
144
|
parentNodeId = currentGroupNode.id;
|
|
145
145
|
}
|
package/utils/tree/utils.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export declare const getNodePathInTree: ({
|
|
|
10
10
|
id: GridRowId;
|
|
11
11
|
tree: GridRowTreeConfig;
|
|
12
12
|
}) => RowTreeBuilderGroupingCriterion[];
|
|
13
|
-
export declare const checkGroupChildrenExpansion: (node: GridGroupNode, defaultGroupingExpansionDepth: number, isGroupExpandedByDefault?: DataGridProProps["isGroupExpandedByDefault"]) => boolean;
|
|
14
|
-
export declare const updateGroupDefaultExpansion: (node: GridGroupNode, defaultGroupingExpansionDepth: number, isGroupExpandedByDefault?: DataGridProProps["isGroupExpandedByDefault"]) => GridGroupNode;
|
|
13
|
+
export declare const checkGroupChildrenExpansion: (node: GridGroupNode, defaultGroupingExpansionDepth: number, isGroupExpandedByDefault?: DataGridProProps["isGroupExpandedByDefault"], prevChildrenExpanded?: boolean) => boolean;
|
|
14
|
+
export declare const updateGroupDefaultExpansion: (node: GridGroupNode, defaultGroupingExpansionDepth: number, isGroupExpandedByDefault?: DataGridProProps["isGroupExpandedByDefault"], prevChildrenExpanded?: boolean) => GridGroupNode;
|
|
15
15
|
/**
|
|
16
16
|
* Insert a node in the tree
|
|
17
17
|
*/
|
package/utils/tree/utils.js
CHANGED
|
@@ -29,20 +29,20 @@ const getNodePathInTree = ({
|
|
|
29
29
|
return path;
|
|
30
30
|
};
|
|
31
31
|
exports.getNodePathInTree = getNodePathInTree;
|
|
32
|
-
const checkGroupChildrenExpansion = (node, defaultGroupingExpansionDepth, isGroupExpandedByDefault) => {
|
|
32
|
+
const checkGroupChildrenExpansion = (node, defaultGroupingExpansionDepth, isGroupExpandedByDefault, prevChildrenExpanded) => {
|
|
33
33
|
let childrenExpanded;
|
|
34
34
|
if (node.id === _xDataGrid.GRID_ROOT_GROUP_ID) {
|
|
35
35
|
childrenExpanded = true;
|
|
36
36
|
} else if (isGroupExpandedByDefault) {
|
|
37
37
|
childrenExpanded = isGroupExpandedByDefault(node);
|
|
38
38
|
} else {
|
|
39
|
-
childrenExpanded = defaultGroupingExpansionDepth === -1 || defaultGroupingExpansionDepth > node.depth;
|
|
39
|
+
childrenExpanded = defaultGroupingExpansionDepth === -1 || defaultGroupingExpansionDepth > node.depth || (prevChildrenExpanded ?? false);
|
|
40
40
|
}
|
|
41
41
|
return childrenExpanded;
|
|
42
42
|
};
|
|
43
43
|
exports.checkGroupChildrenExpansion = checkGroupChildrenExpansion;
|
|
44
|
-
const updateGroupDefaultExpansion = (node, defaultGroupingExpansionDepth, isGroupExpandedByDefault) => {
|
|
45
|
-
const childrenExpanded = checkGroupChildrenExpansion(node, defaultGroupingExpansionDepth, isGroupExpandedByDefault);
|
|
44
|
+
const updateGroupDefaultExpansion = (node, defaultGroupingExpansionDepth, isGroupExpandedByDefault, prevChildrenExpanded) => {
|
|
45
|
+
const childrenExpanded = checkGroupChildrenExpansion(node, defaultGroupingExpansionDepth, isGroupExpandedByDefault, prevChildrenExpanded);
|
|
46
46
|
node.childrenExpanded = childrenExpanded;
|
|
47
47
|
return node;
|
|
48
48
|
};
|