@mui/x-tree-view 7.5.1 → 7.6.1
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 +112 -1
- package/RichTreeView/RichTreeView.js +14 -0
- package/RichTreeView/RichTreeView.types.d.ts +7 -1
- package/SimpleTreeView/SimpleTreeView.js +14 -0
- package/SimpleTreeView/SimpleTreeView.types.d.ts +7 -1
- package/TreeItem/TreeItem.js +35 -7
- package/TreeItem/TreeItem.types.d.ts +1 -0
- package/TreeItem2/TreeItem2.d.ts +12 -6
- package/TreeItem2/TreeItem2.js +21 -10
- package/TreeItem2Provider/TreeItem2Provider.js +4 -2
- package/TreeView/TreeView.js +14 -0
- package/index.js +1 -1
- package/internals/TreeViewItemDepthContext/TreeViewItemDepthContext.d.ts +3 -0
- package/internals/TreeViewItemDepthContext/TreeViewItemDepthContext.js +5 -0
- package/internals/TreeViewItemDepthContext/index.d.ts +1 -0
- package/internals/TreeViewItemDepthContext/index.js +1 -0
- package/internals/TreeViewProvider/TreeViewContext.d.ts +2 -2
- package/internals/TreeViewProvider/TreeViewProvider.types.d.ts +2 -2
- package/internals/index.d.ts +1 -1
- package/internals/models/helpers.d.ts +1 -0
- package/internals/models/plugin.d.ts +12 -5
- package/internals/models/treeView.d.ts +8 -1
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.types.d.ts +28 -4
- package/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +11 -26
- package/internals/plugins/useTreeViewFocus/useTreeViewFocus.types.d.ts +20 -5
- package/internals/plugins/useTreeViewId/useTreeViewId.types.d.ts +10 -1
- package/internals/plugins/useTreeViewItems/useTreeViewItems.js +29 -8
- package/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +50 -7
- package/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +34 -25
- package/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.types.d.ts +22 -4
- package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.types.d.ts +14 -1
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +5 -0
- package/internals/useTreeView/useTreeView.js +8 -3
- package/internals/useTreeView/useTreeView.types.d.ts +2 -1
- package/internals/utils/extractPluginParamsFromProps.d.ts +3 -2
- package/internals/utils/extractPluginParamsFromProps.js +4 -2
- package/internals/utils/tree.js +18 -1
- package/modern/RichTreeView/RichTreeView.js +14 -0
- package/modern/SimpleTreeView/SimpleTreeView.js +14 -0
- package/modern/TreeItem/TreeItem.js +35 -7
- package/modern/TreeItem2/TreeItem2.js +21 -10
- package/modern/TreeItem2Provider/TreeItem2Provider.js +4 -2
- package/modern/TreeView/TreeView.js +14 -0
- package/modern/index.js +1 -1
- package/modern/internals/TreeViewItemDepthContext/TreeViewItemDepthContext.js +5 -0
- package/modern/internals/TreeViewItemDepthContext/index.js +1 -0
- package/modern/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +11 -26
- package/modern/internals/plugins/useTreeViewItems/useTreeViewItems.js +29 -8
- package/modern/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +34 -25
- package/modern/internals/useTreeView/useTreeView.js +8 -3
- package/modern/internals/utils/extractPluginParamsFromProps.js +4 -2
- package/modern/internals/utils/tree.js +18 -1
- package/modern/useTreeItem2/useTreeItem2.js +20 -3
- package/node/RichTreeView/RichTreeView.js +14 -0
- package/node/SimpleTreeView/SimpleTreeView.js +14 -0
- package/node/TreeItem/TreeItem.js +35 -7
- package/node/TreeItem2/TreeItem2.js +20 -9
- package/node/TreeItem2Provider/TreeItem2Provider.js +4 -2
- package/node/TreeView/TreeView.js +14 -0
- package/node/index.js +1 -1
- package/node/internals/TreeViewItemDepthContext/TreeViewItemDepthContext.js +13 -0
- package/node/internals/TreeViewItemDepthContext/index.js +12 -0
- package/node/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +11 -26
- package/node/internals/plugins/useTreeViewItems/useTreeViewItems.js +29 -8
- package/node/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +34 -25
- package/node/internals/useTreeView/useTreeView.js +8 -3
- package/node/internals/utils/extractPluginParamsFromProps.js +4 -2
- package/node/internals/utils/tree.js +18 -1
- package/node/useTreeItem2/useTreeItem2.js +20 -3
- package/package.json +3 -3
- package/useTreeItem2/useTreeItem2.js +20 -3
- package/useTreeItem2/useTreeItem2.types.d.ts +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,117 @@
|
|
|
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.6.1
|
|
7
|
+
|
|
8
|
+
_May 31, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
🐞 Address the `@mui/internal-test-utils` added as a direct dependency to `@mui/x-data-grid` by mistake.
|
|
13
|
+
|
|
14
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
15
|
+
|
|
16
|
+
### Data Grid
|
|
17
|
+
|
|
18
|
+
#### `@mui/x-data-grid@7.6.1`
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Fix column resize not working with special character (#13069) @oukunan
|
|
21
|
+
- [DataGrid] Move `@mui/internal-test-utils` to dev dependency (#13318) @LukasTy
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid-pro@7.6.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
24
|
+
|
|
25
|
+
Same changes as in `@mui/x-data-grid@7.6.1`.
|
|
26
|
+
|
|
27
|
+
#### `@mui/x-data-grid-premium@7.6.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
28
|
+
|
|
29
|
+
Same changes as in `@mui/x-data-grid-pro@7.6.1`.
|
|
30
|
+
|
|
31
|
+
## 7.6.0
|
|
32
|
+
|
|
33
|
+
_May 30, 2024_
|
|
34
|
+
|
|
35
|
+
We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
36
|
+
|
|
37
|
+
- 🎁 Allow to define and customize the indentation of nested items in the Tree View
|
|
38
|
+
- ✨ Allow charts highlights to be controlled
|
|
39
|
+
- 🌍 Improve Persian (fa-IR) locale on the Data Grid
|
|
40
|
+
- 🐞 Bugfixes
|
|
41
|
+
- 📚 Documentation improvements
|
|
42
|
+
|
|
43
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
44
|
+
|
|
45
|
+
### Data Grid
|
|
46
|
+
|
|
47
|
+
#### `@mui/x-data-grid@7.6.0`
|
|
48
|
+
|
|
49
|
+
- [DataGrid] Avoid re-rendering all cells on column change (#12980) @romgrk
|
|
50
|
+
- [DataGrid] Export `GridColumnHeadersProps` (#13229) @cherniavskii
|
|
51
|
+
- [DataGrid] Fix header filters' issue with custom filters (#13255) @MBilalShafi
|
|
52
|
+
- [DataGrid] Remove dead logic to support Safari < 13 (#13249) @oliviertassinari
|
|
53
|
+
- [l10n] Improve Persian (fa-IR) locale (#12994) @amiryxe
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-data-grid-pro@7.6.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
56
|
+
|
|
57
|
+
Same changes as in `@mui/x-data-grid@7.6.0`.
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-data-grid-premium@7.6.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
60
|
+
|
|
61
|
+
Same changes as in `@mui/x-data-grid-pro@7.6.0`, plus:
|
|
62
|
+
|
|
63
|
+
- [DataGridPremium] Fix excel export causing column with wrong width (#13191) @romgrk
|
|
64
|
+
|
|
65
|
+
### Date and Time Pickers
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-date-pickers@7.6.0`
|
|
68
|
+
|
|
69
|
+
- [pickers] Fix `DateBuilderReturnType` when the date is `undefined` (#13244) @alexey-kozlenkov
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-date-pickers-pro@7.6.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
72
|
+
|
|
73
|
+
Same changes as in `@mui/x-date-pickers@7.6.0`.
|
|
74
|
+
|
|
75
|
+
### Charts
|
|
76
|
+
|
|
77
|
+
#### `@mui/x-charts@7.6.0`
|
|
78
|
+
|
|
79
|
+
- [charts] Allow charts highlights to be controlled (#12828) @JCQuintas
|
|
80
|
+
- [charts] Refactor axis band scaleType check (#13295) @JCQuintas
|
|
81
|
+
- [charts] Refactor checkScaleErrors to improve readability and simplify axis message logic (#13305) @JCQuintas
|
|
82
|
+
|
|
83
|
+
### Tree View
|
|
84
|
+
|
|
85
|
+
#### `@mui/x-tree-view@7.6.0`
|
|
86
|
+
|
|
87
|
+
- [TreeView] Add JSDoc to every instance method (#13219) @flaviendelangle
|
|
88
|
+
- [TreeView] Allow to customize the indentation of nested items (#13225) @flaviendelangle
|
|
89
|
+
- [TreeView] Allow to define indentation at the item level (#13126) @flaviendelangle
|
|
90
|
+
|
|
91
|
+
### Docs
|
|
92
|
+
|
|
93
|
+
- [docs] Add Bulk editing demo for the Community plan (#12800) @cherniavskii
|
|
94
|
+
- [docs] Add conditional label formatting on tooltip page and link to label page (#13235) @JCQuintas
|
|
95
|
+
- [docs] Add information about key combinations on a11y sections (#13234) @arthurbalduini
|
|
96
|
+
- [docs] Cleanup of the Tree View demos (#13237) @flaviendelangle
|
|
97
|
+
- [docs] Document how to customize a subsection of a line chart (#13210) @alexfauquette
|
|
98
|
+
- [docs] Fix Pickers FAQ callout (#13238) @LukasTy
|
|
99
|
+
- [docs] Fix Vale errors @oliviertassinari
|
|
100
|
+
- [docs] Fix a small typo in property comment (#13245) @Janpot
|
|
101
|
+
- [docs] Improve the Data Grid FAQ page (#13258) @MBilalShafi
|
|
102
|
+
- [docs] Removes unused lines in TreeItem2 styling (#13264) @arthurbalduini
|
|
103
|
+
- [docs] Small improvements on accessibility data grid doc (#13233) @arthurbalduini
|
|
104
|
+
- [docs] Update Pickers demo configurations (#13303) @LukasTy
|
|
105
|
+
|
|
106
|
+
### Core
|
|
107
|
+
|
|
108
|
+
- [core] Add comment on why logic to sync column header (#13248) @oliviertassinari
|
|
109
|
+
- [core] Fix `l10n` script execution with arguments (#13297) @LukasTy
|
|
110
|
+
- [core] Prevent "Add reviewers" workflow from triggering since it doesn't work (#13236) @JCQuintas
|
|
111
|
+
- [docs-infra] Fix `@mui/material` version used in sandboxes (#13260) @LukasTy
|
|
112
|
+
- [test] Use `describeTreeView` for keyboard navigation tests on disabled items (#13184) @flaviendelangle
|
|
113
|
+
- [test] Use `describeTreeView` for remaining items tests (#13262) @flaviendelangle
|
|
114
|
+
- [test] Use test-utils from npm (#12880) @michaldudak
|
|
115
|
+
- [typescript] Remove duplicate `DateRangePosition` type in favor of `RangePosition` (#13288) @LukasTy
|
|
116
|
+
|
|
6
117
|
## v7.5.1
|
|
7
118
|
|
|
8
119
|
_May 23, 2024_
|
|
@@ -339,7 +450,7 @@ Same changes as in `@mui/x-date-pickers@7.3.1`.
|
|
|
339
450
|
### Core
|
|
340
451
|
|
|
341
452
|
- [core] Fix `l10n` GH workflow (#12895) @LukasTy
|
|
342
|
-
- [core] Match Base
|
|
453
|
+
- [core] Match Base UI and Toolpad @oliviertassinari
|
|
343
454
|
- [core] Remove redundant `setupFiles` entries in `package.json` (#12899) @LukasTy
|
|
344
455
|
- [core] Use `describeTreeView` for focus tests (#12698) @flaviendelangle
|
|
345
456
|
- [core] Use `describeTreeView` for type-ahead tests (#12811) @flaviendelangle
|
|
@@ -180,6 +180,14 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes = {
|
|
|
180
180
|
* Used when the item's expansion is controlled.
|
|
181
181
|
*/
|
|
182
182
|
expandedItems: PropTypes.arrayOf(PropTypes.string),
|
|
183
|
+
/**
|
|
184
|
+
* Unstable features, breaking changes might be introduced.
|
|
185
|
+
* For each feature, if the flag is not explicitly set to `true`,
|
|
186
|
+
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
187
|
+
*/
|
|
188
|
+
experimentalFeatures: PropTypes.shape({
|
|
189
|
+
indentationAtItemLevel: PropTypes.bool
|
|
190
|
+
}),
|
|
183
191
|
/**
|
|
184
192
|
* Used to determine the id of a given item.
|
|
185
193
|
*
|
|
@@ -210,6 +218,12 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes = {
|
|
|
210
218
|
* @returns {boolean} `true` if the item should be disabled.
|
|
211
219
|
*/
|
|
212
220
|
isItemDisabled: PropTypes.func,
|
|
221
|
+
/**
|
|
222
|
+
* Horizontal indentation between an item and its children.
|
|
223
|
+
* Examples: 24, "24px", "2rem", "2em".
|
|
224
|
+
* @default 12px
|
|
225
|
+
*/
|
|
226
|
+
itemChildrenIndentation: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
213
227
|
items: PropTypes.array.isRequired,
|
|
214
228
|
/**
|
|
215
229
|
* If `true`, `ctrl` and `shift` will trigger multiselect.
|
|
@@ -7,7 +7,7 @@ import { DefaultTreeViewPluginParameters, DefaultTreeViewPluginSlotProps, Defaul
|
|
|
7
7
|
import { TreeItemProps } from '../TreeItem';
|
|
8
8
|
import { TreeItem2Props } from '../TreeItem2';
|
|
9
9
|
import { TreeViewItemId } from '../models';
|
|
10
|
-
import { SlotComponentPropsFromProps, TreeViewPublicAPI } from '../internals/models';
|
|
10
|
+
import { SlotComponentPropsFromProps, TreeViewExperimentalFeatures, TreeViewPublicAPI } from '../internals/models';
|
|
11
11
|
interface RichTreeViewItemSlotOwnerState {
|
|
12
12
|
itemId: TreeViewItemId;
|
|
13
13
|
label: string;
|
|
@@ -55,5 +55,11 @@ export interface RichTreeViewProps<R extends {}, Multiple extends boolean | unde
|
|
|
55
55
|
* The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
|
|
56
56
|
*/
|
|
57
57
|
apiRef?: RichTreeViewApiRef;
|
|
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<DefaultTreeViewPlugins>;
|
|
58
64
|
}
|
|
59
65
|
export {};
|
|
@@ -142,11 +142,25 @@ process.env.NODE_ENV !== "production" ? SimpleTreeView.propTypes = {
|
|
|
142
142
|
* Used when the item's expansion is controlled.
|
|
143
143
|
*/
|
|
144
144
|
expandedItems: PropTypes.arrayOf(PropTypes.string),
|
|
145
|
+
/**
|
|
146
|
+
* Unstable features, breaking changes might be introduced.
|
|
147
|
+
* For each feature, if the flag is not explicitly set to `true`,
|
|
148
|
+
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
149
|
+
*/
|
|
150
|
+
experimentalFeatures: PropTypes.shape({
|
|
151
|
+
indentationAtItemLevel: PropTypes.bool
|
|
152
|
+
}),
|
|
145
153
|
/**
|
|
146
154
|
* This prop is used to help implement the accessibility logic.
|
|
147
155
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
148
156
|
*/
|
|
149
157
|
id: PropTypes.string,
|
|
158
|
+
/**
|
|
159
|
+
* Horizontal indentation between an item and its children.
|
|
160
|
+
* Examples: 24, "24px", "2rem", "2em".
|
|
161
|
+
* @default 12px
|
|
162
|
+
*/
|
|
163
|
+
itemChildrenIndentation: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
150
164
|
/**
|
|
151
165
|
* If `true`, `ctrl` and `shift` will trigger multiselect.
|
|
152
166
|
* @default false
|
|
@@ -4,7 +4,7 @@ import { SlotComponentProps } from '@mui/base/utils';
|
|
|
4
4
|
import { SxProps } from '@mui/system';
|
|
5
5
|
import { SimpleTreeViewClasses } from './simpleTreeViewClasses';
|
|
6
6
|
import { SimpleTreeViewPluginParameters, SimpleTreeViewPluginSlotProps, SimpleTreeViewPluginSlots, SimpleTreeViewPlugins } from './SimpleTreeView.plugins';
|
|
7
|
-
import { TreeViewPublicAPI } from '../internals/models';
|
|
7
|
+
import { TreeViewExperimentalFeatures, TreeViewPublicAPI } from '../internals/models';
|
|
8
8
|
export interface SimpleTreeViewSlots extends SimpleTreeViewPluginSlots {
|
|
9
9
|
/**
|
|
10
10
|
* Element rendered at the root.
|
|
@@ -42,4 +42,10 @@ export interface SimpleTreeViewProps<Multiple extends boolean | undefined> exten
|
|
|
42
42
|
* The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
|
|
43
43
|
*/
|
|
44
44
|
apiRef?: SimpleTreeViewApiRef;
|
|
45
|
+
/**
|
|
46
|
+
* Unstable features, breaking changes might be introduced.
|
|
47
|
+
* For each feature, if the flag is not explicitly set to `true`,
|
|
48
|
+
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
49
|
+
*/
|
|
50
|
+
experimentalFeatures?: TreeViewExperimentalFeatures<SimpleTreeViewPlugins>;
|
|
45
51
|
}
|
package/TreeItem/TreeItem.js
CHANGED
|
@@ -10,6 +10,7 @@ import clsx from 'clsx';
|
|
|
10
10
|
import Collapse from '@mui/material/Collapse';
|
|
11
11
|
import { resolveComponentProps, useSlotProps } from '@mui/base/utils';
|
|
12
12
|
import useForkRef from '@mui/utils/useForkRef';
|
|
13
|
+
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
13
14
|
import { alpha, styled, useThemeProps } from '@mui/material/styles';
|
|
14
15
|
import unsupportedProp from '@mui/utils/unsupportedProp';
|
|
15
16
|
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
|
@@ -19,6 +20,7 @@ import { treeItemClasses, getTreeItemUtilityClass } from './treeItemClasses';
|
|
|
19
20
|
import { useTreeViewContext } from '../internals/TreeViewProvider/useTreeViewContext';
|
|
20
21
|
import { TreeViewCollapseIcon, TreeViewExpandIcon } from '../icons';
|
|
21
22
|
import { TreeItem2Provider } from '../TreeItem2Provider';
|
|
23
|
+
import { TreeViewItemDepthContext } from '../internals/TreeViewItemDepthContext';
|
|
22
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
25
|
const useUtilityClasses = ownerState => {
|
|
24
26
|
const {
|
|
@@ -57,7 +59,8 @@ const StyledTreeItemContent = styled(TreeItemContent, {
|
|
|
57
59
|
}, styles.label && {
|
|
58
60
|
[`& .${treeItemClasses.label}`]: styles.label
|
|
59
61
|
}];
|
|
60
|
-
}
|
|
62
|
+
},
|
|
63
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'indentationAtItemLevel'
|
|
61
64
|
})(({
|
|
62
65
|
theme
|
|
63
66
|
}) => ({
|
|
@@ -117,16 +120,33 @@ const StyledTreeItemContent = styled(TreeItemContent, {
|
|
|
117
120
|
}, theme.typography.body1),
|
|
118
121
|
[`& .${treeItemClasses.checkbox}`]: {
|
|
119
122
|
padding: 0
|
|
120
|
-
}
|
|
123
|
+
},
|
|
124
|
+
variants: [{
|
|
125
|
+
props: {
|
|
126
|
+
indentationAtItemLevel: true
|
|
127
|
+
},
|
|
128
|
+
style: {
|
|
129
|
+
paddingLeft: `calc(${theme.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
|
|
130
|
+
}
|
|
131
|
+
}]
|
|
121
132
|
}));
|
|
122
133
|
const TreeItemGroup = styled(Collapse, {
|
|
123
134
|
name: 'MuiTreeItem',
|
|
124
135
|
slot: 'GroupTransition',
|
|
125
|
-
overridesResolver: (props, styles) => styles.groupTransition
|
|
136
|
+
overridesResolver: (props, styles) => styles.groupTransition,
|
|
137
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'indentationAtItemLevel'
|
|
126
138
|
})({
|
|
127
139
|
margin: 0,
|
|
128
140
|
padding: 0,
|
|
129
|
-
paddingLeft:
|
|
141
|
+
paddingLeft: 'var(--TreeView-itemChildrenIndentation)',
|
|
142
|
+
variants: [{
|
|
143
|
+
props: {
|
|
144
|
+
indentationAtItemLevel: true
|
|
145
|
+
},
|
|
146
|
+
style: {
|
|
147
|
+
paddingLeft: 0
|
|
148
|
+
}
|
|
149
|
+
}]
|
|
130
150
|
});
|
|
131
151
|
|
|
132
152
|
/**
|
|
@@ -147,8 +167,10 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
147
167
|
multiSelect
|
|
148
168
|
},
|
|
149
169
|
disabledItemsFocusable,
|
|
170
|
+
indentationAtItemLevel,
|
|
150
171
|
instance
|
|
151
172
|
} = useTreeViewContext();
|
|
173
|
+
const depthContext = React.useContext(TreeViewItemDepthContext);
|
|
152
174
|
const props = useThemeProps({
|
|
153
175
|
props: inProps,
|
|
154
176
|
name: 'MuiTreeItem'
|
|
@@ -197,7 +219,8 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
197
219
|
expanded,
|
|
198
220
|
focused,
|
|
199
221
|
selected,
|
|
200
|
-
disabled
|
|
222
|
+
disabled,
|
|
223
|
+
indentationAtItemLevel
|
|
201
224
|
});
|
|
202
225
|
const classes = useUtilityClasses(ownerState);
|
|
203
226
|
const GroupTransition = slots.groupTransition ?? undefined;
|
|
@@ -205,12 +228,14 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
205
228
|
elementType: GroupTransition,
|
|
206
229
|
ownerState: {},
|
|
207
230
|
externalSlotProps: inSlotProps?.groupTransition,
|
|
208
|
-
additionalProps: {
|
|
231
|
+
additionalProps: _extends({
|
|
209
232
|
unmountOnExit: true,
|
|
210
233
|
in: expanded,
|
|
211
234
|
component: 'ul',
|
|
212
235
|
role: 'group'
|
|
213
|
-
},
|
|
236
|
+
}, indentationAtItemLevel ? {
|
|
237
|
+
indentationAtItemLevel: true
|
|
238
|
+
} : {}),
|
|
214
239
|
className: classes.groupTransition
|
|
215
240
|
});
|
|
216
241
|
const ExpansionIcon = expanded ? slots.collapseIcon : slots.expandIcon;
|
|
@@ -291,6 +316,9 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
|
|
|
291
316
|
onBlur: handleBlur,
|
|
292
317
|
onKeyDown: handleKeyDown,
|
|
293
318
|
ref: handleRootRef,
|
|
319
|
+
style: indentationAtItemLevel ? _extends({}, other.style, {
|
|
320
|
+
'--TreeView-itemDepth': typeof depthContext === 'function' ? depthContext(itemId) : depthContext
|
|
321
|
+
}) : other.style,
|
|
294
322
|
children: [/*#__PURE__*/_jsx(StyledTreeItemContent, _extends({
|
|
295
323
|
as: ContentComponent,
|
|
296
324
|
classes: {
|
package/TreeItem2/TreeItem2.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { CheckboxProps } from '@mui/material/Checkbox';
|
|
3
3
|
import { TreeItem2Props } from './TreeItem2.types';
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { UseTreeItem2Status } from '../useTreeItem2';
|
|
5
|
+
export declare const TreeItem2Root: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, keyof React.ClassAttributes<HTMLLIElement> | keyof React.LiHTMLAttributes<HTMLLIElement>>, {}>;
|
|
6
|
+
export declare const TreeItem2Content: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
7
|
+
status: UseTreeItem2Status;
|
|
8
|
+
indentationAtItemLevel?: true | undefined;
|
|
9
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const TreeItem2Label: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
|
|
11
|
+
export declare const TreeItem2IconContainer: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
|
|
12
|
+
export declare const TreeItem2GroupTransition: import("@emotion/styled").StyledComponent<import("@mui/material/Collapse").CollapseProps & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
13
|
+
indentationAtItemLevel?: true | undefined;
|
|
14
|
+
}, {}, {}>;
|
|
9
15
|
export declare const TreeItem2Checkbox: import("@emotion/styled").StyledComponent<Pick<Omit<CheckboxProps & {
|
|
10
16
|
visible: boolean;
|
|
11
|
-
}, "ref"> & React.RefAttributes<HTMLButtonElement>, "hidden" | "visible" | "color" | "content" | "size" | "style" | "icon" | "translate" | "disabled" | "form" | "slot" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "name" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "readOnly" | "required" | "action" | "checked" | "component" | "sx" | "classes" | "onFocusVisible" | "inputRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "checkedIcon" | "inputProps" | "indeterminate" | "indeterminateIcon" | keyof React.RefAttributes<HTMLButtonElement>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
17
|
+
}, "ref"> & React.RefAttributes<HTMLButtonElement>, "hidden" | "visible" | "color" | "content" | "size" | "style" | "icon" | "translate" | "disabled" | "form" | "slot" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "name" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "readOnly" | "required" | "action" | "checked" | "component" | "sx" | "classes" | "onFocusVisible" | "inputRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "checkedIcon" | "inputProps" | "indeterminate" | "indeterminateIcon" | keyof React.RefAttributes<HTMLButtonElement>> & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
12
18
|
type TreeItem2Component = ((props: TreeItem2Props & React.RefAttributes<HTMLLIElement>) => React.JSX.Element) & {
|
|
13
19
|
propTypes?: any;
|
|
14
20
|
};
|
package/TreeItem2/TreeItem2.js
CHANGED
|
@@ -10,10 +10,10 @@ import { alpha, styled, useThemeProps } from '@mui/material/styles';
|
|
|
10
10
|
import Collapse from '@mui/material/Collapse';
|
|
11
11
|
import MuiCheckbox from '@mui/material/Checkbox';
|
|
12
12
|
import { useSlotProps } from '@mui/base/utils';
|
|
13
|
-
import { shouldForwardProp } from '@mui/system';
|
|
13
|
+
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
14
14
|
import composeClasses from '@mui/utils/composeClasses';
|
|
15
15
|
import { unstable_useTreeItem2 as useTreeItem2 } from '../useTreeItem2';
|
|
16
|
-
import { getTreeItemUtilityClass
|
|
16
|
+
import { getTreeItemUtilityClass } from '../TreeItem';
|
|
17
17
|
import { TreeItem2Icon } from '../TreeItem2Icon';
|
|
18
18
|
import { TreeItem2Provider } from '../TreeItem2Provider';
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -31,7 +31,7 @@ export const TreeItem2Content = styled('div', {
|
|
|
31
31
|
name: 'MuiTreeItem2',
|
|
32
32
|
slot: 'Content',
|
|
33
33
|
overridesResolver: (props, styles) => styles.content,
|
|
34
|
-
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'status'
|
|
34
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'status' && prop !== 'indentationAtItemLevel'
|
|
35
35
|
})(({
|
|
36
36
|
theme
|
|
37
37
|
}) => ({
|
|
@@ -52,12 +52,14 @@ export const TreeItem2Content = styled('div', {
|
|
|
52
52
|
backgroundColor: 'transparent'
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
[`& .${treeItemClasses.groupTransition}`]: {
|
|
56
|
-
margin: 0,
|
|
57
|
-
padding: 0,
|
|
58
|
-
paddingLeft: 12
|
|
59
|
-
},
|
|
60
55
|
variants: [{
|
|
56
|
+
props: {
|
|
57
|
+
indentationAtItemLevel: true
|
|
58
|
+
},
|
|
59
|
+
style: {
|
|
60
|
+
paddingLeft: `calc(${theme.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
61
63
|
props: ({
|
|
62
64
|
status
|
|
63
65
|
}) => status.disabled,
|
|
@@ -125,11 +127,20 @@ export const TreeItem2IconContainer = styled('div', {
|
|
|
125
127
|
export const TreeItem2GroupTransition = styled(Collapse, {
|
|
126
128
|
name: 'MuiTreeItem2',
|
|
127
129
|
slot: 'GroupTransition',
|
|
128
|
-
overridesResolver: (props, styles) => styles.groupTransition
|
|
130
|
+
overridesResolver: (props, styles) => styles.groupTransition,
|
|
131
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'indentationAtItemLevel'
|
|
129
132
|
})({
|
|
130
133
|
margin: 0,
|
|
131
134
|
padding: 0,
|
|
132
|
-
paddingLeft:
|
|
135
|
+
paddingLeft: 'var(--TreeView-itemChildrenIndentation)',
|
|
136
|
+
variants: [{
|
|
137
|
+
props: {
|
|
138
|
+
indentationAtItemLevel: true
|
|
139
|
+
},
|
|
140
|
+
style: {
|
|
141
|
+
paddingLeft: 0
|
|
142
|
+
}
|
|
143
|
+
}]
|
|
133
144
|
});
|
|
134
145
|
export const TreeItem2Checkbox = styled( /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
135
146
|
const {
|
package/TreeView/TreeView.js
CHANGED
|
@@ -115,11 +115,25 @@ process.env.NODE_ENV !== "production" ? TreeView.propTypes = {
|
|
|
115
115
|
* Used when the item's expansion is controlled.
|
|
116
116
|
*/
|
|
117
117
|
expandedItems: PropTypes.arrayOf(PropTypes.string),
|
|
118
|
+
/**
|
|
119
|
+
* Unstable features, breaking changes might be introduced.
|
|
120
|
+
* For each feature, if the flag is not explicitly set to `true`,
|
|
121
|
+
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
122
|
+
*/
|
|
123
|
+
experimentalFeatures: PropTypes.shape({
|
|
124
|
+
indentationAtItemLevel: PropTypes.bool
|
|
125
|
+
}),
|
|
118
126
|
/**
|
|
119
127
|
* This prop is used to help implement the accessibility logic.
|
|
120
128
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
121
129
|
*/
|
|
122
130
|
id: PropTypes.string,
|
|
131
|
+
/**
|
|
132
|
+
* Horizontal indentation between an item and its children.
|
|
133
|
+
* Examples: 24, "24px", "2rem", "2em".
|
|
134
|
+
* @default 12px
|
|
135
|
+
*/
|
|
136
|
+
itemChildrenIndentation: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
123
137
|
/**
|
|
124
138
|
* If `true`, `ctrl` and `shift` will trigger multiselect.
|
|
125
139
|
* @default false
|
package/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TreeViewItemDepthContext } from './TreeViewItemDepthContext';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TreeViewItemDepthContext } from './TreeViewItemDepthContext';
|
|
@@ -6,7 +6,7 @@ export declare const TreeViewContext: React.Context<{
|
|
|
6
6
|
instance: {};
|
|
7
7
|
publicAPI: {};
|
|
8
8
|
rootRef: React.RefObject<HTMLUListElement>;
|
|
9
|
-
wrapItem: import("../models").TreeItemWrapper
|
|
10
|
-
wrapRoot: import("../models").TreeRootWrapper
|
|
9
|
+
wrapItem: import("../models").TreeItemWrapper<any>;
|
|
10
|
+
wrapRoot: import("../models").TreeRootWrapper<any>;
|
|
11
11
|
runItemPlugins: <TProps extends {}>(props: TProps) => Required<import("../models").TreeViewItemPluginResponse>;
|
|
12
12
|
} | null>;
|
|
@@ -4,8 +4,8 @@ export type TreeViewContextValue<TPlugins extends readonly TreeViewAnyPluginSign
|
|
|
4
4
|
instance: TreeViewInstance<TPlugins>;
|
|
5
5
|
publicAPI: TreeViewPublicAPI<TPlugins>;
|
|
6
6
|
rootRef: React.RefObject<HTMLUListElement>;
|
|
7
|
-
wrapItem: TreeItemWrapper
|
|
8
|
-
wrapRoot: TreeRootWrapper
|
|
7
|
+
wrapItem: TreeItemWrapper<TPlugins>;
|
|
8
|
+
wrapRoot: TreeRootWrapper<TPlugins>;
|
|
9
9
|
runItemPlugins: <TProps extends {}>(props: TProps) => Required<TreeViewItemPluginResponse>;
|
|
10
10
|
};
|
|
11
11
|
export interface TreeViewProviderProps<TPlugins extends readonly TreeViewAnyPluginSignature[]> {
|
package/internals/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { useTreeView } from './useTreeView';
|
|
2
2
|
export { TreeViewProvider } from './TreeViewProvider';
|
|
3
3
|
export { unstable_resetCleanupTracking } from './hooks/useInstanceEventHandler';
|
|
4
|
-
export type { TreeViewPlugin, TreeViewPluginSignature, ConvertPluginsIntoSignatures, MergePluginsProperty, TreeViewPublicAPI, } from './models';
|
|
4
|
+
export type { TreeViewPlugin, TreeViewPluginSignature, ConvertPluginsIntoSignatures, MergePluginsProperty, TreeViewPublicAPI, TreeViewExperimentalFeatures, } from './models';
|
|
5
5
|
export { DEFAULT_TREE_VIEW_PLUGINS } from './plugins/defaultPlugins';
|
|
6
6
|
export type { DefaultTreeViewPlugins, DefaultTreeViewPluginSlots, DefaultTreeViewPluginSlotProps, } from './plugins/defaultPlugins';
|
|
7
7
|
export type { DefaultTreeViewPluginParameters } from './plugins/defaultPlugins';
|
|
@@ -17,5 +17,6 @@ export interface MergePlugins<TPlugins extends readonly any[]> {
|
|
|
17
17
|
slotProps: MergePluginsProperty<TPlugins, 'slotProps'>;
|
|
18
18
|
events: MergePluginsProperty<TPlugins, 'events'>;
|
|
19
19
|
models: MergePluginsProperty<TPlugins, 'models'>;
|
|
20
|
+
experimentalFeatures: MergePluginsProperty<TPlugins, 'experimentalFeatures'>;
|
|
20
21
|
}
|
|
21
22
|
export {};
|