@mui/x-tree-view-pro 7.12.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.
Files changed (98) hide show
  1. package/LICENSE +11 -0
  2. package/README.md +26 -0
  3. package/build/CHANGELOG.md +4336 -0
  4. package/build/LICENSE +11 -0
  5. package/build/README.md +26 -0
  6. package/build/RichTreeViewPro/RichTreeViewPro.d.ts +20 -0
  7. package/build/RichTreeViewPro/RichTreeViewPro.js +359 -0
  8. package/build/RichTreeViewPro/RichTreeViewPro.plugins.d.ts +8 -0
  9. package/build/RichTreeViewPro/RichTreeViewPro.plugins.js +5 -0
  10. package/build/RichTreeViewPro/RichTreeViewPro.types.d.ts +65 -0
  11. package/build/RichTreeViewPro/RichTreeViewPro.types.js +1 -0
  12. package/build/RichTreeViewPro/index.d.ts +3 -0
  13. package/build/RichTreeViewPro/index.js +3 -0
  14. package/build/RichTreeViewPro/package.json +6 -0
  15. package/build/RichTreeViewPro/richTreeViewProClasses.d.ts +7 -0
  16. package/build/RichTreeViewPro/richTreeViewProClasses.js +6 -0
  17. package/build/index.d.ts +12 -0
  18. package/build/index.js +22 -0
  19. package/build/internals/index.d.ts +1 -0
  20. package/build/internals/index.js +1 -0
  21. package/build/internals/package.json +6 -0
  22. package/build/internals/plugins/useTreeViewItemsReordering/index.d.ts +2 -0
  23. package/build/internals/plugins/useTreeViewItemsReordering/index.js +1 -0
  24. package/build/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.d.ts +3 -0
  25. package/build/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.itemPlugin.d.ts +4 -0
  26. package/build/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.itemPlugin.js +128 -0
  27. package/build/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.js +193 -0
  28. package/build/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.types.d.ts +140 -0
  29. package/build/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.types.js +1 -0
  30. package/build/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.utils.d.ts +26 -0
  31. package/build/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.utils.js +150 -0
  32. package/build/internals/utils/releaseInfo.d.ts +1 -0
  33. package/build/internals/utils/releaseInfo.js +13 -0
  34. package/build/internals/zero-styled/index.d.ts +3 -0
  35. package/build/internals/zero-styled/index.js +7 -0
  36. package/build/modern/RichTreeViewPro/RichTreeViewPro.js +359 -0
  37. package/build/modern/RichTreeViewPro/RichTreeViewPro.plugins.js +5 -0
  38. package/build/modern/RichTreeViewPro/RichTreeViewPro.types.js +1 -0
  39. package/build/modern/RichTreeViewPro/index.js +3 -0
  40. package/build/modern/RichTreeViewPro/richTreeViewProClasses.js +6 -0
  41. package/build/modern/index.js +22 -0
  42. package/build/modern/internals/index.js +1 -0
  43. package/build/modern/internals/plugins/useTreeViewItemsReordering/index.js +1 -0
  44. package/build/modern/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.itemPlugin.js +128 -0
  45. package/build/modern/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.js +193 -0
  46. package/build/modern/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.types.js +1 -0
  47. package/build/modern/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.utils.js +150 -0
  48. package/build/modern/internals/utils/releaseInfo.js +13 -0
  49. package/build/modern/internals/zero-styled/index.js +7 -0
  50. package/build/modern/themeAugmentation/index.js +3 -0
  51. package/build/node/RichTreeViewPro/RichTreeViewPro.js +367 -0
  52. package/build/node/RichTreeViewPro/RichTreeViewPro.plugins.js +11 -0
  53. package/build/node/RichTreeViewPro/RichTreeViewPro.types.js +5 -0
  54. package/build/node/RichTreeViewPro/index.js +27 -0
  55. package/build/node/RichTreeViewPro/richTreeViewProClasses.js +14 -0
  56. package/build/node/index.js +154 -0
  57. package/build/node/internals/index.js +12 -0
  58. package/build/node/internals/plugins/useTreeViewItemsReordering/index.js +12 -0
  59. package/build/node/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.itemPlugin.js +138 -0
  60. package/build/node/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.js +203 -0
  61. package/build/node/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.types.js +5 -0
  62. package/build/node/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.utils.js +160 -0
  63. package/build/node/internals/utils/releaseInfo.js +20 -0
  64. package/build/node/internals/zero-styled/index.js +17 -0
  65. package/build/node/themeAugmentation/index.js +38 -0
  66. package/build/package.json +59 -0
  67. package/build/themeAugmentation/components.d.ts +13 -0
  68. package/build/themeAugmentation/index.d.ts +3 -0
  69. package/build/themeAugmentation/index.js +3 -0
  70. package/build/themeAugmentation/overrides.d.ts +13 -0
  71. package/build/themeAugmentation/package.json +6 -0
  72. package/build/themeAugmentation/props.d.ts +12 -0
  73. package/package.json +71 -0
  74. package/src/RichTreeViewPro/RichTreeViewPro.plugins.ts +54 -0
  75. package/src/RichTreeViewPro/RichTreeViewPro.test.tsx +20 -0
  76. package/src/RichTreeViewPro/RichTreeViewPro.tsx +383 -0
  77. package/src/RichTreeViewPro/RichTreeViewPro.types.ts +80 -0
  78. package/src/RichTreeViewPro/index.ts +8 -0
  79. package/src/RichTreeViewPro/richTreeViewProClasses.ts +18 -0
  80. package/src/index.ts +17 -0
  81. package/src/internals/index.ts +1 -0
  82. package/src/internals/plugins/useTreeViewItemsReordering/index.ts +7 -0
  83. package/src/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.itemPlugin.ts +155 -0
  84. package/src/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.test.tsx +370 -0
  85. package/src/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.ts +278 -0
  86. package/src/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.types.ts +160 -0
  87. package/src/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.utils.ts +199 -0
  88. package/src/internals/utils/releaseInfo.ts +15 -0
  89. package/src/internals/zero-styled/index.ts +8 -0
  90. package/src/themeAugmentation/components.d.ts +13 -0
  91. package/src/themeAugmentation/index.js +1 -0
  92. package/src/themeAugmentation/index.ts +3 -0
  93. package/src/themeAugmentation/overrides.d.ts +13 -0
  94. package/src/themeAugmentation/props.d.ts +12 -0
  95. package/src/themeAugmentation/themeAugmentation.spec.ts +26 -0
  96. package/tsconfig.build.json +21 -0
  97. package/tsconfig.build.tsbuildinfo +1 -0
  98. package/tsconfig.json +14 -0
