@mui/x-data-grid-generator 6.0.0-alpha.0 → 6.0.0-alpha.1
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 +133 -0
- package/columns/commodities.columns.js +6 -9
- package/columns/employees.columns.js +1 -1
- package/hooks/useQuery.d.ts +6 -6
- package/index.js +1 -1
- package/legacy/columns/commodities.columns.js +6 -9
- package/legacy/columns/employees.columns.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/renderer/renderLink.js +1 -1
- package/legacy/renderer/renderStatus.js +1 -1
- package/modern/columns/commodities.columns.js +6 -9
- package/modern/columns/employees.columns.js +1 -1
- package/modern/index.js +1 -1
- package/modern/renderer/renderLink.js +1 -1
- package/modern/renderer/renderStatus.js +1 -1
- package/node/columns/commodities.columns.js +6 -9
- package/node/columns/employees.columns.js +1 -1
- package/node/index.js +1 -1
- package/node/renderer/renderLink.js +1 -1
- package/node/renderer/renderStatus.js +1 -1
- package/package.json +2 -2
- package/renderer/renderLink.js +1 -1
- package/renderer/renderStatus.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,139 @@
|
|
|
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
|
+
## 6.0.0-alpha.1
|
|
7
|
+
|
|
8
|
+
_Sep 29, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Better support for custom overlays (#5808) @cherniavskii
|
|
13
|
+
- 🖨️ Improve print export (#6273) @oliviertassinari
|
|
14
|
+
- 🎁 Reduce confusion when initializing pickers with a date value (#6170) @flaviendelangle
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
### `@mui/x-data-grid@v6.0.0-alpha.1` / `@mui/x-data-grid-pro@v6.0.0-alpha.1` / `@mui/x-data-grid-premium@v6.0.0-alpha.1`
|
|
19
|
+
|
|
20
|
+
#### Breaking changes
|
|
21
|
+
|
|
22
|
+
- New internal rows structure for v6 (#4927) @flaviendelangle
|
|
23
|
+
|
|
24
|
+
Some selectors related to the rows have been renamed to better describe the type of rows they are returning:
|
|
25
|
+
|
|
26
|
+
```diff
|
|
27
|
+
-const result = gridRowsIdToIdLookupSelector(apiRef);
|
|
28
|
+
+const result = gridRowsDataRowIdToIdLookupSelector(apiRef);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```diff
|
|
32
|
+
-const result = gridRowTreeDepthSelector(apiRef);
|
|
33
|
+
+const result = gridRowMaximumTreeDepthSelector(apiRef);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The format of the tree nodes (the element accessible in `params.node` or with the `apiRef.current.getRowNode` method) have changed.
|
|
37
|
+
You have a new `type` property, which can be useful, for example, to apply custom behavior on groups.
|
|
38
|
+
Here is an example of the old and new approach showing how to apply a custom value formatter in groups for the grouping column:
|
|
39
|
+
|
|
40
|
+
```diff
|
|
41
|
+
<DataGridPremium
|
|
42
|
+
groupingColDef={() => ({
|
|
43
|
+
valueFormatter: (params) => {
|
|
44
|
+
if (params.id == null) {
|
|
45
|
+
return params.value;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const rowNode = apiRef.current.getRowNode(params.id!)!;
|
|
49
|
+
- if (rowNode.children?.length) {
|
|
50
|
+
+ if (rowNode.type === 'group') {
|
|
51
|
+
return `by ${rowNode.groupingKey ?? ''}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return params.value;
|
|
55
|
+
}
|
|
56
|
+
})}
|
|
57
|
+
/>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- The `GridFeatureModeConstant` constant no longer exists (#6077) @DanailH
|
|
61
|
+
|
|
62
|
+
```diff
|
|
63
|
+
-import { GridFeatureModeConstant } from '@mui/x-data-grid';
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Changes
|
|
67
|
+
|
|
68
|
+
- [DataGrid] Fix `GridPagination` props typing (#6238) @cherniavskii
|
|
69
|
+
- [DataGrid] Fix `GridRow` not forwarding `ref` to the root element (#6274) @cherniavskii
|
|
70
|
+
- [DataGrid] Fix `undefined` value being showed in filter button tooltip text (#6259) @cherniavskii
|
|
71
|
+
- [DataGrid] Fix blank space when changing page with dynamic row height (#6049) @m4theushw
|
|
72
|
+
- [DataGrid] New internal rows structure for v6 (#4927) @flaviendelangle
|
|
73
|
+
- [DataGrid] Revert cell/row mode if `processRowUpdate` fails (#6185) @m4theushw
|
|
74
|
+
- [DataGrid] Rework overlays layout (#5808) @cherniavskii
|
|
75
|
+
- [DataGrid] Improve print support (#6273) @oliviertassinari
|
|
76
|
+
- [DataGridPremium] Add missing `themeAugmentation` module (#6270) @cherniavskii
|
|
77
|
+
|
|
78
|
+
### `@mui/x-date-pickers@v6.0.0-alpha.1` / `@mui/x-date-pickers-pro@v6.0.0-alpha.1`
|
|
79
|
+
|
|
80
|
+
#### Breaking changes
|
|
81
|
+
|
|
82
|
+
- [pickers] Do not support unparsed date formats anymore (#6170) @flaviendelangle
|
|
83
|
+
|
|
84
|
+
The `value` prop of the pickers now expects a parsed value.
|
|
85
|
+
Until now, it was possible to provide any format that your date management library was able to parse.
|
|
86
|
+
For instance, you could pass `value={new Date()}` when using `AdapterDayjs`.
|
|
87
|
+
|
|
88
|
+
This brought a lot of confusion so we decided to remove this behavior.
|
|
89
|
+
The format expected by the `value` prop is now the same as for any other prop holding a date.
|
|
90
|
+
Here is the syntax to initialize a date picker at the current date for each adapter:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
// Date-fns
|
|
94
|
+
<DatePicker value={new Date()} />
|
|
95
|
+
|
|
96
|
+
// Dayjs
|
|
97
|
+
import dayjs from 'dayjs'
|
|
98
|
+
<DatePicker value={dayjs()} />
|
|
99
|
+
|
|
100
|
+
// Moment
|
|
101
|
+
import moment from 'moment'
|
|
102
|
+
<DatePicker value={moment()} />
|
|
103
|
+
|
|
104
|
+
// Luxon
|
|
105
|
+
import { DateTime } from 'luxon'
|
|
106
|
+
<DatePicker value={DateTime.now()} />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Changes
|
|
110
|
+
|
|
111
|
+
- [DatePicker] Respect `minDate` and `maxDate` when opening a `DatePicker` or `DateTimePicker` (#6309) @alexfauquette
|
|
112
|
+
- [DateTimePicker] Fix validation with `shouldDisableMonth` and `shouldDisableYear` (#6266) @flaviendelangle
|
|
113
|
+
- [TimePicker] Add support for `disablePast` and `disableFuture` validation props (#6226) @LukasTy
|
|
114
|
+
- [CalendarPicker] Prevent getting focus when `autoFocus=false` (#6304) @alexfauquette
|
|
115
|
+
- [DateField] Extend moment adapter to support `expandFormat` and `formatTokenMap` (#6215) @alexfauquette
|
|
116
|
+
- [pickers] Allow to control the selected sections (#6209, #6307) @flaviendelangle
|
|
117
|
+
- [pickers] Do not loose the value of date sections not present in the format in the new field components (#6141) @flaviendelangle
|
|
118
|
+
- [pickers] Do not support unparsed date formats anymore (#6170) @flaviendelangle
|
|
119
|
+
- [pickers] Support slots on the `DateField` component (#6048) @flaviendelangle
|
|
120
|
+
- [pickers] Support Luxon v3 in `AdapterLuxon` (#6069) @alexfauquette
|
|
121
|
+
- [pickers] New components `TimeField` and `DateTimeField` (#6312) @flaviendelangle
|
|
122
|
+
- [pickers] Support basic mobile edition on new field components (#5958) @flaviendelangle
|
|
123
|
+
|
|
124
|
+
### Docs
|
|
125
|
+
|
|
126
|
+
- [docs] Fix issue in DataGrid/DataGridPro row styling demo (#6264) @MBilalShafi
|
|
127
|
+
- [docs] Improve pickers Getting Started examples (#6292) @flaviendelangle
|
|
128
|
+
- [docs] Pass model change callbacks in controlled grid editing demos (#6296) @cherniavskii
|
|
129
|
+
- [docs] Update the CodeSandbox to use the `next` branch (#6275) @oliviertassinari
|
|
130
|
+
|
|
131
|
+
### Core
|
|
132
|
+
|
|
133
|
+
- [core] Fix typing error (#6291) @flaviendelangle
|
|
134
|
+
- [core] Fix typo in the state updater of `useField` (#6311) @flaviendelangle
|
|
135
|
+
- [core] Remove `GridFeatureModeConstant` (#6077) @DanailH
|
|
136
|
+
- [core] Simplify testing architecture (#6043) @flaviendelangle
|
|
137
|
+
- [test] Skip test in Chrome non-headless and Edge (#6318) @m4theushw
|
|
138
|
+
|
|
6
139
|
## 6.0.0-alpha.0
|
|
7
140
|
|
|
8
141
|
_Sep 22, 2022_
|
|
@@ -86,9 +86,8 @@ export const getCommodityColumns = (editable = false) => [{
|
|
|
86
86
|
field: 'subTotal',
|
|
87
87
|
headerName: 'Sub Total',
|
|
88
88
|
valueGetter: ({
|
|
89
|
-
row
|
|
90
|
-
|
|
91
|
-
}) => rowNode.isAutoGenerated ? null : row.quantity * row.unitPrice,
|
|
89
|
+
row
|
|
90
|
+
}) => row.quantity == null || row.unitPrice == null ? null : row.quantity * row.unitPrice,
|
|
92
91
|
type: 'number',
|
|
93
92
|
width: 120
|
|
94
93
|
}, {
|
|
@@ -103,9 +102,8 @@ export const getCommodityColumns = (editable = false) => [{
|
|
|
103
102
|
field: 'feeAmount',
|
|
104
103
|
headerName: 'Fee Amount',
|
|
105
104
|
valueGetter: ({
|
|
106
|
-
row
|
|
107
|
-
|
|
108
|
-
}) => rowNode.isAutoGenerated ? null : row.feeRate * row.quantity * row.unitPrice,
|
|
105
|
+
row
|
|
106
|
+
}) => row.feeRate == null || row.quantity == null || row.unitPrice == null ? null : row.feeRate * row.quantity * row.unitPrice,
|
|
109
107
|
type: 'number',
|
|
110
108
|
width: 120
|
|
111
109
|
}, {
|
|
@@ -120,9 +118,8 @@ export const getCommodityColumns = (editable = false) => [{
|
|
|
120
118
|
field: 'totalPrice',
|
|
121
119
|
headerName: 'Total in USD',
|
|
122
120
|
valueGetter: ({
|
|
123
|
-
row
|
|
124
|
-
|
|
125
|
-
}) => rowNode.isAutoGenerated ? null : row.feeRate + row.quantity * row.unitPrice,
|
|
121
|
+
row
|
|
122
|
+
}) => row.feeRate == null || row.quantity == null || row.unitPrice == null ? null : row.feeRate + row.quantity * row.unitPrice,
|
|
126
123
|
renderCell: renderTotalPrice,
|
|
127
124
|
type: 'number',
|
|
128
125
|
width: 160
|
|
@@ -11,7 +11,7 @@ export const getEmployeeColumns = () => [{
|
|
|
11
11
|
headerName: 'Avatar',
|
|
12
12
|
generateData: randomColor,
|
|
13
13
|
renderCell: renderAvatar,
|
|
14
|
-
valueGetter: params => params.
|
|
14
|
+
valueGetter: params => params.row.name == null || params.row.avatar == null ? null : {
|
|
15
15
|
name: params.row.name,
|
|
16
16
|
color: params.row.avatar
|
|
17
17
|
},
|
package/hooks/useQuery.d.ts
CHANGED
|
@@ -54,13 +54,13 @@ export declare const createFakeServer: (dataSetOptions?: Partial<UseDemoDataOpti
|
|
|
54
54
|
type?: string | undefined;
|
|
55
55
|
valueOptions?: import("@mui/x-data-grid-pro").ValueOptions[] | ((params: import("@mui/x-data-grid-pro").GridValueOptionsParams<any>) => import("@mui/x-data-grid-pro").ValueOptions[]) | undefined;
|
|
56
56
|
align?: import("@mui/x-data-grid-pro").GridAlignment | undefined;
|
|
57
|
-
valueGetter?: ((params: import("@mui/x-data-grid-pro").GridValueGetterParams<any, any>) => any) | undefined;
|
|
57
|
+
valueGetter?: ((params: import("@mui/x-data-grid-pro").GridValueGetterParams<any, any, import("@mui/x-data-grid-pro").GridTreeNodeWithRender>) => any) | undefined;
|
|
58
58
|
valueSetter?: ((params: import("@mui/x-data-grid-pro").GridValueSetterParams<any, any>) => any) | undefined;
|
|
59
59
|
valueFormatter?: ((params: import("@mui/x-data-grid-pro").GridValueFormatterParams<any>) => any) | undefined;
|
|
60
|
-
valueParser?: ((value: any, params?: import("@mui/x-data-grid-pro").GridCellParams<any, any, any> | undefined) => any) | undefined;
|
|
60
|
+
valueParser?: ((value: any, params?: import("@mui/x-data-grid-pro").GridCellParams<any, any, any, import("@mui/x-data-grid-pro").GridTreeNode> | undefined) => any) | undefined;
|
|
61
61
|
cellClassName?: import("@mui/x-data-grid-pro").GridCellClassNamePropType | undefined;
|
|
62
|
-
renderCell?: ((params: import("@mui/x-data-grid-pro").GridRenderCellParams<any, any, any>) => React.ReactNode) | undefined;
|
|
63
|
-
renderEditCell?: ((params: import("@mui/x-data-grid-pro").GridRenderEditCellParams<any, any, any>) => React.ReactNode) | undefined;
|
|
62
|
+
renderCell?: ((params: import("@mui/x-data-grid-pro").GridRenderCellParams<any, any, any, import("@mui/x-data-grid-pro").GridTreeNodeWithRender>) => React.ReactNode) | undefined;
|
|
63
|
+
renderEditCell?: ((params: import("@mui/x-data-grid-pro").GridRenderEditCellParams<any, any, any, import("@mui/x-data-grid-pro").GridTreeNodeWithRender>) => React.ReactNode) | undefined;
|
|
64
64
|
preProcessEditCellProps?: ((params: import("@mui/x-data-grid-pro").GridPreProcessEditCellProps<any, any>) => import("@mui/x-data-grid-pro").GridEditCellProps<any> | Promise<import("@mui/x-data-grid-pro").GridEditCellProps<any>>) | undefined;
|
|
65
65
|
headerClassName?: import("@mui/x-data-grid-pro").GridColumnHeaderClassNamePropType | undefined;
|
|
66
66
|
renderHeader?: ((params: import("@mui/x-data-grid-pro").GridColumnHeaderParams<any, any, any>) => React.ReactNode) | undefined;
|
|
@@ -69,10 +69,10 @@ export declare const createFakeServer: (dataSetOptions?: Partial<UseDemoDataOpti
|
|
|
69
69
|
disableColumnMenu?: boolean | undefined;
|
|
70
70
|
filterable?: boolean | undefined;
|
|
71
71
|
filterOperators?: GridFilterOperator<any, any, any>[] | undefined;
|
|
72
|
-
getApplyQuickFilterFn?: ((value: any, colDef: import("@mui/x-data-grid-pro").GridStateColDef<any, any, any>, apiRef: React.MutableRefObject<import("@mui/x-data-grid/internals").GridApiCommunity>) => ((params: import("@mui/x-data-grid-pro").GridCellParams<any, any, any>) => boolean) | null) | undefined;
|
|
72
|
+
getApplyQuickFilterFn?: ((value: any, colDef: import("@mui/x-data-grid-pro").GridStateColDef<any, any, any>, apiRef: React.MutableRefObject<import("@mui/x-data-grid/internals").GridApiCommunity>) => ((params: import("@mui/x-data-grid-pro").GridCellParams<any, any, any, import("@mui/x-data-grid-pro").GridTreeNode>) => boolean) | null) | undefined;
|
|
73
73
|
disableReorder?: boolean | undefined;
|
|
74
74
|
disableExport?: boolean | undefined;
|
|
75
|
-
colSpan?: number | ((params: import("@mui/x-data-grid-pro").GridCellParams<any, any, any>) => number | undefined) | undefined;
|
|
75
|
+
colSpan?: number | ((params: import("@mui/x-data-grid-pro").GridCellParams<any, any, any, import("@mui/x-data-grid-pro").GridTreeNode>) => number | undefined) | undefined;
|
|
76
76
|
aggregable?: boolean | undefined;
|
|
77
77
|
availableAggregationFunctions?: string[] | undefined;
|
|
78
78
|
groupingValueGetter?: ((params: import("@mui/x-data-grid-premium").GridGroupingValueGetterParams<any, any>) => import("@mui/x-data-grid-pro").GridKeyValue | null | undefined) | undefined;
|
package/index.js
CHANGED
|
@@ -92,9 +92,8 @@ export var getCommodityColumns = function getCommodityColumns() {
|
|
|
92
92
|
field: 'subTotal',
|
|
93
93
|
headerName: 'Sub Total',
|
|
94
94
|
valueGetter: function valueGetter(_ref) {
|
|
95
|
-
var row = _ref.row
|
|
96
|
-
|
|
97
|
-
return rowNode.isAutoGenerated ? null : row.quantity * row.unitPrice;
|
|
95
|
+
var row = _ref.row;
|
|
96
|
+
return row.quantity == null || row.unitPrice == null ? null : row.quantity * row.unitPrice;
|
|
98
97
|
},
|
|
99
98
|
type: 'number',
|
|
100
99
|
width: 120
|
|
@@ -112,9 +111,8 @@ export var getCommodityColumns = function getCommodityColumns() {
|
|
|
112
111
|
field: 'feeAmount',
|
|
113
112
|
headerName: 'Fee Amount',
|
|
114
113
|
valueGetter: function valueGetter(_ref2) {
|
|
115
|
-
var row = _ref2.row
|
|
116
|
-
|
|
117
|
-
return rowNode.isAutoGenerated ? null : row.feeRate * row.quantity * row.unitPrice;
|
|
114
|
+
var row = _ref2.row;
|
|
115
|
+
return row.feeRate == null || row.quantity == null || row.unitPrice == null ? null : row.feeRate * row.quantity * row.unitPrice;
|
|
118
116
|
},
|
|
119
117
|
type: 'number',
|
|
120
118
|
width: 120
|
|
@@ -130,9 +128,8 @@ export var getCommodityColumns = function getCommodityColumns() {
|
|
|
130
128
|
field: 'totalPrice',
|
|
131
129
|
headerName: 'Total in USD',
|
|
132
130
|
valueGetter: function valueGetter(_ref3) {
|
|
133
|
-
var row = _ref3.row
|
|
134
|
-
|
|
135
|
-
return rowNode.isAutoGenerated ? null : row.feeRate + row.quantity * row.unitPrice;
|
|
131
|
+
var row = _ref3.row;
|
|
132
|
+
return row.feeRate == null || row.quantity == null || row.unitPrice == null ? null : row.feeRate + row.quantity * row.unitPrice;
|
|
136
133
|
},
|
|
137
134
|
renderCell: renderTotalPrice,
|
|
138
135
|
type: 'number',
|
|
@@ -13,7 +13,7 @@ export var getEmployeeColumns = function getEmployeeColumns() {
|
|
|
13
13
|
generateData: randomColor,
|
|
14
14
|
renderCell: renderAvatar,
|
|
15
15
|
valueGetter: function valueGetter(params) {
|
|
16
|
-
return params.
|
|
16
|
+
return params.row.name == null || params.row.avatar == null ? null : {
|
|
17
17
|
name: params.row.name,
|
|
18
18
|
color: params.row.avatar
|
|
19
19
|
};
|
package/legacy/index.js
CHANGED
|
@@ -86,9 +86,8 @@ export const getCommodityColumns = (editable = false) => [{
|
|
|
86
86
|
field: 'subTotal',
|
|
87
87
|
headerName: 'Sub Total',
|
|
88
88
|
valueGetter: ({
|
|
89
|
-
row
|
|
90
|
-
|
|
91
|
-
}) => rowNode.isAutoGenerated ? null : row.quantity * row.unitPrice,
|
|
89
|
+
row
|
|
90
|
+
}) => row.quantity == null || row.unitPrice == null ? null : row.quantity * row.unitPrice,
|
|
92
91
|
type: 'number',
|
|
93
92
|
width: 120
|
|
94
93
|
}, {
|
|
@@ -103,9 +102,8 @@ export const getCommodityColumns = (editable = false) => [{
|
|
|
103
102
|
field: 'feeAmount',
|
|
104
103
|
headerName: 'Fee Amount',
|
|
105
104
|
valueGetter: ({
|
|
106
|
-
row
|
|
107
|
-
|
|
108
|
-
}) => rowNode.isAutoGenerated ? null : row.feeRate * row.quantity * row.unitPrice,
|
|
105
|
+
row
|
|
106
|
+
}) => row.feeRate == null || row.quantity == null || row.unitPrice == null ? null : row.feeRate * row.quantity * row.unitPrice,
|
|
109
107
|
type: 'number',
|
|
110
108
|
width: 120
|
|
111
109
|
}, {
|
|
@@ -120,9 +118,8 @@ export const getCommodityColumns = (editable = false) => [{
|
|
|
120
118
|
field: 'totalPrice',
|
|
121
119
|
headerName: 'Total in USD',
|
|
122
120
|
valueGetter: ({
|
|
123
|
-
row
|
|
124
|
-
|
|
125
|
-
}) => rowNode.isAutoGenerated ? null : row.feeRate + row.quantity * row.unitPrice,
|
|
121
|
+
row
|
|
122
|
+
}) => row.feeRate == null || row.quantity == null || row.unitPrice == null ? null : row.feeRate + row.quantity * row.unitPrice,
|
|
126
123
|
renderCell: renderTotalPrice,
|
|
127
124
|
type: 'number',
|
|
128
125
|
width: 160
|
|
@@ -11,7 +11,7 @@ export const getEmployeeColumns = () => [{
|
|
|
11
11
|
headerName: 'Avatar',
|
|
12
12
|
generateData: randomColor,
|
|
13
13
|
renderCell: renderAvatar,
|
|
14
|
-
valueGetter: params => params.
|
|
14
|
+
valueGetter: params => params.row.name == null || params.row.avatar == null ? null : {
|
|
15
15
|
name: params.row.name,
|
|
16
16
|
color: params.row.avatar
|
|
17
17
|
},
|
package/modern/index.js
CHANGED
|
@@ -97,9 +97,8 @@ const getCommodityColumns = (editable = false) => [{
|
|
|
97
97
|
field: 'subTotal',
|
|
98
98
|
headerName: 'Sub Total',
|
|
99
99
|
valueGetter: ({
|
|
100
|
-
row
|
|
101
|
-
|
|
102
|
-
}) => rowNode.isAutoGenerated ? null : row.quantity * row.unitPrice,
|
|
100
|
+
row
|
|
101
|
+
}) => row.quantity == null || row.unitPrice == null ? null : row.quantity * row.unitPrice,
|
|
103
102
|
type: 'number',
|
|
104
103
|
width: 120
|
|
105
104
|
}, {
|
|
@@ -114,9 +113,8 @@ const getCommodityColumns = (editable = false) => [{
|
|
|
114
113
|
field: 'feeAmount',
|
|
115
114
|
headerName: 'Fee Amount',
|
|
116
115
|
valueGetter: ({
|
|
117
|
-
row
|
|
118
|
-
|
|
119
|
-
}) => rowNode.isAutoGenerated ? null : row.feeRate * row.quantity * row.unitPrice,
|
|
116
|
+
row
|
|
117
|
+
}) => row.feeRate == null || row.quantity == null || row.unitPrice == null ? null : row.feeRate * row.quantity * row.unitPrice,
|
|
120
118
|
type: 'number',
|
|
121
119
|
width: 120
|
|
122
120
|
}, {
|
|
@@ -131,9 +129,8 @@ const getCommodityColumns = (editable = false) => [{
|
|
|
131
129
|
field: 'totalPrice',
|
|
132
130
|
headerName: 'Total in USD',
|
|
133
131
|
valueGetter: ({
|
|
134
|
-
row
|
|
135
|
-
|
|
136
|
-
}) => rowNode.isAutoGenerated ? null : row.feeRate + row.quantity * row.unitPrice,
|
|
132
|
+
row
|
|
133
|
+
}) => row.feeRate == null || row.quantity == null || row.unitPrice == null ? null : row.feeRate + row.quantity * row.unitPrice,
|
|
137
134
|
renderCell: _renderer.renderTotalPrice,
|
|
138
135
|
type: 'number',
|
|
139
136
|
width: 160
|
|
@@ -22,7 +22,7 @@ const getEmployeeColumns = () => [{
|
|
|
22
22
|
headerName: 'Avatar',
|
|
23
23
|
generateData: _services.randomColor,
|
|
24
24
|
renderCell: _renderer.renderAvatar,
|
|
25
|
-
valueGetter: params => params.
|
|
25
|
+
valueGetter: params => params.row.name == null || params.row.avatar == null ? null : {
|
|
26
26
|
name: params.row.name,
|
|
27
27
|
color: params.row.avatar
|
|
28
28
|
},
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-generator",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.1",
|
|
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.19.0",
|
|
23
23
|
"@mui/base": "^5.0.0-alpha.98",
|
|
24
|
-
"@mui/x-data-grid-premium": "6.0.0-alpha.
|
|
24
|
+
"@mui/x-data-grid-premium": "6.0.0-alpha.1",
|
|
25
25
|
"chance": "^1.1.8",
|
|
26
26
|
"clsx": "^1.2.1",
|
|
27
27
|
"lru-cache": "^7.14.0"
|
package/renderer/renderLink.js
CHANGED
package/renderer/renderStatus.js
CHANGED