@mui/x-data-grid-generator 5.14.0 → 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 +147 -5
- package/columns/commodities.columns.js +1 -1
- package/columns/employees.columns.js +4 -4
- package/hooks/useMovieData.js +1 -1
- package/index.js +1 -1
- package/legacy/columns/commodities.columns.js +1 -1
- package/legacy/columns/employees.columns.js +4 -4
- package/legacy/hooks/useMovieData.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/renderer/renderEditStatus.js +45 -19
- package/modern/columns/commodities.columns.js +1 -1
- package/modern/columns/employees.columns.js +4 -4
- package/modern/hooks/useMovieData.js +1 -1
- package/modern/index.js +1 -1
- package/modern/renderer/renderEditStatus.js +15 -13
- package/node/columns/commodities.columns.js +1 -1
- package/node/columns/employees.columns.js +4 -4
- package/node/hooks/useMovieData.js +1 -1
- 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,148 @@
|
|
|
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
|
+
|
|
50
|
+
## 5.15.1
|
|
51
|
+
|
|
52
|
+
_Aug 4, 2022_
|
|
53
|
+
|
|
54
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
55
|
+
|
|
56
|
+
- 📚 New [page presenting the `apiRef`](https://mui.com/x/react-data-grid/api-object/) (#5273) @flaviendelangle
|
|
57
|
+
- ✨ Better keyboard support for start editing cells (#5511) @oliviertassinari
|
|
58
|
+
- 🌍 Improvements to different locales
|
|
59
|
+
- 🐞 Bugfixes
|
|
60
|
+
|
|
61
|
+
### `@mui/x-data-grid@v5.15.1` / `@mui/x-data-grid-pro@v5.15.1` / `@mui/x-data-grid-premium@v5.15.1`
|
|
62
|
+
|
|
63
|
+
#### Changes
|
|
64
|
+
|
|
65
|
+
- [DataGrid] Improve start edit UX (#5511) @oliviertassinari
|
|
66
|
+
- [DataGrid] Add `initialOpen` prop to `GridEditSingleSelectCell` to allow overriding initial open state (#5645) @shapaaa
|
|
67
|
+
- [DataGrid] Forward `ref` to root element in `GridEditInputCell` (#5631) @Zenoo
|
|
68
|
+
- [DataGrid] Toggle open state when clicking on buttons in the `GridToolbar` (#5503) @cherniavskii
|
|
69
|
+
- [DataGrid] Improve German (de-DE) locale (#5586) @sebastianfrey
|
|
70
|
+
- [DataGrid] Improve Korean (ko-KR) locale (#5668) @Einere
|
|
71
|
+
- [DataGrid] Complete Italian (it-IT) locale (#5487) @mamodev
|
|
72
|
+
|
|
73
|
+
### `@mui/x-date-pickers@v5.0.0-beta.4` / `@mui/x-date-picker-pro@5.0.0-beta.4`
|
|
74
|
+
|
|
75
|
+
#### Changes
|
|
76
|
+
|
|
77
|
+
- [DatePicker] Customize day formatter in the calendar (#5373) @alexfauquette
|
|
78
|
+
|
|
79
|
+
### Docs
|
|
80
|
+
|
|
81
|
+
- [docs] New location for the legal content (#5595) @oliviertassinari
|
|
82
|
+
- [docs] Update description of `maxDateTime` prop (#5639) @jurecuhalev
|
|
83
|
+
- [docs] Add missing `date-fns` dependency when opening Codesandbox demo (#5692) @cherniavskii
|
|
84
|
+
|
|
85
|
+
### Core
|
|
86
|
+
|
|
87
|
+
- [core] Drop usage of `GRID_EXPERIMENTAL_ENABLED` env variable (#5669) @ar7casper
|
|
88
|
+
- [core] Isolate asset loading under /x/ (#5594) @oliviertassinari
|
|
89
|
+
- [core] Upgrade node to v14 (#4999) @cherniavskii
|
|
90
|
+
|
|
91
|
+
## 5.15.0
|
|
92
|
+
|
|
93
|
+
_Jul 29, 2022_
|
|
94
|
+
|
|
95
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
96
|
+
|
|
97
|
+
- 🎁 Introduce aggregation (#5592) @flaviendelangle
|
|
98
|
+
|
|
99
|
+
Premium users can now aggregate data in the grid.
|
|
100
|
+
Extract information like sum, average, count, and others with a couple of clicks.
|
|
101
|
+
|
|
102
|
+
https://user-images.githubusercontent.com/45398769/181581503-77cc412e-9d9e-4de1-8bc3-c3bccc54cdaa.mp4
|
|
103
|
+
|
|
104
|
+
To enable this feature, add `experimentalFeatures={{ aggregation: true }}`.
|
|
105
|
+
Aggregation functions are customizable and they combine well with row grouping.
|
|
106
|
+
See the [documentation](https://mui.com/x/react-data-grid/aggregation/) to explore everything it has to offer.
|
|
107
|
+
|
|
108
|
+
- 🚀 Introduce row pinning (#4863) @cherniavskii
|
|
109
|
+
|
|
110
|
+
Pro users can now pin rows on top or bottom of the grid.
|
|
111
|
+
|
|
112
|
+
https://user-images.githubusercontent.com/45398769/181581493-56c733a3-6dd5-4546-bf8d-3f2dff72b14a.mp4
|
|
113
|
+
|
|
114
|
+
To do so, enable the feature with `experimentalFeatures={{ rowPinning: true }}` and provide the pinned rows data to the `pinnedRows` prop.
|
|
115
|
+
For more details, see the [documentation](https://mui.com/x/react-data-grid/row-pinning/).
|
|
116
|
+
|
|
117
|
+
- 🌍 Add simplified Chinese (zh-CN) locale to pickers (#5584) @gamecss
|
|
118
|
+
- 📚 Documentation improvements
|
|
119
|
+
|
|
120
|
+
### `@mui/x-data-grid@v5.15.0` / `@mui/x-data-grid-pro@v5.15.0` / `@mui/x-data-grid-premium@v5.15.0`
|
|
121
|
+
|
|
122
|
+
#### Changes
|
|
123
|
+
|
|
124
|
+
- [DataGrid] Add prop to keep modifications while processing props (#5309) @m4theushw
|
|
125
|
+
- [DataGrid] Fix container width change on React 18 (#5566) @m4theushw
|
|
126
|
+
- [DataGrid] Fix ellipsis style convention (#5587) @oliviertassinari
|
|
127
|
+
- [DataGridPro] Implement row pinning (#4863) @cherniavskii
|
|
128
|
+
- [DataGridPremium] Make aggregation public (#5592) @cherniavskii
|
|
129
|
+
- [l10n] Improve simplified Chinese (zh-CN) locale (#5584) @gamecss
|
|
130
|
+
|
|
131
|
+
### `@mui/x-date-pickers@v5.0.0-beta.3` / `@mui/x-date-picker-pro@5.0.0-beta.3`
|
|
132
|
+
|
|
133
|
+
#### Changes
|
|
134
|
+
|
|
135
|
+
- [l10n] Add simplified Chinese (zh-CN) locale (#5584) @gamecss
|
|
136
|
+
|
|
137
|
+
### Docs
|
|
138
|
+
|
|
139
|
+
- [docs] Split docs page about rows (#5195) @flaviendelangle
|
|
140
|
+
- [docs] Add warning clarifications (#5399) @alexfauquette
|
|
141
|
+
- [docs] Correct slot CSS classes for Pro and Premium components (#5452) @alexfauquette
|
|
142
|
+
- [docs] Fix internal link to `valueParser` (#5450) @alexfauquette
|
|
143
|
+
|
|
144
|
+
### Core
|
|
145
|
+
|
|
146
|
+
- [core] Upgrade monorepo (#5560) @m4theushw
|
|
147
|
+
|
|
6
148
|
## 5.14.0
|
|
7
149
|
|
|
8
150
|
_Jul 21, 2022_
|
|
@@ -306,7 +448,7 @@ _May 31, 2022_
|
|
|
306
448
|
|
|
307
449
|
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
308
450
|
|
|
309
|
-
- 🎁 Introduce support for [dynamic row height](https://mui.com/x/react-data-grid/
|
|
451
|
+
- 🎁 Introduce support for [dynamic row height](https://mui.com/x/react-data-grid/row-height/#dynamic-row-height) (#4859) @m4theushw
|
|
310
452
|
|
|
311
453
|
<img src="https://user-images.githubusercontent.com/42154031/171183167-718d7bcd-ec0f-459e-97fe-0f650abb4a99.gif" width="800">
|
|
312
454
|
|
|
@@ -623,7 +765,7 @@ _Apr 25, 2022_
|
|
|
623
765
|
|
|
624
766
|
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
625
767
|
|
|
626
|
-
- 🎁 Introduce [Row reorder](https://mui.com/x/react-data-grid/
|
|
768
|
+
- 🎁 Introduce [Row reorder](https://mui.com/x/react-data-grid/row-ordering/) (#4034) @DanailH
|
|
627
769
|
|
|
628
770
|
<img src="https://user-images.githubusercontent.com/5858539/165091263-23472fbb-a989-44b8-849a-d2185adfe13b.gif" width="800">
|
|
629
771
|
|
|
@@ -887,7 +1029,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
|
|
|
887
1029
|
<DataGrid getRowSpacing={() => ({ top: 10, bottom: 10 })} />
|
|
888
1030
|
```
|
|
889
1031
|
|
|
890
|
-
Check the [documentation](https://mui.com/x/react-data-grid/
|
|
1032
|
+
Check the [documentation](https://mui.com/x/react-data-grid/row-height/#row-spacing) for more information.
|
|
891
1033
|
|
|
892
1034
|
### `@mui/x-data-grid@v5.6.1` / `@mui/x-data-grid-pro@v5.6.1`
|
|
893
1035
|
|
|
@@ -1141,7 +1283,7 @@ _Jan 28, 2022_
|
|
|
1141
1283
|
|
|
1142
1284
|
A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
1143
1285
|
|
|
1144
|
-
- 🚣 Introduce [variable row height](https://mui.com/x/react-data-grid/
|
|
1286
|
+
- 🚣 Introduce [variable row height](https://mui.com/x/react-data-grid/row-height/#variable-row-height) (#438) @DanailH
|
|
1145
1287
|
|
|
1146
1288
|
Allows for setting a row-specific height.
|
|
1147
1289
|
By default, all rows have the same height, but now you can set the height on a per-row basis.
|
|
@@ -3793,7 +3935,7 @@ Big thanks to the 7 contributors who made this release possible. Here are some h
|
|
|
3793
3935
|
- 🎁 Add `onRowsScrollEnd` to support infinite loading (#1199) @DanailH
|
|
3794
3936
|
This is an XGrid feature. Provides the ability to tap into the `onRowsScrollEnd` which is called when the scroll reaches the bottom of the grid viewport allowing developers to load additional data. It can be used with a combination of `scrollBottomThreshold` to control the area in which the `onRowsScrollEnd` is called.
|
|
3795
3937
|
|
|
3796
|
-
See the documentation for [more details](https://mui.com/x/react-data-grid/
|
|
3938
|
+
See the documentation for [more details](https://mui.com/x/react-data-grid/row-updates/#infinite-loading).
|
|
3797
3939
|
|
|
3798
3940
|
- 🕹 Provide the ability to sort by multiple columns using Shift+click (#1203) @dtassone
|
|
3799
3941
|
- 🇵🇱 Added pl-PL locale (#1117) @LarsKumbier
|
|
@@ -44,7 +44,7 @@ export const getCommodityColumns = (editable = false) => [{
|
|
|
44
44
|
generateData: generateFilledQuantity,
|
|
45
45
|
renderCell: renderProgress,
|
|
46
46
|
renderEditCell: renderEditProgress,
|
|
47
|
-
|
|
47
|
+
availableAggregationFunctions: ['min', 'max', 'avg', 'size'],
|
|
48
48
|
type: 'number',
|
|
49
49
|
width: 120,
|
|
50
50
|
editable
|
|
@@ -18,7 +18,7 @@ export const getEmployeeColumns = () => [{
|
|
|
18
18
|
sortable: false,
|
|
19
19
|
filterable: false,
|
|
20
20
|
groupable: false,
|
|
21
|
-
|
|
21
|
+
aggregable: false,
|
|
22
22
|
disableExport: true
|
|
23
23
|
}, {
|
|
24
24
|
field: 'name',
|
|
@@ -28,7 +28,7 @@ export const getEmployeeColumns = () => [{
|
|
|
28
28
|
width: 120,
|
|
29
29
|
editable: true,
|
|
30
30
|
groupable: false,
|
|
31
|
-
|
|
31
|
+
aggregable: false
|
|
32
32
|
}, {
|
|
33
33
|
field: 'website',
|
|
34
34
|
headerName: 'Website',
|
|
@@ -37,7 +37,7 @@ export const getEmployeeColumns = () => [{
|
|
|
37
37
|
width: 160,
|
|
38
38
|
editable: true,
|
|
39
39
|
groupable: false,
|
|
40
|
-
|
|
40
|
+
aggregable: false
|
|
41
41
|
}, {
|
|
42
42
|
field: 'rating',
|
|
43
43
|
headerName: 'Rating',
|
|
@@ -47,7 +47,7 @@ export const getEmployeeColumns = () => [{
|
|
|
47
47
|
width: 180,
|
|
48
48
|
type: 'number',
|
|
49
49
|
editable: true,
|
|
50
|
-
|
|
50
|
+
availableAggregationFunctions: ['avg', 'min', 'max', 'size']
|
|
51
51
|
}, {
|
|
52
52
|
field: 'email',
|
|
53
53
|
headerName: 'Email',
|
package/hooks/useMovieData.js
CHANGED
|
@@ -36,7 +36,7 @@ const COLUMNS = [{
|
|
|
36
36
|
field: 'year',
|
|
37
37
|
headerName: 'Year',
|
|
38
38
|
type: 'number',
|
|
39
|
-
|
|
39
|
+
availableAggregationFunctions: ['max', 'min']
|
|
40
40
|
}, {
|
|
41
41
|
field: 'cinematicUniverse',
|
|
42
42
|
headerName: 'Cinematic Universe',
|
package/index.js
CHANGED
|
@@ -48,7 +48,7 @@ export var getCommodityColumns = function getCommodityColumns() {
|
|
|
48
48
|
generateData: generateFilledQuantity,
|
|
49
49
|
renderCell: renderProgress,
|
|
50
50
|
renderEditCell: renderEditProgress,
|
|
51
|
-
|
|
51
|
+
availableAggregationFunctions: ['min', 'max', 'avg', 'size'],
|
|
52
52
|
type: 'number',
|
|
53
53
|
width: 120,
|
|
54
54
|
editable: editable
|
|
@@ -21,7 +21,7 @@ export var getEmployeeColumns = function getEmployeeColumns() {
|
|
|
21
21
|
sortable: false,
|
|
22
22
|
filterable: false,
|
|
23
23
|
groupable: false,
|
|
24
|
-
|
|
24
|
+
aggregable: false,
|
|
25
25
|
disableExport: true
|
|
26
26
|
}, {
|
|
27
27
|
field: 'name',
|
|
@@ -31,7 +31,7 @@ export var getEmployeeColumns = function getEmployeeColumns() {
|
|
|
31
31
|
width: 120,
|
|
32
32
|
editable: true,
|
|
33
33
|
groupable: false,
|
|
34
|
-
|
|
34
|
+
aggregable: false
|
|
35
35
|
}, {
|
|
36
36
|
field: 'website',
|
|
37
37
|
headerName: 'Website',
|
|
@@ -40,7 +40,7 @@ export var getEmployeeColumns = function getEmployeeColumns() {
|
|
|
40
40
|
width: 160,
|
|
41
41
|
editable: true,
|
|
42
42
|
groupable: false,
|
|
43
|
-
|
|
43
|
+
aggregable: false
|
|
44
44
|
}, {
|
|
45
45
|
field: 'rating',
|
|
46
46
|
headerName: 'Rating',
|
|
@@ -50,7 +50,7 @@ export var getEmployeeColumns = function getEmployeeColumns() {
|
|
|
50
50
|
width: 180,
|
|
51
51
|
type: 'number',
|
|
52
52
|
editable: true,
|
|
53
|
-
|
|
53
|
+
availableAggregationFunctions: ['avg', 'min', 'max', 'size']
|
|
54
54
|
}, {
|
|
55
55
|
field: 'email',
|
|
56
56
|
headerName: 'Email',
|
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
|
|
|
@@ -44,7 +44,7 @@ export const getCommodityColumns = (editable = false) => [{
|
|
|
44
44
|
generateData: generateFilledQuantity,
|
|
45
45
|
renderCell: renderProgress,
|
|
46
46
|
renderEditCell: renderEditProgress,
|
|
47
|
-
|
|
47
|
+
availableAggregationFunctions: ['min', 'max', 'avg', 'size'],
|
|
48
48
|
type: 'number',
|
|
49
49
|
width: 120,
|
|
50
50
|
editable
|
|
@@ -18,7 +18,7 @@ export const getEmployeeColumns = () => [{
|
|
|
18
18
|
sortable: false,
|
|
19
19
|
filterable: false,
|
|
20
20
|
groupable: false,
|
|
21
|
-
|
|
21
|
+
aggregable: false,
|
|
22
22
|
disableExport: true
|
|
23
23
|
}, {
|
|
24
24
|
field: 'name',
|
|
@@ -28,7 +28,7 @@ export const getEmployeeColumns = () => [{
|
|
|
28
28
|
width: 120,
|
|
29
29
|
editable: true,
|
|
30
30
|
groupable: false,
|
|
31
|
-
|
|
31
|
+
aggregable: false
|
|
32
32
|
}, {
|
|
33
33
|
field: 'website',
|
|
34
34
|
headerName: 'Website',
|
|
@@ -37,7 +37,7 @@ export const getEmployeeColumns = () => [{
|
|
|
37
37
|
width: 160,
|
|
38
38
|
editable: true,
|
|
39
39
|
groupable: false,
|
|
40
|
-
|
|
40
|
+
aggregable: false
|
|
41
41
|
}, {
|
|
42
42
|
field: 'rating',
|
|
43
43
|
headerName: 'Rating',
|
|
@@ -47,7 +47,7 @@ export const getEmployeeColumns = () => [{
|
|
|
47
47
|
width: 180,
|
|
48
48
|
type: 'number',
|
|
49
49
|
editable: true,
|
|
50
|
-
|
|
50
|
+
availableAggregationFunctions: ['avg', 'min', 'max', 'size']
|
|
51
51
|
}, {
|
|
52
52
|
field: 'email',
|
|
53
53
|
headerName: 'Email',
|
|
@@ -36,7 +36,7 @@ const COLUMNS = [{
|
|
|
36
36
|
field: 'year',
|
|
37
37
|
headerName: 'Year',
|
|
38
38
|
type: 'number',
|
|
39
|
-
|
|
39
|
+
availableAggregationFunctions: ['max', 'min']
|
|
40
40
|
}, {
|
|
41
41
|
field: 'cinematicUniverse',
|
|
42
42
|
headerName: 'Cinematic Universe',
|
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
|
|
|
@@ -55,7 +55,7 @@ const getCommodityColumns = (editable = false) => [{
|
|
|
55
55
|
generateData: _services.generateFilledQuantity,
|
|
56
56
|
renderCell: _renderer.renderProgress,
|
|
57
57
|
renderEditCell: _renderer.renderEditProgress,
|
|
58
|
-
|
|
58
|
+
availableAggregationFunctions: ['min', 'max', 'avg', 'size'],
|
|
59
59
|
type: 'number',
|
|
60
60
|
width: 120,
|
|
61
61
|
editable
|
|
@@ -29,7 +29,7 @@ const getEmployeeColumns = () => [{
|
|
|
29
29
|
sortable: false,
|
|
30
30
|
filterable: false,
|
|
31
31
|
groupable: false,
|
|
32
|
-
|
|
32
|
+
aggregable: false,
|
|
33
33
|
disableExport: true
|
|
34
34
|
}, {
|
|
35
35
|
field: 'name',
|
|
@@ -39,7 +39,7 @@ const getEmployeeColumns = () => [{
|
|
|
39
39
|
width: 120,
|
|
40
40
|
editable: true,
|
|
41
41
|
groupable: false,
|
|
42
|
-
|
|
42
|
+
aggregable: false
|
|
43
43
|
}, {
|
|
44
44
|
field: 'website',
|
|
45
45
|
headerName: 'Website',
|
|
@@ -48,7 +48,7 @@ const getEmployeeColumns = () => [{
|
|
|
48
48
|
width: 160,
|
|
49
49
|
editable: true,
|
|
50
50
|
groupable: false,
|
|
51
|
-
|
|
51
|
+
aggregable: false
|
|
52
52
|
}, {
|
|
53
53
|
field: 'rating',
|
|
54
54
|
headerName: 'Rating',
|
|
@@ -58,7 +58,7 @@ const getEmployeeColumns = () => [{
|
|
|
58
58
|
width: 180,
|
|
59
59
|
type: 'number',
|
|
60
60
|
editable: true,
|
|
61
|
-
|
|
61
|
+
availableAggregationFunctions: ['avg', 'min', 'max', 'size']
|
|
62
62
|
}, {
|
|
63
63
|
field: 'email',
|
|
64
64
|
headerName: 'Email',
|
|
@@ -42,7 +42,7 @@ const COLUMNS = [{
|
|
|
42
42
|
field: 'year',
|
|
43
43
|
headerName: 'Year',
|
|
44
44
|
type: 'number',
|
|
45
|
-
|
|
45
|
+
availableAggregationFunctions: ['max', 'min']
|
|
46
46
|
}, {
|
|
47
47
|
field: 'cinematicUniverse',
|
|
48
48
|
headerName: 'Cinematic Universe',
|
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.
|
|
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.
|
|
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
|
|