@mui/x-data-grid 7.29.5 → 7.29.6

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,32 @@
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.29.6
7
+
8
+ _Jun 6, 2025_
9
+
10
+ We'd like to extend a big thank you to @arminmeh, who made this release possible.
11
+
12
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
13
+
14
+ ### Data Grid
15
+
16
+ #### `@mui/x-data-grid@7.29.6`
17
+
18
+ - [DataGrid] Keep pipe pre-processors execution order when callback reference changes (#18217) @arminmeh
19
+
20
+ #### `@mui/x-data-grid-pro@7.29.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
21
+
22
+ Same changes as in `@mui/x-data-grid@7.29.6`.
23
+
24
+ #### `@mui/x-data-grid-premium@7.29.6` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
25
+
26
+ Same changes as in `@mui/x-data-grid-pro@7.29.6`.
27
+
28
+ ### Docs
29
+
30
+ - [docs] Keep `groupingColDef` reference stable in the grid demos (#17549) @arminmeh
31
+
6
32
  ## 7.29.5
7
33
 
8
34
  _May 29, 2025_
@@ -56,12 +56,12 @@ export const useGridPipeProcessing = apiRef => {
56
56
  const oldProcessor = groupCache.processors.get(id);
57
57
  if (oldProcessor !== processor) {
58
58
  groupCache.processors.set(id, processor);
59
- groupCache.processorsAsArray = Array.from(cache.current[group].processors.values());
59
+ groupCache.processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
60
60
  runAppliers(groupCache);
61
61
  }
62
62
  return () => {
63
- cache.current[group].processors.delete(id);
64
- cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values());
63
+ cache.current[group].processors.set(id, null);
64
+ cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
65
65
  };
66
66
  }, [runAppliers]);
67
67
  const registerPipeApplier = React.useCallback((group, id, applier) => {
@@ -28,17 +28,21 @@ export const useGridRowSelectionPreProcessors = (apiRef, props) => {
28
28
  headerName: apiRef.current.getLocaleText('checkboxSelectionHeaderName')
29
29
  });
30
30
  const shouldHaveSelectionColumn = props.checkboxSelection;
31
- const haveSelectionColumn = columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] != null;
32
- if (shouldHaveSelectionColumn && !haveSelectionColumn) {
31
+ const hasSelectionColumn = columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] != null;
32
+ if (shouldHaveSelectionColumn && !hasSelectionColumn) {
33
33
  columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] = selectionColumn;
34
34
  columnsState.orderedFields = [GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields];
35
- } else if (!shouldHaveSelectionColumn && haveSelectionColumn) {
35
+ } else if (!shouldHaveSelectionColumn && hasSelectionColumn) {
36
36
  delete columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD];
37
37
  columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== GRID_CHECKBOX_SELECTION_FIELD);
38
- } else if (shouldHaveSelectionColumn && haveSelectionColumn) {
38
+ } else if (shouldHaveSelectionColumn && hasSelectionColumn) {
39
39
  columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] = _extends({}, selectionColumn, columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD]);
40
+ // If the column is not in the columns array (not a custom selection column), move it to the beginning of the column order
41
+ if (!props.columns.some(col => col.field === GRID_CHECKBOX_SELECTION_FIELD)) {
42
+ columnsState.orderedFields = [GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields.filter(field => field !== GRID_CHECKBOX_SELECTION_FIELD)];
43
+ }
40
44
  }
41
45
  return columnsState;
42
- }, [apiRef, classes, props.checkboxSelection]);
46
+ }, [apiRef, classes, props.columns, props.checkboxSelection]);
43
47
  useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateSelectionColumn);
44
48
  };
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.29.5
2
+ * @mui/x-data-grid v7.29.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -56,12 +56,12 @@ export const useGridPipeProcessing = apiRef => {
56
56
  const oldProcessor = groupCache.processors.get(id);
57
57
  if (oldProcessor !== processor) {
58
58
  groupCache.processors.set(id, processor);
59
- groupCache.processorsAsArray = Array.from(cache.current[group].processors.values());
59
+ groupCache.processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
60
60
  runAppliers(groupCache);
61
61
  }
62
62
  return () => {
63
- cache.current[group].processors.delete(id);
64
- cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values());
63
+ cache.current[group].processors.set(id, null);
64
+ cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
65
65
  };
66
66
  }, [runAppliers]);
