@mui/x-data-grid-pro 7.22.3 → 7.23.1

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 CHANGED
@@ -3,6 +3,166 @@
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.23.1
7
+
8
+ _Dec 5, 2024_
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 German locale on the Data Grid component
13
+ - 🐞 Bugfixes
14
+
15
+ Special thanks go out to the community contributors who have helped make this release possible:
16
+ @lhilgert9.
17
+
18
+ Following are all team members who have contributed to this release:
19
+ @arthurbalduini, @cherniavskii, @flaviendelangle, @JCQuintas, @LukasTy and @MBilalShafi.
20
+
21
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
22
+
23
+ ### Data Grid
24
+
25
+ #### `@mui/x-data-grid@7.23.1`
26
+
27
+ - [DataGrid] Make column autosizing work with flex columns (#15712) @cherniavskii
28
+ - [l10n] Improve German (de-DE) locale (#15641) @lhilgert9
29
+
30
+ #### `@mui/x-data-grid-pro@7.23.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
+
32
+ Same changes as in `@mui/x-data-grid@7.23.1`, plus:
33
+
34
+ - [DataGridPro] Cleanup pinned rows on removal (#15702) @cherniavskii
35
+
36
+ #### `@mui/x-data-grid-premium@7.23.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
37
+
38
+ Same changes as in `@mui/x-data-grid-pro@7.23.1`.
39
+
40
+ ### Date and Time Pickers
41
+
42
+ #### `@mui/x-date-pickers@7.23.1`
43
+
44
+ - [TimePicker] Prevent mouse events after `touchend` event (#15430) @arthurbalduini
45
+
46
+ #### `@mui/x-date-pickers-pro@7.23.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
47
+
48
+ Same changes as in `@mui/x-date-pickers@7.23.1`.
49
+
50
+ ### Charts
51
+
52
+ #### `@mui/x-charts@7.23.1`
53
+
54
+ - [charts] Improve SVG `pattern` and `gradient` support (#15724) @JCQuintas
55
+
56
+ #### `@mui/x-charts-pro@7.23.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
57
+
58
+ Same changes as in `@mui/x-charts@7.23.1`.
59
+
60
+ ### Docs
61
+
62
+ - [docs] Fix Pickers theme augmentation example (#15675) @LukasTy
63
+ - [docs] Remove duplicated warning (#15715) @cherniavskii
64
+ - [test] Force hover in headless Chrome (#15711) @cherniavskii
65
+ - [docs-infra] Bump `@mui/internal-markdown` to support nested demo imports (#15738) @alexfauquette
66
+ - [docs] Improve SEO titles for the Data Grid (#15695) @MBilalShafi
67
+
68
+ ### Core
69
+
70
+ - [core] Add `@mui/x-tree-view-pro` to `releaseChangelog` (#15747) @flaviendelangle
71
+
72
+ ## 7.23.0
73
+
74
+ _Nov 29, 2024_
75
+
76
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
77
+
78
+ - ✨ Support for a new display mode on the Data Grid with the [List View feature](https://mui.com/x/react-data-grid/list-view/), offering an extremely flexible way to render datasets and enabling developers to adapt how data is displayed across different screen sizes.
79
+
80
+ https://github.com/user-attachments/assets/61286adc-03fc-4323-9739-8ca726fcc16c
81
+
82
+ - ⚛️ React 19 support
83
+ - 📚 Documentation improvements
84
+ - 🌍 Improve Spanish, Portuguese, Chinese locales on the Data Grid component.
85
+ - 🌍 Improve Dutch locale on the Date and Time Picker components.
86
+ - 🐞 Bugfixes
87
+
88
+ Special thanks go out to the community contributors who have helped make this release possible:
89
+ @dloeda, @headironc, @mathzdev, @nphmuller, @lhilgert9, @lauri865.
90
+ Following are all team members who have contributed to this release:
91
+ @oliviertassinari, @arminmeh, @KenanYusuf, @flaviendelangle, @MBilalShafi.
92
+
93
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
94
+
95
+ ### Data Grid
96
+
97
+ #### `@mui/x-data-grid@v7.23.0`
98
+
99
+ - [DataGrid] React 19 support (#15557) @arminmeh
100
+ - [DataGrid] Change test dom check from `/jsdom/` to `/jsdom|HappyDOM/`. (#15642) @jedesroches
101
+ - [DataGrid] Fix last separator not being hidden when grid is scrollable (#15551) @KenanYusuf
102
+ - [DataGrid] Fix order of spread props on toolbar items (#15556) @KenanYusuf
103
+ - [DataGrid] Fix row-spanning in combination with column-pinning (#15460) @lhilgert9
104
+ - [DataGrid] Improve resize performance (#15592) @lauri865
105
+ - [DataGrid] Support column virtualization with dynamic row height (#15567) @cherniavskii
106
+ - [DataGrid] Improve `GridCell` performance (#15621) @lauri865
107
+ - [l10n] Improve Chinese (zh-CN) locale (#15570) @headironc
108
+ - [l10n] Improve Portuguese (pt-PT) locale (#15561) @mathzdev
109
+
110
+ #### `@mui/x-data-grid-pro@v7.23.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
111
+
112
+ Same changes as in `@mui/x-data-grid@v7.23.0`, plus:
113
+
114
+ - [DataGridPro] Fix header filtering with `boolean` column type (#15640) @k-rajat19
115
+ - [DataGridPro] Fix pagination state not updating if the data source response has no rows (#15643) @zinoroman
116
+ - [DataGridPro] Fix selection propagation issue on initialization (#15593) @MBilalShafi
117
+
118
+ #### `@mui/x-data-grid-premium@v7.23.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
119
+
120
+ Same changes as in `@mui/x-data-grid-pro@v7.23.0`.
121
+
122
+ ### Date and Time Pickers
123
+
124
+ #### `@mui/x-date-pickers@v7.23.0`
125
+
126
+ - [pickers] React 19 support (#15557) @arminmeh
127
+ - [pickers] Fix DST issue with `America/Asuncion` timezone and `AdapterMoment` (#15653) @flaviendelangle
128
+ - [pickers] Use `props.referenceDate` timezone when `props.value` and `props.defaultValue` are not defined (#15544) @flaviendelangle
129
+ - [l10n] Improve Dutch (nl-NL) locale (#15564) @nphmuller
130
+
131
+ #### `@mui/x-date-pickers-pro@v7.23.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
132
+
133
+ Same changes as in `@mui/x-date-pickers@v7.23.0`.
134
+
135
+ ### Charts
136
+
137
+ #### `@mui/x-charts@v7.23.0`
138
+
139
+ - [charts] React 19 support (#15557) @arminmeh
140
+ - [charts] Prevent invalid `releasePointerCapture` (#15609) @alexfauquette
141
+
142
+ #### `@mui/x-charts-pro@v7.23.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
143
+
144
+ Same changes as in `@mui/x-charts@v7.23.0`.
145
+
146
+ ### Tree View
147
+
148
+ #### `@mui/x-tree-view@v7.23.0`
149
+
150
+ - [TreeView] React 19 support (#15557) @arminmeh
151
+
152
+ #### `@mui/x-tree-view-pro@7.23.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
153
+
154
+ Same changes as in `@mui/x-tree-view@7.23.0`.
155
+
156
+ ### Docs
157
+
158
+ - [docs] Add data caching to lazy loaded detail panel demo (#15555) @cherniavskii
159
+ - [docs] Remove selectors section from list view docs (#15639) @KenanYusuf
160
+ - [docs] Add documentation for the list view feature (#15344) @KenanYusuf
161
+
162
+ ### Core
163
+
164
+ - [core] Update @mui/monorepo (#15574) @oliviertassinari
165
+
6
166
  ## 7.22.3
7
167
 
8
168
  _Nov 21, 2024_
@@ -989,5 +989,13 @@ DataGridProRaw.propTypes = {
989
989
  * If `true`, the Data Grid will auto span the cells over the rows having the same value.
990
990
  * @default false
991
991
  */
992
- unstable_rowSpanning: _propTypes.default.bool
992
+ unstable_rowSpanning: _propTypes.default.bool,
993
+ /**
994
+ * If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
995
+ * By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
996
+ * For datasets with a large number of columns, this can cause performance issues.
997
+ * The downside of enabling this prop is that the row height will be estimated based the cells that are currently rendered, which can cause row height change when scrolling horizontally.
998
+ * @default false
999
+ */
1000
+ virtualizeColumnsWithAutoRowHeight: _propTypes.default.bool
993
1001
  };
package/README.md CHANGED
@@ -15,9 +15,9 @@ This component has the following peer dependencies that you will need to install
15
15
 
16
16
  ```json
17
17
  "peerDependencies": {
18
- "@mui/material": "^5.15.14",
19
- "react": "^17.0.0 || ^18.0.0",
20
- "react-dom": "^17.0.0 || ^18.0.0"
18
+ "@mui/material": "^5.15.14 || ^6.0.0",
19
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
20
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
21
21
  },
22
22
  ```
23
23
 
@@ -98,7 +98,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
98
98
  const currentOperator = React.useMemo(() => filterOperators.find(operator => operator.value === item.operator) ?? filterOperators[0], [item.operator, filterOperators]);
99
99
  const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent ?? defaultInputComponents[colDef.type] : null;
100
100
  const applyFilterChanges = React.useCallback(updatedItem => {
101
- if (item.value && !updatedItem.value) {
101
+ if (item.value && updatedItem.value === undefined) {
102
102
  apiRef.current.deleteFilterItem(updatedItem);
103
103
  return;
104
104
  }
@@ -199,7 +199,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
199
199
  });
200
200
  const classes = useUtilityClasses(ownerState);
201
201
  const isNoInputOperator = currentOperator.requiresFilterValue === false;
202
- const isApplied = Boolean(item?.value) || isNoInputOperator;
202
+ const isApplied = item?.value !== undefined || isNoInputOperator;
203
203
  const label = currentOperator.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${(0, _utils.unstable_capitalize)(item.operator)}`);
204
204
  const isFilterActive = isApplied || hasFocus;
205
205
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2.default)({
@@ -269,7 +269,7 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
269
269
  gridHasFiller: _propTypes.default.bool.isRequired,
270
270
  hasFocus: _propTypes.default.bool,
271
271
  /**
272
- * Class name that will be added in the column header cell.
272
+ * Class name added to the column header cell.
273
273
  */
274
274
  headerClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
275
275
  headerFilterMenuRef: _propTypes.default.shape({
@@ -982,5 +982,13 @@ DataGridProRaw.propTypes = {
982
982
  * If `true`, the Data Grid will auto span the cells over the rows having the same value.
983
983
  * @default false
984
984
  */
985
- unstable_rowSpanning: PropTypes.bool
985
+ unstable_rowSpanning: PropTypes.bool,
986
+ /**
987
+ * If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
988
+ * By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
989
+ * For datasets with a large number of columns, this can cause performance issues.
990
+ * The downside of enabling this prop is that the row height will be estimated based the cells that are currently rendered, which can cause row height change when scrolling horizontally.
991
+ * @default false
992
+ */
993
+ virtualizeColumnsWithAutoRowHeight: PropTypes.bool
986
994
  };
@@ -90,7 +90,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
90
90
  const currentOperator = React.useMemo(() => filterOperators.find(operator => operator.value === item.operator) ?? filterOperators[0], [item.operator, filterOperators]);
91
91
  const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent ?? defaultInputComponents[colDef.type] : null;
92
92
  const applyFilterChanges = React.useCallback(updatedItem => {
93
- if (item.value && !updatedItem.value) {
93
+ if (item.value && updatedItem.value === undefined) {
94
94
  apiRef.current.deleteFilterItem(updatedItem);
95
95
  return;
96
96
  }
@@ -191,7 +191,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
191
191
  });
192
192
  const classes = useUtilityClasses(ownerState);
193
193
  const isNoInputOperator = currentOperator.requiresFilterValue === false;
194
- const isApplied = Boolean(item?.value) || isNoInputOperator;
194
+ const isApplied = item?.value !== undefined || isNoInputOperator;
195
195
  const label = currentOperator.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${capitalize(item.operator)}`);
196
196
  const isFilterActive = isApplied || hasFocus;
197
197
  return /*#__PURE__*/_jsxs("div", _extends({
@@ -261,7 +261,7 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
261
261
  gridHasFiller: PropTypes.bool.isRequired,
262
262
  hasFocus: PropTypes.bool,
263
263
  /**
264
- * Class name that will be added in the column header cell.
264
+ * Class name added to the column header cell.
265
265
  */
266
266
  headerClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
267
267
  headerFilterMenuRef: PropTypes.shape({
@@ -52,7 +52,7 @@ export const useGridDataSource = (apiRef, props) => {
52
52
  if (cachedData !== undefined) {
53
53
  const rows = cachedData.rows;
54
54
  apiRef.current.setRows(rows);
55
- if (cachedData.rowCount) {
55
+ if (cachedData.rowCount !== undefined) {
56
56
  apiRef.current.setRowCount(cachedData.rowCount);
57
57
  }
58
58
  return;
@@ -64,7 +64,7 @@ export const useGridDataSource = (apiRef, props) => {
64
64
  try {
65
65
  const getRowsResponse = await getRows(fetchParams);
66
66
  apiRef.current.unstable_dataSource.cache.set(fetchParams, getRowsResponse);
67
- if (getRowsResponse.rowCount) {
67
+ if (getRowsResponse.rowCount !== undefined) {
68
68
  apiRef.current.setRowCount(getRowsResponse.rowCount);
69
69
  }
70
70
  apiRef.current.setRows(getRowsResponse.rows);
@@ -60,14 +60,31 @@ export function addPinnedRow({
60
60
  });
61
61
  }
62
62
  export const useGridRowPinningPreProcessors = apiRef => {
63
+ const prevPinnedRowsCacheRef = React.useRef(null);
63
64
  const addPinnedRows = React.useCallback(groupingParams => {
64
65
  const pinnedRowsCache = apiRef.current.caches.pinnedRows || {};
66
+ const prevPinnedRowsCache = prevPinnedRowsCacheRef.current;
67
+ prevPinnedRowsCacheRef.current = pinnedRowsCache;
65
68
  let newGroupingParams = _extends({}, groupingParams, {
66
69
  additionalRowGroups: _extends({}, groupingParams.additionalRowGroups, {
67
70
  // reset pinned rows state
68
71
  pinnedRows: {}
69
72
  })
70
73
  });
74
+ if (prevPinnedRowsCache) {
75
+ const pinnedRowCleanup = rowId => {
76
+ const node = newGroupingParams.tree[rowId];
77
+ if (node?.type === 'pinnedRow') {
78
+ delete newGroupingParams.tree[rowId];
79
+ delete newGroupingParams.dataRowIdToModelLookup[rowId];
80
+ delete newGroupingParams.dataRowIdToIdLookup[rowId];
81
+ delete apiRef.current.caches.rows.dataRowIdToIdLookup[rowId];
82
+ delete apiRef.current.caches.rows.dataRowIdToModelLookup[rowId];
83
+ }
84
+ };
85
+ prevPinnedRowsCache.topIds?.forEach(pinnedRowCleanup);
86
+ prevPinnedRowsCache.bottomIds?.forEach(pinnedRowCleanup);
87
+ }
71
88
  pinnedRowsCache.topIds?.forEach(rowId => {
72
89
  newGroupingParams = addPinnedRow({
73
90
  groupingParams: newGroupingParams,
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTczMjE0MzYwMDAwMA==";
3
+ const releaseInfo = "MTczMzM1MzIwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -61,7 +61,7 @@ const useGridDataSource = (apiRef, props) => {
61
61
  if (cachedData !== undefined) {
62
62
  const rows = cachedData.rows;
63
63
  apiRef.current.setRows(rows);
64
- if (cachedData.rowCount) {
64
+ if (cachedData.rowCount !== undefined) {
65
65
  apiRef.current.setRowCount(cachedData.rowCount);
66
66
  }
67
67
  return;
@@ -73,7 +73,7 @@ const useGridDataSource = (apiRef, props) => {
73
73
  try {
74
74
  const getRowsResponse = await getRows(fetchParams);
75
75
  apiRef.current.unstable_dataSource.cache.set(fetchParams, getRowsResponse);
76
- if (getRowsResponse.rowCount) {
76
+ if (getRowsResponse.rowCount !== undefined) {
77
77
  apiRef.current.setRowCount(getRowsResponse.rowCount);
78
78
  }
79
79
  apiRef.current.setRows(getRowsResponse.rows);
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { GridHydrateRowsValue } from '@mui/x-data-grid/internals';
3
3
  import { GridRowId, GridRowModel } from '@mui/x-data-grid';
4
4
  import { GridPrivateApiPro } from '../../../models/gridApiPro';
5
- import { GridPinnedRowsProp } from './gridRowPinningInterface';
5
+ import type { GridPinnedRowsProp } from './gridRowPinningInterface';
6
6
  type GridPinnedRowPosition = keyof GridPinnedRowsProp;
7
7
  export declare function addPinnedRow({ groupingParams, rowModel, rowId, position, apiRef, isAutoGenerated, }: {
8
8
  groupingParams: GridHydrateRowsValue;
@@ -69,14 +69,31 @@ function addPinnedRow({
69
69
  });
70
70
  }
71
71
  const useGridRowPinningPreProcessors = apiRef => {
72
+ const prevPinnedRowsCacheRef = React.useRef(null);
72
73
  const addPinnedRows = React.useCallback(groupingParams => {
73
74
  const pinnedRowsCache = apiRef.current.caches.pinnedRows || {};
75
+ const prevPinnedRowsCache = prevPinnedRowsCacheRef.current;
76
+ prevPinnedRowsCacheRef.current = pinnedRowsCache;
74
77
  let newGroupingParams = (0, _extends2.default)({}, groupingParams, {
75
78
  additionalRowGroups: (0, _extends2.default)({}, groupingParams.additionalRowGroups, {
76
79
  // reset pinned rows state
77
80
  pinnedRows: {}
78
81
  })
79
82
  });
83
+ if (prevPinnedRowsCache) {
84
+ const pinnedRowCleanup = rowId => {
85
+ const node = newGroupingParams.tree[rowId];
86
+ if (node?.type === 'pinnedRow') {
87
+ delete newGroupingParams.tree[rowId];
88
+ delete newGroupingParams.dataRowIdToModelLookup[rowId];
89
+ delete newGroupingParams.dataRowIdToIdLookup[rowId];
90
+ delete apiRef.current.caches.rows.dataRowIdToIdLookup[rowId];
91
+ delete apiRef.current.caches.rows.dataRowIdToModelLookup[rowId];
92
+ }
93
+ };
94
+ prevPinnedRowsCache.topIds?.forEach(pinnedRowCleanup);
95
+ prevPinnedRowsCache.bottomIds?.forEach(pinnedRowCleanup);
96
+ }
80
97
  pinnedRowsCache.topIds?.forEach(rowId => {
81
98
  newGroupingParams = addPinnedRow({
82
99
  groupingParams: newGroupingParams,
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v7.22.3
2
+ * @mui/x-data-grid-pro v7.23.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -982,5 +982,13 @@ DataGridProRaw.propTypes = {
982
982
  * If `true`, the Data Grid will auto span the cells over the rows having the same value.
983
983
  * @default false
984
984
  */
985
- unstable_rowSpanning: PropTypes.bool
985
+ unstable_rowSpanning: PropTypes.bool,
986
+ /**
987
+ * If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
988
+ * By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
989
+ * For datasets with a large number of columns, this can cause performance issues.
990
+ * The downside of enabling this prop is that the row height will be estimated based the cells that are currently rendered, which can cause row height change when scrolling horizontally.
991
+ * @default false
992
+ */
993
+ virtualizeColumnsWithAutoRowHeight: PropTypes.bool
986
994
  };
@@ -90,7 +90,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
90
90
  const currentOperator = React.useMemo(() => filterOperators.find(operator => operator.value === item.operator) ?? filterOperators[0], [item.operator, filterOperators]);
91
91
  const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent ?? defaultInputComponents[colDef.type] : null;
92
92
  const applyFilterChanges = React.useCallback(updatedItem => {
93
- if (item.value && !updatedItem.value) {
93
+ if (item.value && updatedItem.value === undefined) {
94
94
  apiRef.current.deleteFilterItem(updatedItem);
95
95
  return;
96
96
  }
@@ -191,7 +191,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
191
191
  });
192
192
  const classes = useUtilityClasses(ownerState);
193
193
  const isNoInputOperator = currentOperator.requiresFilterValue === false;
194
- const isApplied = Boolean(item?.value) || isNoInputOperator;
194
+ const isApplied = item?.value !== undefined || isNoInputOperator;
195
195
  const label = currentOperator.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${capitalize(item.operator)}`);
196
196
  const isFilterActive = isApplied || hasFocus;
197
197
  return /*#__PURE__*/_jsxs("div", _extends({
@@ -261,7 +261,7 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
261
261
  gridHasFiller: PropTypes.bool.isRequired,
262
262
  hasFocus: PropTypes.bool,
263
263
  /**
264
- * Class name that will be added in the column header cell.
264
+ * Class name added to the column header cell.
265
265
  */
266
266
  headerClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
267
267
  headerFilterMenuRef: PropTypes.shape({
@@ -52,7 +52,7 @@ export const useGridDataSource = (apiRef, props) => {
52
52
  if (cachedData !== undefined) {
53
53
  const rows = cachedData.rows;
54
54
  apiRef.current.setRows(rows);
55
- if (cachedData.rowCount) {
55
+ if (cachedData.rowCount !== undefined) {
56
56
  apiRef.current.setRowCount(cachedData.rowCount);
57
57
  }
58
58
  return;
@@ -64,7 +64,7 @@ export const useGridDataSource = (apiRef, props) => {
64
64
  try {
65
65
  const getRowsResponse = await getRows(fetchParams);
66
66
  apiRef.current.unstable_dataSource.cache.set(fetchParams, getRowsResponse);
67
- if (getRowsResponse.rowCount) {
67
+ if (getRowsResponse.rowCount !== undefined) {
68
68
  apiRef.current.setRowCount(getRowsResponse.rowCount);
69
69
  }
70
70
  apiRef.current.setRows(getRowsResponse.rows);
@@ -60,14 +60,31 @@ export function addPinnedRow({
60
60
  });
61
61
  }
62
62
  export const useGridRowPinningPreProcessors = apiRef => {
63
+ const prevPinnedRowsCacheRef = React.useRef(null);
63
64
  const addPinnedRows = React.useCallback(groupingParams => {
64
65
  const pinnedRowsCache = apiRef.current.caches.pinnedRows || {};
66
+ const prevPinnedRowsCache = prevPinnedRowsCacheRef.current;
67
+ prevPinnedRowsCacheRef.current = pinnedRowsCache;
65
68
  let newGroupingParams = _extends({}, groupingParams, {
66
69
  additionalRowGroups: _extends({}, groupingParams.additionalRowGroups, {
67
70
  // reset pinned rows state
68
71
  pinnedRows: {}
69
72
  })
70
73
  });
74
+ if (prevPinnedRowsCache) {
75
+ const pinnedRowCleanup = rowId => {
76
+ const node = newGroupingParams.tree[rowId];
77
+ if (node?.type === 'pinnedRow') {
78
+ delete newGroupingParams.tree[rowId];
79
+ delete newGroupingParams.dataRowIdToModelLookup[rowId];
80
+ delete newGroupingParams.dataRowIdToIdLookup[rowId];
81
+ delete apiRef.current.caches.rows.dataRowIdToIdLookup[rowId];
82
+ delete apiRef.current.caches.rows.dataRowIdToModelLookup[rowId];
83
+ }
84
+ };
85
+ prevPinnedRowsCache.topIds?.forEach(pinnedRowCleanup);
86
+ prevPinnedRowsCache.bottomIds?.forEach(pinnedRowCleanup);
87
+ }
71
88
  pinnedRowsCache.topIds?.forEach(rowId => {
72
89
  newGroupingParams = addPinnedRow({
73
90
  groupingParams: newGroupingParams,
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v7.22.3
2
+ * @mui/x-data-grid-pro v7.23.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTczMjE0MzYwMDAwMA==";
3
+ const releaseInfo = "MTczMzM1MzIwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-pro",
3
- "version": "7.22.3",
3
+ "version": "7.23.1",
4
4
  "description": "The Pro plan edition of the Data Grid components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -39,17 +39,17 @@
39
39
  "clsx": "^2.1.1",
40
40
  "prop-types": "^15.8.1",
41
41
  "reselect": "^5.1.1",
42
- "@mui/x-data-grid": "7.22.3",
43
- "@mui/x-internals": "7.21.0",
44
- "@mui/x-license": "7.21.0"
42
+ "@mui/x-internals": "7.23.0",
43
+ "@mui/x-license": "7.23.0",
44
+ "@mui/x-data-grid": "7.23.1"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@emotion/react": "^11.9.0",
48
48
  "@emotion/styled": "^11.8.1",
49
49
  "@mui/material": "^5.15.14 || ^6.0.0",
50
50
  "@mui/system": "^5.15.14 || ^6.0.0",
51
- "react": "^17.0.0 || ^18.0.0",
52
- "react-dom": "^17.0.0 || ^18.0.0"
51
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
52
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@emotion/react": {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getReleaseInfo = void 0;
7
7
  var _utils = require("@mui/utils");
8
8
  const getReleaseInfo = () => {
9
- const releaseInfo = "MTczMjE0MzYwMDAwMA==";
9
+ const releaseInfo = "MTczMzM1MzIwMDAwMA==";
10
10
  if (process.env.NODE_ENV !== 'production') {
11
11
  // A simple hack to set the value in the test environment (has no build step).
12
12
  // eslint-disable-next-line no-useless-concat