@progress/kendo-vue-treeview 3.5.0 → 3.5.1-dev.202208150613

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.
Files changed (65) hide show
  1. package/README.md +2 -2
  2. package/dist/cdn/js/kendo-vue-treeview.js +1 -1
  3. package/dist/es/ItemRenderProps.js +1 -0
  4. package/dist/es/TreeView.js +1 -1
  5. package/dist/es/TreeViewDragAnalyzer.js +2 -2
  6. package/dist/es/TreeViewItem.js +2 -2
  7. package/dist/es/TreeViewOperationDescriptors.js +1 -0
  8. package/dist/es/TreeViewProps.js +1 -0
  9. package/dist/es/events.js +1 -0
  10. package/dist/es/moveTreeViewItem.js +1 -1
  11. package/dist/es/package-metadata.js +1 -1
  12. package/dist/esm/ItemRenderProps.d.ts +13 -0
  13. package/dist/esm/ItemRenderProps.js +2 -0
  14. package/dist/esm/TreeView.d.ts +116 -0
  15. package/dist/esm/TreeView.js +435 -0
  16. package/dist/esm/TreeViewDragAnalyzer.d.ts +63 -0
  17. package/dist/esm/TreeViewDragAnalyzer.js +111 -0
  18. package/dist/esm/TreeViewDragClue.d.ts +78 -0
  19. package/dist/esm/TreeViewDragClue.js +112 -0
  20. package/dist/esm/TreeViewItem.d.ts +75 -0
  21. package/dist/esm/TreeViewItem.js +404 -0
  22. package/dist/esm/TreeViewOperationDescriptors.d.ts +76 -0
  23. package/dist/esm/TreeViewOperationDescriptors.js +2 -0
  24. package/dist/esm/TreeViewProps.d.ts +126 -0
  25. package/dist/esm/TreeViewProps.js +1 -0
  26. package/dist/esm/additionalTypes.ts +21 -0
  27. package/dist/esm/events.d.ts +135 -0
  28. package/dist/esm/events.js +1 -0
  29. package/dist/esm/handleTreeViewCheckChange.d.ts +49 -0
  30. package/dist/esm/handleTreeViewCheckChange.js +177 -0
  31. package/dist/esm/main.d.ts +12 -0
  32. package/dist/esm/main.js +8 -0
  33. package/dist/esm/moveTreeViewItem.d.ts +46 -0
  34. package/dist/esm/moveTreeViewItem.js +93 -0
  35. package/dist/esm/package-metadata.d.ts +5 -0
  36. package/dist/esm/package-metadata.js +11 -0
  37. package/dist/esm/package.json +3 -0
  38. package/dist/esm/processTreeViewItems.d.ts +24 -0
  39. package/dist/esm/processTreeViewItems.js +139 -0
  40. package/dist/esm/utils/FieldsService.d.ts +26 -0
  41. package/dist/esm/utils/FieldsService.js +50 -0
  42. package/dist/esm/utils/SortedPublicItemIds.d.ts +8 -0
  43. package/dist/esm/utils/SortedPublicItemIds.js +24 -0
  44. package/dist/esm/utils/consts.d.ts +40 -0
  45. package/dist/esm/utils/consts.js +40 -0
  46. package/dist/esm/utils/getItemIdUponKeyboardNavigation.d.ts +5 -0
  47. package/dist/esm/utils/getItemIdUponKeyboardNavigation.js +77 -0
  48. package/dist/esm/utils/itemIdUtils.d.ts +60 -0
  49. package/dist/esm/utils/itemIdUtils.js +117 -0
  50. package/dist/esm/utils/itemUtils.d.ts +45 -0
  51. package/dist/esm/utils/itemUtils.js +191 -0
  52. package/dist/esm/utils/misc.d.ts +9 -0
  53. package/dist/esm/utils/misc.js +17 -0
  54. package/dist/npm/TreeView.js +8 -8
  55. package/dist/npm/TreeViewDragAnalyzer.js +2 -2
  56. package/dist/npm/TreeViewDragClue.js +1 -1
  57. package/dist/npm/TreeViewItem.js +15 -15
  58. package/dist/npm/handleTreeViewCheckChange.js +10 -10
  59. package/dist/npm/moveTreeViewItem.js +7 -7
  60. package/dist/npm/package-metadata.js +1 -1
  61. package/dist/npm/processTreeViewItems.js +7 -7
  62. package/dist/npm/utils/FieldsService.js +9 -9
  63. package/dist/npm/utils/getItemIdUponKeyboardNavigation.js +5 -5
  64. package/dist/npm/utils/itemUtils.js +18 -18
  65. package/package.json +12 -6
