@mui/x-data-grid-premium 6.16.3 → 6.17.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,72 @@
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
+ ## 6.17.0
7
+
8
+ _Oct 27, 2023_
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
+ - 🎁 The Tree View package is now officially stable!
13
+
14
+ ![tree-view-example](https://github.com/mui/mui-x/assets/550141/77d1fe66-d912-49ba-b38f-b853fb90446a)
15
+
16
+ - ✨ Improve the handling of non-numeric values by Data Grid aggregation
17
+ - 🚀 Support lines with different domains on the line charts
18
+ - 🐞 Bugfixes
19
+ - 📚 Documentation improvements
20
+
21
+ ### Data Grid
22
+
23
+ #### `@mui/x-data-grid@6.17.0`
24
+
25
+ - [DataGrid] Allow custom debounce time for row positions calculation (#10708) @cherniavskii
26
+ - [DataGrid] Persist stable row index for focused row (#10674) @cherniavskii
27
+
28
+ #### `@mui/x-data-grid-pro@6.17.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
29
+
30
+ Same changes as in `@mui/x-data-grid@6.17.0`, plus:
31
+
32
+ - [DataGridPro] Fix `undefined` values passed to `valueFormatter` for tree leaf nodes (#10748) @cherniavskii
33
+
34
+ #### `@mui/x-data-grid-premium@6.17.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@6.17.0`, plus:
37
+
38
+ - [DataGridPremium] Fix `avg` aggregation to ignore non-numeric values (#10787) @cherniavskii
39
+ - [DataGridPremium] Fix `size` aggregation to ignore `undefined` values (#10745) @cherniavskii
40
+ - [DataGridPremium] Fix `sum` aggregation to ignore non-numeric values (#10730) @cherniavskii
41
+ - [DataGridPremium] Fix cell selection throwing index error on second page and beyond (#10784) @MBilalShafi
42
+
43
+ ### Date Pickers
44
+
45
+ #### `@mui/x-date-pickers@6.17.0`
46
+
47
+ - [fields] POC: Use `contentEditable` on `FakeTextField` (#10779) @flaviendelangle
48
+ - [pickers] Fix weekday label localization (#10809) @LukasTy
49
+
50
+ #### `@mui/x-date-pickers-pro@6.17.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
51
+
52
+ Same changes as in `@mui/x-date-pickers@6.17.0`.
53
+
54
+ ### Charts / `@mui/x-charts@6.0.0-alpha.17`
55
+
56
+ - [charts] Fix text position in Safari (#10815) @lhilgert9
57
+ - [charts] Support lines with different domains (#10801) @alexfauquette
58
+
59
+ ### Tree View / `@mui/x-tree-view@6.17.0`
60
+
61
+ No change
62
+
63
+ ### Docs
64
+
65
+ - [docs] Correct editing related props' description (#10798) @MBilalShafi
66
+ - [docs] Fix RTL data grid demo (#10728) @oliviertassinari
67
+ - [docs] Fix unclosed warning (#10796) @flaviendelangle
68
+ - [docs] Improve performance of `Save and restore the state from external storage` recipe (#10811) @michelengelen
69
+
70
+ - [test] Add missing type on `cleanText` utility function (#10780) @flaviendelangle
71
+
6
72
  ## 6.16.3
7
73
 
8
74
  _Oct 20, 2023_
@@ -854,6 +854,13 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
854
854
  * Controls the modes of the rows.
855
855
  */
856
856
  rowModesModel: PropTypes.object,
857
+ /**
858
+ * The milliseconds delay to wait after measuring the row height before recalculating row positions.
859
+ * Setting it to a lower value could be useful when using dynamic row height,
860
+ * but might reduce performance when displaying a large number of rows.
861
+ * @default 166
862
+ */
863
+ rowPositionsDebounceMs: PropTypes.number,
857
864
  /**
858
865
  * If `true`, the reordering of rows is enabled.
859
866
  * @default false
@@ -1,8 +1,8 @@
1
1
  import { GridAggregationFunction } from './gridAggregationInterfaces';
2
2
  export declare const GRID_AGGREGATION_FUNCTIONS: {
3
- sum: GridAggregationFunction<number, number, number>;
4
- avg: GridAggregationFunction<number, number, number>;
3
+ sum: GridAggregationFunction<unknown, number, number>;
4
+ avg: GridAggregationFunction<unknown, number, number>;
5
5
  min: GridAggregationFunction<number | Date, number | Date, number | Date>;
6
6
  max: GridAggregationFunction<number | Date, number | Date, number | Date>;
7
- size: GridAggregationFunction<number, number, number>;
7
+ size: GridAggregationFunction<unknown, number, number>;
8
8
  };
@@ -6,7 +6,7 @@ const sumAgg = {
6
6
  let sum = 0;
7
7
  for (let i = 0; i < values.length; i += 1) {
8
8
  const value = values[i];
9
- if (value != null) {
9
+ if (isNumber(value)) {
10
10
  sum += value;
11
11
  }
12
12
  }
@@ -15,12 +15,22 @@ const sumAgg = {
15
15
  columnTypes: ['number']
16
16
  };
17
17
  const avgAgg = {
18
- apply: params => {
19
- if (params.values.length === 0) {
18
+ apply: ({
19
+ values
20
+ }) => {
21
+ if (values.length === 0) {
20
22
  return null;
21
23
  }
22
- const sum = sumAgg.apply(params);
23
- return sum / params.values.length;
24
+ let sum = 0;
25
+ let valuesCount = 0;
26
+ for (let i = 0; i < values.length; i += 1) {
27
+ const value = values[i];
28
+ if (isNumber(value)) {
29
+ valuesCount += 1;
30
+ sum += value;
31
+ }
32
+ }
33
+ return sum / valuesCount;
24
34
  },
25
35
  columnTypes: ['number']
26
36
  };
@@ -64,7 +74,7 @@ const sizeAgg = {
64
74
  apply: ({
65
75
  values
66
76
  }) => {
67
- return values.length;
77
+ return values.filter(value => typeof value !== 'undefined').length;
68
78
  },
69
79
  valueFormatter: params => {
70
80
  if (params.value == null || !isNumber(params.value)) {
@@ -389,7 +389,7 @@ export const useGridCellSelection = (apiRef, props) => {
389
389
  } else {
390
390
  newClasses.push(gridClasses['cell--rangeTop']);
391
391
  }
392
- if (rowIndex < visibleRows.range.lastRowIndex) {
392
+ if (rowIndex + visibleRows.range.firstRowIndex < visibleRows.range.lastRowIndex) {
393
393
  const {
394
394
  id: nextRowId
395
395
  } = visibleRows.rows[rowIndex + 1];
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v6.16.3
2
+ * @mui/x-data-grid-premium v6.17.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -854,6 +854,13 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
854
854
  * Controls the modes of the rows.
855
855
  */
856
856
  rowModesModel: PropTypes.object,
857
+ /**
858
+ * The milliseconds delay to wait after measuring the row height before recalculating row positions.
859
+ * Setting it to a lower value could be useful when using dynamic row height,
860
+ * but might reduce performance when displaying a large number of rows.
861
+ * @default 166
862
+ */
863
+ rowPositionsDebounceMs: PropTypes.number,
857
864
  /**
858
865
  * If `true`, the reordering of rows is enabled.
859
866
  * @default false
@@ -5,7 +5,7 @@ var sumAgg = {
5
5
  var sum = 0;
6
6
  for (var i = 0; i < values.length; i += 1) {
7
7
  var value = values[i];
8
- if (value != null) {
8
+ if (isNumber(value)) {
9
9
  sum += value;
10
10
  }
11
11
  }
@@ -14,18 +14,27 @@ var sumAgg = {
14
14
  columnTypes: ['number']
15
15
  };
16
16
  var avgAgg = {
17
- apply: function apply(params) {
18
- if (params.values.length === 0) {
17
+ apply: function apply(_ref2) {
18
+ var values = _ref2.values;
19
+ if (values.length === 0) {
19
20
  return null;
20
21
  }
21
- var sum = sumAgg.apply(params);
22
- return sum / params.values.length;
22
+ var sum = 0;
23
+ var valuesCount = 0;
24
+ for (var i = 0; i < values.length; i += 1) {
25
+ var value = values[i];
26
+ if (isNumber(value)) {
27
+ valuesCount += 1;
28
+ sum += value;
29
+ }
30
+ }
31
+ return sum / valuesCount;
23
32
  },
24
33
  columnTypes: ['number']
25
34
  };
26
35
  var minAgg = {
27
- apply: function apply(_ref2) {
28
- var values = _ref2.values;
36
+ apply: function apply(_ref3) {
37
+ var values = _ref3.values;
29
38
  if (values.length === 0) {
30
39
  return null;
31
40
  }
@@ -41,8 +50,8 @@ var minAgg = {
41
50
  columnTypes: ['number', 'date', 'dateTime']
42
51
  };
43
52
  var maxAgg = {
44
- apply: function apply(_ref3) {
45
- var values = _ref3.values;
53
+ apply: function apply(_ref4) {
54
+ var values = _ref4.values;
46
55
  if (values.length === 0) {
47
56
  return null;
48
57
  }
@@ -58,9 +67,11 @@ var maxAgg = {
58
67
  columnTypes: ['number', 'date', 'dateTime']
59
68
  };
60
69
  var sizeAgg = {
61
- apply: function apply(_ref4) {
62
- var values = _ref4.values;
63
- return values.length;
70
+ apply: function apply(_ref5) {
71
+ var values = _ref5.values;
72
+ return values.filter(function (value) {
73
+ return typeof value !== 'undefined';
74
+ }).length;
64
75
  },
65
76
  valueFormatter: function valueFormatter(params) {
66
77
  if (params.value == null || !isNumber(params.value)) {
@@ -380,7 +380,7 @@ export var useGridCellSelection = function useGridCellSelection(apiRef, props) {
380
380
  } else {
381
381
  newClasses.push(gridClasses['cell--rangeTop']);
382
382
  }
383
- if (rowIndex < visibleRows.range.lastRowIndex) {
383
+ if (rowIndex + visibleRows.range.firstRowIndex < visibleRows.range.lastRowIndex) {
384
384
  var nextRowId = visibleRows.rows[rowIndex + 1].id;
385
385
  if (!apiRef.current.unstable_isCellSelected(nextRowId, field)) {
386
386
  newClasses.push(gridClasses['cell--rangeBottom']);
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v6.16.3
2
+ * @mui/x-data-grid-premium v6.17.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 var getReleaseInfo = function getReleaseInfo() {
3
- var releaseInfo = "MTY5Nzc3NDQwMDAwMA==";
3
+ var releaseInfo = "MTY5ODM1NzYwMDAwMA==";
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
@@ -854,6 +854,13 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
854
854
  * Controls the modes of the rows.
855
855
  */
856
856
  rowModesModel: PropTypes.object,
857
+ /**
858
+ * The milliseconds delay to wait after measuring the row height before recalculating row positions.
859
+ * Setting it to a lower value could be useful when using dynamic row height,
860
+ * but might reduce performance when displaying a large number of rows.
861
+ * @default 166
862
+ */
863
+ rowPositionsDebounceMs: PropTypes.number,
857
864
  /**
858
865
  * If `true`, the reordering of rows is enabled.
859
866
  * @default false
@@ -6,7 +6,7 @@ const sumAgg = {
6
6
  let sum = 0;
7
7
  for (let i = 0; i < values.length; i += 1) {
8
8
  const value = values[i];
9
- if (value != null) {
9
+ if (isNumber(value)) {
10
10
  sum += value;
11
11
  }
12
12
  }
@@ -15,12 +15,22 @@ const sumAgg = {
15
15
  columnTypes: ['number']
16
16
  };
17
17
  const avgAgg = {
18
- apply: params => {
19
- if (params.values.length === 0) {
18
+ apply: ({
19
+ values
20
+ }) => {
21
+ if (values.length === 0) {
20
22
  return null;
21
23
  }
22
- const sum = sumAgg.apply(params);
23
- return sum / params.values.length;
24
+ let sum = 0;
25
+ let valuesCount = 0;
26
+ for (let i = 0; i < values.length; i += 1) {
27
+ const value = values[i];
28
+ if (isNumber(value)) {
29
+ valuesCount += 1;
30
+ sum += value;
31
+ }
32
+ }
33
+ return sum / valuesCount;
24
34
  },
25
35
  columnTypes: ['number']
26
36
  };
@@ -64,7 +74,7 @@ const sizeAgg = {
64
74
  apply: ({
65
75
  values
66
76
  }) => {
67
- return values.length;
77
+ return values.filter(value => typeof value !== 'undefined').length;
68
78
  },
69
79
  valueFormatter: params => {
70
80
  if (params.value == null || !isNumber(params.value)) {
@@ -380,7 +380,7 @@ export const useGridCellSelection = (apiRef, props) => {
380
380
  } else {
381
381
  newClasses.push(gridClasses['cell--rangeTop']);
382
382
  }
383
- if (rowIndex < visibleRows.range.lastRowIndex) {
383
+ if (rowIndex + visibleRows.range.firstRowIndex < visibleRows.range.lastRowIndex) {
384
384
  const {
385
385
  id: nextRowId
386
386
  } = visibleRows.rows[rowIndex + 1];
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v6.16.3
2
+ * @mui/x-data-grid-premium v6.17.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 = "MTY5Nzc3NDQwMDAwMA==";
3
+ const releaseInfo = "MTY5ODM1NzYwMDAwMA==";
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
@@ -862,6 +862,13 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
862
862
  * Controls the modes of the rows.
863
863
  */
864
864
  rowModesModel: _propTypes.default.object,
865
+ /**
866
+ * The milliseconds delay to wait after measuring the row height before recalculating row positions.
867
+ * Setting it to a lower value could be useful when using dynamic row height,
868
+ * but might reduce performance when displaying a large number of rows.
869
+ * @default 166
870
+ */
871
+ rowPositionsDebounceMs: _propTypes.default.number,
865
872
  /**
866
873
  * If `true`, the reordering of rows is enabled.
867
874
  * @default false
@@ -12,7 +12,7 @@ const sumAgg = {
12
12
  let sum = 0;
13
13
  for (let i = 0; i < values.length; i += 1) {
14
14
  const value = values[i];
15
- if (value != null) {
15
+ if ((0, _internals.isNumber)(value)) {
16
16
  sum += value;
17
17
  }
18
18
  }
@@ -21,12 +21,22 @@ const sumAgg = {
21
21
  columnTypes: ['number']
22
22
  };
23
23
  const avgAgg = {
24
- apply: params => {
25
- if (params.values.length === 0) {
24
+ apply: ({
25
+ values
26
+ }) => {
27
+ if (values.length === 0) {
26
28
  return null;
27
29
  }
28
- const sum = sumAgg.apply(params);
29
- return sum / params.values.length;
30
+ let sum = 0;
31
+ let valuesCount = 0;
32
+ for (let i = 0; i < values.length; i += 1) {
33
+ const value = values[i];
34
+ if ((0, _internals.isNumber)(value)) {
35
+ valuesCount += 1;
36
+ sum += value;
37
+ }
38
+ }
39
+ return sum / valuesCount;
30
40
  },
31
41
  columnTypes: ['number']
32
42
  };
@@ -70,7 +80,7 @@ const sizeAgg = {
70
80
  apply: ({
71
81
  values
72
82
  }) => {
73
- return values.length;
83
+ return values.filter(value => typeof value !== 'undefined').length;
74
84
  },
75
85
  valueFormatter: params => {
76
86
  if (params.value == null || !(0, _internals.isNumber)(params.value)) {
@@ -390,7 +390,7 @@ const useGridCellSelection = (apiRef, props) => {
390
390
  } else {
391
391
  newClasses.push(_xDataGridPro.gridClasses['cell--rangeTop']);
392
392
  }
393
- if (rowIndex < visibleRows.range.lastRowIndex) {
393
+ if (rowIndex + visibleRows.range.firstRowIndex < visibleRows.range.lastRowIndex) {
394
394
  const {
395
395
  id: nextRowId
396
396
  } = visibleRows.rows[rowIndex + 1];
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v6.16.3
2
+ * @mui/x-data-grid-premium v6.17.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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 = "MTY5Nzc3NDQwMDAwMA==";
9
+ const releaseInfo = "MTY5ODM1NzYwMDAwMA==";
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-premium",
3
- "version": "6.16.3",
3
+ "version": "6.17.0",
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,10 +33,10 @@
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.23.2",
35
35
  "@mui/utils": "^5.14.14",
36
- "@mui/x-data-grid": "6.16.3",
37
- "@mui/x-data-grid-pro": "6.16.3",
36
+ "@mui/x-data-grid": "6.17.0",
37
+ "@mui/x-data-grid-pro": "6.17.0",
38
38
  "@mui/x-license-pro": "6.10.2",
39
- "@types/format-util": "^1.0.2",
39
+ "@types/format-util": "^1.0.3",
40
40
  "clsx": "^2.0.0",
41
41
  "exceljs": "^4.3.0",
42
42
  "prop-types": "^15.8.1",
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTY5Nzc3NDQwMDAwMA==";
3
+ const releaseInfo = "MTY5ODM1NzYwMDAwMA==";
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