@mui/x-tree-view-pro 7.12.1 → 7.14.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,167 @@
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.14.0
7
+
8
+ _Aug 23, 2024_
9
+
10
+ We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 💫 Allow [filtering the axis on zoom](https://mui.com/x/react-charts/zoom-and-pan/#zoom-filtering), making the axis adapt by removing values outside the view.
13
+
14
+ <img width="600" src="https://github.com/user-attachments/assets/e65bbd00-d2a8-4136-81cd-3598f1373c16" alt="filtering the axis on zoom" />
15
+
16
+ - 📊 Improve bar chart performances
17
+ - 🌍 Improve Czech (cs-CZ) and Hebrew (he-IL) locales on the Data Grid
18
+ - 🌍 Improve Chinese (zh-HK), Hebrew (he-IL), and Vietnamese (vi-VN) locales on the Date and Time Pickers
19
+ - 🐞 Bugfixes
20
+
21
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
22
+
23
+ ### Data Grid
24
+
25
+ #### `@mui/x-data-grid@7.14.0`
26
+
27
+ - [DataGrid] Use readonly array result for `getTreeDataPath` (#11743) @pcorpet
28
+ - [DataGrid] Use `event.key` for `Tab` and `Escape` keys (#14170) @k-rajat19
29
+ - [DataGrid] Introduce selectors with arguments (#14236) @MBilalShafi
30
+ - [DataGrid] include `api` in `gridCellParams` interface (#14201) @k-rajat19
31
+ - [l10n] Improve Czech (cs-CZ) locale (#14135) @chirimiri22
32
+ - [l10n] Improve Hebrew (he-IL) locale (#14287) @rotembarsela
33
+
34
+ #### `@mui/x-data-grid-pro@7.14.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
35
+
36
+ Same changes as in `@mui/x-data-grid@7.14.0`.
37
+
38
+ #### `@mui/x-data-grid-premium@7.14.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
39
+
40
+ Same changes as in `@mui/x-data-grid-pro@7.14.0`, plus:
41
+
42
+ - [DataGridPremium] Fix clipboard paste not working for a single cell on non-first page (#14261) @arminmeh
43
+ - [DataGridPremium] Fix `onCellSelectionModelChange` not triggered when additional cell range is selected (#14199) @arminmeh
44
+
45
+ ### Date and Time Pickers
46
+
47
+ #### `@mui/x-date-pickers@7.14.0`
48
+
49
+ - [l10n] Improve Chinese (zh-HK) locale (#13289) @yeeharn
50
+ - [l10n] Improve Hebrew (he-IL) locale (#14287) @rotembarsela
51
+ - [l10n] Improve Vietnamese (vi-VN) locale (#14238) @locnbk2002
52
+ - [TimePicker] Handle `Space` and `Enter` on the `TimeClock` component @arthurbalduini
53
+
54
+ #### `@mui/x-date-pickers-pro@7.14.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
55
+
56
+ Same changes as in `@mui/x-date-pickers@7.14.0`.
57
+
58
+ ### Charts
59
+
60
+ #### `@mui/x-charts@7.14.0`
61
+
62
+ - [charts] Fix grid overflow with zooming (#14280) @alexfauquette
63
+ - [charts] Improve bar chart performances (#14278) @alexfauquette
64
+ - [charts] Test pointer events (#14042) @alexfauquette
65
+ - [charts] Use `isPointInside` function for both graphs and axis (#14222) @JCQuintas
66
+
67
+ #### `@mui/x-charts-pro@7.0.0-alpha.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
68
+
69
+ Same changes as in `@mui/x-charts@7.14.0`, plus:
70
+
71
+ - [charts-pro] Zoom axis filtering (#14121) @JCQuintas
72
+
73
+ ### Docs
74
+
75
+ - [docs] Consistent use of UTC and timezones (#14250) @oliviertassinari
76
+ - [docs] Fix missing leading slashes in URLs (#14249) @oliviertassinari
77
+ - [docs] Dash usage revision on pickers pages (#14260) @arthurbalduini
78
+
79
+ ### Core
80
+
81
+ - [core] Follow JSDocs convention @oliviertassinari
82
+ - [core] Prepare for material v6 (#14143) @LukasTy
83
+ - [code-infra] Set up `eslint-plugin-testing-library` (#14232) @LukasTy
84
+ - [infra] Updated mui-x roadmap links with new project URL (#14271) @michelengelen
85
+
86
+ ## 7.13.0
87
+
88
+ _Aug 16, 2024_
89
+
90
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
91
+
92
+ - 💫 Allow to [edit the label](https://mui.com/x/react-tree-view/rich-tree-view/editing/) of Tree View's items.
93
+
94
+ <img width="344" src="https://github.com/user-attachments/assets/1a6cf765-2dc8-4906-bd93-139086eed148" alt="Item label editing" />
95
+
96
+ - 🔧 Improve rows accessibility on the Data Grid features "Tree Data" and "Row Grouping". Certain "Row Grouping" accessibility updates will only be applied if experimental feature flag is enabled. See the [documentation](https://mui.com/x/react-data-grid/row-grouping/#accessibility-changes-in-v8) for more information.
97
+ - 🌍 Improve Vietnamese (vi-VN) locale on the Data Grid
98
+ - 🐞 Bugfixes
99
+
100
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
101
+
102
+ ### Data Grid
103
+
104
+ #### `@mui/x-data-grid@7.13.0`
105
+
106
+ - [DataGrid] Fix CSV export for `null` and `undefined` values (#14166) @k-rajat19
107
+ - [DataGrid] Fix error logged during skeleton loading with nested data grid (#14186) @KenanYusuf
108
+ - [DataGrid] Remove needless check in `useGridStateInitialization` (#14181) @k-rajat19
109
+ - [DataGrid] Add recipe for persisting filters in local storage (#14208) @cherniavskii
110
+ - [l10n] Improve Vietnamese (vi-VN) locale (#14216) @hungnd-casso
111
+
112
+ #### `@mui/x-data-grid-pro@7.13.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
113
+
114
+ Same changes as in `@mui/x-data-grid@7.13.0`, plus:
115
+
116
+ - [DataGridPro] Fix Tree Data and Row Grouping rows accessibility (#13623) @arminmeh
117
+
118
+ #### `@mui/x-data-grid-premium@7.13.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
119
+
120
+ Same changes as in `@mui/x-data-grid-pro@7.13.0`.
121
+
122
+ ### Date and Time Pickers
123
+
124
+ #### `@mui/x-date-pickers@7.13.0`
125
+
126
+ - [pickers] Fix date and time merging to retain milliseconds (#14173) @LukasTy
127
+
128
+ #### `@mui/x-date-pickers-pro@7.13.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
129
+
130
+ Same changes as in `@mui/x-date-pickers@7.13.0`.
131
+
132
+ ### Charts
133
+
134
+ #### `@mui/x-charts@7.13.0`
135
+
136
+ - [charts] Add `baseline` property to the `LineChart` `series` (#14153) @JCQuintas
137
+ - [charts] Fix issue where tooltip would disappear on mouse click (#14187) @alexfauquette
138
+ - [charts] Rename `CartesianContextProvider` to `CartesianProvider` (#14102) @JCQuintas
139
+ - [charts] Support axis with the same value for all data points (#14191) @alexfauquette
140
+
141
+ #### `@mui/x-charts-pro@7.0.0-alpha.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
142
+
143
+ Same changes as in `@mui/x-charts@7.13.0`.
144
+
145
+ ### Tree View
146
+
147
+ #### `@mui/x-tree-view@7.13.0`
148
+
149
+ - [TreeView] Add label editing feature (#13388) @noraleonte
150
+ - [TreeView] Fix the parameters passed for the `canMoveItemToNewPosition` prop (#14176) @flaviendelangle
151
+
152
+ ### Docs
153
+
154
+ - [docs] Extract dataset in the Line chart docs (#14034) @alexfauquette
155
+ - [docs] Remove redundant encoding in the mock data source server (#14185) @MBilalShafi
156
+ - [docs] Use Netflix financial results to document bar charts (#13991) @alexfauquette
157
+ - [docs] Remove relience of abbreviations (#14226) @oliviertassinari
158
+
159
+ ### Core
160
+
161
+ - [core] Bump monorepo (#14141) @Janpot
162
+ - [core] Fix ESLint issue (#14207) @LukasTy
163
+ - [core] Fix Netlify build cache issue (#14182) @cherniavskii
164
+ - [code-infra] Refactor Netlify `cache-docs` plugin setup (#14105) @LukasTy
165
+ - [internals] Move utils needed for tree view virtualization to shared package (#14202) @flaviendelangle
166
+
6
167
  ## 7.12.1
7
168
 
8
169
  _Aug 8, 2024_
@@ -51,7 +212,7 @@ Same changes as in `@mui/x-date-pickers@7.12.1`.
51
212
  - [charts] Fix charts vendor publish config (#14073) @JCQuintas
52
213
  - [charts] Move `plugins` to `PluginProvider` (#14056) @JCQuintas
53
214
 
54
- #### `@mui/x-date-charts-pro@7.0.0-alpha.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
215
+ #### `@mui/x-charts-pro@7.0.0-alpha.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
55
216
 
56
217
  Same changes as in `@mui/x-charts@7.12.1`, plus:
57
218
 
@@ -170,13 +170,14 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
170
170
  getItemOrderedChildrenIds: PropTypes.func.isRequired,
171
171
  getItemTree: PropTypes.func.isRequired,
172
172
  selectItem: PropTypes.func.isRequired,
173
- setItemExpansion: PropTypes.func.isRequired
173
+ setItemExpansion: PropTypes.func.isRequired,
174
+ updateItemLabel: PropTypes.func.isRequired
174
175
  })
175
176
  }),
176
177
  /**
177
178
  * Used to determine if a given item can move to some new position.
178
179
  * @param {object} params The params describing the item re-ordering.
179
- * @param {string} params.itemId The id of the item to check.
180
+ * @param {string} params.itemId The id of the item that is being moved to a new position.
180
181
  * @param {TreeViewItemReorderPosition} params.oldPosition The old position of the item.
181
182
  * @param {TreeViewItemReorderPosition} params.newPosition The new position of the item.
182
183
  * @returns {boolean} `true` if the item can move to the new position.
@@ -231,7 +232,8 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
231
232
  */
232
233
  experimentalFeatures: PropTypes.shape({
233
234
  indentationAtItemLevel: PropTypes.bool,
234
- itemsReordering: PropTypes.bool
235
+ itemsReordering: PropTypes.bool,
236
+ labelEditing: PropTypes.bool
235
237
  }),
236
238
  /**
237
239
  * Used to determine the id of a given item.
@@ -263,6 +265,16 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
263
265
  * @returns {boolean} `true` if the item should be disabled.
264
266
  */
265
267
  isItemDisabled: PropTypes.func,
268
+ /**
269
+ * Determines if a given item is editable or not.
270
+ * Make sure to also enable the `labelEditing` experimental feature:
271
+ * `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
272
+ * By default, the items are not editable.
273
+ * @template R
274
+ * @param {R} item The item to check.
275
+ * @returns {boolean} `true` if the item is editable.
276
+ */
277
+ isItemEditable: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
266
278
  /**
267
279
  * Used to determine if a given item can be reordered.
268
280
  * @param {string} itemId The id of the item to check.
@@ -314,6 +326,12 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
314
326
  * @param {string} itemId The id of the focused item.
315
327
  */
316
328
  onItemFocus: PropTypes.func,
329
+ /**
330
+ * Callback fired when the label of an item changes.
331
+ * @param {TreeViewItemId} itemId The id of the item that was edited.
332
+ * @param {string} newLabel The new label of the items.
333
+ */
334
+ onItemLabelChange: PropTypes.func,
317
335
  /**
318
336
  * Callback fired when a tree item is moved in the tree.
319
337
  * @param {object} params The params describing the item re-ordering.
@@ -1,8 +1,8 @@
1
- import { UseTreeViewItemsParameters, UseTreeViewExpansionParameters, UseTreeViewSelectionParameters, UseTreeViewFocusParameters, UseTreeViewIconsParameters, ConvertPluginsIntoSignatures, MergeSignaturesProperty, TreeViewCorePluginParameters } from '@mui/x-tree-view/internals';
1
+ import { UseTreeViewItemsParameters, UseTreeViewExpansionParameters, UseTreeViewSelectionParameters, UseTreeViewFocusParameters, UseTreeViewIconsParameters, ConvertPluginsIntoSignatures, MergeSignaturesProperty, TreeViewCorePluginParameters, UseTreeViewLabelParameters } from '@mui/x-tree-view/internals';
2
2
  import { UseTreeViewItemsReorderingParameters } from '../internals/plugins/useTreeViewItemsReordering';
3
- export declare const RICH_TREE_VIEW_PRO_PLUGINS: readonly [import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewItemsSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewExpansionSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewSelectionSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewFocusSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewKeyboardNavigationSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewIconsSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("../internals/plugins/useTreeViewItemsReordering").UseTreeViewItemsReorderingSignature>];
3
+ export declare const RICH_TREE_VIEW_PRO_PLUGINS: readonly [import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewItemsSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewExpansionSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewSelectionSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewFocusSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewKeyboardNavigationSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewIconsSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("@mui/x-tree-view/internals").UseTreeViewLabelSignature>, import("@mui/x-tree-view/internals").TreeViewPlugin<import("../internals/plugins/useTreeViewItemsReordering").UseTreeViewItemsReorderingSignature>];
4
4
  export type RichTreeViewProPluginSignatures = ConvertPluginsIntoSignatures<typeof RICH_TREE_VIEW_PRO_PLUGINS>;
5
5
  export type RichTreeViewProPluginSlots = MergeSignaturesProperty<RichTreeViewProPluginSignatures, 'slots'>;
6
6
  export type RichTreeViewProPluginSlotProps = MergeSignaturesProperty<RichTreeViewProPluginSignatures, 'slotProps'>;
7
- export interface RichTreeViewProPluginParameters<R extends {}, Multiple extends boolean | undefined> extends TreeViewCorePluginParameters, UseTreeViewItemsParameters<R>, UseTreeViewExpansionParameters, UseTreeViewFocusParameters, UseTreeViewSelectionParameters<Multiple>, UseTreeViewIconsParameters, UseTreeViewItemsReorderingParameters {
7
+ export interface RichTreeViewProPluginParameters<R extends {}, Multiple extends boolean | undefined> extends TreeViewCorePluginParameters, UseTreeViewItemsParameters<R>, UseTreeViewExpansionParameters, UseTreeViewFocusParameters, UseTreeViewSelectionParameters<Multiple>, UseTreeViewIconsParameters, UseTreeViewLabelParameters<R>, UseTreeViewItemsReorderingParameters {
8
8
  }
@@ -1,5 +1,5 @@
1
- import { useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons } from '@mui/x-tree-view/internals';
1
+ import { useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons, useTreeViewLabel } from '@mui/x-tree-view/internals';
2
2
  import { useTreeViewItemsReordering } from '../internals/plugins/useTreeViewItemsReordering';
3
- export const RICH_TREE_VIEW_PRO_PLUGINS = [useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons, useTreeViewItemsReordering];
3
+ export const RICH_TREE_VIEW_PRO_PLUGINS = [useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons, useTreeViewLabel, useTreeViewItemsReordering];
4
4
 
5
5
  // We can't infer this type from the plugin, otherwise we would lose the generics.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view-pro v7.12.1
2
+ * @mui/x-tree-view-pro v7.14.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -27,16 +27,17 @@ export const useTreeViewItemsReordering = ({
27
27
  return true;
28
28
  }, [isItemsReorderingEnabled, params.isItemReorderable]);
29
29
  const getDroppingTargetValidActions = React.useCallback(itemId => {
30
- if (!state.itemsReordering) {
30
+ const itemsReordering = state.itemsReordering;
31
+ if (!itemsReordering) {
31
32
  throw new Error('There is no ongoing reordering.');
32
33
  }
33
- if (itemId === state.itemsReordering.draggedItemId) {
34
+ if (itemId === itemsReordering.draggedItemId) {
34
35
  return {};
35
36
  }
36
37
  const canMoveItemToNewPosition = params.canMoveItemToNewPosition;
37
38
  const targetItemMeta = instance.getItemMeta(itemId);
38
39
  const targetItemIndex = instance.getItemIndex(targetItemMeta.id);
39
- const draggedItemMeta = instance.getItemMeta(state.itemsReordering.draggedItemId);
40
+ const draggedItemMeta = instance.getItemMeta(itemsReordering.draggedItemId);
40
41
  const draggedItemIndex = instance.getItemIndex(draggedItemMeta.id);
41
42
  const oldPosition = {
42
43
  parentId: draggedItemMeta.parentId,
@@ -49,7 +50,7 @@ export const useTreeViewItemsReordering = ({
49
50
  isValid = false;
50
51
  } else if (canMoveItemToNewPosition) {
51
52
  isValid = canMoveItemToNewPosition({
52
- itemId,
53
+ itemId: itemsReordering.draggedItemId,
53
54
  oldPosition,
54
55
  newPosition: positionAfterAction
55
56
  });
@@ -70,7 +70,7 @@ export interface UseTreeViewItemsReorderingParameters {
70
70
  /**
71
71
  * Used to determine if a given item can move to some new position.
72
72
  * @param {object} params The params describing the item re-ordering.
73
- * @param {string} params.itemId The id of the item to check.
73
+ * @param {string} params.itemId The id of the item that is being moved to a new position.
74
74
  * @param {TreeViewItemReorderPosition} params.oldPosition The old position of the item.
75
75
  * @param {TreeViewItemReorderPosition} params.newPosition The new position of the item.
76
76
  * @returns {boolean} `true` if the item can move to the new position.
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcyMzE1NDQwMDAwMA==";
3
+ const releaseInfo = "MTcyNDM2MDQwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -170,13 +170,14 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
170
170
  getItemOrderedChildrenIds: PropTypes.func.isRequired,
171
171
  getItemTree: PropTypes.func.isRequired,
172
172
  selectItem: PropTypes.func.isRequired,
173
- setItemExpansion: PropTypes.func.isRequired
173
+ setItemExpansion: PropTypes.func.isRequired,
174
+ updateItemLabel: PropTypes.func.isRequired
174
175
  })
175
176
  }),
176
177
  /**
177
178
  * Used to determine if a given item can move to some new position.
178
179
  * @param {object} params The params describing the item re-ordering.
179
- * @param {string} params.itemId The id of the item to check.
180
+ * @param {string} params.itemId The id of the item that is being moved to a new position.
180
181
  * @param {TreeViewItemReorderPosition} params.oldPosition The old position of the item.
181
182
  * @param {TreeViewItemReorderPosition} params.newPosition The new position of the item.
182
183
  * @returns {boolean} `true` if the item can move to the new position.
@@ -231,7 +232,8 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
231
232
  */
232
233
  experimentalFeatures: PropTypes.shape({
233
234
  indentationAtItemLevel: PropTypes.bool,
234
- itemsReordering: PropTypes.bool
235
+ itemsReordering: PropTypes.bool,
236
+ labelEditing: PropTypes.bool
235
237
  }),
236
238
  /**
237
239
  * Used to determine the id of a given item.
@@ -263,6 +265,16 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
263
265
  * @returns {boolean} `true` if the item should be disabled.
264
266
  */
265
267
  isItemDisabled: PropTypes.func,
268
+ /**
269
+ * Determines if a given item is editable or not.
270
+ * Make sure to also enable the `labelEditing` experimental feature:
271
+ * `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
272
+ * By default, the items are not editable.
273
+ * @template R
274
+ * @param {R} item The item to check.
275
+ * @returns {boolean} `true` if the item is editable.
276
+ */
277
+ isItemEditable: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
266
278
  /**
267
279
  * Used to determine if a given item can be reordered.
268
280
  * @param {string} itemId The id of the item to check.
@@ -314,6 +326,12 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
314
326
  * @param {string} itemId The id of the focused item.
315
327
  */
316
328
  onItemFocus: PropTypes.func,
329
+ /**
330
+ * Callback fired when the label of an item changes.
331
+ * @param {TreeViewItemId} itemId The id of the item that was edited.
332
+ * @param {string} newLabel The new label of the items.
333
+ */
334
+ onItemLabelChange: PropTypes.func,
317
335
  /**
318
336
  * Callback fired when a tree item is moved in the tree.
319
337
  * @param {object} params The params describing the item re-ordering.
@@ -1,5 +1,5 @@
1
- import { useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons } from '@mui/x-tree-view/internals';
1
+ import { useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons, useTreeViewLabel } from '@mui/x-tree-view/internals';
2
2
  import { useTreeViewItemsReordering } from '../internals/plugins/useTreeViewItemsReordering';
3
- export const RICH_TREE_VIEW_PRO_PLUGINS = [useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons, useTreeViewItemsReordering];
3
+ export const RICH_TREE_VIEW_PRO_PLUGINS = [useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons, useTreeViewLabel, useTreeViewItemsReordering];
4
4
 
5
5
  // We can't infer this type from the plugin, otherwise we would lose the generics.
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view-pro v7.12.1
2
+ * @mui/x-tree-view-pro v7.14.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -27,16 +27,17 @@ export const useTreeViewItemsReordering = ({
27
27
  return true;
28
28
  }, [isItemsReorderingEnabled, params.isItemReorderable]);
29
29
  const getDroppingTargetValidActions = React.useCallback(itemId => {
30
- if (!state.itemsReordering) {
30
+ const itemsReordering = state.itemsReordering;
31
+ if (!itemsReordering) {
31
32
  throw new Error('There is no ongoing reordering.');
32
33
  }
33
- if (itemId === state.itemsReordering.draggedItemId) {
34
+ if (itemId === itemsReordering.draggedItemId) {
34
35
  return {};
35
36
  }
36
37
  const canMoveItemToNewPosition = params.canMoveItemToNewPosition;
37
38
  const targetItemMeta = instance.getItemMeta(itemId);
38
39
  const targetItemIndex = instance.getItemIndex(targetItemMeta.id);
39
- const draggedItemMeta = instance.getItemMeta(state.itemsReordering.draggedItemId);
40
+ const draggedItemMeta = instance.getItemMeta(itemsReordering.draggedItemId);
40
41
  const draggedItemIndex = instance.getItemIndex(draggedItemMeta.id);
41
42
  const oldPosition = {
42
43
  parentId: draggedItemMeta.parentId,
@@ -49,7 +50,7 @@ export const useTreeViewItemsReordering = ({
49
50
  isValid = false;
50
51
  } else if (canMoveItemToNewPosition) {
51
52
  isValid = canMoveItemToNewPosition({
52
- itemId,
53
+ itemId: itemsReordering.draggedItemId,
53
54
  oldPosition,
54
55
  newPosition: positionAfterAction
55
56
  });
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcyMzE1NDQwMDAwMA==";
3
+ const releaseInfo = "MTcyNDM2MDQwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -179,13 +179,14 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
179
179
  getItemOrderedChildrenIds: _propTypes.default.func.isRequired,
180
180
  getItemTree: _propTypes.default.func.isRequired,
181
181
  selectItem: _propTypes.default.func.isRequired,
182
- setItemExpansion: _propTypes.default.func.isRequired
182
+ setItemExpansion: _propTypes.default.func.isRequired,
183
+ updateItemLabel: _propTypes.default.func.isRequired
183
184
  })
184
185
  }),
185
186
  /**
186
187
  * Used to determine if a given item can move to some new position.
187
188
  * @param {object} params The params describing the item re-ordering.
188
- * @param {string} params.itemId The id of the item to check.
189
+ * @param {string} params.itemId The id of the item that is being moved to a new position.
189
190
  * @param {TreeViewItemReorderPosition} params.oldPosition The old position of the item.
190
191
  * @param {TreeViewItemReorderPosition} params.newPosition The new position of the item.
191
192
  * @returns {boolean} `true` if the item can move to the new position.
@@ -240,7 +241,8 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
240
241
  */
241
242
  experimentalFeatures: _propTypes.default.shape({
242
243
  indentationAtItemLevel: _propTypes.default.bool,
243
- itemsReordering: _propTypes.default.bool
244
+ itemsReordering: _propTypes.default.bool,
245
+ labelEditing: _propTypes.default.bool
244
246
  }),
245
247
  /**
246
248
  * Used to determine the id of a given item.
@@ -272,6 +274,16 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
272
274
  * @returns {boolean} `true` if the item should be disabled.
273
275
  */
274
276
  isItemDisabled: _propTypes.default.func,
277
+ /**
278
+ * Determines if a given item is editable or not.
279
+ * Make sure to also enable the `labelEditing` experimental feature:
280
+ * `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
281
+ * By default, the items are not editable.
282
+ * @template R
283
+ * @param {R} item The item to check.
284
+ * @returns {boolean} `true` if the item is editable.
285
+ */
286
+ isItemEditable: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
275
287
  /**
276
288
  * Used to determine if a given item can be reordered.
277
289
  * @param {string} itemId The id of the item to check.
@@ -323,6 +335,12 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
323
335
  * @param {string} itemId The id of the focused item.
324
336
  */
325
337
  onItemFocus: _propTypes.default.func,
338
+ /**
339
+ * Callback fired when the label of an item changes.
340
+ * @param {TreeViewItemId} itemId The id of the item that was edited.
341
+ * @param {string} newLabel The new label of the items.
342
+ */
343
+ onItemLabelChange: _propTypes.default.func,
326
344
  /**
327
345
  * Callback fired when a tree item is moved in the tree.
328
346
  * @param {object} params The params describing the item re-ordering.
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.RICH_TREE_VIEW_PRO_PLUGINS = void 0;
7
7
  var _internals = require("@mui/x-tree-view/internals");
8
8
  var _useTreeViewItemsReordering = require("../internals/plugins/useTreeViewItemsReordering");
9
- const RICH_TREE_VIEW_PRO_PLUGINS = exports.RICH_TREE_VIEW_PRO_PLUGINS = [_internals.useTreeViewItems, _internals.useTreeViewExpansion, _internals.useTreeViewSelection, _internals.useTreeViewFocus, _internals.useTreeViewKeyboardNavigation, _internals.useTreeViewIcons, _useTreeViewItemsReordering.useTreeViewItemsReordering];
9
+ const RICH_TREE_VIEW_PRO_PLUGINS = exports.RICH_TREE_VIEW_PRO_PLUGINS = [_internals.useTreeViewItems, _internals.useTreeViewExpansion, _internals.useTreeViewSelection, _internals.useTreeViewFocus, _internals.useTreeViewKeyboardNavigation, _internals.useTreeViewIcons, _internals.useTreeViewLabel, _useTreeViewItemsReordering.useTreeViewItemsReordering];
10
10
 
11
11
  // We can't infer this type from the plugin, otherwise we would lose the generics.
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view-pro v7.12.1
2
+ * @mui/x-tree-view-pro v7.14.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -36,16 +36,17 @@ const useTreeViewItemsReordering = ({
36
36
  return true;
37
37
  }, [isItemsReorderingEnabled, params.isItemReorderable]);
38
38
  const getDroppingTargetValidActions = React.useCallback(itemId => {
39
- if (!state.itemsReordering) {
39
+ const itemsReordering = state.itemsReordering;
40
+ if (!itemsReordering) {
40
41
  throw new Error('There is no ongoing reordering.');
41
42
  }
42
- if (itemId === state.itemsReordering.draggedItemId) {
43
+ if (itemId === itemsReordering.draggedItemId) {
43
44
  return {};
44
45
  }
45
46
  const canMoveItemToNewPosition = params.canMoveItemToNewPosition;
46
47
  const targetItemMeta = instance.getItemMeta(itemId);
47
48
  const targetItemIndex = instance.getItemIndex(targetItemMeta.id);
48
- const draggedItemMeta = instance.getItemMeta(state.itemsReordering.draggedItemId);
49
+ const draggedItemMeta = instance.getItemMeta(itemsReordering.draggedItemId);
49
50
  const draggedItemIndex = instance.getItemIndex(draggedItemMeta.id);
50
51
  const oldPosition = {
51
52
  parentId: draggedItemMeta.parentId,
@@ -58,7 +59,7 @@ const useTreeViewItemsReordering = ({
58
59
  isValid = false;
59
60
  } else if (canMoveItemToNewPosition) {
60
61
  isValid = canMoveItemToNewPosition({
61
- itemId,
62
+ itemId: itemsReordering.draggedItemId,
62
63
  oldPosition,
63
64
  newPosition: positionAfterAction
64
65
  });
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getReleaseInfo = void 0;
7
7
  var _utils = require("@mui/utils");
8
8
  const getReleaseInfo = () => {
9
- const releaseInfo = "MTcyMzE1NDQwMDAwMA==";
9
+ const releaseInfo = "MTcyNDM2MDQwMDAwMA==";
10
10
  if (process.env.NODE_ENV !== 'production') {
11
11
  // A simple hack to set the value in the test environment (has no build step).
12
12
  // eslint-disable-next-line no-useless-concat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-tree-view-pro",
3
- "version": "7.12.1",
3
+ "version": "7.14.0",
4
4
  "description": "The Pro plan edition of the Tree View components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -34,15 +34,15 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.25.0",
37
- "@mui/system": "^5.16.5",
38
- "@mui/utils": "^5.16.5",
39
- "@types/react-transition-group": "^4.4.10",
37
+ "@mui/system": "^5.16.7",
38
+ "@mui/utils": "^5.16.6",
39
+ "@types/react-transition-group": "^4.4.11",
40
40
  "clsx": "^2.1.1",
41
41
  "prop-types": "^15.8.1",
42
42
  "react-transition-group": "^4.4.5",
43
- "@mui/x-internals": "7.12.0",
44
- "@mui/x-license": "7.12.0",
45
- "@mui/x-tree-view": "7.12.1"
43
+ "@mui/x-internals": "7.14.0",
44
+ "@mui/x-license": "7.14.0",
45
+ "@mui/x-tree-view": "7.14.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@emotion/react": "^11.9.0",