@mui/x-data-grid-pro 7.5.1 → 7.6.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 CHANGED
@@ -3,6 +3,92 @@
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.6.0
7
+
8
+ _May 30, 2024_
9
+
10
+ We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 Allow to define and customize the indentation of nested items in the Tree View
13
+ - ✨ Allow charts highlights to be controlled
14
+ - 🌍 Improve Persian (fa-IR) locale on the Data Grid
15
+ - 🐞 Bugfixes
16
+ - 📚 Documentation improvements
17
+
18
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
19
+
20
+ ### Data Grid
21
+
22
+ #### `@mui/x-data-grid@7.6.0`
23
+
24
+ - [DataGrid] Avoid re-rendering all cells on column change (#12980) @romgrk
25
+ - [DataGrid] Export `GridColumnHeadersProps` (#13229) @cherniavskii
26
+ - [DataGrid] Fix header filters' issue with custom filters (#13255) @MBilalShafi
27
+ - [DataGrid] Remove dead logic to support Safari < 13 (#13249) @oliviertassinari
28
+ - [l10n] Improve Persian (fa-IR) locale (#12994) @amiryxe
29
+
30
+ #### `@mui/x-data-grid-pro@7.6.0` [![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.6.0`.
33
+
34
+ #### `@mui/x-data-grid-premium@7.6.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
35
+
36
+ Same changes as in `@mui/x-data-grid-pro@7.6.0`, plus:
37
+
38
+ - [DataGridPremium] Fix excel export causing column with wrong width (#13191) @romgrk
39
+
40
+ ### Date and Time Pickers
41
+
42
+ #### `@mui/x-date-pickers@7.6.0`
43
+
44
+ - [pickers] Fix `DateBuilderReturnType` when the date is `undefined` (#13244) @alexey-kozlenkov
45
+
46
+ #### `@mui/x-date-pickers-pro@7.6.0` [![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.6.0`.
49
+
50
+ ### Charts
51
+
52
+ #### `@mui/x-charts@7.6.0`
53
+
54
+ - [charts] Allow charts highlights to be controlled (#12828) @JCQuintas
55
+ - [charts] Refactor axis band scaleType check (#13295) @JCQuintas
56
+ - [charts] Refactor checkScaleErrors to improve readability and simplify axis message logic (#13305) @JCQuintas
57
+
58
+ ### Tree View
59
+
60
+ #### `@mui/x-tree-view@7.6.0`
61
+
62
+ - [TreeView] Add JSDoc to every instance method (#13219) @flaviendelangle
63
+ - [TreeView] Allow to customize the indentation of nested items (#13225) @flaviendelangle
64
+ - [TreeView] Allow to define indentation at the item level (#13126) @flaviendelangle
65
+
66
+ ### Docs
67
+
68
+ - [docs] Add Bulk editing demo for the Community plan (#12800) @cherniavskii
69
+ - [docs] Add conditional label formatting on tooltip page and link to label page (#13235) @JCQuintas
70
+ - [docs] Add information about key combinations on a11y sections (#13234) @arthurbalduini
71
+ - [docs] Cleanup of the Tree View demos (#13237) @flaviendelangle
72
+ - [docs] Document how to customize a subsection of a line chart (#13210) @alexfauquette
73
+ - [docs] Fix Pickers FAQ callout (#13238) @LukasTy
74
+ - [docs] Fix Vale errors @oliviertassinari
75
+ - [docs] Fix a small typo in property comment (#13245) @Janpot
76
+ - [docs] Improve the Data Grid FAQ page (#13258) @MBilalShafi
77
+ - [docs] Removes unused lines in TreeItem2 styling (#13264) @arthurbalduini
78
+ - [docs] Small improvements on accessibility data grid doc (#13233) @arthurbalduini
79
+ - [docs] Update Pickers demo configurations (#13303) @LukasTy
80
+
81
+ ### Core
82
+
83
+ - [core] Add comment on why logic to sync column header (#13248) @oliviertassinari
84
+ - [core] Fix `l10n` script execution with arguments (#13297) @LukasTy
85
+ - [core] Prevent "Add reviewers" workflow from triggering since it doesn't work (#13236) @JCQuintas
86
+ - [docs-infra] Fix `@mui/material` version used in sandboxes (#13260) @LukasTy
87
+ - [test] Use `describeTreeView` for keyboard navigation tests on disabled items (#13184) @flaviendelangle
88
+ - [test] Use `describeTreeView` for remaining items tests (#13262) @flaviendelangle
89
+ - [test] Use test-utils from npm (#12880) @michaldudak
90
+ - [typescript] Remove duplicate `DateRangePosition` type in favor of `RangePosition` (#13288) @LukasTy
91
+
6
92
  ## v7.5.1
7
93
 
8
94
  _May 23, 2024_
@@ -339,7 +425,7 @@ Same changes as in `@mui/x-date-pickers@7.3.1`.
339
425
  ### Core
340
426
 
341
427
  - [core] Fix `l10n` GH workflow (#12895) @LukasTy
342
- - [core] Match Base UI and Toolpad @oliviertassinari
428
+ - [core] Match Base UI and Toolpad @oliviertassinari
343
429
  - [core] Remove redundant `setupFiles` entries in `package.json` (#12899) @LukasTy
344
430
  - [core] Use `describeTreeView` for focus tests (#12698) @flaviendelangle
345
431
  - [core] Use `describeTreeView` for type-ahead tests (#12811) @flaviendelangle
@@ -73,7 +73,7 @@ DataGridProRaw.propTypes = {
73
73
  */
74
74
  'aria-labelledby': _propTypes.default.string,
75
75
  /**
76
- * If `true`, the Data Grid height is dynamic and follow the number of rows in the Data Grid.
76
+ * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
77
77
  * @default false
78
78
  */
79
79
  autoHeight: _propTypes.default.bool,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { UseGridColumnHeadersProps } from '@mui/x-data-grid/internals';
3
- interface DataGridProColumnHeadersProps extends React.HTMLAttributes<HTMLDivElement>, UseGridColumnHeadersProps {
3
+ export interface GridColumnHeadersProps extends React.HTMLAttributes<HTMLDivElement>, UseGridColumnHeadersProps {
4
4
  }
5
- declare const GridColumnHeaders: React.ForwardRefExoticComponent<DataGridProColumnHeadersProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const GridColumnHeaders: React.ForwardRefExoticComponent<GridColumnHeadersProps & React.RefAttributes<HTMLDivElement>>;
6
6
  export { GridColumnHeaders };
@@ -70,7 +70,12 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
70
70
  const isMenuOpen = menuOpenField === colDef.field;
71
71
 
72
72
  // TODO: Support for `isAnyOf` operator
73
- const filterOperators = colDef.filterOperators?.filter(operator => operator.value !== 'isAnyOf') ?? [];
73
+ const filterOperators = React.useMemo(() => {
74
+ if (!colDef.filterOperators) {
75
+ return [];
76
+ }
77
+ return colDef.filterOperators.filter(operator => operator.value !== 'isAnyOf');
78
+ }, [colDef.filterOperators]);
74
79
  const filterModel = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridFilterModelSelector);
75
80
  const filterableColumnsLookup = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridFilterableColumnLookupSelector);
76
81
  const isFilterReadOnly = React.useMemo(() => {
@@ -80,7 +85,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
80
85
  const filterModelItem = filterModel.items.find(it => it.field === colDef.field);
81
86
  return filterModelItem ? !filterableColumnsLookup[filterModelItem.field] : false;
82
87
  }, [colDef.field, filterModel, filterableColumnsLookup]);
83
- const currentOperator = filterOperators[0];
88
+ const currentOperator = React.useMemo(() => filterOperators.find(operator => operator.value === item.operator) ?? filterOperators[0], [item.operator, filterOperators]);
84
89
  const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent : null;
85
90
  const applyFilterChanges = React.useCallback(updatedItem => {
86
91
  if (item.value && !updatedItem.value) {
@@ -181,9 +186,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
181
186
  showRightBorder
182
187
  });
183
188
  const classes = useUtilityClasses(ownerState);
184
- const isNoInputOperator = filterOperators?.find(({
185
- value
186
- }) => item.operator === value)?.requiresFilterValue === false;
189
+ const isNoInputOperator = currentOperator.requiresFilterValue === false;
187
190
  const isApplied = Boolean(item?.value) || isNoInputOperator;
188
191
  const label = currentOperator.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${(0, _utils.unstable_capitalize)(item.operator)}`);
189
192
  const isFilterActive = isApplied || hasFocus;
@@ -65,7 +65,7 @@ DataGridProRaw.propTypes = {
65
65
  */
66
66
  'aria-labelledby': PropTypes.string,
67
67
  /**
68
- * If `true`, the Data Grid height is dynamic and follow the number of rows in the Data Grid.
68
+ * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
69
69
  * @default false
70
70
  */
71
71
  autoHeight: PropTypes.bool,
@@ -61,7 +61,12 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
61
61
  const isMenuOpen = menuOpenField === colDef.field;
62
62
 
63
63
  // TODO: Support for `isAnyOf` operator
64
- const filterOperators = colDef.filterOperators?.filter(operator => operator.value !== 'isAnyOf') ?? [];
64
+ const filterOperators = React.useMemo(() => {
65
+ if (!colDef.filterOperators) {
66
+ return [];
67
+ }
68
+ return colDef.filterOperators.filter(operator => operator.value !== 'isAnyOf');
69
+ }, [colDef.filterOperators]);
65
70
  const filterModel = useGridSelector(apiRef, gridFilterModelSelector);
66
71
  const filterableColumnsLookup = useGridSelector(apiRef, gridFilterableColumnLookupSelector);
67
72
  const isFilterReadOnly = React.useMemo(() => {
@@ -71,7 +76,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
71
76
  const filterModelItem = filterModel.items.find(it => it.field === colDef.field);
72
77
  return filterModelItem ? !filterableColumnsLookup[filterModelItem.field] : false;
73
78
  }, [colDef.field, filterModel, filterableColumnsLookup]);
74
- const currentOperator = filterOperators[0];
79
+ const currentOperator = React.useMemo(() => filterOperators.find(operator => operator.value === item.operator) ?? filterOperators[0], [item.operator, filterOperators]);
75
80
  const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent : null;
76
81
  const applyFilterChanges = React.useCallback(updatedItem => {
77
82
  if (item.value && !updatedItem.value) {
@@ -172,9 +177,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
172
177
  showRightBorder
173
178
  });
174
179
  const classes = useUtilityClasses(ownerState);
175
- const isNoInputOperator = filterOperators?.find(({
176
- value
177
- }) => item.operator === value)?.requiresFilterValue === false;
180
+ const isNoInputOperator = currentOperator.requiresFilterValue === false;
178
181
  const isApplied = Boolean(item?.value) || isNoInputOperator;
179
182
  const label = currentOperator.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${capitalize(item.operator)}`);
180
183
  const isFilterActive = isApplied || hasFocus;
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcxNjQxNTIwMDAwMA==";
3
+ const releaseInfo = "MTcxNzAxNjQwMDAwMA==";
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/index.d.ts CHANGED
@@ -24,3 +24,4 @@ export { useGridApiContext, useGridApiRef, useGridRootProps } from './typeOverlo
24
24
  export type { GridApi, GridInitialState, GridState } from './typeOverloads/reexports';
25
25
  export { GridColumnMenu, GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS, } from './components/reexports';
26
26
  export { GridColumnHeaders } from './components/GridColumnHeaders';
27
+ export type { GridColumnHeadersProps } from './components/GridColumnHeaders';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v7.5.1
2
+ * @mui/x-data-grid-pro v7.6.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -65,7 +65,7 @@ DataGridProRaw.propTypes = {
65
65
  */
66
66
  'aria-labelledby': PropTypes.string,
67
67
  /**
68
- * If `true`, the Data Grid height is dynamic and follow the number of rows in the Data Grid.
68
+ * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
69
69
  * @default false
70
70
  */
71
71
  autoHeight: PropTypes.bool,
@@ -61,7 +61,12 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
61
61
  const isMenuOpen = menuOpenField === colDef.field;
62
62
 
63
63
  // TODO: Support for `isAnyOf` operator
64
- const filterOperators = colDef.filterOperators?.filter(operator => operator.value !== 'isAnyOf') ?? [];
64
+ const filterOperators = React.useMemo(() => {
65
+ if (!colDef.filterOperators) {
66
+ return [];
67
+ }
68
+ return colDef.filterOperators.filter(operator => operator.value !== 'isAnyOf');
69
+ }, [colDef.filterOperators]);
65
70
  const filterModel = useGridSelector(apiRef, gridFilterModelSelector);
66
71
  const filterableColumnsLookup = useGridSelector(apiRef, gridFilterableColumnLookupSelector);
67
72
  const isFilterReadOnly = React.useMemo(() => {
@@ -71,7 +76,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
71
76
  const filterModelItem = filterModel.items.find(it => it.field === colDef.field);
72
77
  return filterModelItem ? !filterableColumnsLookup[filterModelItem.field] : false;
73
78
  }, [colDef.field, filterModel, filterableColumnsLookup]);
74
- const currentOperator = filterOperators[0];
79
+ const currentOperator = React.useMemo(() => filterOperators.find(operator => operator.value === item.operator) ?? filterOperators[0], [item.operator, filterOperators]);
75
80
  const InputComponent = colDef.filterable || isFilterReadOnly ? currentOperator.InputComponent : null;
76
81
  const applyFilterChanges = React.useCallback(updatedItem => {
77
82
  if (item.value && !updatedItem.value) {
@@ -172,9 +177,7 @@ const GridHeaderFilterCell = /*#__PURE__*/React.forwardRef((props, ref) => {
172
177
  showRightBorder
173
178
  });
174
179
  const classes = useUtilityClasses(ownerState);
175
- const isNoInputOperator = filterOperators?.find(({
176
- value
177
- }) => item.operator === value)?.requiresFilterValue === false;
180
+ const isNoInputOperator = currentOperator.requiresFilterValue === false;
178
181
  const isApplied = Boolean(item?.value) || isNoInputOperator;
179
182
  const label = currentOperator.headerLabel ?? apiRef.current.getLocaleText(`headerFilterOperator${capitalize(item.operator)}`);
180
183
  const isFilterActive = isApplied || hasFocus;
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v7.5.1
2
+ * @mui/x-data-grid-pro v7.6.0
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 = "MTcxNjQxNTIwMDAwMA==";
3
+ const releaseInfo = "MTcxNzAxNjQwMDAwMA==";
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.5.1",
3
+ "version": "7.6.0",
4
4
  "description": "The Pro plan edition of the Data Grid components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -33,15 +33,15 @@
33
33
  "directory": "packages/x-data-grid-pro"
34
34
  },
35
35
  "dependencies": {
36
- "@babel/runtime": "^7.24.5",
37
- "@mui/system": "^5.15.14",
36
+ "@babel/runtime": "^7.24.6",
37
+ "@mui/system": "^5.15.15",
38
38
  "@mui/utils": "^5.15.14",
39
39
  "@types/format-util": "^1.0.4",
40
40
  "clsx": "^2.1.1",
41
41
  "prop-types": "^15.8.1",
42
42
  "reselect": "^4.1.8",
43
- "@mui/x-data-grid": "7.5.1",
44
- "@mui/x-license": "7.2.1"
43
+ "@mui/x-data-grid": "7.6.0",
44
+ "@mui/x-license": "7.6.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@mui/material": "^5.15.14",
@@ -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 = "MTcxNjQxNTIwMDAwMA==";
9
+ const releaseInfo = "MTcxNzAxNjQwMDAwMA==";
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