@progress/kendo-vue-treeview 6.4.1 → 6.5.0-develop.1
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.mjs +21 -21
- package/TreeViewItem.mjs +5 -5
- package/dist/cdn/js/kendo-vue-treeview.js +1 -1
- package/handleTreeViewCheckChange.mjs +5 -5
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +4 -4
- package/utils/getItemIdUponKeyboardNavigation.mjs +1 -1
- package/utils/itemUtils.mjs +7 -7
package/TreeView.mjs
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as r, createVNode as o } from "vue";
|
|
9
|
-
import {
|
|
9
|
+
import { Keys as d, canUseDOM as h, classNames as u, kendoThemeMaps as m, templateRendering as I, getListeners as p, validatePackage as f, guid as g, isRtl as b } from "@progress/kendo-vue-common";
|
|
10
10
|
import F from "./utils/getItemIdUponKeyboardNavigation.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { resolveItemId as E, isEnabledAndAllParentsEnabled as C, hasChildren as k } from "./utils/itemUtils.mjs";
|
|
12
12
|
import { TreeViewItem as S } from "./TreeViewItem.mjs";
|
|
13
|
-
import {
|
|
13
|
+
import { getItemById as x, ZERO_LEVEL_ZERO_NODE_ID as y } from "./utils/itemIdUtils.mjs";
|
|
14
14
|
import D from "./utils/FieldsService.mjs";
|
|
15
15
|
import { packageMetadata as $ } from "./package-metadata.mjs";
|
|
16
|
-
import {
|
|
16
|
+
import { CHECK_INDETERMINATE_FIELD as v, CHECK_FIELD as w, DISABLED_FIELD as L, TEXT_FIELD as R, HAS_CHILDREN_FIELD as T, CHILDREN_FIELD as c, SELECT_FIELD as _, EXPAND_FIELD as H } from "./utils/consts.mjs";
|
|
17
17
|
const {
|
|
18
18
|
sizeMap: B
|
|
19
|
-
} =
|
|
19
|
+
} = m, G = /* @__PURE__ */ r({
|
|
20
20
|
name: "KendoTreeView",
|
|
21
21
|
emits: {
|
|
22
22
|
blur: null,
|
|
@@ -42,11 +42,11 @@ const {
|
|
|
42
42
|
getFocusHierarchicalIndex: Function,
|
|
43
43
|
expandField: {
|
|
44
44
|
type: String,
|
|
45
|
-
default:
|
|
45
|
+
default: H
|
|
46
46
|
},
|
|
47
47
|
selectField: {
|
|
48
48
|
type: String,
|
|
49
|
-
default:
|
|
49
|
+
default: _
|
|
50
50
|
},
|
|
51
51
|
childrenField: {
|
|
52
52
|
type: String,
|
|
@@ -54,7 +54,7 @@ const {
|
|
|
54
54
|
},
|
|
55
55
|
hasChildrenField: {
|
|
56
56
|
type: String,
|
|
57
|
-
default:
|
|
57
|
+
default: T
|
|
58
58
|
},
|
|
59
59
|
expandIcons: Boolean,
|
|
60
60
|
checkboxes: Boolean,
|
|
@@ -64,15 +64,15 @@ const {
|
|
|
64
64
|
},
|
|
65
65
|
disableField: {
|
|
66
66
|
type: String,
|
|
67
|
-
default:
|
|
67
|
+
default: L
|
|
68
68
|
},
|
|
69
69
|
checkField: {
|
|
70
70
|
type: String,
|
|
71
|
-
default:
|
|
71
|
+
default: w
|
|
72
72
|
},
|
|
73
73
|
checkIndeterminateField: {
|
|
74
74
|
type: String,
|
|
75
|
-
default:
|
|
75
|
+
default: v
|
|
76
76
|
},
|
|
77
77
|
item: [Object, String, Function],
|
|
78
78
|
ariaMultiSelectable: [String, Boolean],
|
|
@@ -91,11 +91,11 @@ const {
|
|
|
91
91
|
currentRtl: !1,
|
|
92
92
|
focusedItemId: void 0,
|
|
93
93
|
focusedItemPublicId: void 0,
|
|
94
|
-
tabbableItemId:
|
|
94
|
+
tabbableItemId: y
|
|
95
95
|
};
|
|
96
96
|
},
|
|
97
97
|
mounted() {
|
|
98
|
-
this.currentRtl =
|
|
98
|
+
this.currentRtl = b(this.$el);
|
|
99
99
|
},
|
|
100
100
|
computed: {
|
|
101
101
|
treeGuid() {
|
|
@@ -103,7 +103,7 @@ const {
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
created() {
|
|
106
|
-
|
|
106
|
+
f($), this.allowExplicitFocus = !1, this.innerId = g();
|
|
107
107
|
},
|
|
108
108
|
updated() {
|
|
109
109
|
this.allowExplicitFocus = !1, this.refocusDueToFocusIdField();
|
|
@@ -114,7 +114,7 @@ const {
|
|
|
114
114
|
size: e
|
|
115
115
|
} = this.$props;
|
|
116
116
|
return o("div", {
|
|
117
|
-
class:
|
|
117
|
+
class: u("k-treeview", {
|
|
118
118
|
[`k-treeview-${B[e] || e}`]: e,
|
|
119
119
|
"k-user-select-none": this.draggable,
|
|
120
120
|
"k-rtl": this.currentRtl
|
|
@@ -133,7 +133,7 @@ const {
|
|
|
133
133
|
class: "k-treeview-lines k-treeview-group",
|
|
134
134
|
role: "tree"
|
|
135
135
|
}, [this.dataItems.map(function(t, i) {
|
|
136
|
-
const s =
|
|
136
|
+
const s = I.call(this, this.item, p.call(this));
|
|
137
137
|
return o(S, {
|
|
138
138
|
item: t,
|
|
139
139
|
itemId: i.toString(),
|
|
@@ -219,7 +219,7 @@ const {
|
|
|
219
219
|
clearTimeout(this.blurRequest), this.focusedItemId === void 0 && this.dataItems.length && this.setFocus(this.tabbableItemId), this.$emit("focus", e);
|
|
220
220
|
},
|
|
221
221
|
onBlur(e) {
|
|
222
|
-
clearTimeout(this.blurRequest),
|
|
222
|
+
clearTimeout(this.blurRequest), h && (this.blurRequest = window.setTimeout(() => this.setFocus(void 0), 0)), this.$emit("blur", e);
|
|
223
223
|
},
|
|
224
224
|
onKeyDown(e) {
|
|
225
225
|
const t = this.getFocusedItem();
|
|
@@ -230,8 +230,8 @@ const {
|
|
|
230
230
|
this.$emit("keydown", e);
|
|
231
231
|
},
|
|
232
232
|
dispatchEventsOnKeyDown(e, t) {
|
|
233
|
-
const i = () =>
|
|
234
|
-
e.keyCode === d.left && this.fieldsSvc.expanded(t) && i() ? this.dispatchExpandChange(e, t, this.focusedItemId) : e.keyCode === d.right && !this.fieldsSvc.expanded(t) && (this.fieldsSvc.hasChildren(t) ||
|
|
233
|
+
const i = () => C(this.focusedItemId, this.dataItems, this.fieldsSvc), s = this.fieldsSvc.disabled(t);
|
|
234
|
+
e.keyCode === d.left && this.fieldsSvc.expanded(t) && i() ? this.dispatchExpandChange(e, t, this.focusedItemId) : e.keyCode === d.right && !this.fieldsSvc.expanded(t) && (this.fieldsSvc.hasChildren(t) || k(t, this.$props.childrenField)) && i() ? this.dispatchExpandChange(e, t, this.focusedItemId) : e.keyCode === d.enter && !s ? this.dispatchItemClick(e, t, this.focusedItemId) : e.keyCode === d.space && !s && (e.preventDefault(), this.dispatchCheckChange(e, t, this.focusedItemId));
|
|
235
235
|
},
|
|
236
236
|
setFocus(e) {
|
|
237
237
|
if (e)
|
|
@@ -249,7 +249,7 @@ const {
|
|
|
249
249
|
return this.focusedItemId ? this.getItemById(this.focusedItemId) : void 0;
|
|
250
250
|
},
|
|
251
251
|
getItemById(e) {
|
|
252
|
-
return
|
|
252
|
+
return x(e, this.dataItems, this.$props.childrenField || c);
|
|
253
253
|
},
|
|
254
254
|
dispatchCheckChange(e, t, i) {
|
|
255
255
|
this.$emit("checkchange", {
|
|
@@ -276,7 +276,7 @@ const {
|
|
|
276
276
|
if (this.fieldsSvc.focusIdField) {
|
|
277
277
|
const e = this.focusedItemPublicId;
|
|
278
278
|
if (e) {
|
|
279
|
-
const t = this.$props.getFocusHierarchicalIndex ? this.$props.getFocusHierarchicalIndex(e) :
|
|
279
|
+
const t = this.$props.getFocusHierarchicalIndex ? this.$props.getFocusHierarchicalIndex(e) : E(e, this.fieldsSvc.focusIdField, this.dataItems, this.$props.childrenField);
|
|
280
280
|
t !== this.focusedItemId && (this.allowExplicitFocus = !0, this.focusedItemId = t);
|
|
281
281
|
}
|
|
282
282
|
}
|
package/TreeViewItem.mjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as f, h as I, createVNode as s, isVNode as b } from "vue";
|
|
9
|
-
import {
|
|
9
|
+
import { kendoThemeMaps as g, classNames as d, getTemplate as k, Draggable as x, getRef as l, guid as v, Icon as $, setRef as S } from "@progress/kendo-vue-common";
|
|
10
10
|
import { createId as C } from "./utils/itemIdUtils.mjs";
|
|
11
11
|
import { hasChildren as a, isItemExpandedAndWithChildren as E } from "./utils/itemUtils.mjs";
|
|
12
12
|
import { Reveal as D } from "@progress/kendo-vue-animation";
|
|
@@ -17,7 +17,7 @@ function c(e) {
|
|
|
17
17
|
}
|
|
18
18
|
const {
|
|
19
19
|
sizeMap: N
|
|
20
|
-
} =
|
|
20
|
+
} = g, w = /* @__PURE__ */ f({
|
|
21
21
|
name: "KendoTreeViewItem",
|
|
22
22
|
props: {
|
|
23
23
|
item: Object,
|
|
@@ -74,7 +74,7 @@ const {
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
created() {
|
|
77
|
-
this.itemGuid =
|
|
77
|
+
this.itemGuid = v(), this.prevFocusedItemId = this.focusedItemId, this.prevFieldsService = this.fieldsService, this.prevItem = this.item;
|
|
78
78
|
},
|
|
79
79
|
data() {
|
|
80
80
|
return {
|
|
@@ -145,7 +145,7 @@ const {
|
|
|
145
145
|
class: d("k-treeview-toggle", {
|
|
146
146
|
"k-disabled": this.computedDisabled
|
|
147
147
|
})
|
|
148
|
-
}, [s(
|
|
148
|
+
}, [s($, {
|
|
149
149
|
name: this.getIconClassName(),
|
|
150
150
|
icon: this.getIconSVG(),
|
|
151
151
|
onClick: this.handleExpandChange
|
|
@@ -167,7 +167,7 @@ const {
|
|
|
167
167
|
id: this.itemGuid,
|
|
168
168
|
tabindex: -1,
|
|
169
169
|
onChange: this.handleCheckChange,
|
|
170
|
-
ref:
|
|
170
|
+
ref: S(this, "checkboxElement")
|
|
171
171
|
}, null), s("label", {
|
|
172
172
|
class: "k-checkbox-label",
|
|
173
173
|
for: this.itemGuid
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-animation"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-animation","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueTreeview={},e.Vue,e.KendoVueCommon,e.KendoVueAnimation,e.KendoSVGIcons)}(this,(function(e,t,i,s,n){"use strict";const d="",r="_";function l(e,t,i){if(p(e))return t[Number(e)];{const s=t[Number(c(e))],n=s&&s[i]||[];return n.length?l(o(e),n,i):void 0}}function c(e){return m(e)?e:e.split(r)[0]}function o(e){if(m(e))return e;{const t=e.indexOf(r);return e.substring(t+1)}}function a(e){return h("0",e)}function h(e,t){return e=e.toString(),t?t+r+e:e}function u(e){const t=e.lastIndexOf(r);return t<0?d:e.substring(0,t)}function m(e){return e===d||e.indexOf(r)<0}function p(e){return e!==d&&e.indexOf(r)<0}function f(e){return e.split(r)}function g(e){const t=e.lastIndexOf(r);return t<0?e:e.substring(t+1)}function I(e,t){const i=t;t="r"+r+t;const s=u(e="r"+r+e)+r;if(t.startsWith(s)){const i=t.substring(s.length);if(i){const t=c(i);if(Number(g(e))<Number(t)){return o(s+(Number(t)-1).toString()+i.substring(t.length))}}}return i}var b=Object.defineProperty,v=(e,t,i)=>((e,t,i)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,t+"",i);class k{constructor(){v(this,"objects",[])}init(e){let t;for(let i=0;i<e.length;i++)i%5e4==0&&(t={},this.objects.push(t)),t[e[i]]=!0}hasId(e){return this.objects.some((t=>t[e]))}}function x(e,t){const i=(e||"").split(".");let s=t;return i.forEach((e=>{s=s?s[e]:void 0})),s}function F(e){return void 0!==e.length}function C(e,t){const i=x(t,e);return!(!i||!i.length)}function S(e,t){return t.expanded(e)&&C(e,t.getChildrenField())}function $(e,t,i,s){const n=[],r=new k;return r.init(e),E(r,t,i,d,n,s),n}function y(e,t,i,s,n){const d=Number(c(t));if(d>=e.length)return e;let r=e,l=e[d];return l[s]||(r=e.slice(),l=r[d]=Object.assign({},l,{[s]:!0})),p(t)?i(l):l[n]&&(l[n]=y(l[n],o(t),i,s,n)),r}function w(e,t,i){const s=f(e);let n=t;for(let e=0;e<s.length;e++){const t=n[Number(s[e])];if(i.disabled(t))return!1;n=t[i.getChildrenField()]}return!0}function N(e,t,i,s,n){return(e[s]||[]).every(((e,s)=>n.indexOf(i?x(i,e):h(s,t))>-1))}function D(e,t,i){const s=i.slice();if(p(e))s.splice(Number(e),1);else{const i=Number(c(e)),n=s[i]={...s[i]};n[t]=D(o(e),t,n[t])}return s}function V(e,t,i,s,n){const d=n.slice();if(p(s))if("child"===t){const t=d[Number(s)]={...d[Number(s)]};t[i]?(t[i]=t[i].slice(),t[i].push(e)):t[i]=[e]}else d.splice(Number(s)+("after"===t?1:0),0,e);else{const n=Number(c(s)),r=d[n]={...d[n]};r[i]=V(e,t,i,o(s),r[i])}return d}function E(e,t,i,s,n,d){for(let r=0;r<i.length;r++){const l=i[r],c=h(r,s);e.hasId(x(t,l))&&n.push(c),C(l,d)&&E(e,t,x(d,l),c,n,d)}}function R(e,t,s,n,d){switch(n){case i.Keys.left:return p(t)||d.expanded(e)&&w(t,s,d)?t:u(t);case i.Keys.right:return S(e,d)?a(t):t;case i.Keys.up:return function(){const e=Number(g(t)),i=u(t);return e?T(h(e-1,i),s,d):p(t)?t:i}();case i.Keys.down:return S(e,d)?a(t):O(t,s,d)||t;case i.Keys.home:return"0";case i.Keys.end:return function(){let e,t=(s.length-1).toString(),i=s[s.length-1];for(;S(i,d);)e=i[d.getChildrenField()],t=h(e.length-1,t),i=e[e.length-1];return t}();default:return t}}function O(e,t,i){const s=u(e),n=s?l(s,t,i.getChildrenField()):void 0,d=n?n[i.getChildrenField()]:t,r=Number(g(e));return r<d.length-1?h(r+1,s):n?O(s,t,i):void 0}function T(e,t,i){const s=l(e,t,i.getChildrenField());return S(s,i)?T(h(s[i.getChildrenField()].length-1,e),t,i):e}const M="expanded",G="items",K="selected",P="checked",B="checkIndeterminate",j="_kendoItemId",z="_kendoTreeViewGuid";function H(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const{sizeMap:_}=i.kendoThemeMaps,U=t.defineComponent({name:"KendoTreeViewItem",props:{item:Object,itemId:String,treeGuid:String,animate:Boolean,focusedItemId:String,tabbableItemId:String,fieldsService:Object,itemUI:Object,ariaMultiSelectable:Boolean,expandIcons:Boolean,checkboxes:Boolean,onFocusDomElNeeded:Object,draggable:Boolean,isRtl:Boolean,size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}},disabled:Boolean,ariaLevel:Number,onItemClick:Function,onExpandChange:Function,onCheckChange:Function,onPress:Function,onDrag:Function,onRelease:Function,onFocusdomelneeded:Function},computed:{fieldsSvc(){return this.$props.fieldsService},currentTabIndex(){return(this.$props.focusedItemId||this.$props.tabbableItemId)===this.itemId?0:-1},ariaExpanded(){return this.fieldsSvc.hasChildren(this.item)||C(this.item,this.fieldsSvc.getChildrenField())?!!this.fieldsSvc.expanded(this.item):void 0},ariaChecked(){if(this.$props.checkboxes)return this.fieldsSvc.checked(this.item)?"true":this.fieldsSvc.checkIndeterminate(this.item)?"mixed":"false"},ariaSelected(){return!!this.fieldsSvc.selected(this.item)||(this.$props.ariaMultiSelectable?!!this.computedDisabled&&void 0:void 0)},computedDisabled(){const e=this.fieldsSvc.disabled(this.item);return void 0!==e?e:this.disabled}},created(){this.itemGuid=i.guid(),this.prevFocusedItemId=this.focusedItemId,this.prevFieldsService=this.fieldsService,this.prevItem=this.item},data:()=>({isMounted:!1}),watch:{focusedItemId:function(e,t){this.prevFocusedItemId=t},fieldsService:function(e,t){this.prevFieldsService=t},item:function(e,t){this.prevItem=t}},mounted(){const e=this.$props.focusedItemId,t=this.itemId;e&&e===t&&this.$emit("focusDomElNeeded",this.$el),this.checkboxElement=i.getRef(this,"checkboxElement"),this.checkboxElement&&(this.checkboxElement.indeterminate=this.fieldsSvc.checkIndeterminate(this.item)),this.assignDraggableMeta(this.$refs.treemid),this.isMounted=!0},updated(){const e=this.$props.focusedItemId;if(e&&e!==this.prevFocusedItemId&&e===this.itemId&&this.$emit("focusdomelneeded",this.$el),this.checkboxElement=i.getRef(this,"checkboxElement"),this.checkboxElement){const e=this.fieldsSvc.checkIndeterminate(this.item);e!==this.prevFieldsService.checkIndeterminate(this.prevItem)&&(this.checkboxElement.indeterminate=e)}this.assignDraggableMeta(this.$refs.treemid)},render(){let e,n;const d=function(){return S(this.item,this.fieldsSvc)?t.createVNode("ul",{class:"k-treeview-group",role:"group"},[this.fieldsSvc.children(this.item).map((function(e,i){return t.createVNode(U,{item:e,itemId:h(i,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,ariaLevel:this.$props.ariaLevel+1,onItemClick:this.handleItemClick,onFocusdomelneeded:this.handleFocusDomElNeeded,draggable:this.$props.draggable,onPress:this.handlePress,onDrag:this.handleDrag,onRelease:this.handleRelease,expandIcons:this.$props.expandIcons,onExpandChange:this.handleExpandChange,onCheckChange:this.handleCheckChange,key:i,size:this.$props.size,disabled:this.computedDisabled,isRtl:this.$props.isRtl},null)}),this)]):void 0},r=i.getTemplate.call(this,{h:t.h,template:this.$props.itemUI,defaultRendering:this.fieldsSvc.text(this.item),additionalProps:{item:this.item,itemHierarchicalIndex:this.itemId}}),l=function(){return t.createVNode("span",{class:this.getContentClassName(),style:{touchAction:"none"},onClick:this.handleItemClick},[t.createVNode("span",{class:"k-treeview-leaf-text"},[r])])};return t.createVNode("li",{class:i.classNames("k-treeview-item"),tabindex:this.currentTabIndex,role:"treeitem","aria-level":this.$props.ariaLevel,"aria-expanded":this.ariaExpanded,"aria-selected":this.ariaSelected,"aria-checked":this.ariaChecked,"aria-disabled":!!this.computedDisabled||void 0},[t.createVNode("div",{class:"k-treeview-mid",ref:"treemid"},[function(){return this.$props.expandIcons&&(this.fieldsSvc.hasChildren(this.item)||C(this.item,this.fieldsSvc.getChildrenField()))&&t.createVNode("span",{class:i.classNames("k-treeview-toggle",{"k-disabled":this.computedDisabled})},[t.createVNode(i.Icon,{name:this.getIconClassName(),icon:this.getIconSVG(),onClick:this.handleExpandChange},null)])}.call(this),function(){if(this.$props.checkboxes){const e=this.$props.size;return t.createVNode("div",{class:"k-checkbox-wrap",role:"presentation"},[t.createVNode("input",{type:"checkbox",class:i.classNames("k-checkbox k-rounded-md",{[`k-checkbox-${_[e]||e}`]:e,"k-disabled":this.computedDisabled}),"aria-label":this.item.text,checked:!!this.fieldsSvc.checked(this.item),id:this.itemGuid,tabindex:-1,onChange:this.handleCheckChange,ref:i.setRef(this,"checkboxElement")},null),t.createVNode("label",{class:"k-checkbox-label",for:this.itemGuid},null)])}}.call(this),this.$props.draggable?t.createVNode(i.Draggable,{onPress:e=>this.handlePress(e),onDrag:e=>this.handleDrag(e),onRelease:e=>this.handleRelease(e)},H(e=l.call(this))?e:{default:()=>[e]}):l.call(this)]),this.$props.animate&&this.isMounted?t.createVNode(s.Reveal,{appear:this.ariaExpanded,transitionEnterDuration:200,transitionExitDuration:200,key:this.itemGuid+"_animation",style:{display:"block"}},H(n=d.call(this))?n:{default:()=>[n]}):d.call(this)])},methods:{handleCheckChange(e,t,i){this.$emit("checkChange",e,t||this.item,i||this.itemId)},handleExpandChange(e,t,i){this.$emit("expandChange",e,t||this.item,i||this.itemId)},handleItemClick(e,t,i){this.$emit("itemClick",e,t||this.item,i||this.itemId)},handlePress(e,t,i){this.$emit("press",e,t||{...this.item},i||this.itemId)},handleDrag(e,t,i){this.$emit("drag",e,t||this.item,i||this.itemId)},handleRelease(e,t,i){this.$emit("release",e,t||this.item,i||this.itemId)},handleFocusDomElNeeded(e){this.$emit("focusdomelneeded",e)},getIconClassName(){const e=this.fieldsSvc.expanded(this.item);return e&&!C(this.item,this.fieldsSvc.getChildrenField())?"loading":e?"caret-alt-down":this.$props.isRtl?"caret-alt-left":"caret-alt-right"},getIconSVG(){return this.fieldsSvc.expanded(this.item)?n.caretAltDownIcon:this.$props.isRtl?n.caretAltLeftIcon:n.caretAltRightIcon},getContentClassName(){return i.classNames("k-treeview-leaf",{"k-focus":this.$props.focusedItemId===this.itemId,"k-selected":this.fieldsSvc.selected(this.item),"k-disabled":this.computedDisabled})},assignDraggableMeta(e){e&&!e[j]&&(e[j]=this.$props.itemId,e[z]=this.$props.treeGuid)}}});var Y=Object.defineProperty,A=(e,t,i)=>((e,t,i)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i);let L=class{constructor(e){A(this,"focusIdField"),A(this,"expandField"),A(this,"selectField"),A(this,"childrenField"),A(this,"hasChildrenField"),A(this,"textField"),A(this,"disableField"),A(this,"checkField"),A(this,"checkIndeterminateField"),this.expandField=e.expandField,this.selectField=e.selectField,this.hasChildrenField=e.hasChildrenField,this.childrenField=e.childrenField,this.textField=e.textField,this.disableField=e.disableField,this.checkField=e.checkField,this.checkIndeterminateField=e.checkIndeterminateField,this.focusIdField=e.focusIdField}expanded(e){return x(this.expandField,e)}selected(e){return x(this.selectField,e)}text(e){return x(this.textField,e)}disabled(e){return x(this.disableField,e)}hasChildren(e){return x(this.hasChildrenField,e)}children(e){return x(this.childrenField,e)||[]}checked(e){return x(this.checkField,e)}checkIndeterminate(e){return x(this.checkIndeterminateField,e)}focusId(e){return this.focusIdField&&x(this.focusIdField,e)}getChildrenField(){return this.childrenField}};const X={name:"@progress/kendo-vue-treeview",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1650203065,version:"6.4.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"},{sizeMap:q}=i.kendoThemeMaps,W=t.defineComponent({name:"KendoTreeView",emits:{blur:null,focus:null,itemdragstart:null,itemdragover:null,itemdragend:null,keydown:null,itemclick:null,expandchange:null,checkchange:null},props:{dataItems:Array,animate:{type:Boolean,default:!0},id:String,draggable:Boolean,tabIndex:Number,focusIdField:String,getFocusHierarchicalIndex:Function,expandField:{type:String,default:M},selectField:{type:String,default:K},childrenField:{type:String,default:G},hasChildrenField:{type:String,default:"hasChildren"},expandIcons:Boolean,checkboxes:Boolean,textField:{type:String,default:"text"},disableField:{type:String,default:"disabled"},checkField:{type:String,default:P},checkIndeterminateField:{type:String,default:B},item:[Object,String,Function],ariaMultiSelectable:[String,Boolean],ariaLabel:String,ariaLabelledby:String,size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}}},data:()=>({currentRtl:!1,focusedItemId:void 0,focusedItemPublicId:void 0,tabbableItemId:"0"}),mounted(){this.currentRtl=i.isRtl(this.$el)},computed:{treeGuid(){return this.id||this.innerId}},created(){i.validatePackage(X),this.allowExplicitFocus=!1,this.innerId=i.guid()},updated(){this.allowExplicitFocus=!1,this.refocusDueToFocusIdField()},render(){this.fieldsSvc=new L(this.$props);const{size:e}=this.$props;return t.createVNode("div",{class:i.classNames("k-treeview",{[`k-treeview-${q[e]||e}`]:e,"k-user-select-none":this.draggable,"k-rtl":this.currentRtl}),onKeydown:this.onKeyDown,onFocusin:this.onFocus,onFocusout:this.onBlur,"aria-multiselectable":!!this.ariaMultiSelectable||void 0,"aria-label":this.$props["aria-label"],"aria-labelledby":this.$props["aria-labelledby"],tabindex:this.$props.tabIndex,style:{userSelect:this.draggable?"none":void 0}},[t.createVNode("ul",{class:"k-treeview-lines k-treeview-group",role:"tree"},[this.dataItems.map((function(s,n){const d=i.templateRendering.call(this,this.item,i.getListeners.call(this));return t.createVNode(U,{item:s,itemId:n.toString(),treeGuid:this.treeGuid,animate:this.$props.animate,focusedItemId:this.focusedItemId,tabbableItemId:this.tabbableItemId,fieldsService:this.fieldsSvc,itemUI:d,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,onExpandChange:this.onExpandChange,onCheckChange:this.onCheckChange,key:n,size:e,ariaLevel:1,isRtl:this.currentRtl},null)}),this)])])},methods:{onFocusDomElNeeded(e){this.allowExplicitFocus&&this.focusDomItem(e)},onCheckChange(e,t,i){this.setFocus(i),this.dispatchCheckChange(e,t,i)},onExpandChange(e,t,i){this.setFocus(i),this.dispatchExpandChange(e,t,i)},onPress(e,t,i){this.$emit("itemdragstart",{target:this,item:t,itemHierarchicalIndex:i})},onDrag(e,t,i){const{pageX:s,pageY:n,clientX:d,clientY:r}=e;this.$emit("itemdragover",{target:this,item:t,itemHierarchicalIndex:i,pageX:s,pageY:n,clientX:d,clientY:r})},onRelease(e,t,i){const{pageX:s,pageY:n,clientX:d,clientY:r}=e;this.$emit("itemdragend",{target:this,item:t,itemHierarchicalIndex:i,pageX:s,pageY:n,clientX:d,clientY:r})},onItemClick(e,t,i){this.setFocus(i),this.dispatchItemClick(e,t,i)},onFocus(e){clearTimeout(this.blurRequest),void 0===this.focusedItemId&&this.dataItems.length&&this.setFocus(this.tabbableItemId),this.$emit("focus",e)},onBlur(e){clearTimeout(this.blurRequest),i.canUseDOM&&(this.blurRequest=window.setTimeout((()=>this.setFocus(void 0)),0)),this.$emit("blur",e)},onKeyDown(e){const t=this.getFocusedItem();if(t){const i=R(t,this.focusedItemId,this.dataItems,e.keyCode,this.fieldsSvc);i!==this.focusedItemId&&(e.preventDefault(),this.allowExplicitFocus=!0,this.setFocus(i)),this.dispatchEventsOnKeyDown(e,t)}this.$emit("keydown",e)},dispatchEventsOnKeyDown(e,t){const s=()=>w(this.focusedItemId,this.dataItems,this.fieldsSvc),n=this.fieldsSvc.disabled(t);e.keyCode===i.Keys.left&&this.fieldsSvc.expanded(t)&&s()||e.keyCode===i.Keys.right&&!this.fieldsSvc.expanded(t)&&(this.fieldsSvc.hasChildren(t)||C(t,this.$props.childrenField))&&s()?this.dispatchExpandChange(e,t,this.focusedItemId):e.keyCode!==i.Keys.enter||n?e.keyCode===i.Keys.space&&!n&&(e.preventDefault(),this.dispatchCheckChange(e,t,this.focusedItemId)):this.dispatchItemClick(e,t,this.focusedItemId)},setFocus(e){if(e)if(this.fieldsSvc.focusIdField){const t=this.getItemById(e);this.focusedItemId=e,this.focusedItemPublicId=this.fieldsSvc.focusId(t)}else this.focusedItemId=e;else{const e=this.focusedItemId;this.focusedItemId=void 0,this.focusedItemPublicId=void 0,this.tabbableItemId=e}},getFocusedItem(){return this.focusedItemId?this.getItemById(this.focusedItemId):void 0},getItemById(e){return l(e,this.dataItems,this.$props.childrenField||G)},dispatchCheckChange(e,t,i){this.$emit("checkchange",{item:t,itemHierarchicalIndex:i,event:e})},dispatchExpandChange(e,t,i){this.$emit("expandchange",{item:t,itemHierarchicalIndex:i,event:e})},dispatchItemClick(e,t,i){this.$emit("itemclick",{item:t,itemHierarchicalIndex:i,event:e})},refocusDueToFocusIdField(){if(this.fieldsSvc.focusIdField){const e=this.focusedItemPublicId;if(e){const t=this.$props.getFocusHierarchicalIndex?this.$props.getFocusHierarchicalIndex(e):function(e,t,i,s){const n=$([e],t,i,s);return n.length?n[0]:void 0}(e,this.fieldsSvc.focusIdField,this.dataItems,this.$props.childrenField);t!==this.focusedItemId&&(this.allowExplicitFocus=!0,this.focusedItemId=t)}}},focusDomItem(e){e.focus()},guid(){return this.treeGuid}}});function J(e,t,i,s,n){if(i){let{ids:d,field:r}=Q(i,t);return function(e,t,i,s,n){let d=e;return t.forEach((e=>{d=y(d,e,(e=>Z(i,e)),s,n)})),d}(e,!F(i)&&i.idField?$(d,i.idField,e,n):d,r,s,n)}return e}function Q(e,t){let i,s;return F(e)?(i=e,s=t):(i=e.ids||[],s=e.operationField||t),{ids:i,field:s}}function Z(e,t){const i=(e||"").split(".");let s=t;for(let e=0;e<i.length;e++){const t=i[e];if(e===i.length-1)s[t]=!0;else{if(void 0===s[t])return;s[t]={...s[t]},s=s[t]}}}function ee(e,t,i,s,n){let d=!1;for(let r=0;r<e.length;r++){const l=e[r];if(x(s,l)){if(!d)for(let e=0;e<t.length;e++)Z(n,t[e]);d=!0,l[i]&&ee(l[i],[],i,s,n)}else l[i]&&ee(l[i],d?[l]:t.concat([l]),i,s,n)}}const te=t.defineComponent({name:"KendoTreeViewDragClue",data:()=>({visible:!1,top:0,left:0,text:"",operationIconName:"cancel",operationSvg:n.cancelIcon}),render(){const e={top:this.top+"px",left:this.left+"px"};return this.visible&&t.createVNode("div",{class:"k-header k-drag-clue",style:{display:"block",position:"absolute",zIndex:2e4,padding:"4px 6px",...e}},[t.createVNode(i.Icon,{name:i.getIconName(this.operationIconName),icon:this.operationSvg,class:"k-drag-status"},null),this.text])},methods:{show(e,t,i,s){this.visible=!0,this.top=e,this.left=t,this.text=i,"string"==typeof s?this.operationIconName=s:this.operationSvg=s},hide(){this.visible=!1}}});var ie=Object.defineProperty,se=(e,t,i)=>((e,t,i)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i);e.TreeView=W,e.TreeViewDragAnalyzer=class{constructor(e){se(this,"itemId"),se(this,"treeViewGuid"),se(this,"initialized",!1),se(this,"destDomNodeWithMeta"),se(this,"destItemId"),se(this,"destTreeViewGuid"),this.event=e,this.itemId=e.itemHierarchicalIndex,this.treeViewGuid=e.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}_`)}get destinationMeta(){return{itemHierarchicalIndex:this.destItemId,treeViewGuid:this.destTreeViewGuid}}getDropOperation(){if(this.initialized&&this.isDropAllowed){const{top:e,height:t}=this.destDomNodeWithMeta.getBoundingClientRect();return e+t-this.event.clientY<6?"after":this.event.clientY-e<6?"before":"child"}}setDestimationMeta(e){let t=e;for(;t&&!t[j];)t=t.parentNode;t&&t[j]&&(this.destDomNodeWithMeta=t,this.destItemId=t[j],this.destTreeViewGuid=t[z])}},e.TreeViewDragClue=te,e.TreeViewItem=U,e.handleTreeViewCheckChange=function(e,t,i,s={},n){if(!i||!i.length)return[];const{ids:d,idField:r}=function(e){let t,i;return F(e)?t=e:(t=e.ids||[],i=e.idField),{ids:t,idField:i}}(t),c=r?x(r,e.item):e.itemHierarchicalIndex,o=d.indexOf(c),a=-1===o,m=n||G;let p;return s.singleMode?p=a?[c]:[]:(p=d.slice(),a?p.push(c):p.splice(o,1),s.checkChildren&&function(e,t,i,s,n,d){(function(e,t,i,s){return s?function e(t){let n=[];const d=t[i]||[];for(let t=0;t<d.length;t++)n.push(x(s,d[t])),n=n.concat(e(d[t]));return n}(e):function e(t,s){let n=[];const d=t[i]||[];for(let t=0;t<d.length;t++){const i=h(t,s);n.push(i),n=n.concat(e(d[t],i))}return n}(e,t)})(e,t,n,s).forEach((e=>{i&&-1===d.indexOf(e)?d.push(e):!i&&d.indexOf(e)>-1&&d.splice(d.indexOf(e),1)}))}(e.item,e.itemHierarchicalIndex,a,r,m,p),s.checkParents&&function(e,t,i,s,n,d){const r=h();let c=r.next();function o(){for(;!c.done;){const{id:e,item:t}=c.value;if(-1!==n.indexOf(e)||!N(t,e,i,s,n))break;n.push(e),c=r.next()}}function a(){for(;!c.done;){const{id:e}=c.value,t=n.indexOf(e);if(!(t>-1))break;n.splice(t,1),c=r.next()}}function*h(){if(i){const n=function(e,t,i){const s=[],n=f(e);let d=i;for(let e=0;e<n.length-1&&d;e++){const i=d[Number(n[e])];s.push(i),d=i[t]}return s}(e,s,d);for(let e=n.length-1;e>-1;e--)yield{id:x(i,n[e]),item:t?n[e]:void 0}}else{let i=u(e);for(;i;)yield{id:i,item:t?l(i,d,s):void 0},i=u(i)}}t?o():a()}(e.itemHierarchicalIndex,a,r,m,p,i)),F(t)?p:Object.assign({},t,{ids:p})},e.moveTreeViewItem=function(e,t,i,s,n,d){const r=d||G;if(!(t&&t.length&&e&&s)||n&&!n.length||!l(s,n&&n!==t?n:t,r))return o();const c=l(e,t,r);if(!c)return o();if(n&&n!==t){return{sourceData:D(e,r,t),targetData:V(c,i,r,s,n)}}{if(`${s}_`.startsWith(`${e}_`))return o();const d=D(e,r,t),l=V(c,i,r,I(e,s),d);return n?{sourceData:l,targetData:l}:l}function o(){return n?{sourceData:t,targetData:n}:t}},e.processTreeViewItems=function(e,t){if(!e||!e.length)return[];let i=e;const s=t.cloneField||"cloned",n=t.expandField||M,d=t.selectField||K,r=t.checkField||P,l=t.childrenField||G;return i=J(i,n,t.expand,s,l),i=J(i,d,t.select,s,l),i=J(i,r,t.check,s,l),function(e,t,i){if(i&&!F(i)&&i.applyCheckIndeterminate){const{field:s}=Q(i,P),n=i.checkIndeterminateField||B;for(let i=0;i<e.length;i++){const d=e[i],r=d[t];r&&ee(r,x(s,d)?[]:[d],t,s,n)}}}(i,l,t.check),i}}));
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-animation"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-animation","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueTreeview={},e.Vue,e.KendoVueCommon,e.KendoVueAnimation,e.KendoSVGIcons)}(this,(function(e,t,i,s,n){"use strict";const d="",r="_";function l(e,t,i){if(p(e))return t[Number(e)];{const s=t[Number(c(e))],n=s&&s[i]||[];return n.length?l(o(e),n,i):void 0}}function c(e){return m(e)?e:e.split(r)[0]}function o(e){if(m(e))return e;{const t=e.indexOf(r);return e.substring(t+1)}}function a(e){return h("0",e)}function h(e,t){return e=e.toString(),t?t+r+e:e}function u(e){const t=e.lastIndexOf(r);return t<0?d:e.substring(0,t)}function m(e){return e===d||e.indexOf(r)<0}function p(e){return e!==d&&e.indexOf(r)<0}function f(e){return e.split(r)}function g(e){const t=e.lastIndexOf(r);return t<0?e:e.substring(t+1)}function I(e,t){const i=t;t="r"+r+t;const s=u(e="r"+r+e)+r;if(t.startsWith(s)){const i=t.substring(s.length);if(i){const t=c(i);if(Number(g(e))<Number(t)){return o(s+(Number(t)-1).toString()+i.substring(t.length))}}}return i}var b=Object.defineProperty,v=(e,t,i)=>((e,t,i)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,t+"",i);class k{constructor(){v(this,"objects",[])}init(e){let t;for(let i=0;i<e.length;i++)i%5e4==0&&(t={},this.objects.push(t)),t[e[i]]=!0}hasId(e){return this.objects.some((t=>t[e]))}}function x(e,t){const i=(e||"").split(".");let s=t;return i.forEach((e=>{s=s?s[e]:void 0})),s}function F(e){return void 0!==e.length}function C(e,t){const i=x(t,e);return!(!i||!i.length)}function S(e,t){return t.expanded(e)&&C(e,t.getChildrenField())}function $(e,t,i,s){const n=[],r=new k;return r.init(e),E(r,t,i,d,n,s),n}function y(e,t,i,s,n){const d=Number(c(t));if(d>=e.length)return e;let r=e,l=e[d];return l[s]||(r=e.slice(),l=r[d]=Object.assign({},l,{[s]:!0})),p(t)?i(l):l[n]&&(l[n]=y(l[n],o(t),i,s,n)),r}function w(e,t,i){const s=f(e);let n=t;for(let e=0;e<s.length;e++){const t=n[Number(s[e])];if(i.disabled(t))return!1;n=t[i.getChildrenField()]}return!0}function N(e,t,i,s,n){return(e[s]||[]).every(((e,s)=>n.indexOf(i?x(i,e):h(s,t))>-1))}function D(e,t,i){const s=i.slice();if(p(e))s.splice(Number(e),1);else{const i=Number(c(e)),n=s[i]={...s[i]};n[t]=D(o(e),t,n[t])}return s}function V(e,t,i,s,n){const d=n.slice();if(p(s))if("child"===t){const t=d[Number(s)]={...d[Number(s)]};t[i]?(t[i]=t[i].slice(),t[i].push(e)):t[i]=[e]}else d.splice(Number(s)+("after"===t?1:0),0,e);else{const n=Number(c(s)),r=d[n]={...d[n]};r[i]=V(e,t,i,o(s),r[i])}return d}function E(e,t,i,s,n,d){for(let r=0;r<i.length;r++){const l=i[r],c=h(r,s);e.hasId(x(t,l))&&n.push(c),C(l,d)&&E(e,t,x(d,l),c,n,d)}}function R(e,t,s,n,d){switch(n){case i.Keys.left:return p(t)||d.expanded(e)&&w(t,s,d)?t:u(t);case i.Keys.right:return S(e,d)?a(t):t;case i.Keys.up:return function(){const e=Number(g(t)),i=u(t);return e?T(h(e-1,i),s,d):p(t)?t:i}();case i.Keys.down:return S(e,d)?a(t):O(t,s,d)||t;case i.Keys.home:return"0";case i.Keys.end:return function(){let e,t=(s.length-1).toString(),i=s[s.length-1];for(;S(i,d);)e=i[d.getChildrenField()],t=h(e.length-1,t),i=e[e.length-1];return t}();default:return t}}function O(e,t,i){const s=u(e),n=s?l(s,t,i.getChildrenField()):void 0,d=n?n[i.getChildrenField()]:t,r=Number(g(e));return r<d.length-1?h(r+1,s):n?O(s,t,i):void 0}function T(e,t,i){const s=l(e,t,i.getChildrenField());return S(s,i)?T(h(s[i.getChildrenField()].length-1,e),t,i):e}const M="expanded",G="items",K="selected",P="checked",B="checkIndeterminate",j="_kendoItemId",z="_kendoTreeViewGuid";function H(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const{sizeMap:_}=i.kendoThemeMaps,U=t.defineComponent({name:"KendoTreeViewItem",props:{item:Object,itemId:String,treeGuid:String,animate:Boolean,focusedItemId:String,tabbableItemId:String,fieldsService:Object,itemUI:Object,ariaMultiSelectable:Boolean,expandIcons:Boolean,checkboxes:Boolean,onFocusDomElNeeded:Object,draggable:Boolean,isRtl:Boolean,size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}},disabled:Boolean,ariaLevel:Number,onItemClick:Function,onExpandChange:Function,onCheckChange:Function,onPress:Function,onDrag:Function,onRelease:Function,onFocusdomelneeded:Function},computed:{fieldsSvc(){return this.$props.fieldsService},currentTabIndex(){return(this.$props.focusedItemId||this.$props.tabbableItemId)===this.itemId?0:-1},ariaExpanded(){return this.fieldsSvc.hasChildren(this.item)||C(this.item,this.fieldsSvc.getChildrenField())?!!this.fieldsSvc.expanded(this.item):void 0},ariaChecked(){if(this.$props.checkboxes)return this.fieldsSvc.checked(this.item)?"true":this.fieldsSvc.checkIndeterminate(this.item)?"mixed":"false"},ariaSelected(){return!!this.fieldsSvc.selected(this.item)||(this.$props.ariaMultiSelectable?!!this.computedDisabled&&void 0:void 0)},computedDisabled(){const e=this.fieldsSvc.disabled(this.item);return void 0!==e?e:this.disabled}},created(){this.itemGuid=i.guid(),this.prevFocusedItemId=this.focusedItemId,this.prevFieldsService=this.fieldsService,this.prevItem=this.item},data:()=>({isMounted:!1}),watch:{focusedItemId:function(e,t){this.prevFocusedItemId=t},fieldsService:function(e,t){this.prevFieldsService=t},item:function(e,t){this.prevItem=t}},mounted(){const e=this.$props.focusedItemId,t=this.itemId;e&&e===t&&this.$emit("focusDomElNeeded",this.$el),this.checkboxElement=i.getRef(this,"checkboxElement"),this.checkboxElement&&(this.checkboxElement.indeterminate=this.fieldsSvc.checkIndeterminate(this.item)),this.assignDraggableMeta(this.$refs.treemid),this.isMounted=!0},updated(){const e=this.$props.focusedItemId;if(e&&e!==this.prevFocusedItemId&&e===this.itemId&&this.$emit("focusdomelneeded",this.$el),this.checkboxElement=i.getRef(this,"checkboxElement"),this.checkboxElement){const e=this.fieldsSvc.checkIndeterminate(this.item);e!==this.prevFieldsService.checkIndeterminate(this.prevItem)&&(this.checkboxElement.indeterminate=e)}this.assignDraggableMeta(this.$refs.treemid)},render(){let e,n;const d=function(){return S(this.item,this.fieldsSvc)?t.createVNode("ul",{class:"k-treeview-group",role:"group"},[this.fieldsSvc.children(this.item).map((function(e,i){return t.createVNode(U,{item:e,itemId:h(i,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,ariaLevel:this.$props.ariaLevel+1,onItemClick:this.handleItemClick,onFocusdomelneeded:this.handleFocusDomElNeeded,draggable:this.$props.draggable,onPress:this.handlePress,onDrag:this.handleDrag,onRelease:this.handleRelease,expandIcons:this.$props.expandIcons,onExpandChange:this.handleExpandChange,onCheckChange:this.handleCheckChange,key:i,size:this.$props.size,disabled:this.computedDisabled,isRtl:this.$props.isRtl},null)}),this)]):void 0},r=i.getTemplate.call(this,{h:t.h,template:this.$props.itemUI,defaultRendering:this.fieldsSvc.text(this.item),additionalProps:{item:this.item,itemHierarchicalIndex:this.itemId}}),l=function(){return t.createVNode("span",{class:this.getContentClassName(),style:{touchAction:"none"},onClick:this.handleItemClick},[t.createVNode("span",{class:"k-treeview-leaf-text"},[r])])};return t.createVNode("li",{class:i.classNames("k-treeview-item"),tabindex:this.currentTabIndex,role:"treeitem","aria-level":this.$props.ariaLevel,"aria-expanded":this.ariaExpanded,"aria-selected":this.ariaSelected,"aria-checked":this.ariaChecked,"aria-disabled":!!this.computedDisabled||void 0},[t.createVNode("div",{class:"k-treeview-mid",ref:"treemid"},[function(){return this.$props.expandIcons&&(this.fieldsSvc.hasChildren(this.item)||C(this.item,this.fieldsSvc.getChildrenField()))&&t.createVNode("span",{class:i.classNames("k-treeview-toggle",{"k-disabled":this.computedDisabled})},[t.createVNode(i.Icon,{name:this.getIconClassName(),icon:this.getIconSVG(),onClick:this.handleExpandChange},null)])}.call(this),function(){if(this.$props.checkboxes){const e=this.$props.size;return t.createVNode("div",{class:"k-checkbox-wrap",role:"presentation"},[t.createVNode("input",{type:"checkbox",class:i.classNames("k-checkbox k-rounded-md",{[`k-checkbox-${_[e]||e}`]:e,"k-disabled":this.computedDisabled}),"aria-label":this.item.text,checked:!!this.fieldsSvc.checked(this.item),id:this.itemGuid,tabindex:-1,onChange:this.handleCheckChange,ref:i.setRef(this,"checkboxElement")},null),t.createVNode("label",{class:"k-checkbox-label",for:this.itemGuid},null)])}}.call(this),this.$props.draggable?t.createVNode(i.Draggable,{onPress:e=>this.handlePress(e),onDrag:e=>this.handleDrag(e),onRelease:e=>this.handleRelease(e)},H(e=l.call(this))?e:{default:()=>[e]}):l.call(this)]),this.$props.animate&&this.isMounted?t.createVNode(s.Reveal,{appear:this.ariaExpanded,transitionEnterDuration:200,transitionExitDuration:200,key:this.itemGuid+"_animation",style:{display:"block"}},H(n=d.call(this))?n:{default:()=>[n]}):d.call(this)])},methods:{handleCheckChange(e,t,i){this.$emit("checkChange",e,t||this.item,i||this.itemId)},handleExpandChange(e,t,i){this.$emit("expandChange",e,t||this.item,i||this.itemId)},handleItemClick(e,t,i){this.$emit("itemClick",e,t||this.item,i||this.itemId)},handlePress(e,t,i){this.$emit("press",e,t||{...this.item},i||this.itemId)},handleDrag(e,t,i){this.$emit("drag",e,t||this.item,i||this.itemId)},handleRelease(e,t,i){this.$emit("release",e,t||this.item,i||this.itemId)},handleFocusDomElNeeded(e){this.$emit("focusdomelneeded",e)},getIconClassName(){const e=this.fieldsSvc.expanded(this.item);return e&&!C(this.item,this.fieldsSvc.getChildrenField())?"loading":e?"caret-alt-down":this.$props.isRtl?"caret-alt-left":"caret-alt-right"},getIconSVG(){return this.fieldsSvc.expanded(this.item)?n.caretAltDownIcon:this.$props.isRtl?n.caretAltLeftIcon:n.caretAltRightIcon},getContentClassName(){return i.classNames("k-treeview-leaf",{"k-focus":this.$props.focusedItemId===this.itemId,"k-selected":this.fieldsSvc.selected(this.item),"k-disabled":this.computedDisabled})},assignDraggableMeta(e){e&&!e[j]&&(e[j]=this.$props.itemId,e[z]=this.$props.treeGuid)}}});var Y=Object.defineProperty,A=(e,t,i)=>((e,t,i)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i);let L=class{constructor(e){A(this,"focusIdField"),A(this,"expandField"),A(this,"selectField"),A(this,"childrenField"),A(this,"hasChildrenField"),A(this,"textField"),A(this,"disableField"),A(this,"checkField"),A(this,"checkIndeterminateField"),this.expandField=e.expandField,this.selectField=e.selectField,this.hasChildrenField=e.hasChildrenField,this.childrenField=e.childrenField,this.textField=e.textField,this.disableField=e.disableField,this.checkField=e.checkField,this.checkIndeterminateField=e.checkIndeterminateField,this.focusIdField=e.focusIdField}expanded(e){return x(this.expandField,e)}selected(e){return x(this.selectField,e)}text(e){return x(this.textField,e)}disabled(e){return x(this.disableField,e)}hasChildren(e){return x(this.hasChildrenField,e)}children(e){return x(this.childrenField,e)||[]}checked(e){return x(this.checkField,e)}checkIndeterminate(e){return x(this.checkIndeterminateField,e)}focusId(e){return this.focusIdField&&x(this.focusIdField,e)}getChildrenField(){return this.childrenField}};const X={name:"@progress/kendo-vue-treeview",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1650203065,version:"6.5.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"},{sizeMap:q}=i.kendoThemeMaps,W=t.defineComponent({name:"KendoTreeView",emits:{blur:null,focus:null,itemdragstart:null,itemdragover:null,itemdragend:null,keydown:null,itemclick:null,expandchange:null,checkchange:null},props:{dataItems:Array,animate:{type:Boolean,default:!0},id:String,draggable:Boolean,tabIndex:Number,focusIdField:String,getFocusHierarchicalIndex:Function,expandField:{type:String,default:M},selectField:{type:String,default:K},childrenField:{type:String,default:G},hasChildrenField:{type:String,default:"hasChildren"},expandIcons:Boolean,checkboxes:Boolean,textField:{type:String,default:"text"},disableField:{type:String,default:"disabled"},checkField:{type:String,default:P},checkIndeterminateField:{type:String,default:B},item:[Object,String,Function],ariaMultiSelectable:[String,Boolean],ariaLabel:String,ariaLabelledby:String,size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}}},data:()=>({currentRtl:!1,focusedItemId:void 0,focusedItemPublicId:void 0,tabbableItemId:"0"}),mounted(){this.currentRtl=i.isRtl(this.$el)},computed:{treeGuid(){return this.id||this.innerId}},created(){i.validatePackage(X),this.allowExplicitFocus=!1,this.innerId=i.guid()},updated(){this.allowExplicitFocus=!1,this.refocusDueToFocusIdField()},render(){this.fieldsSvc=new L(this.$props);const{size:e}=this.$props;return t.createVNode("div",{class:i.classNames("k-treeview",{[`k-treeview-${q[e]||e}`]:e,"k-user-select-none":this.draggable,"k-rtl":this.currentRtl}),onKeydown:this.onKeyDown,onFocusin:this.onFocus,onFocusout:this.onBlur,"aria-multiselectable":!!this.ariaMultiSelectable||void 0,"aria-label":this.$props["aria-label"],"aria-labelledby":this.$props["aria-labelledby"],tabindex:this.$props.tabIndex,style:{userSelect:this.draggable?"none":void 0}},[t.createVNode("ul",{class:"k-treeview-lines k-treeview-group",role:"tree"},[this.dataItems.map((function(s,n){const d=i.templateRendering.call(this,this.item,i.getListeners.call(this));return t.createVNode(U,{item:s,itemId:n.toString(),treeGuid:this.treeGuid,animate:this.$props.animate,focusedItemId:this.focusedItemId,tabbableItemId:this.tabbableItemId,fieldsService:this.fieldsSvc,itemUI:d,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,onExpandChange:this.onExpandChange,onCheckChange:this.onCheckChange,key:n,size:e,ariaLevel:1,isRtl:this.currentRtl},null)}),this)])])},methods:{onFocusDomElNeeded(e){this.allowExplicitFocus&&this.focusDomItem(e)},onCheckChange(e,t,i){this.setFocus(i),this.dispatchCheckChange(e,t,i)},onExpandChange(e,t,i){this.setFocus(i),this.dispatchExpandChange(e,t,i)},onPress(e,t,i){this.$emit("itemdragstart",{target:this,item:t,itemHierarchicalIndex:i})},onDrag(e,t,i){const{pageX:s,pageY:n,clientX:d,clientY:r}=e;this.$emit("itemdragover",{target:this,item:t,itemHierarchicalIndex:i,pageX:s,pageY:n,clientX:d,clientY:r})},onRelease(e,t,i){const{pageX:s,pageY:n,clientX:d,clientY:r}=e;this.$emit("itemdragend",{target:this,item:t,itemHierarchicalIndex:i,pageX:s,pageY:n,clientX:d,clientY:r})},onItemClick(e,t,i){this.setFocus(i),this.dispatchItemClick(e,t,i)},onFocus(e){clearTimeout(this.blurRequest),void 0===this.focusedItemId&&this.dataItems.length&&this.setFocus(this.tabbableItemId),this.$emit("focus",e)},onBlur(e){clearTimeout(this.blurRequest),i.canUseDOM&&(this.blurRequest=window.setTimeout((()=>this.setFocus(void 0)),0)),this.$emit("blur",e)},onKeyDown(e){const t=this.getFocusedItem();if(t){const i=R(t,this.focusedItemId,this.dataItems,e.keyCode,this.fieldsSvc);i!==this.focusedItemId&&(e.preventDefault(),this.allowExplicitFocus=!0,this.setFocus(i)),this.dispatchEventsOnKeyDown(e,t)}this.$emit("keydown",e)},dispatchEventsOnKeyDown(e,t){const s=()=>w(this.focusedItemId,this.dataItems,this.fieldsSvc),n=this.fieldsSvc.disabled(t);e.keyCode===i.Keys.left&&this.fieldsSvc.expanded(t)&&s()||e.keyCode===i.Keys.right&&!this.fieldsSvc.expanded(t)&&(this.fieldsSvc.hasChildren(t)||C(t,this.$props.childrenField))&&s()?this.dispatchExpandChange(e,t,this.focusedItemId):e.keyCode!==i.Keys.enter||n?e.keyCode===i.Keys.space&&!n&&(e.preventDefault(),this.dispatchCheckChange(e,t,this.focusedItemId)):this.dispatchItemClick(e,t,this.focusedItemId)},setFocus(e){if(e)if(this.fieldsSvc.focusIdField){const t=this.getItemById(e);this.focusedItemId=e,this.focusedItemPublicId=this.fieldsSvc.focusId(t)}else this.focusedItemId=e;else{const e=this.focusedItemId;this.focusedItemId=void 0,this.focusedItemPublicId=void 0,this.tabbableItemId=e}},getFocusedItem(){return this.focusedItemId?this.getItemById(this.focusedItemId):void 0},getItemById(e){return l(e,this.dataItems,this.$props.childrenField||G)},dispatchCheckChange(e,t,i){this.$emit("checkchange",{item:t,itemHierarchicalIndex:i,event:e})},dispatchExpandChange(e,t,i){this.$emit("expandchange",{item:t,itemHierarchicalIndex:i,event:e})},dispatchItemClick(e,t,i){this.$emit("itemclick",{item:t,itemHierarchicalIndex:i,event:e})},refocusDueToFocusIdField(){if(this.fieldsSvc.focusIdField){const e=this.focusedItemPublicId;if(e){const t=this.$props.getFocusHierarchicalIndex?this.$props.getFocusHierarchicalIndex(e):function(e,t,i,s){const n=$([e],t,i,s);return n.length?n[0]:void 0}(e,this.fieldsSvc.focusIdField,this.dataItems,this.$props.childrenField);t!==this.focusedItemId&&(this.allowExplicitFocus=!0,this.focusedItemId=t)}}},focusDomItem(e){e.focus()},guid(){return this.treeGuid}}});function J(e,t,i,s,n){if(i){let{ids:d,field:r}=Q(i,t);return function(e,t,i,s,n){let d=e;return t.forEach((e=>{d=y(d,e,(e=>Z(i,e)),s,n)})),d}(e,!F(i)&&i.idField?$(d,i.idField,e,n):d,r,s,n)}return e}function Q(e,t){let i,s;return F(e)?(i=e,s=t):(i=e.ids||[],s=e.operationField||t),{ids:i,field:s}}function Z(e,t){const i=(e||"").split(".");let s=t;for(let e=0;e<i.length;e++){const t=i[e];if(e===i.length-1)s[t]=!0;else{if(void 0===s[t])return;s[t]={...s[t]},s=s[t]}}}function ee(e,t,i,s,n){let d=!1;for(let r=0;r<e.length;r++){const l=e[r];if(x(s,l)){if(!d)for(let e=0;e<t.length;e++)Z(n,t[e]);d=!0,l[i]&&ee(l[i],[],i,s,n)}else l[i]&&ee(l[i],d?[l]:t.concat([l]),i,s,n)}}const te=t.defineComponent({name:"KendoTreeViewDragClue",data:()=>({visible:!1,top:0,left:0,text:"",operationIconName:"cancel",operationSvg:n.cancelIcon}),render(){const e={top:this.top+"px",left:this.left+"px"};return this.visible&&t.createVNode("div",{class:"k-header k-drag-clue",style:{display:"block",position:"absolute",zIndex:2e4,padding:"4px 6px",...e}},[t.createVNode(i.Icon,{name:i.getIconName(this.operationIconName),icon:this.operationSvg,class:"k-drag-status"},null),this.text])},methods:{show(e,t,i,s){this.visible=!0,this.top=e,this.left=t,this.text=i,"string"==typeof s?this.operationIconName=s:this.operationSvg=s},hide(){this.visible=!1}}});var ie=Object.defineProperty,se=(e,t,i)=>((e,t,i)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i);e.TreeView=W,e.TreeViewDragAnalyzer=class{constructor(e){se(this,"itemId"),se(this,"treeViewGuid"),se(this,"initialized",!1),se(this,"destDomNodeWithMeta"),se(this,"destItemId"),se(this,"destTreeViewGuid"),this.event=e,this.itemId=e.itemHierarchicalIndex,this.treeViewGuid=e.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}_`)}get destinationMeta(){return{itemHierarchicalIndex:this.destItemId,treeViewGuid:this.destTreeViewGuid}}getDropOperation(){if(this.initialized&&this.isDropAllowed){const{top:e,height:t}=this.destDomNodeWithMeta.getBoundingClientRect();return e+t-this.event.clientY<6?"after":this.event.clientY-e<6?"before":"child"}}setDestimationMeta(e){let t=e;for(;t&&!t[j];)t=t.parentNode;t&&t[j]&&(this.destDomNodeWithMeta=t,this.destItemId=t[j],this.destTreeViewGuid=t[z])}},e.TreeViewDragClue=te,e.TreeViewItem=U,e.handleTreeViewCheckChange=function(e,t,i,s={},n){if(!i||!i.length)return[];const{ids:d,idField:r}=function(e){let t,i;return F(e)?t=e:(t=e.ids||[],i=e.idField),{ids:t,idField:i}}(t),c=r?x(r,e.item):e.itemHierarchicalIndex,o=d.indexOf(c),a=-1===o,m=n||G;let p;return s.singleMode?p=a?[c]:[]:(p=d.slice(),a?p.push(c):p.splice(o,1),s.checkChildren&&function(e,t,i,s,n,d){(function(e,t,i,s){return s?function e(t){let n=[];const d=t[i]||[];for(let t=0;t<d.length;t++)n.push(x(s,d[t])),n=n.concat(e(d[t]));return n}(e):function e(t,s){let n=[];const d=t[i]||[];for(let t=0;t<d.length;t++){const i=h(t,s);n.push(i),n=n.concat(e(d[t],i))}return n}(e,t)})(e,t,n,s).forEach((e=>{i&&-1===d.indexOf(e)?d.push(e):!i&&d.indexOf(e)>-1&&d.splice(d.indexOf(e),1)}))}(e.item,e.itemHierarchicalIndex,a,r,m,p),s.checkParents&&function(e,t,i,s,n,d){const r=h();let c=r.next();function o(){for(;!c.done;){const{id:e,item:t}=c.value;if(-1!==n.indexOf(e)||!N(t,e,i,s,n))break;n.push(e),c=r.next()}}function a(){for(;!c.done;){const{id:e}=c.value,t=n.indexOf(e);if(!(t>-1))break;n.splice(t,1),c=r.next()}}function*h(){if(i){const n=function(e,t,i){const s=[],n=f(e);let d=i;for(let e=0;e<n.length-1&&d;e++){const i=d[Number(n[e])];s.push(i),d=i[t]}return s}(e,s,d);for(let e=n.length-1;e>-1;e--)yield{id:x(i,n[e]),item:t?n[e]:void 0}}else{let i=u(e);for(;i;)yield{id:i,item:t?l(i,d,s):void 0},i=u(i)}}t?o():a()}(e.itemHierarchicalIndex,a,r,m,p,i)),F(t)?p:Object.assign({},t,{ids:p})},e.moveTreeViewItem=function(e,t,i,s,n,d){const r=d||G;if(!(t&&t.length&&e&&s)||n&&!n.length||!l(s,n&&n!==t?n:t,r))return o();const c=l(e,t,r);if(!c)return o();if(n&&n!==t){return{sourceData:D(e,r,t),targetData:V(c,i,r,s,n)}}{if(`${s}_`.startsWith(`${e}_`))return o();const d=D(e,r,t),l=V(c,i,r,I(e,s),d);return n?{sourceData:l,targetData:l}:l}function o(){return n?{sourceData:t,targetData:n}:t}},e.processTreeViewItems=function(e,t){if(!e||!e.length)return[];let i=e;const s=t.cloneField||"cloned",n=t.expandField||M,d=t.selectField||K,r=t.checkField||P,l=t.childrenField||G;return i=J(i,n,t.expand,s,l),i=J(i,d,t.select,s,l),i=J(i,r,t.check,s,l),function(e,t,i){if(i&&!F(i)&&i.applyCheckIndeterminate){const{field:s}=Q(i,P),n=i.checkIndeterminateField||B;for(let i=0;i<e.length;i++){const d=e[i],r=d[t];r&&ee(r,x(s,d)?[]:[d],t,s,n)}}}(i,l,t.check),i}}));
|
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { getAllDirectIndirectChildrenIds as I, areAllDirectChildrenChecked as p, getAllParents as g } from "./utils/itemUtils.mjs";
|
|
9
9
|
import { getDirectParentId as u, getItemById as O } from "./utils/itemIdUtils.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { isArray as m, getNestedValue as x } from "./utils/misc.mjs";
|
|
11
11
|
import { CHILDREN_FIELD as k } from "./utils/consts.mjs";
|
|
12
12
|
function E(i, n, t, o = {}, f) {
|
|
13
13
|
if (!t || !t.length)
|
|
14
14
|
return [];
|
|
15
|
-
const { ids: l, idField: r } = C(n), c = r ?
|
|
15
|
+
const { ids: l, idField: r } = C(n), c = r ? x(r, i.item) : i.itemHierarchicalIndex, h = l.indexOf(c), d = h === -1, a = f || k;
|
|
16
16
|
let e;
|
|
17
|
-
return o.singleMode ? e = d ? [c] : [] : (e = l.slice(), d ? e.push(c) : e.splice(h, 1), o.checkChildren && w(i.item, i.itemHierarchicalIndex, d, r, a, e), o.checkParents && D(i.itemHierarchicalIndex, d, r, a, e, t)),
|
|
17
|
+
return o.singleMode ? e = d ? [c] : [] : (e = l.slice(), d ? e.push(c) : e.splice(h, 1), o.checkChildren && w(i.item, i.itemHierarchicalIndex, d, r, a, e), o.checkParents && D(i.itemHierarchicalIndex, d, r, a, e, t)), m(n) ? e : Object.assign({}, n, { ids: e });
|
|
18
18
|
}
|
|
19
19
|
function C(i) {
|
|
20
20
|
let n, t;
|
|
21
|
-
return
|
|
21
|
+
return m(i) ? n = i : (n = i.ids || [], t = i.idField), { ids: n, idField: t };
|
|
22
22
|
}
|
|
23
23
|
function w(i, n, t, o, f, l) {
|
|
24
24
|
I(i, n, f, o).forEach((r) => {
|
|
@@ -51,7 +51,7 @@ function D(i, n, t, o, f, l) {
|
|
|
51
51
|
if (t) {
|
|
52
52
|
const e = g(i, o, l);
|
|
53
53
|
for (let s = e.length - 1; s > -1; s--)
|
|
54
|
-
yield { id:
|
|
54
|
+
yield { id: x(t, e[s]), item: n ? e[s] : void 0 };
|
|
55
55
|
} else {
|
|
56
56
|
let e = u(i);
|
|
57
57
|
for (; e; )
|
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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-treeview",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-treeview",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1752060609,version:"6.5.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "Kendo UI for Vue",
|
|
11
11
|
productCode: "KENDOUIVUE",
|
|
12
12
|
productCodes: ["KENDOUIVUE"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "6.
|
|
13
|
+
publishDate: 1752060609,
|
|
14
|
+
version: "6.5.0-develop.1",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-treeview",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0-develop.1",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@progress/kendo-licensing": "^1.4.0",
|
|
22
|
-
"@progress/kendo-vue-animation": "6.
|
|
23
|
-
"@progress/kendo-vue-common": "6.
|
|
22
|
+
"@progress/kendo-vue-animation": "6.5.0-develop.1",
|
|
23
|
+
"@progress/kendo-vue-common": "6.5.0-develop.1",
|
|
24
24
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
25
25
|
"vue": "^3.0.2"
|
|
26
26
|
},
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"package": {
|
|
42
42
|
"productName": "Kendo UI for Vue",
|
|
43
43
|
"productCode": "KENDOUIVUE",
|
|
44
|
-
"publishDate":
|
|
44
|
+
"publishDate": 1752060609,
|
|
45
45
|
"licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { Keys as l } from "@progress/kendo-vue-common";
|
|
9
|
-
import { ZERO_LEVEL_ZERO_NODE_ID as I,
|
|
9
|
+
import { ZERO_LEVEL_ZERO_NODE_ID as I, getDirectParentId as i, isIdZeroLevel as E, getFirstChildId as y, getShortId as C, createId as p, getItemById as s } from "./itemIdUtils.mjs";
|
|
10
10
|
import { isEnabledAndAllParentsEnabled as N, isItemExpandedAndWithChildren as d } from "./itemUtils.mjs";
|
|
11
11
|
function D(r, n, e, o, t) {
|
|
12
12
|
switch (o) {
|
package/utils/itemUtils.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { getAllShortIds as p, isIdZeroLevel as h, getRootParentId as I, getIdWithoutRootParentId as b, createId as g, EMPTY_ID as C } from "./itemIdUtils.mjs";
|
|
9
9
|
import x from "./SortedPublicItemIds.mjs";
|
|
10
10
|
import { getNestedValue as i } from "./misc.mjs";
|
|
11
11
|
function P(t, o) {
|
|
@@ -24,11 +24,11 @@ function A(t, o, e, n) {
|
|
|
24
24
|
return r.init(t), N(r, o, e, C, u, n), u;
|
|
25
25
|
}
|
|
26
26
|
function d(t, o, e, n, u) {
|
|
27
|
-
const r = Number(
|
|
27
|
+
const r = Number(I(o));
|
|
28
28
|
if (r >= t.length)
|
|
29
29
|
return t;
|
|
30
30
|
let s = t, c = t[r];
|
|
31
|
-
return c[n] || (s = t.slice(), c = s[r] = Object.assign({}, c, { [n]: !0 })),
|
|
31
|
+
return c[n] || (s = t.slice(), c = s[r] = Object.assign({}, c, { [n]: !0 })), h(o) ? e(c) : c[u] && (c[u] = d(
|
|
32
32
|
c[u],
|
|
33
33
|
b(o),
|
|
34
34
|
e,
|
|
@@ -80,10 +80,10 @@ function y(t, o, e) {
|
|
|
80
80
|
}
|
|
81
81
|
function v(t, o, e) {
|
|
82
82
|
const n = e.slice();
|
|
83
|
-
if (
|
|
83
|
+
if (h(t))
|
|
84
84
|
n.splice(Number(t), 1);
|
|
85
85
|
else {
|
|
86
|
-
const u = Number(
|
|
86
|
+
const u = Number(I(t)), r = n[u] = { ...n[u] };
|
|
87
87
|
r[o] = v(
|
|
88
88
|
b(t),
|
|
89
89
|
o,
|
|
@@ -94,14 +94,14 @@ function v(t, o, e) {
|
|
|
94
94
|
}
|
|
95
95
|
function E(t, o, e, n, u) {
|
|
96
96
|
const r = u.slice();
|
|
97
|
-
if (
|
|
97
|
+
if (h(n))
|
|
98
98
|
if (o === "child") {
|
|
99
99
|
const s = r[Number(n)] = { ...r[Number(n)] };
|
|
100
100
|
s[e] ? (s[e] = s[e].slice(), s[e].push(t)) : s[e] = [t];
|
|
101
101
|
} else
|
|
102
102
|
r.splice(Number(n) + (o === "after" ? 1 : 0), 0, t);
|
|
103
103
|
else {
|
|
104
|
-
const s = Number(
|
|
104
|
+
const s = Number(I(n)), c = r[s] = { ...r[s] };
|
|
105
105
|
c[e] = E(
|
|
106
106
|
t,
|
|
107
107
|
o,
|