@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/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-generator v8.24.0
2
+ * @mui/x-data-grid-generator v8.26.0
3
3
  *
4
4
  * @license UNLICENSED
5
5
  * This source code is licensed under the UNLICENSED license found in the
@@ -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
- apiRef.current.stopCellEditMode({
23
- id,
24
- field
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.stopCellEditMode({
30
- id,
31
- field
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,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import Box from '@mui/material/Box';
@@ -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.stopCellEditMode({
29
- id,
30
- field,
31
- cellToFocusAfter: 'below'
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.stopCellEditMode({
38
- id,
39
- field,
40
- ignoreModifications: true
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-generator v8.24.0
2
+ * @mui/x-data-grid-generator v8.26.0
3
3
  *
4
4
  * @license UNLICENSED
5
5
  * This source code is licensed under the UNLICENSED license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-generator",
3
- "version": "8.24.0",
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.24.0",
29
- "@mui/x-data-grid-premium": "8.24.0",
30
- "@mui/x-internals": "8.24.0",
31
- "@mui/x-data-grid-pro": "8.24.0"
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
- apiRef.current.stopCellEditMode({
30
- id,
31
- field
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.stopCellEditMode({
37
- id,
38
- field
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, {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").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.stopCellEditMode({
36
- id,
37
- field,
38
- cellToFocusAfter: 'below'
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.stopCellEditMode({
45
- id,
46
- field,
47
- ignoreModifications: true
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, {