@mui/x-tree-view 7.6.1 → 7.7.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 +147 -0
- package/RichTreeView/RichTreeView.d.ts +1 -3
- package/RichTreeView/RichTreeView.js +12 -15
- package/RichTreeView/RichTreeView.plugins.d.ts +13 -0
- package/RichTreeView/RichTreeView.plugins.js +10 -0
- package/RichTreeView/RichTreeView.types.d.ts +6 -6
- package/RichTreeView/index.d.ts +2 -0
- package/RichTreeView/index.js +1 -1
- package/SimpleTreeView/SimpleTreeView.d.ts +1 -1
- package/SimpleTreeView/SimpleTreeView.js +11 -14
- package/SimpleTreeView/SimpleTreeView.plugins.d.ts +12 -7
- package/SimpleTreeView/SimpleTreeView.plugins.js +8 -2
- package/SimpleTreeView/SimpleTreeView.types.d.ts +3 -3
- package/TreeItem/TreeItem.js +7 -1
- package/TreeItem/TreeItem.types.d.ts +22 -1
- package/TreeItem2/TreeItem2.js +12 -2
- package/TreeItem2/TreeItem2.types.d.ts +10 -1
- package/TreeView/TreeView.js +2 -1
- package/hooks/useTreeViewApiRef.d.ts +1 -1
- package/index.js +1 -1
- package/internals/TreeViewProvider/TreeViewContext.d.ts +2 -2
- package/internals/TreeViewProvider/TreeViewProvider.d.ts +1 -1
- package/internals/TreeViewProvider/TreeViewProvider.types.d.ts +10 -9
- package/internals/TreeViewProvider/index.d.ts +1 -1
- package/internals/TreeViewProvider/useTreeViewContext.d.ts +1 -1
- package/internals/corePlugins/corePlugins.d.ts +2 -2
- package/internals/corePlugins/index.d.ts +1 -1
- package/internals/hooks/useInstanceEventHandler.d.ts +2 -2
- package/internals/index.d.ts +1 -5
- package/internals/index.js +1 -3
- package/internals/models/helpers.d.ts +3 -16
- package/internals/models/plugin.d.ts +9 -9
- package/internals/models/treeView.d.ts +5 -4
- package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +4 -5
- package/internals/useTreeView/extractPluginParamsFromProps.d.ts +13 -0
- package/internals/{utils → useTreeView}/extractPluginParamsFromProps.js +16 -16
- package/internals/useTreeView/index.d.ts +0 -1
- package/internals/useTreeView/useTreeView.d.ts +4 -4
- package/internals/useTreeView/useTreeView.js +85 -72
- package/internals/useTreeView/useTreeView.types.d.ts +13 -12
- package/internals/useTreeView/useTreeViewModels.d.ts +3 -2
- package/internals/utils/publishTreeViewEvent.d.ts +1 -1
- package/internals/zero-styled/index.d.ts +3 -0
- package/internals/zero-styled/index.js +7 -0
- package/modern/RichTreeView/RichTreeView.js +12 -15
- package/modern/RichTreeView/RichTreeView.plugins.js +10 -0
- package/modern/RichTreeView/index.js +1 -1
- package/modern/SimpleTreeView/SimpleTreeView.js +11 -14
- package/modern/SimpleTreeView/SimpleTreeView.plugins.js +8 -2
- package/modern/TreeItem/TreeItem.js +7 -1
- package/modern/TreeItem2/TreeItem2.js +12 -2
- package/modern/TreeView/TreeView.js +2 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -3
- package/modern/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +4 -5
- package/modern/internals/{utils → useTreeView}/extractPluginParamsFromProps.js +16 -16
- package/modern/internals/useTreeView/useTreeView.js +85 -72
- package/modern/internals/zero-styled/index.js +7 -0
- package/node/RichTreeView/RichTreeView.js +14 -17
- package/node/RichTreeView/RichTreeView.plugins.js +16 -0
- package/node/RichTreeView/index.js +13 -1
- package/node/SimpleTreeView/SimpleTreeView.js +13 -16
- package/node/SimpleTreeView/SimpleTreeView.plugins.js +8 -2
- package/node/TreeItem/TreeItem.js +10 -4
- package/node/TreeItem2/TreeItem2.js +18 -8
- package/node/TreeView/TreeView.js +4 -3
- package/node/index.js +1 -1
- package/node/internals/index.js +1 -15
- package/node/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +4 -5
- package/node/internals/{utils → useTreeView}/extractPluginParamsFromProps.js +16 -16
- package/node/internals/useTreeView/useTreeView.js +85 -72
- package/node/internals/zero-styled/index.js +17 -0
- package/package.json +2 -2
- package/useTreeItem2/useTreeItem2.d.ts +2 -2
- package/useTreeItem2/useTreeItem2.types.d.ts +14 -2
- package/internals/plugins/defaultPlugins.d.ts +0 -13
- package/internals/plugins/defaultPlugins.js +0 -10
- package/internals/plugins/index.d.ts +0 -2
- package/internals/plugins/index.js +0 -1
- package/internals/utils/extractPluginParamsFromProps.d.ts +0 -18
- package/modern/internals/plugins/defaultPlugins.js +0 -10
- package/modern/internals/plugins/index.js +0 -1
- package/node/internals/plugins/defaultPlugins.js +0 -16
- package/node/internals/plugins/index.js +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,153 @@
|
|
|
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.7.0
|
|
7
|
+
|
|
8
|
+
_Jun 13, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Allow customization of the Pickers month and the year buttons
|
|
13
|
+
- 🌍 Improve Persian (fa-IR), Portuguese (pt-PT), and Russian (ru-RU) locales on the Data Grid
|
|
14
|
+
- 🌍 Improve Korean (ko-KR) and Persian (fa-IR) locales on the Date and Time Pickers
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
- 📚 Documentation improvements
|
|
17
|
+
|
|
18
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
19
|
+
|
|
20
|
+
### Data Grid
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid@7.7.0`
|
|
23
|
+
|
|
24
|
+
- [DataGrid] Add `getFilterState` method (#13418) @cherniavskii
|
|
25
|
+
- [DataGrid] Do not show resize separators for column groups (#13455) @cherniavskii
|
|
26
|
+
- [l10n] Improve Persian (fa-IR) locale (#13402) @fakhamatia
|
|
27
|
+
- [l10n] Improve Portuguese (pt-PT) locale (#13384) @olavocarvalho
|
|
28
|
+
- [l10n] Improve Russian (ru-RU) locale (#11210) @dastan-akhmetov-scity
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@7.7.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@7.7.0`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPro] Do not render detail panel if the focused cell is not visible (#13456) @cherniavskii
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-premium@7.7.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid-pro@7.7.0`.
|
|
39
|
+
|
|
40
|
+
### Date and Time Pickers
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-date-pickers@7.7.0`
|
|
43
|
+
|
|
44
|
+
- [l10n] Improve Korean (ko-KR) locale (#13452) @ryxxn
|
|
45
|
+
- [l10n] Improve Persian (fa-IR) locale (#13402) @fakhamatia
|
|
46
|
+
- [pickers] Allow to customize the month and the year buttons (#13321) @flaviendelangle
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers-pro@7.7.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
|
+
|
|
50
|
+
Same changes as in `@mui/x-date-pickers@7.7.0`.
|
|
51
|
+
|
|
52
|
+
### Charts
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-charts@7.7.0`
|
|
55
|
+
|
|
56
|
+
- [charts] Add watermark on the pro `ResponsiveChartContainer` (#13398) @alexfauquette
|
|
57
|
+
- [charts] Allow to specify y-axis configuration (#13438) @alexfauquette
|
|
58
|
+
- [charts] Fix eslint for react compiler (#13444) @alexfauquette
|
|
59
|
+
- [charts] Improve themeAugmentation typing (#13433) @noraleonte
|
|
60
|
+
- [charts] Move the `ZAxisContextProvider` by default in the `ChartContainer` (#13465) @alexfauquette
|
|
61
|
+
- [charts] Use plugins to define series extremum and colors (#13397) @alexfauquette
|
|
62
|
+
|
|
63
|
+
### Tree View
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-tree-view@7.7.0`
|
|
66
|
+
|
|
67
|
+
- [TreeView] Improve TypeScript for plugins (#13380) @flaviendelangle
|
|
68
|
+
- [TreeView] Improve the typing of the cancelable events (#13152) @flaviendelangle
|
|
69
|
+
- [TreeView] Prepare support for PigmentCSS (#13412) @flaviendelangle
|
|
70
|
+
- [TreeView] Refactor the tree view internals to prepare for headless API (#13311) @flaviendelangle
|
|
71
|
+
|
|
72
|
+
### Docs
|
|
73
|
+
|
|
74
|
+
- [docs] Add `renderHeader` recipe to the Master Details docs (#13370) @michelengelen
|
|
75
|
+
- [docs] Add lazy loading detail panel demo (#13453) @cherniavskii
|
|
76
|
+
- [docs] Add small edits to the Data Grid overview page (#13060) @danilo-leal
|
|
77
|
+
- [docs] Update a11y pages description (#13417) @danilo-leal
|
|
78
|
+
- [docs] improve the writing on the "Quick filter outside of the grid" example (#13155) @michelengelen
|
|
79
|
+
|
|
80
|
+
### Core
|
|
81
|
+
|
|
82
|
+
- [core] Add `eslint-plugin-react-compiler` experimental version and rules (#13415) @JCQuintas
|
|
83
|
+
- [core] Minor setup cleanup (#13467) @LukasTy
|
|
84
|
+
- [infra] Adjust CI setup (#13448) @LukasTy
|
|
85
|
+
- [test] Add tests for the custom slots of `TreeItem2` (#13314) @flaviendelangle
|
|
86
|
+
|
|
87
|
+
## 7.6.2
|
|
88
|
+
|
|
89
|
+
_Jun 6, 2024_
|
|
90
|
+
|
|
91
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
92
|
+
|
|
93
|
+
- 📚 Adds Date and Time Pickers accessibility page
|
|
94
|
+
- 🐞 Bugfixes
|
|
95
|
+
- 📚 Documentation improvements
|
|
96
|
+
|
|
97
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
98
|
+
|
|
99
|
+
### Data Grid
|
|
100
|
+
|
|
101
|
+
#### `@mui/x-data-grid@7.6.2`
|
|
102
|
+
|
|
103
|
+
- [DataGrid] Add the `areElementSizesEqual` utility to improve code readability (#13254) @layerok
|
|
104
|
+
- [DataGrid] Clean up IE remnants from the codebase (#13390) @MBilalShafi
|
|
105
|
+
|
|
106
|
+
#### `@mui/x-data-grid-pro@7.6.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
107
|
+
|
|
108
|
+
Same changes as in `@mui/x-data-grid@7.6.2`.
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-data-grid-premium@7.6.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
111
|
+
|
|
112
|
+
Same changes as in `@mui/x-data-grid-pro@7.6.2`.
|
|
113
|
+
|
|
114
|
+
### Date and Time Pickers
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-date-pickers@7.6.2`
|
|
117
|
+
|
|
118
|
+
- [fields] Fix `PageUp` and `PageDown` editing on letter sections (#13310) @arthurbalduini
|
|
119
|
+
- [pickers] Fix `AdapterDayjs` timezone behavior (#13362) @LukasTy
|
|
120
|
+
- [pickers] Use `useRtl` instead of `useTheme` to access direction (#13363) @flaviendelangle
|
|
121
|
+
|
|
122
|
+
#### `@mui/x-date-pickers-pro@7.6.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
123
|
+
|
|
124
|
+
Same changes as in `@mui/x-date-pickers@7.6.2`.
|
|
125
|
+
|
|
126
|
+
### Charts
|
|
127
|
+
|
|
128
|
+
#### `@mui/x-charts@7.6.2`
|
|
129
|
+
|
|
130
|
+
- [charts] Add `Initializable` type and behaviour to allow checking if a complex context has been initialized. (#13365) @JCQuintas
|
|
131
|
+
- [charts] Fix some props not working in `xAxis` and `yAxis` (#13372) @Valyok26
|
|
132
|
+
- [charts] Harmonize charts types (#13366) @alexfauquette
|
|
133
|
+
- [charts] Introduce plugins system (#13367) @alexfauquette
|
|
134
|
+
- [charts] Simplify plugin types (#13396) @JCQuintas
|
|
135
|
+
|
|
136
|
+
### Docs
|
|
137
|
+
|
|
138
|
+
- [docs] Add badges like in Material UI @oliviertassinari
|
|
139
|
+
- [docs] Update twitter.com to x.com @oliviertassinari
|
|
140
|
+
- [docs] Fix the description of `tickInterval` (#13355) @alexfauquette
|
|
141
|
+
- [docs] Adjust the code example for `quickFilterValues` (#12919) @michelengelen
|
|
142
|
+
- [docs] Create Pickers accessibility page (#13274) @arthurbalduini
|
|
143
|
+
|
|
144
|
+
### Core
|
|
145
|
+
|
|
146
|
+
- [core] Comment on `CSS.escape` for the future @oliviertassinari
|
|
147
|
+
- [core] Fix `l10n` action setup (#13382) @LukasTy
|
|
148
|
+
- [core] Fixes in preparation for React 18.3 (#13378) @LukasTy
|
|
149
|
+
- [core] Remove explicit `marked` dependency (#13383) @LukasTy
|
|
150
|
+
- [core] Remove unused `@types/prettier` dependency (#13389) @LukasTy
|
|
151
|
+
- [core] Add `docs/.env.local` to `.gitignore` (#13377) @KenanYusuf
|
|
152
|
+
|
|
6
153
|
## 7.6.1
|
|
7
154
|
|
|
8
155
|
_May 31, 2024_
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RichTreeViewProps } from './RichTreeView.types';
|
|
3
|
-
export declare const RichTreeViewRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material
|
|
4
|
-
ownerState: RichTreeViewProps<any, any>;
|
|
5
|
-
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, keyof React.ClassAttributes<HTMLUListElement> | keyof React.HTMLAttributes<HTMLUListElement>>, {}>;
|
|
3
|
+
export declare const RichTreeViewRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, keyof React.ClassAttributes<HTMLUListElement> | keyof React.HTMLAttributes<HTMLUListElement>>, {}>;
|
|
6
4
|
type RichTreeViewComponent = (<R extends {}, Multiple extends boolean | undefined = undefined>(props: RichTreeViewProps<R, Multiple> & React.RefAttributes<HTMLUListElement>) => React.JSX.Element) & {
|
|
7
5
|
propTypes?: any;
|
|
8
6
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { styled, useThemeProps } from '@mui/material/styles';
|
|
5
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
7
6
|
import { getRichTreeViewUtilityClass } from './richTreeViewClasses';
|
|
7
|
+
import { styled, createUseThemeProps } from '../internals/zero-styled';
|
|
8
8
|
import { useTreeView } from '../internals/useTreeView';
|
|
9
9
|
import { TreeViewProvider } from '../internals/TreeViewProvider';
|
|
10
|
-
import {
|
|
10
|
+
import { RICH_TREE_VIEW_PLUGINS } from './RichTreeView.plugins';
|
|
11
11
|
import { TreeItem } from '../TreeItem';
|
|
12
12
|
import { buildWarning } from '../internals/utils/warning';
|
|
13
|
-
import { extractPluginParamsFromProps } from '../internals/utils/extractPluginParamsFromProps';
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const useThemeProps = createUseThemeProps('MuiRichTreeView');
|
|
15
15
|
const useUtilityClasses = ownerState => {
|
|
16
16
|
const {
|
|
17
17
|
classes
|
|
@@ -80,27 +80,24 @@ const RichTreeView = /*#__PURE__*/React.forwardRef(function RichTreeView(inProps
|
|
|
80
80
|
childrenWarning();
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
const {
|
|
84
|
-
pluginParams,
|
|
85
|
-
slots,
|
|
86
|
-
slotProps,
|
|
87
|
-
otherProps
|
|
88
|
-
} = extractPluginParamsFromProps({
|
|
89
|
-
props,
|
|
90
|
-
plugins: DEFAULT_TREE_VIEW_PLUGINS,
|
|
91
|
-
rootRef: ref
|
|
92
|
-
});
|
|
93
83
|
const {
|
|
94
84
|
getRootProps,
|
|
95
85
|
contextValue,
|
|
96
86
|
instance
|
|
97
|
-
} = useTreeView(
|
|
87
|
+
} = useTreeView({
|
|
88
|
+
plugins: RICH_TREE_VIEW_PLUGINS,
|
|
89
|
+
rootRef: ref,
|
|
90
|
+
props
|
|
91
|
+
});
|
|
92
|
+
const {
|
|
93
|
+
slots,
|
|
94
|
+
slotProps
|
|
95
|
+
} = props;
|
|
98
96
|
const classes = useUtilityClasses(props);
|
|
99
97
|
const Root = slots?.root ?? RichTreeViewRoot;
|
|
100
98
|
const rootProps = useSlotProps({
|
|
101
99
|
elementType: Root,
|
|
102
100
|
externalSlotProps: slotProps?.root,
|
|
103
|
-
externalForwardedProps: otherProps,
|
|
104
101
|
className: classes.root,
|
|
105
102
|
getSlotProps: getRootProps,
|
|
106
103
|
ownerState: props
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseTreeViewIdParameters } from '../internals/plugins/useTreeViewId';
|
|
2
|
+
import { UseTreeViewItemsParameters } from '../internals/plugins/useTreeViewItems';
|
|
3
|
+
import { UseTreeViewExpansionParameters } from '../internals/plugins/useTreeViewExpansion';
|
|
4
|
+
import { UseTreeViewSelectionParameters } from '../internals/plugins/useTreeViewSelection';
|
|
5
|
+
import { UseTreeViewFocusParameters } from '../internals/plugins/useTreeViewFocus';
|
|
6
|
+
import { UseTreeViewIconsParameters } from '../internals/plugins/useTreeViewIcons';
|
|
7
|
+
import { ConvertPluginsIntoSignatures, MergeSignaturesProperty } from '../internals/models';
|
|
8
|
+
export declare const RICH_TREE_VIEW_PLUGINS: readonly [import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewId").UseTreeViewIdSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewItems").UseTreeViewItemsSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewExpansion").UseTreeViewExpansionSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewSelection").UseTreeViewSelectionSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewFocus").UseTreeViewFocusSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewKeyboardNavigation").UseTreeViewKeyboardNavigationSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewIcons").UseTreeViewIconsSignature>];
|
|
9
|
+
export type RichTreeViewPluginSignatures = ConvertPluginsIntoSignatures<typeof RICH_TREE_VIEW_PLUGINS>;
|
|
10
|
+
export type RichTreeViewPluginSlots = MergeSignaturesProperty<RichTreeViewPluginSignatures, 'slots'>;
|
|
11
|
+
export type RichTreeViewPluginSlotProps = MergeSignaturesProperty<RichTreeViewPluginSignatures, 'slotProps'>;
|
|
12
|
+
export interface RichTreeViewPluginParameters<R extends {}, Multiple extends boolean | undefined> extends UseTreeViewIdParameters, UseTreeViewItemsParameters<R>, UseTreeViewExpansionParameters, UseTreeViewFocusParameters, UseTreeViewSelectionParameters<Multiple>, UseTreeViewIconsParameters {
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useTreeViewId } from '../internals/plugins/useTreeViewId';
|
|
2
|
+
import { useTreeViewItems } from '../internals/plugins/useTreeViewItems';
|
|
3
|
+
import { useTreeViewExpansion } from '../internals/plugins/useTreeViewExpansion';
|
|
4
|
+
import { useTreeViewSelection } from '../internals/plugins/useTreeViewSelection';
|
|
5
|
+
import { useTreeViewFocus } from '../internals/plugins/useTreeViewFocus';
|
|
6
|
+
import { useTreeViewKeyboardNavigation } from '../internals/plugins/useTreeViewKeyboardNavigation';
|
|
7
|
+
import { useTreeViewIcons } from '../internals/plugins/useTreeViewIcons';
|
|
8
|
+
export const RICH_TREE_VIEW_PLUGINS = [useTreeViewId, useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons];
|
|
9
|
+
|
|
10
|
+
// We can't infer this type from the plugin, otherwise we would lose the generics.
|
|
@@ -3,7 +3,7 @@ import { Theme } from '@mui/material/styles';
|
|
|
3
3
|
import { SxProps } from '@mui/system';
|
|
4
4
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
5
5
|
import { RichTreeViewClasses } from './richTreeViewClasses';
|
|
6
|
-
import {
|
|
6
|
+
import { RichTreeViewPluginParameters, RichTreeViewPluginSlotProps, RichTreeViewPluginSlots, RichTreeViewPluginSignatures } from './RichTreeView.plugins';
|
|
7
7
|
import { TreeItemProps } from '../TreeItem';
|
|
8
8
|
import { TreeItem2Props } from '../TreeItem2';
|
|
9
9
|
import { TreeViewItemId } from '../models';
|
|
@@ -12,7 +12,7 @@ interface RichTreeViewItemSlotOwnerState {
|
|
|
12
12
|
itemId: TreeViewItemId;
|
|
13
13
|
label: string;
|
|
14
14
|
}
|
|
15
|
-
export interface RichTreeViewSlots extends
|
|
15
|
+
export interface RichTreeViewSlots extends RichTreeViewPluginSlots {
|
|
16
16
|
/**
|
|
17
17
|
* Element rendered at the root.
|
|
18
18
|
* @default RichTreeViewRoot
|
|
@@ -24,11 +24,11 @@ export interface RichTreeViewSlots extends DefaultTreeViewPluginSlots {
|
|
|
24
24
|
*/
|
|
25
25
|
item?: React.JSXElementConstructor<TreeItemProps> | React.JSXElementConstructor<TreeItem2Props>;
|
|
26
26
|
}
|
|
27
|
-
export interface RichTreeViewSlotProps<R extends {}, Multiple extends boolean | undefined> extends
|
|
27
|
+
export interface RichTreeViewSlotProps<R extends {}, Multiple extends boolean | undefined> extends RichTreeViewPluginSlotProps {
|
|
28
28
|
root?: SlotComponentProps<'ul', {}, RichTreeViewProps<R, Multiple>>;
|
|
29
29
|
item?: SlotComponentPropsFromProps<TreeItemProps | TreeItem2Props, {}, RichTreeViewItemSlotOwnerState>;
|
|
30
30
|
}
|
|
31
|
-
export type RichTreeViewApiRef = React.MutableRefObject<TreeViewPublicAPI<
|
|
31
|
+
export type RichTreeViewApiRef = React.MutableRefObject<TreeViewPublicAPI<RichTreeViewPluginSignatures> | undefined>;
|
|
32
32
|
export interface RichTreeViewPropsBase extends React.HTMLAttributes<HTMLUListElement> {
|
|
33
33
|
className?: string;
|
|
34
34
|
/**
|
|
@@ -40,7 +40,7 @@ export interface RichTreeViewPropsBase extends React.HTMLAttributes<HTMLUListEle
|
|
|
40
40
|
*/
|
|
41
41
|
sx?: SxProps<Theme>;
|
|
42
42
|
}
|
|
43
|
-
export interface RichTreeViewProps<R extends {}, Multiple extends boolean | undefined> extends
|
|
43
|
+
export interface RichTreeViewProps<R extends {}, Multiple extends boolean | undefined> extends RichTreeViewPluginParameters<R, Multiple>, RichTreeViewPropsBase {
|
|
44
44
|
/**
|
|
45
45
|
* Overridable component slots.
|
|
46
46
|
* @default {}
|
|
@@ -60,6 +60,6 @@ export interface RichTreeViewProps<R extends {}, Multiple extends boolean | unde
|
|
|
60
60
|
* For each feature, if the flag is not explicitly set to `true`,
|
|
61
61
|
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
62
62
|
*/
|
|
63
|
-
experimentalFeatures?: TreeViewExperimentalFeatures<
|
|
63
|
+
experimentalFeatures?: TreeViewExperimentalFeatures<RichTreeViewPluginSignatures>;
|
|
64
64
|
}
|
|
65
65
|
export {};
|
package/RichTreeView/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from './RichTreeView';
|
|
2
2
|
export * from './richTreeViewClasses';
|
|
3
3
|
export type { RichTreeViewProps, RichTreeViewPropsBase, RichTreeViewSlots, RichTreeViewSlotProps, } from './RichTreeView.types';
|
|
4
|
+
export { RICH_TREE_VIEW_PLUGINS } from './RichTreeView.plugins';
|
|
5
|
+
export type { RichTreeViewPluginSlots, RichTreeViewPluginSlotProps, RichTreeViewPluginParameters, } from './RichTreeView.plugins';
|
package/RichTreeView/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SimpleTreeViewProps } from './SimpleTreeView.types';
|
|
3
|
-
export declare const SimpleTreeViewRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material
|
|
3
|
+
export declare const SimpleTreeViewRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
4
4
|
ownerState: SimpleTreeViewProps<any>;
|
|
5
5
|
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, keyof React.ClassAttributes<HTMLUListElement> | keyof React.HTMLAttributes<HTMLUListElement>>, {}>;
|
|
6
6
|
type SimpleTreeViewComponent = (<Multiple extends boolean | undefined = undefined>(props: SimpleTreeViewProps<Multiple> & React.RefAttributes<HTMLUListElement>) => React.JSX.Element) & {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { styled, useThemeProps } from '@mui/material/styles';
|
|
5
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
6
|
+
import { styled, createUseThemeProps } from '../internals/zero-styled';
|
|
7
7
|
import { getSimpleTreeViewUtilityClass } from './simpleTreeViewClasses';
|
|
8
8
|
import { useTreeView } from '../internals/useTreeView';
|
|
9
9
|
import { TreeViewProvider } from '../internals/TreeViewProvider';
|
|
10
10
|
import { SIMPLE_TREE_VIEW_PLUGINS } from './SimpleTreeView.plugins';
|
|
11
11
|
import { buildWarning } from '../internals/utils/warning';
|
|
12
|
-
import { extractPluginParamsFromProps } from '../internals/utils/extractPluginParamsFromProps';
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const useThemeProps = createUseThemeProps('MuiSimpleTreeView');
|
|
14
14
|
const useUtilityClasses = ownerState => {
|
|
15
15
|
const {
|
|
16
16
|
classes
|
|
@@ -56,27 +56,24 @@ const SimpleTreeView = /*#__PURE__*/React.forwardRef(function SimpleTreeView(inP
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
const {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
getRootProps,
|
|
60
|
+
contextValue
|
|
61
|
+
} = useTreeView({
|
|
62
|
+
plugins: SIMPLE_TREE_VIEW_PLUGINS,
|
|
63
|
+
rootRef: ref,
|
|
64
64
|
props: _extends({}, props, {
|
|
65
65
|
items: EMPTY_ITEMS
|
|
66
|
-
})
|
|
67
|
-
plugins: SIMPLE_TREE_VIEW_PLUGINS,
|
|
68
|
-
rootRef: ref
|
|
66
|
+
})
|
|
69
67
|
});
|
|
70
68
|
const {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} =
|
|
69
|
+
slots,
|
|
70
|
+
slotProps
|
|
71
|
+
} = props;
|
|
74
72
|
const classes = useUtilityClasses(props);
|
|
75
73
|
const Root = slots?.root ?? SimpleTreeViewRoot;
|
|
76
74
|
const rootProps = useSlotProps({
|
|
77
75
|
elementType: Root,
|
|
78
76
|
externalSlotProps: slotProps?.root,
|
|
79
|
-
externalForwardedProps: otherProps,
|
|
80
77
|
className: classes.root,
|
|
81
78
|
getSlotProps: getRootProps,
|
|
82
79
|
ownerState
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { UseTreeViewIdParameters } from '../internals/plugins/useTreeViewId';
|
|
2
|
+
import { UseTreeViewItemsParameters } from '../internals/plugins/useTreeViewItems';
|
|
3
|
+
import { UseTreeViewExpansionParameters } from '../internals/plugins/useTreeViewExpansion';
|
|
4
|
+
import { UseTreeViewSelectionParameters } from '../internals/plugins/useTreeViewSelection';
|
|
5
|
+
import { UseTreeViewFocusParameters } from '../internals/plugins/useTreeViewFocus';
|
|
6
|
+
import { UseTreeViewIconsParameters } from '../internals/plugins/useTreeViewIcons';
|
|
7
|
+
import { ConvertPluginsIntoSignatures, MergeSignaturesProperty } from '../internals/models';
|
|
8
|
+
export declare const SIMPLE_TREE_VIEW_PLUGINS: readonly [import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewId").UseTreeViewIdSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewItems").UseTreeViewItemsSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewExpansion").UseTreeViewExpansionSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewSelection").UseTreeViewSelectionSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewFocus").UseTreeViewFocusSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewKeyboardNavigation").UseTreeViewKeyboardNavigationSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewIcons").UseTreeViewIconsSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewJSXItems").UseTreeViewJSXItemsSignature>];
|
|
9
|
+
export type SimpleTreeViewPluginSignatures = ConvertPluginsIntoSignatures<typeof SIMPLE_TREE_VIEW_PLUGINS>;
|
|
10
|
+
export type SimpleTreeViewPluginSlots = MergeSignaturesProperty<SimpleTreeViewPluginSignatures, 'slots'>;
|
|
11
|
+
export type SimpleTreeViewPluginSlotProps = MergeSignaturesProperty<SimpleTreeViewPluginSignatures, 'slotProps'>;
|
|
12
|
+
export interface SimpleTreeViewPluginParameters<Multiple extends boolean | undefined> extends UseTreeViewIdParameters, Omit<UseTreeViewItemsParameters<any>, 'items' | 'isItemDisabled' | 'getItemLabel' | 'getItemId'>, UseTreeViewExpansionParameters, UseTreeViewFocusParameters, UseTreeViewSelectionParameters<Multiple>, UseTreeViewIconsParameters {
|
|
8
13
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useTreeViewId } from '../internals/plugins/useTreeViewId';
|
|
2
|
+
import { useTreeViewItems } from '../internals/plugins/useTreeViewItems';
|
|
3
|
+
import { useTreeViewExpansion } from '../internals/plugins/useTreeViewExpansion';
|
|
4
|
+
import { useTreeViewSelection } from '../internals/plugins/useTreeViewSelection';
|
|
5
|
+
import { useTreeViewFocus } from '../internals/plugins/useTreeViewFocus';
|
|
6
|
+
import { useTreeViewKeyboardNavigation } from '../internals/plugins/useTreeViewKeyboardNavigation';
|
|
7
|
+
import { useTreeViewIcons } from '../internals/plugins/useTreeViewIcons';
|
|
2
8
|
import { useTreeViewJSXItems } from '../internals/plugins/useTreeViewJSXItems';
|
|
3
|
-
export const SIMPLE_TREE_VIEW_PLUGINS = [
|
|
9
|
+
export const SIMPLE_TREE_VIEW_PLUGINS = [useTreeViewId, useTreeViewItems, useTreeViewExpansion, useTreeViewSelection, useTreeViewFocus, useTreeViewKeyboardNavigation, useTreeViewIcons, useTreeViewJSXItems];
|
|
4
10
|
|
|
5
11
|
// We can't infer this type from the plugin, otherwise we would lose the generics.
|
|
@@ -3,7 +3,7 @@ import { Theme } from '@mui/material/styles';
|
|
|
3
3
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
4
4
|
import { SxProps } from '@mui/system';
|
|
5
5
|
import { SimpleTreeViewClasses } from './simpleTreeViewClasses';
|
|
6
|
-
import { SimpleTreeViewPluginParameters, SimpleTreeViewPluginSlotProps, SimpleTreeViewPluginSlots,
|
|
6
|
+
import { SimpleTreeViewPluginParameters, SimpleTreeViewPluginSlotProps, SimpleTreeViewPluginSlots, SimpleTreeViewPluginSignatures } from './SimpleTreeView.plugins';
|
|
7
7
|
import { TreeViewExperimentalFeatures, TreeViewPublicAPI } from '../internals/models';
|
|
8
8
|
export interface SimpleTreeViewSlots extends SimpleTreeViewPluginSlots {
|
|
9
9
|
/**
|
|
@@ -15,7 +15,7 @@ export interface SimpleTreeViewSlots extends SimpleTreeViewPluginSlots {
|
|
|
15
15
|
export interface SimpleTreeViewSlotProps extends SimpleTreeViewPluginSlotProps {
|
|
16
16
|
root?: SlotComponentProps<'ul', {}, {}>;
|
|
17
17
|
}
|
|
18
|
-
export type SimpleTreeViewApiRef = React.MutableRefObject<TreeViewPublicAPI<
|
|
18
|
+
export type SimpleTreeViewApiRef = React.MutableRefObject<TreeViewPublicAPI<SimpleTreeViewPluginSignatures> | undefined>;
|
|
19
19
|
export interface SimpleTreeViewProps<Multiple extends boolean | undefined> extends SimpleTreeViewPluginParameters<Multiple>, React.HTMLAttributes<HTMLUListElement> {
|
|
20
20
|
/**
|
|
21
21
|
* The content of the component.
|
|
@@ -47,5 +47,5 @@ export interface SimpleTreeViewProps<Multiple extends boolean | undefined> exten
|
|
|
47
47
|
* For each feature, if the flag is not explicitly set to `true`,
|
|
48
48
|
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
49
49
|
*/
|
|
50
|
-
experimentalFeatures?: TreeViewExperimentalFeatures<
|
|
50
|
+
experimentalFeatures?: TreeViewExperimentalFeatures<SimpleTreeViewPluginSignatures>;
|
|
51
51
|
}
|
package/TreeItem/TreeItem.js
CHANGED
|
@@ -11,10 +11,11 @@ import Collapse from '@mui/material/Collapse';
|
|
|
11
11
|
import { resolveComponentProps, useSlotProps } from '@mui/base/utils';
|
|
12
12
|
import useForkRef from '@mui/utils/useForkRef';
|
|
13
13
|
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
14
|
-
import { alpha
|
|
14
|
+
import { alpha } from '@mui/material/styles';
|
|
15
15
|
import unsupportedProp from '@mui/utils/unsupportedProp';
|
|
16
16
|
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
|
17
17
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
18
|
+
import { styled, createUseThemeProps } from '../internals/zero-styled';
|
|
18
19
|
import { TreeItemContent } from './TreeItemContent';
|
|
19
20
|
import { treeItemClasses, getTreeItemUtilityClass } from './treeItemClasses';
|
|
20
21
|
import { useTreeViewContext } from '../internals/TreeViewProvider/useTreeViewContext';
|
|
@@ -22,6 +23,7 @@ import { TreeViewCollapseIcon, TreeViewExpandIcon } from '../icons';
|
|
|
22
23
|
import { TreeItem2Provider } from '../TreeItem2Provider';
|
|
23
24
|
import { TreeViewItemDepthContext } from '../internals/TreeViewItemDepthContext';
|
|
24
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
const useThemeProps = createUseThemeProps('MuiTreeItem');
|
|
25
27
|
const useUtilityClasses = ownerState => {
|
|
26
28
|
const {
|
|
27
29
|
classes
|
|
@@ -390,6 +392,10 @@ process.env.NODE_ENV !== "production" ? TreeItem.propTypes = {
|
|
|
390
392
|
* Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
|
|
391
393
|
*/
|
|
392
394
|
onFocus: unsupportedProp,
|
|
395
|
+
/**
|
|
396
|
+
* Callback fired when a key of the keyboard is pressed on the item.
|
|
397
|
+
*/
|
|
398
|
+
onKeyDown: PropTypes.func,
|
|
393
399
|
/**
|
|
394
400
|
* The props used for each component slot.
|
|
395
401
|
* @default {}
|
|
@@ -7,6 +7,14 @@ import { TreeItemContentProps } from './TreeItemContent';
|
|
|
7
7
|
import { TreeItemClasses } from './treeItemClasses';
|
|
8
8
|
import { TreeViewItemId } from '../models';
|
|
9
9
|
import { SlotComponentPropsFromProps } from '../internals/models';
|
|
10
|
+
import { MuiCancellableEventHandler } from '../internals/models/MuiCancellableEvent';
|
|
11
|
+
import { UseTreeViewIconsSignature } from '../internals/plugins/useTreeViewIcons';
|
|
12
|
+
import { UseTreeViewSelectionSignature } from '../internals/plugins/useTreeViewSelection';
|
|
13
|
+
import { UseTreeViewItemsSignature } from '../internals/plugins/useTreeViewItems';
|
|
14
|
+
import { UseTreeViewFocusSignature } from '../internals/plugins/useTreeViewFocus';
|
|
15
|
+
import { UseTreeViewExpansionSignature } from '../internals/plugins/useTreeViewExpansion';
|
|
16
|
+
import { UseTreeViewKeyboardNavigationSignature } from '../internals/plugins/useTreeViewKeyboardNavigation';
|
|
17
|
+
import { UseTreeViewIdSignature } from '../internals/plugins/useTreeViewId';
|
|
10
18
|
export interface TreeItemSlots {
|
|
11
19
|
/**
|
|
12
20
|
* The icon used to collapse the item.
|
|
@@ -25,7 +33,7 @@ export interface TreeItemSlots {
|
|
|
25
33
|
*/
|
|
26
34
|
icon?: React.ElementType;
|
|
27
35
|
/**
|
|
28
|
-
* The component that animates
|
|
36
|
+
* The component that animates the appearance / disappearance of the item's children.
|
|
29
37
|
* @default TreeItem2Group
|
|
30
38
|
*/
|
|
31
39
|
groupTransition?: React.ElementType;
|
|
@@ -90,6 +98,10 @@ export interface TreeItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>,
|
|
|
90
98
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
91
99
|
*/
|
|
92
100
|
sx?: SxProps<Theme>;
|
|
101
|
+
/**
|
|
102
|
+
* Callback fired when a key of the keyboard is pressed on the item.
|
|
103
|
+
*/
|
|
104
|
+
onKeyDown?: MuiCancellableEventHandler<React.KeyboardEvent<HTMLLIElement>>;
|
|
93
105
|
}
|
|
94
106
|
export interface TreeItemOwnerState extends TreeItemProps {
|
|
95
107
|
expanded: boolean;
|
|
@@ -98,3 +110,12 @@ export interface TreeItemOwnerState extends TreeItemProps {
|
|
|
98
110
|
disabled: boolean;
|
|
99
111
|
indentationAtItemLevel: boolean;
|
|
100
112
|
}
|
|
113
|
+
export type TreeItemMinimalPlugins = readonly [
|
|
114
|
+
UseTreeViewIconsSignature,
|
|
115
|
+
UseTreeViewSelectionSignature,
|
|
116
|
+
UseTreeViewItemsSignature,
|
|
117
|
+
UseTreeViewFocusSignature,
|
|
118
|
+
UseTreeViewExpansionSignature,
|
|
119
|
+
UseTreeViewKeyboardNavigationSignature,
|
|
120
|
+
UseTreeViewIdSignature
|
|
121
|
+
];
|
package/TreeItem2/TreeItem2.js
CHANGED
|
@@ -6,17 +6,19 @@ import * as React from 'react';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import unsupportedProp from '@mui/utils/unsupportedProp';
|
|
9
|
-
import { alpha
|
|
9
|
+
import { alpha } 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
13
|
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
14
14
|
import composeClasses from '@mui/utils/composeClasses';
|
|
15
|
+
import { styled, createUseThemeProps } from '../internals/zero-styled';
|
|
15
16
|
import { unstable_useTreeItem2 as useTreeItem2 } from '../useTreeItem2';
|
|
16
17
|
import { getTreeItemUtilityClass } from '../TreeItem';
|
|
17
18
|
import { TreeItem2Icon } from '../TreeItem2Icon';
|
|
18
19
|
import { TreeItem2Provider } from '../TreeItem2Provider';
|
|
19
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
const useThemeProps = createUseThemeProps('MuiTreeItem2');
|
|
20
22
|
export const TreeItem2Root = styled('li', {
|
|
21
23
|
name: 'MuiTreeItem2',
|
|
22
24
|
slot: 'Root',
|
|
@@ -321,11 +323,19 @@ process.env.NODE_ENV !== "production" ? TreeItem2.propTypes = {
|
|
|
321
323
|
* The label of the item.
|
|
322
324
|
*/
|
|
323
325
|
label: PropTypes.node,
|
|
326
|
+
/**
|
|
327
|
+
* Callback fired when the item root is blurred.
|
|
328
|
+
*/
|
|
329
|
+
onBlur: PropTypes.func,
|
|
324
330
|
/**
|
|
325
331
|
* This prop isn't supported.
|
|
326
|
-
* Use the `onItemFocus` callback on the tree if you need to monitor
|
|
332
|
+
* Use the `onItemFocus` callback on the tree if you need to monitor an item's focus.
|
|
327
333
|
*/
|
|
328
334
|
onFocus: unsupportedProp,
|
|
335
|
+
/**
|
|
336
|
+
* Callback fired when a key is pressed on the keyboard and the tree is in focus.
|
|
337
|
+
*/
|
|
338
|
+
onKeyDown: PropTypes.func,
|
|
329
339
|
/**
|
|
330
340
|
* The props used for each component slot.
|
|
331
341
|
* @default {}
|
|
@@ -3,6 +3,7 @@ import { SlotComponentProps } from '@mui/base/utils';
|
|
|
3
3
|
import { UseTreeItem2Parameters, UseTreeItem2Status } from '../useTreeItem2';
|
|
4
4
|
import { TreeItemClasses } from '../TreeItem';
|
|
5
5
|
import { TreeItem2IconSlotProps, TreeItem2IconSlots } from '../TreeItem2Icon';
|
|
6
|
+
import { MuiCancellableEventHandler } from '../internals/models/MuiCancellableEvent';
|
|
6
7
|
export interface TreeItem2Slots extends TreeItem2IconSlots {
|
|
7
8
|
/**
|
|
8
9
|
* The component that renders the root.
|
|
@@ -62,9 +63,17 @@ export interface TreeItem2Props extends Omit<UseTreeItem2Parameters, 'rootRef'>,
|
|
|
62
63
|
slotProps?: TreeItem2SlotProps;
|
|
63
64
|
/**
|
|
64
65
|
* This prop isn't supported.
|
|
65
|
-
* Use the `onItemFocus` callback on the tree if you need to monitor
|
|
66
|
+
* Use the `onItemFocus` callback on the tree if you need to monitor an item's focus.
|
|
66
67
|
*/
|
|
67
68
|
onFocus?: null;
|
|
69
|
+
/**
|
|
70
|
+
* Callback fired when the item root is blurred.
|
|
71
|
+
*/
|
|
72
|
+
onBlur?: MuiCancellableEventHandler<React.FocusEvent<HTMLLIElement>>;
|
|
73
|
+
/**
|
|
74
|
+
* Callback fired when a key is pressed on the keyboard and the tree is in focus.
|
|
75
|
+
*/
|
|
76
|
+
onKeyDown?: MuiCancellableEventHandler<React.KeyboardEvent<HTMLLIElement>>;
|
|
68
77
|
}
|
|
69
78
|
export interface TreeItem2OwnerState extends Omit<TreeItem2Props, 'disabled'>, UseTreeItem2Status {
|
|
70
79
|
}
|
package/TreeView/TreeView.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { styled, useThemeProps } from '@mui/material/styles';
|
|
5
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
5
|
+
import { styled, createUseThemeProps } from '../internals/zero-styled';
|
|
6
6
|
import { getTreeViewUtilityClass } from './treeViewClasses';
|
|
7
7
|
import { SimpleTreeView, SimpleTreeViewRoot } from '../SimpleTreeView';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const useThemeProps = createUseThemeProps('MuiTreeView');
|
|
9
10
|
const useUtilityClasses = ownerState => {
|
|
10
11
|
const {
|
|
11
12
|
classes
|
|
@@ -3,4 +3,4 @@ import { TreeViewAnyPluginSignature, TreeViewPublicAPI } from '../internals/mode
|
|
|
3
3
|
/**
|
|
4
4
|
* Hook that instantiates a [[TreeViewApiRef]].
|
|
5
5
|
*/
|
|
6
|
-
export declare const useTreeViewApiRef: <
|
|
6
|
+
export declare const useTreeViewApiRef: <TSignatures extends readonly TreeViewAnyPluginSignature[] = readonly [import("../internals").UseTreeViewIdSignature, import("../internals").UseTreeViewItemsSignature, import("../internals").UseTreeViewExpansionSignature, import("../internals").UseTreeViewSelectionSignature, import("../internals").UseTreeViewFocusSignature, import("../internals").UseTreeViewKeyboardNavigationSignature, import("../internals").UseTreeViewIconsSignature]>() => React.MutableRefObject<TreeViewPublicAPI<TSignatures> | undefined>;
|
package/index.js
CHANGED