@mui/x-tree-view 7.0.0-beta.7 → 7.0.0
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 +195 -12
- package/README.md +1 -1
- package/RichTreeView/RichTreeView.js +12 -14
- package/RichTreeView/RichTreeView.types.d.ts +1 -1
- package/SimpleTreeView/SimpleTreeView.js +3 -4
- package/TreeItem/TreeItem.js +43 -35
- package/TreeItem/TreeItem.types.d.ts +3 -3
- package/TreeItem/TreeItemContent.d.ts +7 -7
- package/TreeItem/TreeItemContent.js +10 -10
- package/TreeItem/useTreeItemState.d.ts +1 -1
- package/TreeItem/useTreeItemState.js +13 -13
- package/TreeItem2/TreeItem2.js +16 -17
- package/TreeItem2Icon/TreeItem2Icon.js +5 -6
- package/TreeItem2Provider/TreeItem2Provider.js +3 -3
- package/TreeItem2Provider/TreeItem2Provider.types.d.ts +1 -1
- package/TreeView/TreeView.d.ts +1 -1
- package/TreeView/TreeView.js +1 -1
- package/hooks/useTreeItem2Utils/useTreeItem2Utils.d.ts +2 -2
- package/hooks/useTreeItem2Utils/useTreeItem2Utils.js +12 -12
- package/index.js +1 -1
- package/internals/hooks/useInstanceEventHandler.js +5 -10
- package/internals/models/plugin.d.ts +1 -1
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +11 -18
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.types.d.ts +3 -3
- package/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +59 -43
- package/internals/plugins/useTreeViewFocus/useTreeViewFocus.types.d.ts +6 -5
- package/internals/plugins/useTreeViewId/useTreeViewId.js +1 -1
- package/internals/plugins/useTreeViewId/useTreeViewId.types.d.ts +1 -1
- package/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.js +17 -18
- package/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.types.d.ts +2 -2
- package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +70 -77
- package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.types.d.ts +4 -1
- package/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +24 -29
- package/internals/plugins/useTreeViewNodes/useTreeViewNodes.types.d.ts +11 -11
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +18 -21
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +4 -4
- package/internals/useTreeView/useTreeView.js +5 -6
- package/internals/useTreeView/useTreeView.utils.d.ts +2 -2
- package/internals/useTreeView/useTreeView.utils.js +22 -22
- package/internals/utils/extractPluginParamsFromProps.js +2 -2
- package/internals/utils/utils.js +1 -0
- package/modern/RichTreeView/RichTreeView.js +7 -7
- package/modern/SimpleTreeView/SimpleTreeView.js +1 -1
- package/modern/TreeItem/TreeItem.js +31 -22
- package/modern/TreeItem/TreeItemContent.js +10 -10
- package/modern/TreeItem/useTreeItemState.js +13 -13
- package/modern/TreeItem2/TreeItem2.js +11 -11
- package/modern/TreeItem2Provider/TreeItem2Provider.js +3 -3
- package/modern/TreeView/TreeView.js +1 -1
- package/modern/hooks/useTreeItem2Utils/useTreeItem2Utils.js +12 -12
- package/modern/index.js +1 -1
- package/modern/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +7 -7
- package/modern/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +57 -38
- package/modern/internals/plugins/useTreeViewId/useTreeViewId.js +1 -1
- package/modern/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.js +17 -17
- package/modern/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +69 -74
- package/modern/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +19 -20
- package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +13 -13
- package/modern/internals/useTreeView/useTreeView.js +3 -4
- package/modern/internals/useTreeView/useTreeView.utils.js +22 -22
- package/modern/internals/utils/utils.js +1 -0
- package/modern/useTreeItem2/useTreeItem2.js +23 -12
- package/node/RichTreeView/RichTreeView.js +7 -7
- package/node/SimpleTreeView/SimpleTreeView.js +1 -1
- package/node/TreeItem/TreeItem.js +31 -22
- package/node/TreeItem/TreeItemContent.js +10 -10
- package/node/TreeItem/useTreeItemState.js +13 -13
- package/node/TreeItem2/TreeItem2.js +11 -11
- package/node/TreeItem2Provider/TreeItem2Provider.js +3 -3
- package/node/TreeView/TreeView.js +1 -1
- package/node/hooks/useTreeItem2Utils/useTreeItem2Utils.js +12 -12
- package/node/index.js +1 -1
- package/node/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +7 -7
- package/node/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +57 -38
- package/node/internals/plugins/useTreeViewId/useTreeViewId.js +1 -1
- package/node/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.js +17 -17
- package/node/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +69 -74
- package/node/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +19 -20
- package/node/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +13 -13
- package/node/internals/useTreeView/useTreeView.js +3 -4
- package/node/internals/useTreeView/useTreeView.utils.js +22 -22
- package/node/internals/utils/utils.js +1 -0
- package/node/useTreeItem2/useTreeItem2.js +23 -12
- package/package.json +5 -5
- package/useTreeItem2/useTreeItem2.js +26 -18
- package/useTreeItem2/useTreeItem2.types.d.ts +9 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,189 @@
|
|
|
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
|
+
## v7.0.0
|
|
7
|
+
|
|
8
|
+
_Mar 22, 2024_
|
|
9
|
+
|
|
10
|
+
We're excited to [announce the first v7 stable release](https://mui.com/blog/mui-x-v7/)! 🎉🚀
|
|
11
|
+
|
|
12
|
+
This is now the officially supported major version, where we'll keep rolling out new features, bug fixes, and improvements.
|
|
13
|
+
Migration guides are available with a complete list of the breaking changes:
|
|
14
|
+
|
|
15
|
+
- [Data Grid](https://mui.com/x/migration/migration-data-grid-v6/)
|
|
16
|
+
- [Date and Time Pickers](https://mui.com/x/migration/migration-pickers-v6/)
|
|
17
|
+
- [Tree View](https://mui.com/x/migration/migration-tree-view-v6/)
|
|
18
|
+
- [Charts](https://mui.com/x/migration/migration-charts-v6/)
|
|
19
|
+
|
|
20
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
21
|
+
|
|
22
|
+
- 🚀 Improve the usage of custom `viewRenderers` on `DateTimePicker` (#12441) @LukasTy
|
|
23
|
+
- ✨ Set focus on the focused Tree Item instead of the Tree View (#12226) @flaviendelangle
|
|
24
|
+
- 🕹️ Support controlled `density` for the Data Grid (#12332) @MBilalShafi
|
|
25
|
+
- 🎁 Dynamic virtualization range for the Data Grid (#12353) @romgrk
|
|
26
|
+
- 🐞 Bugfixes
|
|
27
|
+
- 📚 Documentation improvements
|
|
28
|
+
|
|
29
|
+
### Data Grid
|
|
30
|
+
|
|
31
|
+
#### Breaking changes
|
|
32
|
+
|
|
33
|
+
- The `density` is a [controlled prop](https://mui.com/x/react-data-grid/accessibility/#set-the-density-programmatically) now, if you were previously passing the `density` prop to the Data Grid, you will need to do one of the following:
|
|
34
|
+
|
|
35
|
+
1. Move it to the `initialState.density` to initialize it.
|
|
36
|
+
|
|
37
|
+
```diff
|
|
38
|
+
<DataGrid
|
|
39
|
+
- density="compact"
|
|
40
|
+
+ initialState={{ density: "compact" }}
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2. Move it to the state and use `onDensityChange` callback to update the `density` prop accordingly for it to work as expected.
|
|
45
|
+
|
|
46
|
+
```diff
|
|
47
|
+
+ const [density, setDensity] = React.useState<GridDensity>('compact');
|
|
48
|
+
<DataGrid
|
|
49
|
+
- density="compact"
|
|
50
|
+
+ density={density}
|
|
51
|
+
+ onDensityChange={(newDensity) => setDensity(newDensity)}
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- The selector `gridDensityValueSelector` was removed, use the `gridDensitySelector` instead.
|
|
56
|
+
|
|
57
|
+
- The props `rowBuffer` and `columnBuffer` were renamed to `rowBufferPx` and `columnBufferPx`.
|
|
58
|
+
Their value is now a pixel value rather than a number of items. Their default value is now `150`.
|
|
59
|
+
|
|
60
|
+
- The props `rowThreshold` and `columnThreshold` have been removed.
|
|
61
|
+
If you had the `rowThreshold` prop set to `0` to force new rows to be rendered more often – this is no longer necessary.
|
|
62
|
+
|
|
63
|
+
#### `@mui/x-data-grid@7.0.0`
|
|
64
|
+
|
|
65
|
+
- [DataGrid] Allow to control the grid density (#12332) @MBilalShafi
|
|
66
|
+
- [DataGrid] Dynamic virtualization range (#12353) @romgrk
|
|
67
|
+
- [DataGrid] Fix `ElementType` usage (#12479) @cherniavskii
|
|
68
|
+
- [DataGrid] Fix cell value formatting on copy (#12357) @sai6855
|
|
69
|
+
- [DataGrid] Fix checkbox selection is keeping selection when filtering (#11751) @g1mishra
|
|
70
|
+
- [DataGrid] Make `rows` an optional prop (#12478) @MBilalShafi
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-data-grid-pro@7.0.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
73
|
+
|
|
74
|
+
Same changes as in `@mui/x-data-grid@7.0.0`.
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-data-grid-premium@7.0.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
77
|
+
|
|
78
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0`, plus:
|
|
79
|
+
|
|
80
|
+
- [DataGridPremium] Add support for confirmation before clipboard paste (#12225) @cherniavskii
|
|
81
|
+
- [DataGridPremium] Fix single grouping column sorting (#9679) @cherniavskii
|
|
82
|
+
- [DataGridPremium] Fix boolean cell not rendered in group rows (#12492) @sai6855
|
|
83
|
+
|
|
84
|
+
### Date and Time Pickers
|
|
85
|
+
|
|
86
|
+
#### Breaking changes
|
|
87
|
+
|
|
88
|
+
- The `DesktopDateTimePicker` view rendering has been optimized by using the same technique as for `DesktopDateTimeRangePicker`.
|
|
89
|
+
- The `dateTimeViewRenderers` have been removed in favor of reusing existing time view renderers (`renderTimeViewClock`, `renderDigitalClockTimeView` and `renderMultiSectionDigitalClockTimeView`) and date view renderer (`renderDateViewCalendar`).
|
|
90
|
+
- Passing `renderTimeViewClock` to time view renderers will no longer revert to the old behavior of rendering only date or time view.
|
|
91
|
+
|
|
92
|
+
#### `@mui/x-date-pickers@7.0.0`
|
|
93
|
+
|
|
94
|
+
- [fields] Allow to override the separator between the start and the end date in all range fields (#12174) @flaviendelangle
|
|
95
|
+
- [fields] Support format without separator (#12489) @flaviendelangle
|
|
96
|
+
- [pickers] Use renderer interceptor on `DesktopDateTimePicker` (#12441) @LukasTy
|
|
97
|
+
|
|
98
|
+
#### `@mui/x-date-pickers-pro@7.0.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
99
|
+
|
|
100
|
+
Same changes as in `@mui/x-date-pickers@7.0.0`, plus:
|
|
101
|
+
|
|
102
|
+
- [DateTimeRangePicker] Add component `JSDoc` (#12518) @LukasTy
|
|
103
|
+
- [DateTimeRangePicker] Fix views behavior regression (#12529) @LukasTy
|
|
104
|
+
|
|
105
|
+
### Charts
|
|
106
|
+
|
|
107
|
+
#### `@mui/x-charts@7.0.0`
|
|
108
|
+
|
|
109
|
+
- [charts] Fix small typo in `CartesianContextProvider` (#12461) @Janpot
|
|
110
|
+
|
|
111
|
+
### Tree View
|
|
112
|
+
|
|
113
|
+
#### Breaking changes
|
|
114
|
+
|
|
115
|
+
- The required `nodeId` prop used by the `TreeItem` has been renamed to `itemId` for consistency:
|
|
116
|
+
|
|
117
|
+
```diff
|
|
118
|
+
<TreeView>
|
|
119
|
+
- <TreeItem label="Item 1" nodeId="one">
|
|
120
|
+
+ <TreeItem label="Item 1" itemId="one">
|
|
121
|
+
</TreeView>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- The focus is now applied to the Tree Item root element instead of the Tree View root element.
|
|
125
|
+
|
|
126
|
+
This change will allow new features that require the focus to be on the Tree Item,
|
|
127
|
+
like the drag and drop reordering of items.
|
|
128
|
+
It also solves several issues with focus management,
|
|
129
|
+
like the inability to scroll to the focused item when a lot of items are rendered.
|
|
130
|
+
|
|
131
|
+
This will mostly impact how you write tests to interact with the Tree View:
|
|
132
|
+
|
|
133
|
+
For example, if you were writing a test with `react-testing-library`, here is what the changes could look like:
|
|
134
|
+
|
|
135
|
+
```diff
|
|
136
|
+
it('test example on first item', () => {
|
|
137
|
+
- const { getByRole } = render(
|
|
138
|
+
+ const { getAllByRole } = render(
|
|
139
|
+
<SimpleTreeView>
|
|
140
|
+
<TreeItem nodeId="one" />
|
|
141
|
+
<TreeItem nodeId="two" />
|
|
142
|
+
</SimpleTreeView>
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
- const tree = getByRole('tree');
|
|
146
|
+
+ const firstTreeItem = getAllByRole('treeitem')[0];
|
|
147
|
+
act(() => {
|
|
148
|
+
- tree.focus();
|
|
149
|
+
+ firstTreeItem.focus();
|
|
150
|
+
});
|
|
151
|
+
- fireEvent.keyDown(tree, { key: 'ArrowDown' });
|
|
152
|
+
+ fireEvent.keyDown(firstTreeItem, { key: 'ArrowDown' });
|
|
153
|
+
})
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### `@mui/x-tree-view@7.0.0`
|
|
157
|
+
|
|
158
|
+
- [TreeView] Rename `nodeId` to `itemId` (#12418) @noraleonte
|
|
159
|
+
- [TreeView] Set focus on the focused Tree Item instead of the Tree View (#12226) @flaviendelangle
|
|
160
|
+
- [TreeView] Update JSDoc of the `ContentComponent` prop to avoid using the word "node" (#12476) @flaviendelangle
|
|
161
|
+
|
|
162
|
+
### `@mui/x-codemod@7.0.0`
|
|
163
|
+
|
|
164
|
+
- [codemod] Add a codemod and update the grid migration guide (#12488) @MBilalShafi
|
|
165
|
+
|
|
166
|
+
### Docs
|
|
167
|
+
|
|
168
|
+
- [docs] Finalize migration guide (#12501) @noraleonte
|
|
169
|
+
- [docs] Fix nested cells alignment in the popular features demo (#12450) @cherniavskii
|
|
170
|
+
- [docs] Fix some Vale errors (#12469) @oliviertassinari
|
|
171
|
+
- [docs] Remove mentions of pre release (#12513) @noraleonte
|
|
172
|
+
- [docs] Update branch name and tags (#12498) @cherniavskii
|
|
173
|
+
- [docs] Update links to v6 (#12496) @cherniavskii
|
|
174
|
+
- [docs] Update links to v7 docs (#12500) @noraleonte
|
|
175
|
+
- [docs] Update supported versions (#12508) @joserodolfofreitas
|
|
176
|
+
- [docs] Update "What's new in MUI X" page #12527 @cherniavskii
|
|
177
|
+
|
|
178
|
+
### Core
|
|
179
|
+
|
|
180
|
+
- [core] Bump `@mui/material` peer dependency for all packages (#12516) @LukasTy
|
|
181
|
+
- [core] Fix `no-restricted-imports` ESLint rule not working for Data Grid packages (#12477) @cherniavskii
|
|
182
|
+
- [core] Lower the frequency of `no-response` action runs (#12491) @michaldudak
|
|
183
|
+
- [core] Remove leftover `legacy` `browserlistrc` entry (#12415) @LukasTy
|
|
184
|
+
- [core] Update NPM tag (#12511) @cherniavskii
|
|
185
|
+
- [core] Update supported browsers (browserlistrc) (#12521) @LukasTy
|
|
186
|
+
- [core] Use Circle CI context @oliviertassinari
|
|
187
|
+
- [license] Fix grammar on expired license error message (#12460) @joserodolfofreitas
|
|
188
|
+
|
|
6
189
|
## 7.0.0-beta.7
|
|
7
190
|
|
|
8
191
|
_Mar 14, 2024_
|
|
@@ -90,7 +273,7 @@ The `onNodeFocus` callback has been renamed to `onItemFocus` for consistency:
|
|
|
90
273
|
- [docs] Add `legacy` bundle drop mention in migration pages (#12424) @LukasTy
|
|
91
274
|
- [docs] Add missing luxon `Info` import (#12427) @LukasTy
|
|
92
275
|
- [docs] Improve slots definitions for charts (#12408) @alexfauquette
|
|
93
|
-
- [docs] Polish What's new in MUI
|
|
276
|
+
- [docs] Polish What's new in MUI X blog titles (#12309) @oliviertassinari
|
|
94
277
|
- [docs] Replace `rel="noreferrer"` by `rel="noopener"` @oliviertassinari
|
|
95
278
|
- [docs] Update `date-fns` `weekStarsOn` overriding example (#12416) @LukasTy
|
|
96
279
|
|
|
@@ -252,7 +435,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
|
|
|
252
435
|
### Docs
|
|
253
436
|
|
|
254
437
|
- [docs] Fix image layout shift when loading @oliviertassinari
|
|
255
|
-
- [docs] Match Material
|
|
438
|
+
- [docs] Match Material UI repo comment for redirections @oliviertassinari
|
|
256
439
|
- [docs] Non breaking spaces @oliviertassinari
|
|
257
440
|
- [docs] Polish the Date Picker playground (#11869) @zanivan
|
|
258
441
|
- [docs] Standardize WAI-ARIA references @oliviertassinari
|
|
@@ -263,9 +446,9 @@ Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
|
|
|
263
446
|
- [core] Remove grid folder from `getComponentInfo` RegExp (#12241) @flaviendelangle
|
|
264
447
|
- [core] Remove `window.` reference for common globals @oliviertassinari
|
|
265
448
|
- [core] Use runtime agnostic setTimeout type @oliviertassinari
|
|
266
|
-
- [docs-infra] Fix Stack
|
|
449
|
+
- [docs-infra] Fix Stack Overflow breaking space @oliviertassinari
|
|
267
450
|
- [docs-infra] Fix missing non breaking spaces @oliviertassinari
|
|
268
|
-
- [
|
|
451
|
+
- [infra] Update `no-response` workflow (#12193) @MBilalShafi
|
|
269
452
|
- [infra] Fix missing permission reset @oliviertassinari
|
|
270
453
|
|
|
271
454
|
## 7.0.0-beta.4
|
|
@@ -282,7 +465,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
282
465
|
|
|
283
466
|
### Breaking changes
|
|
284
467
|
|
|
285
|
-
- The support for IE11 has been removed from all MUI
|
|
468
|
+
- The support for IE11 has been removed from all MUI X packages. The `legacy` bundle that used to support old browsers like IE11 is no longer included.
|
|
286
469
|
|
|
287
470
|
### Data Grid
|
|
288
471
|
|
|
@@ -324,7 +507,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
|
|
|
324
507
|
- The headless field hooks (e.g.: `useDateField`) now returns a new prop called `enableAccessibleFieldDOMStructure`.
|
|
325
508
|
This property is utilized to determine whether the anticipated UI is constructed using an accessible DOM structure. Learn more about this new [accessible DOM structure](/x/react-date-pickers/fields/#accessible-dom-structure).
|
|
326
509
|
|
|
327
|
-
|
|
510
|
+
When building a custom UI, you are most-likely only supporting one DOM structure, so you can remove `enableAccessibleFieldDOMStructure` before it is passed to the DOM:
|
|
328
511
|
|
|
329
512
|
```diff
|
|
330
513
|
function MyCustomTextField(props) {
|
|
@@ -392,7 +575,7 @@ These components are no longer exported from `@mui/x-charts`:
|
|
|
392
575
|
### Docs
|
|
393
576
|
|
|
394
577
|
- [docs] Add recipe for hiding separator on non-resizable columns (#12134) @michelengelen
|
|
395
|
-
- [docs] Add small improvements to the Gauge
|
|
578
|
+
- [docs] Add small improvements to the Gauge page (#12076) @danilo-leal
|
|
396
579
|
- [docs] Add the 'point' scaleType to the axis documentation (#12179) @alexfauquette
|
|
397
580
|
- [docs] Clarify Pickers 'Component composition' section (#12097) @LukasTy
|
|
398
581
|
- [docs] Fix "Licensing" page link (#12156) @LukasTy
|
|
@@ -975,7 +1158,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
|
|
|
975
1158
|
|
|
976
1159
|
- [charts] Do not propagate `innerRadius` and `outerRadius` to the DOM (#11689) @alexfauquette
|
|
977
1160
|
- [charts] Fix default `stackOffset` for `LineChart` (#11647) @alexfauquette
|
|
978
|
-
- [charts] Remove a
|
|
1161
|
+
- [charts] Remove a TypeScript ignore (#11688) @alexfauquette
|
|
979
1162
|
|
|
980
1163
|
### Tree View
|
|
981
1164
|
|
|
@@ -1404,7 +1587,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.7`.
|
|
|
1404
1587
|
- [core] Fix release changelog (#11496) @romgrk
|
|
1405
1588
|
- [core] Fix use of ::before & ::after (#11515) @oliviertassinari
|
|
1406
1589
|
- [core] Localize the issue template to MUI X (#11511) @oliviertassinari
|
|
1407
|
-
- [core]
|
|
1590
|
+
- [core] Regenerate API files (#11542) @flaviendelangle
|
|
1408
1591
|
- [core] Remove issue emoji @oliviertassinari
|
|
1409
1592
|
- [core] Sync the release instructions with MUI Core @oliviertassinari
|
|
1410
1593
|
- [core] Yaml format match most common convention @oliviertassinari
|
|
@@ -1447,7 +1630,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
|
|
|
1447
1630
|
|
|
1448
1631
|
- The `filterModel` now supports `Date` objects as values for `date` and `dateTime` column types.
|
|
1449
1632
|
The `filterModel` still accepts strings as values for `date` and `dateTime` column types,
|
|
1450
|
-
but all updates to the `filterModel` coming from the UI (
|
|
1633
|
+
but all updates to the `filterModel` coming from the UI (for example filter panel) will set the value as a `Date` object.
|
|
1451
1634
|
|
|
1452
1635
|
#### `@mui/x-data-grid@7.0.0-alpha.6`
|
|
1453
1636
|
|
|
@@ -1658,7 +1841,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.5`, plus:
|
|
|
1658
1841
|
### Core
|
|
1659
1842
|
|
|
1660
1843
|
- [core] Automate cherry-pick of PRs from `next` -> `master` (#11382) @MBilalShafi
|
|
1661
|
-
- [
|
|
1844
|
+
- [infra] Update `no-response` workflow (#11369) @MBilalShafi
|
|
1662
1845
|
- [test] Fix flaky screenshots (#11388) @cherniavskii
|
|
1663
1846
|
|
|
1664
1847
|
## 7.0.0-alpha.4
|
|
@@ -1896,7 +2079,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.3`.
|
|
|
1896
2079
|
|
|
1897
2080
|
- [charts] Adjusted `defaultizeValueFormatter` util to accept an optional `series.valueFormatter` value (#11144) @michelengelen
|
|
1898
2081
|
- [charts] Apply `labelStyle` and `tickLabelStyle` props on `<ChartsYAxis />` (#11180) @akamfoad
|
|
1899
|
-
- [charts] Fix
|
|
2082
|
+
- [charts] Fix TypeScript config (#11259) @alexfauquette
|
|
1900
2083
|
- [charts] Fix error with empty dataset (#11063) @alexfauquette
|
|
1901
2084
|
- [charts] Fix export strategy (#11235) @alexfauquette
|
|
1902
2085
|
- [charts] Remove outdated prop-types (#11045) @alexfauquette
|
package/README.md
CHANGED
|
@@ -36,21 +36,20 @@ function WrappedTreeItem({
|
|
|
36
36
|
slotProps,
|
|
37
37
|
label,
|
|
38
38
|
id,
|
|
39
|
-
|
|
39
|
+
itemId,
|
|
40
40
|
children
|
|
41
41
|
}) {
|
|
42
|
-
|
|
43
|
-
const Item = (_slots$item = slots == null ? void 0 : slots.item) != null ? _slots$item : TreeItem;
|
|
42
|
+
const Item = slots?.item ?? TreeItem;
|
|
44
43
|
const itemProps = useSlotProps({
|
|
45
44
|
elementType: Item,
|
|
46
|
-
externalSlotProps: slotProps
|
|
45
|
+
externalSlotProps: slotProps?.item,
|
|
47
46
|
additionalProps: {
|
|
48
|
-
|
|
47
|
+
itemId,
|
|
49
48
|
id,
|
|
50
49
|
label
|
|
51
50
|
},
|
|
52
51
|
ownerState: {
|
|
53
|
-
|
|
52
|
+
itemId,
|
|
54
53
|
label
|
|
55
54
|
}
|
|
56
55
|
});
|
|
@@ -58,7 +57,7 @@ function WrappedTreeItem({
|
|
|
58
57
|
children: children
|
|
59
58
|
}));
|
|
60
59
|
}
|
|
61
|
-
const childrenWarning = buildWarning(['MUI X: The `RichTreeView` component does not support JSX children.', 'If you want to add items, you need to use the `items` prop', 'Check the documentation for more details: https://
|
|
60
|
+
const childrenWarning = buildWarning(['MUI X: The `RichTreeView` component does not support JSX children.', 'If you want to add items, you need to use the `items` prop', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/']);
|
|
62
61
|
|
|
63
62
|
/**
|
|
64
63
|
*
|
|
@@ -71,7 +70,6 @@ const childrenWarning = buildWarning(['MUI X: The `RichTreeView` component does
|
|
|
71
70
|
* - [RichTreeView API](https://mui.com/x/api/tree-view/rich-tree-view/)
|
|
72
71
|
*/
|
|
73
72
|
const RichTreeView = /*#__PURE__*/React.forwardRef(function RichTreeView(inProps, ref) {
|
|
74
|
-
var _slots$root;
|
|
75
73
|
const props = useThemeProps({
|
|
76
74
|
props: inProps,
|
|
77
75
|
name: 'MuiRichTreeView'
|
|
@@ -97,10 +95,10 @@ const RichTreeView = /*#__PURE__*/React.forwardRef(function RichTreeView(inProps
|
|
|
97
95
|
instance
|
|
98
96
|
} = useTreeView(pluginParams);
|
|
99
97
|
const classes = useUtilityClasses(props);
|
|
100
|
-
const Root =
|
|
98
|
+
const Root = slots?.root ?? RichTreeViewRoot;
|
|
101
99
|
const rootProps = useSlotProps({
|
|
102
100
|
elementType: Root,
|
|
103
|
-
externalSlotProps: slotProps
|
|
101
|
+
externalSlotProps: slotProps?.root,
|
|
104
102
|
externalForwardedProps: otherProps,
|
|
105
103
|
className: classes.root,
|
|
106
104
|
getSlotProps: getRootProps,
|
|
@@ -109,7 +107,7 @@ const RichTreeView = /*#__PURE__*/React.forwardRef(function RichTreeView(inProps
|
|
|
109
107
|
const nodesToRender = instance.getNodesToRender();
|
|
110
108
|
const renderNode = ({
|
|
111
109
|
label,
|
|
112
|
-
|
|
110
|
+
itemId,
|
|
113
111
|
id,
|
|
114
112
|
children
|
|
115
113
|
}) => {
|
|
@@ -118,9 +116,9 @@ const RichTreeView = /*#__PURE__*/React.forwardRef(function RichTreeView(inProps
|
|
|
118
116
|
slotProps: slotProps,
|
|
119
117
|
label: label,
|
|
120
118
|
id: id,
|
|
121
|
-
|
|
122
|
-
children: children
|
|
123
|
-
},
|
|
119
|
+
itemId: itemId,
|
|
120
|
+
children: children?.map(renderNode)
|
|
121
|
+
}, itemId);
|
|
124
122
|
};
|
|
125
123
|
return /*#__PURE__*/_jsx(TreeViewProvider, {
|
|
126
124
|
value: contextValue,
|
|
@@ -9,7 +9,7 @@ import { TreeItem2Props } from '../TreeItem2';
|
|
|
9
9
|
import { TreeViewItemId } from '../models';
|
|
10
10
|
import { TreeViewPublicAPI } from '../internals/models';
|
|
11
11
|
interface RichTreeViewItemSlotOwnerState {
|
|
12
|
-
|
|
12
|
+
itemId: TreeViewItemId;
|
|
13
13
|
label: string;
|
|
14
14
|
}
|
|
15
15
|
export interface RichTreeViewSlots extends DefaultTreeViewPluginSlots {
|
|
@@ -31,7 +31,7 @@ export const SimpleTreeViewRoot = styled('ul', {
|
|
|
31
31
|
outline: 0
|
|
32
32
|
});
|
|
33
33
|
const EMPTY_ITEMS = [];
|
|
34
|
-
const itemsPropWarning = buildWarning(['MUI X: The `SimpleTreeView` component does not support the `items` prop.', 'If you want to add items, you need to pass them as JSX children.', 'Check the documentation for more details: https://
|
|
34
|
+
const itemsPropWarning = buildWarning(['MUI X: The `SimpleTreeView` component does not support the `items` prop.', 'If you want to add items, you need to pass them as JSX children.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/simple-tree-view/items/']);
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
*
|
|
@@ -44,7 +44,6 @@ const itemsPropWarning = buildWarning(['MUI X: The `SimpleTreeView` component do
|
|
|
44
44
|
* - [SimpleTreeView API](https://mui.com/x/api/tree-view/simple-tree-view/)
|
|
45
45
|
*/
|
|
46
46
|
const SimpleTreeView = /*#__PURE__*/React.forwardRef(function SimpleTreeView(inProps, ref) {
|
|
47
|
-
var _slots$root;
|
|
48
47
|
const props = useThemeProps({
|
|
49
48
|
props: inProps,
|
|
50
49
|
name: 'MuiSimpleTreeView'
|
|
@@ -72,10 +71,10 @@ const SimpleTreeView = /*#__PURE__*/React.forwardRef(function SimpleTreeView(inP
|
|
|
72
71
|
contextValue
|
|
73
72
|
} = useTreeView(pluginParams);
|
|
74
73
|
const classes = useUtilityClasses(props);
|
|
75
|
-
const Root =
|
|
74
|
+
const Root = slots?.root ?? SimpleTreeViewRoot;
|
|
76
75
|
const rootProps = useSlotProps({
|
|
77
76
|
elementType: Root,
|
|
78
|
-
externalSlotProps: slotProps
|
|
77
|
+
externalSlotProps: slotProps?.root,
|
|
79
78
|
externalForwardedProps: otherProps,
|
|
80
79
|
className: classes.root,
|
|
81
80
|
getSlotProps: getRootProps,
|
package/TreeItem/TreeItem.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "
|
|
3
|
+
const _excluded = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"],
|
|
4
4
|
_excluded2 = ["ownerState"],
|
|
5
5
|
_excluded3 = ["ownerState"],
|
|
6
6
|
_excluded4 = ["ownerState"];
|
|
@@ -137,7 +137,6 @@ const TreeItemGroup = styled(Collapse, {
|
|
|
137
137
|
* - [TreeItem API](https://mui.com/x/api/tree-view/tree-item/)
|
|
138
138
|
*/
|
|
139
139
|
export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps, inRef) {
|
|
140
|
-
var _ref, _inSlots$expandIcon, _ref2, _inSlots$collapseIcon, _inSlots$endIcon, _slots$groupTransitio;
|
|
141
140
|
const {
|
|
142
141
|
icons: contextIcons,
|
|
143
142
|
runItemPlugins,
|
|
@@ -158,11 +157,13 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
158
157
|
slotProps: inSlotProps,
|
|
159
158
|
ContentComponent = TreeItemContent,
|
|
160
159
|
ContentProps,
|
|
161
|
-
|
|
160
|
+
itemId,
|
|
162
161
|
id,
|
|
163
162
|
label,
|
|
164
163
|
onClick,
|
|
165
|
-
onMouseDown
|
|
164
|
+
onMouseDown,
|
|
165
|
+
onBlur,
|
|
166
|
+
onKeyDown
|
|
166
167
|
} = props,
|
|
167
168
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
168
169
|
const {
|
|
@@ -170,13 +171,13 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
170
171
|
rootRef
|
|
171
172
|
} = runItemPlugins(props);
|
|
172
173
|
const handleRootRef = useForkRef(inRef, rootRef);
|
|
173
|
-
const handleContentRef = useForkRef(ContentProps
|
|
174
|
+
const handleContentRef = useForkRef(ContentProps?.ref, contentRef);
|
|
174
175
|
const slots = {
|
|
175
|
-
expandIcon:
|
|
176
|
-
collapseIcon:
|
|
177
|
-
endIcon:
|
|
178
|
-
icon: inSlots
|
|
179
|
-
groupTransition: inSlots
|
|
176
|
+
expandIcon: inSlots?.expandIcon ?? contextIcons.slots.expandIcon ?? TreeViewExpandIcon,
|
|
177
|
+
collapseIcon: inSlots?.collapseIcon ?? contextIcons.slots.collapseIcon ?? TreeViewCollapseIcon,
|
|
178
|
+
endIcon: inSlots?.endIcon ?? contextIcons.slots.endIcon,
|
|
179
|
+
icon: inSlots?.icon,
|
|
180
|
+
groupTransition: inSlots?.groupTransition
|
|
180
181
|
};
|
|
181
182
|
const isExpandable = reactChildren => {
|
|
182
183
|
if (Array.isArray(reactChildren)) {
|
|
@@ -185,10 +186,10 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
185
186
|
return Boolean(reactChildren);
|
|
186
187
|
};
|
|
187
188
|
const expandable = isExpandable(children);
|
|
188
|
-
const expanded = instance.isNodeExpanded(
|
|
189
|
-
const focused = instance.isNodeFocused(
|
|
190
|
-
const selected = instance.isNodeSelected(
|
|
191
|
-
const disabled = instance.isNodeDisabled(
|
|
189
|
+
const expanded = instance.isNodeExpanded(itemId);
|
|
190
|
+
const focused = instance.isNodeFocused(itemId);
|
|
191
|
+
const selected = instance.isNodeSelected(itemId);
|
|
192
|
+
const disabled = instance.isNodeDisabled(itemId);
|
|
192
193
|
const ownerState = _extends({}, props, {
|
|
193
194
|
expanded,
|
|
194
195
|
focused,
|
|
@@ -196,11 +197,11 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
196
197
|
disabled
|
|
197
198
|
});
|
|
198
199
|
const classes = useUtilityClasses(ownerState);
|
|
199
|
-
const GroupTransition =
|
|
200
|
+
const GroupTransition = slots.groupTransition ?? undefined;
|
|
200
201
|
const groupTransitionProps = useSlotProps({
|
|
201
202
|
elementType: GroupTransition,
|
|
202
203
|
ownerState: {},
|
|
203
|
-
externalSlotProps: inSlotProps
|
|
204
|
+
externalSlotProps: inSlotProps?.groupTransition,
|
|
204
205
|
additionalProps: {
|
|
205
206
|
unmountOnExit: true,
|
|
206
207
|
in: expanded,
|
|
@@ -215,9 +216,9 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
215
216
|
ownerState: {},
|
|
216
217
|
externalSlotProps: tempOwnerState => {
|
|
217
218
|
if (expanded) {
|
|
218
|
-
return _extends({}, resolveComponentProps(contextIcons.slotProps.collapseIcon, tempOwnerState), resolveComponentProps(inSlotProps
|
|
219
|
+
return _extends({}, resolveComponentProps(contextIcons.slotProps.collapseIcon, tempOwnerState), resolveComponentProps(inSlotProps?.collapseIcon, tempOwnerState));
|
|
219
220
|
}
|
|
220
|
-
return _extends({}, resolveComponentProps(contextIcons.slotProps.expandIcon, tempOwnerState), resolveComponentProps(inSlotProps
|
|
221
|
+
return _extends({}, resolveComponentProps(contextIcons.slotProps.expandIcon, tempOwnerState), resolveComponentProps(inSlotProps?.expandIcon, tempOwnerState));
|
|
221
222
|
}
|
|
222
223
|
}),
|
|
223
224
|
expansionIconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
@@ -230,7 +231,7 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
230
231
|
if (expandable) {
|
|
231
232
|
return {};
|
|
232
233
|
}
|
|
233
|
-
return _extends({}, resolveComponentProps(contextIcons.slotProps.endIcon, tempOwnerState), resolveComponentProps(inSlotProps
|
|
234
|
+
return _extends({}, resolveComponentProps(contextIcons.slotProps.endIcon, tempOwnerState), resolveComponentProps(inSlotProps?.endIcon, tempOwnerState));
|
|
234
235
|
}
|
|
235
236
|
}),
|
|
236
237
|
displayIconProps = _objectWithoutPropertiesLoose(_useSlotProps2, _excluded3);
|
|
@@ -239,7 +240,7 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
239
240
|
const _useSlotProps3 = useSlotProps({
|
|
240
241
|
elementType: Icon,
|
|
241
242
|
ownerState: {},
|
|
242
|
-
externalSlotProps: inSlotProps
|
|
243
|
+
externalSlotProps: inSlotProps?.icon
|
|
243
244
|
}),
|
|
244
245
|
iconProps = _objectWithoutPropertiesLoose(_useSlotProps3, _excluded4);
|
|
245
246
|
const icon = Icon ? /*#__PURE__*/_jsx(Icon, _extends({}, iconProps)) : null;
|
|
@@ -250,24 +251,29 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
250
251
|
/* single-selection trees unset aria-selected on un-selected items.
|
|
251
252
|
*
|
|
252
253
|
* If the tree does not support multiple selection, aria-selected
|
|
253
|
-
* is set to true for the selected
|
|
254
|
+
* is set to true for the selected item and it is not present on any other item in the tree.
|
|
254
255
|
* Source: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/
|
|
255
256
|
*/
|
|
256
257
|
ariaSelected = true;
|
|
257
258
|
}
|
|
258
259
|
function handleFocus(event) {
|
|
259
|
-
// DOM focus stays on the tree which manages focus with aria-activedescendant
|
|
260
|
-
if (event.target === event.currentTarget) {
|
|
261
|
-
instance.focusRoot();
|
|
262
|
-
}
|
|
263
260
|
const canBeFocused = !disabled || disabledItemsFocusable;
|
|
264
261
|
if (!focused && canBeFocused && event.currentTarget === event.target) {
|
|
265
|
-
instance.focusItem(event,
|
|
262
|
+
instance.focusItem(event, itemId);
|
|
266
263
|
}
|
|
267
264
|
}
|
|
268
|
-
|
|
265
|
+
function handleBlur(event) {
|
|
266
|
+
onBlur?.(event);
|
|
267
|
+
instance.removeFocusedItem();
|
|
268
|
+
}
|
|
269
|
+
const handleKeyDown = event => {
|
|
270
|
+
onKeyDown?.(event);
|
|
271
|
+
instance.handleItemKeyDown(event, itemId);
|
|
272
|
+
};
|
|
273
|
+
const idAttribute = instance.getTreeItemId(itemId, id);
|
|
274
|
+
const tabIndex = instance.canItemBeTabbed(itemId) ? 0 : -1;
|
|
269
275
|
return /*#__PURE__*/_jsx(TreeItem2Provider, {
|
|
270
|
-
|
|
276
|
+
itemId: itemId,
|
|
271
277
|
children: /*#__PURE__*/_jsxs(TreeItemRoot, _extends({
|
|
272
278
|
className: clsx(classes.root, className),
|
|
273
279
|
role: "treeitem",
|
|
@@ -275,10 +281,12 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
275
281
|
"aria-selected": ariaSelected,
|
|
276
282
|
"aria-disabled": disabled || undefined,
|
|
277
283
|
id: idAttribute,
|
|
278
|
-
tabIndex:
|
|
284
|
+
tabIndex: tabIndex
|
|
279
285
|
}, other, {
|
|
280
286
|
ownerState: ownerState,
|
|
281
287
|
onFocus: handleFocus,
|
|
288
|
+
onBlur: handleBlur,
|
|
289
|
+
onKeyDown: handleKeyDown,
|
|
282
290
|
ref: handleRootRef,
|
|
283
291
|
children: [/*#__PURE__*/_jsx(StyledTreeItemContent, _extends({
|
|
284
292
|
as: ContentComponent,
|
|
@@ -292,7 +300,7 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
292
300
|
label: classes.label
|
|
293
301
|
},
|
|
294
302
|
label: label,
|
|
295
|
-
|
|
303
|
+
itemId: itemId,
|
|
296
304
|
onClick: onClick,
|
|
297
305
|
onMouseDown: onMouseDown,
|
|
298
306
|
icon: icon,
|
|
@@ -324,7 +332,7 @@ process.env.NODE_ENV !== "production" ? TreeItem.propTypes = {
|
|
|
324
332
|
classes: PropTypes.object,
|
|
325
333
|
className: PropTypes.string,
|
|
326
334
|
/**
|
|
327
|
-
* The component used
|
|
335
|
+
* The component used to render the content of the item.
|
|
328
336
|
* @default TreeItemContent
|
|
329
337
|
*/
|
|
330
338
|
ContentComponent: elementTypeAcceptingRef,
|
|
@@ -338,13 +346,13 @@ process.env.NODE_ENV !== "production" ? TreeItem.propTypes = {
|
|
|
338
346
|
*/
|
|
339
347
|
disabled: PropTypes.bool,
|
|
340
348
|
/**
|
|
341
|
-
* The
|
|
349
|
+
* The id of the item.
|
|
342
350
|
*/
|
|
343
|
-
|
|
351
|
+
itemId: PropTypes.string.isRequired,
|
|
344
352
|
/**
|
|
345
|
-
* The
|
|
353
|
+
* The tree item label.
|
|
346
354
|
*/
|
|
347
|
-
|
|
355
|
+
label: PropTypes.node,
|
|
348
356
|
/**
|
|
349
357
|
* This prop isn't supported.
|
|
350
358
|
* Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
|
|
@@ -58,7 +58,7 @@ export interface TreeItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>,
|
|
|
58
58
|
*/
|
|
59
59
|
slotProps?: TreeItemSlotProps;
|
|
60
60
|
/**
|
|
61
|
-
* The component used
|
|
61
|
+
* The component used to render the content of the item.
|
|
62
62
|
* @default TreeItemContent
|
|
63
63
|
*/
|
|
64
64
|
ContentComponent?: React.JSXElementConstructor<TreeItemContentProps>;
|
|
@@ -83,9 +83,9 @@ export interface TreeItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>,
|
|
|
83
83
|
*/
|
|
84
84
|
label?: React.ReactNode;
|
|
85
85
|
/**
|
|
86
|
-
* The id of the
|
|
86
|
+
* The id of the item.
|
|
87
87
|
*/
|
|
88
|
-
|
|
88
|
+
itemId: TreeViewItemId;
|
|
89
89
|
/**
|
|
90
90
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
91
91
|
*/
|