@mui/x-tree-view 8.16.0 → 8.18.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 +208 -1
- package/RichTreeView/RichTreeView.js +11 -11
- package/SimpleTreeView/SimpleTreeView.js +10 -10
- package/TreeItem/TreeItem.d.ts +1 -1
- package/TreeItemDragAndDropOverlay/TreeItemDragAndDropOverlay.d.ts +1 -2
- package/TreeItemDragAndDropOverlay/TreeItemDragAndDropOverlay.js +0 -2
- package/TreeItemIcon/TreeItemIcon.d.ts +1 -2
- package/TreeItemProvider/TreeItemProvider.d.ts +1 -2
- package/esm/RichTreeView/RichTreeView.js +11 -11
- package/esm/SimpleTreeView/SimpleTreeView.js +10 -10
- package/esm/TreeItem/TreeItem.d.ts +1 -1
- package/esm/TreeItemDragAndDropOverlay/TreeItemDragAndDropOverlay.d.ts +1 -2
- package/esm/TreeItemDragAndDropOverlay/TreeItemDragAndDropOverlay.js +0 -1
- package/esm/TreeItemIcon/TreeItemIcon.d.ts +1 -2
- package/esm/TreeItemProvider/TreeItemProvider.d.ts +1 -2
- package/esm/icons/icons.js +0 -1
- package/esm/index.js +1 -1
- package/esm/internals/TreeViewProvider/TreeViewChildrenItemProvider.d.ts +1 -1
- package/esm/internals/TreeViewProvider/TreeViewProvider.d.ts +1 -2
- package/esm/internals/components/RichTreeViewItems.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.types.d.ts +11 -11
- package/esm/internals/plugins/useTreeViewFocus/useTreeViewFocus.types.d.ts +5 -4
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +7 -7
- package/esm/internals/plugins/useTreeViewJSXItems/itemPlugin.d.ts +2 -0
- package/esm/internals/plugins/useTreeViewJSXItems/itemPlugin.js +74 -0
- package/esm/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +2 -71
- package/esm/internals/plugins/useTreeViewLabel/itemPlugin.d.ts +11 -0
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +1 -1
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.types.d.ts +2 -11
- package/esm/internals/plugins/useTreeViewSelection/itemPlugin.d.ts +20 -0
- package/esm/internals/plugins/useTreeViewSelection/{useTreeViewSelection.itemPlugin.js → itemPlugin.js} +23 -3
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +1 -1
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +20 -31
- package/esm/models/items.d.ts +1 -0
- package/esm/useTreeItem/useTreeItem.js +0 -15
- package/esm/useTreeItem/useTreeItem.types.d.ts +0 -1
- package/icons/icons.js +0 -2
- package/index.js +1 -1
- package/internals/TreeViewProvider/TreeViewChildrenItemProvider.d.ts +1 -1
- package/internals/TreeViewProvider/TreeViewProvider.d.ts +1 -2
- package/internals/components/RichTreeViewItems.d.ts +1 -1
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.d.ts +1 -1
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.types.d.ts +11 -11
- package/internals/plugins/useTreeViewFocus/useTreeViewFocus.types.d.ts +5 -4
- package/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +7 -7
- package/internals/plugins/useTreeViewJSXItems/itemPlugin.d.ts +2 -0
- package/internals/plugins/useTreeViewJSXItems/itemPlugin.js +81 -0
- package/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +2 -71
- package/internals/plugins/useTreeViewLabel/itemPlugin.d.ts +11 -0
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +4 -4
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.types.d.ts +2 -11
- package/internals/plugins/useTreeViewSelection/itemPlugin.d.ts +20 -0
- package/internals/plugins/useTreeViewSelection/{useTreeViewSelection.itemPlugin.js → itemPlugin.js} +23 -3
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +2 -2
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +20 -31
- package/models/items.d.ts +1 -0
- package/package.json +3 -3
- package/useTreeItem/useTreeItem.js +0 -15
- package/useTreeItem/useTreeItem.types.d.ts +0 -1
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.itemPlugin.d.ts +0 -2
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.d.ts +0 -2
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.itemPlugin.d.ts +0 -2
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.d.ts +0 -2
- /package/esm/internals/plugins/useTreeViewLabel/{useTreeViewLabel.itemPlugin.js → itemPlugin.js} +0 -0
- /package/internals/plugins/useTreeViewLabel/{useTreeViewLabel.itemPlugin.js → itemPlugin.js} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TreeViewCancellableEventHandler } from "../../../models/index.js";
|
|
3
|
+
import { TreeViewItemPlugin } from "../../models/index.js";
|
|
4
|
+
export declare const useTreeViewSelectionItemPlugin: TreeViewItemPlugin;
|
|
5
|
+
interface UseTreeItemRootSlotPropsFromSelection {
|
|
6
|
+
'aria-checked': React.AriaAttributes['aria-checked'];
|
|
7
|
+
}
|
|
8
|
+
interface UseTreeItemCheckboxSlotPropsFromSelection {
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
indeterminate?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
tabIndex?: -1;
|
|
14
|
+
onChange?: TreeViewCancellableEventHandler<React.ChangeEvent<HTMLInputElement>>;
|
|
15
|
+
}
|
|
16
|
+
declare module '@mui/x-tree-view/useTreeItem' {
|
|
17
|
+
interface UseTreeItemRootSlotOwnProps extends UseTreeItemRootSlotPropsFromSelection {}
|
|
18
|
+
interface UseTreeItemCheckboxSlotOwnProps extends UseTreeItemCheckboxSlotPropsFromSelection {}
|
|
19
|
+
}
|
|
20
|
+
export {};
|
package/internals/plugins/useTreeViewSelection/{useTreeViewSelection.itemPlugin.js → itemPlugin.js}
RENAMED
|
@@ -51,9 +51,29 @@ const useTreeViewSelectionItemPlugin = ({
|
|
|
51
51
|
} = (0, _TreeViewProvider.useTreeViewContext)();
|
|
52
52
|
const isCheckboxSelectionEnabled = (0, _store.useStore)(store, _useTreeViewSelection.selectionSelectors.isCheckboxSelectionEnabled);
|
|
53
53
|
const isItemSelectionEnabled = (0, _store.useStore)(store, _useTreeViewSelection.selectionSelectors.canItemBeSelected, itemId);
|
|
54
|
-
const
|
|
54
|
+
const selectionStatus = (0, _store.useStore)(store, selectorCheckboxSelectionStatus, itemId);
|
|
55
|
+
const isSelectionEnabledForItem = (0, _store.useStore)(store, _useTreeViewSelection.selectionSelectors.canItemBeSelected, itemId);
|
|
55
56
|
return {
|
|
56
57
|
propsEnhancers: {
|
|
58
|
+
root: () => {
|
|
59
|
+
// https://www.w3.org/WAI/ARIA/apg/patterns/treeview/
|
|
60
|
+
let ariaChecked;
|
|
61
|
+
if (selectionStatus === 'checked') {
|
|
62
|
+
// - each selected node has aria-checked set to true.
|
|
63
|
+
ariaChecked = true;
|
|
64
|
+
} else if (selectionStatus === 'indeterminate') {
|
|
65
|
+
ariaChecked = 'mixed';
|
|
66
|
+
} else if (!isSelectionEnabledForItem) {
|
|
67
|
+
// - if the tree contains nodes that are not selectable, aria-checked is not present on those nodes.
|
|
68
|
+
ariaChecked = undefined;
|
|
69
|
+
} else {
|
|
70
|
+
// - all nodes that are selectable but not selected have aria-checked set to false.
|
|
71
|
+
ariaChecked = false;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
'aria-checked': ariaChecked
|
|
75
|
+
};
|
|
76
|
+
},
|
|
57
77
|
checkbox: ({
|
|
58
78
|
externalEventHandlers,
|
|
59
79
|
interactions
|
|
@@ -73,8 +93,8 @@ const useTreeViewSelectionItemPlugin = ({
|
|
|
73
93
|
onChange: handleChange,
|
|
74
94
|
visible: isCheckboxSelectionEnabled,
|
|
75
95
|
disabled: !isItemSelectionEnabled,
|
|
76
|
-
checked:
|
|
77
|
-
indeterminate:
|
|
96
|
+
checked: selectionStatus === 'checked',
|
|
97
|
+
indeterminate: selectionStatus === 'indeterminate'
|
|
78
98
|
};
|
|
79
99
|
}
|
|
80
100
|
}
|
|
@@ -13,7 +13,7 @@ var _useIsoLayoutEffect = require("@base-ui-components/utils/useIsoLayoutEffect"
|
|
|
13
13
|
var _tree = require("../../utils/tree");
|
|
14
14
|
var _useTreeViewSelection = require("./useTreeViewSelection.utils");
|
|
15
15
|
var _useTreeViewSelection2 = require("./useTreeViewSelection.selectors");
|
|
16
|
-
var
|
|
16
|
+
var _itemPlugin = require("./itemPlugin");
|
|
17
17
|
const useTreeViewSelection = ({
|
|
18
18
|
store,
|
|
19
19
|
params
|
|
@@ -206,7 +206,7 @@ const useTreeViewSelection = ({
|
|
|
206
206
|
};
|
|
207
207
|
};
|
|
208
208
|
exports.useTreeViewSelection = useTreeViewSelection;
|
|
209
|
-
useTreeViewSelection.itemPlugin =
|
|
209
|
+
useTreeViewSelection.itemPlugin = _itemPlugin.useTreeViewSelectionItemPlugin;
|
|
210
210
|
const DEFAULT_SELECTED_ITEMS = [];
|
|
211
211
|
const EMPTY_SELECTION_PROPAGATION = {};
|
|
212
212
|
useTreeViewSelection.applyDefaultValuesToParams = ({
|
|
@@ -3,18 +3,18 @@ import type { DefaultizedProps } from '@mui/x-internals/types';
|
|
|
3
3
|
import type { TreeViewPluginSignature } from "../../models/index.js";
|
|
4
4
|
import { UseTreeViewItemsSignature } from "../useTreeViewItems/index.js";
|
|
5
5
|
import { UseTreeViewExpansionSignature } from "../useTreeViewExpansion/index.js";
|
|
6
|
-
import { TreeViewSelectionPropagation,
|
|
6
|
+
import { TreeViewSelectionPropagation, TreeViewItemId } from "../../../models/index.js";
|
|
7
7
|
export interface UseTreeViewSelectionPublicAPI {
|
|
8
8
|
/**
|
|
9
9
|
* Select or deselect an item.
|
|
10
10
|
* @param {object} parameters The parameters of the method.
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {TreeViewItemId} parameters.itemId The id of the item to select or deselect.
|
|
12
12
|
* @param {React.SyntheticEvent} parameters.event The DOM event that triggered the change.
|
|
13
13
|
* @param {boolean} parameters.keepExistingSelection If `true`, the other already selected items will remain selected, otherwise, they will be deselected. This parameter is only relevant when `multiSelect` is `true`
|
|
14
14
|
* @param {boolean | undefined} parameters.shouldBeSelected If `true` the item will be selected. If `false` the item will be deselected. If not defined, the item's selection status will be toggled.
|
|
15
15
|
*/
|
|
16
16
|
setItemSelection: (parameters: {
|
|
17
|
-
itemId:
|
|
17
|
+
itemId: TreeViewItemId;
|
|
18
18
|
event?: React.SyntheticEvent;
|
|
19
19
|
shouldBeSelected?: boolean;
|
|
20
20
|
keepExistingSelection?: boolean;
|
|
@@ -29,33 +29,33 @@ export interface UseTreeViewSelectionInstance extends UseTreeViewSelectionPublic
|
|
|
29
29
|
/**
|
|
30
30
|
* Expand the current selection range up to the given item.
|
|
31
31
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {TreeViewItemId} itemId The id of the item to expand the selection to.
|
|
33
33
|
*/
|
|
34
|
-
expandSelectionRange: (event: React.SyntheticEvent, itemId:
|
|
34
|
+
expandSelectionRange: (event: React.SyntheticEvent, itemId: TreeViewItemId) => void;
|
|
35
35
|
/**
|
|
36
36
|
* Expand the current selection range from the first navigable item to the given item.
|
|
37
37
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {TreeViewItemId} itemId The id of the item up to which the selection range should be expanded.
|
|
39
39
|
*/
|
|
40
|
-
selectRangeFromStartToItem: (event: React.SyntheticEvent, itemId:
|
|
40
|
+
selectRangeFromStartToItem: (event: React.SyntheticEvent, itemId: TreeViewItemId) => void;
|
|
41
41
|
/**
|
|
42
42
|
* Expand the current selection range from the given item to the last navigable item.
|
|
43
43
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
44
|
-
* @param {
|
|
44
|
+
* @param {TreeViewItemId} itemId The id of the item from which the selection range should be expanded.
|
|
45
45
|
*/
|
|
46
|
-
selectRangeFromItemToEnd: (event: React.SyntheticEvent, itemId:
|
|
46
|
+
selectRangeFromItemToEnd: (event: React.SyntheticEvent, itemId: TreeViewItemId) => void;
|
|
47
47
|
/**
|
|
48
48
|
* Update the selection when navigating with ArrowUp / ArrowDown keys.
|
|
49
49
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
50
|
-
* @param {
|
|
51
|
-
* @param {
|
|
50
|
+
* @param {TreeViewItemId} currentItemId The id of the active item before the keyboard navigation.
|
|
51
|
+
* @param {TreeViewItemId} nextItemId The id of the active item after the keyboard navigation.
|
|
52
52
|
*/
|
|
53
|
-
selectItemFromArrowNavigation: (event: React.SyntheticEvent, currentItemId:
|
|
53
|
+
selectItemFromArrowNavigation: (event: React.SyntheticEvent, currentItemId: TreeViewItemId, nextItemId: TreeViewItemId) => void;
|
|
54
54
|
}
|
|
55
|
-
export type TreeViewSelectionValue<Multiple extends boolean | undefined> = Multiple extends true ?
|
|
55
|
+
export type TreeViewSelectionValue<Multiple extends boolean | undefined> = Multiple extends true ? TreeViewItemId[] : TreeViewItemId | null;
|
|
56
56
|
export interface UseTreeViewSelectionParameters<Multiple extends boolean | undefined> {
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Whether selection is disabled.
|
|
59
59
|
* @default false
|
|
60
60
|
*/
|
|
61
61
|
disableSelection?: boolean;
|
|
@@ -71,12 +71,12 @@ export interface UseTreeViewSelectionParameters<Multiple extends boolean | undef
|
|
|
71
71
|
*/
|
|
72
72
|
selectedItems?: TreeViewSelectionValue<Multiple>;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Whether multiple items can be selected.
|
|
75
75
|
* @default false
|
|
76
76
|
*/
|
|
77
77
|
multiSelect?: Multiple;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* Whether the Tree View renders a checkbox at the left of its label that allows selecting it.
|
|
80
80
|
* @default false
|
|
81
81
|
*/
|
|
82
82
|
checkboxSelection?: boolean;
|
|
@@ -100,17 +100,17 @@ export interface UseTreeViewSelectionParameters<Multiple extends boolean | undef
|
|
|
100
100
|
/**
|
|
101
101
|
* Callback fired when Tree Items are selected/deselected.
|
|
102
102
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
103
|
-
* @param {
|
|
103
|
+
* @param {TreeViewItemId[] | TreeViewItemId} itemIds The ids of the selected items.
|
|
104
104
|
* When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
|
|
105
105
|
*/
|
|
106
106
|
onSelectedItemsChange?: (event: React.SyntheticEvent | null, itemIds: TreeViewSelectionValue<Multiple>) => void;
|
|
107
107
|
/**
|
|
108
108
|
* Callback fired when a Tree Item is selected or deselected.
|
|
109
109
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
110
|
-
* @param {
|
|
110
|
+
* @param {TreeViewItemId} itemId The itemId of the modified item.
|
|
111
111
|
* @param {boolean} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
|
|
112
112
|
*/
|
|
113
|
-
onItemSelectionToggle?: (event: React.SyntheticEvent | null, itemId:
|
|
113
|
+
onItemSelectionToggle?: (event: React.SyntheticEvent | null, itemId: TreeViewItemId, isSelected: boolean) => void;
|
|
114
114
|
}
|
|
115
115
|
export type UseTreeViewSelectionParametersWithDefaults<Multiple extends boolean> = DefaultizedProps<UseTreeViewSelectionParameters<Multiple>, 'disableSelection' | 'defaultSelectedItems' | 'multiSelect' | 'checkboxSelection' | 'selectionPropagation'>;
|
|
116
116
|
export interface UseTreeViewSelectionState {
|
|
@@ -129,15 +129,4 @@ export type UseTreeViewSelectionSignature = TreeViewPluginSignature<{
|
|
|
129
129
|
publicAPI: UseTreeViewSelectionPublicAPI;
|
|
130
130
|
state: UseTreeViewSelectionState;
|
|
131
131
|
dependencies: [UseTreeViewItemsSignature, UseTreeViewExpansionSignature, UseTreeViewItemsSignature];
|
|
132
|
-
}>;
|
|
133
|
-
export interface UseTreeItemCheckboxSlotPropsFromSelection {
|
|
134
|
-
visible?: boolean;
|
|
135
|
-
checked?: boolean;
|
|
136
|
-
indeterminate?: boolean;
|
|
137
|
-
disabled?: boolean;
|
|
138
|
-
tabIndex?: -1;
|
|
139
|
-
onChange?: TreeViewCancellableEventHandler<React.ChangeEvent<HTMLInputElement>>;
|
|
140
|
-
}
|
|
141
|
-
declare module '@mui/x-tree-view/useTreeItem' {
|
|
142
|
-
interface UseTreeItemCheckboxSlotOwnProps extends UseTreeItemCheckboxSlotPropsFromSelection {}
|
|
143
|
-
}
|
|
132
|
+
}>;
|
package/models/items.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export type TreeViewItemId = string;
|
|
|
2
2
|
export type TreeViewDefaultItemModelProperties = {
|
|
3
3
|
id: string;
|
|
4
4
|
label: string;
|
|
5
|
+
children?: TreeViewDefaultItemModelProperties[];
|
|
5
6
|
};
|
|
6
7
|
export type TreeViewBaseItem<R extends {} = TreeViewDefaultItemModelProperties> = R & {
|
|
7
8
|
children?: TreeViewBaseItem<R>[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-tree-view",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.18.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of the MUI X Tree View components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.28.4",
|
|
35
35
|
"@base-ui-components/utils": "0.1.2",
|
|
36
|
-
"@mui/utils": "^7.3.
|
|
36
|
+
"@mui/utils": "^7.3.5",
|
|
37
37
|
"@types/react-transition-group": "^4.4.12",
|
|
38
38
|
"clsx": "^2.1.1",
|
|
39
39
|
"prop-types": "^15.8.1",
|
|
40
40
|
"react-transition-group": "^4.4.5",
|
|
41
|
-
"@mui/x-internals": "8.
|
|
41
|
+
"@mui/x-internals": "8.18.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.9.0",
|
|
@@ -61,7 +61,6 @@ const useTreeItem = parameters => {
|
|
|
61
61
|
const handleContentRef = (0, _useMergedRefs.useMergedRefs)(contentRef, contentRefObject);
|
|
62
62
|
const checkboxRef = React.useRef(null);
|
|
63
63
|
const treeId = (0, _store.useStore)(store, _useTreeViewId2.idSelectors.treeId);
|
|
64
|
-
const isSelectionEnabledForItem = (0, _store.useStore)(store, _useTreeViewSelection.selectionSelectors.canItemBeSelected, itemId);
|
|
65
64
|
const isCheckboxSelectionEnabled = (0, _store.useStore)(store, _useTreeViewSelection.selectionSelectors.isCheckboxSelectionEnabled);
|
|
66
65
|
const idAttribute = (0, _useTreeViewId.generateTreeItemIdAttribute)({
|
|
67
66
|
itemId,
|
|
@@ -154,26 +153,12 @@ const useTreeItem = parameters => {
|
|
|
154
153
|
});
|
|
155
154
|
const getRootProps = (externalProps = {}) => {
|
|
156
155
|
const externalEventHandlers = (0, _extends2.default)({}, (0, _extractEventHandlers.default)(parameters), (0, _extractEventHandlers.default)(externalProps));
|
|
157
|
-
|
|
158
|
-
// https://www.w3.org/WAI/ARIA/apg/patterns/treeview/
|
|
159
|
-
let ariaSelected;
|
|
160
|
-
if (status.selected) {
|
|
161
|
-
// - each selected node has aria-selected set to true.
|
|
162
|
-
ariaSelected = true;
|
|
163
|
-
} else if (!isSelectionEnabledForItem) {
|
|
164
|
-
// - if the tree contains nodes that are not selectable, aria-selected is not present on those nodes.
|
|
165
|
-
ariaSelected = undefined;
|
|
166
|
-
} else {
|
|
167
|
-
// - all nodes that are selectable but not selected have aria-selected set to false.
|
|
168
|
-
ariaSelected = false;
|
|
169
|
-
}
|
|
170
156
|
const props = (0, _extends2.default)({}, externalEventHandlers, {
|
|
171
157
|
ref: handleRootRef,
|
|
172
158
|
role: 'treeitem',
|
|
173
159
|
tabIndex: shouldBeAccessibleWithTab ? 0 : -1,
|
|
174
160
|
id: idAttribute,
|
|
175
161
|
'aria-expanded': status.expandable ? status.expanded : undefined,
|
|
176
|
-
'aria-selected': ariaSelected,
|
|
177
162
|
'aria-disabled': status.disabled || undefined
|
|
178
163
|
}, externalProps, {
|
|
179
164
|
style: (0, _extends2.default)({}, externalProps.style ?? {}, {
|
|
@@ -42,7 +42,6 @@ export interface UseTreeItemRootSlotPropsFromUseTreeItem {
|
|
|
42
42
|
tabIndex: 0 | -1;
|
|
43
43
|
id: string;
|
|
44
44
|
'aria-expanded': React.AriaAttributes['aria-expanded'];
|
|
45
|
-
'aria-selected': React.AriaAttributes['aria-selected'];
|
|
46
45
|
'aria-disabled': React.AriaAttributes['aria-disabled'];
|
|
47
46
|
onFocus: TreeViewCancellableEventHandler<React.FocusEvent<HTMLElement>>;
|
|
48
47
|
onBlur: TreeViewCancellableEventHandler<React.FocusEvent<HTMLElement>>;
|
/package/esm/internals/plugins/useTreeViewLabel/{useTreeViewLabel.itemPlugin.js → itemPlugin.js}
RENAMED
|
File without changes
|
/package/internals/plugins/useTreeViewLabel/{useTreeViewLabel.itemPlugin.js → itemPlugin.js}
RENAMED
|
File without changes
|