@mui/x-tree-view 7.0.0-alpha.9 → 7.0.0-beta.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 CHANGED
@@ -3,6 +3,106 @@
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-beta.0
7
+
8
+ _Jan 26, 2024_
9
+
10
+ We are glad to announce MUI X v7 beta!
11
+ This version has several improvements, bug fixes, and exciting features 🎉.
12
+ We want to offer a big thanks to the 7 contributors who made this release possible ✨:
13
+
14
+ - 🚀 Release the [Date Time Range Picker](https://next.mui.com/x/react-date-pickers/date-time-range-picker/) component (#9528) @LukasTy
15
+
16
+ <img src="https://github.com/mui/mui-x/assets/4941090/122bb7bc-5e72-4e11-a8e5-96f3026de922" width="510" height="652" alt="Date Time Range Picker example" />
17
+
18
+ - 🎁 New column management panel design for the Data Grid (#11770) @MBilalShafi
19
+
20
+ <img width="310" alt="image" src="https://github.com/mui/mui-x/assets/12609561/a79dac8b-d54d-4e69-a63a-ef78f3993f37">
21
+
22
+ - 🐞 Bugfixes
23
+ - 📚 Documentation improvements
24
+
25
+ ### Data Grid
26
+
27
+ #### Breaking changes
28
+
29
+ - The columns management component has been redesigned and the component was extracted from the `ColumnsPanel` which now only serves as a wrapper to display the component above the headers as a panel. As a result, a new slot `columnsManagement` and the related prop `slotProps.columnsManagement` have been introduced. The props corresponding to the columns management component which were previously passed to the prop `slotProps.columnsPanel` should now be passed to `slotProps.columnsManagement`. `slotProps.columnsPanel` could still be used to override props corresponding to the `Panel` component used in `ColumnsPanel` which uses [`Popper`](https://next.mui.com/material-ui/react-popper/) component under the hood.
30
+
31
+ ```diff
32
+ <DataGrid
33
+ slotProps={{
34
+ - columnsPanel: {
35
+ + columnsManagement: {
36
+ sort: 'asc',
37
+ autoFocusSearchField: false,
38
+ },
39
+ }}
40
+ />
41
+ ```
42
+
43
+ - `Show all` and `Hide all` buttons in the `ColumnsPanel` have been combined into one `Show/Hide All` toggle in the new columns management component. The related props `disableShowAllButton` and `disableHideAllButton` have been replaced with a new prop `disableShowHideToggle`.
44
+
45
+ ```diff
46
+ <DataGrid
47
+ - disableShowAllButton
48
+ - disableHideAllButton
49
+ + disableShowHideToggle
50
+ />
51
+ ```
52
+
53
+ #### `@mui/x-data-grid@7.0.0-beta.0`
54
+
55
+ - [DataGrid] Export `GridColumnTypes` interface for custom column types (#11742) @cherniavskii
56
+ - [DataGrid] Initialize `apiRef` early (#11792) @cherniavskii
57
+ - [DataGrid] New column management panel design (#11770) @MBilalShafi
58
+ - [DataGrid] Fix support for tree with more than 50,000 children (#11757) @zenazn
59
+
60
+ #### `@mui/x-data-grid-pro@7.0.0-beta.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
61
+
62
+ Same changes as in `@mui/x-data-grid@7.0.0-beta.0`.
63
+
64
+ #### `@mui/x-data-grid-premium@7.0.0-beta.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
65
+
66
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.0`.
67
+
68
+ ### Date Pickers
69
+
70
+ #### `@mui/x-date-pickers@7.0.0-beta.0`
71
+
72
+ - [pickers] Apply the `layout.tabs` class to `Tabs` slot (#11781) @LukasTy
73
+ - [pickers] Avoid deep imports (#11794) @LukasTy
74
+ - [pickers] Fields typing optimization (#11779) @LukasTy
75
+
76
+ #### `@mui/x-date-pickers-pro@7.0.0-beta.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
77
+
78
+ Same changes as in `@mui/x-date-pickers@7.0.0-beta.0`, plus:
79
+
80
+ - [pickers] Add `DateTimeRangePicker` component (#9528) @LukasTy
81
+ - [pickers] Add `DateTimeRangePicker` theme augmentation (#11814) @LukasTy
82
+ - [DateRangePicker] Remove `calendars` prop on `Mobile` (#11752) @LukasTy
83
+
84
+ ### Tree View / `@mui/x-tree-view@7.0.0-beta.0`
85
+
86
+ - [TreeView] Remove unused props from prop-types and typing (#11778) @flaviendelangle
87
+ - [TreeView] Throw an error when two items have the same id (#11715) @flaviendelangle
88
+
89
+ ### Docs
90
+
91
+ - [docs] Add `contextValue` to the headless tree view doc (#11705) @flaviendelangle
92
+ - [docs] Add section for the `disableSelection` prop (#11821) @flaviendelangle
93
+ - [docs] Fix brand name non-breaking space (#11758) @oliviertassinari
94
+ - [docs] Fix typo in Data Grid components page (#11775) @flaviendelangle
95
+ - [docs] Fix use of quote, should use callout (#11759) @oliviertassinari
96
+ - [docs] Improve error message for MUI Vale rule @oliviertassinari
97
+ - [docs] Include `DateTimeRangePicker` in relevant demos (#11815) @LukasTy
98
+ - [docs] Add recipe for sorting row groups by the number of child rows (#11164) @cherniavskii
99
+
100
+ ### Core
101
+
102
+ - [core] Cleanup script and alias setup (#11749) @LukasTy
103
+ - [core] Polish issue templates @oliviertassinari
104
+ - [code-infra] Update prettier and pretty-quick (#11735) @Janpot
105
+
6
106
  ## 7.0.0-alpha.9
7
107
 
8
108
  _Jan 19, 2024_
@@ -138,14 +238,14 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
138
238
  #### Breaking changes
139
239
 
140
240
  - The `expandIcon` / `defaultExpandIcon` props, used to expand the children of a node (rendered when it is collapsed),
141
- is now defined as a slot both on the Tree View and the Tree Item components.
241
+ is now defined as a slot both on the Tree View and the Tree Item components.
142
242
 
143
243
  If you were using the `ChevronRight` icon from `@mui/icons-material`,
144
244
  you can stop passing it to your component because it is now the default value:
145
245
 
146
246
  ```diff
147
247
  -import ChevronRightIcon from '@mui/icons-material/ChevronRight';
148
-
248
+
149
249
  <SimpleTreeView
150
250
  - defaultExpandIcon={<ChevronRightIcon />}
151
251
  >
@@ -180,14 +280,14 @@ is now defined as a slot both on the Tree View and the Tree Item components.
180
280
  ```
181
281
 
182
282
  - The `collapseIcon` / `defaultCollapseIcon` props, used to collapse the children of a node (rendered when it is expanded),
183
- is now defined as a slot both on the Tree View and the Tree Item components.
283
+ is now defined as a slot both on the Tree View and the Tree Item components.
184
284
 
185
285
  If you were using the `ExpandMore` icon from `@mui/icons-material`,
186
286
  you can stop passing it to your component because it is now the default value:
187
287
 
188
288
  ```diff
189
289
  - import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
190
-
290
+
191
291
  <SimpleTreeView
192
292
  - defaultCollapseIcon={<ExpandMoreIcon />}
193
293
  >
@@ -227,14 +327,14 @@ is now defined as a slot both on the Tree View and the Tree Item components.
227
327
  ```diff
228
328
  -import { TreeItem, useTreeItem } from '@mui/x-tree-view/TreeItem';
229
329
  +import { TreeItem, useTreeItemState } from '@mui/x-tree-view/TreeItem';
230
-
330
+
231
331
  const CustomContent = React.forwardRef((props, ref) => {
232
332
  - const { disabled } = useTreeItem(props.nodeId);
233
333
  + const { disabled } = useTreeItemState(props.nodeId);
234
-
334
+
235
335
  // Render some UI
236
336
  });
237
-
337
+
238
338
  function App() {
239
339
  return (
240
340
  <SimpleTreeView>
@@ -412,7 +512,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.8`.
412
512
 
413
513
  - [docs] Fix parsing of `x-date-pickers-pro` demo adapter imports (#11628) @LukasTy
414
514
  - [docs] Improve `git diff` format @oliviertassinari
415
- - [docs] Push up the MUI X brand (#11533) @oliviertassinari
515
+ - [docs] Push up the MUI X brand (#11533) @oliviertassinari
416
516
  - [docs] Remove old data grid translation files (#11646) @cherniavskii
417
517
  - [docs] Improve Server-side data grid docs (#11589) @oliviertassinari
418
518
  - [docs] Improve charts landing page (#11570) @oliviertassinari
@@ -422,8 +522,8 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.8`.
422
522
  - [core] Lock `jsdom` version (#11652) @cherniavskii
423
523
  - [core] Remove PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD (#11608) @oliviertassinari
424
524
  - [core] Simplify isSsr logic (#11606) @oliviertassinari
425
- - [core] Sync playwright cache between MUI X and Material UI (#11607) @oliviertassinari
426
- - [core] Use MUI X official name in errors (#11645) @oliviertassinari
525
+ - [core] Sync playwright cache between MUI X and Material UI (#11607) @oliviertassinari
526
+ - [core] Use MUI X official name in errors (#11645) @oliviertassinari
427
527
 
428
528
  ## 7.0.0-alpha.7
429
529
 
@@ -455,7 +555,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
455
555
  items={MUI_X_PRODUCTS}
456
556
  defaultCollapseIcon={<ExpandMoreIcon />}
457
557
  defaultExpandIcon={<ChevronRightIcon />}
458
- />
558
+ />;
459
559
  ```
460
560
 
461
561
  - 🌍 Improve Czech (cs-CZ) locale on the Data Grid
@@ -559,10 +659,10 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.7`.
559
659
 
560
660
  - [core] Fix release changelog (#11496) @romgrk
561
661
  - [core] Fix use of ::before & ::after (#11515) @oliviertassinari
562
- - [core] Localize the issue template to MUI X (#11511) @oliviertassinari
662
+ - [core] Localize the issue template to MUI X (#11511) @oliviertassinari
563
663
  - [core] Regen api files (#11542) @flaviendelangle
564
664
  - [core] Remove issue emoji @oliviertassinari
565
- - [core] Sync the release instructions with MUI Core @oliviertassinari
665
+ - [core] Sync the release instructions with MUI Core @oliviertassinari
566
666
  - [core] Yaml format match most common convention @oliviertassinari
567
667
 
568
668
  ## 7.0.0-alpha.6
@@ -600,6 +700,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
600
700
  getOptionLabel: (value: any) => value.name,
601
701
  };
602
702
  ```
703
+
603
704
  - The `filterModel` now supports `Date` objects as values for `date` and `dateTime` column types.
604
705
  The `filterModel` still accepts strings as values for `date` and `dateTime` column types,
605
706
  but all updates to the `filterModel` coming from the UI (e.g. filter panel) will set the value as a `Date` object.
@@ -693,7 +794,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.5`.
693
794
  #### Breaking changes
694
795
 
695
796
  - The slot interfaces got renamed to match with `@mui/base` naming.
696
- The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsProps` with `SlotProps`.
797
+ The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsProps` with `SlotProps`.
697
798
 
698
799
  ```diff
699
800
  -DateCalendarSlotsComponent
@@ -1071,7 +1172,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.3`.
1071
1172
  - [docs] Polish Next.js header description @oliviertassinari
1072
1173
  - [docs] Remove the `newFeature` flag on v6 features (#11168) @flaviendelangle
1073
1174
  - [docs] Simplify a bit chart demo (#11173) @oliviertassinari
1074
- - [docs] Standardize the usage of callouts in the MUI X docs (#7127) @samuelsycamore
1175
+ - [docs] Standardize the usage of callouts in the MUI X docs (#7127) @samuelsycamore
1075
1176
  - [docs] Adjust the Data Grid demo page design (#11231) @danilo-leal
1076
1177
 
1077
1178
  ### Core
@@ -1460,15 +1561,15 @@ And if you need the exact same output you can apply the following transformation
1460
1561
  // For Day.js
1461
1562
  -const isoString = adapter.toISO(value);
1462
1563
  +const isoString = value.toISOString();
1463
-
1564
+
1464
1565
  // For Luxon
1465
1566
  -const isoString = adapter.toISO(value);
1466
1567
  +const isoString = value.toUTC().toISO({ format: 'extended' });
1467
-
1568
+
1468
1569
  // For DateFns
1469
1570
  -const isoString = adapter.toISO(value);
1470
1571
  +const isoString = dateFns.formatISO(value, { format: 'extended' });
1471
-
1572
+
1472
1573
  // For Moment
1473
1574
  -const isoString = adapter.toISO(value);
1474
1575
  +const isoString = value.toISOString();
@@ -1836,7 +1937,7 @@ Same changes as in `@mui/x-date-pickers@6.19.0`.
1836
1937
 
1837
1938
  - [docs] Add missing component @oliviertassinari
1838
1939
  - [docs] Fix parsing of `x-date-pickers-pro` demo adapter imports (#11637) @LukasTy
1839
- - [docs] Push up the MUI X brand (#11533) @oliviertassinari
1940
+ - [docs] Push up the MUI X brand (#11533) @oliviertassinari
1840
1941
  - [docs] Improve Server-side data grid docs (#11589) @oliviertassinari
1841
1942
  - [docs] Add demo to the charts overview page (#11586) @danilo-leal
1842
1943
  - [docs] Fix 404 links in the docs @oliviertassinari
@@ -2196,7 +2297,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
2196
2297
  - 🥧 Pie charts are now animated.
2197
2298
  - 📈 Line charts now support partial data, and can interpolate missing data https://mui.com/x/react-charts/lines/#skip-missing-points.
2198
2299
 
2199
- <img src="https://github.com/mui/mui-x/assets/3165635/d2d50b1b-ee29-4e4c-9ebe-629c06f3093e" width="683" height="436" />
2300
+ <img src="https://github.com/mui/mui-x/assets/3165635/d2d50b1b-ee29-4e4c-9ebe-629c06f3093e" width="683" height="436" alt="Charts partial data" />
2200
2301
 
2201
2302
  - ✨ The data grid allows to ignore [diacritics](https://en.wikipedia.org/wiki/Diacritic) when filtering.
2202
2303
  - 📚 Documentation improvements
@@ -2690,7 +2791,7 @@ Same changes as in `@mui/x-date-pickers@6.15.0`.
2690
2791
  - [docs] Add missing MIT packages on the Licensing page (#10348) @flaviendelangle
2691
2792
  - [docs] Clearer component pattern @oliviertassinari
2692
2793
  - [docs] Easier to understand demo (#10370) @oliviertassinari
2693
- - [docs] Fix `301` to Material UI @oliviertassinari
2794
+ - [docs] Fix `301` to Material UI @oliviertassinari
2694
2795
  - [docs] Improve the column visibility section (#10327) @MBilalShafi
2695
2796
  - [docs] Improve the documentation section `rowIdentifier` (#10326) @MBilalShafi
2696
2797
  - [docs] Improve pickers localization documentation (#10202) @flaviendelangle
@@ -2768,12 +2869,12 @@ Same changes as in `@mui/x-date-pickers@6.14.0`.
2768
2869
  - [docs] Add conditional range picker props example (#10227) @LukasTy
2769
2870
  - [docs] Add toolbar to the multi-filters demo (#10223) @MBilalShafi
2770
2871
  - [docs] Avoid the use of "We" @oliviertassinari
2771
- - [docs] Clarify MUI vs. MUI Core difference @oliviertassinari
2872
+ - [docs] Clarify MUI vs. MUI Core difference @oliviertassinari
2772
2873
  - [docs] Enable `ariaV7` flag for demos using `useDemoData` hook (#10204) @cherniavskii
2773
2874
  - [docs] Fix Tree View link to API references (#10282) @oliviertassinari
2774
2875
  - [docs] Fix image layout shift (#10313) @oliviertassinari
2775
- - [docs] Fix link to MUI X from readme logo @oliviertassinari
2776
- - [docs] Fix redirection to Base UI URLs @oliviertassinari
2876
+ - [docs] Fix link to MUI X from readme logo @oliviertassinari
2877
+ - [docs] Fix redirection to Base UI URLs @oliviertassinari
2777
2878
  - [docs] Improve Tree View demos (#10268) @oliviertassinari
2778
2879
  - [docs] Improve docs for ref type props (#10273) @michelengelen
2779
2880
  - [docs] Improve npm package README (#10269) @oliviertassinari
@@ -2857,7 +2958,7 @@ Same changes as in `@mui/x-date-pickers@6.13.0`, plus:
2857
2958
  - [docs] Improve the week picker example (#8257) @flaviendelangle
2858
2959
  - [docs] Include code links in the data grid demo (#10219) @cherniavskii
2859
2960
  - [docs] Polish page for SEO (#10216) @oliviertassinari
2860
- - [docs] Use `Base UI` `Portal` for the quick filter recipe (#10188) @DanailH
2961
+ - [docs] Use `Base UI` `Portal` for the quick filter recipe (#10188) @DanailH
2861
2962
 
2862
2963
  ### Core
2863
2964
 
@@ -3118,7 +3219,7 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
3118
3219
 
3119
3220
  - ⌚️ Move the tree view component from `@mui/lab` package
3120
3221
 
3121
- The `<TreeView />` component has been moved to the MUI X repository.
3222
+ The `<TreeView />` component has been moved to the MUI X repository.
3122
3223
  It is now accessible from its own package: `@mui/x-tree-view`.
3123
3224
 
3124
3225
  - 🌍 Improve Hebrew (he-IL), Finnish (fi-FI), and Italian (it-IT) locales on the data grid
@@ -3180,7 +3281,7 @@ Same changes as in `@mui/x-date-pickers@6.11.0`.
3180
3281
 
3181
3282
  - [docs] Add Tree View doc (#9825) @flaviendelangle
3182
3283
  - [docs] Add charts nav item (#9821) @LukasTy
3183
- - [docs] Add charts to MUI X introduction pages (#9704) @joserodolfofreitas
3284
+ - [docs] Add charts to MUI X introduction pages (#9704) @joserodolfofreitas
3184
3285
  - [docs] Add example for avoiding picker views layout shift (#9781) @noraleonte
3185
3286
  - [docs] Consistency of Next.js App Router @oliviertassinari
3186
3287
  - [docs] Fix API page regression: bring back slots section (#9866) @alexfauquette
@@ -3249,7 +3350,7 @@ Same changes as in `@mui/x-date-pickers@6.10.2`.
3249
3350
  ### Docs
3250
3351
 
3251
3352
  - [docs] Add `pnpm` in more places @oliviertassinari
3252
- - [docs] Add `pnpm` installation instructions for MUI X (#9707) @richbustos
3353
+ - [docs] Add `pnpm` installation instructions for MUI X (#9707) @richbustos
3253
3354
  - [docs] Align pickers "uncontrolled vs controlled" sections (#9772) @LukasTy
3254
3355
  - [docs] Apply style guide to the data grid Layout page (#9673) @richbustos
3255
3356
  - [docs] Differentiate between packages in `slotProps` docs (#9668) @cherniavskii
@@ -3558,7 +3659,7 @@ We'd like to offer a big thanks to the 11 contributors who made this release pos
3558
3659
 
3559
3660
  - 🚀 Introducing UTC and timezone support for pickers.
3560
3661
 
3561
- <img width="774" src="https://github.com/mui/mui-x/assets/3165635/ad95a404-ee67-4aff-b996-ad6cbb322348">
3662
+ <img width="774" src="https://github.com/mui/mui-x/assets/3165635/ad95a404-ee67-4aff-b996-ad6cbb322348" alt="Pickers time zone switching">
3562
3663
 
3563
3664
  Visit the [documentation](https://mui.com/x/react-date-pickers/timezone/) to learn how to use it.
3564
3665
 
@@ -3610,7 +3711,7 @@ Same changes as in `@mui/x-date-pickers@6.9.0`.
3610
3711
 
3611
3712
  - [docs] Add examples of using different time view renderers (#9360) @LukasTy
3612
3713
  - [docs] Add recipe for single-click editing (#8365) @m4theushw
3613
- - [docs] Fix Base UI references (#9349) @oliviertassinari
3714
+ - [docs] Fix Base UI references (#9349) @oliviertassinari
3614
3715
  - [docs] Fix random screenshot generation (#9364) @cherniavskii
3615
3716
  - [docs] Remove random generation from chart doc example (#9343) @flaviendelangle
3616
3717
  - [docs] Sync h1 with sidenav link (#9252) @oliviertassinari
@@ -3794,7 +3895,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
3794
3895
 
3795
3896
  - 🚀 New date time picking UI on [`DesktopDateTimePicker`](https://mui.com/x/react-date-pickers/date-time-picker/)
3796
3897
 
3797
- <img src="https://github.com/mui/mui-x/assets/3165635/4e1fe9f9-03eb-4f23-99dd-80212b21fb23" width="840" height="506" />
3898
+ <img src="https://github.com/mui/mui-x/assets/3165635/4e1fe9f9-03eb-4f23-99dd-80212b21fb23" width="840" height="506" alt="Desktop Date Time Picker example" />
3798
3899
 
3799
3900
  - 🚀 Performance improvements
3800
3901
  - 🐞 Bugfixes
@@ -3870,7 +3971,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
3870
3971
 
3871
3972
  - 💫 Introduce filtering on column headers for `DataGridPro` and `DataGridPremium`:
3872
3973
 
3873
- <img src="https://github.com/mui/mui-x/releases/download/v6.5.0/recording.gif" width="840" height="506" />
3974
+ <img src="https://github.com/mui/mui-x/releases/download/v6.5.0/recording.gif" width="840" height="506" alt="Filtering on column headers example" />
3874
3975
 
3875
3976
  See [the documentation](https://mui.com/x/react-data-grid/filtering/header-filters/) for more information
3876
3977
 
@@ -4029,7 +4130,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
4029
4130
 
4030
4131
  - 🚀 New [time-picking UI](https://mui.com/x/react-date-pickers/digital-clock/) designed for desktops (#7958) @LukasTy
4031
4132
 
4032
- <img src="https://user-images.githubusercontent.com/4941090/235072007-de39a397-e4a4-4c98-8e10-5ee4ad440108.gif" width="494" />
4133
+ <img src="https://user-images.githubusercontent.com/4941090/235072007-de39a397-e4a4-4c98-8e10-5ee4ad440108.gif" width="494" alt="New digital clock time picker" />
4033
4134
 
4034
4135
  - ✨ Picker fields [now always include a leading zero](https://mui.com/x/react-date-pickers/adapters-locale/#respect-leading-zeros-in-fields) on digit sections (#8527) @flaviendelangle
4035
4136
  - 🌍 Improve Chinese (zh-CN), French (fr-FR), and Turkish (tr-TR) locales
@@ -4405,7 +4506,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
4405
4506
  - [docs] Add a warning for `luxon` macro tokens (#8245) @flaviendelangle
4406
4507
  - [docs] Complete pickers customization pages (#8066) @alexfauquette
4407
4508
  - [docs] Fix 301 redirection @oliviertassinari
4408
- - [docs] Fix 404 links to customization Material UI APIs (#8200) @oliviertassinari
4509
+ - [docs] Fix 404 links to customization Material UI APIs (#8200) @oliviertassinari
4409
4510
  - [docs] Fix `moment-hijri` demo (#8255) @LukasTy
4410
4511
  - [docs] Improve migration diff (#8240) @oliviertassinari
4411
4512
  - [docs] Change **What's new** page url to point to announcement blog post (#8186) @joserodolfofreitas
@@ -4836,7 +4937,7 @@ We'd like to offer a big thanks to the 17 contributors who made this release pos
4836
4937
 
4837
4938
  _Jan 19, 2023_
4838
4939
 
4839
- After a long period in alpha, we're glad to announce the first MUI X v6 beta!
4940
+ After a long period in alpha, we're glad to announce the first MUI X v6 beta!
4840
4941
  We encourage you to try out this version, packed with improvements, bug fixes, and a few highlighted features ✨:
4841
4942
 
4842
4943
  **Data Grid**
@@ -6092,7 +6193,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
6092
6193
  #### Breaking changes
6093
6194
 
6094
6195
  - The `ToolbarComponent` has been replaced by a `Toolbar` component slot.
6095
- You can find more information about this pattern in the [Base UI documentation](https://mui.com/base-ui/getting-started/usage/#shared-props):
6196
+ You can find more information about this pattern in the [Base UI documentation](https://mui.com/base-ui/getting-started/usage/#shared-props):
6096
6197
 
6097
6198
  ```diff
6098
6199
  // Same on all other pickers
@@ -6243,7 +6344,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
6243
6344
 
6244
6345
  #### Breaking changes
6245
6346
 
6246
- - All the props used by the mobile and desktop wrappers to override components or components' props have been replaced by component slots. You can find more information about this pattern in the [Base UI documentation](https://mui.com/base-ui/getting-started/usage/#shared-props).
6347
+ - All the props used by the mobile and desktop wrappers to override components or components' props have been replaced by component slots. You can find more information about this pattern in the [Base UI documentation](https://mui.com/base-ui/getting-started/usage/#shared-props).
6247
6348
 
6248
6349
  Some of the names have also been prefixed by `desktop` when it was unclear that the behavior was only applied on the desktop version of the pickers (or the responsive version when used on a desktop).
6249
6350
 
@@ -6432,7 +6533,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
6432
6533
  #### Breaking changes
6433
6534
 
6434
6535
  - The `renderDay` prop has been replaced by a `Day` component slot.
6435
- You can find more information about this pattern in the [Base UI documentation](https://mui.com/base-ui/getting-started/usage/#shared-props).
6536
+ You can find more information about this pattern in the [Base UI documentation](https://mui.com/base-ui/getting-started/usage/#shared-props).
6436
6537
 
6437
6538
  ```diff
6438
6539
  // Same for any other date, date time or date range picker.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # MUI X Tree View
1
+ # MUI X Tree View
2
2
 
3
3
  This package is the community edition of the tree view components.
4
- It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.
4
+ It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.
5
5
 
6
6
  ## Installation
7
7
 
@@ -127,24 +127,6 @@ process.env.NODE_ENV !== "production" ? SimpleTreeView.propTypes = {
127
127
  * Used when the item's expansion is controlled.
128
128
  */
129
129
  expandedNodes: PropTypes.arrayOf(PropTypes.string),
130
- /**
131
- * Used to determine the string label for a given item.
132
- *
133
- * @template R
134
- * @param {R} item The item to check.
135
- * @returns {string} The id of the item.
136
- * @default `(item) => item.id`
137
- */
138
- getItemId: PropTypes.func,
139
- /**
140
- * Used to determine the string label for a given item.
141
- *
142
- * @template R
143
- * @param {R} item The item to check.
144
- * @returns {string} The label of the item.
145
- * @default `(item) => item.label`
146
- */
147
- getItemLabel: PropTypes.func,
148
130
  /**
149
131
  * This prop is used to help implement the accessibility logic.
150
132
  * If you don't provide this prop. It falls back to a randomly generated id.
@@ -4,5 +4,5 @@ export declare const SIMPLE_TREE_VIEW_PLUGINS: readonly [import("../internals/mo
4
4
  export type SimpleTreeViewPlugins = ConvertPluginsIntoSignatures<typeof SIMPLE_TREE_VIEW_PLUGINS>;
5
5
  export type SimpleTreeViewPluginSlots = DefaultTreeViewPluginSlots;
6
6
  export type SimpleTreeViewPluginSlotProps = DefaultTreeViewPluginSlotProps;
7
- export interface SimpleTreeViewPluginParameters<Multiple extends boolean | undefined> extends Omit<DefaultTreeViewPluginParameters<any, Multiple>, 'items' | 'isItemDisabled'> {
7
+ export interface SimpleTreeViewPluginParameters<Multiple extends boolean | undefined> extends Omit<DefaultTreeViewPluginParameters<any, Multiple>, 'items' | 'isItemDisabled' | 'getItemLabel' | 'getItemId'> {
8
8
  }
@@ -100,24 +100,6 @@ process.env.NODE_ENV !== "production" ? TreeView.propTypes = {
100
100
  * Used when the item's expansion is controlled.
101
101
  */
102
102
  expandedNodes: PropTypes.arrayOf(PropTypes.string),
103
- /**
104
- * Used to determine the string label for a given item.
105
- *
106
- * @template R
107
- * @param {R} item The item to check.
108
- * @returns {string} The id of the item.
109
- * @default `(item) => item.id`
110
- */
111
- getItemId: PropTypes.func,
112
- /**
113
- * Used to determine the string label for a given item.
114
- *
115
- * @template R
116
- * @param {R} item The item to check.
117
- * @returns {string} The label of the item.
118
- * @default `(item) => item.label`
119
- */
120
- getItemLabel: PropTypes.func,
121
103
  /**
122
104
  * This prop is used to help implement the accessibility logic.
123
105
  * If you don't provide this prop. It falls back to a randomly generated id.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.0.0-alpha.9
2
+ * @mui/x-tree-view v7.0.0-beta.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -12,11 +12,16 @@ export const useTreeViewJSXNodes = ({
12
12
  setState
13
13
  }) => {
14
14
  const insertJSXNode = useEventCallback(node => {
15
- setState(prevState => _extends({}, prevState, {
16
- nodeMap: _extends({}, prevState.nodeMap, {
17
- [node.id]: node
18
- })
19
- }));
15
+ setState(prevState => {
16
+ if (prevState.nodeMap[node.id] != null) {
17
+ throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', `Tow items were provided with the same id in the \`items\` prop: "${node.id}"`].join('\n'));
18
+ }
19
+ return _extends({}, prevState, {
20
+ nodeMap: _extends({}, prevState.nodeMap, {
21
+ [node.id]: node
22
+ })
23
+ });
24
+ });
20
25
  });
21
26
  const removeJSXNode = useEventCallback(nodeId => {
22
27
  setState(prevState => {
@@ -16,6 +16,9 @@ const updateState = ({
16
16
  if (id == null) {
17
17
  throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', 'An item was provided without id in the `items` prop:', JSON.stringify(item)].join('\n'));
18
18
  }
19
+ if (nodeMap[id] != null) {
20
+ throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', `Tow items were provided with the same id in the \`items\` prop: "${id}"`].join('\n'));
21
+ }
19
22
  const label = getItemLabel ? getItemLabel(item) : item.label;
20
23
  if (label == null) {
21
24
  throw new Error(['MUI X: The Tree View component requires all items to have a `label` property.', 'Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.', 'An item was provided without label in the `items` prop:', JSON.stringify(item)].join('\n'));
@@ -125,24 +125,6 @@ process.env.NODE_ENV !== "production" ? SimpleTreeView.propTypes = {
125
125
  * Used when the item's expansion is controlled.
126
126
  */
127
127
  expandedNodes: PropTypes.arrayOf(PropTypes.string),
128
- /**
129
- * Used to determine the string label for a given item.
130
- *
131
- * @template R
132
- * @param {R} item The item to check.
133
- * @returns {string} The id of the item.
134
- * @default `(item) => item.id`
135
- */
136
- getItemId: PropTypes.func,
137
- /**
138
- * Used to determine the string label for a given item.
139
- *
140
- * @template R
141
- * @param {R} item The item to check.
142
- * @returns {string} The label of the item.
143
- * @default `(item) => item.label`
144
- */
145
- getItemLabel: PropTypes.func,
146
128
  /**
147
129
  * This prop is used to help implement the accessibility logic.
148
130
  * If you don't provide this prop. It falls back to a randomly generated id.
@@ -100,24 +100,6 @@ process.env.NODE_ENV !== "production" ? TreeView.propTypes = {
100
100
  * Used when the item's expansion is controlled.
101
101
  */
102
102
  expandedNodes: PropTypes.arrayOf(PropTypes.string),
103
- /**
104
- * Used to determine the string label for a given item.
105
- *
106
- * @template R
107
- * @param {R} item The item to check.
108
- * @returns {string} The id of the item.
109
- * @default `(item) => item.id`
110
- */
111
- getItemId: PropTypes.func,
112
- /**
113
- * Used to determine the string label for a given item.
114
- *
115
- * @template R
116
- * @param {R} item The item to check.
117
- * @returns {string} The label of the item.
118
- * @default `(item) => item.label`
119
- */
120
- getItemLabel: PropTypes.func,
121
103
  /**
122
104
  * This prop is used to help implement the accessibility logic.
123
105
  * If you don't provide this prop. It falls back to a randomly generated id.
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.0.0-alpha.9
2
+ * @mui/x-tree-view v7.0.0-beta.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -14,6 +14,9 @@ export var useTreeViewJSXNodes = function useTreeViewJSXNodes(_ref) {
14
14
  setState = _ref.setState;
15
15
  var insertJSXNode = useEventCallback(function (node) {
16
16
  setState(function (prevState) {
17
+ if (prevState.nodeMap[node.id] != null) {
18
+ throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', "Tow items were provided with the same id in the `items` prop: \"".concat(node.id, "\"")].join('\n'));
19
+ }
17
20
  return _extends({}, prevState, {
18
21
  nodeMap: _extends({}, prevState.nodeMap, _defineProperty({}, node.id, node))
19
22
  });
@@ -15,6 +15,9 @@ var updateState = function updateState(_ref) {
15
15
  if (id == null) {
16
16
  throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', 'An item was provided without id in the `items` prop:', JSON.stringify(item)].join('\n'));
17
17
  }
18
+ if (nodeMap[id] != null) {
19
+ throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', "Tow items were provided with the same id in the `items` prop: \"".concat(id, "\"")].join('\n'));
20
+ }
18
21
  var label = getItemLabel ? getItemLabel(item) : item.label;
19
22
  if (label == null) {
20
23
  throw new Error(['MUI X: The Tree View component requires all items to have a `label` property.', 'Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.', 'An item was provided without label in the `items` prop:', JSON.stringify(item)].join('\n'));
@@ -126,24 +126,6 @@ process.env.NODE_ENV !== "production" ? SimpleTreeView.propTypes = {
126
126
  * Used when the item's expansion is controlled.
127
127
  */
128
128
  expandedNodes: PropTypes.arrayOf(PropTypes.string),
129
- /**
130
- * Used to determine the string label for a given item.
131
- *
132
- * @template R
133
- * @param {R} item The item to check.
134
- * @returns {string} The id of the item.
135
- * @default `(item) => item.id`
136
- */
137
- getItemId: PropTypes.func,
138
- /**
139
- * Used to determine the string label for a given item.
140
- *
141
- * @template R
142
- * @param {R} item The item to check.
143
- * @returns {string} The label of the item.
144
- * @default `(item) => item.label`
145
- */
146
- getItemLabel: PropTypes.func,
147
129
  /**
148
130
  * This prop is used to help implement the accessibility logic.
149
131
  * If you don't provide this prop. It falls back to a randomly generated id.
@@ -100,24 +100,6 @@ process.env.NODE_ENV !== "production" ? TreeView.propTypes = {
100
100
  * Used when the item's expansion is controlled.
101
101
  */
102
102
  expandedNodes: PropTypes.arrayOf(PropTypes.string),
103
- /**
104
- * Used to determine the string label for a given item.
105
- *
106
- * @template R
107
- * @param {R} item The item to check.
108
- * @returns {string} The id of the item.
109
- * @default `(item) => item.id`
110
- */
111
- getItemId: PropTypes.func,
112
- /**
113
- * Used to determine the string label for a given item.
114
- *
115
- * @template R
116
- * @param {R} item The item to check.
117
- * @returns {string} The label of the item.
118
- * @default `(item) => item.label`
119
- */
120
- getItemLabel: PropTypes.func,
121
103
  /**
122
104
  * This prop is used to help implement the accessibility logic.
123
105
  * If you don't provide this prop. It falls back to a randomly generated id.
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.0.0-alpha.9
2
+ * @mui/x-tree-view v7.0.0-beta.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -12,11 +12,16 @@ export const useTreeViewJSXNodes = ({
12
12
  setState
13
13
  }) => {
14
14
  const insertJSXNode = useEventCallback(node => {
15
- setState(prevState => _extends({}, prevState, {
16
- nodeMap: _extends({}, prevState.nodeMap, {
17
- [node.id]: node
18
- })
19
- }));
15
+ setState(prevState => {
16
+ if (prevState.nodeMap[node.id] != null) {
17
+ throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', `Tow items were provided with the same id in the \`items\` prop: "${node.id}"`].join('\n'));
18
+ }
19
+ return _extends({}, prevState, {
20
+ nodeMap: _extends({}, prevState.nodeMap, {
21
+ [node.id]: node
22
+ })
23
+ });
24
+ });
20
25
  });
21
26
  const removeJSXNode = useEventCallback(nodeId => {
22
27
  setState(prevState => {
@@ -15,6 +15,9 @@ const updateState = ({
15
15
  if (id == null) {
16
16
  throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', 'An item was provided without id in the `items` prop:', JSON.stringify(item)].join('\n'));
17
17
  }
18
+ if (nodeMap[id] != null) {
19
+ throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', `Tow items were provided with the same id in the \`items\` prop: "${id}"`].join('\n'));
20
+ }
18
21
  const label = getItemLabel ? getItemLabel(item) : item.label;
19
22
  if (label == null) {
20
23
  throw new Error(['MUI X: The Tree View component requires all items to have a `label` property.', 'Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.', 'An item was provided without label in the `items` prop:', JSON.stringify(item)].join('\n'));
@@ -135,24 +135,6 @@ process.env.NODE_ENV !== "production" ? SimpleTreeView.propTypes = {
135
135
  * Used when the item's expansion is controlled.
136
136
  */
137
137
  expandedNodes: _propTypes.default.arrayOf(_propTypes.default.string),
138
- /**
139
- * Used to determine the string label for a given item.
140
- *
141
- * @template R
142
- * @param {R} item The item to check.
143
- * @returns {string} The id of the item.
144
- * @default `(item) => item.id`
145
- */
146
- getItemId: _propTypes.default.func,
147
- /**
148
- * Used to determine the string label for a given item.
149
- *
150
- * @template R
151
- * @param {R} item The item to check.
152
- * @returns {string} The label of the item.
153
- * @default `(item) => item.label`
154
- */
155
- getItemLabel: _propTypes.default.func,
156
138
  /**
157
139
  * This prop is used to help implement the accessibility logic.
158
140
  * If you don't provide this prop. It falls back to a randomly generated id.
@@ -109,24 +109,6 @@ process.env.NODE_ENV !== "production" ? TreeView.propTypes = {
109
109
  * Used when the item's expansion is controlled.
110
110
  */
111
111
  expandedNodes: _propTypes.default.arrayOf(_propTypes.default.string),
112
- /**
113
- * Used to determine the string label for a given item.
114
- *
115
- * @template R
116
- * @param {R} item The item to check.
117
- * @returns {string} The id of the item.
118
- * @default `(item) => item.id`
119
- */
120
- getItemId: _propTypes.default.func,
121
- /**
122
- * Used to determine the string label for a given item.
123
- *
124
- * @template R
125
- * @param {R} item The item to check.
126
- * @returns {string} The label of the item.
127
- * @default `(item) => item.label`
128
- */
129
- getItemLabel: _propTypes.default.func,
130
112
  /**
131
113
  * This prop is used to help implement the accessibility logic.
132
114
  * If you don't provide this prop. It falls back to a randomly generated id.
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.0.0-alpha.9
2
+ * @mui/x-tree-view v7.0.0-beta.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -21,11 +21,16 @@ const useTreeViewJSXNodes = ({
21
21
  setState
22
22
  }) => {
23
23
  const insertJSXNode = (0, _useEventCallback.default)(node => {
24
- setState(prevState => (0, _extends2.default)({}, prevState, {
25
- nodeMap: (0, _extends2.default)({}, prevState.nodeMap, {
26
- [node.id]: node
27
- })
28
- }));
24
+ setState(prevState => {
25
+ if (prevState.nodeMap[node.id] != null) {
26
+ throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', `Tow items were provided with the same id in the \`items\` prop: "${node.id}"`].join('\n'));
27
+ }
28
+ return (0, _extends2.default)({}, prevState, {
29
+ nodeMap: (0, _extends2.default)({}, prevState.nodeMap, {
30
+ [node.id]: node
31
+ })
32
+ });
33
+ });
29
34
  });
30
35
  const removeJSXNode = (0, _useEventCallback.default)(nodeId => {
31
36
  setState(prevState => {
@@ -24,6 +24,9 @@ const updateState = ({
24
24
  if (id == null) {
25
25
  throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', 'An item was provided without id in the `items` prop:', JSON.stringify(item)].join('\n'));
26
26
  }
27
+ if (nodeMap[id] != null) {
28
+ throw new Error(['MUI X: The Tree View component requires all items to have a unique `id` property.', 'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.', `Tow items were provided with the same id in the \`items\` prop: "${id}"`].join('\n'));
29
+ }
27
30
  const label = getItemLabel ? getItemLabel(item) : item.label;
28
31
  if (label == null) {
29
32
  throw new Error(['MUI X: The Tree View component requires all items to have a `label` property.', 'Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.', 'An item was provided without label in the `items` prop:', JSON.stringify(item)].join('\n'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-tree-view",
3
- "version": "7.0.0-alpha.9",
3
+ "version": "7.0.0-beta.0",
4
4
  "description": "The community edition of the tree view components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -33,9 +33,9 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.23.8",
36
- "@mui/base": "^5.0.0-beta.32",
37
- "@mui/system": "^5.15.5",
38
- "@mui/utils": "^5.15.5",
36
+ "@mui/base": "^5.0.0-beta.33",
37
+ "@mui/system": "^5.15.6",
38
+ "@mui/utils": "^5.15.6",
39
39
  "@types/react-transition-group": "^4.4.10",
40
40
  "clsx": "^2.1.0",
41
41
  "prop-types": "^15.8.1",