@mui/x-tree-view-pro 9.0.0-alpha.2 → 9.0.0-alpha.3

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
@@ -1,5 +1,127 @@
1
1
  # Changelog
2
2
 
3
+ ## 9.0.0-alpha.3
4
+
5
+ _Mar 12, 2026_
6
+
7
+ We'd like to extend a big thank you to the 13 contributors who made this release possible. Here are some highlights ✨:
8
+
9
+ - 🐞 Bugfixes and internal improvements
10
+
11
+ The following team members contributed to this release:
12
+ @aemartos, @alexfauquette, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @MBilalShafi, @michelengelen, @rita-codes, @sai6855, @siriwatknp
13
+
14
+ ### Data Grid
15
+
16
+ #### `@mui/x-data-grid@9.0.0-alpha.3`
17
+
18
+ - [DataGrid] Fix crash when `rows` and `rowModesModel` are updated simultaneously (#21265) @michelengelen
19
+ - [DataGrid] Add missing `resizablePanelHandle` classes to `gridClasses` object (#21538) @sai6855
20
+ - [DataGrid] Refactor `headerAlign` style calls (#21541) @sai6855
21
+
22
+ #### `@mui/x-data-grid-pro@9.0.0-alpha.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
23
+
24
+ Same changes as in `@mui/x-data-grid@9.0.0-alpha.3`, plus:
25
+
26
+ - [DataGridPro] Add `role="presentation"` to detail panel toggle header content (#21634) @michelengelen
27
+ - [DataGridPro] Fix sorting not reflected in nested server-side data (#21619) @MBilalShafi
28
+
29
+ #### `@mui/x-data-grid-premium@9.0.0-alpha.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
30
+
31
+ Same changes as in `@mui/x-data-grid-pro@9.0.0-alpha.3`.
32
+
33
+ ### Date and Time Pickers
34
+
35
+ #### `@mui/x-date-pickers@9.0.0-alpha.3`
36
+
37
+ - [pickers] Refactor `DateRangePickerDay` overrides to use a centralized `elementOverrides` object (#21426) @sai6855
38
+ - [pickers] Migrate from deprecated props for `PickersModalDialog` (#21702) @siriwatknp
39
+
40
+ #### `@mui/x-date-pickers-pro@9.0.0-alpha.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-date-pickers@9.0.0-alpha.3`.
43
+
44
+ ### Charts
45
+
46
+ #### `@mui/x-charts@9.0.0-alpha.3`
47
+
48
+ - [charts] Differentiate Line Plot roots classes (#21679) @JCQuintas
49
+ - [charts] Enable keyboard navigation by default (#21675) @alexfauquette
50
+ - [charts] Fix keyboard tooltip radar (#21667) @alexfauquette
51
+ - [charts] Fix selector default parameter (#21638) @JCQuintas
52
+ - [charts] Fix tooltip blink between node and pointer anchor (#21611) @alexfauquette
53
+ - [charts] Let tooltip and legend reflect the line shape (#21475) @alexfauquette
54
+ - [charts] Refactor `BarChart` classes structure (#21601) @JCQuintas
55
+ - [charts] Refactor `LineChart` classes structure (#21648) @JCQuintas
56
+ - [charts] Refactor `ScatterChart` classes structure (#21651) @JCQuintas
57
+ - [charts] Refactor `PieChart` classes structure (#21649) @JCQuintas
58
+ - [charts] Remove batch rendering checks in highlight selectors (#21646) @bernardobelchior
59
+ - [charts] Standardize generic arg names to `SeriesType` (#21694) @alexfauquette
60
+ - [charts] Simplify highlight hooks return types (#21695) @alexfauquette
61
+
62
+ #### `@mui/x-charts-pro@9.0.0-alpha.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
63
+
64
+ Same changes as in `@mui/x-charts@9.0.0-alpha.3`, plus:
65
+
66
+ - [charts-pro] Fix heatmap style override from `arc` to `cell` (#21693) @Copilot
67
+ - [charts-pro] Fix image export truncated when page is zoomed out (#21685) @bernardobelchior
68
+ - [charts-pro] Speed-up heatmap cell search with an index lookup (#21130) @alexfauquette
69
+ - [charts-pro] Fix heatmap highlight not working (#21710) @Copilot
70
+
71
+ #### `@mui/x-charts-premium@9.0.0-alpha.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
72
+
73
+ Same changes as in `@mui/x-charts-pro@9.0.0-alpha.3`, plus:
74
+
75
+ - [charts-premium] Re-enable WebGL tests (#21708) @bernardobelchior
76
+
77
+ ### Tree View
78
+
79
+ #### Breaking changes
80
+
81
+ - Remove `TreeViewBaseItem` type (use `TreeViewDefaultItemModelProperties` or a custom interface)
82
+ - Remove `useTreeViewApiRef` hook (use `useRichTreeViewApiRef`, `useSimpleTreeViewApiRef`, or `useRichTreeViewProApiRef`)
83
+ - Remove `status` from content slot props returned by `getContentProps()` (use `data-*` attributes; `status` on `useTreeItem` return value is unchanged)
84
+ - Remove deprecated CSS state classes from `treeItemClasses`: `expanded`, `selected`, `focused`, `disabled`, `editable`, `editing` (use `[data-expanded]`, `[data-selected]`, etc.)
85
+ - The `<RichTreeViewPro />` component has now virtualization enabled by default.
86
+ - The items used inside the `<RichTreeViewPro />` now have a default height of `32px`.
87
+ - The events of the `<RichTreeViewPro />` are now rendered as a flat list instead of a nested tree.
88
+
89
+ #### `@mui/x-tree-view@9.0.0-alpha.3`
90
+
91
+ - [tree view] Remove deprecated APIs (#21591) @flaviendelangle
92
+ - [tree view] Fix collapsed children not selected with `selectionPropagation.descendants` in `SimpleTreeView` (#21253) @flaviendelangle
93
+
94
+ #### `@mui/x-tree-view-pro@9.0.0-alpha.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
95
+
96
+ Same changes as in `@mui/x-tree-view@9.0.0-alpha.3`, plus:
97
+
98
+ - [RichTreeViewPro] Make the virtualization opt-out and port the layout doc from the data grid (#21461) @flaviendelangle
99
+
100
+ ### Codemod
101
+
102
+ #### `@mui/x-codemod@9.0.0-alpha.3`
103
+
104
+ Internal changes.
105
+
106
+ ### Docs
107
+
108
+ - [docs] Fix `AssistantWithDataSource` demo crashing (#21555) @sai6855
109
+ - [docs] Remove `Preview` pill from Sankey (#21623) @bernardobelchior
110
+ - [docs] Migrate internal Material UI deprecated APIs (#21680) @siriwatknp
111
+ - [docs] Remove `New` flag on Tree View and Date and Time Pickers features released before v9 alpha (#21585) @flaviendelangle
112
+
113
+ ### Core
114
+
115
+ - [code-infra] Remove checkout step (#21688) @Janpot
116
+ - [code-infra] Fix contributor generation in changelog (#21718) @brijeshb42
117
+ - [docs-infra] Do not point to non-existent v8 subdomain (#21640) @cherniavskii
118
+
119
+ ### Miscellaneous
120
+
121
+ - [test] Add missing tests for forwarding props to filter operators in DataGrid (#21441) @siriwatknp
122
+ - [x-license] Export additional license types and constants (#21625) @aemartos
123
+ - [x-license] Refactor license verification to accept package info object and add v9 version gating (#21690) @aemartos
124
+
3
125
  ## 9.0.0-alpha.2
4
126
 
5
127
  _Mar 5, 2026_
@@ -92,7 +214,7 @@ Internal changes.
92
214
 
93
215
  - [docs] Add backticks and parentheses to all functions and hooks (DX-173) (#21496) @mapache-salvaje
94
216
  - [docs] Remove mentions of `mySvgRef` (#21559) @bernardobelchior
95
- - [docs] Update Roadmap section in the docs (#20892) @alelthomas
217
+ - [docs] Update Roadmap section in the docs (#20892) @alelthomas
96
218
  - [docs] Add tutorial and example app for aggregation with row grouping (DX-162) (#21102) @mapache-salvaje
97
219
  - [docs] Fix missing codemod docs (#21604) @JCQuintas
98
220
 
@@ -13,9 +13,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _useMergedRefs = require("@base-ui/utils/useMergedRefs");
14
14
  var _store = require("@mui/x-internals/store");
15
15
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
16
- var _useLicenseVerifier = require("@mui/x-license/useLicenseVerifier");
17
- var _Watermark = require("@mui/x-license/Watermark");
18
- var _internals = require("@mui/x-tree-view/internals");
16
+ var _internals = require("@mui/x-license/internals");
17
+ var _internals2 = require("@mui/x-tree-view/internals");
19
18
  var _warning = require("@mui/x-internals/warning");
20
19
  var _zeroStyled = require("../internals/zero-styled");
21
20
  var _richTreeViewProClasses = require("./richTreeViewProClasses");
@@ -59,7 +58,11 @@ const RichTreeViewProRoot = exports.RichTreeViewProRoot = (0, _zeroStyled.styled
59
58
  width: '100%'
60
59
  }
61
60
  });
62
- const releaseInfo = "MTc3MjY2ODgwMDAwMA==";
61
+ const packageInfo = {
62
+ releaseDate: "MTc3MzI3MzYwMDAwMA==",
63
+ version: process.env.MUI_VERSION,
64
+ name: 'x-tree-view-pro'
65
+ };
63
66
 
64
67
  /**
65
68
  *
@@ -76,7 +79,7 @@ const RichTreeViewPro = exports.RichTreeViewPro = /*#__PURE__*/React.forwardRef(
76
79
  props: inProps,
77
80
  name: 'MuiRichTreeViewPro'
78
81
  });
79
- (0, _useLicenseVerifier.useLicenseVerifier)('x-tree-view-pro', releaseInfo);
82
+ (0, _internals.useLicenseVerifier)(packageInfo);
80
83
  if (process.env.NODE_ENV !== 'production') {
81
84
  if (props.children != null) {
82
85
  (0, _warning.warnOnce)(['MUI X: The `<RichTreeViewPro />` 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/.']);
@@ -89,9 +92,14 @@ const RichTreeViewPro = exports.RichTreeViewPro = /*#__PURE__*/React.forwardRef(
89
92
  parameters,
90
93
  forwardedProps
91
94
  } = (0, _useExtractRichTreeViewProParameters.useExtractRichTreeViewProParameters)(props);
95
+ if (process.env.NODE_ENV !== 'production') {
96
+ if (parameters.itemHeight === null && !parameters.disableVirtualization) {
97
+ (0, _warning.warnOnce)(['MUI X: `itemHeight={null}` is not compatible with virtualization.', 'Please use `disableVirtualization` when using `itemHeight={null}`.']);
98
+ }
99
+ }
92
100
 
93
101
  // Context hooks
94
- const store = (0, _internals.useTreeViewStore)(_RichTreeViewProStore.RichTreeViewProStore, parameters);
102
+ const store = (0, _internals2.useTreeViewStore)(_RichTreeViewProStore.RichTreeViewProStore, parameters);
95
103
 
96
104
  // Ref hooks
97
105
  const ref = React.useRef(null);
@@ -105,25 +113,24 @@ const RichTreeViewPro = exports.RichTreeViewPro = /*#__PURE__*/React.forwardRef(
105
113
  const slots = React.useMemo(() => (0, _extends2.default)({
106
114
  root: RichTreeViewProRoot
107
115
  }, inSlots), [inSlots]);
108
- const Renderer = isVirtualizationEnabled ? _RichTreeViewVirtualizedItems.RichTreeViewVirtualizedItems : _internals.RichTreeViewItems;
109
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.TreeViewProvider, {
116
+ const Renderer = isVirtualizationEnabled ? _RichTreeViewVirtualizedItems.RichTreeViewVirtualizedItems : _internals2.RichTreeViewItems;
117
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals2.TreeViewProvider, {
110
118
  store: store,
111
119
  classes: classes,
112
120
  slots: slots,
113
121
  slotProps: slotProps,
114
122
  apiRef: apiRef,
115
123
  rootRef: ref,
116
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.TreeViewItemDepthContext.Provider, {
117
- value: _internals.itemsSelectors.itemDepth,
124
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals2.TreeViewItemDepthContext.Provider, {
125
+ value: _internals2.itemsSelectors.itemDepth,
118
126
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Renderer, {
119
127
  slots: slots,
120
128
  slotProps: slotProps,
121
129
  forwardedProps: forwardedProps,
122
130
  ownerState: props,
123
131
  rootRef: handleRef
124
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Watermark.Watermark, {
125
- packageName: "x-tree-view-pro",
126
- releaseInfo: releaseInfo
132
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.Watermark, {
133
+ packageInfo: packageInfo
127
134
  })]
128
135
  })
129
136
  });
@@ -210,11 +217,16 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
210
217
  * @default false
211
218
  */
212
219
  disableSelection: _propTypes.default.bool,
220
+ /**
221
+ * If `true`, virtualization is disabled.
222
+ * @default false
223
+ */
224
+ disableVirtualization: _propTypes.default.bool,
213
225
  /**
214
226
  * When equal to 'flat', the tree is rendered as a flat list (children are rendered as siblings of their parents).
215
227
  * When equal to 'nested', the tree is rendered with nested children (children are rendered inside the groupTransition slot of their children).
216
228
  * Nested DOM structure is not compatible with collapse / expansion animations.
217
- * @default 'flat' when using virtualization, 'nested' otherwise
229
+ * @default 'flat'
218
230
  */
219
231
  domStructure: _propTypes.default.oneOf(['flat', 'nested']),
220
232
  /**
@@ -296,7 +308,8 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
296
308
  itemChildrenIndentation: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
297
309
  /**
298
310
  * Sets the height in pixel of an item.
299
- * If not provided, no height restriction is applied to the tree item content element.
311
+ * Set to `null` to explicitly remove any item height restriction when items have different heights (not compatible with virtualization).
312
+ * @default 32
300
313
  */
301
314
  itemHeight: _propTypes.default.number,
302
315
  items: _propTypes.default.array.isRequired,
@@ -401,12 +414,5 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
401
414
  /**
402
415
  * The system prop that allows defining system overrides as well as additional CSS styles.
403
416
  */
404
- sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
405
- /**
406
- * Whether virtualization is enabled.
407
- * If true, the DOM structure will be set to 'flat'.
408
- * If true and no itemHeight is provided, a default item height of 32px will be used for calculating the virtualization.
409
- * @default false
410
- */
411
- virtualization: _propTypes.default.bool
417
+ sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
412
418
  } : void 0;
@@ -6,8 +6,7 @@ import PropTypes from 'prop-types';
6
6
  import { useMergedRefs } from '@base-ui/utils/useMergedRefs';
7
7
  import { useStore } from '@mui/x-internals/store';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
- import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
10
- import { Watermark } from '@mui/x-license/Watermark';
9
+ import { useLicenseVerifier, Watermark } from '@mui/x-license/internals';
11
10
  import { TreeViewProvider, RichTreeViewItems, TreeViewItemDepthContext, itemsSelectors, useTreeViewStore } from '@mui/x-tree-view/internals';
12
11
  import { warnOnce } from '@mui/x-internals/warning';
13
12
  import { styled, createUseThemeProps } from "../internals/zero-styled/index.mjs";
@@ -52,7 +51,11 @@ export const RichTreeViewProRoot = styled('ul', {
52
51
  width: '100%'
53
52
  }
54
53
  });
55
- const releaseInfo = "MTc3MjY2ODgwMDAwMA==";
54
+ const packageInfo = {
55
+ releaseDate: "MTc3MzI3MzYwMDAwMA==",
56
+ version: process.env.MUI_VERSION,
57
+ name: 'x-tree-view-pro'
58
+ };
56
59
 
57
60
  /**
58
61
  *
@@ -69,7 +72,7 @@ const RichTreeViewPro = /*#__PURE__*/React.forwardRef(function RichTreeViewPro(i
69
72
  props: inProps,
70
73
  name: 'MuiRichTreeViewPro'
71
74
  });
72
- useLicenseVerifier('x-tree-view-pro', releaseInfo);
75
+ useLicenseVerifier(packageInfo);
73
76
  if (process.env.NODE_ENV !== 'production') {
74
77
  if (props.children != null) {
75
78
  warnOnce(['MUI X: The `<RichTreeViewPro />` 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/.']);
@@ -82,6 +85,11 @@ const RichTreeViewPro = /*#__PURE__*/React.forwardRef(function RichTreeViewPro(i
82
85
  parameters,
83
86
  forwardedProps
84
87
  } = useExtractRichTreeViewProParameters(props);
88
+ if (process.env.NODE_ENV !== 'production') {
89
+ if (parameters.itemHeight === null && !parameters.disableVirtualization) {
90
+ warnOnce(['MUI X: `itemHeight={null}` is not compatible with virtualization.', 'Please use `disableVirtualization` when using `itemHeight={null}`.']);
91
+ }
92
+ }
85
93
 
86
94
  // Context hooks
87
95
  const store = useTreeViewStore(RichTreeViewProStore, parameters);
@@ -115,8 +123,7 @@ const RichTreeViewPro = /*#__PURE__*/React.forwardRef(function RichTreeViewPro(i
115
123
  ownerState: props,
116
124
  rootRef: handleRef
117
125
  }), /*#__PURE__*/_jsx(Watermark, {
118
- packageName: "x-tree-view-pro",
119
- releaseInfo: releaseInfo
126
+ packageInfo: packageInfo
120
127
  })]
121
128
  })
122
129
  });
@@ -203,11 +210,16 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
203
210
  * @default false
204
211
  */
205
212
  disableSelection: PropTypes.bool,
213
+ /**
214
+ * If `true`, virtualization is disabled.
215
+ * @default false
216
+ */
217
+ disableVirtualization: PropTypes.bool,
206
218
  /**
207
219
  * When equal to 'flat', the tree is rendered as a flat list (children are rendered as siblings of their parents).
208
220
  * When equal to 'nested', the tree is rendered with nested children (children are rendered inside the groupTransition slot of their children).
209
221
  * Nested DOM structure is not compatible with collapse / expansion animations.
210
- * @default 'flat' when using virtualization, 'nested' otherwise
222
+ * @default 'flat'
211
223
  */
212
224
  domStructure: PropTypes.oneOf(['flat', 'nested']),
213
225
  /**
@@ -289,7 +301,8 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
289
301
  itemChildrenIndentation: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
290
302
  /**
291
303
  * Sets the height in pixel of an item.
292
- * If not provided, no height restriction is applied to the tree item content element.
304
+ * Set to `null` to explicitly remove any item height restriction when items have different heights (not compatible with virtualization).
305
+ * @default 32
293
306
  */
294
307
  itemHeight: PropTypes.number,
295
308
  items: PropTypes.array.isRequired,
@@ -394,13 +407,6 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
394
407
  /**
395
408
  * The system prop that allows defining system overrides as well as additional CSS styles.
396
409
  */
397
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
398
- /**
399
- * Whether virtualization is enabled.
400
- * If true, the DOM structure will be set to 'flat'.
401
- * If true and no itemHeight is provided, a default item height of 32px will be used for calculating the virtualization.
402
- * @default false
403
- */
404
- virtualization: PropTypes.bool
410
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
405
411
  } : void 0;
406
412
  export { RichTreeViewPro };
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.useExtractRichTreeViewProParameters = useExtractRichTreeViewProParameters;
9
9
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
- const _excluded = ["apiRef", "slots", "slotProps", "disabledItemsFocusable", "items", "isItemDisabled", "isItemSelectionDisabled", "getItemLabel", "getItemChildren", "getItemId", "onItemClick", "itemChildrenIndentation", "id", "expandedItems", "defaultExpandedItems", "onExpandedItemsChange", "onItemExpansionToggle", "expansionTrigger", "disableSelection", "selectedItems", "defaultSelectedItems", "multiSelect", "checkboxSelection", "selectionPropagation", "onSelectedItemsChange", "onItemSelectionToggle", "onItemFocus", "itemHeight", "onItemLabelChange", "isItemEditable", "domStructure", "dataSource", "dataSourceCache", "itemsReordering", "isItemReorderable", "canMoveItemToNewPosition", "onItemPositionChange", "virtualization"];
11
+ const _excluded = ["apiRef", "slots", "slotProps", "disabledItemsFocusable", "items", "isItemDisabled", "isItemSelectionDisabled", "getItemLabel", "getItemChildren", "getItemId", "onItemClick", "itemChildrenIndentation", "id", "expandedItems", "defaultExpandedItems", "onExpandedItemsChange", "onItemExpansionToggle", "expansionTrigger", "disableSelection", "selectedItems", "defaultSelectedItems", "multiSelect", "checkboxSelection", "selectionPropagation", "onSelectedItemsChange", "onItemSelectionToggle", "onItemFocus", "itemHeight", "onItemLabelChange", "isItemEditable", "domStructure", "dataSource", "dataSourceCache", "itemsReordering", "isItemReorderable", "canMoveItemToNewPosition", "onItemPositionChange", "disableVirtualization"];
12
12
  function useExtractRichTreeViewProParameters(props) {
13
13
  const {
14
14
  // Props for Provider
@@ -52,7 +52,7 @@ function useExtractRichTreeViewProParameters(props) {
52
52
  isItemReorderable,
53
53
  canMoveItemToNewPosition,
54
54
  onItemPositionChange,
55
- virtualization
55
+ disableVirtualization
56
56
 
57
57
  // Forwarded props
58
58
  } = props,
@@ -95,14 +95,14 @@ function useExtractRichTreeViewProParameters(props) {
95
95
  isItemReorderable,
96
96
  canMoveItemToNewPosition,
97
97
  onItemPositionChange,
98
- virtualization
98
+ disableVirtualization
99
99
  }), [
100
100
  // Shared parameters
101
101
  disabledItemsFocusable, items, isItemDisabled, isItemSelectionDisabled, getItemLabel, getItemChildren, getItemId, onItemClick, itemChildrenIndentation, id, expandedItems, defaultExpandedItems, onExpandedItemsChange, onItemExpansionToggle, expansionTrigger, disableSelection, selectedItems, defaultSelectedItems, multiSelect, checkboxSelection, selectionPropagation, onSelectedItemsChange, onItemSelectionToggle, onItemFocus, itemHeight,
102
102
  // RichTreeViewStore parameters
103
103
  onItemLabelChange, isItemEditable, domStructure,
104
104
  // RichTreeViewProStore parameters
105
- dataSource, dataSourceCache, itemsReordering, isItemReorderable, canMoveItemToNewPosition, onItemPositionChange, virtualization]);
105
+ dataSource, dataSourceCache, itemsReordering, isItemReorderable, canMoveItemToNewPosition, onItemPositionChange, disableVirtualization]);
106
106
  return {
107
107
  apiRef,
108
108
  slots,
@@ -1,5 +1,5 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
- const _excluded = ["apiRef", "slots", "slotProps", "disabledItemsFocusable", "items", "isItemDisabled", "isItemSelectionDisabled", "getItemLabel", "getItemChildren", "getItemId", "onItemClick", "itemChildrenIndentation", "id", "expandedItems", "defaultExpandedItems", "onExpandedItemsChange", "onItemExpansionToggle", "expansionTrigger", "disableSelection", "selectedItems", "defaultSelectedItems", "multiSelect", "checkboxSelection", "selectionPropagation", "onSelectedItemsChange", "onItemSelectionToggle", "onItemFocus", "itemHeight", "onItemLabelChange", "isItemEditable", "domStructure", "dataSource", "dataSourceCache", "itemsReordering", "isItemReorderable", "canMoveItemToNewPosition", "onItemPositionChange", "virtualization"];
2
+ const _excluded = ["apiRef", "slots", "slotProps", "disabledItemsFocusable", "items", "isItemDisabled", "isItemSelectionDisabled", "getItemLabel", "getItemChildren", "getItemId", "onItemClick", "itemChildrenIndentation", "id", "expandedItems", "defaultExpandedItems", "onExpandedItemsChange", "onItemExpansionToggle", "expansionTrigger", "disableSelection", "selectedItems", "defaultSelectedItems", "multiSelect", "checkboxSelection", "selectionPropagation", "onSelectedItemsChange", "onItemSelectionToggle", "onItemFocus", "itemHeight", "onItemLabelChange", "isItemEditable", "domStructure", "dataSource", "dataSourceCache", "itemsReordering", "isItemReorderable", "canMoveItemToNewPosition", "onItemPositionChange", "disableVirtualization"];
3
3
  import * as React from 'react';
4
4
  export function useExtractRichTreeViewProParameters(props) {
5
5
  const {
@@ -44,7 +44,7 @@ export function useExtractRichTreeViewProParameters(props) {
44
44
  isItemReorderable,
45
45
  canMoveItemToNewPosition,
46
46
  onItemPositionChange,
47
- virtualization
47
+ disableVirtualization
48
48
 
49
49
  // Forwarded props
50
50
  } = props,
@@ -87,14 +87,14 @@ export function useExtractRichTreeViewProParameters(props) {
87
87
  isItemReorderable,
88
88
  canMoveItemToNewPosition,
89
89
  onItemPositionChange,
90
- virtualization
90
+ disableVirtualization
91
91
  }), [
92
92
  // Shared parameters
93
93
  disabledItemsFocusable, items, isItemDisabled, isItemSelectionDisabled, getItemLabel, getItemChildren, getItemId, onItemClick, itemChildrenIndentation, id, expandedItems, defaultExpandedItems, onExpandedItemsChange, onItemExpansionToggle, expansionTrigger, disableSelection, selectedItems, defaultSelectedItems, multiSelect, checkboxSelection, selectionPropagation, onSelectedItemsChange, onItemSelectionToggle, onItemFocus, itemHeight,
94
94
  // RichTreeViewStore parameters
95
95
  onItemLabelChange, isItemEditable, domStructure,
96
96
  // RichTreeViewProStore parameters
97
- dataSource, dataSourceCache, itemsReordering, isItemReorderable, canMoveItemToNewPosition, onItemPositionChange, virtualization]);
97
+ dataSource, dataSourceCache, itemsReordering, isItemReorderable, canMoveItemToNewPosition, onItemPositionChange, disableVirtualization]);
98
98
  return {
99
99
  apiRef,
100
100
  slots,
@@ -68,7 +68,7 @@ function RichTreeViewVirtualizedItems(props) {
68
68
  const virtualizer = (0, _xVirtualizer.useVirtualizer)({
69
69
  layout,
70
70
  dimensions: {
71
- rowHeight: defaultItemHeight // The defaultItemHeight is always defined when virtualization is enabled.
71
+ rowHeight: defaultItemHeight ?? 32
72
72
  },
73
73
  virtualization: {},
74
74
  rows: items,
@@ -61,7 +61,7 @@ export function RichTreeViewVirtualizedItems(props) {
61
61
  const virtualizer = useVirtualizer({
62
62
  layout,
63
63
  dimensions: {
64
- rowHeight: defaultItemHeight // The defaultItemHeight is always defined when virtualization is enabled.
64
+ rowHeight: defaultItemHeight ?? 32
65
65
  },
66
66
  virtualization: {},
67
67
  rows: items,
package/index.d.mts CHANGED
@@ -8,5 +8,5 @@ export * from '@mui/x-tree-view/TreeItemDragAndDropOverlay';
8
8
  export * from '@mui/x-tree-view/TreeItemLabelInput';
9
9
  export * from '@mui/x-tree-view/models';
10
10
  export * from '@mui/x-tree-view/icons';
11
- export { useTreeItemUtils, useTreeItemModel, useApplyPropagationToSelectedItemsOnMount, useTreeViewApiRef } from '@mui/x-tree-view/hooks';
11
+ export { useTreeItemUtils, useTreeItemModel, useApplyPropagationToSelectedItemsOnMount } from '@mui/x-tree-view/hooks';
12
12
  export * from "./hooks/index.mjs";
package/index.d.ts CHANGED
@@ -8,5 +8,5 @@ export * from '@mui/x-tree-view/TreeItemDragAndDropOverlay';
8
8
  export * from '@mui/x-tree-view/TreeItemLabelInput';
9
9
  export * from '@mui/x-tree-view/models';
10
10
  export * from '@mui/x-tree-view/icons';
11
- export { useTreeItemUtils, useTreeItemModel, useApplyPropagationToSelectedItemsOnMount, useTreeViewApiRef } from '@mui/x-tree-view/hooks';
11
+ export { useTreeItemUtils, useTreeItemModel, useApplyPropagationToSelectedItemsOnMount } from '@mui/x-tree-view/hooks';
12
12
  export * from "./hooks/index.js";
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view-pro v9.0.0-alpha.2
2
+ * @mui/x-tree-view-pro v9.0.0-alpha.3
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
@@ -13,8 +13,7 @@ Object.defineProperty(exports, "__esModule", {
13
13
  var _exportNames = {
14
14
  useTreeItemUtils: true,
15
15
  useTreeItemModel: true,
16
- useApplyPropagationToSelectedItemsOnMount: true,
17
- useTreeViewApiRef: true
16
+ useApplyPropagationToSelectedItemsOnMount: true
18
17
  };
19
18
  Object.defineProperty(exports, "useApplyPropagationToSelectedItemsOnMount", {
20
19
  enumerable: true,
@@ -34,12 +33,6 @@ Object.defineProperty(exports, "useTreeItemUtils", {
34
33
  return _hooks.useTreeItemUtils;
35
34
  }
36
35
  });
37
- Object.defineProperty(exports, "useTreeViewApiRef", {
38
- enumerable: true,
39
- get: function () {
40
- return _hooks.useTreeViewApiRef;
41
- }
42
- });
43
36
  var _SimpleTreeView = require("@mui/x-tree-view/SimpleTreeView");
44
37
  Object.keys(_SimpleTreeView).forEach(function (key) {
45
38
  if (key === "default" || key === "__esModule") return;
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view-pro v9.0.0-alpha.2
2
+ * @mui/x-tree-view-pro v9.0.0-alpha.3
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
@@ -18,5 +18,5 @@ export * from '@mui/x-tree-view/TreeItemDragAndDropOverlay';
18
18
  export * from '@mui/x-tree-view/TreeItemLabelInput';
19
19
  export * from '@mui/x-tree-view/models';
20
20
  export * from '@mui/x-tree-view/icons';
21
- export { useTreeItemUtils, useTreeItemModel, useApplyPropagationToSelectedItemsOnMount, useTreeViewApiRef } from '@mui/x-tree-view/hooks';
21
+ export { useTreeItemUtils, useTreeItemModel, useApplyPropagationToSelectedItemsOnMount } from '@mui/x-tree-view/hooks';
22
22
  export * from "./hooks/index.mjs";
@@ -74,14 +74,18 @@ export interface RichTreeViewProStoreParameters<R extends TreeViewValidItem<R>,
74
74
  * When equal to 'flat', the tree is rendered as a flat list (children are rendered as siblings of their parents).
75
75
  * When equal to 'nested', the tree is rendered with nested children (children are rendered inside the groupTransition slot of their children).
76
76
  * Nested DOM structure is not compatible with collapse / expansion animations.
77
- * @default 'flat' when using virtualization, 'nested' otherwise
77
+ * @default 'flat'
78
78
  */
79
79
  domStructure?: TreeViewDOMStructure;
80
80
  /**
81
- * Whether virtualization is enabled.
82
- * If true, the DOM structure will be set to 'flat'.
83
- * If true and no itemHeight is provided, a default item height of 32px will be used for calculating the virtualization.
81
+ * If `true`, virtualization is disabled.
84
82
  * @default false
85
83
  */
86
- virtualization?: boolean;
84
+ disableVirtualization?: boolean;
85
+ /**
86
+ * Sets the height in pixel of an item.
87
+ * Set to `null` to explicitly remove any item height restriction when items have different heights (not compatible with virtualization).
88
+ * @default 32
89
+ */
90
+ itemHeight?: number | null;
87
91
  }
@@ -74,14 +74,18 @@ export interface RichTreeViewProStoreParameters<R extends TreeViewValidItem<R>,
74
74
  * When equal to 'flat', the tree is rendered as a flat list (children are rendered as siblings of their parents).
75
75
  * When equal to 'nested', the tree is rendered with nested children (children are rendered inside the groupTransition slot of their children).
76
76
  * Nested DOM structure is not compatible with collapse / expansion animations.
77
- * @default 'flat' when using virtualization, 'nested' otherwise
77
+ * @default 'flat'
78
78
  */
79
79
  domStructure?: TreeViewDOMStructure;
80
80
  /**
81
- * Whether virtualization is enabled.
82
- * If true, the DOM structure will be set to 'flat'.
83
- * If true and no itemHeight is provided, a default item height of 32px will be used for calculating the virtualization.
81
+ * If `true`, virtualization is disabled.
84
82
  * @default false
85
83
  */
86
- virtualization?: boolean;
84
+ disableVirtualization?: boolean;
85
+ /**
86
+ * Sets the height in pixel of an item.
87
+ * Set to `null` to explicitly remove any item height restriction when items have different heights (not compatible with virtualization).
88
+ * @default 32
89
+ */
90
+ itemHeight?: number | null;
87
91
  }
@@ -10,14 +10,14 @@ var _internals = require("@mui/x-tree-view/internals");
10
10
  var _lazyLoading = require("../plugins/lazyLoading");
11
11
  const DEFAULT_IS_ITEM_REORDERABLE_WHEN_ENABLED = () => true;
12
12
  const DEFAULT_IS_ITEM_REORDERABLE_WHEN_DISABLED = () => false;
13
- const DEFAULT_ITEM_HEIGHT_WITH_VIRTUALIZATION = 32;
13
+ const DEFAULT_ITEM_HEIGHT = 32;
14
14
  const deriveStateFromParameters = parameters => ({
15
15
  lazyLoadedItems: parameters.dataSource ? _lazyLoading.TREE_VIEW_LAZY_LOADED_ITEMS_INITIAL_STATE : null,
16
16
  currentReorder: null,
17
17
  isItemReorderable: parameters.itemsReordering ? parameters.isItemReorderable ?? DEFAULT_IS_ITEM_REORDERABLE_WHEN_ENABLED : DEFAULT_IS_ITEM_REORDERABLE_WHEN_DISABLED,
18
- domStructure: parameters.domStructure ?? (parameters.virtualization ? 'flat' : 'nested'),
19
- virtualization: parameters.virtualization ?? false,
20
- itemHeight: parameters.itemHeight ?? (parameters.virtualization ? DEFAULT_ITEM_HEIGHT_WITH_VIRTUALIZATION : null)
18
+ domStructure: parameters.domStructure ?? 'flat',
19
+ virtualization: !(parameters.disableVirtualization ?? false),
20
+ itemHeight: parameters.itemHeight === undefined ? DEFAULT_ITEM_HEIGHT : parameters.itemHeight
21
21
  });
22
22
  const parametersToStateMapper = exports.parametersToStateMapper = {
23
23
  getInitialState: (minimalInitialState, parameters) => (0, _extends2.default)({}, _internals.ExtendableRichTreeViewStore.rawMapper.getInitialState(minimalInitialState, parameters), deriveStateFromParameters(parameters)),
@@ -3,14 +3,14 @@ import { ExtendableRichTreeViewStore } from '@mui/x-tree-view/internals';
3
3
  import { TREE_VIEW_LAZY_LOADED_ITEMS_INITIAL_STATE } from "../plugins/lazyLoading/index.mjs";
4
4
  const DEFAULT_IS_ITEM_REORDERABLE_WHEN_ENABLED = () => true;
5
5
  const DEFAULT_IS_ITEM_REORDERABLE_WHEN_DISABLED = () => false;
6
- const DEFAULT_ITEM_HEIGHT_WITH_VIRTUALIZATION = 32;
6
+ const DEFAULT_ITEM_HEIGHT = 32;
7
7
  const deriveStateFromParameters = parameters => ({
8
8
  lazyLoadedItems: parameters.dataSource ? TREE_VIEW_LAZY_LOADED_ITEMS_INITIAL_STATE : null,
9
9
  currentReorder: null,
10
10
  isItemReorderable: parameters.itemsReordering ? parameters.isItemReorderable ?? DEFAULT_IS_ITEM_REORDERABLE_WHEN_ENABLED : DEFAULT_IS_ITEM_REORDERABLE_WHEN_DISABLED,
11
- domStructure: parameters.domStructure ?? (parameters.virtualization ? 'flat' : 'nested'),
12
- virtualization: parameters.virtualization ?? false,
13
- itemHeight: parameters.itemHeight ?? (parameters.virtualization ? DEFAULT_ITEM_HEIGHT_WITH_VIRTUALIZATION : null)
11
+ domStructure: parameters.domStructure ?? 'flat',
12
+ virtualization: !(parameters.disableVirtualization ?? false),
13
+ itemHeight: parameters.itemHeight === undefined ? DEFAULT_ITEM_HEIGHT : parameters.itemHeight
14
14
  });
15
15
  export const parametersToStateMapper = {
16
16
  getInitialState: (minimalInitialState, parameters) => _extends({}, ExtendableRichTreeViewStore.rawMapper.getInitialState(minimalInitialState, parameters), deriveStateFromParameters(parameters)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-tree-view-pro",
3
- "version": "9.0.0-alpha.2",
3
+ "version": "9.0.0-alpha.3",
4
4
  "author": "MUI Team",
5
5
  "description": "The Pro plan edition of the MUI X Tree View components.",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -41,8 +41,8 @@
41
41
  "reselect": "^5.1.1",
42
42
  "use-sync-external-store": "^1.6.0",
43
43
  "@mui/x-internals": "9.0.0-alpha.2",
44
- "@mui/x-license": "9.0.0-alpha.2",
45
- "@mui/x-tree-view": "9.0.0-alpha.2",
44
+ "@mui/x-license": "9.0.0-alpha.3",
45
+ "@mui/x-tree-view": "9.0.0-alpha.3",
46
46
  "@mui/x-virtualizer": "1.0.0-alpha.1"
47
47
  },
48
48
  "peerDependencies": {