@mui/x-data-grid-generator 5.15.1 → 5.15.2
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 +44 -0
- package/index.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/renderer/renderEditStatus.js +45 -19
- package/modern/index.js +1 -1
- package/modern/renderer/renderEditStatus.js +15 -13
- package/node/index.js +1 -1
- package/node/renderer/renderEditStatus.js +14 -12
- package/package.json +2 -2
- package/renderer/renderEditStatus.js +15 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,50 @@
|
|
|
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.2
|
|
7
|
+
|
|
8
|
+
_Aug 11, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ✨ Improve quick filtering with row grouping (#5701) @alexfauquette
|
|
13
|
+
- 📚 Documentation improvements
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@5.15.2` / `@mui/x-data-grid-pro@5.15.2` / `@mui/x-data-grid-premium@5.15.2`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Catch errors if rows freezing is not supported (#5711) @cherniavskii
|
|
21
|
+
- [DataGrid] Preserve cell mode when entering edit mode while commiting (#5686) @m4theushw
|
|
22
|
+
- [DataGridPremium] Let quick filter search in row grouping children (#5701) @alexfauquette
|
|
23
|
+
|
|
24
|
+
### `@mui/x-date-pickers@v5.0.0-beta.5` / `@mui/x-date-picker-pro@5.0.0-beta.5`
|
|
25
|
+
|
|
26
|
+
#### Changes
|
|
27
|
+
|
|
28
|
+
- [pickers] Add `react-dom` to peerDependencies (#5752) @cherniavskii
|
|
29
|
+
- [TimePicker] Set clock focus outline to `none` (#5758) @LukasTy
|
|
30
|
+
- [pickers] Fix theme augmentation with TypeScript (#5596) @alexfauquette
|
|
31
|
+
- [pickers] Reset input value when locale is modified (#5310) @alexfauquette
|
|
32
|
+
- [pickers] Support `disableHighlightToday` on `MonthPicker` and `YearPicker` (#5562) @flaviendelangle
|
|
33
|
+
- [pickers] Fallback to desktop mode when `matchMedia` is unavailable (#5684) @LukasTy
|
|
34
|
+
- [pickers] Trigger `onChange` when clearing or accepting `Invalid date` (#5740) @LukasTy
|
|
35
|
+
|
|
36
|
+
### Docs
|
|
37
|
+
|
|
38
|
+
- [docs] Add RFC GH issue template (#5739) @bytasv
|
|
39
|
+
- [docs] Add description to the `GridExportStateParams` page (#5654) @oliviertassinari
|
|
40
|
+
- [docs] Improve the Events page (#5413) @flaviendelangle
|
|
41
|
+
- [docs] Use new editing API in the introduction demos (#5728) @oliviertassinari
|
|
42
|
+
|
|
43
|
+
### Core
|
|
44
|
+
|
|
45
|
+
- [core] Remove duplicated `FUNDING.yml` file (#5656) @oliviertassinari
|
|
46
|
+
- [core] Remove outdated Next.js options (#5727) @oliviertassinari
|
|
47
|
+
- [core] Update tooling to run with React 18 (#4155) @m4theushw
|
|
48
|
+
- [test] Fix failing dynamic row height tests on Edge (#5707) @m4theushw
|
|
49
|
+
|
|
6
50
|
## 5.15.1
|
|
7
51
|
|
|
8
52
|
_Aug 4, 2022_
|
package/index.js
CHANGED
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
4
|
import * as React from 'react';
|
|
3
|
-
import { useGridApiContext } from '@mui/x-data-grid-premium';
|
|
5
|
+
import { useGridApiContext, useGridRootProps, GridEditModes } from '@mui/x-data-grid-premium';
|
|
4
6
|
import Select from '@mui/material/Select';
|
|
5
7
|
import MenuItem from '@mui/material/MenuItem';
|
|
6
8
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
@@ -17,30 +19,54 @@ function EditStatus(props) {
|
|
|
17
19
|
var id = props.id,
|
|
18
20
|
value = props.value,
|
|
19
21
|
field = props.field;
|
|
22
|
+
var rootProps = useGridRootProps();
|
|
20
23
|
var apiRef = useGridApiContext();
|
|
21
24
|
|
|
22
|
-
var handleChange = function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
var handleChange = /*#__PURE__*/function () {
|
|
26
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
27
|
+
var isValid;
|
|
28
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
29
|
+
while (1) {
|
|
30
|
+
switch (_context.prev = _context.next) {
|
|
31
|
+
case 0:
|
|
32
|
+
_context.next = 2;
|
|
33
|
+
return apiRef.current.setEditCellValue({
|
|
34
|
+
id: id,
|
|
35
|
+
field: field,
|
|
36
|
+
value: event.target.value
|
|
37
|
+
});
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
case 2:
|
|
40
|
+
isValid = _context.sent;
|
|
41
|
+
|
|
42
|
+
if (isValid && rootProps.editMode === GridEditModes.Cell) {
|
|
43
|
+
apiRef.current.stopCellEditMode({
|
|
44
|
+
id: id,
|
|
45
|
+
field: field,
|
|
46
|
+
cellToFocusAfter: 'below'
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
case 4:
|
|
51
|
+
case "end":
|
|
52
|
+
return _context.stop();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}, _callee);
|
|
56
|
+
}));
|
|
57
|
+
|
|
58
|
+
return function handleChange(_x) {
|
|
59
|
+
return _ref.apply(this, arguments);
|
|
60
|
+
};
|
|
61
|
+
}();
|
|
40
62
|
|
|
41
63
|
var handleClose = function handleClose(event, reason) {
|
|
42
64
|
if (reason === 'backdropClick') {
|
|
43
|
-
apiRef.current.
|
|
65
|
+
apiRef.current.stopCellEditMode({
|
|
66
|
+
id: id,
|
|
67
|
+
field: field,
|
|
68
|
+
ignoreModifications: true
|
|
69
|
+
});
|
|
44
70
|
}
|
|
45
71
|
};
|
|
46
72
|
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useGridApiContext } from '@mui/x-data-grid-premium';
|
|
3
|
+
import { useGridApiContext, useGridRootProps, GridEditModes } from '@mui/x-data-grid-premium';
|
|
4
4
|
import Select from '@mui/material/Select';
|
|
5
5
|
import MenuItem from '@mui/material/MenuItem';
|
|
6
6
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
@@ -19,30 +19,32 @@ function EditStatus(props) {
|
|
|
19
19
|
value,
|
|
20
20
|
field
|
|
21
21
|
} = props;
|
|
22
|
+
const rootProps = useGridRootProps();
|
|
22
23
|
const apiRef = useGridApiContext();
|
|
23
24
|
|
|
24
|
-
const handleChange = event => {
|
|
25
|
-
apiRef.current.setEditCellValue({
|
|
25
|
+
const handleChange = async event => {
|
|
26
|
+
const isValid = await apiRef.current.setEditCellValue({
|
|
26
27
|
id,
|
|
27
28
|
field,
|
|
28
29
|
value: event.target.value
|
|
29
|
-
}, event);
|
|
30
|
-
apiRef.current.commitCellChange({
|
|
31
|
-
id,
|
|
32
|
-
field
|
|
33
30
|
});
|
|
34
|
-
apiRef.current.setCellMode(id, field, 'view');
|
|
35
31
|
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
if (isValid && rootProps.editMode === GridEditModes.Cell) {
|
|
33
|
+
apiRef.current.stopCellEditMode({
|
|
34
|
+
id,
|
|
35
|
+
field,
|
|
36
|
+
cellToFocusAfter: 'below'
|
|
37
|
+
});
|
|
40
38
|
}
|
|
41
39
|
};
|
|
42
40
|
|
|
43
41
|
const handleClose = (event, reason) => {
|
|
44
42
|
if (reason === 'backdropClick') {
|
|
45
|
-
apiRef.current.
|
|
43
|
+
apiRef.current.stopCellEditMode({
|
|
44
|
+
id,
|
|
45
|
+
field,
|
|
46
|
+
ignoreModifications: true
|
|
47
|
+
});
|
|
46
48
|
}
|
|
47
49
|
};
|
|
48
50
|
|
package/node/index.js
CHANGED
|
@@ -43,30 +43,32 @@ function EditStatus(props) {
|
|
|
43
43
|
value,
|
|
44
44
|
field
|
|
45
45
|
} = props;
|
|
46
|
+
const rootProps = (0, _xDataGridPremium.useGridRootProps)();
|
|
46
47
|
const apiRef = (0, _xDataGridPremium.useGridApiContext)();
|
|
47
48
|
|
|
48
|
-
const handleChange = event => {
|
|
49
|
-
apiRef.current.setEditCellValue({
|
|
49
|
+
const handleChange = async event => {
|
|
50
|
+
const isValid = await apiRef.current.setEditCellValue({
|
|
50
51
|
id,
|
|
51
52
|
field,
|
|
52
53
|
value: event.target.value
|
|
53
|
-
}, event);
|
|
54
|
-
apiRef.current.commitCellChange({
|
|
55
|
-
id,
|
|
56
|
-
field
|
|
57
54
|
});
|
|
58
|
-
apiRef.current.setCellMode(id, field, 'view');
|
|
59
55
|
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
if (isValid && rootProps.editMode === _xDataGridPremium.GridEditModes.Cell) {
|
|
57
|
+
apiRef.current.stopCellEditMode({
|
|
58
|
+
id,
|
|
59
|
+
field,
|
|
60
|
+
cellToFocusAfter: 'below'
|
|
61
|
+
});
|
|
64
62
|
}
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
const handleClose = (event, reason) => {
|
|
68
66
|
if (reason === 'backdropClick') {
|
|
69
|
-
apiRef.current.
|
|
67
|
+
apiRef.current.stopCellEditMode({
|
|
68
|
+
id,
|
|
69
|
+
field,
|
|
70
|
+
ignoreModifications: true
|
|
71
|
+
});
|
|
70
72
|
}
|
|
71
73
|
};
|
|
72
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-generator",
|
|
3
|
-
"version": "5.15.
|
|
3
|
+
"version": "5.15.2",
|
|
4
4
|
"description": "Generate fake data for demo purposes only.",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.18.6",
|
|
23
23
|
"@mui/base": "^5.0.0-alpha.80",
|
|
24
|
-
"@mui/x-data-grid-premium": "5.15.
|
|
24
|
+
"@mui/x-data-grid-premium": "5.15.2",
|
|
25
25
|
"chance": "^1.1.8",
|
|
26
26
|
"clsx": "^1.2.1",
|
|
27
27
|
"lru-cache": "^7.13.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useGridApiContext } from '@mui/x-data-grid-premium';
|
|
3
|
+
import { useGridApiContext, useGridRootProps, GridEditModes } from '@mui/x-data-grid-premium';
|
|
4
4
|
import Select from '@mui/material/Select';
|
|
5
5
|
import MenuItem from '@mui/material/MenuItem';
|
|
6
6
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
@@ -19,30 +19,32 @@ function EditStatus(props) {
|
|
|
19
19
|
value,
|
|
20
20
|
field
|
|
21
21
|
} = props;
|
|
22
|
+
const rootProps = useGridRootProps();
|
|
22
23
|
const apiRef = useGridApiContext();
|
|
23
24
|
|
|
24
|
-
const handleChange = event => {
|
|
25
|
-
apiRef.current.setEditCellValue({
|
|
25
|
+
const handleChange = async event => {
|
|
26
|
+
const isValid = await apiRef.current.setEditCellValue({
|
|
26
27
|
id,
|
|
27
28
|
field,
|
|
28
29
|
value: event.target.value
|
|
29
|
-
}, event);
|
|
30
|
-
apiRef.current.commitCellChange({
|
|
31
|
-
id,
|
|
32
|
-
field
|
|
33
30
|
});
|
|
34
|
-
apiRef.current.setCellMode(id, field, 'view');
|
|
35
31
|
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
if (isValid && rootProps.editMode === GridEditModes.Cell) {
|
|
33
|
+
apiRef.current.stopCellEditMode({
|
|
34
|
+
id,
|
|
35
|
+
field,
|
|
36
|
+
cellToFocusAfter: 'below'
|
|
37
|
+
});
|
|
40
38
|
}
|
|
41
39
|
};
|
|
42
40
|
|
|
43
41
|
const handleClose = (event, reason) => {
|
|
44
42
|
if (reason === 'backdropClick') {
|
|
45
|
-
apiRef.current.
|
|
43
|
+
apiRef.current.stopCellEditMode({
|
|
44
|
+
id,
|
|
45
|
+
field,
|
|
46
|
+
ignoreModifications: true
|
|
47
|
+
});
|
|
46
48
|
}
|
|
47
49
|
};
|
|
48
50
|
|