@progress/kendo-react-treeview 9.4.0-develop.6 → 9.4.0-develop.7
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.js +1 -1
- package/TreeView.mjs +10 -11
- package/TreeViewDragAnalyzer.js +1 -1
- package/TreeViewDragAnalyzer.mjs +0 -1
- package/TreeViewDragClue.js +1 -1
- package/TreeViewDragClue.mjs +0 -1
- package/TreeViewItem.js +1 -1
- package/TreeViewItem.mjs +3 -4
- package/handleTreeViewCheckChange.js +1 -1
- package/handleTreeViewCheckChange.mjs +12 -13
- package/index.js +2 -1
- package/index.mjs +4 -4
- package/moveTreeViewItem.js +1 -1
- package/moveTreeViewItem.mjs +18 -19
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -3
- package/package.json +4 -4
- package/processTreeViewItems.js +1 -1
- package/processTreeViewItems.mjs +0 -1
- package/utils/consts.js +1 -1
- package/utils/consts.mjs +3 -4
- package/utils/getItemIdUponKeyboardNavigation.js +1 -1
- package/utils/getItemIdUponKeyboardNavigation.mjs +8 -9
- package/utils/utils.js +1 -1
- package/utils/utils.mjs +3 -4
package/TreeView.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),a=require("prop-types"),l=require("@progress/kendo-react-common"),f=require("./utils/getItemIdUponKeyboardNavigation.js"),g=require("./utils/utils.js"),b=require("./TreeViewItem.js"),E=require("./package-metadata.js"),o=require("./utils/consts.js");function F(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const r=F(m),{sizeMap:C}=l.kendoThemeMaps,c=class c extends r.Component{constructor(t){super(t),this.state={focusedItemId:void 0,focusedItemPublicId:void 0,tabbableItemId:l.treeIdUtils.ZERO_LEVEL_ZERO_NODE_ID},this.fieldsSvc=null,this.allowExplicitFocus=!1,this._element=null,this.onFocusDomElNeeded=e=>{this.allowExplicitFocus&&this.focusDomItem(e)},this.onCheckChange=(e,i,s)=>{this.setFocus(s),this.dispatchCheckChange(e,i,s)},this.onExpandChange=(e,i,s)=>{this.setFocus(s),this.dispatchExpandChange(e,i,s)},this.onPress=(e,i,s)=>{this.props.onItemDragStart&&this.props.onItemDragStart.call(void 0,{target:this,item:i,itemHierarchicalIndex:s})},this.onDrag=(e,i,s)=>{const{pageX:d,pageY:h,clientX:u,clientY:p}=e;this.props.onItemDragOver&&this.props.onItemDragOver.call(void 0,{target:this,item:i,itemHierarchicalIndex:s,pageX:d,pageY:h,clientX:u,clientY:p})},this.onRelease=(e,i,s)=>{const{pageX:d,pageY:h,clientX:u,clientY:p}=e;this.props.onItemDragEnd&&this.props.onItemDragEnd.call(void 0,{target:this,item:i,itemHierarchicalIndex:s,pageX:d,pageY:h,clientX:u,clientY:p})},this.onItemClick=(e,i,s)=>{this.setFocus(s),this.dispatchItemClick(e,i,s)},this.onFocus=()=>{clearTimeout(this.blurRequest),this.state.focusedItemId===void 0&&this.data.length&&this.setFocus(this.state.tabbableItemId)},this.onBlur=()=>{clearTimeout(this.blurRequest),this.blurRequest=window.setTimeout(()=>this.setFocus(void 0),0)},this.onKeyDown=e=>{const i=this.getFocusedItem();if(i&&this.fieldsSvc){const s=f(i,this.state.focusedItemId,this.data,e.keyCode,this.fieldsSvc);s!==this.state.focusedItemId&&(e.preventDefault(),this.allowExplicitFocus=!0,this.setFocus(s)),this.dispatchEventsOnKeyDown(e,i)}},this.onContextMenu=(e,i,s)=>{if(this.props.onContextMenu){const d={target:this,syntheticEvent:e,nativeEvent:e.nativeEvent,item:i,itemID:s};this.props.onContextMenu.call(void 0,d)}},l.validatePackage(E.packageMetadata)}get treeGuid(){return this.props.id+"-accessibility-id"}get element(){return this._element}render(){this.fieldsSvc=new l.TreeFieldsService(this.props);const{size:t,className:e}=this.props;return r.createElement("div",{id:this.props.id,style:this.props.style?this.props.style:void 0,className:l.classNames("k-treeview",{[`k-treeview-${C[t]||t}`]:t,"k-user-select-none":this.props.draggable,"k-rtl":this.props.dir==="rtl"},e),onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,role:"tree","aria-multiselectable":this.ariaMultiSelectable?!0:void 0,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],ref:i=>this._element=i,tabIndex:this.props.tabIndex},r.createElement("ul",{className:"k-treeview-lines k-treeview-group",role:"group"},this.data.map((i,s)=>r.createElement(b.TreeViewItem,{id:this.props.id+"-item-"+s,item:i,position:g.getNodePosition(s,this.data),itemId:s.toString(),treeGuid:this.treeGuid,animate:this.props.animate,focusedItemId:this.state.focusedItemId,tabbableItemId:this.state.tabbableItemId,fieldsService:this.fieldsSvc,itemUI:this.props.item,checkboxes:this.props.checkboxes,ariaMultiSelectable:this.ariaMultiSelectable,onItemClick:this.onItemClick,onFocusDomElNeeded:this.onFocusDomElNeeded,draggable:this.props.draggable,onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,expandIcons:this.props.expandIcons,iconField:this.props.iconField,onExpandChange:this.onExpandChange,onCheckChange:this.onCheckChange,onContextMenu:this.onContextMenu,key:s,size:t,isRtl:this.props.dir==="rtl"}))))}componentDidUpdate(){this.allowExplicitFocus=!1,this.refocusDueToFocusIdField()}dispatchEventsOnKeyDown(t,e){if(this.fieldsSvc===null)return;const i=()=>this.fieldsSvc&&l.isEnabledAndAllParentsEnabled(this.state.focusedItemId,this.data,this.fieldsSvc);t.keyCode===l.Keys.left&&this.fieldsSvc.expanded(e)&&i()?this.dispatchExpandChange(t,e,this.state.focusedItemId):t.keyCode===l.Keys.right&&!this.fieldsSvc.expanded(e)&&(this.fieldsSvc.hasChildren(e)||l.hasChildren(e,this.props.childrenField))&&i()?this.dispatchExpandChange(t,e,this.state.focusedItemId):t.keyCode===l.Keys.enter&&i()?this.dispatchItemClick(t,e,this.state.focusedItemId):t.keyCode===l.Keys.space&&i()&&(t.preventDefault(),this.dispatchCheckChange(t,e,this.state.focusedItemId))}setFocus(t){if(t&&this.fieldsSvc)if(this.fieldsSvc.focusIdField){const e=this.getItemById(t);this.setState({focusedItemId:t,focusedItemPublicId:this.fieldsSvc.focusId(e)})}else this.setState({focusedItemId:t});else this.setState(e=>({focusedItemId:void 0,focusedItemPublicId:void 0,tabbableItemId:e.focusedItemId}))}getFocusedItem(){return this.state.focusedItemId?this.getItemById(this.state.focusedItemId):void 0}getItemById(t){return l.treeIdUtils.getItemById(t,this.data,this.props.childrenField||o.CHILDREN_FIELD)}dispatchCheckChange(t,e,i){l.dispatchEvent(this.props.onCheckChange,t,this,{item:e,itemHierarchicalIndex:i})}dispatchExpandChange(t,e,i){l.dispatchEvent(this.props.onExpandChange,t,this,{item:e,itemHierarchicalIndex:i})}dispatchItemClick(t,e,i){l.dispatchEvent(this.props.onItemClick,t,this,{item:e,itemHierarchicalIndex:i})}refocusDueToFocusIdField(){if(this.fieldsSvc&&this.fieldsSvc.focusIdField){const t=this.state.focusedItemPublicId;if(t){const e=this.props.getFocusHierarchicalIndex?this.props.getFocusHierarchicalIndex(t):l.resolveItemId(t,this.fieldsSvc.focusIdField,this.data,this.props.childrenField);e!==this.state.focusedItemId&&(this.allowExplicitFocus=!0,this.setState({focusedItemId:e}))}}}get ariaMultiSelectable(){return this.props["aria-multiselectable"]===!0||this.props["aria-multiselectable"]==="true"}get data(){return this.props.data||[]}focusDomItem(t){t.focus()}get guid(){return this.treeGuid}};c.propTypes={data:a.arrayOf(a.any),animate:a.bool,tabIndex:a.number,focusIdField:a.string,getHierarchicalIndexById:a.func,onExpandChange:a.func,onItemClick:a.func,expandField:a.string,selectField:a.string,iconField:a.string,childrenField:a.string,hasChildrenField:a.string,textField:a.string,disableField:a.string,item:a.any,"aria-multiselectable":(t,e,i)=>t[e]!==void 0&&t[e]!==!0&&t[e]!==!1&&t[e]!=="true"&&t[e]!=="false"?new Error("Invalid prop `"+e+"` supplied to `"+i+"`. Validation failed."):null,"aria-label":a.string,"aria-labelledby":a.string,size:a.oneOf([null,"small","medium","large"]),dir:a.string},c.defaultProps={animate:!0,expandField:o.EXPAND_FIELD,selectField:o.SELECT_FIELD,iconField:o.ICON_FIELD,hasChildrenField:o.HAS_CHILDREN_FIELD,childrenField:o.CHILDREN_FIELD,textField:o.TEXT_FIELD,disableField:o.DISABLED_FIELD,checkField:o.CHECK_FIELD,checkIndeterminateField:o.CHECK_INDETERMINATE_FIELD,size:"medium"};let I=c;exports.TreeView=I;
|
package/TreeView.mjs
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import * as o from "react";
|
|
8
|
+
import * as l from "react";
|
|
10
9
|
import a from "prop-types";
|
|
11
10
|
import { treeIdUtils as u, validatePackage as f, TreeFieldsService as g, classNames as F, Keys as d, hasChildren as E, dispatchEvent as p, resolveItemId as b, kendoThemeMaps as C, isEnabledAndAllParentsEnabled as v } from "@progress/kendo-react-common";
|
|
12
11
|
import D from "./utils/getItemIdUponKeyboardNavigation.mjs";
|
|
@@ -14,7 +13,7 @@ import { getNodePosition as x } from "./utils/utils.mjs";
|
|
|
14
13
|
import { TreeViewItem as k } from "./TreeViewItem.mjs";
|
|
15
14
|
import { packageMetadata as S } from "./package-metadata.mjs";
|
|
16
15
|
import { EXPAND_FIELD as y, SELECT_FIELD as w, ICON_FIELD as _, HAS_CHILDREN_FIELD as L, CHILDREN_FIELD as I, TEXT_FIELD as H, DISABLED_FIELD as P, CHECK_FIELD as M, CHECK_INDETERMINATE_FIELD as R } from "./utils/consts.mjs";
|
|
17
|
-
const { sizeMap: T } = C, r = class r extends
|
|
16
|
+
const { sizeMap: T } = C, r = class r extends l.Component {
|
|
18
17
|
constructor(t) {
|
|
19
18
|
super(t), this.state = {
|
|
20
19
|
focusedItemId: void 0,
|
|
@@ -29,23 +28,23 @@ const { sizeMap: T } = C, r = class r extends o.Component {
|
|
|
29
28
|
}, this.onPress = (e, i, s) => {
|
|
30
29
|
this.props.onItemDragStart && this.props.onItemDragStart.call(void 0, { target: this, item: i, itemHierarchicalIndex: s });
|
|
31
30
|
}, this.onDrag = (e, i, s) => {
|
|
32
|
-
const { pageX:
|
|
31
|
+
const { pageX: o, pageY: n, clientX: h, clientY: c } = e;
|
|
33
32
|
this.props.onItemDragOver && this.props.onItemDragOver.call(void 0, {
|
|
34
33
|
target: this,
|
|
35
34
|
item: i,
|
|
36
35
|
itemHierarchicalIndex: s,
|
|
37
|
-
pageX:
|
|
36
|
+
pageX: o,
|
|
38
37
|
pageY: n,
|
|
39
38
|
clientX: h,
|
|
40
39
|
clientY: c
|
|
41
40
|
});
|
|
42
41
|
}, this.onRelease = (e, i, s) => {
|
|
43
|
-
const { pageX:
|
|
42
|
+
const { pageX: o, pageY: n, clientX: h, clientY: c } = e;
|
|
44
43
|
this.props.onItemDragEnd && this.props.onItemDragEnd.call(void 0, {
|
|
45
44
|
target: this,
|
|
46
45
|
item: i,
|
|
47
46
|
itemHierarchicalIndex: s,
|
|
48
|
-
pageX:
|
|
47
|
+
pageX: o,
|
|
49
48
|
pageY: n,
|
|
50
49
|
clientX: h,
|
|
51
50
|
clientY: c
|
|
@@ -64,14 +63,14 @@ const { sizeMap: T } = C, r = class r extends o.Component {
|
|
|
64
63
|
}
|
|
65
64
|
}, this.onContextMenu = (e, i, s) => {
|
|
66
65
|
if (this.props.onContextMenu) {
|
|
67
|
-
const
|
|
66
|
+
const o = {
|
|
68
67
|
target: this,
|
|
69
68
|
syntheticEvent: e,
|
|
70
69
|
nativeEvent: e.nativeEvent,
|
|
71
70
|
item: i,
|
|
72
71
|
itemID: s
|
|
73
72
|
};
|
|
74
|
-
this.props.onContextMenu.call(void 0,
|
|
73
|
+
this.props.onContextMenu.call(void 0, o);
|
|
75
74
|
}
|
|
76
75
|
}, f(S);
|
|
77
76
|
}
|
|
@@ -90,7 +89,7 @@ const { sizeMap: T } = C, r = class r extends o.Component {
|
|
|
90
89
|
render() {
|
|
91
90
|
this.fieldsSvc = new g(this.props);
|
|
92
91
|
const { size: t, className: e } = this.props;
|
|
93
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ l.createElement(
|
|
94
93
|
"div",
|
|
95
94
|
{
|
|
96
95
|
id: this.props.id,
|
|
@@ -114,7 +113,7 @@ const { sizeMap: T } = C, r = class r extends o.Component {
|
|
|
114
113
|
ref: (i) => this._element = i,
|
|
115
114
|
tabIndex: this.props.tabIndex
|
|
116
115
|
},
|
|
117
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ l.createElement("ul", { className: "k-treeview-lines k-treeview-group", role: "group" }, this.data.map((i, s) => /* @__PURE__ */ l.createElement(
|
|
118
117
|
k,
|
|
119
118
|
{
|
|
120
119
|
id: this.props.id + "-item-" + s,
|
package/TreeViewDragAnalyzer.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./utils/consts.js"),s=6;class r{constructor(t){this.event=t,this.initialized=!1,this.destItemId="",this.destTreeViewGuid="",this.itemId=t.itemHierarchicalIndex,this.treeViewGuid=t.target.guid}init(){return this.initialized||(this.setDestimationMeta(document.elementFromPoint(this.event.clientX,this.event.clientY)),this.initialized=!0),this}get isDropAllowed(){return this.initialized&&this.destItemId&&this.destTreeViewGuid?!`${this.destTreeViewGuid}_${this.destItemId}_`.startsWith(`${this.treeViewGuid}_${this.itemId}_`):!1}get destinationMeta(){return{itemHierarchicalIndex:this.destItemId,treeViewGuid:this.destTreeViewGuid}}getDropOperation(){if(this.initialized&&this.isDropAllowed){const{top:t,height:e}=this.destDomNodeWithMeta.getBoundingClientRect();return t+e-this.event.clientY<s?"after":this.event.clientY-t<s?"before":"child"}}setDestimationMeta(t){let e=t;for(;e&&!e[i.DOM_KENDO_ITEM_ID_FIELD];)e=e.parentNode;e&&e[i.DOM_KENDO_ITEM_ID_FIELD]&&(this.destDomNodeWithMeta=e,this.destItemId=e[i.DOM_KENDO_ITEM_ID_FIELD],this.destTreeViewGuid=e[i.DOM_KENDO_TREEVIEW_GUID_FIELD])}}exports.TreeViewDragAnalyzer=r;
|
package/TreeViewDragAnalyzer.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { DOM_KENDO_ITEM_ID_FIELD as i, DOM_KENDO_TREEVIEW_GUID_FIELD as r } from "./utils/consts.mjs";
|
|
10
9
|
const s = 6;
|
|
11
10
|
class h {
|
package/TreeViewDragClue.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),i=require("@progress/kendo-react-common"),a=require("@progress/kendo-svg-icons");function u(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>s[e]})}}return t.default=s,Object.freeze(t)}const n=u(p),l=class l extends n.PureComponent{constructor(){super(...arguments),this.state={visible:!1,top:0,left:0,text:"",operationClassName:"cancel"}}render(){const t={top:this.state.top+"px",left:this.state.left+"px"};return this.state.visible&&n.createElement("div",{className:"k-header k-drag-clue",style:{...this.props.style,...t}},n.createElement(i.IconWrap,{className:i.classNames("k-drag-status"),name:this.state.operationClassName&&i.toIconName(this.state.operationClassName),icon:this.state.operationClassName==="k-i-plus"?a.plusIcon:this.state.operationClassName==="k-i-insert-up"?a.insertTopIcon:this.state.operationClassName==="k-i-insert-down"?a.insertBottomIcon:this.state.operationClassName==="k-i-insert-middle"?a.insertMiddleIcon:a.cancelIcon}),this.state.text)}show(t,e,o,c){this.setState({visible:!0,top:t,left:e,text:o,operationClassName:c})}hide(){this.setState({visible:!1})}};l.defaultProps={style:{display:"block",position:"absolute",zIndex:2e4,padding:"4px 6px"}};let r=l;exports.TreeViewDragClue=r;
|
package/TreeViewDragClue.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as s from "react";
|
|
10
9
|
import { IconWrap as l, classNames as r, toIconName as p } from "@progress/kendo-react-common";
|
|
11
10
|
import { plusIcon as c, insertTopIcon as m, insertBottomIcon as d, insertMiddleIcon as h, cancelIcon as u } from "@progress/kendo-svg-icons";
|
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
|
|
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),d=class d 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.renderSubitemsIfApplicable(),t=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:n=>this.itemElement=n},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},t):t),e&&(this.props.animate?i.createElement(m.Reveal,{transitionEnterDuration:200,transitionExitDuration:200,style:{display:"block"},children:e}):e))}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(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}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}}};d.defaultProps={position:"top",iconField:"svgIcon"};let a=d;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
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as t from "react";
|
|
10
|
-
import { classNames as n, Draggable as
|
|
9
|
+
import { classNames as n, Draggable as p, hasChildren as o, IconWrap as d, isItemExpandedAndWithChildren as l, treeIdUtils as m, withIdHOC as I, kendoThemeMaps as u } from "@progress/kendo-react-common";
|
|
11
10
|
import { caretAltDownIcon as f, caretAltLeftIcon as b, caretAltRightIcon as g } from "@progress/kendo-svg-icons";
|
|
12
11
|
import { Reveal as k } from "@progress/kendo-react-animation";
|
|
13
12
|
import { DOM_KENDO_ITEM_ID_FIELD as x, DOM_KENDO_TREEVIEW_GUID_FIELD as E } from "./utils/consts.mjs";
|
|
@@ -48,7 +47,7 @@ const { sizeMap: v } = u, S = t.createContext(
|
|
|
48
47
|
"aria-disabled": this.disabled ? !0 : void 0,
|
|
49
48
|
ref: (s) => this.itemElement = s
|
|
50
49
|
},
|
|
51
|
-
/* @__PURE__ */ t.createElement("span", { className: `k-treeview-${this.props.position}`, ref: this.assignDraggableMeta }, this.renderExpandIcon(), this.renderCheckbox(), this.props.draggable ? /* @__PURE__ */ t.createElement(
|
|
50
|
+
/* @__PURE__ */ t.createElement("span", { className: `k-treeview-${this.props.position}`, ref: this.assignDraggableMeta }, this.renderExpandIcon(), this.renderCheckbox(), this.props.draggable ? /* @__PURE__ */ t.createElement(p, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease }, i) : i),
|
|
52
51
|
e && (this.props.animate ? /* @__PURE__ */ t.createElement(
|
|
53
52
|
k,
|
|
54
53
|
{
|
|
@@ -108,7 +107,7 @@ const { sizeMap: v } = u, S = t.createContext(
|
|
|
108
107
|
}
|
|
109
108
|
renderSubitemsIfApplicable() {
|
|
110
109
|
const e = this.fieldsSvc.children(this.item);
|
|
111
|
-
return
|
|
110
|
+
return l(this.item, this.fieldsSvc) ? /* @__PURE__ */ t.createElement("ul", { className: "k-treeview-group", role: "group" }, e.map((i, s) => /* @__PURE__ */ t.createElement(
|
|
112
111
|
c,
|
|
113
112
|
{
|
|
114
113
|
item: i,
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@progress/kendo-react-common"),I=require("./utils/consts.js");function g(i,t,n,d={},o){if(!n||!n.length)return[];const{ids:l,idField:r}=x(t),c=r?s.getNestedValue(r,i.item):i.itemHierarchicalIndex,u=l.indexOf(c),a=u===-1,h=o||I.CHILDREN_FIELD;let e;return d.singleMode?e=a?[c]:[]:(e=l.slice(),a?e.push(c):e.splice(u,1),d.checkChildren&&k(i.item,i.itemHierarchicalIndex,a,r,h,e),d.checkParents&&m(i.itemHierarchicalIndex,a,r,h,e,n)),s.isArray(t)?e:Object.assign({},t,{ids:e})}function x(i){let t,n;return s.isArray(i)?t=i:(t=i.ids||[],n=i.idField),{ids:t,idField:n}}function k(i,t,n,d,o,l){s.getAllDirectIndirectChildrenIds(i,t,o,d).forEach(r=>{n&&l.indexOf(r)===-1?l.push(r):!n&&l.indexOf(r)>-1&&l.splice(l.indexOf(r),1)})}function m(i,t,n,d,o,l){const r=h();let c=r.next();t?u():a();function u(){for(;!c.done;){const{id:e,item:f}=c.value;if(o.indexOf(e)===-1&&s.areAllDirectChildrenChecked(f,e,n,d,o))o.push(e),c=r.next();else break}}function a(){for(;!c.done;){const{id:e}=c.value,f=o.indexOf(e);if(f>-1)o.splice(f,1),c=r.next();else break}}function*h(){if(n){const e=s.getAllParents(i,d,l);for(let f=e.length-1;f>-1;f--)yield{id:s.getNestedValue(n,e[f]),item:t?e[f]:void 0}}else{let e=s.treeIdUtils.getDirectParentId(i);for(;e;)yield{id:e,item:t?s.treeIdUtils.getItemById(e,l,d):void 0},e=s.treeIdUtils.getDirectParentId(e)}}}exports.handleTreeViewCheckChange=g;
|
|
@@ -5,34 +5,33 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { getNestedValue as I, isArray as x, getAllDirectIndirectChildrenIds as m, areAllDirectChildrenChecked as p, getAllParents as g, treeIdUtils as u } from "@progress/kendo-react-common";
|
|
10
9
|
import { CHILDREN_FIELD as O } from "./utils/consts.mjs";
|
|
11
10
|
function b(i, n, t, s = {}, d) {
|
|
12
11
|
if (!t || !t.length)
|
|
13
12
|
return [];
|
|
14
|
-
const { ids:
|
|
13
|
+
const { ids: l, idField: r } = k(n), c = r ? I(r, i.item) : i.itemHierarchicalIndex, h = l.indexOf(c), o = h === -1, a = d || O;
|
|
15
14
|
let e;
|
|
16
|
-
return s.singleMode ? e = o ? [c] : [] : (e =
|
|
15
|
+
return s.singleMode ? e = o ? [c] : [] : (e = l.slice(), o ? e.push(c) : e.splice(h, 1), s.checkChildren && C(i.item, i.itemHierarchicalIndex, o, r, a, e), s.checkParents && D(i.itemHierarchicalIndex, o, r, a, e, t)), x(n) ? e : Object.assign({}, n, { ids: e });
|
|
17
16
|
}
|
|
18
17
|
function k(i) {
|
|
19
18
|
let n, t;
|
|
20
19
|
return x(i) ? n = i : (n = i.ids || [], t = i.idField), { ids: n, idField: t };
|
|
21
20
|
}
|
|
22
|
-
function C(i, n, t, s, d,
|
|
23
|
-
m(i, n, d, s).forEach((
|
|
24
|
-
t &&
|
|
21
|
+
function C(i, n, t, s, d, l) {
|
|
22
|
+
m(i, n, d, s).forEach((r) => {
|
|
23
|
+
t && l.indexOf(r) === -1 ? l.push(r) : !t && l.indexOf(r) > -1 && l.splice(l.indexOf(r), 1);
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
|
-
function D(i, n, t, s, d,
|
|
28
|
-
const
|
|
29
|
-
let c =
|
|
26
|
+
function D(i, n, t, s, d, l) {
|
|
27
|
+
const r = a();
|
|
28
|
+
let c = r.next();
|
|
30
29
|
n ? h() : o();
|
|
31
30
|
function h() {
|
|
32
31
|
for (; !c.done; ) {
|
|
33
32
|
const { id: e, item: f } = c.value;
|
|
34
33
|
if (d.indexOf(e) === -1 && p(f, e, t, s, d))
|
|
35
|
-
d.push(e), c =
|
|
34
|
+
d.push(e), c = r.next();
|
|
36
35
|
else
|
|
37
36
|
break;
|
|
38
37
|
}
|
|
@@ -41,14 +40,14 @@ function D(i, n, t, s, d, r) {
|
|
|
41
40
|
for (; !c.done; ) {
|
|
42
41
|
const { id: e } = c.value, f = d.indexOf(e);
|
|
43
42
|
if (f > -1)
|
|
44
|
-
d.splice(f, 1), c =
|
|
43
|
+
d.splice(f, 1), c = r.next();
|
|
45
44
|
else
|
|
46
45
|
break;
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
function* a() {
|
|
50
49
|
if (t) {
|
|
51
|
-
const e = g(i, s,
|
|
50
|
+
const e = g(i, s, l);
|
|
52
51
|
for (let f = e.length - 1; f > -1; f--)
|
|
53
52
|
yield { id: I(t, e[f]), item: n ? e[f] : void 0 };
|
|
54
53
|
} else {
|
|
@@ -56,7 +55,7 @@ function D(i, n, t, s, d, r) {
|
|
|
56
55
|
for (; e; )
|
|
57
56
|
yield {
|
|
58
57
|
id: e,
|
|
59
|
-
item: n ? u.getItemById(e,
|
|
58
|
+
item: n ? u.getItemById(e, l, s) : void 0
|
|
60
59
|
}, e = u.getDirectParentId(e);
|
|
61
60
|
}
|
|
62
61
|
}
|
package/index.js
CHANGED
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
8
|
+
"use client";
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TreeView.js"),t=require("./processTreeViewItems.js"),o=require("./moveTreeViewItem.js"),n=require("./handleTreeViewCheckChange.js"),a=require("./TreeViewDragClue.js"),s=require("./TreeViewDragAnalyzer.js"),T=require("./TreeViewItem.js"),w=require("./utils/getItemIdUponKeyboardNavigation.js"),r=require("@progress/kendo-react-common"),i=r.withIdHOC(e.TreeView);i.displayName="KendoReactTreeView";exports.TreeViewClassComponent=e.TreeView;exports.processTreeViewItems=t.processTreeViewItems;exports.moveTreeViewItem=o.moveTreeViewItem;exports.handleTreeViewCheckChange=n.handleTreeViewCheckChange;exports.TreeViewDragClue=a.TreeViewDragClue;exports.TreeViewDragAnalyzer=s.TreeViewDragAnalyzer;exports.TreeViewItemPropsContext=T.TreeViewItemPropsContext;exports.getItemIdUponKeyboardNavigation=w;Object.defineProperty(exports,"FieldsService",{enumerable:!0,get:()=>r.TreeFieldsService});exports.TreeView=i;
|
package/index.mjs
CHANGED
|
@@ -10,9 +10,9 @@ import { TreeView as e } from "./TreeView.mjs";
|
|
|
10
10
|
import { processTreeViewItems as p } from "./processTreeViewItems.mjs";
|
|
11
11
|
import { moveTreeViewItem as w } from "./moveTreeViewItem.mjs";
|
|
12
12
|
import { handleTreeViewCheckChange as f } from "./handleTreeViewCheckChange.mjs";
|
|
13
|
-
import { TreeViewDragClue as
|
|
13
|
+
import { TreeViewDragClue as n } from "./TreeViewDragClue.mjs";
|
|
14
14
|
import { TreeViewDragAnalyzer as d } from "./TreeViewDragAnalyzer.mjs";
|
|
15
|
-
import { TreeViewItemPropsContext as
|
|
15
|
+
import { TreeViewItemPropsContext as C } from "./TreeViewItem.mjs";
|
|
16
16
|
import { default as I } from "./utils/getItemIdUponKeyboardNavigation.mjs";
|
|
17
17
|
import { withIdHOC as r } from "@progress/kendo-react-common";
|
|
18
18
|
import { TreeFieldsService as h } from "@progress/kendo-react-common";
|
|
@@ -23,8 +23,8 @@ export {
|
|
|
23
23
|
o as TreeView,
|
|
24
24
|
e as TreeViewClassComponent,
|
|
25
25
|
d as TreeViewDragAnalyzer,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
n as TreeViewDragClue,
|
|
27
|
+
C as TreeViewItemPropsContext,
|
|
28
28
|
I as getItemIdUponKeyboardNavigation,
|
|
29
29
|
f as handleTreeViewCheckChange,
|
|
30
30
|
w as moveTreeViewItem,
|
package/moveTreeViewItem.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@progress/kendo-react-common"),S=require("./utils/consts.js");function T(u,n,l,o,e,v){const f=v||S.CHILDREN_FIELD;if(!y())return s();const d=t.treeIdUtils.getItemById(u,n,f);if(!d)return s();if(!e||e===n){if(!R())return s();const m=t.removeItem(u,f,n),r=t.addItem(d,l,f,t.treeIdUtils.getDecrementedItemIdAfterRemoval(u,o),m);return e?{sourceData:r,targetData:r}:r}const i=t.removeItem(u,f,n),p=t.addItem(d,l,f,o,e);return{sourceData:i,targetData:p};function s(){return e?{sourceData:n,targetData:e}:n}function R(){return!`${o}_`.startsWith(`${u}_`)}function y(){if(!n||!n.length||!u||!o||e&&!e.length)return!1;const m=!e||e===n?n:e;return!!t.treeIdUtils.getItemById(o,m,f)}}exports.moveTreeViewItem=T;
|
package/moveTreeViewItem.mjs
CHANGED
|
@@ -5,43 +5,42 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!y())
|
|
8
|
+
import { treeIdUtils as s, removeItem as R, addItem as l } from "@progress/kendo-react-common";
|
|
9
|
+
import { CHILDREN_FIELD as C } from "./utils/consts.mjs";
|
|
10
|
+
function N(u, f, v, o, n, r) {
|
|
11
|
+
const t = r || C;
|
|
12
|
+
if (!B())
|
|
14
13
|
return p();
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
14
|
+
const e = s.getItemById(u, f, t);
|
|
15
|
+
if (!e)
|
|
17
16
|
return p();
|
|
18
17
|
if (!n || n === f) {
|
|
19
|
-
if (!
|
|
18
|
+
if (!y())
|
|
20
19
|
return p();
|
|
21
|
-
const d =
|
|
22
|
-
|
|
20
|
+
const d = R(u, t, f), m = l(
|
|
21
|
+
e,
|
|
23
22
|
v,
|
|
24
23
|
t,
|
|
25
|
-
s.getDecrementedItemIdAfterRemoval(u,
|
|
24
|
+
s.getDecrementedItemIdAfterRemoval(u, o),
|
|
26
25
|
d
|
|
27
26
|
);
|
|
28
27
|
return n ? { sourceData: m, targetData: m } : m;
|
|
29
28
|
}
|
|
30
|
-
const F =
|
|
29
|
+
const F = R(u, t, f), _ = l(e, v, t, o, n);
|
|
31
30
|
return { sourceData: F, targetData: _ };
|
|
32
31
|
function p() {
|
|
33
32
|
return n ? { sourceData: f, targetData: n } : f;
|
|
34
33
|
}
|
|
35
|
-
function i() {
|
|
36
|
-
return !`${e}_`.startsWith(`${u}_`);
|
|
37
|
-
}
|
|
38
34
|
function y() {
|
|
39
|
-
|
|
35
|
+
return !`${o}_`.startsWith(`${u}_`);
|
|
36
|
+
}
|
|
37
|
+
function B() {
|
|
38
|
+
if (!f || !f.length || !u || !o || n && !n.length)
|
|
40
39
|
return !1;
|
|
41
40
|
const d = !n || n === f ? f : n;
|
|
42
|
-
return !!s.getItemById(
|
|
41
|
+
return !!s.getItemById(o, d, t);
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
export {
|
|
46
|
-
|
|
45
|
+
N as moveTreeViewItem
|
|
47
46
|
};
|
package/package-metadata.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-treeview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1738077092,version:"9.4.0-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
const e = {
|
|
10
9
|
name: "@progress/kendo-react-treeview",
|
|
11
10
|
productName: "KendoReact",
|
|
12
11
|
productCode: "KENDOUIREACT",
|
|
13
12
|
productCodes: ["KENDOUIREACT"],
|
|
14
|
-
publishDate:
|
|
15
|
-
version: "9.4.0-develop.
|
|
13
|
+
publishDate: 1738077092,
|
|
14
|
+
version: "9.4.0-develop.7",
|
|
16
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
17
16
|
};
|
|
18
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-treeview",
|
|
3
|
-
"version": "9.4.0-develop.
|
|
3
|
+
"version": "9.4.0-develop.7",
|
|
4
4
|
"description": "React TreeView displays hierarchical data in a traditional tree structure, supports user interaction. KendoReact TreeView package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-licensing": "^1.3.4",
|
|
29
|
-
"@progress/kendo-react-animation": "9.4.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "9.4.0-develop.
|
|
29
|
+
"@progress/kendo-react-animation": "9.4.0-develop.7",
|
|
30
|
+
"@progress/kendo-react-common": "9.4.0-develop.7",
|
|
31
31
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
32
32
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
33
33
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"package": {
|
|
54
54
|
"productName": "KendoReact",
|
|
55
55
|
"productCode": "KENDOUIREACT",
|
|
56
|
-
"publishDate":
|
|
56
|
+
"publishDate": 1738077092,
|
|
57
57
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
58
58
|
}
|
|
59
59
|
},
|
package/processTreeViewItems.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@progress/kendo-react-common"),d=require("./utils/consts.js");function C(n,t){if(!n||!n.length)return[];let e=n;const l=t.cloneField||"cloned",c=t.expandField||d.EXPAND_FIELD,s=t.selectField||d.SELECT_FIELD,r=t.checkField||d.CHECK_FIELD,i=t.childrenField||d.CHILDREN_FIELD;return e=o(e,c,t.expand,l,i),e=o(e,s,t.select,l,i),e=o(e,r,t.check,l,i),m(e,i,t.check),e}function o(n,t,e,l,c){if(e){const{ids:s,field:r}=E(e,t),i=!f.isArray(e)&&e.idField?f.resolveItemsIds(s,e.idField,n,c):s;return F(n,i,r,l,c)}return n}function E(n,t){let e,l;return f.isArray(n)?(e=n,l=t):(e=n.ids||[],l=n.operationField||t),{ids:e,field:l}}function F(n,t,e,l,c){let s=n;return t.forEach(r=>{s=f.updateItem(s,r,i=>g(e,i),l,c)}),s}function g(n,t){const e=(n||"").split(".");let l=t;for(let c=0;c<e.length;c++){const s=e[c];if(c===e.length-1)l[s]=!0;else if(l[s]!==void 0)l[s]={...l[s]},l=l[s];else return}}function m(n,t,e){if(e&&!f.isArray(e)&&e.applyCheckIndeterminate){const{field:l}=E(e,d.CHECK_FIELD),c=e.checkIndeterminateField||d.CHECK_INDETERMINATE_FIELD;for(let s=0;s<n.length;s++){const r=n[s],i=r[t];i&&I(i,f.getNestedValue(l,r)?[]:[r],t,l,c)}}}function I(n,t,e,l,c){let s=!1;for(let r=0;r<n.length;r++){const i=n[r];if(f.getNestedValue(l,i)){if(!s)for(let u=0;u<t.length;u++)g(c,t[u]);s=!0,i[e]&&I(i[e],[],e,l,c)}else i[e]&&I(i[e],s?[i]:t.concat([i]),e,l,c)}}exports.processTreeViewItems=C;
|
package/processTreeViewItems.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { isArray as I, resolveItemsIds as g, updateItem as C, getNestedValue as E } from "@progress/kendo-react-common";
|
|
10
9
|
import { EXPAND_FIELD as D, SELECT_FIELD as L, CHECK_FIELD as o, CHILDREN_FIELD as N, CHECK_INDETERMINATE_FIELD as _ } from "./utils/consts.mjs";
|
|
11
10
|
function A(n, t) {
|
package/utils/consts.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E="expanded",D="text",I="disabled",_="items",L="hasChildren",e="selected",t="svgIcon",F="checked",n="checkIndeterminate",c="_kendoItemId",o="_kendoTreeViewGuid";exports.CHECK_FIELD=F;exports.CHECK_INDETERMINATE_FIELD=n;exports.CHILDREN_FIELD=_;exports.DISABLED_FIELD=I;exports.DOM_KENDO_ITEM_ID_FIELD=c;exports.DOM_KENDO_TREEVIEW_GUID_FIELD=o;exports.EXPAND_FIELD=E;exports.HAS_CHILDREN_FIELD=L;exports.ICON_FIELD=t;exports.SELECT_FIELD=e;exports.TEXT_FIELD=D;
|
package/utils/consts.mjs
CHANGED
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"
|
|
9
|
-
const E = "expanded", I = "text", e = "disabled", D = "items", _ = "hasChildren", t = "selected", n = "svgIcon", c = "checked", s = "checkIndeterminate", o = "_kendoItemId", L = "_kendoTreeViewGuid";
|
|
8
|
+
const E = "expanded", I = "text", D = "disabled", e = "items", _ = "hasChildren", t = "selected", n = "svgIcon", c = "checked", s = "checkIndeterminate", o = "_kendoItemId", L = "_kendoTreeViewGuid";
|
|
10
9
|
export {
|
|
11
10
|
c as CHECK_FIELD,
|
|
12
11
|
s as CHECK_INDETERMINATE_FIELD,
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
e as CHILDREN_FIELD,
|
|
13
|
+
D as DISABLED_FIELD,
|
|
15
14
|
o as DOM_KENDO_ITEM_ID_FIELD,
|
|
16
15
|
L as DOM_KENDO_TREEVIEW_GUID_FIELD,
|
|
17
16
|
E as EXPAND_FIELD,
|
|
@@ -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
|
|
8
|
+
"use strict";const e=require("@progress/kendo-react-common");function p(d,t,n,l,r){switch(l){case e.Keys.left:return g();case e.Keys.right:return I();case e.Keys.up:return h();case e.Keys.down:return U();case e.Keys.home:return e.treeIdUtils.ZERO_LEVEL_ZERO_NODE_ID;case e.Keys.end:return c();default:return t}function g(){return e.treeIdUtils.isIdZeroLevel(t)||r.expanded(d)&&e.isEnabledAndAllParentsEnabled(t,n,r)?t:e.treeIdUtils.getDirectParentId(t)}function I(){return e.isItemExpandedAndWithChildren(d,r)?e.treeIdUtils.getFirstChildId(t):t}function h(){const o=Number(e.treeIdUtils.getShortId(t)),i=e.treeIdUtils.getDirectParentId(t);return o?a(e.treeIdUtils.createId(o-1,i),n,r):e.treeIdUtils.isIdZeroLevel(t)?t:i}function U(){return e.isItemExpandedAndWithChildren(d,r)?e.treeIdUtils.getFirstChildId(t):u(t,n,r)||t}function c(){let o=(n.length-1).toString(),i=n[n.length-1],s;for(;e.isItemExpandedAndWithChildren(i,r);)s=i[r.getChildrenField()],o=e.treeIdUtils.createId(s.length-1,o),i=s[s.length-1];return o}}function u(d,t,n){const l=e.treeIdUtils.getDirectParentId(d),r=l?e.treeIdUtils.getItemById(l,t,n.getChildrenField()):void 0,g=r?r[n.getChildrenField()]:t,I=Number(e.treeIdUtils.getShortId(d));return I<g.length-1?e.treeIdUtils.createId(I+1,l):r?u(l,t,n):void 0}function a(d,t,n){const l=e.treeIdUtils.getItemById(d,t,n.getChildrenField());return e.isItemExpandedAndWithChildren(l,n)?a(e.treeIdUtils.createId(l[n.getChildrenField()].length-1,d),t,n):d}module.exports=p;
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import { Keys as a, treeIdUtils as n, isEnabledAndAllParentsEnabled as E, isItemExpandedAndWithChildren as c } from "@progress/kendo-react-common";
|
|
8
|
+
import { Keys as a, treeIdUtils as n, isEnabledAndAllParentsEnabled as s, isItemExpandedAndWithChildren as c } from "@progress/kendo-react-common";
|
|
10
9
|
function F(o, e, t, g, r) {
|
|
11
10
|
switch (g) {
|
|
12
11
|
case a.left:
|
|
@@ -14,32 +13,32 @@ function F(o, e, t, g, r) {
|
|
|
14
13
|
case a.right:
|
|
15
14
|
return l();
|
|
16
15
|
case a.up:
|
|
17
|
-
return s();
|
|
18
|
-
case a.down:
|
|
19
16
|
return y();
|
|
17
|
+
case a.down:
|
|
18
|
+
return C();
|
|
20
19
|
case a.home:
|
|
21
20
|
return n.ZERO_LEVEL_ZERO_NODE_ID;
|
|
22
21
|
case a.end:
|
|
23
|
-
return
|
|
22
|
+
return E();
|
|
24
23
|
default:
|
|
25
24
|
return e;
|
|
26
25
|
}
|
|
27
26
|
function I() {
|
|
28
27
|
return n.isIdZeroLevel(e) || // For expanded disabled items, navigate directly to the parent.
|
|
29
28
|
// Collapse cannot happen because an event is not fired to the client.
|
|
30
|
-
r.expanded(o) &&
|
|
29
|
+
r.expanded(o) && s(e, t, r) ? e : n.getDirectParentId(e);
|
|
31
30
|
}
|
|
32
31
|
function l() {
|
|
33
32
|
return c(o, r) ? n.getFirstChildId(e) : e;
|
|
34
33
|
}
|
|
35
|
-
function
|
|
34
|
+
function y() {
|
|
36
35
|
const d = Number(n.getShortId(e)), u = n.getDirectParentId(e);
|
|
37
36
|
return d ? i(n.createId(d - 1, u), t, r) : n.isIdZeroLevel(e) ? e : u;
|
|
38
37
|
}
|
|
39
|
-
function
|
|
38
|
+
function C() {
|
|
40
39
|
return c(o, r) ? n.getFirstChildId(e) : p(e, t, r) || e;
|
|
41
40
|
}
|
|
42
|
-
function
|
|
41
|
+
function E() {
|
|
43
42
|
let d = (t.length - 1).toString(), u = t[t.length - 1], h;
|
|
44
43
|
for (; c(u, r); )
|
|
45
44
|
h = u[r.getChildrenField()], d = n.createId(h.length - 1, d), u = h[h.length - 1];
|
package/utils/utils.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=(t,e)=>t===e.length-1,s=(t,e)=>{const o=n(t,e);return t===0&&!o?"top":o?"bot":"mid"};exports.getNodePosition=s;
|
package/utils/utils.mjs
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
const o = (t, e)
|
|
10
|
-
|
|
11
|
-
return t === 0 && !n ? "top" : n ? "bot" : "mid";
|
|
8
|
+
const n = (t, e) => t === e.length - 1, s = (t, e) => {
|
|
9
|
+
const o = n(t, e);
|
|
10
|
+
return t === 0 && !o ? "top" : o ? "bot" : "mid";
|
|
12
11
|
};
|
|
13
12
|
export {
|
|
14
13
|
s as getNodePosition
|