@mui/x-data-grid-generator 8.24.0 → 8.26.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 +196 -6479
- package/esm/index.js +1 -1
- package/esm/renderer/renderEditIncoterm.js +12 -10
- package/esm/renderer/renderEditRating.js +2 -0
- package/esm/renderer/renderEditStatus.js +10 -12
- package/index.js +1 -1
- package/package.json +5 -5
- package/renderer/renderEditIncoterm.js +11 -9
- package/renderer/renderEditRating.js +1 -0
- package/renderer/renderEditStatus.js +9 -11
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { useGridApiContext } from '@mui/x-data-grid-premium';
|
|
2
|
+
import { GridCellEditStopReasons, useGridApiContext } from '@mui/x-data-grid-premium';
|
|
3
3
|
import Select from '@mui/material/Select';
|
|
4
4
|
import MenuItem from '@mui/material/MenuItem';
|
|
5
5
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
@@ -14,22 +14,24 @@ function EditIncoterm(props) {
|
|
|
14
14
|
} = props;
|
|
15
15
|
const apiRef = useGridApiContext();
|
|
16
16
|
const handleChange = async event => {
|
|
17
|
-
await apiRef.current.setEditCellValue({
|
|
17
|
+
const isValid = await apiRef.current.setEditCellValue({
|
|
18
18
|
id,
|
|
19
19
|
field,
|
|
20
20
|
value: event.target.value
|
|
21
21
|
}, event);
|
|
22
|
-
|
|
23
|
-
id,
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
if (isValid) {
|
|
23
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
24
|
+
apiRef.current.publishEvent('cellEditStop', _extends({}, params, {
|
|
25
|
+
reason: GridCellEditStopReasons.enterKeyDown
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
26
28
|
};
|
|
27
29
|
const handleClose = (event, reason) => {
|
|
28
30
|
if (reason === 'backdropClick') {
|
|
29
|
-
apiRef.current.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
31
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
32
|
+
apiRef.current.publishEvent('cellEditStop', _extends({}, params, {
|
|
33
|
+
reason: GridCellEditStopReasons.cellFocusOut
|
|
34
|
+
}));
|
|
33
35
|
}
|
|
34
36
|
};
|
|
35
37
|
return /*#__PURE__*/_jsx(Select, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { useGridApiContext, useGridRootProps, GridEditModes } from '@mui/x-data-grid-premium';
|
|
2
|
+
import { useGridApiContext, useGridRootProps, GridEditModes, GridCellEditStopReasons } from '@mui/x-data-grid-premium';
|
|
3
3
|
import Select from '@mui/material/Select';
|
|
4
4
|
import MenuItem from '@mui/material/MenuItem';
|
|
5
5
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
@@ -23,22 +23,20 @@ function EditStatus(props) {
|
|
|
23
23
|
id,
|
|
24
24
|
field,
|
|
25
25
|
value: event.target.value
|
|
26
|
-
});
|
|
26
|
+
}, event);
|
|
27
27
|
if (isValid && rootProps.editMode === GridEditModes.Cell) {
|
|
28
|
-
apiRef.current.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
28
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
29
|
+
apiRef.current.publishEvent('cellEditStop', _extends({}, params, {
|
|
30
|
+
reason: GridCellEditStopReasons.enterKeyDown
|
|
31
|
+
}));
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
34
|
const handleClose = (event, reason) => {
|
|
36
35
|
if (reason === 'backdropClick') {
|
|
37
|
-
apiRef.current.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
36
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
37
|
+
apiRef.current.publishEvent('cellEditStop', _extends({}, params, {
|
|
38
|
+
reason: GridCellEditStopReasons.cellFocusOut
|
|
39
|
+
}));
|
|
42
40
|
}
|
|
43
41
|
};
|
|
44
42
|
return /*#__PURE__*/_jsx(Select, {
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-generator",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.26.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Generate fake data for demo purposes only.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"chance": "^1.1.13",
|
|
26
26
|
"clsx": "^2.1.1",
|
|
27
27
|
"lru-cache": "^11.2.2",
|
|
28
|
-
"@mui/x-data-grid": "8.
|
|
29
|
-
"@mui/x-data-grid-premium": "8.
|
|
30
|
-
"@mui/x-internals": "8.
|
|
31
|
-
"@mui/x-data-grid-pro": "8.
|
|
28
|
+
"@mui/x-data-grid": "8.26.0",
|
|
29
|
+
"@mui/x-data-grid-premium": "8.26.0",
|
|
30
|
+
"@mui/x-internals": "8.26.0",
|
|
31
|
+
"@mui/x-data-grid-pro": "8.26.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@emotion/react": "^11.9.0",
|
|
@@ -21,22 +21,24 @@ function EditIncoterm(props) {
|
|
|
21
21
|
} = props;
|
|
22
22
|
const apiRef = (0, _xDataGridPremium.useGridApiContext)();
|
|
23
23
|
const handleChange = async event => {
|
|
24
|
-
await apiRef.current.setEditCellValue({
|
|
24
|
+
const isValid = await apiRef.current.setEditCellValue({
|
|
25
25
|
id,
|
|
26
26
|
field,
|
|
27
27
|
value: event.target.value
|
|
28
28
|
}, event);
|
|
29
|
-
|
|
30
|
-
id,
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
if (isValid) {
|
|
30
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
31
|
+
apiRef.current.publishEvent('cellEditStop', (0, _extends2.default)({}, params, {
|
|
32
|
+
reason: _xDataGridPremium.GridCellEditStopReasons.enterKeyDown
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
33
35
|
};
|
|
34
36
|
const handleClose = (event, reason) => {
|
|
35
37
|
if (reason === 'backdropClick') {
|
|
36
|
-
apiRef.current.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
38
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
39
|
+
apiRef.current.publishEvent('cellEditStop', (0, _extends2.default)({}, params, {
|
|
40
|
+
reason: _xDataGridPremium.GridCellEditStopReasons.cellFocusOut
|
|
41
|
+
}));
|
|
40
42
|
}
|
|
41
43
|
};
|
|
42
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
|
|
@@ -30,22 +30,20 @@ function EditStatus(props) {
|
|
|
30
30
|
id,
|
|
31
31
|
field,
|
|
32
32
|
value: event.target.value
|
|
33
|
-
});
|
|
33
|
+
}, event);
|
|
34
34
|
if (isValid && rootProps.editMode === _xDataGridPremium.GridEditModes.Cell) {
|
|
35
|
-
apiRef.current.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
35
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
36
|
+
apiRef.current.publishEvent('cellEditStop', (0, _extends2.default)({}, params, {
|
|
37
|
+
reason: _xDataGridPremium.GridCellEditStopReasons.enterKeyDown
|
|
38
|
+
}));
|
|
40
39
|
}
|
|
41
40
|
};
|
|
42
41
|
const handleClose = (event, reason) => {
|
|
43
42
|
if (reason === 'backdropClick') {
|
|
44
|
-
apiRef.current.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
});
|
|
43
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
44
|
+
apiRef.current.publishEvent('cellEditStop', (0, _extends2.default)({}, params, {
|
|
45
|
+
reason: _xDataGridPremium.GridCellEditStopReasons.cellFocusOut
|
|
46
|
+
}));
|
|
49
47
|
}
|
|
50
48
|
};
|
|
51
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
|