@progress/kendo-react-treeview 13.3.0 → 13.4.0-develop.2

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.
@@ -0,0 +1,112 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { TreeFieldsService } from '@progress/kendo-react-common';
9
+ import * as React from 'react';
10
+ /**
11
+ * @hidden
12
+ */
13
+ export declare const TreeViewItemPropsContext: React.Context<(props: TreeViewItemProps) => TreeViewItemProps>;
14
+ /**
15
+ * @hidden
16
+ */
17
+ export interface TreeViewItemProps {
18
+ item: any;
19
+ itemId: string;
20
+ treeGuid: string;
21
+ animate: boolean;
22
+ focusedItemId?: string;
23
+ tabbableItemId: string;
24
+ fieldsService: TreeFieldsService;
25
+ itemUI?: React.ComponentType<{
26
+ item: any;
27
+ itemHierarchicalIndex: string;
28
+ }>;
29
+ ariaMultiSelectable: boolean;
30
+ onItemClick: any;
31
+ expandIcons?: boolean;
32
+ iconField?: string;
33
+ onExpandChange: any;
34
+ onCheckChange: any;
35
+ checkboxes?: boolean;
36
+ onFocusDomElNeeded: any;
37
+ draggable?: boolean;
38
+ onPress: any;
39
+ onDrag: any;
40
+ onRelease: any;
41
+ size?: 'small' | 'medium' | 'large';
42
+ /**
43
+ * @hidden
44
+ *
45
+ * Internal usage!!!
46
+ */
47
+ position?: 'top' | 'mid' | 'bot';
48
+ /**
49
+ * Currently for internal usage only! Replicates the current behavior which disables all children
50
+ * if the parent is disabled, which was previously achieved only though the kendo-themes,
51
+ * but due to rendering changes had to be replicated programmatically!
52
+ *
53
+ * @hidden
54
+ */
55
+ disabled?: boolean;
56
+ /**
57
+ * @hidden
58
+ */
59
+ isRtl?: boolean;
60
+ /**
61
+ * @hidden
62
+ */
63
+ onContextMenu: (event: React.MouseEvent<HTMLElement>, item: any, itemId: string) => void;
64
+ /**
65
+ * @hidden
66
+ * This prop comes from the `TreeView`component.
67
+ * It replaces the previously used guid() function and is used to generate unique `id` for
68
+ * the checkbox and label in the TreeViewItem.
69
+ */
70
+ id?: string;
71
+ }
72
+ /**
73
+ * @hidden
74
+ */
75
+ declare class TreeViewItemWithoutContext extends React.Component<TreeViewItemProps> {
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 onCheckChange;
91
+ private onExpandChange;
92
+ private onItemClick;
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 {};
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 p=require("react"),s=require("@progress/kendo-react-common"),o=require("@progress/kendo-svg-icons"),m=require("@progress/kendo-react-animation"),h=require("./utils/consts.js"),I=require("./utils/utils.js");function u(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const i=u(p),{sizeMap:b}=s.kendoThemeMaps,l=i.createContext(r=>r),c=class c extends i.Component{constructor(){super(...arguments),this.onCheckChange=e=>{this.props.onCheckChange(e,this.item,this.itemId)},this.onExpandChange=e=>{this.props.onExpandChange(e,this.item,this.itemId)},this.onItemClick=e=>{this.props.onItemClick(e,this.item,this.itemId)},this.onPress=e=>{this.props.onPress(e.event,this.item,this.itemId)},this.onDrag=e=>{this.props.onDrag(e.event,this.item,this.itemId)},this.onRelease=e=>{this.props.onRelease(e.event,this.item,this.itemId)},this.onContextMenu=e=>{this.props.onContextMenu(e,this.item,this.itemId)},this.assignDraggableMeta=e=>{e&&(e[h.DOM_KENDO_ITEM_ID_FIELD]=this.props.itemId,e[h.DOM_KENDO_TREEVIEW_GUID_FIELD]=this.props.treeGuid)}}render(){const e=this.renderItemInPart();return i.createElement("li",{className:s.classNames("k-treeview-item"),tabIndex:this.tabIndex,role:"treeitem","aria-expanded":this.ariaExpanded,"aria-selected":this.ariaSelected,"aria-checked":this.ariaChecked,"aria-disabled":this.disabled?!0:void 0,ref:t=>{this.itemElement=t}},i.createElement("span",{className:`k-treeview-${this.props.position}`,ref:this.assignDraggableMeta},this.renderExpandIcon(),this.renderCheckbox(),this.props.draggable?i.createElement(s.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease},e):e),this.renderSubitemsWithAnimation())}componentDidMount(){const e=this.props.focusedItemId,t=this.itemId;e&&e===t&&this.props.onFocusDomElNeeded(this.itemElement),this.checkboxElement&&(this.checkboxElement.indeterminate=this.fieldsSvc.checkIndeterminate(this.item))}componentDidUpdate(e){const t=this.props.focusedItemId;if(t&&t!==e.focusedItemId&&t===this.itemId&&this.props.onFocusDomElNeeded(this.itemElement),this.checkboxElement){const n=this.fieldsSvc.checkIndeterminate(this.item);this.checkboxElement.indeterminate!==n&&(this.checkboxElement.indeterminate=n)}}renderCheckbox(){if(this.props.checkboxes){const e=this.props.size;return i.createElement("span",{className:s.classNames("k-checkbox-wrap")},i.createElement("input",{type:"checkbox",className:s.classNames("k-checkbox k-rounded-md",{[`k-checkbox-${b[e]||e}`]:e,"k-disabled":this.disabled}),"aria-label":this.item.text,checked:!!this.fieldsSvc.checked(this.item),id:this.props.id,tabIndex:-1,onChange:this.onCheckChange,ref:t=>{this.checkboxElement=t}}))}}renderExpandIcon(){return this.props.expandIcons&&(this.fieldsSvc.hasChildren(this.item)||s.hasChildren(this.item,this.fieldsSvc.getChildrenField()))&&i.createElement("span",{className:s.classNames("k-treeview-toggle",{"k-disabled":this.disabled}),onClick:this.onExpandChange},i.createElement(s.IconWrap,{...this.getIconProps()}))}renderSubitemsIfApplicable(){const e=this.fieldsSvc.children(this.item);return s.isItemExpandedAndWithChildren(this.item,this.fieldsSvc)?i.createElement("ul",{className:"k-treeview-group",role:"group"},e.map((t,n)=>i.createElement(d,{item:t,position:I.getNodePosition(n,e),itemId:s.treeIdUtils.createId(n,this.itemId),treeGuid:this.props.treeGuid,animate:this.props.animate,focusedItemId:this.props.focusedItemId,tabbableItemId:this.props.tabbableItemId,fieldsService:this.props.fieldsService,itemUI:this.props.itemUI,checkboxes:this.props.checkboxes,ariaMultiSelectable:this.props.ariaMultiSelectable,onItemClick:this.props.onItemClick,onFocusDomElNeeded:this.props.onFocusDomElNeeded,draggable:this.props.draggable,onPress:this.props.onPress,onDrag:this.props.onDrag,onRelease:this.props.onRelease,expandIcons:this.props.expandIcons,iconField:this.props.iconField,onExpandChange:this.props.onExpandChange,onCheckChange:this.props.onCheckChange,onContextMenu:this.props.onContextMenu,key:n,size:this.props.size,disabled:this.disabled,isRtl:this.props.isRtl}))):void 0}renderSubitemsWithAnimation(){const e=this.renderSubitemsIfApplicable(),t=this.fieldsSvc.children(this.item).length>0;return this.props.animate&&t?i.createElement(m.Reveal,{transitionEnterDuration:200,transitionExitDuration:200,style:{display:"block"}},e):e}renderItemInPart(){const e=this.props.iconField,t=e&&this.item[e];return i.createElement("span",{className:s.classNames("k-treeview-leaf",{"k-focus":this.props.focusedItemId===this.itemId,"k-selected":this.fieldsSvc.selected(this.item),"k-disabled":this.disabled,"k-touch-action-none":this.props.draggable}),onClick:this.onItemClick,onContextMenu:this.onContextMenu},t&&i.createElement(s.IconWrap,{name:t.name,icon:t}),i.createElement("span",{className:"k-treeview-leaf-text"},this.props.itemUI?i.createElement(this.props.itemUI,{item:this.item,itemHierarchicalIndex:this.itemId}):this.fieldsSvc.text(this.item)))}get fieldsSvc(){return this.props.fieldsService}get itemId(){return this.props.itemId}get item(){return this.props.item}get tabIndex(){return(this.props.focusedItemId||this.props.tabbableItemId)===this.itemId?0:-1}get ariaExpanded(){return this.fieldsSvc.hasChildren(this.item)||s.hasChildren(this.item,this.fieldsSvc.getChildrenField())?!!this.fieldsSvc.expanded(this.item):void 0}get disabled(){return this.props.disabled||this.fieldsSvc.disabled(this.item)}get ariaChecked(){if(this.props.checkboxes)return this.fieldsSvc.checked(this.item)?"true":this.fieldsSvc.checkIndeterminate(this.item)?"mixed":"false"}get ariaSelected(){if(this.fieldsSvc.selected(this.item))return!0;if(this.props.ariaMultiSelectable)return this.disabled?void 0:!1}getIconProps(){const e=this.fieldsSvc.expanded(this.item);return e&&!s.hasChildren(this.item,this.fieldsSvc.getChildrenField())?{name:"loading"}:e?{name:"caret-alt-down",icon:o.caretAltDownIcon}:{name:this.props.isRtl?"caret-alt-left":"caret-alt-right",icon:this.props.isRtl?o.caretAltLeftIcon:o.caretAltRightIcon}}};c.defaultProps={position:"top",iconField:"svgIcon"};let a=c;const d=s.withIdHOC(i.forwardRef((r,e)=>{const n=i.useContext(l).call(void 0,r);return i.createElement(a,{ref:e,...n})}));d.displayName="TreeViewItem";exports.TreeViewItem=d;exports.TreeViewItemPropsContext=l;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),s=require("@progress/kendo-react-common"),o=require("@progress/kendo-svg-icons"),m=require("@progress/kendo-react-animation"),d=require("./utils/consts.js"),I=require("./utils/utils.js");function u(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const i=u(p),{sizeMap:b}=s.kendoThemeMaps,l=i.createContext(r=>r),h=class h extends i.Component{constructor(){super(...arguments),this.onCheckChange=e=>{this.props.onCheckChange(e,this.item,this.itemId)},this.onExpandChange=e=>{this.props.onExpandChange(e,this.item,this.itemId)},this.onItemClick=e=>{this.props.onItemClick(e,this.item,this.itemId)},this.onPress=e=>{this.props.onPress(e.event,this.item,this.itemId)},this.onDrag=e=>{this.props.onDrag(e.event,this.item,this.itemId)},this.onRelease=e=>{this.props.onRelease(e.event,this.item,this.itemId)},this.onContextMenu=e=>{this.props.onContextMenu(e,this.item,this.itemId)},this.assignDraggableMeta=e=>{e&&(e[d.DOM_KENDO_ITEM_ID_FIELD]=this.props.itemId,e[d.DOM_KENDO_TREEVIEW_GUID_FIELD]=this.props.treeGuid)}}render(){const e=this.renderItemInPart(),t=this.props.itemId.split("_").length;return i.createElement("li",{className:s.classNames("k-treeview-item"),style:{"--kendo-treeview-level":t},tabIndex:this.tabIndex,role:"treeitem","aria-expanded":this.ariaExpanded,"aria-selected":this.ariaSelected,"aria-checked":this.ariaChecked,"aria-disabled":this.disabled?!0:void 0,ref:n=>{this.itemElement=n}},i.createElement("span",{className:s.classNames("k-treeview-item-content",{"k-focus":this.props.focusedItemId===this.itemId,"k-selected":this.fieldsSvc.selected(this.item),"k-disabled":this.disabled,"k-touch-action-none":this.props.draggable}),ref:this.assignDraggableMeta},this.renderExpandIcon(),this.renderCheckbox(),this.props.draggable?i.createElement(s.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease},e):e),this.renderSubitemsWithAnimation())}componentDidMount(){const e=this.props.focusedItemId,t=this.itemId;e&&e===t&&this.props.onFocusDomElNeeded(this.itemElement),this.checkboxElement&&(this.checkboxElement.indeterminate=this.fieldsSvc.checkIndeterminate(this.item))}componentDidUpdate(e){const t=this.props.focusedItemId;if(t&&t!==e.focusedItemId&&t===this.itemId&&this.props.onFocusDomElNeeded(this.itemElement),this.checkboxElement){const n=this.fieldsSvc.checkIndeterminate(this.item);this.checkboxElement.indeterminate!==n&&(this.checkboxElement.indeterminate=n)}}renderCheckbox(){if(this.props.checkboxes){const e=this.props.size,t=!!this.fieldsSvc.checked(this.item);return i.createElement("span",{className:s.classNames("k-checkbox-wrap")},i.createElement("input",{type:"checkbox",className:s.classNames("k-checkbox",{[`k-checkbox-${b[e]||e}`]:e,"k-disabled":this.disabled,"k-checked":t}),"aria-label":this.item.text,checked:t,id:this.props.id,tabIndex:-1,onChange:this.onCheckChange,ref:n=>{this.checkboxElement=n}}))}}renderExpandIcon(){return this.props.expandIcons&&(this.fieldsSvc.hasChildren(this.item)||s.hasChildren(this.item,this.fieldsSvc.getChildrenField()))&&i.createElement("span",{className:s.classNames("k-treeview-toggle",{"k-disabled":this.disabled}),onClick:this.onExpandChange},i.createElement(s.IconWrap,{...this.getIconProps()}))}renderSubitemsIfApplicable(){const e=this.fieldsSvc.children(this.item);return s.isItemExpandedAndWithChildren(this.item,this.fieldsSvc)?i.createElement("ul",{className:"k-treeview-group",role:"group"},e.map((t,n)=>i.createElement(c,{item:t,position:I.getNodePosition(n,e),itemId:s.treeIdUtils.createId(n,this.itemId),treeGuid:this.props.treeGuid,animate:this.props.animate,focusedItemId:this.props.focusedItemId,tabbableItemId:this.props.tabbableItemId,fieldsService:this.props.fieldsService,itemUI:this.props.itemUI,checkboxes:this.props.checkboxes,ariaMultiSelectable:this.props.ariaMultiSelectable,onItemClick:this.props.onItemClick,onFocusDomElNeeded:this.props.onFocusDomElNeeded,draggable:this.props.draggable,onPress:this.props.onPress,onDrag:this.props.onDrag,onRelease:this.props.onRelease,expandIcons:this.props.expandIcons,iconField:this.props.iconField,onExpandChange:this.props.onExpandChange,onCheckChange:this.props.onCheckChange,onContextMenu:this.props.onContextMenu,key:n,size:this.props.size,disabled:this.disabled,isRtl:this.props.isRtl}))):void 0}renderSubitemsWithAnimation(){const e=this.renderSubitemsIfApplicable(),t=this.fieldsSvc.children(this.item).length>0;return this.props.animate&&t?i.createElement(m.Reveal,{transitionEnterDuration:200,transitionExitDuration:200,style:{display:"block"}},e):e}renderItemInPart(){const e=this.props.iconField,t=e&&this.item[e];return i.createElement("span",{className:s.classNames("k-treeview-leaf"),onClick:this.onItemClick,onContextMenu:this.onContextMenu},t&&i.createElement(s.IconWrap,{name:t.name,icon:t}),i.createElement("span",{className:"k-treeview-leaf-text"},this.props.itemUI?i.createElement(this.props.itemUI,{item:this.item,itemHierarchicalIndex:this.itemId}):this.fieldsSvc.text(this.item)))}get fieldsSvc(){return this.props.fieldsService}get itemId(){return this.props.itemId}get item(){return this.props.item}get tabIndex(){return(this.props.focusedItemId||this.props.tabbableItemId)===this.itemId?0:-1}get ariaExpanded(){return this.fieldsSvc.hasChildren(this.item)||s.hasChildren(this.item,this.fieldsSvc.getChildrenField())?!!this.fieldsSvc.expanded(this.item):void 0}get disabled(){return this.props.disabled||this.fieldsSvc.disabled(this.item)}get ariaChecked(){if(this.props.checkboxes)return this.fieldsSvc.checked(this.item)?"true":this.fieldsSvc.checkIndeterminate(this.item)?"mixed":"false"}get ariaSelected(){if(this.fieldsSvc.selected(this.item))return!0;if(this.props.ariaMultiSelectable)return this.disabled?void 0:!1}getIconProps(){const e=this.fieldsSvc.expanded(this.item);return e&&!s.hasChildren(this.item,this.fieldsSvc.getChildrenField())?{name:"loading"}:e?{name:"chevron-down",icon:o.chevronDownIcon}:{name:this.props.isRtl?"chevron-left":"chevron-right",icon:this.props.isRtl?o.chevronLeftIcon:o.chevronRightIcon}}};h.defaultProps={position:"top",iconField:"svgIcon"};let a=h;const c=s.withIdHOC(i.forwardRef((r,e)=>{const n=i.useContext(l).call(void 0,r);return i.createElement(a,{ref:e,...n})}));c.displayName="TreeViewItem";exports.TreeViewItem=c;exports.TreeViewItemPropsContext=l;
package/TreeViewItem.mjs CHANGED
@@ -6,14 +6,14 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as i from "react";
9
- import { classNames as n, Draggable as l, hasChildren as o, IconWrap as d, isItemExpandedAndWithChildren as p, treeIdUtils as m, withIdHOC as I, kendoThemeMaps as u } from "@progress/kendo-react-common";
10
- import { caretAltDownIcon as f, caretAltLeftIcon as b, caretAltRightIcon as g } from "@progress/kendo-svg-icons";
11
- import { Reveal as k } from "@progress/kendo-react-animation";
12
- import { DOM_KENDO_ITEM_ID_FIELD as x, DOM_KENDO_TREEVIEW_GUID_FIELD as E } from "./utils/consts.mjs";
13
- import { getNodePosition as C } from "./utils/utils.mjs";
14
- const { sizeMap: v } = u, S = i.createContext(
9
+ import { withIdHOC as l, classNames as n, Draggable as p, kendoThemeMaps as m, hasChildren as o, IconWrap as d, isItemExpandedAndWithChildren as I, treeIdUtils as u } from "@progress/kendo-react-common";
10
+ import { chevronDownIcon as f, chevronLeftIcon as b, chevronRightIcon as k } from "@progress/kendo-svg-icons";
11
+ import { Reveal as g } from "@progress/kendo-react-animation";
12
+ import { DOM_KENDO_ITEM_ID_FIELD as x, DOM_KENDO_TREEVIEW_GUID_FIELD as v } from "./utils/consts.mjs";
13
+ import { getNodePosition as E } from "./utils/utils.mjs";
14
+ const { sizeMap: C } = m, S = i.createContext(
15
15
  (r) => r
16
- ), h = class h extends i.Component {
16
+ ), a = class a extends i.Component {
17
17
  constructor() {
18
18
  super(...arguments), this.onCheckChange = (e) => {
19
19
  this.props.onCheckChange(e, this.item, this.itemId);
@@ -30,26 +30,41 @@ const { sizeMap: v } = u, S = i.createContext(
30
30
  }, this.onContextMenu = (e) => {
31
31
  this.props.onContextMenu(e, this.item, this.itemId);
32
32
  }, this.assignDraggableMeta = (e) => {
33
- e && (e[x] = this.props.itemId, e[E] = this.props.treeGuid);
33
+ e && (e[x] = this.props.itemId, e[v] = this.props.treeGuid);
34
34
  };
35
35
  }
36
36
  render() {
37
- const e = this.renderItemInPart();
37
+ const e = this.renderItemInPart(), t = this.props.itemId.split("_").length;
38
38
  return /* @__PURE__ */ i.createElement(
39
39
  "li",
40
40
  {
41
41
  className: n("k-treeview-item"),
42
+ style: { "--kendo-treeview-level": t },
42
43
  tabIndex: this.tabIndex,
43
44
  role: "treeitem",
44
45
  "aria-expanded": this.ariaExpanded,
45
46
  "aria-selected": this.ariaSelected,
46
47
  "aria-checked": this.ariaChecked,
47
48
  "aria-disabled": this.disabled ? !0 : void 0,
48
- ref: (t) => {
49
- this.itemElement = t;
49
+ ref: (s) => {
50
+ this.itemElement = s;
50
51
  }
51
52
  },
52
- /* @__PURE__ */ i.createElement("span", { className: `k-treeview-${this.props.position}`, ref: this.assignDraggableMeta }, this.renderExpandIcon(), this.renderCheckbox(), this.props.draggable ? /* @__PURE__ */ i.createElement(l, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease }, e) : e),
53
+ /* @__PURE__ */ i.createElement(
54
+ "span",
55
+ {
56
+ className: n("k-treeview-item-content", {
57
+ "k-focus": this.props.focusedItemId === this.itemId,
58
+ "k-selected": this.fieldsSvc.selected(this.item),
59
+ "k-disabled": this.disabled,
60
+ "k-touch-action-none": this.props.draggable
61
+ }),
62
+ ref: this.assignDraggableMeta
63
+ },
64
+ this.renderExpandIcon(),
65
+ this.renderCheckbox(),
66
+ this.props.draggable ? /* @__PURE__ */ i.createElement(p, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease }, e) : e
67
+ ),
53
68
  this.renderSubitemsWithAnimation()
54
69
  );
55
70
  }
@@ -66,22 +81,23 @@ const { sizeMap: v } = u, S = i.createContext(
66
81
  }
67
82
  renderCheckbox() {
68
83
  if (this.props.checkboxes) {
69
- const e = this.props.size;
84
+ const e = this.props.size, t = !!this.fieldsSvc.checked(this.item);
70
85
  return /* @__PURE__ */ i.createElement("span", { className: n("k-checkbox-wrap") }, /* @__PURE__ */ i.createElement(
71
86
  "input",
72
87
  {
73
88
  type: "checkbox",
74
- className: n("k-checkbox k-rounded-md", {
75
- [`k-checkbox-${v[e] || e}`]: e,
76
- "k-disabled": this.disabled
89
+ className: n("k-checkbox", {
90
+ [`k-checkbox-${C[e] || e}`]: e,
91
+ "k-disabled": this.disabled,
92
+ "k-checked": t
77
93
  }),
78
94
  "aria-label": this.item.text,
79
- checked: !!this.fieldsSvc.checked(this.item),
95
+ checked: t,
80
96
  id: this.props.id,
81
97
  tabIndex: -1,
82
98
  onChange: this.onCheckChange,
83
- ref: (t) => {
84
- this.checkboxElement = t;
99
+ ref: (s) => {
100
+ this.checkboxElement = s;
85
101
  }
86
102
  }
87
103
  ));
@@ -103,12 +119,12 @@ const { sizeMap: v } = u, S = i.createContext(
103
119
  }
104
120
  renderSubitemsIfApplicable() {
105
121
  const e = this.fieldsSvc.children(this.item);
106
- return p(this.item, this.fieldsSvc) ? /* @__PURE__ */ i.createElement("ul", { className: "k-treeview-group", role: "group" }, e.map((t, s) => /* @__PURE__ */ i.createElement(
122
+ return I(this.item, this.fieldsSvc) ? /* @__PURE__ */ i.createElement("ul", { className: "k-treeview-group", role: "group" }, e.map((t, s) => /* @__PURE__ */ i.createElement(
107
123
  c,
108
124
  {
109
125
  item: t,
110
- position: C(s, e),
111
- itemId: m.createId(s, this.itemId),
126
+ position: E(s, e),
127
+ itemId: u.createId(s, this.itemId),
112
128
  treeGuid: this.props.treeGuid,
113
129
  animate: this.props.animate,
114
130
  focusedItemId: this.props.focusedItemId,
@@ -137,19 +153,14 @@ const { sizeMap: v } = u, S = i.createContext(
137
153
  }
138
154
  renderSubitemsWithAnimation() {
139
155
  const e = this.renderSubitemsIfApplicable(), t = this.fieldsSvc.children(this.item).length > 0;
140
- return this.props.animate && t ? /* @__PURE__ */ i.createElement(k, { transitionEnterDuration: 200, transitionExitDuration: 200, style: { display: "block" } }, e) : e;
156
+ return this.props.animate && t ? /* @__PURE__ */ i.createElement(g, { transitionEnterDuration: 200, transitionExitDuration: 200, style: { display: "block" } }, e) : e;
141
157
  }
142
158
  renderItemInPart() {
143
159
  const e = this.props.iconField, t = e && this.item[e];
144
160
  return /* @__PURE__ */ i.createElement(
145
161
  "span",
146
162
  {
147
- className: n("k-treeview-leaf", {
148
- "k-focus": this.props.focusedItemId === this.itemId,
149
- "k-selected": this.fieldsSvc.selected(this.item),
150
- "k-disabled": this.disabled,
151
- "k-touch-action-none": this.props.draggable
152
- }),
163
+ className: n("k-treeview-leaf"),
153
164
  onClick: this.onItemClick,
154
165
  onContextMenu: this.onContextMenu
155
166
  },
@@ -187,21 +198,21 @@ const { sizeMap: v } = u, S = i.createContext(
187
198
  }
188
199
  getIconProps() {
189
200
  const e = this.fieldsSvc.expanded(this.item);
190
- return e && !o(this.item, this.fieldsSvc.getChildrenField()) ? { name: "loading" } : e ? { name: "caret-alt-down", icon: f } : {
191
- name: this.props.isRtl ? "caret-alt-left" : "caret-alt-right",
192
- icon: this.props.isRtl ? b : g
201
+ return e && !o(this.item, this.fieldsSvc.getChildrenField()) ? { name: "loading" } : e ? { name: "chevron-down", icon: f } : {
202
+ name: this.props.isRtl ? "chevron-left" : "chevron-right",
203
+ icon: this.props.isRtl ? b : k
193
204
  };
194
205
  }
195
206
  };
196
- h.defaultProps = {
207
+ a.defaultProps = {
197
208
  position: "top",
198
209
  iconField: "svgIcon"
199
210
  };
200
- let a = h;
201
- const c = I(
211
+ let h = a;
212
+ const c = l(
202
213
  i.forwardRef((r, e) => {
203
214
  const s = i.useContext(S).call(void 0, r);
204
- return /* @__PURE__ */ i.createElement(a, { ref: e, ...s });
215
+ return /* @__PURE__ */ i.createElement(h, { ref: e, ...s });
205
216
  })
206
217
  );
207
218
  c.displayName = "TreeViewItem";
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ /**
9
+ * The descriptors of the data operations which are applied to the TreeView component.
10
+ */
11
+ export interface TreeViewOperationDescriptors {
12
+ /**
13
+ * The hierarchical indices of the items to which the expand operation will be applied, or the descriptor of the operation.
14
+ */
15
+ expand?: string[] | TreeViewOperationDescriptor;
16
+ /**
17
+ * The hierarchical indices of the items to which the select operation will be applied, or the descriptor of the operation.
18
+ */
19
+ select?: string[] | TreeViewOperationDescriptor;
20
+ /**
21
+ * The hierarchical indices of the items to which the check operation will be applied, or the descriptor of the operation.
22
+ */
23
+ check?: string[] | TreeViewCheckDescriptor;
24
+ /**
25
+ * When the operations are applied, the corresponding items and their parents are cloned.
26
+ * For performance reasons, TreeView items are cloned only once.
27
+ * The name of the field which provides a Boolean representation of whether an item is already cloned.
28
+ * Defaults to `cloned`.
29
+ */
30
+ cloneField?: string;
31
+ /**
32
+ * The expand field of the item.
33
+ */
34
+ expandField?: string;
35
+ /**
36
+ * The select field of the item.
37
+ */
38
+ selectField?: string;
39
+ /**
40
+ * The check field of the item.
41
+ */
42
+ checkField?: string;
43
+ /**
44
+ * The children field of the item.
45
+ */
46
+ childrenField?: string;
47
+ }
48
+ /**
49
+ * The descriptor which is used for expanding, selecting, and checking.
50
+ */
51
+ export interface TreeViewOperationDescriptor {
52
+ /**
53
+ * The IDs of the items to which the operation will be applied. By default, the TreeView applies the hierarchical indices of the items. These indices are zero-based. The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index.
54
+ */
55
+ ids?: any[];
56
+ /**
57
+ * The name of the field which will provide a Boolean representation for the operation state of the item.
58
+ *
59
+ * The default fields are:
60
+ * * `expanded`&mdash;Indicates that an item is expanded.
61
+ * * `selected`&mdash;Indicates that an item is selected.
62
+ * * `checked`&mdash;Indicates that an item is checked.
63
+ */
64
+ operationField?: string;
65
+ /**
66
+ * The name of the field which will uniquely describe an item as an alternative to its hierarchical index.
67
+ */
68
+ idField?: string;
69
+ }
70
+ /**
71
+ * The descriptor which is used for checking.
72
+ */
73
+ export interface TreeViewCheckDescriptor extends TreeViewOperationDescriptor {
74
+ /**
75
+ * Determines if a parent item will have an indeterminate state when not all its children are checked.
76
+ */
77
+ applyCheckIndeterminate?: boolean;
78
+ /**
79
+ * The name of the field which will provide a Boolean representation for the indeterminate state of a parent item.
80
+ * Defaults to `checkIndeterminate`.
81
+ */
82
+ checkIndeterminateField?: string;
83
+ }