@mui/x-data-grid-premium 5.17.18 → 5.17.19
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 +25 -0
- package/hooks/features/export/serializer/excelSerializer.js +32 -6
- package/index.js +1 -1
- package/legacy/hooks/features/export/serializer/excelSerializer.js +32 -6
- package/legacy/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/modern/hooks/features/export/serializer/excelSerializer.js +32 -4
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/hooks/features/export/serializer/excelSerializer.js +31 -5
- package/node/index.js +1 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +3 -3
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
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.17.19
|
|
7
|
+
|
|
8
|
+
_Jan 16, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Improve Spanish (es-ES) and add Belarusian (be-BY) and Urdu (ur-PK) locales
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
|
|
15
|
+
### `@mui/x-data-grid@v5.17.19` / `@mui/x-data-grid-pro@v5.17.19` / `@mui/x-data-grid-premium@v5.17.19`
|
|
16
|
+
|
|
17
|
+
#### Changes
|
|
18
|
+
|
|
19
|
+
- [DataGrid] Improve print support (#7407) @cherniavskii
|
|
20
|
+
- [DataGrid] Improve Spanish (es-ES) locale (#7438) @Anderssxn
|
|
21
|
+
- [DataGridPremium] Fix Excel export not working with date strings (#7478) @cherniavskii
|
|
22
|
+
- [DataGridPro] Fix missing column headers border with top-pinned rows (#7399) @cherniavskii
|
|
23
|
+
|
|
24
|
+
### `@mui/x-date-pickers@v5.0.14` / `@mui/x-date-pickers-pro@v5.0.14`
|
|
25
|
+
|
|
26
|
+
#### Changes
|
|
27
|
+
|
|
28
|
+
- [pickers] Add Belarusian (be-BY) locale (#7450) @volhalink
|
|
29
|
+
- [pickers] Add Urdu (ur-PK) locale (#7449) @MBilalShafi
|
|
30
|
+
|
|
6
31
|
## 5.17.18
|
|
7
32
|
|
|
8
33
|
_Jan 5, 2023_
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { buildWarning } from '@mui/x-data-grid/internals';
|
|
3
|
+
import { buildWarning, isObject } from '@mui/x-data-grid/internals';
|
|
4
4
|
|
|
5
5
|
const getExcelJs = async () => {
|
|
6
6
|
var _excelJsModule$defaul;
|
|
@@ -36,6 +36,8 @@ const getFormattedValueOptions = (colDef, valueOptions, api) => {
|
|
|
36
36
|
return valueOptionsFormatted.map(option => typeof option === 'object' ? option.label : option);
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
let invalidDateValueWarnedOnce = false;
|
|
40
|
+
|
|
39
41
|
const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
40
42
|
const row = {};
|
|
41
43
|
const dataValidation = {};
|
|
@@ -68,8 +70,6 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
68
70
|
switch (cellParams.colDef.type) {
|
|
69
71
|
case 'singleSelect':
|
|
70
72
|
{
|
|
71
|
-
var _formattedValue$label;
|
|
72
|
-
|
|
73
73
|
if (typeof cellParams.colDef.valueOptions === 'function') {
|
|
74
74
|
// If value option depends on the row, set specific options to the cell
|
|
75
75
|
// This dataValidation is buggy with LibreOffice and does not allow to have coma
|
|
@@ -101,7 +101,12 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
if (isObject(formattedValue)) {
|
|
105
|
+
row[column.field] = formattedValue == null ? void 0 : formattedValue.label;
|
|
106
|
+
} else {
|
|
107
|
+
row[column.field] = formattedValue;
|
|
108
|
+
}
|
|
109
|
+
|
|
105
110
|
break;
|
|
106
111
|
}
|
|
107
112
|
|
|
@@ -116,12 +121,33 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
116
121
|
// Excel does not do any timezone conversion, so we create a date using UTC instead of local timezone
|
|
117
122
|
// Solution from: https://github.com/exceljs/exceljs/issues/486#issuecomment-432557582
|
|
118
123
|
// About Date.UTC(): https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC#exemples
|
|
119
|
-
const
|
|
124
|
+
const value = api.getCellParams(id, column.field).value; // value may be `undefined` in auto-generated grouping rows
|
|
120
125
|
|
|
121
|
-
if (!
|
|
126
|
+
if (!value) {
|
|
122
127
|
break;
|
|
123
128
|
}
|
|
124
129
|
|
|
130
|
+
let date;
|
|
131
|
+
|
|
132
|
+
if (value instanceof Date) {
|
|
133
|
+
date = value;
|
|
134
|
+
} else {
|
|
135
|
+
const valueString = (value != null ? value : '').toString();
|
|
136
|
+
date = new Date(valueString);
|
|
137
|
+
|
|
138
|
+
if (Number.isNaN(date.getTime())) {
|
|
139
|
+
// Invalid date
|
|
140
|
+
row[column.field] = valueString;
|
|
141
|
+
|
|
142
|
+
if (process.env.NODE_ENV !== 'production' && !invalidDateValueWarnedOnce) {
|
|
143
|
+
console.warn([`MUI: The cell value "${value}" not a valid value for the \`${column.type}\` column type.`, `Row id: ${id}, field: ${column.field}.`, `This value will be exported as is in the Excel file.`].join('\n'));
|
|
144
|
+
invalidDateValueWarnedOnce = true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
125
151
|
const utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
|
|
126
152
|
row[column.field] = utcDate;
|
|
127
153
|
break;
|
package/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var _defaultColumnsStyles;
|
|
|
8
8
|
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from '@mui/x-data-grid-pro';
|
|
11
|
-
import { buildWarning } from '@mui/x-data-grid/internals';
|
|
11
|
+
import { buildWarning, isObject } from '@mui/x-data-grid/internals';
|
|
12
12
|
|
|
13
13
|
var getExcelJs = /*#__PURE__*/function () {
|
|
14
14
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -68,6 +68,8 @@ var getFormattedValueOptions = function getFormattedValueOptions(colDef, valueOp
|
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
+
var invalidDateValueWarnedOnce = false;
|
|
72
|
+
|
|
71
73
|
var serializeRow = function serializeRow(id, columns, api, defaultValueOptionsFormulae) {
|
|
72
74
|
var row = {};
|
|
73
75
|
var dataValidation = {};
|
|
@@ -100,8 +102,6 @@ var serializeRow = function serializeRow(id, columns, api, defaultValueOptionsFo
|
|
|
100
102
|
switch (cellParams.colDef.type) {
|
|
101
103
|
case 'singleSelect':
|
|
102
104
|
{
|
|
103
|
-
var _formattedValue$label;
|
|
104
|
-
|
|
105
105
|
if (typeof cellParams.colDef.valueOptions === 'function') {
|
|
106
106
|
// If value option depends on the row, set specific options to the cell
|
|
107
107
|
// This dataValidation is buggy with LibreOffice and does not allow to have coma
|
|
@@ -135,7 +135,12 @@ var serializeRow = function serializeRow(id, columns, api, defaultValueOptionsFo
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
if (isObject(formattedValue)) {
|
|
139
|
+
row[column.field] = formattedValue == null ? void 0 : formattedValue.label;
|
|
140
|
+
} else {
|
|
141
|
+
row[column.field] = formattedValue;
|
|
142
|
+
}
|
|
143
|
+
|
|
139
144
|
break;
|
|
140
145
|
}
|
|
141
146
|
|
|
@@ -150,12 +155,33 @@ var serializeRow = function serializeRow(id, columns, api, defaultValueOptionsFo
|
|
|
150
155
|
// Excel does not do any timezone conversion, so we create a date using UTC instead of local timezone
|
|
151
156
|
// Solution from: https://github.com/exceljs/exceljs/issues/486#issuecomment-432557582
|
|
152
157
|
// About Date.UTC(): https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC#exemples
|
|
153
|
-
var
|
|
158
|
+
var value = api.getCellParams(id, column.field).value; // value may be `undefined` in auto-generated grouping rows
|
|
154
159
|
|
|
155
|
-
if (!
|
|
160
|
+
if (!value) {
|
|
156
161
|
break;
|
|
157
162
|
}
|
|
158
163
|
|
|
164
|
+
var date;
|
|
165
|
+
|
|
166
|
+
if (value instanceof Date) {
|
|
167
|
+
date = value;
|
|
168
|
+
} else {
|
|
169
|
+
var valueString = (value != null ? value : '').toString();
|
|
170
|
+
date = new Date(valueString);
|
|
171
|
+
|
|
172
|
+
if (Number.isNaN(date.getTime())) {
|
|
173
|
+
// Invalid date
|
|
174
|
+
row[column.field] = valueString;
|
|
175
|
+
|
|
176
|
+
if (process.env.NODE_ENV !== 'production' && !invalidDateValueWarnedOnce) {
|
|
177
|
+
console.warn(["MUI: The cell value \"".concat(value, "\" not a valid value for the `").concat(column.type, "` column type."), "Row id: ".concat(id, ", field: ").concat(column.field, "."), "This value will be exported as is in the Excel file."].join('\n'));
|
|
178
|
+
invalidDateValueWarnedOnce = true;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
159
185
|
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
|
|
160
186
|
row[column.field] = utcDate;
|
|
161
187
|
break;
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY3MzgyMDAwMDAwMA==";
|
|
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).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from '@mui/x-data-grid-pro';
|
|
3
|
-
import { buildWarning } from '@mui/x-data-grid/internals';
|
|
3
|
+
import { buildWarning, isObject } from '@mui/x-data-grid/internals';
|
|
4
4
|
|
|
5
5
|
const getExcelJs = async () => {
|
|
6
6
|
const excelJsModule = await import('exceljs');
|
|
@@ -34,6 +34,8 @@ const getFormattedValueOptions = (colDef, valueOptions, api) => {
|
|
|
34
34
|
return valueOptionsFormatted.map(option => typeof option === 'object' ? option.label : option);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
let invalidDateValueWarnedOnce = false;
|
|
38
|
+
|
|
37
39
|
const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
38
40
|
const row = {};
|
|
39
41
|
const dataValidation = {};
|
|
@@ -97,7 +99,12 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
if (isObject(formattedValue)) {
|
|
103
|
+
row[column.field] = formattedValue?.label;
|
|
104
|
+
} else {
|
|
105
|
+
row[column.field] = formattedValue;
|
|
106
|
+
}
|
|
107
|
+
|
|
101
108
|
break;
|
|
102
109
|
}
|
|
103
110
|
|
|
@@ -112,12 +119,33 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
112
119
|
// Excel does not do any timezone conversion, so we create a date using UTC instead of local timezone
|
|
113
120
|
// Solution from: https://github.com/exceljs/exceljs/issues/486#issuecomment-432557582
|
|
114
121
|
// About Date.UTC(): https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC#exemples
|
|
115
|
-
const
|
|
122
|
+
const value = api.getCellParams(id, column.field).value; // value may be `undefined` in auto-generated grouping rows
|
|
116
123
|
|
|
117
|
-
if (!
|
|
124
|
+
if (!value) {
|
|
118
125
|
break;
|
|
119
126
|
}
|
|
120
127
|
|
|
128
|
+
let date;
|
|
129
|
+
|
|
130
|
+
if (value instanceof Date) {
|
|
131
|
+
date = value;
|
|
132
|
+
} else {
|
|
133
|
+
const valueString = (value ?? '').toString();
|
|
134
|
+
date = new Date(valueString);
|
|
135
|
+
|
|
136
|
+
if (Number.isNaN(date.getTime())) {
|
|
137
|
+
// Invalid date
|
|
138
|
+
row[column.field] = valueString;
|
|
139
|
+
|
|
140
|
+
if (process.env.NODE_ENV !== 'production' && !invalidDateValueWarnedOnce) {
|
|
141
|
+
console.warn([`MUI: The cell value "${value}" not a valid value for the \`${column.type}\` column type.`, `Row id: ${id}, field: ${column.field}.`, `This value will be exported as is in the Excel file.`].join('\n'));
|
|
142
|
+
invalidDateValueWarnedOnce = true;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
121
149
|
const utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
|
|
122
150
|
row[column.field] = utcDate;
|
|
123
151
|
break;
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY3MzgyMDAwMDAwMA==";
|
|
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).
|
|
@@ -51,6 +51,8 @@ const getFormattedValueOptions = (colDef, valueOptions, api) => {
|
|
|
51
51
|
return valueOptionsFormatted.map(option => typeof option === 'object' ? option.label : option);
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
let invalidDateValueWarnedOnce = false;
|
|
55
|
+
|
|
54
56
|
const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
55
57
|
const row = {};
|
|
56
58
|
const dataValidation = {};
|
|
@@ -83,8 +85,6 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
83
85
|
switch (cellParams.colDef.type) {
|
|
84
86
|
case 'singleSelect':
|
|
85
87
|
{
|
|
86
|
-
var _formattedValue$label;
|
|
87
|
-
|
|
88
88
|
if (typeof cellParams.colDef.valueOptions === 'function') {
|
|
89
89
|
// If value option depends on the row, set specific options to the cell
|
|
90
90
|
// This dataValidation is buggy with LibreOffice and does not allow to have coma
|
|
@@ -116,7 +116,12 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
if ((0, _internals.isObject)(formattedValue)) {
|
|
120
|
+
row[column.field] = formattedValue == null ? void 0 : formattedValue.label;
|
|
121
|
+
} else {
|
|
122
|
+
row[column.field] = formattedValue;
|
|
123
|
+
}
|
|
124
|
+
|
|
120
125
|
break;
|
|
121
126
|
}
|
|
122
127
|
|
|
@@ -131,12 +136,33 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
131
136
|
// Excel does not do any timezone conversion, so we create a date using UTC instead of local timezone
|
|
132
137
|
// Solution from: https://github.com/exceljs/exceljs/issues/486#issuecomment-432557582
|
|
133
138
|
// About Date.UTC(): https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC#exemples
|
|
134
|
-
const
|
|
139
|
+
const value = api.getCellParams(id, column.field).value; // value may be `undefined` in auto-generated grouping rows
|
|
135
140
|
|
|
136
|
-
if (!
|
|
141
|
+
if (!value) {
|
|
137
142
|
break;
|
|
138
143
|
}
|
|
139
144
|
|
|
145
|
+
let date;
|
|
146
|
+
|
|
147
|
+
if (value instanceof Date) {
|
|
148
|
+
date = value;
|
|
149
|
+
} else {
|
|
150
|
+
const valueString = (value != null ? value : '').toString();
|
|
151
|
+
date = new Date(valueString);
|
|
152
|
+
|
|
153
|
+
if (Number.isNaN(date.getTime())) {
|
|
154
|
+
// Invalid date
|
|
155
|
+
row[column.field] = valueString;
|
|
156
|
+
|
|
157
|
+
if (process.env.NODE_ENV !== 'production' && !invalidDateValueWarnedOnce) {
|
|
158
|
+
console.warn([`MUI: The cell value "${value}" not a valid value for the \`${column.type}\` column type.`, `Row id: ${id}, field: ${column.field}.`, `This value will be exported as is in the Excel file.`].join('\n'));
|
|
159
|
+
invalidDateValueWarnedOnce = true;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
140
166
|
const utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
|
|
141
167
|
row[column.field] = utcDate;
|
|
142
168
|
break;
|
package/node/index.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.getReleaseInfo = void 0;
|
|
|
8
8
|
var _utils = require("@mui/utils");
|
|
9
9
|
|
|
10
10
|
const getReleaseInfo = () => {
|
|
11
|
-
const releaseInfo = "
|
|
11
|
+
const releaseInfo = "MTY3MzgyMDAwMDAwMA==";
|
|
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.17.
|
|
3
|
+
"version": "5.17.19",
|
|
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,8 +33,8 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.18.9",
|
|
35
35
|
"@mui/utils": "^5.10.3",
|
|
36
|
-
"@mui/x-data-grid": "5.17.
|
|
37
|
-
"@mui/x-data-grid-pro": "5.17.
|
|
36
|
+
"@mui/x-data-grid": "5.17.19",
|
|
37
|
+
"@mui/x-data-grid-pro": "5.17.19",
|
|
38
38
|
"@mui/x-license-pro": "5.17.12",
|
|
39
39
|
"@types/format-util": "^1.0.2",
|
|
40
40
|
"clsx": "^1.2.1",
|
package/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY3MzgyMDAwMDAwMA==";
|
|
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).
|