@@ -0,0 +1,112 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+
6
+ for (var p in s) {
7
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ }; // @ts-ignore
16
+
17
+
18
+ import * as Vue from 'vue';
19
+ var allVue = Vue;
20
+ var gh = allVue.h;
21
+ var isV3 = allVue.version && allVue.version[0] === '3';
22
+ import { classNames } from '@progress/kendo-vue-common';
23
+ /**
24
+ * @hidden
25
+ */
26
+
27
+ var TreeViewDragClueVue2 = {
28
+ name: 'KendoTreeViewDragClue',
29
+ props: {},
30
+ data: function data() {
31
+ return {
32
+ visible: false,
33
+ top: 0,
34
+ left: 0,
35
+ text: '',
36
+ operationClassName: 'k-i-cancel'
37
+ };
38
+ },
39
+ // @ts-ignore
40
+ setup: !isV3 ? undefined : function () {
41
+ var v3 = !!isV3;
42
+ return {
43
+ v3: v3
44
+ };
45
+ },
46
+ // @ts-ignore
47
+ render: function render(createElement) {
48
+ var h = gh || createElement;
49
+ var defaultStyle = {
50
+ display: 'block',
51
+ position: 'absolute',
52
+ zIndex: 20000,
53
+ padding: '4px 6px'
54
+ };
55
+ var dynamicStyle = {
56
+ top: this.top + 'px',
57
+ left: this.left + 'px'
58
+ };
59
+ return this.visible && h("div", {
60
+ "class": "k-header k-drag-clue",
61
+ style: __assign(__assign({}, defaultStyle), dynamicStyle)
62
+ }, [h("span", {
63
+ "class": classNames('k-icon k-drag-status k-icon-with-modifier', this.operationClassName)
64
+ }, [h("span", {
65
+ "class": "k-icon k-icon-modifier"
66
+ })]), this.text]);
67
+ },
68
+ methods: {
69
+ show: function show(top, left, text, operationClassName) {
70
+ this.visible = true;
71
+ this.top = top;
72
+ this.left = left;
73
+ this.text = text;
74
+ this.operationClassName = operationClassName;
75
+ },
76
+ hide: function hide() {
77
+ this.visible = false;
78
+ }
79
+ }
80
+ };
81
+ /**
82
+ * Represents the Kendo UI for Vue Native TreeViewDragClue component which renders a clue when an item is dragged.
83
+ *
84
+ * {% meta height:400 %}
85
+ * {% embed_file drag/single/main.vue preview %}
86
+ * {% embed_file drag/single/main.js %}
87
+ * {% endmeta %}
88
+ *
89
+ * ## Methods
90
+ *
91
+ * ### hide
92
+ * Hides the TreeViewDragClue component.
93
+ *
94
+ * ### show
95
+ * Displays the TreeViewDragClue component.
96
+ *
97
+ * #### Parameters
98
+ * ##### top <span class='code'>number</span>
99
+ * The `top` CSS position of the component.
100
+ *
101
+ * ##### left <span class='code'>number</span>
102
+ * The `left` CSS position of the component.
103
+ *
104
+ * ##### text <span class='code'>string</span>
105
+ * The text of the component.
106
+ *
107
+ * ##### operationClassName <span class='code'>string</span>
108
+ * The CSS class name which is related to the specific drop operation.
109
+ */
110
+
111
+ var TreeViewDragClue = TreeViewDragClueVue2;
112
+ export { TreeViewDragClue, TreeViewDragClueVue2 };
@@ -0,0 +1,75 @@
1
+ import { DefineComponent } from './additionalTypes';
2
+ import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
3
+ declare type DefaultData<V> = object | ((this: V) => {});
4
+ declare type DefaultMethods<V> = {
5
+ [key: string]: (this: V, ...args: any[]) => any;
6
+ };
7
+ import FieldsService from './utils/FieldsService';
8
+ /**
9
+ * @hidden
10
+ */
11
+ export interface TreeViewItemProps {
12
+ item: any;
13
+ itemId: string;
14
+ treeGuid: string;
15
+ animate: boolean;
16
+ focusedItemId?: string;
17
+ tabbableItemId: string;
18
+ fieldsService: FieldsService;
19
+ itemUI?: any;
20
+ ariaMultiSelectable: boolean;
21
+ onItemClick?: any;
22
+ expandIcons?: boolean;
23
+ onExpandChange?: any;
24
+ onCheckChange?: any;
25
+ checkboxes?: boolean;
26
+ onFocusDomElNeeded?: any;
27
+ draggable?: boolean;
28
+ onPress?: any;
29
+ onDrag?: any;
30
+ onRelease?: any;
31
+ size?: null | 'small' | 'medium' | 'large' | string;
32
+ }
33
+ /**
34
+ * @hidden
35
+ */
36
+ export interface TreeViewItemState {
37
+ checkboxElement: any;
38
+ itemGuid: any;
39
+ }
40
+ /**
41
+ * @hidden
42
+ */
43
+ export interface TreeViewItemComputed {
44
+ [key: string]: any;
45
+ fieldsSvc: any;
46
+ currentTabIndex: number;
47
+ ariaExpanded?: boolean;
48
+ ariaChecked?: string | boolean;
49
+ ariaSelected?: boolean;
50
+ }
51
+ /**
52
+ * @hidden
53
+ */
54
+ export interface TreeViewItemMethods {
55
+ [key: string]: any;
56
+ }
57
+ /**
58
+ * @hidden
59
+ */
60
+ export interface TreeViewItemData {
61
+ }
62
+ /**
63
+ * @hidden
64
+ */
65
+ export interface TreeViewItemAll extends Vue, TreeViewItemMethods, TreeViewItemData, TreeViewItemComputed, TreeViewItemState {
66
+ }
67
+ /**
68
+ * @hidden
69
+ */
70
+ declare let TreeViewItemVue2: ComponentOptions<TreeViewItemAll, DefaultData<TreeViewItemData>, DefaultMethods<TreeViewItemAll>, TreeViewItemComputed, RecordPropsDefinition<TreeViewItemProps>>;
71
+ /**
72
+ * @hidden
73
+ */
74
+ declare const TreeViewItem: DefineComponent<TreeViewItemProps, any, TreeViewItemData, TreeViewItemComputed, TreeViewItemMethods, {}, {}, {}, string, TreeViewItemProps, TreeViewItemProps, {}>;
75
+ export { TreeViewItem, TreeViewItemVue2 };
@@ -0,0 +1,404 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+
6
+ for (var p in s) {
7
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ }; // @ts-ignore
16
+
17
+
18
+ import * as Vue from 'vue';
19
+ var allVue = Vue;
20
+ var gh = allVue.h;
21
+ var isV3 = allVue.version && allVue.version[0] === '3';
22
+ import { classNames, guid, Draggable, kendoThemeMaps, getTemplate, setRef, getRef } from '@progress/kendo-vue-common';
23
+ import { createId } from './utils/itemIdUtils.js';
24
+ import { isItemExpandedAndWithChildren, hasChildren } from './utils/itemUtils.js';
25
+ import { Reveal } from '@progress/kendo-vue-animation';
26
+ import { DOM_KENDO_ITEM_ID_FIELD, DOM_KENDO_TREEVIEW_GUID_FIELD } from './utils/consts.js';
27
+ var sizeMap = kendoThemeMaps.sizeMap;
28
+ /**
29
+ * @hidden
30
+ */
31
+
32
+ var TreeViewItemVue2 = {
33
+ name: 'KendoTreeViewItem',
34
+ props: {
35
+ item: Object,
36
+ itemId: String,
37
+ treeGuid: String,
38
+ animate: Boolean,
39
+ focusedItemId: String,
40
+ tabbableItemId: String,
41
+ fieldsService: Object,
42
+ itemUI: Object,
43
+ ariaMultiSelectable: Boolean,
44
+ expandIcons: Boolean,
45
+ checkboxes: Boolean,
46
+ onFocusDomElNeeded: Object,
47
+ draggable: Boolean,
48
+ size: {
49
+ type: String,
50
+ default: 'medium',
51
+ validator: function validator(value) {
52
+ return [null, 'small', 'medium', 'large'].includes(value);
53
+ }
54
+ }
55
+ },
56
+ computed: {
57
+ fieldsSvc: function fieldsSvc() {
58
+ return this.$props.fieldsService;
59
+ },
60
+ currentTabIndex: function currentTabIndex() {
61
+ return (this.$props.focusedItemId || this.$props.tabbableItemId) === this.itemId ? 0 : -1;
62
+ },
63
+ ariaExpanded: function ariaExpanded() {
64
+ return this.fieldsSvc.hasChildren(this.item) || hasChildren(this.item, this.fieldsSvc.getChildrenField()) ? Boolean(this.fieldsSvc.expanded(this.item)) : undefined;
65
+ },
66
+ ariaChecked: function ariaChecked() {
67
+ if (this.$props.checkboxes) {
68
+ if (this.fieldsSvc.checked(this.item)) {
69
+ return 'true';
70
+ } else {
71
+ return this.fieldsSvc.checkIndeterminate(this.item) ? 'mixed' : 'false';
72
+ }
73
+ } else {
74
+ return undefined;
75
+ }
76
+ },
77
+ ariaSelected: function ariaSelected() {
78
+ if (this.fieldsSvc.selected(this.item)) {
79
+ return true;
80
+ } else if (this.$props.ariaMultiSelectable) {
81
+ return this.fieldsSvc.disabled(this.item) ? undefined : false;
82
+ } else {
83
+ return undefined;
84
+ }
85
+ }
86
+ },
87
+ created: function created() {
88
+ this.itemGuid = guid();
89
+ this.prevFocusedItemId = this.focusedItemId;
90
+ this.prevFieldsService = this.fieldsService;
91
+ this.prevItem = this.item;
92
+ },
93
+ watch: {
94
+ focusedItemId: function focusedItemId(_, oldValue) {
95
+ this.prevFocusedItemId = oldValue;
96
+ },
97
+ fieldsService: function fieldsService(_, oldValue) {
98
+ this.prevFieldsService = oldValue;
99
+ },
100
+ item: function item(_, oldValue) {
101
+ this.prevItem = oldValue;
102
+ }
103
+ },
104
+ mounted: function mounted() {
105
+ var focusedItemId = this.$props.focusedItemId;
106
+ var currentItemId = this.itemId;
107
+
108
+ if (focusedItemId && focusedItemId === currentItemId) {
109
+ this.$emit('focusdomelneeded', this.$el);
110
+ }
111
+
112
+ this.checkboxElement = getRef(this, 'checkboxElement');
113
+
114
+ if (this.checkboxElement) {
115
+ this.checkboxElement.indeterminate = this.fieldsSvc.checkIndeterminate(this.item);
116
+ }
117
+
118
+ this.assignDraggableMeta(this.$refs.treemid);
119
+ },
120
+ updated: function updated() {
121
+ var focusedItemId = this.$props.focusedItemId;
122
+
123
+ if (focusedItemId && focusedItemId !== this.prevFocusedItemId && focusedItemId === this.itemId) {
124
+ this.$emit('focusdomelneeded', this.$el);
125
+ }
126
+
127
+ this.checkboxElement = getRef(this, 'checkboxElement');
128
+
129
+ if (this.checkboxElement) {
130
+ var indeterminate = this.fieldsSvc.checkIndeterminate(this.item);
131
+
132
+ if (indeterminate !== this.prevFieldsService.checkIndeterminate(this.prevItem)) {
133
+ this.checkboxElement.indeterminate = indeterminate;
134
+ }
135
+ }
136
+
137
+ this.assignDraggableMeta(this.$refs.treemid);
138
+ },
139
+ // @ts-ignore
140
+ setup: !isV3 ? undefined : function () {
141
+ var v3 = !!isV3;
142
+ return {
143
+ v3: v3
144
+ };
145
+ },
146
+ // @ts-ignore
147
+ render: function render(createElement) {
148
+ var _this2 = this;
149
+
150
+ var _this = this;
151
+
152
+ var h = gh || createElement;
153
+
154
+ var subitems = function subitems() {
155
+ return isItemExpandedAndWithChildren(this.item, this.fieldsSvc) ? h("ul", {
156
+ "class": "k-treeview-group",
157
+ role: "group",
158
+ attrs: this.v3 ? undefined : {
159
+ role: "group"
160
+ }
161
+ }, [this.fieldsSvc.children(this.item).map(function (item, index) {
162
+ return h(TreeViewItem, {
163
+ item: item,
164
+ attrs: this.v3 ? undefined : {
165
+ item: item,
166
+ itemId: createId(index, this.itemId),
167
+ treeGuid: this.$props.treeGuid,
168
+ animate: this.$props.animate,
169
+ focusedItemId: this.$props.focusedItemId,
170
+ tabbableItemId: this.$props.tabbableItemId,
171
+ fieldsService: this.$props.fieldsService,
172
+ itemUI: this.$props.itemUI,
173
+ checkboxes: this.$props.checkboxes,
174
+ ariaMultiSelectable: this.$props.ariaMultiSelectable,
175
+ draggable: this.$props.draggable,
176
+ expandIcons: this.$props.expandIcons,
177
+ size: this.$props.size
178
+ },
179
+ itemId: createId(index, this.itemId),
180
+ treeGuid: this.$props.treeGuid,
181
+ animate: this.$props.animate,
182
+ focusedItemId: this.$props.focusedItemId,
183
+ tabbableItemId: this.$props.tabbableItemId,
184
+ fieldsService: this.$props.fieldsService,
185
+ itemUI: this.$props.itemUI,
186
+ checkboxes: this.$props.checkboxes,
187
+ ariaMultiSelectable: this.$props.ariaMultiSelectable,
188
+ onItemclick: this.handleItemClick,
189
+ on: this.v3 ? undefined : {
190
+ "itemclick": this.handleItemClick,
191
+ "focusdomelneeded": this.handleFocusDomElNeeded,
192
+ "press": this.handlePress,
193
+ "drag": this.handleDrag,
194
+ "release": this.handleRelease,
195
+ "expandchange": this.handleExpandChange,
196
+ "checkchange": this.handleCheckChange
197
+ },
198
+ onFocusdomelneeded: this.handleFocusDomElNeeded,
199
+ draggable: this.$props.draggable,
200
+ onPress: this.handlePress,
201
+ onDrag: this.handleDrag,
202
+ onRelease: this.handleRelease,
203
+ expandIcons: this.$props.expandIcons,
204
+ onExpandchange: this.handleExpandChange,
205
+ onCheckchange: this.handleCheckChange,
206
+ key: index,
207
+ size: this.$props.size
208
+ });
209
+ }, this)]) : undefined;
210
+ };
211
+
212
+ var renderExpandIcon = function renderExpandIcon() {
213
+ var renderExpand = this.$props.expandIcons && ( // If it is explicitly said that the item has children (even not loaded yet)
214
+ // or if the item actually has children, then render the icon.
215
+ this.fieldsSvc.hasChildren(this.item) || hasChildren(this.item, this.fieldsSvc.getChildrenField()));
216
+ return renderExpand && h("span", {
217
+ "class": "k-treeview-toggle"
218
+ }, [h("span", {
219
+ "class": this.getIconClassName(),
220
+ onClick: this.handleExpandChange,
221
+ on: this.v3 ? undefined : {
222
+ "click": this.handleExpandChange
223
+ }
224
+ })]);
225
+ };
226
+
227
+ var renderCheckbox = function renderCheckbox() {
228
+ var _a;
229
+
230
+ if (this.$props.checkboxes) {
231
+ var size = this.$props.size;
232
+ return h("div", {
233
+ "class": "k-checkbox-wrap"
234
+ }, [h("input", {
235
+ type: "checkbox",
236
+ attrs: this.v3 ? undefined : {
237
+ type: "checkbox",
238
+ id: this.itemGuid,
239
+ tabindex: -1
240
+ },
241
+ "class": classNames('k-checkbox k-rounded-md', (_a = {}, _a["k-checkbox-".concat(sizeMap[size] || size)] = size, _a)),
242
+ checked: this.v3 ? Boolean(this.fieldsSvc.checked(this.item)) : null,
243
+ domProps: this.v3 ? undefined : {
244
+ "checked": Boolean(this.fieldsSvc.checked(this.item))
245
+ },
246
+ id: this.itemGuid,
247
+ tabindex: -1,
248
+ onChange: this.handleCheckChange,
249
+ on: this.v3 ? undefined : {
250
+ "change": this.handleCheckChange
251
+ },
252
+ ref: setRef(this, 'checkboxElement')
253
+ }), h("label", {
254
+ "class": "k-checkbox-label",
255
+ "for": this.itemGuid,
256
+ attrs: this.v3 ? undefined : {
257
+ "for": this.itemGuid
258
+ }
259
+ })]);
260
+ } else {
261
+ return undefined;
262
+ }
263
+ };
264
+
265
+ var itemRender = getTemplate.call(this, {
266
+ h: h,
267
+ template: this.$props.itemUI,
268
+ defaultRendering: this.fieldsSvc.text(this.item),
269
+ additionalProps: {
270
+ item: this.item,
271
+ itemHierarchicalIndex: this.itemId
272
+ }
273
+ });
274
+
275
+ var itemInPart = function itemInPart() {
276
+ return h("span", {
277
+ "class": this.getContentClassName(),
278
+ style: {
279
+ touchAction: 'none'
280
+ },
281
+ onClick: this.handleItemClick,
282
+ on: this.v3 ? undefined : {
283
+ "click": this.handleItemClick
284
+ }
285
+ }, [h("span", {
286
+ "class": "k-treeview-leaf-text"
287
+ }, [itemRender])]);
288
+ };
289
+
290
+ return h("li", {
291
+ "class": this.getRootClassName(),
292
+ tabindex: this.currentTabIndex,
293
+ attrs: this.v3 ? undefined : {
294
+ tabindex: this.currentTabIndex,
295
+ role: "treeitem",
296
+ "aria-expanded": this.ariaExpanded,
297
+ "aria-selected": this.ariaSelected,
298
+ "aria-checked": this.ariaChecked,
299
+ "aria-disabled": this.fieldsSvc.disabled(this.item) ? true : undefined
300
+ },
301
+ role: "treeitem",
302
+ "aria-expanded": this.ariaExpanded,
303
+ "aria-selected": this.ariaSelected,
304
+ "aria-checked": this.ariaChecked,
305
+ "aria-disabled": this.fieldsSvc.disabled(this.item) ? true : undefined
306
+ }, [h("div", {
307
+ "class": "k-treeview-mid",
308
+ ref: 'treemid'
309
+ }, [renderExpandIcon.call(this), renderCheckbox.call(this), this.$props.draggable ? // @ts-ignore function children
310
+ h(Draggable, {
311
+ onPress: function onPress(e) {
312
+ return _this.handlePress(e);
313
+ },
314
+ on: this.v3 ? undefined : {
315
+ "press": function onPress(e) {
316
+ return _this.handlePress(e);
317
+ },
318
+ "drag": function drag(e) {
319
+ return _this.handleDrag(e);
320
+ },
321
+ "release": function release(e) {
322
+ return _this.handleRelease(e);
323
+ }
324
+ },
325
+ onDrag: function drag(e) {
326
+ return _this.handleDrag(e);
327
+ },
328
+ onRelease: function release(e) {
329
+ return _this.handleRelease(e);
330
+ }
331
+ }, this.v3 ? function () {
332
+ return [itemInPart.call(_this2)];
333
+ } : [itemInPart.call(_this2)]) : itemInPart.call(this)]), this.$props.animate ? // @ts-ignore function children
334
+ h(Reveal, {
335
+ appear: this.ariaExpanded,
336
+ attrs: this.v3 ? undefined : {
337
+ appear: this.ariaExpanded,
338
+ transitionEnterDuration: 200,
339
+ transitionExitDuration: 200
340
+ },
341
+ transitionEnterDuration: 200,
342
+ transitionExitDuration: 200,
343
+ style: {
344
+ display: 'block'
345
+ }
346
+ }, this.v3 ? function () {
347
+ return [subitems.call(_this2)];
348
+ } : [subitems.call(_this2)]) : subitems.call(this)]);
349
+ },
350
+ methods: {
351
+ handleCheckChange: function handleCheckChange(e, subItem, subItemId) {
352
+ this.$emit('checkchange', e, subItem || this.item, subItemId || this.itemId);
353
+ },
354
+ handleExpandChange: function handleExpandChange(e, subItem, subItemId) {
355
+ this.$emit('expandchange', e, subItem || this.item, subItemId || this.itemId);
356
+ },
357
+ handleItemClick: function handleItemClick(e, subItem, subItemId) {
358
+ this.$emit('itemclick', e, subItem || this.item, subItemId || this.itemId);
359
+ },
360
+ handlePress: function handlePress(e, subItem, subItemId) {
361
+ this.$emit('press', e, subItem || __assign({}, this.item), subItemId || this.itemId);
362
+ },
363
+ handleDrag: function handleDrag(e, subItem, subItemId) {
364
+ this.$emit('drag', e, subItem || this.item, subItemId || this.itemId);
365
+ },
366
+ handleRelease: function handleRelease(e, subItem, subItemId) {
367
+ this.$emit('release', e, subItem || this.item, subItemId || this.itemId);
368
+ },
369
+ handleFocusDomElNeeded: function handleFocusDomElNeeded(e) {
370
+ this.$emit('focusdomelneeded', e);
371
+ },
372
+ getIconClassName: function getIconClassName() {
373
+ var expanded = this.fieldsSvc.expanded(this.item);
374
+ return classNames('k-icon', {
375
+ 'k-i-expand': !expanded,
376
+ 'k-i-collapse': expanded,
377
+ 'k-i-loading': expanded && !hasChildren(this.item, this.fieldsSvc.getChildrenField())
378
+ });
379
+ },
380
+ getRootClassName: function getRootClassName() {
381
+ return classNames('k-treeview-item', {
382
+ 'k-disabled': this.fieldsSvc.disabled(this.item)
383
+ }, this.item.class);
384
+ },
385
+ getContentClassName: function getContentClassName() {
386
+ return classNames('k-treeview-leaf', {
387
+ 'k-focus': this.$props.focusedItemId === this.itemId,
388
+ 'k-selected': this.fieldsSvc.selected(this.item)
389
+ });
390
+ },
391
+ assignDraggableMeta: function assignDraggableMeta(element) {
392
+ if (element && !element[DOM_KENDO_ITEM_ID_FIELD]) {
393
+ element[DOM_KENDO_ITEM_ID_FIELD] = this.$props.itemId;
394
+ element[DOM_KENDO_TREEVIEW_GUID_FIELD] = this.$props.treeGuid;
395
+ }
396
+ }
397
+ }
398
+ };
399
+ /**
400
+ * @hidden
401
+ */
402
+
403
+ var TreeViewItem = TreeViewItemVue2;
404
+ export { TreeViewItem, TreeViewItemVue2 };
@@ -0,0 +1,76 @@
1
+ /**
2
+ * The descriptors of the data operations which are applied to the TreeView component.
3
+ */
4
+ export interface TreeViewOperationDescriptors {
5
+ /**
6
+ * The hierarchical indices of the items to which the expand operation will be applied, or the descriptor of the operation.
7
+ */
8
+ expand?: string[] | TreeViewOperationDescriptor;
9
+ /**
10
+ * The hierarchical indices of the items to which the select operation will be applied, or the descriptor of the operation.
11
+ */
12
+ select?: string[] | TreeViewOperationDescriptor;
13
+ /**
14
+ * The hierarchical indices of the items to which the check operation will be applied, or the descriptor of the operation.
15
+ */
16
+ check?: string[] | TreeViewCheckDescriptor;
17
+ /**
18
+ * When the operations are applied, the corresponding items and their parents are cloned.
19
+ * For performance reasons, TreeView items are cloned only once.
20
+ * The name of the field which provides a Boolean representation of whether an item is already cloned.
21
+ * Defaults to `cloned`.
22
+ */
23
+ cloneField?: string;
24
+ /**
25
+ * The expand field of the item.
26
+ */
27
+ expandField?: string;
28
+ /**
29
+ * The select field of the item.
30
+ */
31
+ selectField?: string;
32
+ /**
33
+ * The check field of the item.
34
+ */
35
+ checkField?: string;
36
+ /**
37
+ * The children field of the item.
38
+ */
39
+ childrenField?: string;
40
+ }
41
+ /**
42
+ * The descriptor which is used for expanding, selecting, and checking.
43
+ */
44
+ export interface TreeViewOperationDescriptor {
45
+ /**
46
+ * The IDs of the items to which the operation will be applied. By default, the TreeView applies the hierarchical indices of the items. These indices are zero-based. The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index.
47
+ */
48
+ ids?: any[];
49
+ /**
50
+ * The name of the field which will provide a Boolean representation for the operation state of the item.
51
+ *
52
+ * The default fields are:
53
+ * * `expanded`&mdash;Indicates that an item is expanded.
54
+ * * `selected`&mdash;Indicates that an item is selected.
55
+ * * `checked`&mdash;Indicates that an item is checked.
56
+ */
57
+ operationField?: string;
58
+ /**
59
+ * The name of the field which will uniquely describe an item as an alternative to its hierarchical index.
60
+ */
61
+ idField?: string;
62
+ }
63
+ /**
64
+ * The descriptor which is used for checking.
65
+ */
66
+ export interface TreeViewCheckDescriptor extends TreeViewOperationDescriptor {
67
+ /**
68
+ * Determines if a parent item will have an indeterminate state when not all its children are checked.
69
+ */
70
+ applyCheckIndeterminate?: boolean;
71
+ /**
72
+ * The name of the field which will provide a Boolean representation for the indeterminate state of a parent item.
73
+ * Defaults to `checkIndeterminate`.
74
+ */
75
+ checkIndeterminateField?: string;
76
+ }
@@ -0,0 +1,2 @@
1
+ /* eslint-disable max-len */
2
+ export {};