package/build/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ Commercial License
2
+
3
+ Copyright (c) 2020 Material-UI SAS
4
+
5
+ MUI X Pro (https://mui.com/pricing/) is commercial software. You MUST agree to the
6
+ End User License Agreement (EULA: https://mui.com/r/x-license-eula) to be able to
7
+ use the software.
8
+
9
+ This means that you either need to purchase a commercial license at
10
+ https://mui.com/r/x-get-license?scope=pro or be eligible for the Evaluation (trial)
11
+ licenses detailed at https://mui.com/r/x-license-trial.
@@ -0,0 +1,26 @@
1
+ # MUI X Tree View
2
+
3
+ This package is the Pro plan 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.
5
+
6
+ ## Installation
7
+
8
+ Install the package in your project directory with:
9
+
10
+ ```bash
11
+ npm install @mui/x-tree-view-pro
12
+ ```
13
+
14
+ This component has the following peer dependencies that you will need to install as well.
15
+
16
+ ```json
17
+ "peerDependencies": {
18
+ "@mui/material": "^5.15.14",
19
+ "react": "^17.0.0 || ^18.0.0",
20
+ "react-dom": "^17.0.0 || ^18.0.0"
21
+ },
22
+ ```
23
+
24
+ ## Documentation
25
+
26
+ Visit [https://mui.com/x/react-tree-view/](https://mui.com/x/react-tree-view/) to view the full documentation.
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { RichTreeViewProProps } from './RichTreeViewPro.types';
3
+ export declare const RichTreeViewProRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
4
+ ownerState: RichTreeViewProProps<any, any>;
5
+ }, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, keyof React.ClassAttributes<HTMLUListElement> | keyof React.HTMLAttributes<HTMLUListElement>>, {}>;
6
+ type RichTreeViewProComponent = (<R extends {}, Multiple extends boolean | undefined = undefined>(props: RichTreeViewProProps<R, Multiple> & React.RefAttributes<HTMLUListElement>) => React.JSX.Element) & {
7
+ propTypes?: any;
8
+ };
9
+ /**
10
+ *
11
+ * Demos:
12
+ *
13
+ * - [Tree View](https://mui.com/x/react-tree-view/)
14
+ *
15
+ * API:
16
+ *
17
+ * - [RichTreeView API](https://mui.com/x/api/tree-view/rich-tree-view/)
18
+ */
19
+ declare const RichTreeViewPro: RichTreeViewProComponent;
20
+ export { RichTreeViewPro };
@@ -0,0 +1,359 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import composeClasses from '@mui/utils/composeClasses';
5
+ import { useLicenseVerifier, Watermark } from '@mui/x-license';
6
+ import useSlotProps from '@mui/utils/useSlotProps';
7
+ import { TreeItem } from '@mui/x-tree-view/TreeItem';
8
+ import { useTreeView, TreeViewProvider, warnOnce } from '@mui/x-tree-view/internals';
9
+ import { styled, createUseThemeProps } from '../internals/zero-styled';
10
+ import { getRichTreeViewProUtilityClass } from './richTreeViewProClasses';
11
+ import { RICH_TREE_VIEW_PRO_PLUGINS } from './RichTreeViewPro.plugins';
12
+ import { getReleaseInfo } from '../internals/utils/releaseInfo';
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ const useThemeProps = createUseThemeProps('MuiRichTreeViewPro');
15
+ const useUtilityClasses = ownerState => {
16
+ const {
17
+ classes
18
+ } = ownerState;
19
+ const slots = {
20
+ root: ['root']
21
+ };
22
+ return composeClasses(slots, getRichTreeViewProUtilityClass, classes);
23
+ };
24
+ export const RichTreeViewProRoot = styled('ul', {
25
+ name: 'MuiRichTreeViewPro',
26
+ slot: 'Root',
27
+ overridesResolver: (props, styles) => styles.root
28
+ })({
29
+ padding: 0,
30
+ margin: 0,
31
+ listStyle: 'none',
32
+ outline: 0,
33
+ position: 'relative'
34
+ });
35
+ function WrappedTreeItem({
36
+ slots,
37
+ slotProps,
38
+ label,
39
+ id,
40
+ itemId,
41
+ children
42
+ }) {
43
+ const Item = slots?.item ?? TreeItem;
44
+ const itemProps = useSlotProps({
45
+ elementType: Item,
46
+ externalSlotProps: slotProps?.item,
47
+ additionalProps: {
48
+ itemId,
49
+ id,
50
+ label
51
+ },
52
+ ownerState: {
53
+ itemId,
54
+ label
55
+ }
56
+ });
57
+ return /*#__PURE__*/_jsx(Item, _extends({}, itemProps, {
58
+ children: children
59
+ }));
60
+ }
61
+ process.env.NODE_ENV !== "production" ? WrappedTreeItem.propTypes = {
62
+ // ----------------------------- Warning --------------------------------
63
+ // | These PropTypes are generated from the TypeScript type definitions |
64
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
65
+ // ----------------------------------------------------------------------
66
+ /**
67
+ * The content of the component.
68
+ */
69
+ children: PropTypes.node,
70
+ /**
71
+ * The id of the item.
72
+ */
73
+ itemId: PropTypes.string.isRequired,
74
+ label: PropTypes.string.isRequired,
75
+ /**
76
+ * The props used for each component slot.
77
+ * @default {}
78
+ */
79
+ slotProps: PropTypes.object,
80
+ /**
81
+ * Overridable component slots.
82
+ * @default {}
83
+ */
84
+ slots: PropTypes.object
85
+ } : void 0;
86
+ const releaseInfo = getReleaseInfo();
87
+
88
+ /**
89
+ *
90
+ * Demos:
91
+ *
92
+ * - [Tree View](https://mui.com/x/react-tree-view/)
93
+ *
94
+ * API:
95
+ *
96
+ * - [RichTreeView API](https://mui.com/x/api/tree-view/rich-tree-view/)
97
+ */
98
+ const RichTreeViewPro = /*#__PURE__*/React.forwardRef(function RichTreeViewPro(inProps, ref) {
99
+ const props = useThemeProps({
100
+ props: inProps,
101
+ name: 'MuiRichTreeViewPro'
102
+ });
103
+ useLicenseVerifier('x-tree-view-pro', releaseInfo);
104
+ if (process.env.NODE_ENV !== 'production') {
105
+ if (props.children != null) {
106
+ 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/.']);
107
+ }
108
+ }
109
+ const {
110
+ getRootProps,
111
+ contextValue,
112
+ instance
113
+ } = useTreeView({
114
+ plugins: RICH_TREE_VIEW_PRO_PLUGINS,
115
+ rootRef: ref,
116
+ props
117
+ });
118
+ const {
119
+ slots,
120
+ slotProps
121
+ } = props;
122
+ const classes = useUtilityClasses(props);
123
+ const Root = slots?.root ?? RichTreeViewProRoot;
124
+ const rootProps = useSlotProps({
125
+ elementType: Root,
126
+ externalSlotProps: slotProps?.root,
127
+ className: classes.root,
128
+ getSlotProps: getRootProps,
129
+ ownerState: props
130
+ });
131
+ const itemsToRender = instance.getItemsToRender();
132
+ const renderItem = ({
133
+ label,
134
+ itemId,
135
+ id,
136
+ children
137
+ }) => {
138
+ return /*#__PURE__*/_jsx(WrappedTreeItem, {
139
+ slots: slots,
140
+ slotProps: slotProps,
141
+ label: label,
142
+ id: id,
143
+ itemId: itemId,
144
+ children: children?.map(renderItem)
145
+ }, itemId);
146
+ };
147
+ return /*#__PURE__*/_jsx(TreeViewProvider, {
148
+ value: contextValue,
149
+ children: /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
150
+ children: [itemsToRender.map(renderItem), /*#__PURE__*/_jsx(Watermark, {
151
+ packageName: "x-tree-view-pro",
152
+ releaseInfo: releaseInfo
153
+ })]
154
+ }))
155
+ });
156
+ });
157
+ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
158
+ // ----------------------------- Warning --------------------------------
159
+ // | These PropTypes are generated from the TypeScript type definitions |
160
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
161
+ // ----------------------------------------------------------------------
162
+ /**
163
+ * The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
164
+ */
165
+ apiRef: PropTypes.shape({
166
+ current: PropTypes.shape({
167
+ focusItem: PropTypes.func.isRequired,
168
+ getItem: PropTypes.func.isRequired,
169
+ getItemDOMElement: PropTypes.func.isRequired,
170
+ getItemOrderedChildrenIds: PropTypes.func.isRequired,
171
+ getItemTree: PropTypes.func.isRequired,
172
+ selectItem: PropTypes.func.isRequired,
173
+ setItemExpansion: PropTypes.func.isRequired
174
+ })
175
+ }),
176
+ /**
177
+ * Used to determine if a given item can move to some new position.
178
+ * @param {object} params The params describing the item re-ordering.
179
+ * @param {string} params.itemId The id of the item to check.
180
+ * @param {TreeViewItemReorderPosition} params.oldPosition The old position of the item.
181
+ * @param {TreeViewItemReorderPosition} params.newPosition The new position of the item.
182
+ * @returns {boolean} `true` if the item can move to the new position.
183
+ */
184
+ canMoveItemToNewPosition: PropTypes.func,
185
+ /**
186
+ * If `true`, the tree view renders a checkbox at the left of its label that allows selecting it.
187
+ * @default false
188
+ */
189
+ checkboxSelection: PropTypes.bool,
190
+ /**
191
+ * Override or extend the styles applied to the component.
192
+ */
193
+ classes: PropTypes.object,
194
+ className: PropTypes.string,
195
+ /**
196
+ * Expanded item ids.
197
+ * Used when the item's expansion is not controlled.
198
+ * @default []
199
+ */
200
+ defaultExpandedItems: PropTypes.arrayOf(PropTypes.string),
201
+ /**
202
+ * Selected item ids. (Uncontrolled)
203
+ * When `multiSelect` is true this takes an array of strings; when false (default) a string.
204
+ * @default []
205
+ */
206
+ defaultSelectedItems: PropTypes.any,
207
+ /**
208
+ * If `true`, will allow focus on disabled items.
209
+ * @default false
210
+ */
211
+ disabledItemsFocusable: PropTypes.bool,
212
+ /**
213
+ * If `true` selection is disabled.
214
+ * @default false
215
+ */
216
+ disableSelection: PropTypes.bool,
217
+ /**
218
+ * Expanded item ids.
219
+ * Used when the item's expansion is controlled.
220
+ */
221
+ expandedItems: PropTypes.arrayOf(PropTypes.string),
222
+ /**
223
+ * The slot that triggers the item's expansion when clicked.
224
+ * @default 'content'
225
+ */
226
+ expansionTrigger: PropTypes.oneOf(['content', 'iconContainer']),
227
+ /**
228
+ * Unstable features, breaking changes might be introduced.
229
+ * For each feature, if the flag is not explicitly set to `true`,
230
+ * the feature will be fully disabled and any property / method call will not have any effect.
231
+ */
232
+ experimentalFeatures: PropTypes.shape({
233
+ indentationAtItemLevel: PropTypes.bool,
234
+ itemsReordering: PropTypes.bool
235
+ }),
236
+ /**
237
+ * Used to determine the id of a given item.
238
+ *
239
+ * @template R
240
+ * @param {R} item The item to check.
241
+ * @returns {string} The id of the item.
242
+ * @default (item) => item.id
243
+ */
244
+ getItemId: PropTypes.func,
245
+ /**
246
+ * Used to determine the string label for a given item.
247
+ *
248
+ * @template R
249
+ * @param {R} item The item to check.
250
+ * @returns {string} The label of the item.
251
+ * @default (item) => item.label
252
+ */
253
+ getItemLabel: PropTypes.func,
254
+ /**
255
+ * This prop is used to help implement the accessibility logic.
256
+ * If you don't provide this prop. It falls back to a randomly generated id.
257
+ */
258
+ id: PropTypes.string,
259
+ /**
260
+ * Used to determine if a given item should be disabled.
261
+ * @template R
262
+ * @param {R} item The item to check.
263
+ * @returns {boolean} `true` if the item should be disabled.
264
+ */
265
+ isItemDisabled: PropTypes.func,
266
+ /**
267
+ * Used to determine if a given item can be reordered.
268
+ * @param {string} itemId The id of the item to check.
269
+ * @returns {boolean} `true` if the item can be reordered.
270
+ * @default () => true
271
+ */
272
+ isItemReorderable: PropTypes.func,
273
+ /**
274
+ * Horizontal indentation between an item and its children.
275
+ * Examples: 24, "24px", "2rem", "2em".
276
+ * @default 12px
277
+ */
278
+ itemChildrenIndentation: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
279
+ items: PropTypes.array.isRequired,
280
+ /**
281
+ * If `true`, the reordering of items is enabled.
282
+ * Make sure to also enable the `itemsReordering` experimental feature:
283
+ * `<RichTreeViewPro experimentalFeatures={{ itemsReordering: true }} itemsReordering />`.
284
+ * @default false
285
+ */
286
+ itemsReordering: PropTypes.bool,
287
+ /**
288
+ * If `true`, `ctrl` and `shift` will trigger multiselect.
289
+ * @default false
290
+ */
291
+ multiSelect: PropTypes.bool,
292
+ /**
293
+ * Callback fired when tree items are expanded/collapsed.
294
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change.
295
+ * @param {array} itemIds The ids of the expanded items.
296
+ */
297
+ onExpandedItemsChange: PropTypes.func,
298
+ /**
299
+ * Callback fired when the `content` slot of a given tree item is clicked.
300
+ * @param {React.MouseEvent} event The DOM event that triggered the change.
301
+ * @param {string} itemId The id of the focused item.
302
+ */
303
+ onItemClick: PropTypes.func,
304
+ /**
305
+ * Callback fired when a tree item is expanded or collapsed.
306
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change.
307
+ * @param {array} itemId The itemId of the modified item.
308
+ * @param {array} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
309
+ */
310
+ onItemExpansionToggle: PropTypes.func,
311
+ /**
312
+ * Callback fired when a given tree item is focused.
313
+ * @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
314
+ * @param {string} itemId The id of the focused item.
315
+ */
316
+ onItemFocus: PropTypes.func,
317
+ /**
318
+ * Callback fired when a tree item is moved in the tree.
319
+ * @param {object} params The params describing the item re-ordering.
320
+ * @param {string} params.itemId The id of the item moved.
321
+ * @param {TreeViewItemReorderPosition} params.oldPosition The old position of the item.
322
+ * @param {TreeViewItemReorderPosition} params.newPosition The new position of the item.
323
+ */
324
+ onItemPositionChange: PropTypes.func,
325
+ /**
326
+ * Callback fired when a tree item is selected or deselected.
327
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change.
328
+ * @param {array} itemId The itemId of the modified item.
329
+ * @param {array} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
330
+ */
331
+ onItemSelectionToggle: PropTypes.func,
332
+ /**
333
+ * Callback fired when tree items are selected/deselected.
334
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change.
335
+ * @param {string[] | string} itemIds The ids of the selected items.
336
+ * When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
337
+ */
338
+ onSelectedItemsChange: PropTypes.func,
339
+ /**
340
+ * Selected item ids. (Controlled)
341
+ * When `multiSelect` is true this takes an array of strings; when false (default) a string.
342
+ */
343
+ selectedItems: PropTypes.any,
344
+ /**
345
+ * The props used for each component slot.
346
+ * @default {}
347
+ */
348
+ slotProps: PropTypes.object,
349
+ /**
350
+ * Overridable component slots.
351
+ * @default {}
352
+ */
353
+ slots: PropTypes.object,
354
+ /**
355
+ * The system prop that allows defining system overrides as well as additional CSS styles.
356
+ */
357
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
358
+ } : void 0;
359
+ export { RichTreeViewPro };
@@ -0,0 +1,8 @@
1
+ import { UseTreeViewItemsParameters, UseTreeViewExpansionParameters, UseTreeViewSelectionParameters, UseTreeViewFocusParameters, UseTreeViewIconsParameters, ConvertPluginsIntoSignatures, MergeSignaturesProperty, TreeViewCorePluginParameters } from '@mui/x-tree-view/internals';
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>];
4
+ export type RichTreeViewProPluginSignatures = ConvertPluginsIntoSignatures<typeof RICH_TREE_VIEW_PRO_PLUGINS>;
5
+ export type RichTreeViewProPluginSlots = MergeSignaturesProperty<RichTreeViewProPluginSignatures, 'slots'>;
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 {
8
+ }
@@ -0,0 +1,5 @@
1
+ import { useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons } from '@mui/x-tree-view/internals';
2
+ import { useTreeViewItemsReordering } from '../internals/plugins/useTreeViewItemsReordering';
3
+ export const RICH_TREE_VIEW_PRO_PLUGINS = [useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons, useTreeViewItemsReordering];
4
+
5
+ // We can't infer this type from the plugin, otherwise we would lose the generics.
@@ -0,0 +1,65 @@
1
+ import * as React from 'react';
2
+ import { Theme } from '@mui/material/styles';
3
+ import { SxProps } from '@mui/system';
4
+ import { SlotComponentProps } from '@mui/utils';
5
+ import { TreeItem, TreeItemProps } from '@mui/x-tree-view/TreeItem';
6
+ import { TreeItem2Props } from '@mui/x-tree-view/TreeItem2';
7
+ import { TreeViewItemId } from '@mui/x-tree-view/models';
8
+ import { TreeViewPublicAPI, TreeViewExperimentalFeatures } from '@mui/x-tree-view/internals';
9
+ import { RichTreeViewProClasses } from './richTreeViewProClasses';
10
+ import { RichTreeViewProPluginParameters, RichTreeViewProPluginSlotProps, RichTreeViewProPluginSlots, RichTreeViewProPluginSignatures } from './RichTreeViewPro.plugins';
11
+ interface RichTreeViewItemProSlotOwnerState {
12
+ itemId: TreeViewItemId;
13
+ label: string;
14
+ }
15
+ export interface RichTreeViewProSlots extends RichTreeViewProPluginSlots {
16
+ /**
17
+ * Element rendered at the root.
18
+ * @default RichTreeViewProRoot
19
+ */
20
+ root?: React.ElementType;
21
+ /**
22
+ * Custom component for the item.
23
+ * @default TreeItem.
24
+ */
25
+ item?: React.JSXElementConstructor<TreeItemProps> | React.JSXElementConstructor<TreeItem2Props>;
26
+ }
27
+ export interface RichTreeViewProSlotProps<R extends {}, Multiple extends boolean | undefined> extends RichTreeViewProPluginSlotProps {
28
+ root?: SlotComponentProps<'ul', {}, RichTreeViewProProps<R, Multiple>>;
29
+ item?: SlotComponentProps<typeof TreeItem, {}, RichTreeViewItemProSlotOwnerState>;
30
+ }
31
+ export type RichTreeViewProApiRef = React.MutableRefObject<TreeViewPublicAPI<RichTreeViewProPluginSignatures> | undefined>;
32
+ export interface RichTreeViewProPropsBase extends React.HTMLAttributes<HTMLUListElement> {
33
+ className?: string;
34
+ /**
35
+ * Override or extend the styles applied to the component.
36
+ */
37
+ classes?: Partial<RichTreeViewProClasses>;
38
+ /**
39
+ * The system prop that allows defining system overrides as well as additional CSS styles.
40
+ */
41
+ sx?: SxProps<Theme>;
42
+ }
43
+ export interface RichTreeViewProProps<R extends {}, Multiple extends boolean | undefined> extends RichTreeViewProPluginParameters<R, Multiple>, RichTreeViewProPropsBase {
44
+ /**
45
+ * Overridable component slots.
46
+ * @default {}
47
+ */
48
+ slots?: RichTreeViewProSlots;
49
+ /**
50
+ * The props used for each component slot.
51
+ * @default {}
52
+ */
53
+ slotProps?: RichTreeViewProSlotProps<R, Multiple>;
54
+ /**
55
+ * The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
56
+ */
57
+ apiRef?: RichTreeViewProApiRef;
58
+ /**
59
+ * Unstable features, breaking changes might be introduced.
60
+ * For each feature, if the flag is not explicitly set to `true`,
61
+ * the feature will be fully disabled and any property / method call will not have any effect.
62
+ */
63
+ experimentalFeatures?: TreeViewExperimentalFeatures<RichTreeViewProPluginSignatures>;
64
+ }
65
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './RichTreeViewPro';
2
+ export * from './richTreeViewProClasses';
3
+ export type { RichTreeViewProProps, RichTreeViewProPropsBase, RichTreeViewProSlots, RichTreeViewProSlotProps, } from './RichTreeViewPro.types';
@@ -0,0 +1,3 @@
1
+ export * from './RichTreeViewPro';
2
+ export * from './richTreeViewProClasses';
3
+ export {};
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/RichTreeViewPro/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,7 @@
1
+ export interface RichTreeViewProClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ }
5
+ export type RichTreeViewProClassKey = keyof RichTreeViewProClasses;
6
+ export declare function getRichTreeViewProUtilityClass(slot: string): string;
7
+ export declare const richTreeViewProClasses: RichTreeViewProClasses;
@@ -0,0 +1,6 @@
1
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
2
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
3
+ export function getRichTreeViewProUtilityClass(slot) {
4
+ return generateUtilityClass('MuiRichTreeViewPro', slot);
5
+ }
6
+ export const richTreeViewProClasses = generateUtilityClasses('MuiRichTreeViewPro', ['root']);
@@ -0,0 +1,12 @@
1
+ export * from '@mui/x-tree-view/TreeView';
2
+ export * from '@mui/x-tree-view/SimpleTreeView';
3
+ export * from './RichTreeViewPro';
4
+ export * from '@mui/x-tree-view/TreeItem';
5
+ export * from '@mui/x-tree-view/TreeItem2';
6
+ export * from '@mui/x-tree-view/useTreeItem2';
7
+ export * from '@mui/x-tree-view/TreeItem2Icon';
8
+ export * from '@mui/x-tree-view/TreeItem2Provider';
9
+ export { unstable_resetCleanupTracking } from '@mui/x-tree-view/internals';
10
+ export * from '@mui/x-tree-view/models';
11
+ export * from '@mui/x-tree-view/icons';
12
+ export * from '@mui/x-tree-view/hooks';
package/build/index.js ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @mui/x-tree-view-pro v7.12.0
3
+ *
4
+ * @license MUI X Commercial
5
+ * This source code is licensed under the commercial license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ // Tree View
9
+ export * from '@mui/x-tree-view/TreeView';
10
+ export * from '@mui/x-tree-view/SimpleTreeView';
11
+ export * from './RichTreeViewPro';
12
+
13
+ // Tree Item
14
+ export * from '@mui/x-tree-view/TreeItem';
15
+ export * from '@mui/x-tree-view/TreeItem2';
16
+ export * from '@mui/x-tree-view/useTreeItem2';
17
+ export * from '@mui/x-tree-view/TreeItem2Icon';
18
+ export * from '@mui/x-tree-view/TreeItem2Provider';
19
+ export { unstable_resetCleanupTracking } from '@mui/x-tree-view/internals';
20
+ export * from '@mui/x-tree-view/models';
21
+ export * from '@mui/x-tree-view/icons';
22
+ export * from '@mui/x-tree-view/hooks';
@@ -0,0 +1 @@
1
+ export { UseTreeViewItemsReorderingSignature } from './plugins/useTreeViewItemsReordering';
@@ -0,0 +1 @@
1
+ export { UseTreeViewItemsReorderingSignature } from './plugins/useTreeViewItemsReordering';
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/internals/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,2 @@
1
+ export { useTreeViewItemsReordering } from './useTreeViewItemsReordering';
2
+ export type { UseTreeViewItemsReorderingSignature, UseTreeViewItemsReorderingParameters, UseTreeViewItemsReorderingDefaultizedParameters, TreeViewItemReorderPosition, } from './useTreeViewItemsReordering.types';
@@ -0,0 +1 @@
1
+ export { useTreeViewItemsReordering } from './useTreeViewItemsReordering';
@@ -0,0 +1,3 @@
1
+ import { TreeViewPlugin } from '@mui/x-tree-view/internals';
2
+ import { UseTreeViewItemsReorderingSignature } from './useTreeViewItemsReordering.types';
3
+ export declare const useTreeViewItemsReordering: TreeViewPlugin<UseTreeViewItemsReorderingSignature>;
@@ -0,0 +1,4 @@
1
+ import { TreeViewItemPlugin } from '@mui/x-tree-view/internals';
2
+ import { TreeItem2Props } from '@mui/x-tree-view/TreeItem2';
3
+ export declare const isAndroid: () => boolean;
4
+ export declare const useTreeViewItemsReorderingItemPlugin: TreeViewItemPlugin<TreeItem2Props>;