@mui/x-data-grid 7.0.0-alpha.5 → 7.0.0-alpha.7

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.
Files changed (81) hide show
  1. package/CHANGELOG.md +408 -6
  2. package/DataGrid/DataGrid.js +31 -21
  3. package/DataGrid/useDataGridProps.js +0 -1
  4. package/colDef/gridDateOperators.js +13 -6
  5. package/colDef/gridSingleSelectColDef.js +6 -15
  6. package/components/GridPagination.d.ts +2 -2
  7. package/components/cell/GridEditSingleSelectCell.d.ts +1 -2
  8. package/components/cell/GridEditSingleSelectCell.js +9 -29
  9. package/components/columnSelection/GridHeaderCheckbox.js +3 -1
  10. package/components/panel/filterPanel/GridFilterForm.js +44 -9
  11. package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  12. package/components/panel/filterPanel/GridFilterInputDate.js +25 -8
  13. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
  14. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +7 -48
  15. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -2
  16. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +15 -57
  17. package/components/panel/filterPanel/filterPanelUtils.d.ts +3 -2
  18. package/components/panel/filterPanel/filterPanelUtils.js +10 -5
  19. package/hooks/features/filter/gridFilterUtils.js +21 -24
  20. package/hooks/features/rowSelection/useGridRowSelection.js +9 -9
  21. package/hooks/features/rowSelection/utils.d.ts +2 -0
  22. package/hooks/features/rowSelection/utils.js +8 -0
  23. package/hooks/utils/useGridAriaAttributes.js +2 -1
  24. package/index.js +1 -1
  25. package/legacy/DataGrid/DataGrid.js +31 -21
  26. package/legacy/DataGrid/useDataGridProps.js +0 -1
  27. package/legacy/colDef/gridDateOperators.js +13 -13
  28. package/legacy/colDef/gridSingleSelectColDef.js +6 -15
  29. package/legacy/components/cell/GridEditSingleSelectCell.js +8 -28
  30. package/legacy/components/columnSelection/GridHeaderCheckbox.js +3 -1
  31. package/legacy/components/panel/filterPanel/GridFilterForm.js +51 -19
  32. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  33. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +27 -8
  34. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +6 -53
  35. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +14 -59
  36. package/legacy/components/panel/filterPanel/filterPanelUtils.js +10 -6
  37. package/legacy/hooks/features/filter/gridFilterUtils.js +20 -17
  38. package/legacy/hooks/features/rowSelection/useGridRowSelection.js +9 -9
  39. package/legacy/hooks/features/rowSelection/utils.js +8 -0
  40. package/legacy/hooks/utils/useGridAriaAttributes.js +2 -1
  41. package/legacy/index.js +1 -1
  42. package/legacy/locales/csCZ.js +2 -2
  43. package/locales/csCZ.js +2 -2
  44. package/models/props/DataGridProps.d.ts +26 -26
  45. package/modern/DataGrid/DataGrid.js +31 -21
  46. package/modern/DataGrid/useDataGridProps.js +0 -1
  47. package/modern/colDef/gridDateOperators.js +13 -6
  48. package/modern/colDef/gridSingleSelectColDef.js +6 -15
  49. package/modern/components/cell/GridEditSingleSelectCell.js +9 -29
  50. package/modern/components/columnSelection/GridHeaderCheckbox.js +3 -1
  51. package/modern/components/panel/filterPanel/GridFilterForm.js +44 -9
  52. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  53. package/modern/components/panel/filterPanel/GridFilterInputDate.js +24 -6
  54. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +7 -47
  55. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +15 -56
  56. package/modern/components/panel/filterPanel/filterPanelUtils.js +10 -5
  57. package/modern/hooks/features/filter/gridFilterUtils.js +21 -24
  58. package/modern/hooks/features/rowSelection/useGridRowSelection.js +9 -9
  59. package/modern/hooks/features/rowSelection/utils.js +8 -0
  60. package/modern/hooks/utils/useGridAriaAttributes.js +2 -1
  61. package/modern/index.js +1 -1
  62. package/modern/locales/csCZ.js +2 -2
  63. package/node/DataGrid/DataGrid.js +31 -21
  64. package/node/DataGrid/useDataGridProps.js +0 -1
  65. package/node/colDef/gridDateOperators.js +13 -6
  66. package/node/colDef/gridSingleSelectColDef.js +5 -14
  67. package/node/components/cell/GridEditSingleSelectCell.js +8 -28
  68. package/node/components/columnSelection/GridHeaderCheckbox.js +3 -1
  69. package/node/components/panel/filterPanel/GridFilterForm.js +44 -9
  70. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  71. package/node/components/panel/filterPanel/GridFilterInputDate.js +24 -6
  72. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +6 -46
  73. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +14 -55
  74. package/node/components/panel/filterPanel/filterPanelUtils.js +12 -7
  75. package/node/hooks/features/filter/gridFilterUtils.js +21 -23
  76. package/node/hooks/features/rowSelection/useGridRowSelection.js +9 -9
  77. package/node/hooks/features/rowSelection/utils.js +14 -0
  78. package/node/hooks/utils/useGridAriaAttributes.js +2 -1
  79. package/node/index.js +1 -1
  80. package/node/locales/csCZ.js +2 -2
  81. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,236 @@
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
+ ## 7.0.0-alpha.7
7
+
8
+ _Jan 5, 2024_
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
+ - 🎁 New component to create a Tree View from a structured data source:
13
+
14
+ You can now directly pass your data to the `RichTreeView` component instead of manually converting it into JSX `TreeItem` components:
15
+
16
+ ```tsx
17
+ const ITEMS = [
18
+ {
19
+ id: 'node-1',
20
+ label: 'Node 1',
21
+ children: [
22
+ { id: 'node-1-1', label: Node 1.1' },
23
+ { id: 'node-1-2', label: Node 1.2' },
24
+ ],
25
+ },
26
+ {
27
+ id: 'node-2',
28
+ label: 'Node 2',
29
+ },
30
+ ];
31
+
32
+ <RichTreeView
33
+ items={MUI_X_PRODUCTS}
34
+ defaultCollapseIcon={<ExpandMoreIcon />}
35
+ defaultExpandIcon={<ChevronRightIcon />}
36
+ />
37
+ ```
38
+
39
+ - 🌍 Improve Czech (cs-CZ) locale on the Data Grid
40
+ - 🐞 Bugfixes
41
+
42
+ ### Data Grid
43
+
44
+ #### `@mui/x-data-grid@7.0.0-alpha.7`
45
+
46
+ - [DataGrid] Don't evaluate `hasEval` when `disableEval` is set (#11516) @reihwald
47
+ - [DataGrid] follow warning message guideline for `autoPageSize` and `autoHeight` (#11585) @Sboonny
48
+ - [DataGrid] Replace `eval` with `new Function` (#11557) @oliviertassinari
49
+ - [DataGrid] Warn devs when `autoPageSize` is used with `autoHeight` (#11554) @Sboonny
50
+ - [l10n] Improve Czech (cs-CZ) locale (#11526) @fdebef
51
+
52
+ #### `@mui/x-data-grid-pro@7.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
53
+
54
+ Same changes as in `@mui/x-data-grid@7.0.0-alpha.7`.
55
+
56
+ #### `@mui/x-data-grid-premium@7.0.0-alpha.7` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
57
+
58
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.7`.
59
+
60
+ ### Date Pickers
61
+
62
+ #### `@mui/x-date-pickers@7.0.0-alpha.7`
63
+
64
+ - [pickers] Fix views management (#11419) @LukasTy
65
+
66
+ #### `@mui/x-date-pickers-pro@7.0.0-alpha.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
67
+
68
+ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.7`.
69
+
70
+ ### Charts / `@mui/x-charts@7.0.0-alpha.7`
71
+
72
+ - [charts] Add `arcLabelRadius` property (#11487) @alexfauquette
73
+ - [charts] Fix `null` in line chart using dataset (#11550) @alexfauquette
74
+
75
+ ### Tree View
76
+
77
+ #### Breaking changes
78
+
79
+ - The expansion props have been renamed to better describe their behaviors:
80
+
81
+ | Old name | New name |
82
+ | :---------------- | :---------------------- |
83
+ | `onNodeToggle` | `onExpandedNodesChange` |
84
+ | `expanded` | `expandedNodes` |
85
+ | `defaultExpanded` | `defaultExpandedNodes` |
86
+
87
+ ```diff
88
+ <TreeView
89
+ - onNodeToggle={handleExpansionChange}
90
+ + onExpandedNodesChange={handleExpansionChange}
91
+
92
+ - expanded={expandedNodes}
93
+ + expandedNodes={expandedNodes}
94
+
95
+ - defaultExpanded={defaultExpandedNodes}
96
+ + defaultExpandedNodes={defaultExpandedNodes}
97
+ />
98
+ ```
99
+
100
+ - The selection props have been renamed to better describe their behaviors:
101
+
102
+ | Old name | New name |
103
+ | :---------------- | :---------------------- |
104
+ | `onNodeSelect` | `onSelectedNodesChange` |
105
+ | `selected` | `selectedNodes` |
106
+ | `defaultSelected` | `defaultSelectedNodes` |
107
+
108
+ ```diff
109
+ <TreeView
110
+ - onNodeSelect={handleSelectionChange}
111
+ + onSelectedNodesChange={handleSelectionChange}
112
+
113
+ - selected={selectedNodes}
114
+ + selectedNodes={selectedNodes}
115
+
116
+ - defaultSelected={defaultSelectedNodes}
117
+ + defaultSelectedNodes={defaultSelectedNodes}
118
+ />
119
+ ```
120
+
121
+ #### `@mui/x-tree-view@7.0.0-alpha.7`
122
+
123
+ - [TreeView] Improve the expansion API (#11476) @flaviendelangle
124
+ - [TreeView] Improve the selection API (#11560) @flaviendelangle
125
+ - [TreeView] Introduce the `items` prop (#11059) @flaviendelangle
126
+
127
+ ### Docs
128
+
129
+ - [docs] Add example for TreeView `onNodeExpansionToggle` prop (#11547) @flaviendelangle
130
+ - [docs] Clarify Pickers usage with Luxon (#11545) @LukasTy
131
+ - [docs] Complete transition to next branch (#11521) @oliviertassinari
132
+ - [docs] Fix 404 links in the docs @oliviertassinari
133
+ - [docs] Fix over page fetching @oliviertassinari
134
+ - [docs] Lint `next.config.js` (#11514) @oliviertassinari
135
+
136
+ ### Core
137
+
138
+ - [core] Fix release changelog (#11496) @romgrk
139
+ - [core] Fix use of ::before & ::after (#11515) @oliviertassinari
140
+ - [core] Localize the issue template to MUI X (#11511) @oliviertassinari
141
+ - [core] Regen api files (#11542) @flaviendelangle
142
+ - [core] Remove issue emoji @oliviertassinari
143
+ - [core] Sync the release instructions with MUI Core @oliviertassinari
144
+ - [core] Yaml format match most common convention @oliviertassinari
145
+
146
+ ## 7.0.0-alpha.6
147
+
148
+ _Dec 22, 2023_
149
+
150
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
151
+
152
+ - 🎁 Data Grid now supports `Date` objects in the `filterModel`
153
+ - 🌍 Improve Russian (ru-RU) locale on the Data Grid
154
+ - 🐞 Bugfixes
155
+
156
+ ### Data Grid
157
+
158
+ #### Breaking changes
159
+
160
+ - The filter panel no longer uses the native version of the [`Select`](https://mui.com/material-ui/react-select/) component for all components.
161
+ - The `getOptionValue` and `getOptionLabel` props were removed from the following components:
162
+
163
+ - `GridEditSingleSelectCell`
164
+ - `GridFilterInputSingleSelect`
165
+ - `GridFilterInputMultipleSingleSelect`
166
+
167
+ Use the `getOptionValue` and `getOptionLabel` properties on the `singleSelect` column definition instead:
168
+
169
+ ```tsx
170
+ const column: GridColDef = {
171
+ type: 'singleSelect',
172
+ field: 'country',
173
+ valueOptions: [
174
+ { code: 'BR', name: 'Brazil' },
175
+ { code: 'FR', name: 'France' },
176
+ ],
177
+ getOptionValue: (value: any) => value.code,
178
+ getOptionLabel: (value: any) => value.name,
179
+ };
180
+ ```
181
+ - The `filterModel` now supports `Date` objects as values for `date` and `dateTime` column types.
182
+ The `filterModel` still accepts strings as values for `date` and `dateTime` column types,
183
+ but all updates to the `filterModel` coming from the UI (e.g. filter panel) will set the value as a `Date` object.
184
+
185
+ #### `@mui/x-data-grid@7.0.0-alpha.6`
186
+
187
+ - [DataGrid] Fix typos in the JSDoc (#11451) @flaviendelangle
188
+ - [DataGrid] Make `checkboxSelection` respect the `disableMultipleRowSelection` prop (#11448) @cherniavskii
189
+ - [DataGrid] Support `Date` objects in filter model (#7069) @cherniavskii
190
+ - [DataGrid] Use non-native `Select`s by default (#11330) @cherniavskii
191
+ - [l10n] Improve Russian (ru-RU) locale (#11441) @wensiet
192
+
193
+ #### `@mui/x-data-grid-pro@7.0.0-alpha.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
194
+
195
+ Same changes as in `@mui/x-data-grid@7.0.0-alpha.6`.
196
+
197
+ #### `@mui/x-data-grid-premium@7.0.0-alpha.6` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
198
+
199
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.6`.
200
+
201
+ ### Date Pickers
202
+
203
+ #### `@mui/x-date-pickers@7.0.0-alpha.6`
204
+
205
+ - [fields] Adjust `PickersInput` sizing styles (#11392) @noraleonte
206
+ - [fields] Fix section pasting (#11447) @LukasTy
207
+ - [pickers] Add `PickersTextField` `standard` and `filled` variants (#11250) @noraleonte
208
+ - [pickers] Cleanup error messages in `PickersSectionList` (#11449) @flaviendelangle
209
+ - [pickers] Create new component `PickersSectionList` (#11352) @flaviendelangle
210
+
211
+ #### `@mui/x-date-pickers-pro@7.0.0-alpha.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
212
+
213
+ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.6`.
214
+
215
+ ### Charts / `@mui/x-charts@7.0.0-alpha.5`
216
+
217
+ - [charts] Allow percentage values for pie chart center and radius (#11464) @alexfauquette
218
+ - [charts] Improve dataset typing (#11372) @alexfauquette
219
+ - [charts] Make error message more explicit (#11457) @alexfauquette
220
+ - [charts] Make the helper `ChartsText` component public (#11370) @alexfauquette
221
+
222
+ ### Docs
223
+
224
+ - [docs] Document `false` default values for boolean props (#11477) @cherniavskii
225
+ - [docs] Improve Pickers `name` prop examples (#11422) @LukasTy
226
+ - [docs] Limit `date-fns` package to v2 in codesandbox (#11463) @LukasTy
227
+
228
+ ### Core
229
+
230
+ - [core] Add missing breaking changes to changelog (#11420) @MBilalShafi
231
+ - [core] Cherry pick follow up (#11469) @LukasTy
232
+ - [core] Fix `cherry-pick` action (#11446) @LukasTy
233
+ - [core] Fix security regressions in cherry-pick-next-to-master.yml (#11482) @MBilalShafi
234
+ - [test] Reload the page if its blank and there are no links to the remaining tests (#11466) @cherniavskii
235
+
6
236
  ## 7.0.0-alpha.5
7
237
 
8
238
  _Dec 14, 2023_
@@ -43,12 +273,93 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.5`.
43
273
  - The slot interfaces got renamed to match with `@mui/base` naming.
44
274
  The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsProps` with `SlotProps`.
45
275
 
46
- ```diff
47
- - DateCalendarSlotsComponent
48
- + DateCalendarSlots
49
- - DateCalendarSlotsComponentsProps
50
- + DateCalendarSlotProps
51
- ```
276
+ ```diff
277
+ - DateCalendarSlotsComponent
278
+ + DateCalendarSlots
279
+ - DateCalendarSlotsComponentsProps
280
+ + DateCalendarSlotProps
281
+ ```
282
+
283
+ - Move `inputRef` inside the props passed to the field hooks
284
+
285
+ The field hooks now only receive the props instead of an object containing both the props and the `inputRef`.
286
+
287
+ ```diff
288
+ - const { inputRef, ...otherProps } = props
289
+ - const fieldResponse = useDateField({ props: otherProps, inputRef });
290
+ + const fieldResponse = useDateField(props);
291
+ ```
292
+
293
+ If you are using a multi input range field hook, the same applies to `startInputRef` and `endInputRef` params
294
+
295
+ ```diff
296
+ - const { inputRef: startInputRef, ...otherStartTextFieldProps } = startTextFieldProps
297
+ - const { inputRef: endInputRef, ...otherEndTextFieldProps } = endTextFieldProps
298
+
299
+ const fieldResponse = useMultiInputDateRangeField({
300
+ sharedProps,
301
+ - startTextFieldProps: otherStartTextFieldProps,
302
+ - endTextFieldProps: otherEndTextFieldProps,
303
+ - startInputRef
304
+ - endInputRef,
305
+ + startTextFieldProps,
306
+ + endTextFieldProps
307
+ });
308
+ ```
309
+
310
+ - Rename the ref returned by the field hooks to `inputRef`
311
+
312
+ When used with the v6 TextField approach (where the input is an `<input />` HTML element), the field hooks return a ref that needs to be passed to the `<input />` element.
313
+ This ref was previously named `ref` and has been renamed `inputRef` for extra clarity.
314
+
315
+ ```diff
316
+ const fieldResponse = useDateField(props);
317
+
318
+ - return <input ref={fieldResponse.ref} />
319
+ + return <input ref={fieldResponse.inputRef} />
320
+ ```
321
+
322
+ If you are using a multi input range field hook, the same applies to the ref in the `startDate` and `endDate` objects
323
+
324
+ ```diff
325
+ const fieldResponse = useDateField(props);
326
+
327
+ return (
328
+ <div>
329
+ - <input ref={fieldResponse.startDate.ref} />
330
+ + <input ref={fieldResponse.startDate.inputRef} />
331
+ <span>–</span>
332
+ - <input ref={fieldResponse.endDate.ref} />
333
+ + <input ref={fieldResponse.endDate.inputRef} />
334
+ </div>
335
+ )
336
+ ```
337
+
338
+ - Restructure the API of `useClearableField`
339
+
340
+ The `useClearableField` hook API has been simplified to now take a `props` parameter instead of a `fieldProps`, `InputProps`, `clearable`, `onClear`, `slots` and `slotProps` parameters.
341
+
342
+ You should now be able to directly pass the returned value from your field hook (e.g: `useDateField`) to `useClearableField`
343
+
344
+ ```diff
345
+ const fieldResponse = useDateField(props);
346
+
347
+ - const { InputProps, onClear, clearable, slots, slotProps, ...otherFieldProps } = fieldResponse
348
+ - const { InputProps: ProcessedInputProps, fieldProps: processedFieldProps } = useClearableField({
349
+ - fieldProps: otherFieldProps,
350
+ - InputProps,
351
+ - clearable,
352
+ - onClear,
353
+ - slots,
354
+ - slotProps,
355
+ - });
356
+ -
357
+ - return <MyCustomTextField {...processedFieldProps} InputProps={ProcessedInputProps} />
358
+
359
+ + const processedFieldProps = useClearableField(fieldResponse);
360
+ +
361
+ + return <MyCustomTextField {...processedFieldProps} />
362
+ ```
52
363
 
53
364
  #### `@mui/x-date-pickers@7.0.0-alpha.5`
54
365
 
@@ -1029,6 +1340,97 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
1029
1340
  - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
1030
1341
  - [license] Correctly throw errors (#10924) @oliviertassinari
1031
1342
 
1343
+ ## 6.18.7
1344
+
1345
+ _Jan 5, 2024_
1346
+
1347
+ We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
1348
+
1349
+ - 🌍 Improve Czech (cs-CZ) locale on Data Grid (#11429) @wensiet
1350
+ - 🐞 Bugfixes
1351
+
1352
+ ### Data Grid
1353
+
1354
+ #### `@mui/x-data-grid@6.18.7`
1355
+
1356
+ - [DataGrid] Don't evaluate `hasEval` when `disableEval` is set (#11553) @reihwald
1357
+ - [l10n] Update Czech (cs-CZ) locale (#11498) @fdebef
1358
+
1359
+ #### `@mui/x-data-grid-pro@6.18.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
1360
+
1361
+ Same changes as in `@mui/x-data-grid@6.18.7`.
1362
+
1363
+ #### `@mui/x-data-grid-premium@6.18.7` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
1364
+
1365
+ Same changes as in `@mui/x-data-grid-pro@6.18.7`.
1366
+
1367
+ ### Date Pickers
1368
+
1369
+ #### `@mui/x-date-pickers@6.18.7`
1370
+
1371
+ - [pickers] Fix views management (@LukasTy) (#11572)
1372
+
1373
+ #### `@mui/x-date-pickers-pro@6.18.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
1374
+
1375
+ Same changes as in `@mui/x-date-pickers@6.18.7`.
1376
+
1377
+ ### Charts / `@mui/x-charts@6.18.7`
1378
+
1379
+ - [charts] Fix `null` in line chart using dataset (@alexfauquette) (#11561)
1380
+
1381
+ ### Docs
1382
+
1383
+ - [docs] Clarify Pickers usage with Luxon (#11566) @LukasTy
1384
+
1385
+ ## 6.18.6
1386
+
1387
+ _Dec 22, 2023_
1388
+
1389
+ We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
1390
+
1391
+ - 🌍 Improve Russian (ru-RU) locale (#11429) @wensiet
1392
+ - 🐞 Bugfixes
1393
+
1394
+ ### Data Grid
1395
+
1396
+ #### `@mui/x-data-grid@6.18.6`
1397
+
1398
+ - [DataGrid] Fix typos in the JSDoc (#11475) @flaviendelangle
1399
+ - [l10n] Improve Russian (ru-RU) locale (#11429) @wensiet
1400
+
1401
+ #### `@mui/x-data-grid-pro@6.18.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
1402
+
1403
+ Same changes as in `@mui/x-data-grid@6.18.6`.
1404
+
1405
+ #### `@mui/x-data-grid-premium@6.18.6` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
1406
+
1407
+ Same changes as in `@mui/x-data-grid-pro@6.18.6`.
1408
+
1409
+ ### Date Pickers
1410
+
1411
+ #### `@mui/x-date-pickers@6.18.6`
1412
+
1413
+ - [fields] Fix section pasting (#11467) @LukasTy
1414
+
1415
+ #### `@mui/x-date-pickers-pro@6.18.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
1416
+
1417
+ Same changes as in `@mui/x-date-pickers@6.18.6`.
1418
+
1419
+ ### Charts / `@mui/x-charts@6.18.4`
1420
+
1421
+ - [charts] Allow percentage values for pie chart center and radius (#11464) @alexfauquette
1422
+ - [charts] Make error message more explicit (#11457) @alexfauquette
1423
+ - [charts] Make the helper `ChartsText` component public (#11370) @alexfauquette
1424
+ - [charts] Improve dataset typing (#11372) @alexfauquette
1425
+ - [charts] Fix size overflow (#11385) @alexfauquette
1426
+
1427
+ ### Docs
1428
+
1429
+ - [docs] Document false default values for boolean props (#11489) @cherniavskii
1430
+ - [docs] Improve Pickers `name` prop examples (#11442) @LukasTy
1431
+ - [docs] Limit `date-fns` package to v2 in codesandbox (#11478) @LukasTy
1432
+ - [test] Reload the page if its blank and there are no links to the remaining tests (#11471) @cherniavskii
1433
+
1032
1434
  ## 6.18.5
1033
1435
 
1034
1436
  _Dec 14, 2023_
@@ -41,21 +41,21 @@ DataGridRaw.propTypes = {
41
41
  // | To update them edit the TypeScript types and run "yarn proptypes" |
42
42
  // ----------------------------------------------------------------------
43
43
  /**
44
- * The ref object that allows grid manipulation. Can be instantiated with `useGridApiRef()`.
44
+ * The ref object that allows Data Grid manipulation. Can be instantiated with `useGridApiRef()`.
45
45
  */
46
46
  apiRef: PropTypes.shape({
47
47
  current: PropTypes.object.isRequired
48
48
  }),
49
49
  /**
50
- * The label of the grid.
50
+ * The label of the Data Grid.
51
51
  */
52
52
  'aria-label': PropTypes.string,
53
53
  /**
54
- * The id of the element containing a label for the grid.
54
+ * The id of the element containing a label for the Data Grid.
55
55
  */
56
56
  'aria-labelledby': PropTypes.string,
57
57
  /**
58
- * If `true`, the grid height is dynamic and follow the number of rows in the grid.
58
+ * If `true`, the Data Grid height is dynamic and follow the number of rows in the Data Grid.
59
59
  * @default false
60
60
  */
61
61
  autoHeight: PropTypes.bool,
@@ -63,13 +63,18 @@ DataGridRaw.propTypes = {
63
63
  * If `true`, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar.
64
64
  * @default false
65
65
  */
66
- autoPageSize: PropTypes.bool,
66
+ autoPageSize: chainPropTypes(PropTypes.bool, props => {
67
+ if (props.autoHeight && props.autoPageSize) {
68
+ return new Error(['MUI: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You can not use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n'));
69
+ }
70
+ return null;
71
+ }),
67
72
  /**
68
73
  * Controls the modes of the cells.
69
74
  */
70
75
  cellModesModel: PropTypes.object,
71
76
  /**
72
- * If `true`, the grid get a first column with a checkbox that allows to select rows.
77
+ * If `true`, the Data Grid will display an extra column with checkboxes for selecting rows.
73
78
  * @default false
74
79
  */
75
80
  checkboxSelection: PropTypes.bool,
@@ -89,7 +94,7 @@ DataGridRaw.propTypes = {
89
94
  columnBuffer: PropTypes.number,
90
95
  columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
91
96
  /**
92
- * Sets the height in pixel of the column headers in the grid.
97
+ * Sets the height in pixel of the column headers in the Data Grid.
93
98
  * @default 56
94
99
  */
95
100
  columnHeaderHeight: PropTypes.number,
@@ -109,12 +114,12 @@ DataGridRaw.propTypes = {
109
114
  */
110
115
  columnThreshold: PropTypes.number,
111
116
  /**
112
- * Set the column visibility model of the grid.
113
- * If defined, the grid will ignore the `hide` property in [[GridColDef]].
117
+ * Set the column visibility model of the Data Grid.
118
+ * If defined, the Data Grid will ignore the `hide` property in [[GridColDef]].
114
119
  */
115
120
  columnVisibilityModel: PropTypes.object,
116
121
  /**
117
- * Set the density of the grid.
122
+ * Set the density of the Data Grid.
118
123
  * @default "standard"
119
124
  */
120
125
  density: PropTypes.oneOf(['comfortable', 'compact', 'standard']),
@@ -141,9 +146,14 @@ DataGridRaw.propTypes = {
141
146
  /**
142
147
  * If `true`, `eval()` is not used for performance optimization.
143
148
  * @default false
144
- * @ignore - do not document
145
149
  */
146
150
  disableEval: PropTypes.bool,
151
+ /**
152
+ * If `true`, multiple selection using the Ctrl/CMD or Shift key is disabled.
153
+ * The MIT DataGrid will ignore this prop, unless `checkboxSelection` is enabled.
154
+ * @default false (`!props.checkboxSelection` for MIT Data Grid)
155
+ */
156
+ disableMultipleRowSelection: PropTypes.bool,
147
157
  /**
148
158
  * If `true`, the selection on click on a row or cell is disabled.
149
159
  * @default false
@@ -180,7 +190,7 @@ DataGridRaw.propTypes = {
180
190
  */
181
191
  filterMode: PropTypes.oneOf(['client', 'server']),
182
192
  /**
183
- * Set the filter model of the grid.
193
+ * Set the filter model of the Data Grid.
184
194
  */
185
195
  filterModel: PropTypes.shape({
186
196
  items: PropTypes.arrayOf(PropTypes.shape({
@@ -195,7 +205,7 @@ DataGridRaw.propTypes = {
195
205
  quickFilterValues: PropTypes.array
196
206
  }),
197
207
  /**
198
- * Forwarded props for the grid root element.
208
+ * Forwarded props for the Data Grid root element.
199
209
  * @ignore - do not document.
200
210
  */
201
211
  forwardedProps: PropTypes.object,
@@ -263,7 +273,7 @@ DataGridRaw.propTypes = {
263
273
  */
264
274
  ignoreDiacritics: PropTypes.bool,
265
275
  /**
266
- * If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
276
+ * If `true`, the Data Grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
267
277
  * If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
268
278
  * @default false
269
279
  */
@@ -301,7 +311,7 @@ DataGridRaw.propTypes = {
301
311
  */
302
312
  loading: PropTypes.bool,
303
313
  /**
304
- * Set the locale text of the grid.
314
+ * Set the locale text of the Data Grid.
305
315
  * You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
306
316
  */
307
317
  localeText: PropTypes.object,
@@ -469,7 +479,7 @@ DataGridRaw.propTypes = {
469
479
  */
470
480
  onProcessRowUpdateError: PropTypes.func,
471
481
  /**
472
- * Callback fired when the grid is resized.
482
+ * Callback fired when the Data Grid is resized.
473
483
  * @param {ElementSize} containerSize With all properties from [[ElementSize]].
474
484
  * @param {MuiEvent<{}>} event The event object.
475
485
  * @param {GridCallbackDetails} details Additional details for this callback.
@@ -527,7 +537,7 @@ DataGridRaw.propTypes = {
527
537
  */
528
538
  onSortModelChange: PropTypes.func,
529
539
  /**
530
- * Callback fired when the state of the grid is updated.
540
+ * Callback fired when the state of the Data Grid is updated.
531
541
  * @param {GridState} state The new state.
532
542
  * @param {MuiEvent<{}>} event The event object.
533
543
  * @param {GridCallbackDetails} details Additional details for this callback.
@@ -581,7 +591,7 @@ DataGridRaw.propTypes = {
581
591
  */
582
592
  rowCount: PropTypes.number,
583
593
  /**
584
- * Sets the height in pixel of a row in the grid.
594
+ * Sets the height in pixel of a row in the Data Grid.
585
595
  * @default 52
586
596
  */
587
597
  rowHeight: PropTypes.number,
@@ -606,7 +616,7 @@ DataGridRaw.propTypes = {
606
616
  */
607
617
  rowSelection: PropTypes.bool,
608
618
  /**
609
- * Sets the row selection model of the grid.
619
+ * Sets the row selection model of the Data Grid.
610
620
  */
611
621
  rowSelectionModel: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired), PropTypes.number, PropTypes.string]),
612
622
  /**
@@ -620,7 +630,7 @@ DataGridRaw.propTypes = {
620
630
  */
621
631
  rowThreshold: PropTypes.number,
622
632
  /**
623
- * Override the height/width of the grid inner scrollbar.
633
+ * Override the height/width of the Data Grid inner scrollbar.
624
634
  */
625
635
  scrollbarSize: PropTypes.number,
626
636
  /**
@@ -654,7 +664,7 @@ DataGridRaw.propTypes = {
654
664
  */
655
665
  sortingOrder: PropTypes.arrayOf(PropTypes.oneOf(['asc', 'desc'])),
656
666
  /**
657
- * Set the sort model of the grid.
667
+ * Set the sort model of the Data Grid.
658
668
  */
659
669
  sortModel: PropTypes.arrayOf(PropTypes.shape({
660
670
  field: PropTypes.string.isRequired,
@@ -8,7 +8,6 @@ import { computeSlots, useProps } from '../internals/utils';
8
8
  const DATA_GRID_FORCED_PROPS = {
9
9
  disableMultipleColumnsFiltering: true,
10
10
  disableMultipleColumnsSorting: true,
11
- disableMultipleRowSelection: true,
12
11
  throttleRowsMs: undefined,
13
12
  hideFooterRowCount: false,
14
13
  pagination: true,
@@ -1,12 +1,15 @@
1
1
  import { GridFilterInputDate } from '../components/panel/filterPanel/GridFilterInputDate';
2
- const dateRegex = /(\d+)-(\d+)-(\d+)/;
3
- const dateTimeRegex = /(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;
4
2
  function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
5
3
  if (!filterItem.value) {
6
4
  return null;
7
5
  }
8
- const [year, month, day, hour, minute] = filterItem.value.match(showTime ? dateTimeRegex : dateRegex).slice(1).map(Number);
9
- const time = new Date(year, month - 1, day, hour || 0, minute || 0).getTime();
6
+ const date = new Date(filterItem.value);
7
+ if (showTime) {
8
+ date.setSeconds(0, 0);
9
+ } else {
10
+ date.setHours(0, 0, 0, 0);
11
+ }
12
+ const time = date.getTime();
10
13
  return value => {
11
14
  if (!value) {
12
15
  return false;
@@ -17,8 +20,12 @@ function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
17
20
 
18
21
  // Make a copy of the date to not reset the hours in the original object
19
22
  const dateCopy = new Date(value);
20
- const timeToCompare = dateCopy.setHours(showTime ? value.getHours() : 0, showTime ? value.getMinutes() : 0, 0, 0);
21
- return compareFn(timeToCompare, time);
23
+ if (showTime) {
24
+ dateCopy.setSeconds(0, 0);
25
+ } else {
26
+ dateCopy.setHours(0, 0, 0, 0);
27
+ }
28
+ return compareFn(dateCopy.getTime(), time);
22
29
  };
23
30
  }
24
31
  export const getGridDateOperators = showTime => [{
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { GRID_STRING_COL_DEF } from './gridStringColDef';
3
3
  import { renderEditSingleSelectCell } from '../components/cell/GridEditSingleSelectCell';
4
4
  import { getGridSingleSelectOperators } from './gridSingleSelectOperators';
5
- import { isSingleSelectColDef } from '../components/panel/filterPanel/filterPanelUtils';
5
+ import { getValueOptions, isSingleSelectColDef } from '../components/panel/filterPanel/filterPanelUtils';
6
6
  import { isObject } from '../utils/utils';
7
7
  const isArrayOfObjects = options => {
8
8
  return typeof options[0] === 'object';
@@ -28,16 +28,10 @@ export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
28
28
  if (!isSingleSelectColDef(colDef)) {
29
29
  return '';
30
30
  }
31
- let valueOptions;
32
- if (typeof colDef.valueOptions === 'function') {
33
- valueOptions = colDef.valueOptions({
34
- id,
35
- row: id ? api.getRow(id) : null,
36
- field
37
- });
38
- } else {
39
- valueOptions = colDef.valueOptions;
40
- }
31
+ const valueOptions = getValueOptions(colDef, {
32
+ id,
33
+ row: id ? api.getRow(id) : null
34
+ });
41
35
  if (value == null) {
42
36
  return '';
43
37
  }
@@ -55,10 +49,7 @@ export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
55
49
  // @ts-ignore
56
50
  pastedValueParser: (value, params) => {
57
51
  const colDef = params.colDef;
58
- const colDefValueOptions = colDef.valueOptions;
59
- const valueOptions = typeof colDefValueOptions === 'function' ? colDefValueOptions({
60
- field: colDef.field
61
- }) : colDefValueOptions || [];
52
+ const valueOptions = getValueOptions(colDef) || [];
62
53
  const getOptionValue = colDef.getOptionValue;
63
54
  const valueOption = valueOptions.find(option => {
64
55
  if (getOptionValue(option) === value) {