@mui/x-data-grid-premium 5.15.0 → 5.15.3

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +128 -1
  2. package/DataGridPremium/DataGridPremium.js +2 -2
  3. package/README.md +3 -2
  4. package/hooks/features/rowGrouping/createGroupingColDef.js +0 -10
  5. package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +2 -1
  6. package/hooks/features/rowGrouping/gridRowGroupingUtils.js +30 -21
  7. package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -1
  8. package/index.js +1 -1
  9. package/legacy/DataGridPremium/DataGridPremium.js +2 -2
  10. package/legacy/hooks/features/rowGrouping/createGroupingColDef.js +0 -10
  11. package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +35 -21
  12. package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -1
  13. package/legacy/index.js +1 -1
  14. package/legacy/utils/releaseInfo.js +1 -1
  15. package/modern/DataGridPremium/DataGridPremium.js +2 -2
  16. package/modern/hooks/features/rowGrouping/createGroupingColDef.js +0 -10
  17. package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +27 -20
  18. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -1
  19. package/modern/index.js +1 -1
  20. package/modern/utils/releaseInfo.js +1 -1
  21. package/node/DataGridPremium/DataGridPremium.js +2 -2
  22. package/node/hooks/features/rowGrouping/createGroupingColDef.js +0 -10
  23. package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +31 -21
  24. package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -1
  25. package/node/index.js +1 -1
  26. package/node/utils/releaseInfo.js +1 -1
  27. package/package.json +4 -4
  28. package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,133 @@
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
+ ## 5.15.3
7
+
8
+ _Aug 18, 2022_
9
+
10
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 📚 Documentation improvements
13
+ - 🐞 Bugfixes
14
+
15
+ ### `@mui/x-data-grid@v5.15.3` / `@mui/x-data-grid-pro@v5.15.3` / `@mui/x-data-grid-premium@v5.15.3`
16
+
17
+ #### Changes
18
+
19
+ - [DataGrid] Fix <kbd>Enter</kbd> causing Select to re-open when commiting value (#5756) @m4theushw
20
+ - [DataGrid] Fix `GridOverlays` bypassing pointer events (#5674) @philjones88
21
+
22
+ ### `@mui/x-date-pickers@v5.0.0-beta.6` / `@mui/x-date-picker-pro@v5.0.0-beta.6`
23
+
24
+ #### Changes
25
+
26
+ - [DatePicker] Support click on day outside of current month (#5768) @alexfauquette
27
+ - [pickers] Extend `PickersActionBarProps` with `DialogActionProps` (#5798) @LukasTy
28
+
29
+ ### Docs
30
+
31
+ - [docs] Fix API anchor link scroll top (#5795) @oliviertassinari
32
+ - [docs] Fix contradiction in the free trial clause (#5732) @oliviertassinari
33
+ - [docs] Fix default value of the DataGrid `logLevel` prop to false (#5784) @HwangTaehyun
34
+ - [docs] Fix typo on the row height page (#5772) @flaviendelangle
35
+ - [docs] Improve "upgrading plans" documentation. (#5683) @joserodolfofreitas
36
+ - [docs] Link the license docs before pricing (#5726) @oliviertassinari
37
+ - [docs] Update packages README files (#5835) @cherniavskii
38
+ - [docs] Use `InputBase` for pickers inputs (#5597) @cherniavskii
39
+
40
+ ### Core
41
+
42
+ - [core] Upgrade monorepo (#5771, #5797) @cherniavskii
43
+ - [core] Various TS improvements (#5556) @flaviendelangle
44
+ - [license] Give more context in the missing license (#5731) @oliviertassinari
45
+ - [license] Only log an error type once (#5730) @oliviertassinari
46
+ - [test] Increase timeout to take print screenshot (#5799) @m4theushw
47
+
48
+ ## 5.15.2
49
+
50
+ _Aug 11, 2022_
51
+
52
+ We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
53
+
54
+ - ✨ Improve quick filtering with row grouping (#5701) @alexfauquette
55
+ - 📚 Documentation improvements
56
+ - 🐞 Bugfixes
57
+
58
+ ### `@mui/x-data-grid@v5.15.2` / `@mui/x-data-grid-pro@v5.15.2` / `@mui/x-data-grid-premium@v5.15.2`
59
+
60
+ #### Changes
61
+
62
+ - [DataGrid] Catch errors if rows freezing is not supported (#5711) @cherniavskii
63
+ - [DataGrid] Preserve cell mode when entering edit mode while commiting (#5686) @m4theushw
64
+ - [DataGridPremium] Let quick filter search in row grouping children (#5701) @alexfauquette
65
+
66
+ ### `@mui/x-date-pickers@v5.0.0-beta.5` / `@mui/x-date-picker-pro@5.0.0-beta.5`
67
+
68
+ #### Changes
69
+
70
+ - [pickers] Add `react-dom` to peerDependencies (#5752) @cherniavskii
71
+ - [TimePicker] Set clock focus outline to `none` (#5758) @LukasTy
72
+ - [pickers] Fix theme augmentation with TypeScript (#5596) @alexfauquette
73
+ - [pickers] Reset input value when locale is modified (#5310) @alexfauquette
74
+ - [pickers] Support `disableHighlightToday` on `MonthPicker` and `YearPicker` (#5562) @flaviendelangle
75
+ - [pickers] Fallback to desktop mode when `matchMedia` is unavailable (#5684) @LukasTy
76
+ - [pickers] Trigger `onChange` when clearing or accepting `Invalid date` (#5740) @LukasTy
77
+
78
+ ### Docs
79
+
80
+ - [docs] Add RFC GH issue template (#5739) @bytasv
81
+ - [docs] Add description to the `GridExportStateParams` page (#5654) @oliviertassinari
82
+ - [docs] Improve the Events page (#5413) @flaviendelangle
83
+ - [docs] Use new editing API in the introduction demos (#5728) @oliviertassinari
84
+
85
+ ### Core
86
+
87
+ - [core] Remove duplicated `FUNDING.yml` file (#5656) @oliviertassinari
88
+ - [core] Remove outdated Next.js options (#5727) @oliviertassinari
89
+ - [core] Update tooling to run with React 18 (#4155) @m4theushw
90
+ - [test] Fix failing dynamic row height tests on Edge (#5707) @m4theushw
91
+
92
+ ## 5.15.1
93
+
94
+ _Aug 4, 2022_
95
+
96
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
97
+
98
+ - 📚 New [page presenting the `apiRef`](https://mui.com/x/react-data-grid/api-object/) (#5273) @flaviendelangle
99
+ - ✨ Better keyboard support for start editing cells (#5511) @oliviertassinari
100
+ - 🌍 Improvements to different locales
101
+ - 🐞 Bugfixes
102
+
103
+ ### `@mui/x-data-grid@v5.15.1` / `@mui/x-data-grid-pro@v5.15.1` / `@mui/x-data-grid-premium@v5.15.1`
104
+
105
+ #### Changes
106
+
107
+ - [DataGrid] Improve start edit UX (#5511) @oliviertassinari
108
+ - [DataGrid] Add `initialOpen` prop to `GridEditSingleSelectCell` to allow overriding initial open state (#5645) @shapaaa
109
+ - [DataGrid] Forward `ref` to root element in `GridEditInputCell` (#5631) @Zenoo
110
+ - [DataGrid] Toggle open state when clicking on buttons in the `GridToolbar` (#5503) @cherniavskii
111
+ - [DataGrid] Improve German (de-DE) locale (#5586) @sebastianfrey
112
+ - [DataGrid] Improve Korean (ko-KR) locale (#5668) @Einere
113
+ - [DataGrid] Complete Italian (it-IT) locale (#5487) @mamodev
114
+
115
+ ### `@mui/x-date-pickers@v5.0.0-beta.4` / `@mui/x-date-picker-pro@5.0.0-beta.4`
116
+
117
+ #### Changes
118
+
119
+ - [DatePicker] Customize day formatter in the calendar (#5373) @alexfauquette
120
+
121
+ ### Docs
122
+
123
+ - [docs] New location for the legal content (#5595) @oliviertassinari
124
+ - [docs] Update description of `maxDateTime` prop (#5639) @jurecuhalev
125
+ - [docs] Add missing `date-fns` dependency when opening Codesandbox demo (#5692) @cherniavskii
126
+
127
+ ### Core
128
+
129
+ - [core] Drop usage of `GRID_EXPERIMENTAL_ENABLED` env variable (#5669) @ar7casper
130
+ - [core] Isolate asset loading under /x/ (#5594) @oliviertassinari
131
+ - [core] Upgrade node to v14 (#4999) @cherniavskii
132
+
6
133
  ## 5.15.0
7
134
 
8
135
  _Jul 29, 2022_
@@ -13,7 +140,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
13
140
 
14
141
  Premium users can now aggregate data in the grid.
15
142
  Extract information like sum, average, count, and others with a couple of clicks.
16
-
143
+
17
144
  https://user-images.githubusercontent.com/45398769/181581503-77cc412e-9d9e-4de1-8bc3-c3bccc54cdaa.mp4
18
145
 
19
146
  To enable this feature, add `experimentalFeatures={{ aggregation: true }}`.
@@ -517,7 +517,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
517
517
 
518
518
  /**
519
519
  * Allows to pass the logging level or false to turn off logging.
520
- * @default "debug"
520
+ * @default "error" ("warn" in dev mode)
521
521
  */
522
522
  logLevel: PropTypes.oneOf(['debug', 'error', 'info', 'warn', false]),
523
523
 
@@ -875,7 +875,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
875
875
  * @param {GridState} state The new state.
876
876
  * @param {MuiEvent<{}>} event The event object.
877
877
  * @param {GridCallbackDetails} details Additional details for this callback.
878
- * @internal
878
+ * @ignore - do not document.
879
879
  */
880
880
  onStateChange: PropTypes.func,
881
881
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @mui/x-data-grid-pro
1
+ # @mui/x-data-grid-premium
2
2
 
3
3
  This package is the Premium plan edition of the data grid component.
4
4
  It's part of MUI X, an open core extension of MUI, with advanced components.
@@ -21,7 +21,8 @@ This component has the following peer dependencies that you will need to install
21
21
  "peerDependencies": {
22
22
  "@mui/material": "^5.4.1",
23
23
  "@mui/system": "^5.4.1",
24
- "react": "^17.0.2 || ^18.0.0"
24
+ "react": "^17.0.2 || ^18.0.0",
25
+ "react-dom": "^17.0.2 || ^18.0.0"
25
26
  },
26
27
  ```
27
28
 
@@ -66,11 +66,6 @@ const getLeafProperties = leafColDef => {
66
66
  }
67
67
 
68
68
  return params => {
69
- // We only want to filter leaves
70
- if (params.rowNode.groupingField != null) {
71
- return true;
72
- }
73
-
74
69
  return originalFn(params);
75
70
  };
76
71
  }
@@ -109,11 +104,6 @@ const getGroupingCriteriaProperties = (groupedByColDef, applyHeaderName) => {
109
104
  }
110
105
 
111
106
  return params => {
112
- // We only want to filter the groups of the current grouping criteria
113
- if (params.rowNode.groupingField !== groupedByColDef.field) {
114
- return true;
115
- }
116
-
117
107
  return originalFn(params);
118
108
  };
119
109
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { GridRowTreeConfig, GridFilterState } from '@mui/x-data-grid-pro';
2
+ import { GridRowTreeConfig, GridFilterState, GridFilterModel } from '@mui/x-data-grid-pro';
3
3
  import { GridAggregatedFilterItemApplier } from '@mui/x-data-grid-pro/internals';
4
4
  import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
5
5
  import { GridRowGroupingModel } from './gridRowGroupingInterfaces';
@@ -13,6 +13,7 @@ export declare const isGroupingColumn: (field: string) => boolean;
13
13
  interface FilterRowTreeFromTreeDataParams {
14
14
  rowTree: GridRowTreeConfig;
15
15
  isRowMatchingFilters: GridAggregatedFilterItemApplier | null;
16
+ filterModel: GridFilterModel;
16
17
  }
17
18
  /**
18
19
  * A leaf is visible if it passed the filter
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { passFilterLogic } from '@mui/x-data-grid-pro/internals';
2
3
  import { gridRowGroupingSanitizedModelSelector } from './gridRowGroupingSelector';
3
4
  export const GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = '__row_group_by_columns_group__';
4
5
  export const ROW_GROUPING_STRATEGY = 'grouping-columns';
@@ -42,48 +43,56 @@ const shouldApplyFilterItemOnGroup = (columnField, node) => {
42
43
  export const filterRowTreeFromGroupingColumns = params => {
43
44
  const {
44
45
  rowTree,
45
- isRowMatchingFilters
46
+ isRowMatchingFilters,
47
+ filterModel
46
48
  } = params;
47
49
  const visibleRowsLookup = {};
48
50
  const filteredRowsLookup = {};
49
51
  const filteredDescendantCountLookup = {};
50
52
 
51
- const filterTreeNode = (node, areAncestorsPassingChildren, areAncestorsExpanded) => {
52
- var _node$children, _node$children2;
53
+ const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
54
+ var _node$children;
53
55
 
54
- let isMatchingFilters;
56
+ let isPassingFiltering = false;
57
+ let filterResults = {
58
+ passingFilterItems: null,
59
+ passingQuickFilterValues: null
60
+ };
55
61
 
56
- if (!isRowMatchingFilters) {
57
- isMatchingFilters = true;
58
- } else {
62
+ if (isRowMatchingFilters && node.position !== 'footer') {
59
63
  const shouldApplyItem = node.isAutoGenerated ? columnField => shouldApplyFilterItemOnGroup(columnField, node) : undefined;
60
- isMatchingFilters = isRowMatchingFilters(node.id, shouldApplyItem);
64
+ filterResults = isRowMatchingFilters(node.id, shouldApplyItem);
65
+ } else {
66
+ isPassingFiltering = true;
61
67
  }
62
68
 
63
69
  let filteredDescendantCount = 0;
64
70
  (_node$children = node.children) == null ? void 0 : _node$children.forEach(childId => {
65
71
  const childNode = rowTree[childId];
66
- const childSubTreeSize = filterTreeNode(childNode, areAncestorsPassingChildren && isMatchingFilters, areAncestorsExpanded && !!node.childrenExpanded);
72
+ const childSubTreeSize = filterTreeNode(childNode, areAncestorsExpanded && !!node.childrenExpanded, [...ancestorsResults, filterResults]);
67
73
  filteredDescendantCount += childSubTreeSize;
68
74
  });
69
- let shouldPassFilters;
70
75
 
71
- if (!areAncestorsPassingChildren) {
72
- shouldPassFilters = false;
73
- } else if ((_node$children2 = node.children) != null && _node$children2.length) {
74
- shouldPassFilters = isMatchingFilters && filteredDescendantCount > 0;
75
- } else {
76
- shouldPassFilters = isMatchingFilters;
76
+ if (isPassingFiltering === false) {
77
+ var _node$children2;
78
+
79
+ if ((_node$children2 = node.children) != null && _node$children2.length) {
80
+ // If node has children - it's passing if at least one child passes filters
81
+ isPassingFiltering = filteredDescendantCount > 0;
82
+ } else {
83
+ const allResults = [...ancestorsResults, filterResults];
84
+ isPassingFiltering = passFilterLogic(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel);
85
+ }
77
86
  }
78
87
 
79
- visibleRowsLookup[node.id] = shouldPassFilters && areAncestorsExpanded;
80
- filteredRowsLookup[node.id] = shouldPassFilters;
88
+ visibleRowsLookup[node.id] = isPassingFiltering && areAncestorsExpanded;
89
+ filteredRowsLookup[node.id] = isPassingFiltering;
81
90
 
82
91
  if (node.footerId != null) {
83
- visibleRowsLookup[node.footerId] = shouldPassFilters && areAncestorsExpanded && !!node.childrenExpanded;
92
+ visibleRowsLookup[node.footerId] = isPassingFiltering && areAncestorsExpanded && !!node.childrenExpanded;
84
93
  }
85
94
 
86
- if (!shouldPassFilters) {
95
+ if (!isPassingFiltering) {
87
96
  return 0;
88
97
  }
89
98
 
@@ -102,7 +111,7 @@ export const filterRowTreeFromGroupingColumns = params => {
102
111
  const node = nodes[i];
103
112
 
104
113
  if (node.depth === 0) {
105
- filterTreeNode(node, true, true);
114
+ filterTreeNode(node, true, []);
106
115
  }
107
116
  }
108
117
 
@@ -136,7 +136,8 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
136
136
  const rowTree = gridRowTreeSelector(apiRef);
137
137
  return filterRowTreeFromGroupingColumns({
138
138
  rowTree,
139
- isRowMatchingFilters: params.isRowMatchingFilters
139
+ isRowMatchingFilters: params.isRowMatchingFilters,
140
+ filterModel: params.filterModel
140
141
  });
141
142
  }, [apiRef]);
142
143
  const sortRows = React.useCallback(params => {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.15.0
1
+ /** @license MUI v5.15.3
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -517,7 +517,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
517
517
 
518
518
  /**
519
519
  * Allows to pass the logging level or false to turn off logging.
520
- * @default "debug"
520
+ * @default "error" ("warn" in dev mode)
521
521
  */
522
522
  logLevel: PropTypes.oneOf(['debug', 'error', 'info', 'warn', false]),
523
523
 
@@ -875,7 +875,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
875
875
  * @param {GridState} state The new state.
876
876
  * @param {MuiEvent<{}>} event The event object.
877
877
  * @param {GridCallbackDetails} details Additional details for this callback.
878
- * @internal
878
+ * @ignore - do not document.
879
879
  */
880
880
  onStateChange: PropTypes.func,
881
881
 
@@ -68,11 +68,6 @@ var getLeafProperties = function getLeafProperties(leafColDef) {
68
68
  }
69
69
 
70
70
  return function (params) {
71
- // We only want to filter leaves
72
- if (params.rowNode.groupingField != null) {
73
- return true;
74
- }
75
-
76
71
  return originalFn(params);
77
72
  };
78
73
  }
@@ -113,11 +108,6 @@ var getGroupingCriteriaProperties = function getGroupingCriteriaProperties(group
113
108
  }
114
109
 
115
110
  return function (params) {
116
- // We only want to filter the groups of the current grouping criteria
117
- if (params.rowNode.groupingField !== groupedByColDef.field) {
118
- return true;
119
- }
120
-
121
111
  return originalFn(params);
122
112
  };
123
113
  }
@@ -1,4 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import { passFilterLogic } from '@mui/x-data-grid-pro/internals';
2
4
  import { gridRowGroupingSanitizedModelSelector } from './gridRowGroupingSelector';
3
5
  export var GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = '__row_group_by_columns_group__';
4
6
  export var ROW_GROUPING_STRATEGY = 'grouping-columns';
@@ -43,49 +45,61 @@ var shouldApplyFilterItemOnGroup = function shouldApplyFilterItemOnGroup(columnF
43
45
 
44
46
  export var filterRowTreeFromGroupingColumns = function filterRowTreeFromGroupingColumns(params) {
45
47
  var rowTree = params.rowTree,
46
- isRowMatchingFilters = params.isRowMatchingFilters;
48
+ isRowMatchingFilters = params.isRowMatchingFilters,
49
+ filterModel = params.filterModel;
47
50
  var visibleRowsLookup = {};
48
51
  var filteredRowsLookup = {};
49
52
  var filteredDescendantCountLookup = {};
50
53
 
51
- var filterTreeNode = function filterTreeNode(node, areAncestorsPassingChildren, areAncestorsExpanded) {
52
- var _node$children, _node$children2;
54
+ var filterTreeNode = function filterTreeNode(node, areAncestorsExpanded, ancestorsResults) {
55
+ var _node$children;
53
56
 
54
- var isMatchingFilters;
57
+ var isPassingFiltering = false;
58
+ var filterResults = {
59
+ passingFilterItems: null,
60
+ passingQuickFilterValues: null
61
+ };
55
62
 
56
- if (!isRowMatchingFilters) {
57
- isMatchingFilters = true;
58
- } else {
63
+ if (isRowMatchingFilters && node.position !== 'footer') {
59
64
  var shouldApplyItem = node.isAutoGenerated ? function (columnField) {
60
65
  return shouldApplyFilterItemOnGroup(columnField, node);
61
66
  } : undefined;
62
- isMatchingFilters = isRowMatchingFilters(node.id, shouldApplyItem);
67
+ filterResults = isRowMatchingFilters(node.id, shouldApplyItem);
68
+ } else {
69
+ isPassingFiltering = true;
63
70
  }
64
71
 
65
72
  var filteredDescendantCount = 0;
66
73
  (_node$children = node.children) == null ? void 0 : _node$children.forEach(function (childId) {
67
74
  var childNode = rowTree[childId];
68
- var childSubTreeSize = filterTreeNode(childNode, areAncestorsPassingChildren && isMatchingFilters, areAncestorsExpanded && !!node.childrenExpanded);
75
+ var childSubTreeSize = filterTreeNode(childNode, areAncestorsExpanded && !!node.childrenExpanded, [].concat(_toConsumableArray(ancestorsResults), [filterResults]));
69
76
  filteredDescendantCount += childSubTreeSize;
70
77
  });
71
- var shouldPassFilters;
72
78
 
73
- if (!areAncestorsPassingChildren) {
74
- shouldPassFilters = false;
75
- } else if ((_node$children2 = node.children) != null && _node$children2.length) {
76
- shouldPassFilters = isMatchingFilters && filteredDescendantCount > 0;
77
- } else {
78
- shouldPassFilters = isMatchingFilters;
79
+ if (isPassingFiltering === false) {
80
+ var _node$children2;
81
+
82
+ if ((_node$children2 = node.children) != null && _node$children2.length) {
83
+ // If node has children - it's passing if at least one child passes filters
84
+ isPassingFiltering = filteredDescendantCount > 0;
85
+ } else {
86
+ var allResults = [].concat(_toConsumableArray(ancestorsResults), [filterResults]);
87
+ isPassingFiltering = passFilterLogic(allResults.map(function (result) {
88
+ return result.passingFilterItems;
89
+ }), allResults.map(function (result) {
90
+ return result.passingQuickFilterValues;
91
+ }), filterModel);
92
+ }
79
93
  }
80
94
 
81
- visibleRowsLookup[node.id] = shouldPassFilters && areAncestorsExpanded;
82
- filteredRowsLookup[node.id] = shouldPassFilters;
95
+ visibleRowsLookup[node.id] = isPassingFiltering && areAncestorsExpanded;
96
+ filteredRowsLookup[node.id] = isPassingFiltering;
83
97
 
84
98
  if (node.footerId != null) {
85
- visibleRowsLookup[node.footerId] = shouldPassFilters && areAncestorsExpanded && !!node.childrenExpanded;
99
+ visibleRowsLookup[node.footerId] = isPassingFiltering && areAncestorsExpanded && !!node.childrenExpanded;
86
100
  }
87
101
 
88
- if (!shouldPassFilters) {
102
+ if (!isPassingFiltering) {
89
103
  return 0;
90
104
  }
91
105
 
@@ -104,7 +118,7 @@ export var filterRowTreeFromGroupingColumns = function filterRowTreeFromGrouping
104
118
  var node = nodes[i];
105
119
 
106
120
  if (node.depth === 0) {
107
- filterTreeNode(node, true, true);
121
+ filterTreeNode(node, true, []);
108
122
  }
109
123
  }
110
124
 
@@ -146,7 +146,8 @@ export var useGridRowGroupingPreProcessors = function useGridRowGroupingPreProce
146
146
  var rowTree = gridRowTreeSelector(apiRef);
147
147
  return filterRowTreeFromGroupingColumns({
148
148
  rowTree: rowTree,
149
- isRowMatchingFilters: params.isRowMatchingFilters
149
+ isRowMatchingFilters: params.isRowMatchingFilters,
150
+ filterModel: params.filterModel
150
151
  });
151
152
  }, [apiRef]);
152
153
  var sortRows = React.useCallback(function (params) {
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.15.0
1
+ /** @license MUI v5.15.3
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export var getReleaseInfo = function getReleaseInfo() {
3
- var releaseInfo = "MTY1OTA0NTYwMDAwMA==";
3
+ var releaseInfo = "MTY2MDc5MTYwMDAwMA==";
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).
@@ -517,7 +517,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
517
517
 
518
518
  /**
519
519
  * Allows to pass the logging level or false to turn off logging.
520
- * @default "debug"
520
+ * @default "error" ("warn" in dev mode)
521
521
  */
522
522
  logLevel: PropTypes.oneOf(['debug', 'error', 'info', 'warn', false]),
523
523
 
@@ -875,7 +875,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
875
875
  * @param {GridState} state The new state.
876
876
  * @param {MuiEvent<{}>} event The event object.
877
877
  * @param {GridCallbackDetails} details Additional details for this callback.
878
- * @internal
878
+ * @ignore - do not document.
879
879
  */
880
880
  onStateChange: PropTypes.func,
881
881
 
@@ -63,11 +63,6 @@ const getLeafProperties = leafColDef => ({
63
63
  }
64
64
 
65
65
  return params => {
66
- // We only want to filter leaves
67
- if (params.rowNode.groupingField != null) {
68
- return true;
69
- }
70
-
71
66
  return originalFn(params);
72
67
  };
73
68
  }
@@ -103,11 +98,6 @@ const getGroupingCriteriaProperties = (groupedByColDef, applyHeaderName) => {
103
98
  }
104
99
 
105
100
  return params => {
106
- // We only want to filter the groups of the current grouping criteria
107
- if (params.rowNode.groupingField !== groupedByColDef.field) {
108
- return true;
109
- }
110
-
111
101
  return originalFn(params);
112
102
  };
113
103
  }
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { passFilterLogic } from '@mui/x-data-grid-pro/internals';
2
3
  import { gridRowGroupingSanitizedModelSelector } from './gridRowGroupingSelector';
3
4
  export const GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = '__row_group_by_columns_group__';
4
5
  export const ROW_GROUPING_STRATEGY = 'grouping-columns';
@@ -42,46 +43,52 @@ const shouldApplyFilterItemOnGroup = (columnField, node) => {
42
43
  export const filterRowTreeFromGroupingColumns = params => {
43
44
  const {
44
45
  rowTree,
45
- isRowMatchingFilters
46
+ isRowMatchingFilters,
47
+ filterModel
46
48
  } = params;
47
49
  const visibleRowsLookup = {};
48
50
  const filteredRowsLookup = {};
49
51
  const filteredDescendantCountLookup = {};
50
52
 
51
- const filterTreeNode = (node, areAncestorsPassingChildren, areAncestorsExpanded) => {
52
- let isMatchingFilters;
53
+ const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
54
+ let isPassingFiltering = false;
55
+ let filterResults = {
56
+ passingFilterItems: null,
57
+ passingQuickFilterValues: null
58
+ };
53
59
 
54
- if (!isRowMatchingFilters) {
55
- isMatchingFilters = true;
56
- } else {
60
+ if (isRowMatchingFilters && node.position !== 'footer') {
57
61
  const shouldApplyItem = node.isAutoGenerated ? columnField => shouldApplyFilterItemOnGroup(columnField, node) : undefined;
58
- isMatchingFilters = isRowMatchingFilters(node.id, shouldApplyItem);
62
+ filterResults = isRowMatchingFilters(node.id, shouldApplyItem);
63
+ } else {
64
+ isPassingFiltering = true;
59
65
  }
60
66
 
61
67
  let filteredDescendantCount = 0;
62
68
  node.children?.forEach(childId => {
63
69
  const childNode = rowTree[childId];
64
- const childSubTreeSize = filterTreeNode(childNode, areAncestorsPassingChildren && isMatchingFilters, areAncestorsExpanded && !!node.childrenExpanded);
70
+ const childSubTreeSize = filterTreeNode(childNode, areAncestorsExpanded && !!node.childrenExpanded, [...ancestorsResults, filterResults]);
65
71
  filteredDescendantCount += childSubTreeSize;
66
72
  });
67
- let shouldPassFilters;
68
73
 
69
- if (!areAncestorsPassingChildren) {
70
- shouldPassFilters = false;
71
- } else if (node.children?.length) {
72
- shouldPassFilters = isMatchingFilters && filteredDescendantCount > 0;
73
- } else {
74
- shouldPassFilters = isMatchingFilters;
74
+ if (isPassingFiltering === false) {
75
+ if (node.children?.length) {
76
+ // If node has children - it's passing if at least one child passes filters
77
+ isPassingFiltering = filteredDescendantCount > 0;
78
+ } else {
79
+ const allResults = [...ancestorsResults, filterResults];
80
+ isPassingFiltering = passFilterLogic(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel);
81
+ }
75
82
  }
76
83
 
77
- visibleRowsLookup[node.id] = shouldPassFilters && areAncestorsExpanded;
78
- filteredRowsLookup[node.id] = shouldPassFilters;
84
+ visibleRowsLookup[node.id] = isPassingFiltering && areAncestorsExpanded;
85
+ filteredRowsLookup[node.id] = isPassingFiltering;
79
86
 
80
87
  if (node.footerId != null) {
81
- visibleRowsLookup[node.footerId] = shouldPassFilters && areAncestorsExpanded && !!node.childrenExpanded;
88
+ visibleRowsLookup[node.footerId] = isPassingFiltering && areAncestorsExpanded && !!node.childrenExpanded;
82
89
  }
83
90
 
84
- if (!shouldPassFilters) {
91
+ if (!isPassingFiltering) {
85
92
  return 0;
86
93
  }
87
94
 
@@ -100,7 +107,7 @@ export const filterRowTreeFromGroupingColumns = params => {
100
107
  const node = nodes[i];
101
108
 
102
109
  if (node.depth === 0) {
103
- filterTreeNode(node, true, true);
110
+ filterTreeNode(node, true, []);
104
111
  }
105
112
  }
106
113
 
@@ -136,7 +136,8 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
136
136
  const rowTree = gridRowTreeSelector(apiRef);
137
137
  return filterRowTreeFromGroupingColumns({
138
138
  rowTree,
139
- isRowMatchingFilters: params.isRowMatchingFilters
139
+ isRowMatchingFilters: params.isRowMatchingFilters,
140
+ filterModel: params.filterModel
140
141
  });
141
142
  }, [apiRef]);
142
143
  const sortRows = React.useCallback(params => {
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.15.0
1
+ /** @license MUI v5.15.3
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTY1OTA0NTYwMDAwMA==";
3
+ const releaseInfo = "MTY2MDc5MTYwMDAwMA==";
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).
@@ -540,7 +540,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
540
540
 
541
541
  /**
542
542
  * Allows to pass the logging level or false to turn off logging.
543
- * @default "debug"
543
+ * @default "error" ("warn" in dev mode)
544
544
  */
545
545
  logLevel: _propTypes.default.oneOf(['debug', 'error', 'info', 'warn', false]),
546
546
 
@@ -898,7 +898,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
898
898
  * @param {GridState} state The new state.
899
899
  * @param {MuiEvent<{}>} event The event object.
900
900
  * @param {GridCallbackDetails} details Additional details for this callback.
901
- * @internal
901
+ * @ignore - do not document.
902
902
  */
903
903
  onStateChange: _propTypes.default.func,
904
904
 
@@ -88,11 +88,6 @@ const getLeafProperties = leafColDef => {
88
88
  }
89
89
 
90
90
  return params => {
91
- // We only want to filter leaves
92
- if (params.rowNode.groupingField != null) {
93
- return true;
94
- }
95
-
96
91
  return originalFn(params);
97
92
  };
98
93
  }
@@ -131,11 +126,6 @@ const getGroupingCriteriaProperties = (groupedByColDef, applyHeaderName) => {
131
126
  }
132
127
 
133
128
  return params => {
134
- // We only want to filter the groups of the current grouping criteria
135
- if (params.rowNode.groupingField !== groupedByColDef.field) {
136
- return true;
137
- }
138
-
139
129
  return originalFn(params);
140
130
  };
141
131
  }
@@ -9,6 +9,8 @@ exports.setStrategyAvailability = exports.mergeStateWithRowGroupingModel = expor
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
12
+ var _internals = require("@mui/x-data-grid-pro/internals");
13
+
12
14
  var _gridRowGroupingSelector = require("./gridRowGroupingSelector");
13
15
 
14
16
  const GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD = '__row_group_by_columns_group__';
@@ -64,48 +66,56 @@ const shouldApplyFilterItemOnGroup = (columnField, node) => {
64
66
  const filterRowTreeFromGroupingColumns = params => {
65
67
  const {
66
68
  rowTree,
67
- isRowMatchingFilters
69
+ isRowMatchingFilters,
70
+ filterModel
68
71
  } = params;
69
72
  const visibleRowsLookup = {};
70
73
  const filteredRowsLookup = {};
71
74
  const filteredDescendantCountLookup = {};
72
75
 
73
- const filterTreeNode = (node, areAncestorsPassingChildren, areAncestorsExpanded) => {
74
- var _node$children, _node$children2;
76
+ const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
77
+ var _node$children;
75
78
 
76
- let isMatchingFilters;
79
+ let isPassingFiltering = false;
80
+ let filterResults = {
81
+ passingFilterItems: null,
82
+ passingQuickFilterValues: null
83
+ };
77
84
 
78
- if (!isRowMatchingFilters) {
79
- isMatchingFilters = true;
80
- } else {
85
+ if (isRowMatchingFilters && node.position !== 'footer') {
81
86
  const shouldApplyItem = node.isAutoGenerated ? columnField => shouldApplyFilterItemOnGroup(columnField, node) : undefined;
82
- isMatchingFilters = isRowMatchingFilters(node.id, shouldApplyItem);
87
+ filterResults = isRowMatchingFilters(node.id, shouldApplyItem);
88
+ } else {
89
+ isPassingFiltering = true;
83
90
  }
84
91
 
85
92
  let filteredDescendantCount = 0;
86
93
  (_node$children = node.children) == null ? void 0 : _node$children.forEach(childId => {
87
94
  const childNode = rowTree[childId];
88
- const childSubTreeSize = filterTreeNode(childNode, areAncestorsPassingChildren && isMatchingFilters, areAncestorsExpanded && !!node.childrenExpanded);
95
+ const childSubTreeSize = filterTreeNode(childNode, areAncestorsExpanded && !!node.childrenExpanded, [...ancestorsResults, filterResults]);
89
96
  filteredDescendantCount += childSubTreeSize;
90
97
  });
91
- let shouldPassFilters;
92
98
 
93
- if (!areAncestorsPassingChildren) {
94
- shouldPassFilters = false;
95
- } else if ((_node$children2 = node.children) != null && _node$children2.length) {
96
- shouldPassFilters = isMatchingFilters && filteredDescendantCount > 0;
97
- } else {
98
- shouldPassFilters = isMatchingFilters;
99
+ if (isPassingFiltering === false) {
100
+ var _node$children2;
101
+
102
+ if ((_node$children2 = node.children) != null && _node$children2.length) {
103
+ // If node has children - it's passing if at least one child passes filters
104
+ isPassingFiltering = filteredDescendantCount > 0;
105
+ } else {
106
+ const allResults = [...ancestorsResults, filterResults];
107
+ isPassingFiltering = (0, _internals.passFilterLogic)(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel);
108
+ }
99
109
  }
100
110
 
101
- visibleRowsLookup[node.id] = shouldPassFilters && areAncestorsExpanded;
102
- filteredRowsLookup[node.id] = shouldPassFilters;
111
+ visibleRowsLookup[node.id] = isPassingFiltering && areAncestorsExpanded;
112
+ filteredRowsLookup[node.id] = isPassingFiltering;
103
113
 
104
114
  if (node.footerId != null) {
105
- visibleRowsLookup[node.footerId] = shouldPassFilters && areAncestorsExpanded && !!node.childrenExpanded;
115
+ visibleRowsLookup[node.footerId] = isPassingFiltering && areAncestorsExpanded && !!node.childrenExpanded;
106
116
  }
107
117
 
108
- if (!shouldPassFilters) {
118
+ if (!isPassingFiltering) {
109
119
  return 0;
110
120
  }
111
121
 
@@ -124,7 +134,7 @@ const filterRowTreeFromGroupingColumns = params => {
124
134
  const node = nodes[i];
125
135
 
126
136
  if (node.depth === 0) {
127
- filterTreeNode(node, true, true);
137
+ filterTreeNode(node, true, []);
128
138
  }
129
139
  }
130
140
 
@@ -156,7 +156,8 @@ const useGridRowGroupingPreProcessors = (apiRef, props) => {
156
156
  const rowTree = (0, _xDataGridPro.gridRowTreeSelector)(apiRef);
157
157
  return (0, _gridRowGroupingUtils.filterRowTreeFromGroupingColumns)({
158
158
  rowTree,
159
- isRowMatchingFilters: params.isRowMatchingFilters
159
+ isRowMatchingFilters: params.isRowMatchingFilters,
160
+ filterModel: params.filterModel
160
161
  });
161
162
  }, [apiRef]);
162
163
  const sortRows = React.useCallback(params => {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.15.0
1
+ /** @license MUI v5.15.3
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -8,7 +8,7 @@ exports.getReleaseInfo = void 0;
8
8
  var _utils = require("@mui/utils");
9
9
 
10
10
  const getReleaseInfo = () => {
11
- const releaseInfo = "MTY1OTA0NTYwMDAwMA==";
11
+ const releaseInfo = "MTY2MDc5MTYwMDAwMA==";
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-premium",
3
- "version": "5.15.0",
3
+ "version": "5.15.3",
4
4
  "description": "The Premium plan edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -33,9 +33,9 @@
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.18.6",
35
35
  "@mui/utils": "^5.4.1",
36
- "@mui/x-data-grid": "5.15.0",
37
- "@mui/x-data-grid-pro": "5.15.0",
38
- "@mui/x-license-pro": "5.15.0",
36
+ "@mui/x-data-grid": "5.15.3",
37
+ "@mui/x-data-grid-pro": "5.15.3",
38
+ "@mui/x-license-pro": "5.15.3",
39
39
  "@types/format-util": "^1.0.2",
40
40
  "clsx": "^1.2.1",
41
41
  "exceljs": "^4.3.0",
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTY1OTA0NTYwMDAwMA==";
3
+ const releaseInfo = "MTY2MDc5MTYwMDAwMA==";
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).