67
67
  const registerPipeApplier = React.useCallback((group, id, applier) => {
@@ -28,17 +28,21 @@ export const useGridRowSelectionPreProcessors = (apiRef, props) => {
28
28
  headerName: apiRef.current.getLocaleText('checkboxSelectionHeaderName')
29
29
  });
30
30
  const shouldHaveSelectionColumn = props.checkboxSelection;
31
- const haveSelectionColumn = columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] != null;
32
- if (shouldHaveSelectionColumn && !haveSelectionColumn) {
31
+ const hasSelectionColumn = columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] != null;
32
+ if (shouldHaveSelectionColumn && !hasSelectionColumn) {
33
33
  columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] = selectionColumn;
34
34
  columnsState.orderedFields = [GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields];
35
- } else if (!shouldHaveSelectionColumn && haveSelectionColumn) {
35
+ } else if (!shouldHaveSelectionColumn && hasSelectionColumn) {
36
36
  delete columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD];
37
37
  columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== GRID_CHECKBOX_SELECTION_FIELD);
38
- } else if (shouldHaveSelectionColumn && haveSelectionColumn) {
38
+ } else if (shouldHaveSelectionColumn && hasSelectionColumn) {
39
39
  columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] = _extends({}, selectionColumn, columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD]);
40
+ // If the column is not in the columns array (not a custom selection column), move it to the beginning of the column order
41
+ if (!props.columns.some(col => col.field === GRID_CHECKBOX_SELECTION_FIELD)) {
42
+ columnsState.orderedFields = [GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields.filter(field => field !== GRID_CHECKBOX_SELECTION_FIELD)];
43
+ }
40
44
  }
41
45
  return columnsState;
42
- }, [apiRef, classes, props.checkboxSelection]);
46
+ }, [apiRef, classes, props.columns, props.checkboxSelection]);
43
47
  useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateSelectionColumn);
44
48
  };
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.29.5
2
+ * @mui/x-data-grid v7.29.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -64,12 +64,12 @@ const useGridPipeProcessing = apiRef => {
64
64
  const oldProcessor = groupCache.processors.get(id);
65
65
  if (oldProcessor !== processor) {
66
66
  groupCache.processors.set(id, processor);
67
- groupCache.processorsAsArray = Array.from(cache.current[group].processors.values());
67
+ groupCache.processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
68
68
  runAppliers(groupCache);
69
69
  }
70
70
  return () => {
71
- cache.current[group].processors.delete(id);
72
- cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values());
71
+ cache.current[group].processors.set(id, null);
72
+ cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
73
73
  };
74
74
  }, [runAppliers]);
75
75
  const registerPipeApplier = React.useCallback((group, id, applier) => {
@@ -36,18 +36,22 @@ const useGridRowSelectionPreProcessors = (apiRef, props) => {
36
36
  headerName: apiRef.current.getLocaleText('checkboxSelectionHeaderName')
37
37
  });
38
38
  const shouldHaveSelectionColumn = props.checkboxSelection;
39
- const haveSelectionColumn = columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD] != null;
40
- if (shouldHaveSelectionColumn && !haveSelectionColumn) {
39
+ const hasSelectionColumn = columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD] != null;
40
+ if (shouldHaveSelectionColumn && !hasSelectionColumn) {
41
41
  columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD] = selectionColumn;
42
42
  columnsState.orderedFields = [_colDef.GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields];
43
- } else if (!shouldHaveSelectionColumn && haveSelectionColumn) {
43
+ } else if (!shouldHaveSelectionColumn && hasSelectionColumn) {
44
44
  delete columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD];
45
45
  columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== _colDef.GRID_CHECKBOX_SELECTION_FIELD);
46
- } else if (shouldHaveSelectionColumn && haveSelectionColumn) {
46
+ } else if (shouldHaveSelectionColumn && hasSelectionColumn) {
47
47
  columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD] = (0, _extends2.default)({}, selectionColumn, columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD]);
48
+ // If the column is not in the columns array (not a custom selection column), move it to the beginning of the column order
49
+ if (!props.columns.some(col => col.field === _colDef.GRID_CHECKBOX_SELECTION_FIELD)) {
50
+ columnsState.orderedFields = [_colDef.GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields.filter(field => field !== _colDef.GRID_CHECKBOX_SELECTION_FIELD)];
51
+ }
48
52
  }
49
53
  return columnsState;
50
- }, [apiRef, classes, props.checkboxSelection]);
54
+ }, [apiRef, classes, props.columns, props.checkboxSelection]);
51
55
  (0, _pipeProcessing.useGridRegisterPipeProcessor)(apiRef, 'hydrateColumns', updateSelectionColumn);
52
56
  };
53
57
  exports.useGridRowSelectionPreProcessors = useGridRowSelectionPreProcessors;
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.29.5
2
+ * @mui/x-data-grid v7.29.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "7.29.5",
3
+ "version": "7.29.6",
4
4
  "description": "The Community plan edition of the Data Grid components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",