@mui/x-data-grid 7.0.0-alpha.2 → 7.0.0-alpha.4
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 +364 -0
- package/DataGrid/DataGrid.d.ts +0 -10
- package/DataGrid/DataGrid.js +11 -23
- package/DataGrid/useDataGridProps.js +1 -1
- package/README.md +0 -1
- package/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/colDef/gridDefaultColumnTypes.d.ts +2 -2
- package/colDef/gridDefaultColumnTypes.js +2 -2
- package/components/GridHeader.js +3 -2
- package/components/GridRow.js +9 -6
- package/components/base/GridOverlays.js +0 -2
- package/components/cell/GridActionsCell.js +0 -1
- package/components/cell/GridCell.js +3 -5
- package/components/cell/GridEditDateCell.js +1 -20
- package/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +2 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/components/panel/index.d.ts +0 -1
- package/components/panel/index.js +0 -1
- package/components/virtualization/GridVirtualScroller.js +0 -1
- package/constants/defaultGridSlotsComponents.js +1 -2
- package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/hooks/features/editing/useGridCellEditing.js +8 -23
- package/hooks/features/editing/useGridRowEditing.js +7 -22
- package/hooks/features/export/useGridCsvExport.d.ts +1 -1
- package/hooks/features/export/useGridCsvExport.js +1 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +1 -0
- package/hooks/features/filter/gridFilterUtils.js +7 -4
- package/hooks/features/filter/useGridFilter.js +2 -2
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -2
- package/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +9 -6
- package/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/hooks/features/sorting/useGridSorting.js +6 -5
- package/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/index.js +1 -1
- package/internals/index.d.ts +2 -2
- package/internals/index.js +2 -2
- package/legacy/DataGrid/DataGrid.js +11 -23
- package/legacy/DataGrid/useDataGridProps.js +1 -1
- package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/legacy/colDef/gridDefaultColumnTypes.js +2 -2
- package/legacy/components/GridHeader.js +3 -2
- package/legacy/components/GridRow.js +9 -6
- package/legacy/components/base/GridOverlays.js +0 -2
- package/legacy/components/cell/GridActionsCell.js +0 -1
- package/legacy/components/cell/GridCell.js +3 -5
- package/legacy/components/cell/GridEditDateCell.js +1 -20
- package/legacy/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterForm.js +2 -2
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/legacy/components/panel/index.js +0 -1
- package/legacy/components/virtualization/GridVirtualScroller.js +0 -1
- package/legacy/constants/defaultGridSlotsComponents.js +1 -2
- package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/legacy/hooks/features/editing/useGridCellEditing.js +8 -23
- package/legacy/hooks/features/editing/useGridRowEditing.js +7 -24
- package/legacy/hooks/features/export/useGridCsvExport.js +1 -1
- package/legacy/hooks/features/filter/gridFilterUtils.js +7 -4
- package/legacy/hooks/features/filter/useGridFilter.js +2 -2
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +9 -6
- package/legacy/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/legacy/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/legacy/hooks/features/sorting/useGridSorting.js +6 -5
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +2 -2
- package/legacy/locales/bgBG.js +33 -37
- package/legacy/locales/coreLocales.js +1 -0
- package/legacy/locales/daDK.js +37 -39
- package/legacy/locales/plPL.js +0 -1
- package/legacy/models/params/gridEditCellParams.js +1 -0
- package/legacy/utils/domUtils.js +10 -1
- package/legacy/utils/utils.js +0 -1
- package/locales/bgBG.js +33 -37
- package/locales/coreLocales.js +1 -0
- package/locales/daDK.js +37 -39
- package/locales/plPL.js +0 -1
- package/models/api/gridEditingApi.d.ts +2 -4
- package/models/api/gridSortApi.d.ts +2 -2
- package/models/colDef/gridColType.d.ts +2 -4
- package/models/gridFilterModel.d.ts +2 -2
- package/models/gridSlotsComponent.d.ts +0 -5
- package/models/gridSlotsComponentsProps.d.ts +0 -3
- package/models/params/gridEditCellParams.d.ts +3 -1
- package/models/params/gridEditCellParams.js +1 -0
- package/models/params/gridRowParams.d.ts +1 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +11 -23
- package/modern/DataGrid/useDataGridProps.js +1 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/modern/colDef/gridDefaultColumnTypes.js +2 -2
- package/modern/components/GridHeader.js +2 -1
- package/modern/components/GridRow.js +9 -6
- package/modern/components/base/GridOverlays.js +0 -2
- package/modern/components/cell/GridActionsCell.js +0 -1
- package/modern/components/cell/GridCell.js +2 -4
- package/modern/components/cell/GridEditDateCell.js +1 -20
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterForm.js +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/modern/components/panel/index.js +0 -1
- package/modern/components/virtualization/GridVirtualScroller.js +0 -1
- package/modern/constants/defaultGridSlotsComponents.js +1 -2
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +8 -23
- package/modern/hooks/features/editing/useGridRowEditing.js +7 -22
- package/modern/hooks/features/export/useGridCsvExport.js +1 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +4 -2
- package/modern/hooks/features/filter/useGridFilter.js +2 -2
- package/modern/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +9 -6
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/modern/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/modern/hooks/features/sorting/useGridSorting.js +6 -5
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -2
- package/modern/locales/bgBG.js +33 -37
- package/modern/locales/coreLocales.js +1 -0
- package/modern/locales/daDK.js +37 -39
- package/modern/locales/plPL.js +0 -1
- package/modern/models/params/gridEditCellParams.js +1 -0
- package/modern/utils/domUtils.js +10 -1
- package/modern/utils/utils.js +0 -1
- package/node/DataGrid/DataGrid.js +11 -23
- package/node/DataGrid/useDataGridProps.js +1 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/node/colDef/gridDefaultColumnTypes.js +2 -2
- package/node/components/GridHeader.js +2 -1
- package/node/components/GridRow.js +8 -5
- package/node/components/base/GridOverlays.js +0 -2
- package/node/components/cell/GridActionsCell.js +0 -1
- package/node/components/cell/GridCell.js +2 -4
- package/node/components/cell/GridEditDateCell.js +1 -20
- package/node/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/node/components/panel/filterPanel/GridFilterForm.js +2 -2
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/node/components/panel/index.js +0 -11
- package/node/components/virtualization/GridVirtualScroller.js +0 -1
- package/node/constants/defaultGridSlotsComponents.js +0 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/node/hooks/features/editing/useGridCellEditing.js +7 -22
- package/node/hooks/features/editing/useGridRowEditing.js +6 -21
- package/node/hooks/features/export/useGridCsvExport.js +1 -1
- package/node/hooks/features/filter/gridFilterUtils.js +6 -3
- package/node/hooks/features/filter/useGridFilter.js +1 -1
- package/node/hooks/features/focus/gridFocusStateSelector.js +3 -7
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -7
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +8 -5
- package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/node/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/node/hooks/features/sorting/useGridSorting.js +6 -5
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +21 -14
- package/node/locales/bgBG.js +33 -37
- package/node/locales/daDK.js +37 -39
- package/node/locales/plPL.js +0 -1
- package/node/models/params/gridEditCellParams.js +1 -0
- package/node/utils/domUtils.js +11 -1
- package/node/utils/utils.js +0 -1
- package/package.json +4 -4
- package/utils/domUtils.d.ts +2 -0
- package/utils/domUtils.js +10 -1
- package/utils/utils.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,271 @@
|
|
|
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.4
|
|
7
|
+
|
|
8
|
+
_Dec 8, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 The scatter charts now use voronoi to trigger items
|
|
13
|
+
|
|
14
|
+
Users needed to hover the item to highlight the scatter item or show the tooltip.
|
|
15
|
+
Now they can interact with data by triggering the closest element. See the [docs page](https://next.mui.com/x/react-charts/scatter/#interaction) for more info.
|
|
16
|
+
|
|
17
|
+
- 📚 Add [Pickers FAQ page](https://next.mui.com/x/react-date-pickers/faq/)
|
|
18
|
+
- 🎉 The Data Grid Header filters feature is now stable
|
|
19
|
+
- 🌍 Improve Danish (da-DK) locale on Data Grid
|
|
20
|
+
- 🐞 Bugfixes
|
|
21
|
+
|
|
22
|
+
### Data Grid
|
|
23
|
+
|
|
24
|
+
#### Breaking changes
|
|
25
|
+
|
|
26
|
+
- The header filters feature is now stable. `unstable_` prefix is removed from prop `headerFilters` and related exports.
|
|
27
|
+
See [migration docs](https://next.mui.com/x/migration/migration-data-grid-v6/#filtering) for more details.
|
|
28
|
+
|
|
29
|
+
- The `GridColDef['type']` has been narrowed down to only accept the built-in column types.
|
|
30
|
+
TypeScript users need to use the `GridColDef` interface when defining columns:
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
// 🛑 `type` is inferred as `string` and is too wide
|
|
34
|
+
const columns = [{ type: 'number', field: 'id' }];
|
|
35
|
+
<DataGrid columns={columns} />;
|
|
36
|
+
|
|
37
|
+
// ✅ `type` is `'number'`
|
|
38
|
+
const columns: GridColDef[] = [{ type: 'number', field: 'id' }];
|
|
39
|
+
<DataGrid columns={columns} />;
|
|
40
|
+
|
|
41
|
+
// ✅ Alternalively, `as const` can be used to narrow down the type
|
|
42
|
+
const columns = [{ type: 'number' as const, field: 'id' }];
|
|
43
|
+
<DataGrid columns={columns} />;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-data-grid@7.0.0-alpha.4`
|
|
47
|
+
|
|
48
|
+
- [DataGrid] Added a guard for reorder cells (#11159) @michelengelen
|
|
49
|
+
- [DataGrid] Narrow down `GridColDef['type']` (#11270) @cherniavskii
|
|
50
|
+
- [l10n] Improve Danish (da-DK) locale (#11304) @goibon
|
|
51
|
+
|
|
52
|
+
#### `@mui/x-data-grid-pro@7.0.0-alpha.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
53
|
+
|
|
54
|
+
Same changes as in `@mui/x-data-grid@7.0.0-alpha.4`, plus:
|
|
55
|
+
|
|
56
|
+
- [DataGridPro] Make header filters feature stable (#11243) @MBilalShafi
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-data-grid-premium@7.0.0-alpha.4` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
59
|
+
|
|
60
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.4`.
|
|
61
|
+
|
|
62
|
+
### Date Pickers
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-date-pickers@7.0.0-alpha.4`
|
|
65
|
+
|
|
66
|
+
- [fields] Rework `PickersTextField` (#11258) @flaviendelangle
|
|
67
|
+
- [pickers] Fix `MultiSectionDigitalClock` issues (#11305) @LukasTy
|
|
68
|
+
- [pickers] Fix views height consistency (#11337) @LukasTy
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-date-pickers-pro@7.0.0-alpha.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
71
|
+
|
|
72
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-alpha.4`.
|
|
73
|
+
|
|
74
|
+
### Charts / `@mui/x-charts@7.0.0-alpha.4`
|
|
75
|
+
|
|
76
|
+
- [charts] Remove animation on sparkline (#11311) @oliviertassinari
|
|
77
|
+
- [charts] Use voronoi cells to trigger interaction with scatter items (#10981) @alexfauquette
|
|
78
|
+
- [charts] Add `@mui/utils` as a dependency (#11351) @michelengelen
|
|
79
|
+
|
|
80
|
+
### Docs
|
|
81
|
+
|
|
82
|
+
- [docs] Add FAQ page (#11271) @noraleonte
|
|
83
|
+
- [docs] Add a doc section on how to override the start of the week with each adapter (#11223) @flaviendelangle
|
|
84
|
+
- [docs] Added params to `onPaginationModelChange` docs (#10191) @JFBenzs
|
|
85
|
+
- [docs] Fix typo (#11324) @cadam11
|
|
86
|
+
- [docs] Improve `DemoContainer` styling coverage (#11315) @LukasTy
|
|
87
|
+
- [docs] General revision of the Charts docs (#11249) @danilo-leal
|
|
88
|
+
|
|
89
|
+
## 7.0.0-alpha.3
|
|
90
|
+
|
|
91
|
+
_Dec 4, 2023_
|
|
92
|
+
|
|
93
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
94
|
+
|
|
95
|
+
- 🚀 Support localized start of the week on pickers' `AdapterLuxon`
|
|
96
|
+
|
|
97
|
+
When using Luxon 3.4.4 or higher, the start of the week will be defined by the date locale (e.g.: Sunday for `en-US`, Monday for `fr-FR`).
|
|
98
|
+
|
|
99
|
+
- 📈 Fix a lot of Charts package issues
|
|
100
|
+
- 🎉 The Data Grid features Cell selection and Clipboard paste are now stable
|
|
101
|
+
- 🌍 Improve Bulgarian (bg-BG) locale on Data Grid
|
|
102
|
+
- 🐞 Bugfixes
|
|
103
|
+
- 📚 Documentation improvements
|
|
104
|
+
|
|
105
|
+
### Data Grid
|
|
106
|
+
|
|
107
|
+
#### Breaking changes
|
|
108
|
+
|
|
109
|
+
- The clipboard paste feature is now enabled by default. The flag `clipboardPaste` is no longer needed to be passed to the `experimentalFeatures` prop.
|
|
110
|
+
|
|
111
|
+
- The clipboard related exports `ignoreValueFormatterDuringExport` and `splitClipboardPastedText` are no longer prefixed with `unstable_`.
|
|
112
|
+
|
|
113
|
+
- The deprecated constants `SUBMIT_FILTER_STROKE_TIME` and `SUBMIT_FILTER_DATE_STROKE_TIME` have been removed from the `DataGrid` exports. Use the [`filterDebounceMs`](https://next.mui.com/x/api/data-grid/data-grid/#DataGrid-prop-filterDebounceMs) prop to customize filter debounce time.
|
|
114
|
+
|
|
115
|
+
- The `slots.preferencesPanel` slot and the `slotProps.preferencesPanel` prop were removed. Use `slots.panel` and `slotProps.panel` instead.
|
|
116
|
+
|
|
117
|
+
- The `GridPreferencesPanel` component is not exported anymore as it wasn't meant to be used outside of the Data Grid.
|
|
118
|
+
|
|
119
|
+
- The `unstable_` prefix has been removed from the cell selection props listed below.
|
|
120
|
+
|
|
121
|
+
| Old name | New name |
|
|
122
|
+
| :------------------------------------ | :--------------------------- |
|
|
123
|
+
| `unstable_cellSelection` | `cellSelection` |
|
|
124
|
+
| `unstable_cellSelectionModel` | `cellSelectionModel` |
|
|
125
|
+
| `unstable_onCellSelectionModelChange` | `onCellSelectionModelChange` |
|
|
126
|
+
|
|
127
|
+
- The `unstable_` prefix has been removed from the cell selection API methods listed below.
|
|
128
|
+
|
|
129
|
+
| Old name | New name |
|
|
130
|
+
| :--------------------------------- | :------------------------ |
|
|
131
|
+
| `unstable_getCellSelectionModel` | `getCellSelectionModel` |
|
|
132
|
+
| `unstable_getSelectedCellsAsArray` | `getSelectedCellsAsArray` |
|
|
133
|
+
| `unstable_isCellSelected` | `isCellSelected` |
|
|
134
|
+
| `unstable_selectCellRange` | `selectCellRange` |
|
|
135
|
+
| `unstable_setCellSelectionModel` | `setCellSelectionModel` |
|
|
136
|
+
|
|
137
|
+
- The Quick Filter now ignores hidden columns by default.
|
|
138
|
+
See [including hidden columns](https://next.mui.com/x/react-data-grid/filtering/quick-filter/#including-hidden-columns) section for more details.
|
|
139
|
+
|
|
140
|
+
#### `@mui/x-data-grid@7.0.0-alpha.3`
|
|
141
|
+
|
|
142
|
+
- [DataGrid] Fix cell editing adding a leading "v" on paste (#9205) @prasad5795
|
|
143
|
+
- [DataGrid] Exclude hidden columns from quick filtering by default (#11229) @cherniavskii
|
|
144
|
+
- [DataGrid] Fix `onFilterModelChange` being fired with stale field value (#11000) @gitstart
|
|
145
|
+
- [DataGrid] Fix handling of event target in portal (#11174) @cherniavskii
|
|
146
|
+
- [DataGrid] Remove deprecated constants (#11233) @michelengelen
|
|
147
|
+
- [DataGrid] Remove the `preferencesPanel` slot (#11228) @cherniavskii
|
|
148
|
+
- [l10n] Improve Bulgarian (bg-BG) locale (#10856) @Kristiqn95
|
|
149
|
+
|
|
150
|
+
#### `@mui/x-data-grid-pro@7.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
151
|
+
|
|
152
|
+
Same changes as in `@mui/x-data-grid@7.0.0-alpha.3`.
|
|
153
|
+
|
|
154
|
+
#### `@mui/x-data-grid-premium@7.0.0-alpha.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
155
|
+
|
|
156
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.3`, plus:
|
|
157
|
+
|
|
158
|
+
- [DataGridPremium] Fix aggregated column ignoring column definition changes (#11129) @cherniavskii
|
|
159
|
+
- [DataGridPremium] Make Cell selection feature stable (#11246) @MBilalShafi
|
|
160
|
+
- [DataGridPremium] Make Clipboard paste feature stable (#11248) @MBilalShafi
|
|
161
|
+
|
|
162
|
+
### Date Pickers
|
|
163
|
+
|
|
164
|
+
#### Breaking changes
|
|
165
|
+
|
|
166
|
+
- The Date and Time Pickers now use the localized week when using `AdapterLuxon` and Luxon v3.4.4 or higher is installed.
|
|
167
|
+
This new behavior allows `AdapterLuxon` to have the same behavior as the other adapters.
|
|
168
|
+
If you want to keep the start of the week on Monday even if your locale says otherwise, you can hardcode the week settings as follows:
|
|
169
|
+
The Firefox browser currently does not support this behavior because the [getWeekInfo](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo) API is not yet implemented.
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
import { Settings } from 'luxon';
|
|
173
|
+
|
|
174
|
+
Settings.defaultWeekSettings = {
|
|
175
|
+
firstDay: 1,
|
|
176
|
+
minimalDays: Info.getMinimumDaysInFirstWeek(),
|
|
177
|
+
weekend: [6, 7],
|
|
178
|
+
};
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
- Add new parameters to the `shortcuts` slot `onChange` callback
|
|
182
|
+
|
|
183
|
+
The `onChange` callback fired when selecting a shortcut now requires two new parameters (previously they were optional):
|
|
184
|
+
|
|
185
|
+
- The [`changeImportance`](/x/react-date-pickers/shortcuts/#behavior-when-selecting-a-shortcut) of the shortcut.
|
|
186
|
+
- The `item` containing the entire shortcut object.
|
|
187
|
+
|
|
188
|
+
```diff
|
|
189
|
+
const CustomShortcuts = (props) => {
|
|
190
|
+
return (
|
|
191
|
+
<React.Fragment>
|
|
192
|
+
{props.items.map(item => {
|
|
193
|
+
const value = item.getValue({ isValid: props.isValid });
|
|
194
|
+
return (
|
|
195
|
+
<button
|
|
196
|
+
- onClick={() => onChange(value)}
|
|
197
|
+
+ onClick={() => onChange(value, props.changeImportance ?? 'accept', item)}
|
|
198
|
+
>
|
|
199
|
+
{value}
|
|
200
|
+
</button>
|
|
201
|
+
)
|
|
202
|
+
}}
|
|
203
|
+
</React.Fragment>
|
|
204
|
+
)
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
<DatePicker slots={{ shortcuts: CustomShortcuts }} />
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
- Usage of `AdapterDayjs` with the `customParseFormat` plugin
|
|
211
|
+
The call to `dayjs.extend(customParseFormatPlugin)` has been moved to the `AdapterDayjs` constructor. This allows users to pass custom options to this plugin before the adapter uses it.
|
|
212
|
+
|
|
213
|
+
If you are using this plugin before the rendering of the first `LocalizationProvider` component and did not call `dayjs.extend` in your own codebase, you will need to manually extend `dayjs`:
|
|
214
|
+
|
|
215
|
+
```tsx
|
|
216
|
+
import dayjs from 'dayjs';
|
|
217
|
+
import customParseFormatPlugin from 'dayjs/plugin/customParseFormat';
|
|
218
|
+
|
|
219
|
+
dayjs.extend(customParseFormatPlugin);
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
The other plugins are still added before the adapter initialization.
|
|
223
|
+
|
|
224
|
+
#### `@mui/x-date-pickers@7.0.0-alpha.3`
|
|
225
|
+
|
|
226
|
+
- [pickers] Expand field placeholder methods flexibility by providing `format` parameter (#11130) @LukasTy
|
|
227
|
+
- [pickers] Make `changeImportance` and `shortcut` mandatory in `PickersShortcuts` (#10941) @flaviendelangle
|
|
228
|
+
- [pickers] Moved extend with `customParseFormat` to constructor (#11151) @michelengelen
|
|
229
|
+
- [pickers] POC: `PickersTextField` styling - outlined variant (#10778) @noraleonte
|
|
230
|
+
- [pickers] Support localized start of the week on `AdapterLuxon` (#10964) @flaviendelangle
|
|
231
|
+
- [pickers] Use adapter methods instead of date library ones whenever possible (#11142) @flaviendelangle
|
|
232
|
+
|
|
233
|
+
#### `@mui/x-date-pickers-pro@7.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
234
|
+
|
|
235
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-alpha.3`.
|
|
236
|
+
|
|
237
|
+
### Charts / `@mui/x-charts@7.0.0-alpha.3`
|
|
238
|
+
|
|
239
|
+
- [charts] Adjusted `defaultizeValueFormatter` util to accept an optional `series.valueFormatter` value (#11144) @michelengelen
|
|
240
|
+
- [charts] Apply `labelStyle` and `tickLabelStyle` props on `<ChartsYAxis />` (#11180) @akamfoad
|
|
241
|
+
- [charts] Fix TS config (#11259) @alexfauquette
|
|
242
|
+
- [charts] Fix error with empty dataset (#11063) @alexfauquette
|
|
243
|
+
- [charts] Fix export strategy (#11235) @alexfauquette
|
|
244
|
+
- [charts] Remove outdated prop-types (#11045) @alexfauquette
|
|
245
|
+
|
|
246
|
+
### Docs
|
|
247
|
+
|
|
248
|
+
- [docs] Add `TextField` styling example to customization playground (#10812) @noraleonte
|
|
249
|
+
- [docs] Add a card grid to the installation page (#11177) @danilo-leal
|
|
250
|
+
- [docs] Add end v6 blogpost to whats new page (#10999) @joserodolfofreitas
|
|
251
|
+
- [docs] Add small formatting improvements to the licensing page (#11178) @danilo-leal
|
|
252
|
+
- [docs] Document charts composition (#10710) (#11239) @alexfauquette
|
|
253
|
+
- [docs] Fix <title> generation (#11182) @oliviertassinari
|
|
254
|
+
- [docs] Fix dead anchor link (#11265) @oliviertassinari
|
|
255
|
+
- [docs] Improve Data Grid togglable columns example (#11238) @MBilalShafi
|
|
256
|
+
- [docs] Improve the prop descriptions of `DayCalendar` (#11158) @flaviendelangle
|
|
257
|
+
- [docs] Move the adapter breaking changes in a collapsable block (#11205) @flaviendelangle
|
|
258
|
+
- [docs] Polish Next.js header description @oliviertassinari
|
|
259
|
+
- [docs] Remove the `newFeature` flag on v6 features (#11168) @flaviendelangle
|
|
260
|
+
- [docs] Simplify a bit chart demo (#11173) @oliviertassinari
|
|
261
|
+
- [docs] Standardize the usage of callouts in the MUI X docs (#7127) @samuelsycamore
|
|
262
|
+
- [docs] Adjust the Data Grid demo page design (#11231) @danilo-leal
|
|
263
|
+
|
|
264
|
+
### Core
|
|
265
|
+
|
|
266
|
+
- [core] Make `@mui/system` a direct dependency (#11128) @LukasTy
|
|
267
|
+
- [core] Remove blank lines, coding style @oliviertassinari
|
|
268
|
+
- [core] Remove outdated `ENABLE_AD` env variable (#11181) @oliviertassinari
|
|
269
|
+
- [github] Do not add `plan: Pro` and `plan: Premium` labels on pro / premium issue templates (#10183) @flaviendelangle
|
|
270
|
+
|
|
6
271
|
## 7.0.0-alpha.2
|
|
7
272
|
|
|
8
273
|
_Nov 23, 2023_
|
|
@@ -684,6 +949,105 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
|
|
|
684
949
|
- [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
|
|
685
950
|
- [license] Correctly throw errors (#10924) @oliviertassinari
|
|
686
951
|
|
|
952
|
+
## 6.18.4
|
|
953
|
+
|
|
954
|
+
_Dec 8, 2023_
|
|
955
|
+
|
|
956
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
957
|
+
|
|
958
|
+
- 📚 Add [Pickers FAQ page](https://mui.com/x/react-date-pickers/faq/)
|
|
959
|
+
- 🌍 Improve Danish (da-DK) locale on Data Grid
|
|
960
|
+
- 🐞 Bugfixes
|
|
961
|
+
|
|
962
|
+
### Data Grid
|
|
963
|
+
|
|
964
|
+
#### `@mui/x-data-grid@6.18.4`
|
|
965
|
+
|
|
966
|
+
- [DataGrid] Fix cell slot style override (#11215) @oliviertassinari
|
|
967
|
+
- [l10n] Improve Danish (da-DK) locale (#11346) @goibon
|
|
968
|
+
|
|
969
|
+
#### `@mui/x-data-grid-pro@6.18.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
970
|
+
|
|
971
|
+
Same changes as in `@mui/x-data-grid@6.18.4`.
|
|
972
|
+
|
|
973
|
+
#### `@mui/x-data-grid-premium@6.18.4` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
974
|
+
|
|
975
|
+
Same changes as in `@mui/x-data-grid-pro@6.18.4`.
|
|
976
|
+
|
|
977
|
+
### Date Pickers
|
|
978
|
+
|
|
979
|
+
#### `@mui/x-date-pickers@6.18.4`
|
|
980
|
+
|
|
981
|
+
- [pickers] Fix `MultiSectionDigitalClock` issues (#11308) @LukasTy
|
|
982
|
+
|
|
983
|
+
#### `@mui/x-date-pickers-pro@6.18.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
984
|
+
|
|
985
|
+
Same changes as in `@mui/x-date-pickers@6.18.4`.
|
|
986
|
+
|
|
987
|
+
### Docs
|
|
988
|
+
|
|
989
|
+
- [docs] Fix typo (#11323) @cadam11
|
|
990
|
+
- [docs] Add FAQ page (#11347) @noraleonte
|
|
991
|
+
|
|
992
|
+
## 6.18.3
|
|
993
|
+
|
|
994
|
+
_Dec 4, 2023_
|
|
995
|
+
|
|
996
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
997
|
+
|
|
998
|
+
- 📈 Fix a lot of Charts package issues
|
|
999
|
+
- 🌍 Improve Bulgarian (bg-BG) locale on Data Grid
|
|
1000
|
+
- 🐞 Bugfixes
|
|
1001
|
+
- 📚 Documentation improvements
|
|
1002
|
+
|
|
1003
|
+
### Data Grid
|
|
1004
|
+
|
|
1005
|
+
#### `@mui/x-data-grid@6.18.3`
|
|
1006
|
+
|
|
1007
|
+
- [DataGrid] Fix cell editing adding a leading "v" on paste (#11166) @prasad5795
|
|
1008
|
+
- [DataGrid] Fix handling of event target in portal (#11209) @cherniavskii
|
|
1009
|
+
- [DataGrid] Fix `onFilterModelChange` being fired with stale field value (#11244) @gitstart
|
|
1010
|
+
- [l10n] Improve Bulgarian (bg-BG) locale (#10856) (#11206) @Kristiqn95
|
|
1011
|
+
|
|
1012
|
+
#### `@mui/x-data-grid-pro@6.18.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
1013
|
+
|
|
1014
|
+
Same changes as in `@mui/x-data-grid@6.18.3`.
|
|
1015
|
+
|
|
1016
|
+
#### `@mui/x-data-grid-premium@6.18.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
1017
|
+
|
|
1018
|
+
Same changes as in `@mui/x-data-grid-pro@6.18.3`, plus:
|
|
1019
|
+
|
|
1020
|
+
- [DataGridPremium] Fix aggregated column ignoring column definition changes (#11176) @cherniavskii
|
|
1021
|
+
- [DataGridPremium] Fix custom filter operators not working on aggregated column (#11201) @cherniavskii
|
|
1022
|
+
|
|
1023
|
+
### Date Pickers
|
|
1024
|
+
|
|
1025
|
+
#### `@mui/x-date-pickers@6.18.3`
|
|
1026
|
+
|
|
1027
|
+
- [pickers] Correctly format `MultiSectionDigitalClock` number sections (#11297) @LukasTy
|
|
1028
|
+
- [pickers] Expand field placeholder methods flexibility by providing `format` parameter (#11254) @LukasTy
|
|
1029
|
+
|
|
1030
|
+
#### `@mui/x-date-pickers-pro@6.18.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
1031
|
+
|
|
1032
|
+
Same changes as in `@mui/x-date-pickers@6.18.3`.
|
|
1033
|
+
|
|
1034
|
+
### Charts / `@mui/x-charts@6.18.3`
|
|
1035
|
+
|
|
1036
|
+
- [charts] Adjusted `defaultizeValueFormatter` util to accept an optional `series.valueFormatter` value (#11213) @michelengelen
|
|
1037
|
+
- [charts] Apply `labelStyle` and `tickLabelStyle` props on `<ChartsYAxis />` (#11180) @akamfoad
|
|
1038
|
+
- [charts] Fix TS config (#11259) @alexfauquette
|
|
1039
|
+
- [charts] Fix error with empty dataset (#11063) @alexfauquette
|
|
1040
|
+
- [charts] Fix export strategy (#11235) @alexfauquette
|
|
1041
|
+
|
|
1042
|
+
### Docs
|
|
1043
|
+
|
|
1044
|
+
- [docs] Add LTS section to support page (#11300) @joserodolfofreitas
|
|
1045
|
+
- [docs] Add end v6 blogpost to whats new page (#11299) @joserodolfofreitas
|
|
1046
|
+
- [docs] Document charts composition (#10710) @alexfauquette
|
|
1047
|
+
- [docs] Fix version links (#11167) @LukasTy
|
|
1048
|
+
- [docs] Improve Data Grid togglable columns example (#11241) @MBilalShafi
|
|
1049
|
+
- [docs] Split charts overview and getting started in distinct pages (#10910) @alexfauquette
|
|
1050
|
+
|
|
687
1051
|
## 6.18.2
|
|
688
1052
|
|
|
689
1053
|
_Nov 23, 2023_
|
package/DataGrid/DataGrid.d.ts
CHANGED
|
@@ -13,14 +13,4 @@ interface DataGridComponent {
|
|
|
13
13
|
* - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
|
|
14
14
|
*/
|
|
15
15
|
export declare const DataGrid: DataGridComponent;
|
|
16
|
-
/**
|
|
17
|
-
* Remove at v7
|
|
18
|
-
* @deprecated
|
|
19
|
-
*/
|
|
20
|
-
export declare const SUBMIT_FILTER_STROKE_TIME: number;
|
|
21
|
-
/**
|
|
22
|
-
* Remove at v7
|
|
23
|
-
* @deprecated
|
|
24
|
-
*/
|
|
25
|
-
export declare const SUBMIT_FILTER_DATE_STROKE_TIME: number;
|
|
26
16
|
export {};
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -5,7 +5,7 @@ import { chainPropTypes } from '@mui/utils';
|
|
|
5
5
|
import { GridBody, GridFooterPlaceholder, GridHeader, GridRoot } from '../components';
|
|
6
6
|
import { GridContextProvider } from '../context/GridContextProvider';
|
|
7
7
|
import { useDataGridComponent } from './useDataGridComponent';
|
|
8
|
-
import { useDataGridProps
|
|
8
|
+
import { useDataGridProps } from './useDataGridProps';
|
|
9
9
|
import { DataGridVirtualScroller } from '../components/DataGridVirtualScroller';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -35,18 +35,6 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
|
|
|
35
35
|
* - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
|
|
36
36
|
*/
|
|
37
37
|
export const DataGrid = /*#__PURE__*/React.memo(DataGridRaw);
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Remove at v7
|
|
41
|
-
* @deprecated
|
|
42
|
-
*/
|
|
43
|
-
export const SUBMIT_FILTER_STROKE_TIME = DATA_GRID_PROPS_DEFAULT_VALUES.filterDebounceMs;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Remove at v7
|
|
47
|
-
* @deprecated
|
|
48
|
-
*/
|
|
49
|
-
export const SUBMIT_FILTER_DATE_STROKE_TIME = DATA_GRID_PROPS_DEFAULT_VALUES.filterDebounceMs;
|
|
50
38
|
DataGridRaw.propTypes = {
|
|
51
39
|
// ----------------------------- Warning --------------------------------
|
|
52
40
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -274,6 +262,15 @@ DataGridRaw.propTypes = {
|
|
|
274
262
|
* @default false
|
|
275
263
|
*/
|
|
276
264
|
ignoreDiacritics: PropTypes.bool,
|
|
265
|
+
/**
|
|
266
|
+
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
267
|
+
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
268
|
+
* @default false
|
|
269
|
+
*/
|
|
270
|
+
ignoreValueFormatterDuringExport: PropTypes.oneOfType([PropTypes.shape({
|
|
271
|
+
clipboardExport: PropTypes.bool,
|
|
272
|
+
csvExport: PropTypes.bool
|
|
273
|
+
}), PropTypes.bool]),
|
|
277
274
|
/**
|
|
278
275
|
* The initial state of the DataGrid.
|
|
279
276
|
* The data in it will be set in the state on initialization but will not be controlled.
|
|
@@ -666,14 +663,5 @@ DataGridRaw.propTypes = {
|
|
|
666
663
|
/**
|
|
667
664
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
668
665
|
*/
|
|
669
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
670
|
-
/**
|
|
671
|
-
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
672
|
-
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
673
|
-
* @default false
|
|
674
|
-
*/
|
|
675
|
-
unstable_ignoreValueFormatterDuringExport: PropTypes.oneOfType([PropTypes.shape({
|
|
676
|
-
clipboardExport: PropTypes.bool,
|
|
677
|
-
csvExport: PropTypes.bool
|
|
678
|
-
}), PropTypes.bool])
|
|
666
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
679
667
|
};
|
|
@@ -68,7 +68,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
68
68
|
disableColumnResize: false,
|
|
69
69
|
keepNonExistentRowsSelected: false,
|
|
70
70
|
keepColumnPositionIfDraggedOutside: false,
|
|
71
|
-
|
|
71
|
+
ignoreValueFormatterDuringExport: false,
|
|
72
72
|
clipboardCopyCellDelimiter: '\t',
|
|
73
73
|
rowPositionsDebounceMs: 166
|
|
74
74
|
};
|
package/README.md
CHANGED
|
@@ -7,8 +7,8 @@ import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
|
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export const GRID_CHECKBOX_SELECTION_FIELD = '__check__';
|
|
9
9
|
export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF, {
|
|
10
|
+
type: 'custom',
|
|
10
11
|
field: GRID_CHECKBOX_SELECTION_FIELD,
|
|
11
|
-
type: 'checkboxSelection',
|
|
12
12
|
width: 50,
|
|
13
13
|
resizable: false,
|
|
14
14
|
sortable: false,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GridColumnTypesRecord } from '../models/colDef/gridColumnTypesRecord';
|
|
2
|
-
export declare const DEFAULT_GRID_COL_TYPE_KEY = "
|
|
1
|
+
import type { GridColumnTypesRecord } from '../models/colDef/gridColumnTypesRecord';
|
|
2
|
+
export declare const DEFAULT_GRID_COL_TYPE_KEY = "string";
|
|
3
3
|
export declare const getGridDefaultColumnTypes: () => GridColumnTypesRecord;
|
|
@@ -4,7 +4,7 @@ import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from './gridDateColDef';
|
|
|
4
4
|
import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
|
|
5
5
|
import { GRID_SINGLE_SELECT_COL_DEF } from './gridSingleSelectColDef';
|
|
6
6
|
import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from './gridActionsColDef';
|
|
7
|
-
export const DEFAULT_GRID_COL_TYPE_KEY = '
|
|
7
|
+
export const DEFAULT_GRID_COL_TYPE_KEY = 'string';
|
|
8
8
|
export const getGridDefaultColumnTypes = () => {
|
|
9
9
|
const nativeColumnTypes = {
|
|
10
10
|
string: GRID_STRING_COL_DEF,
|
|
@@ -14,7 +14,7 @@ export const getGridDefaultColumnTypes = () => {
|
|
|
14
14
|
boolean: GRID_BOOLEAN_COL_DEF,
|
|
15
15
|
singleSelect: GRID_SINGLE_SELECT_COL_DEF,
|
|
16
16
|
[GRID_ACTIONS_COLUMN_TYPE]: GRID_ACTIONS_COL_DEF,
|
|
17
|
-
|
|
17
|
+
custom: GRID_STRING_COL_DEF
|
|
18
18
|
};
|
|
19
19
|
return nativeColumnTypes;
|
|
20
20
|
};
|
package/components/GridHeader.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
4
|
+
import { GridPreferencesPanel } from './panel/GridPreferencesPanel';
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
7
|
export function GridHeader() {
|
|
7
|
-
var _rootProps$slotProps
|
|
8
|
+
var _rootProps$slotProps;
|
|
8
9
|
const rootProps = useGridRootProps();
|
|
9
10
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
10
|
-
children: [/*#__PURE__*/_jsx(
|
|
11
|
+
children: [/*#__PURE__*/_jsx(GridPreferencesPanel, {}), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.toolbar))]
|
|
11
12
|
});
|
|
12
13
|
}
|
package/components/GridRow.js
CHANGED
|
@@ -13,7 +13,7 @@ import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
|
13
13
|
import { gridColumnsTotalWidthSelector } from '../hooks/features/columns/gridColumnsSelector';
|
|
14
14
|
import { useGridSelector, objectShallowCompare } from '../hooks/utils/useGridSelector';
|
|
15
15
|
import { useGridVisibleRows } from '../hooks/utils/useGridVisibleRows';
|
|
16
|
-
import { findParentElementFromClassName } from '../utils/domUtils';
|
|
16
|
+
import { findParentElementFromClassName, isEventTargetInPortal } from '../utils/domUtils';
|
|
17
17
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../colDef/gridCheckboxSelectionColDef';
|
|
18
18
|
import { GRID_ACTIONS_COLUMN_TYPE } from '../colDef/gridActionsColDef';
|
|
19
19
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../constants/gridDetailPanelToggleField';
|
|
@@ -53,7 +53,6 @@ function EmptyCell({
|
|
|
53
53
|
style: style
|
|
54
54
|
}); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
|
|
55
55
|
}
|
|
56
|
-
|
|
57
56
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
58
57
|
const {
|
|
59
58
|
selected,
|
|
@@ -137,9 +136,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
137
136
|
}, [apiRef, currentPage.range, index, rowHeight, rowId, position]);
|
|
138
137
|
const publish = React.useCallback((eventName, propHandler) => event => {
|
|
139
138
|
// Ignore portal
|
|
140
|
-
|
|
141
|
-
// See https://github.com/mui/material-ui/issues/10534
|
|
142
|
-
if (event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
|
|
139
|
+
if (isEventTargetInPortal(event)) {
|
|
143
140
|
return;
|
|
144
141
|
}
|
|
145
142
|
|
|
@@ -196,7 +193,13 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
196
193
|
const rowReordering = rootProps.rowReordering;
|
|
197
194
|
const getCell = (column, cellProps) => {
|
|
198
195
|
var _editRowsState$rowId$, _editRowsState$rowId;
|
|
199
|
-
|
|
196
|
+
// when the cell is a reorder cell we are not allowing to reorder the col
|
|
197
|
+
// fixes https://github.com/mui/mui-x/issues/11126
|
|
198
|
+
const isReorderCell = column.field === '__reorder__';
|
|
199
|
+
const isEditingRows = Object.keys(editRowsState).length > 0;
|
|
200
|
+
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
201
|
+
const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
|
|
202
|
+
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
200
203
|
const editCellState = (_editRowsState$rowId$ = (_editRowsState$rowId = editRowsState[rowId]) == null ? void 0 : _editRowsState$rowId[column.field]) != null ? _editRowsState$rowId$ : null;
|
|
201
204
|
let cellIsNotVisible = false;
|
|
202
205
|
if (focusedCellColumnIndexNotInRange !== undefined && visibleColumns[focusedCellColumnIndexNotInRange].field === column.field) {
|
|
@@ -31,7 +31,6 @@ const GridOverlayWrapperRoot = styled('div', {
|
|
|
31
31
|
zIndex: overlayType === 'loadingOverlay' ? 5 // Should be above pinned columns, pinned rows, and detail panel
|
|
32
32
|
: 4 // Should be above pinned columns and detail panel
|
|
33
33
|
}));
|
|
34
|
-
|
|
35
34
|
const GridOverlayWrapperInner = styled('div', {
|
|
36
35
|
name: 'MuiDataGrid',
|
|
37
36
|
slot: 'OverlayWrapperInner',
|
|
@@ -67,7 +66,6 @@ function GridOverlayWrapper(props) {
|
|
|
67
66
|
if (rootProps.autoHeight && height === 0) {
|
|
68
67
|
height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
|
|
69
68
|
}
|
|
70
|
-
|
|
71
69
|
const classes = useUtilityClasses(_extends({}, props, {
|
|
72
70
|
classes: rootProps.classes
|
|
73
71
|
}));
|
|
@@ -128,7 +128,6 @@ function GridActionsCell(props) {
|
|
|
128
128
|
if (newIndex < 0 || newIndex >= numberOfButtons) {
|
|
129
129
|
return; // We're already in the first or last item = do nothing and let the grid listen the event
|
|
130
130
|
}
|
|
131
|
-
|
|
132
131
|
if (newIndex !== focusedButtonIndex) {
|
|
133
132
|
event.preventDefault(); // Prevent scrolling
|
|
134
133
|
event.stopPropagation(); // Don't stop propagation for other keys, e.g. ArrowUp
|
|
@@ -243,7 +243,6 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
243
243
|
minHeight: height,
|
|
244
244
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
245
245
|
};
|
|
246
|
-
|
|
247
246
|
return cellStyle;
|
|
248
247
|
}, [width, height, isNotVisible]);
|
|
249
248
|
React.useEffect(() => {
|
|
@@ -386,7 +385,7 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
386
385
|
} : void 0;
|
|
387
386
|
export { MemoizedCellWrapper as GridCellWrapper, GridCell };
|
|
388
387
|
const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
389
|
-
var _getActions, _ref, _rootProps$
|
|
388
|
+
var _getActions, _ref, _rootProps$cellSelect, _rootProps$experiment3, _rootProps$experiment4;
|
|
390
389
|
const {
|
|
391
390
|
column,
|
|
392
391
|
rowId,
|
|
@@ -461,8 +460,8 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
461
460
|
const cellRef = React.useRef(null);
|
|
462
461
|
const handleRef = useForkRef(ref, cellRef);
|
|
463
462
|
const focusElementRef = React.useRef(null);
|
|
464
|
-
// @ts-expect-error To access `
|
|
465
|
-
const isSelectionMode = (_rootProps$
|
|
463
|
+
// @ts-expect-error To access `cellSelection` flag as it's a `premium` feature
|
|
464
|
+
const isSelectionMode = (_rootProps$cellSelect = rootProps.cellSelection) != null ? _rootProps$cellSelect : false;
|
|
466
465
|
const ownerState = {
|
|
467
466
|
align,
|
|
468
467
|
showRightBorder,
|
|
@@ -512,7 +511,6 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
512
511
|
minHeight: height,
|
|
513
512
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
514
513
|
};
|
|
515
|
-
|
|
516
514
|
return cellStyle;
|
|
517
515
|
}, [width, height, isNotVisible]);
|
|
518
516
|
React.useEffect(() => {
|
|
@@ -63,7 +63,6 @@ function GridEditDateCell(props) {
|
|
|
63
63
|
classes: rootProps.classes
|
|
64
64
|
};
|
|
65
65
|
const classes = useUtilityClasses(ownerState);
|
|
66
|
-
const hasUpdatedEditValueOnMount = React.useRef(false);
|
|
67
66
|
const parseValueToDate = React.useCallback(value => {
|
|
68
67
|
if (value === '') {
|
|
69
68
|
return null;
|
|
@@ -109,26 +108,8 @@ function GridEditDateCell(props) {
|
|
|
109
108
|
inputRef.current.focus();
|
|
110
109
|
}
|
|
111
110
|
}, [hasFocus]);
|
|
112
|
-
const meta = apiRef.current.unstable_getEditCellMeta(id, field);
|
|
113
|
-
const handleInputRef = el => {
|
|
114
|
-
inputRef.current = el;
|
|
115
|
-
if (meta != null && meta.unstable_updateValueOnRender && !hasUpdatedEditValueOnMount.current) {
|
|
116
|
-
const inputValue = inputRef.current.value;
|
|
117
|
-
const parsedDate = parseValueToDate(inputValue);
|
|
118
|
-
setValueState({
|
|
119
|
-
parsed: parsedDate,
|
|
120
|
-
formatted: inputValue
|
|
121
|
-
});
|
|
122
|
-
apiRef.current.setEditCellValue({
|
|
123
|
-
id,
|
|
124
|
-
field,
|
|
125
|
-
value: parsedDate
|
|
126
|
-
});
|
|
127
|
-
hasUpdatedEditValueOnMount.current = true;
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
111
|
return /*#__PURE__*/_jsx(StyledInputBase, _extends({
|
|
131
|
-
inputRef:
|
|
112
|
+
inputRef: inputRef,
|
|
132
113
|
fullWidth: true,
|
|
133
114
|
className: classes.root,
|
|
134
115
|
type: isDateTime ? 'datetime-local' : 'date',
|