@mui/x-data-grid-generator 6.0.0-alpha.0 → 6.0.0-alpha.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 +209 -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,215 @@
|
|
|
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
|
+
## v6.0.0-alpha.2
|
|
7
|
+
|
|
8
|
+
_Oct 7, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Further progress on stabilizing new date field components
|
|
13
|
+
- 🎁 Improve support for theme augmentation in the DataGrid (#6269) @cherniavskii
|
|
14
|
+
- 🌍 Add Japanese (ja-JP) locale to pickers (#6365) @sho918
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
### `@mui/x-data-grid@v6.0.0-alpha.2` / `@mui/x-data-grid-pro@v6.0.0-alpha.2` / `@mui/x-data-grid-premium@v6.0.0-alpha.2`
|
|
19
|
+
|
|
20
|
+
#### Breaking changes
|
|
21
|
+
|
|
22
|
+
- 🎁 The aggregation is no longer experimental.
|
|
23
|
+
|
|
24
|
+
You can now use the aggregation without the `experimentalFeatures.aggregation` flag enabled.
|
|
25
|
+
|
|
26
|
+
```diff
|
|
27
|
+
<DataGridPremium
|
|
28
|
+
- experimentalFeatures={{ aggregation: true }}
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The aggregation of the columns through the column menu is now enabled by default on `DataGridPremium`. You can set `disableAggregation={true}` to disable it.
|
|
33
|
+
|
|
34
|
+
#### Changes
|
|
35
|
+
|
|
36
|
+
- [DataGrid] Add filter item ID to `.MuiDataGrid-filterForm` (#6313) @m4theushw
|
|
37
|
+
- [DataGrid] Add missing `valueOptions` (#6401) @DanailH
|
|
38
|
+
- [DataGrid] Don't start edit mode when pressing Shift + Space (#6228) @m4theushw
|
|
39
|
+
- [DataGrid] Fix error when using column grouping with all columns hidden (#6405) @alexfauquette
|
|
40
|
+
- [DataGrid] Pass generics to the components in the theme augmentation (#6269) @cherniavskii
|
|
41
|
+
- [DataGridPremium] Remove the aggregation from the experimental features (#6372) @flaviendelangle
|
|
42
|
+
|
|
43
|
+
### `@mui/x-date-pickers@v6.0.0-alpha.2` / `@mui/x-date-pickers-pro@v6.0.0-alpha.2`
|
|
44
|
+
|
|
45
|
+
#### Breaking changes
|
|
46
|
+
|
|
47
|
+
- The `renderDay` prop has been replaced by a `Day` component slot.
|
|
48
|
+
You can find more information about this pattern in the [MUI Base documentation](https://mui.com/base/getting-started/usage/#shared-props).
|
|
49
|
+
|
|
50
|
+
```diff
|
|
51
|
+
// Same for any other date, date time or date range picker.
|
|
52
|
+
<DatePicker
|
|
53
|
+
- renderDay={(_, dayProps) => <CustomDay {...dayProps} />}
|
|
54
|
+
+ components={{ Day: CustomDay }}
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### Changes
|
|
59
|
+
|
|
60
|
+
- [DateRangePicker] Fix the shape of the first selected day when the start date has an hour set (#6403) @flaviendelangle
|
|
61
|
+
- [l10n] Add Japanese (ja-JP) locale to pickers (#6365) @sho918
|
|
62
|
+
- [DateRangePicker] Force focus to stay on inputs (#6324) @alexfauquette
|
|
63
|
+
- [pickers] Improve edition on field components (#6339) @flaviendelangle
|
|
64
|
+
- [pickers] Improve field selection behaviors (#6317) @flaviendelangle
|
|
65
|
+
- [pickers] Replace the `renderDay` prop with a `Day` component slot (#6293) @flaviendelangle
|
|
66
|
+
|
|
67
|
+
### Docs
|
|
68
|
+
|
|
69
|
+
- [docs] Apply style guide to Data Grid Aggregation page (#5781) @samuelsycamore
|
|
70
|
+
- [docs] Fix code examples of editing cells (#6004) @TiagoPortfolio
|
|
71
|
+
- [docs] Fix customized day rendering demo style (#6342) (#6399) @Ambrish-git
|
|
72
|
+
- [docs] Implement Style Guide on "Advanced" Data Grid doc pages (#6331) @samuelsycamore
|
|
73
|
+
- [docs] Use components instead of demos for `SelectorsDocs` (#6103) @flaviendelangle
|
|
74
|
+
- [license] Add new license status 'Out of scope' (#5260) @flaviendelangle
|
|
75
|
+
|
|
76
|
+
### Core
|
|
77
|
+
|
|
78
|
+
- [core] Speedup of yarn install in the CI (#6395) @oliviertassinari
|
|
79
|
+
- [test] Remove redundant test clean-ups (#6377) @oliviertassinari
|
|
80
|
+
- [test] Replace `React.render` with `React.createRoot` in e2e tests (#6393) @m4theushw
|
|
81
|
+
|
|
82
|
+
## 6.0.0-alpha.1
|
|
83
|
+
|
|
84
|
+
_Sep 29, 2022_
|
|
85
|
+
|
|
86
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
87
|
+
|
|
88
|
+
- 🚀 Better support for custom overlays (#5808) @cherniavskii
|
|
89
|
+
- 🖨️ Improve print export (#6273) @oliviertassinari
|
|
90
|
+
- 🎁 Reduce confusion when initializing pickers with a date value (#6170) @flaviendelangle
|
|
91
|
+
- 📚 Documentation improvements
|
|
92
|
+
- 🐞 Bugfixes
|
|
93
|
+
|
|
94
|
+
### `@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`
|
|
95
|
+
|
|
96
|
+
#### Breaking changes
|
|
97
|
+
|
|
98
|
+
- New internal rows structure for v6 (#4927) @flaviendelangle
|
|
99
|
+
|
|
100
|
+
Some selectors related to the rows have been renamed to better describe the type of rows they are returning:
|
|
101
|
+
|
|
102
|
+
```diff
|
|
103
|
+
-const result = gridRowsIdToIdLookupSelector(apiRef);
|
|
104
|
+
+const result = gridRowsDataRowIdToIdLookupSelector(apiRef);
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
```diff
|
|
108
|
+
-const result = gridRowTreeDepthSelector(apiRef);
|
|
109
|
+
+const result = gridRowMaximumTreeDepthSelector(apiRef);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The format of the tree nodes (the element accessible in `params.node` or with the `apiRef.current.getRowNode` method) have changed.
|
|
113
|
+
You have a new `type` property, which can be useful, for example, to apply custom behavior on groups.
|
|
114
|
+
Here is an example of the old and new approach showing how to apply a custom value formatter in groups for the grouping column:
|
|
115
|
+
|
|
116
|
+
```diff
|
|
117
|
+
<DataGridPremium
|
|
118
|
+
groupingColDef={() => ({
|
|
119
|
+
valueFormatter: (params) => {
|
|
120
|
+
if (params.id == null) {
|
|
121
|
+
return params.value;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const rowNode = apiRef.current.getRowNode(params.id!)!;
|
|
125
|
+
- if (rowNode.children?.length) {
|
|
126
|
+
+ if (rowNode.type === 'group') {
|
|
127
|
+
return `by ${rowNode.groupingKey ?? ''}`;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return params.value;
|
|
131
|
+
}
|
|
132
|
+
})}
|
|
133
|
+
/>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
- The `GridFeatureModeConstant` constant no longer exists (#6077) @DanailH
|
|
137
|
+
|
|
138
|
+
```diff
|
|
139
|
+
-import { GridFeatureModeConstant } from '@mui/x-data-grid';
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### Changes
|
|
143
|
+
|
|
144
|
+
- [DataGrid] Fix `GridPagination` props typing (#6238) @cherniavskii
|
|
145
|
+
- [DataGrid] Fix `GridRow` not forwarding `ref` to the root element (#6274) @cherniavskii
|
|
146
|
+
- [DataGrid] Fix `undefined` value being showed in filter button tooltip text (#6259) @cherniavskii
|
|
147
|
+
- [DataGrid] Fix blank space when changing page with dynamic row height (#6049) @m4theushw
|
|
148
|
+
- [DataGrid] New internal rows structure for v6 (#4927) @flaviendelangle
|
|
149
|
+
- [DataGrid] Revert cell/row mode if `processRowUpdate` fails (#6185) @m4theushw
|
|
150
|
+
- [DataGrid] Rework overlays layout (#5808) @cherniavskii
|
|
151
|
+
- [DataGrid] Improve print support (#6273) @oliviertassinari
|
|
152
|
+
- [DataGridPremium] Add missing `themeAugmentation` module (#6270) @cherniavskii
|
|
153
|
+
|
|
154
|
+
### `@mui/x-date-pickers@v6.0.0-alpha.1` / `@mui/x-date-pickers-pro@v6.0.0-alpha.1`
|
|
155
|
+
|
|
156
|
+
#### Breaking changes
|
|
157
|
+
|
|
158
|
+
- [pickers] Do not support unparsed date formats anymore (#6170) @flaviendelangle
|
|
159
|
+
|
|
160
|
+
The `value` prop of the pickers now expects a parsed value.
|
|
161
|
+
Until now, it was possible to provide any format that your date management library was able to parse.
|
|
162
|
+
For instance, you could pass `value={new Date()}` when using `AdapterDayjs`.
|
|
163
|
+
|
|
164
|
+
This brought a lot of confusion so we decided to remove this behavior.
|
|
165
|
+
The format expected by the `value` prop is now the same as for any other prop holding a date.
|
|
166
|
+
Here is the syntax to initialize a date picker at the current date for each adapter:
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
// Date-fns
|
|
170
|
+
<DatePicker value={new Date()} />
|
|
171
|
+
|
|
172
|
+
// Dayjs
|
|
173
|
+
import dayjs from 'dayjs'
|
|
174
|
+
<DatePicker value={dayjs()} />
|
|
175
|
+
|
|
176
|
+
// Moment
|
|
177
|
+
import moment from 'moment'
|
|
178
|
+
<DatePicker value={moment()} />
|
|
179
|
+
|
|
180
|
+
// Luxon
|
|
181
|
+
import { DateTime } from 'luxon'
|
|
182
|
+
<DatePicker value={DateTime.now()} />
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
#### Changes
|
|
186
|
+
|
|
187
|
+
- [DatePicker] Respect `minDate` and `maxDate` when opening a `DatePicker` or `DateTimePicker` (#6309) @alexfauquette
|
|
188
|
+
- [DateTimePicker] Fix validation with `shouldDisableMonth` and `shouldDisableYear` (#6266) @flaviendelangle
|
|
189
|
+
- [TimePicker] Add support for `disablePast` and `disableFuture` validation props (#6226) @LukasTy
|
|
190
|
+
- [CalendarPicker] Prevent getting focus when `autoFocus=false` (#6304) @alexfauquette
|
|
191
|
+
- [DateField] Extend moment adapter to support `expandFormat` and `formatTokenMap` (#6215) @alexfauquette
|
|
192
|
+
- [pickers] Allow to control the selected sections (#6209, #6307) @flaviendelangle
|
|
193
|
+
- [pickers] Do not loose the value of date sections not present in the format in the new field components (#6141) @flaviendelangle
|
|
194
|
+
- [pickers] Do not support unparsed date formats anymore (#6170) @flaviendelangle
|
|
195
|
+
- [pickers] Support slots on the `DateField` component (#6048) @flaviendelangle
|
|
196
|
+
- [pickers] Support Luxon v3 in `AdapterLuxon` (#6069) @alexfauquette
|
|
197
|
+
- [pickers] New components `TimeField` and `DateTimeField` (#6312) @flaviendelangle
|
|
198
|
+
- [pickers] Support basic mobile edition on new field components (#5958) @flaviendelangle
|
|
199
|
+
|
|
200
|
+
### Docs
|
|
201
|
+
|
|
202
|
+
- [docs] Fix issue in DataGrid/DataGridPro row styling demo (#6264) @MBilalShafi
|
|
203
|
+
- [docs] Improve pickers Getting Started examples (#6292) @flaviendelangle
|
|
204
|
+
- [docs] Pass model change callbacks in controlled grid editing demos (#6296) @cherniavskii
|
|
205
|
+
- [docs] Update the CodeSandbox to use the `next` branch (#6275) @oliviertassinari
|
|
206
|
+
|
|
207
|
+
### Core
|
|
208
|
+
|
|
209
|
+
- [core] Fix typing error (#6291) @flaviendelangle
|
|
210
|
+
- [core] Fix typo in the state updater of `useField` (#6311) @flaviendelangle
|
|
211
|
+
- [core] Remove `GridFeatureModeConstant` (#6077) @DanailH
|
|
212
|
+
- [core] Simplify testing architecture (#6043) @flaviendelangle
|
|
213
|
+
- [test] Skip test in Chrome non-headless and Edge (#6318) @m4theushw
|
|
214
|
+
|
|
6
215
|
## 6.0.0-alpha.0
|
|
7
216
|
|
|
8
217
|
_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.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.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.2",
|
|
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