@progress/kendo-react-treeview 15.2.0-develop.1 → 15.2.0-develop.3
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/TreeView.d.ts +16 -103
- package/TreeView.js +1 -1
- package/TreeView.mjs +286 -227
- package/TreeViewDragClue.d.ts +21 -34
- package/TreeViewDragClue.js +1 -1
- package/TreeViewDragClue.mjs +52 -48
- package/TreeViewItem.d.ts +1 -38
- package/TreeViewItem.js +1 -1
- package/TreeViewItem.mjs +174 -193
- package/dist/cdn/js/kendo-react-treeview.js +1 -1
- package/events.d.ts +9 -9
- package/index.d.mts +3 -5
- package/index.d.ts +3 -5
- package/index.js +1 -1
- package/index.mjs +17 -20
- package/moveTreeViewItem.mjs +7 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +4 -4
- package/TreeViewMcpWrapper.d.ts +0 -17
- package/TreeViewMcpWrapper.js +0 -8
- package/TreeViewMcpWrapper.mjs +0 -20
package/TreeViewDragClue.mjs
CHANGED
|
@@ -5,53 +5,57 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { IconWrap as
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
8
|
+
import * as e from "react";
|
|
9
|
+
import { IconWrap as C, toIconName as k, classNames as I } from "@progress/kendo-react-common";
|
|
10
|
+
import { cancelIcon as N, insertMiddleIcon as b, insertBottomIcon as g, insertTopIcon as v, plusIcon as w } from "@progress/kendo-svg-icons";
|
|
11
|
+
const x = {
|
|
12
|
+
style: { display: "block", position: "absolute", zIndex: 2e4, padding: "4px 6px" }
|
|
13
|
+
}, y = e.forwardRef((r, n) => {
|
|
14
|
+
const { style: l = x.style } = r, [t, a] = e.useState({
|
|
15
|
+
visible: !1,
|
|
16
|
+
top: 0,
|
|
17
|
+
left: 0,
|
|
18
|
+
text: "",
|
|
19
|
+
operationClassName: "cancel"
|
|
20
|
+
}), i = e.useCallback((s, d, m, f) => {
|
|
21
|
+
a({ visible: !0, top: s, left: d, text: m, operationClassName: f });
|
|
22
|
+
}, []), c = e.useCallback(() => {
|
|
23
|
+
a((s) => ({ ...s, visible: !1 }));
|
|
24
|
+
}, []), o = e.useRef({
|
|
25
|
+
show: () => {
|
|
26
|
+
},
|
|
27
|
+
hide: () => {
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
o.current = { show: i, hide: c }, e.useImperativeHandle(n, () => o.current);
|
|
31
|
+
const u = e.useMemo(() => {
|
|
32
|
+
switch (t.operationClassName) {
|
|
33
|
+
case "k-i-plus":
|
|
34
|
+
return w;
|
|
35
|
+
case "k-i-insert-up":
|
|
36
|
+
return v;
|
|
37
|
+
case "k-i-insert-down":
|
|
38
|
+
return g;
|
|
39
|
+
case "k-i-insert-middle":
|
|
40
|
+
return b;
|
|
41
|
+
default:
|
|
42
|
+
return N;
|
|
43
|
+
}
|
|
44
|
+
}, [t.operationClassName]);
|
|
45
|
+
if (!t.visible)
|
|
46
|
+
return null;
|
|
47
|
+
const p = { top: t.top + "px", left: t.left + "px" };
|
|
48
|
+
return /* @__PURE__ */ e.createElement("div", { className: "k-header k-drag-clue", style: { ...l, ...p } }, /* @__PURE__ */ e.createElement(
|
|
49
|
+
C,
|
|
50
|
+
{
|
|
51
|
+
className: I("k-drag-status"),
|
|
52
|
+
name: t.operationClassName && k(t.operationClassName),
|
|
53
|
+
icon: u
|
|
54
|
+
}
|
|
55
|
+
), t.text);
|
|
56
|
+
});
|
|
57
|
+
y.displayName = "KendoReactTreeViewDragClue";
|
|
55
58
|
export {
|
|
56
|
-
|
|
59
|
+
y as TreeViewDragClue,
|
|
60
|
+
x as treeViewDragClueDefaultProps
|
|
57
61
|
};
|
package/TreeViewItem.d.ts
CHANGED
|
@@ -72,41 +72,4 @@ export interface TreeViewItemProps {
|
|
|
72
72
|
/**
|
|
73
73
|
* @hidden
|
|
74
74
|
*/
|
|
75
|
-
declare
|
|
76
|
-
private itemElement;
|
|
77
|
-
private checkboxElement;
|
|
78
|
-
static defaultProps: {
|
|
79
|
-
position: string;
|
|
80
|
-
iconField: string;
|
|
81
|
-
};
|
|
82
|
-
render(): React.JSX.Element;
|
|
83
|
-
componentDidMount(): void;
|
|
84
|
-
componentDidUpdate(prevProps: TreeViewItemProps): void;
|
|
85
|
-
private renderCheckbox;
|
|
86
|
-
private renderExpandIcon;
|
|
87
|
-
private renderSubitemsIfApplicable;
|
|
88
|
-
private renderSubitemsWithAnimation;
|
|
89
|
-
private renderItemInPart;
|
|
90
|
-
private onItemContentClick;
|
|
91
|
-
private onCheckChange;
|
|
92
|
-
private onExpandChange;
|
|
93
|
-
private onPress;
|
|
94
|
-
private onDrag;
|
|
95
|
-
private onRelease;
|
|
96
|
-
private onContextMenu;
|
|
97
|
-
private get fieldsSvc();
|
|
98
|
-
private get itemId();
|
|
99
|
-
private get item();
|
|
100
|
-
private get tabIndex();
|
|
101
|
-
private get ariaExpanded();
|
|
102
|
-
private get disabled();
|
|
103
|
-
private get ariaChecked();
|
|
104
|
-
private get ariaSelected();
|
|
105
|
-
private getIconProps;
|
|
106
|
-
private assignDraggableMeta;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* @hidden
|
|
110
|
-
*/
|
|
111
|
-
export declare const TreeViewItem: React.ForwardRefExoticComponent<Omit<TreeViewItemProps & React.RefAttributes<TreeViewItemWithoutContext>, "ref"> & React.RefAttributes<any>>;
|
|
112
|
-
export {};
|
|
75
|
+
export declare const TreeViewItem: React.ForwardRefExoticComponent<TreeViewItemProps & React.RefAttributes<unknown>>;
|
package/TreeViewItem.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("react"),o=require("@progress/kendo-react-common"),C=require("@progress/kendo-svg-icons"),Z=require("@progress/kendo-react-animation"),y=require("./utils/consts.js"),p=require("./utils/utils.js");function ee(e){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(d,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return d.default=e,Object.freeze(d)}const a=ee(Y),{sizeMap:te}=o.kendoThemeMaps,_=a.createContext(e=>e),ne={iconField:"svgIcon"},ae=e=>{var S;const d=a.useRef(null),r=a.useRef(null),{focusedItemId:l,tabbableItemId:h,checkboxes:I,treeGuid:f,onItemClick:x,onCheckChange:u,onExpandChange:E,onPress:v,onDrag:P,onRelease:D,onContextMenu:N,onFocusDomElNeeded:R}=e,i=e.fieldsService,n=e.item,c=e.itemId,w=(S=e.iconField)!=null?S:ne.iconField,s=e.disabled||i.disabled(n),T=(l||h)===c?0:-1,O=i.hasChildren(n)||o.hasChildren(n,i.getChildrenField())?!!i.expanded(n):void 0,V=(()=>{if(i.selected(n))return!0;if(e.ariaMultiSelectable)return s?void 0:!1})(),U=(()=>{if(e.checkboxes)return i.checked(n)?"true":i.checkIndeterminate(n)?"mixed":"false"})(),q=()=>{const t=i.expanded(n);return t&&!o.hasChildren(n,i.getChildrenField())?{name:"loading"}:t?{name:"chevron-down",icon:C.chevronDownIcon}:{name:e.isRtl?"chevron-left":"chevron-right",icon:e.isRtl?C.chevronLeftIcon:C.chevronRightIcon}},z=a.useCallback(t=>{t&&(t[y.DOM_KENDO_ITEM_ID_FIELD]=c,t[y.DOM_KENDO_TREEVIEW_GUID_FIELD]=f)},[c,f]),W=a.useCallback(t=>{t.target.closest(".k-treeview-toggle")||(I&&!s&&!t.target.closest(".k-checkbox")&&u(t,n,c),x(t,n,c))},[I,s,u,x,n,c]),j=a.useCallback(t=>{u(t,n,c)},[u,n,c]),L=a.useCallback(t=>{E(t,n,c)},[E,n,c]),A=a.useCallback(t=>{v(t.event,n,c)},[v,n,c]),G=a.useCallback(t=>{P(t.event,n,c)},[P,n,c]),B=a.useCallback(t=>{D(t.event,n,c)},[D,n,c]),K=a.useCallback(t=>{N(t,n,c)},[N,n,c]),F=a.useRef(void 0);a.useLayoutEffect(()=>{l&&l!==F.current&&l===c&&R(d.current),F.current=l},[l,c,R]);const k=!!i.checkIndeterminate(n);a.useLayoutEffect(()=>{r.current&&r.current.indeterminate!==k&&(r.current.indeterminate=k)},[k,I]);const H=()=>{if(e.checkboxes){const t=e.size,m=!!i.checked(n);return a.createElement("span",{className:o.classNames("k-checkbox-wrap")},a.createElement("input",{type:"checkbox",className:o.classNames("k-checkbox",{[`k-checkbox-${te[t]||t}`]:t,"k-disabled":s,"k-checked":m}),"aria-label":n.text,checked:m,id:e.id,tabIndex:-1,onChange:j,ref:r}))}},$=()=>e.expandIcons&&(i.hasChildren(n)||o.hasChildren(n,i.getChildrenField()))&&a.createElement("span",{className:o.classNames("k-treeview-toggle",{"k-disabled":s}),onClick:L},a.createElement(o.IconWrap,{...q()})),J=()=>{const t=i.children(n);return o.isItemExpandedAndWithChildren(n,i)?a.createElement("ul",{className:"k-treeview-group",role:"group"},t.map((m,b)=>a.createElement(g,{item:m,position:p.getNodePosition(b,t),itemId:o.treeIdUtils.createId(b,c),treeGuid:e.treeGuid,animate:e.animate,focusedItemId:e.focusedItemId,tabbableItemId:e.tabbableItemId,fieldsService:e.fieldsService,itemUI:e.itemUI,checkboxes:e.checkboxes,ariaMultiSelectable:e.ariaMultiSelectable,onItemClick:e.onItemClick,onFocusDomElNeeded:e.onFocusDomElNeeded,draggable:e.draggable,onPress:e.onPress,onDrag:e.onDrag,onRelease:e.onRelease,expandIcons:e.expandIcons,iconField:e.iconField,onExpandChange:e.onExpandChange,onCheckChange:e.onCheckChange,onContextMenu:e.onContextMenu,key:o.treeIdUtils.createId(b,c),size:e.size,disabled:s,isRtl:e.isRtl}))):void 0},Q=()=>{const t=J(),m=i.hasChildren(n)||o.hasChildren(n,i.getChildrenField());return e.animate&&m?a.createElement(Z.Reveal,{transitionEnterDuration:200,transitionExitDuration:200,style:{display:"block"}},t):t},M=(()=>{const t=w&&n[w];return a.createElement("span",{className:o.classNames("k-treeview-leaf"),onContextMenu:K},t&&a.createElement(o.IconWrap,{name:t.name,icon:t}),a.createElement("span",{className:"k-treeview-leaf-text"},e.itemUI?a.createElement(e.itemUI,{item:n,itemHierarchicalIndex:c}):i.text(n)))})(),X=e.itemId.split("_").length;return a.createElement("li",{className:o.classNames("k-treeview-item"),style:{"--kendo-treeview-level":X},tabIndex:T,role:"treeitem","aria-expanded":O,"aria-selected":V,"aria-checked":U,"aria-disabled":s?!0:void 0,ref:d},a.createElement("span",{className:o.classNames("k-treeview-item-content",{"k-focus":e.focusedItemId===c,"k-selected":i.selected(n),"k-disabled":s,"k-touch-action-none":e.draggable}),ref:z,onClick:W},$(),H(),e.draggable?a.createElement(o.Draggable,{onPress:A,onDrag:G,onRelease:B},M):M),Q())},g=a.forwardRef((e,d)=>{const r=o.useId(e.id),h=a.useContext(_)({...e,id:r});return a.createElement(ae,{...h})});g.displayName="TreeViewItem";exports.TreeViewItem=g;exports.TreeViewItemPropsContext=_;
|
package/TreeViewItem.mjs
CHANGED
|
@@ -5,210 +5,191 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
10
|
-
import { chevronDownIcon as
|
|
11
|
-
import { Reveal as
|
|
12
|
-
import { DOM_KENDO_ITEM_ID_FIELD as
|
|
13
|
-
import { getNodePosition as
|
|
14
|
-
const { sizeMap:
|
|
15
|
-
(
|
|
16
|
-
),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
8
|
+
import * as a from "react";
|
|
9
|
+
import { useId as Y, hasChildren as u, classNames as s, Draggable as Z, IconWrap as S, kendoThemeMaps as p, isItemExpandedAndWithChildren as ee, treeIdUtils as _ } from "@progress/kendo-react-common";
|
|
10
|
+
import { chevronDownIcon as te, chevronLeftIcon as ne, chevronRightIcon as ae } from "@progress/kendo-svg-icons";
|
|
11
|
+
import { Reveal as ce } from "@progress/kendo-react-animation";
|
|
12
|
+
import { DOM_KENDO_ITEM_ID_FIELD as ie, DOM_KENDO_TREEVIEW_GUID_FIELD as oe } from "./utils/consts.mjs";
|
|
13
|
+
import { getNodePosition as re } from "./utils/utils.mjs";
|
|
14
|
+
const { sizeMap: le } = p, de = a.createContext(
|
|
15
|
+
(e) => e
|
|
16
|
+
), se = {
|
|
17
|
+
iconField: "svgIcon"
|
|
18
|
+
}, me = (e) => {
|
|
19
|
+
var M;
|
|
20
|
+
const h = a.useRef(null), d = a.useRef(null), {
|
|
21
|
+
focusedItemId: r,
|
|
22
|
+
tabbableItemId: I,
|
|
23
|
+
checkboxes: k,
|
|
24
|
+
treeGuid: f,
|
|
25
|
+
onItemClick: g,
|
|
26
|
+
onCheckChange: m,
|
|
27
|
+
onExpandChange: x,
|
|
28
|
+
onPress: E,
|
|
29
|
+
onDrag: v,
|
|
30
|
+
onRelease: D,
|
|
31
|
+
onContextMenu: P,
|
|
32
|
+
onFocusDomElNeeded: R
|
|
33
|
+
} = e, i = e.fieldsService, n = e.item, c = e.itemId, w = (M = e.iconField) != null ? M : se.iconField, o = e.disabled || i.disabled(n), T = (r || I) === c ? 0 : -1, V = i.hasChildren(n) || u(n, i.getChildrenField()) ? !!i.expanded(n) : void 0, U = (() => {
|
|
34
|
+
if (i.selected(n))
|
|
35
|
+
return !0;
|
|
36
|
+
if (e.ariaMultiSelectable)
|
|
37
|
+
return o ? void 0 : !1;
|
|
38
|
+
})(), z = (() => {
|
|
39
|
+
if (e.checkboxes)
|
|
40
|
+
return i.checked(n) ? "true" : i.checkIndeterminate(n) ? "mixed" : "false";
|
|
41
|
+
})(), L = () => {
|
|
42
|
+
const t = i.expanded(n);
|
|
43
|
+
return t && !u(n, i.getChildrenField()) ? { name: "loading" } : t ? { name: "chevron-down", icon: te } : {
|
|
44
|
+
name: e.isRtl ? "chevron-left" : "chevron-right",
|
|
45
|
+
icon: e.isRtl ? ne : ae
|
|
34
46
|
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
return /* @__PURE__ */
|
|
47
|
+
}, W = a.useCallback(
|
|
48
|
+
(t) => {
|
|
49
|
+
t && (t[ie] = c, t[oe] = f);
|
|
50
|
+
},
|
|
51
|
+
[c, f]
|
|
52
|
+
), G = a.useCallback(
|
|
53
|
+
(t) => {
|
|
54
|
+
t.target.closest(".k-treeview-toggle") || (k && !o && !t.target.closest(".k-checkbox") && m(t, n, c), g(t, n, c));
|
|
55
|
+
},
|
|
56
|
+
[k, o, m, g, n, c]
|
|
57
|
+
), O = a.useCallback(
|
|
58
|
+
(t) => {
|
|
59
|
+
m(t, n, c);
|
|
60
|
+
},
|
|
61
|
+
[m, n, c]
|
|
62
|
+
), A = a.useCallback(
|
|
63
|
+
(t) => {
|
|
64
|
+
x(t, n, c);
|
|
65
|
+
},
|
|
66
|
+
[x, n, c]
|
|
67
|
+
), B = a.useCallback(
|
|
68
|
+
(t) => {
|
|
69
|
+
E(t.event, n, c);
|
|
70
|
+
},
|
|
71
|
+
[E, n, c]
|
|
72
|
+
), K = a.useCallback(
|
|
73
|
+
(t) => {
|
|
74
|
+
v(t.event, n, c);
|
|
75
|
+
},
|
|
76
|
+
[v, n, c]
|
|
77
|
+
), H = a.useCallback(
|
|
78
|
+
(t) => {
|
|
79
|
+
D(t.event, n, c);
|
|
80
|
+
},
|
|
81
|
+
[D, n, c]
|
|
82
|
+
), $ = a.useCallback(
|
|
83
|
+
(t) => {
|
|
84
|
+
P(t, n, c);
|
|
85
|
+
},
|
|
86
|
+
[P, n, c]
|
|
87
|
+
), F = a.useRef(void 0);
|
|
88
|
+
a.useLayoutEffect(() => {
|
|
89
|
+
r && r !== F.current && r === c && R(h.current), F.current = r;
|
|
90
|
+
}, [r, c, R]);
|
|
91
|
+
const C = !!i.checkIndeterminate(n);
|
|
92
|
+
a.useLayoutEffect(() => {
|
|
93
|
+
d.current && d.current.indeterminate !== C && (d.current.indeterminate = C);
|
|
94
|
+
}, [C, k]);
|
|
95
|
+
const j = () => {
|
|
96
|
+
if (e.checkboxes) {
|
|
97
|
+
const t = e.size, l = !!i.checked(n);
|
|
98
|
+
return /* @__PURE__ */ a.createElement("span", { className: s("k-checkbox-wrap") }, /* @__PURE__ */ a.createElement(
|
|
87
99
|
"input",
|
|
88
100
|
{
|
|
89
101
|
type: "checkbox",
|
|
90
|
-
className:
|
|
91
|
-
[`k-checkbox-${
|
|
92
|
-
"k-disabled":
|
|
93
|
-
"k-checked":
|
|
102
|
+
className: s("k-checkbox", {
|
|
103
|
+
[`k-checkbox-${le[t] || t}`]: t,
|
|
104
|
+
"k-disabled": o,
|
|
105
|
+
"k-checked": l
|
|
94
106
|
}),
|
|
95
|
-
"aria-label":
|
|
96
|
-
checked:
|
|
97
|
-
id:
|
|
107
|
+
"aria-label": n.text,
|
|
108
|
+
checked: l,
|
|
109
|
+
id: e.id,
|
|
98
110
|
tabIndex: -1,
|
|
99
|
-
onChange:
|
|
100
|
-
ref:
|
|
101
|
-
this.checkboxElement = s;
|
|
102
|
-
}
|
|
111
|
+
onChange: O,
|
|
112
|
+
ref: d
|
|
103
113
|
}
|
|
104
114
|
));
|
|
105
115
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return
|
|
109
|
-
|
|
110
|
-
(this.fieldsSvc.hasChildren(this.item) || o(this.item, this.fieldsSvc.getChildrenField())) && // Allowing the toggle-button even with `disabled=true` might be a valid case!
|
|
111
|
-
// Re-evaluate the classes bellow if such scenario occurs
|
|
112
|
-
/* @__PURE__ */ i.createElement(
|
|
113
|
-
"span",
|
|
116
|
+
}, q = () => e.expandIcons && (i.hasChildren(n) || u(n, i.getChildrenField())) && /* @__PURE__ */ a.createElement("span", { className: s("k-treeview-toggle", { "k-disabled": o }), onClick: A }, /* @__PURE__ */ a.createElement(S, { ...L() })), J = () => {
|
|
117
|
+
const t = i.children(n);
|
|
118
|
+
return ee(n, i) ? /* @__PURE__ */ a.createElement("ul", { className: "k-treeview-group", role: "group" }, t.map((l, b) => /* @__PURE__ */ a.createElement(
|
|
119
|
+
y,
|
|
114
120
|
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
onDrag: this.props.onDrag,
|
|
142
|
-
onRelease: this.props.onRelease,
|
|
143
|
-
expandIcons: this.props.expandIcons,
|
|
144
|
-
iconField: this.props.iconField,
|
|
145
|
-
onExpandChange: this.props.onExpandChange,
|
|
146
|
-
onCheckChange: this.props.onCheckChange,
|
|
147
|
-
onContextMenu: this.props.onContextMenu,
|
|
148
|
-
key: s,
|
|
149
|
-
size: this.props.size,
|
|
150
|
-
disabled: this.disabled,
|
|
151
|
-
isRtl: this.props.isRtl
|
|
121
|
+
item: l,
|
|
122
|
+
position: re(b, t),
|
|
123
|
+
itemId: _.createId(b, c),
|
|
124
|
+
treeGuid: e.treeGuid,
|
|
125
|
+
animate: e.animate,
|
|
126
|
+
focusedItemId: e.focusedItemId,
|
|
127
|
+
tabbableItemId: e.tabbableItemId,
|
|
128
|
+
fieldsService: e.fieldsService,
|
|
129
|
+
itemUI: e.itemUI,
|
|
130
|
+
checkboxes: e.checkboxes,
|
|
131
|
+
ariaMultiSelectable: e.ariaMultiSelectable,
|
|
132
|
+
onItemClick: e.onItemClick,
|
|
133
|
+
onFocusDomElNeeded: e.onFocusDomElNeeded,
|
|
134
|
+
draggable: e.draggable,
|
|
135
|
+
onPress: e.onPress,
|
|
136
|
+
onDrag: e.onDrag,
|
|
137
|
+
onRelease: e.onRelease,
|
|
138
|
+
expandIcons: e.expandIcons,
|
|
139
|
+
iconField: e.iconField,
|
|
140
|
+
onExpandChange: e.onExpandChange,
|
|
141
|
+
onCheckChange: e.onCheckChange,
|
|
142
|
+
onContextMenu: e.onContextMenu,
|
|
143
|
+
key: _.createId(b, c),
|
|
144
|
+
size: e.size,
|
|
145
|
+
disabled: o,
|
|
146
|
+
isRtl: e.isRtl
|
|
152
147
|
}
|
|
153
148
|
))) : void 0;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
a.defaultProps = {
|
|
200
|
-
position: "top",
|
|
201
|
-
iconField: "svgIcon"
|
|
202
|
-
};
|
|
203
|
-
let h = a;
|
|
204
|
-
const c = l(
|
|
205
|
-
i.forwardRef((r, e) => {
|
|
206
|
-
const s = i.useContext(S).call(void 0, r);
|
|
207
|
-
return /* @__PURE__ */ i.createElement(h, { ref: e, ...s });
|
|
208
|
-
})
|
|
209
|
-
);
|
|
210
|
-
c.displayName = "TreeViewItem";
|
|
149
|
+
}, Q = () => {
|
|
150
|
+
const t = J(), l = i.hasChildren(n) || u(n, i.getChildrenField());
|
|
151
|
+
return e.animate && l ? /* @__PURE__ */ a.createElement(ce, { transitionEnterDuration: 200, transitionExitDuration: 200, style: { display: "block" } }, t) : t;
|
|
152
|
+
}, N = (() => {
|
|
153
|
+
const t = w && n[w];
|
|
154
|
+
return /* @__PURE__ */ a.createElement("span", { className: s("k-treeview-leaf"), onContextMenu: $ }, t && /* @__PURE__ */ a.createElement(S, { name: t.name, icon: t }), /* @__PURE__ */ a.createElement("span", { className: "k-treeview-leaf-text" }, e.itemUI ? /* @__PURE__ */ a.createElement(e.itemUI, { item: n, itemHierarchicalIndex: c }) : i.text(n)));
|
|
155
|
+
})(), X = e.itemId.split("_").length;
|
|
156
|
+
return /* @__PURE__ */ a.createElement(
|
|
157
|
+
"li",
|
|
158
|
+
{
|
|
159
|
+
className: s("k-treeview-item"),
|
|
160
|
+
style: { "--kendo-treeview-level": X },
|
|
161
|
+
tabIndex: T,
|
|
162
|
+
role: "treeitem",
|
|
163
|
+
"aria-expanded": V,
|
|
164
|
+
"aria-selected": U,
|
|
165
|
+
"aria-checked": z,
|
|
166
|
+
"aria-disabled": o ? !0 : void 0,
|
|
167
|
+
ref: h
|
|
168
|
+
},
|
|
169
|
+
/* @__PURE__ */ a.createElement(
|
|
170
|
+
"span",
|
|
171
|
+
{
|
|
172
|
+
className: s("k-treeview-item-content", {
|
|
173
|
+
"k-focus": e.focusedItemId === c,
|
|
174
|
+
"k-selected": i.selected(n),
|
|
175
|
+
"k-disabled": o,
|
|
176
|
+
"k-touch-action-none": e.draggable
|
|
177
|
+
}),
|
|
178
|
+
ref: W,
|
|
179
|
+
onClick: G
|
|
180
|
+
},
|
|
181
|
+
q(),
|
|
182
|
+
j(),
|
|
183
|
+
e.draggable ? /* @__PURE__ */ a.createElement(Z, { onPress: B, onDrag: K, onRelease: H }, N) : N
|
|
184
|
+
),
|
|
185
|
+
Q()
|
|
186
|
+
);
|
|
187
|
+
}, y = a.forwardRef((e, h) => {
|
|
188
|
+
const d = Y(e.id), I = a.useContext(de)({ ...e, id: d });
|
|
189
|
+
return /* @__PURE__ */ a.createElement(me, { ...I });
|
|
190
|
+
});
|
|
191
|
+
y.displayName = "TreeViewItem";
|
|
211
192
|
export {
|
|
212
|
-
|
|
213
|
-
|
|
193
|
+
y as TreeViewItem,
|
|
194
|
+
de as TreeViewItemPropsContext
|
|
214
195
|
};
|