@progress/kendo-angular-treeview 21.4.1 → 22.0.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.
Files changed (83) hide show
  1. package/fesm2022/progress-kendo-angular-treeview.mjs +115 -115
  2. package/filtering-base.d.ts +1 -1
  3. package/localization/messages.d.ts +1 -1
  4. package/package.json +11 -19
  5. package/schematics/ngAdd/index.js +4 -4
  6. package/esm2022/check-mode.mjs +0 -5
  7. package/esm2022/check.directive.mjs +0 -334
  8. package/esm2022/checkable-settings.mjs +0 -5
  9. package/esm2022/checkbox/checked-state.mjs +0 -5
  10. package/esm2022/data-bound-component.mjs +0 -19
  11. package/esm2022/data-change-notification.service.mjs +0 -14
  12. package/esm2022/default-callbacks.mjs +0 -36
  13. package/esm2022/directives.mjs +0 -53
  14. package/esm2022/disable.directive.mjs +0 -83
  15. package/esm2022/drag-and-drop/drag-and-drop-editing.directive.mjs +0 -76
  16. package/esm2022/drag-and-drop/drag-and-drop-utils.mjs +0 -270
  17. package/esm2022/drag-and-drop/drag-and-drop.directive.mjs +0 -348
  18. package/esm2022/drag-and-drop/drag-clue/drag-clue-template.directive.mjs +0 -44
  19. package/esm2022/drag-and-drop/drag-clue/drag-clue.component.mjs +0 -132
  20. package/esm2022/drag-and-drop/drag-clue/drag-clue.service.mjs +0 -123
  21. package/esm2022/drag-and-drop/drop-hint/drop-hint-template.directive.mjs +0 -43
  22. package/esm2022/drag-and-drop/drop-hint/drop-hint.component.mjs +0 -102
  23. package/esm2022/drag-and-drop/drop-hint/drop-hint.service.mjs +0 -41
  24. package/esm2022/drag-and-drop/editing-services/drag-and-drop-asset.service.mjs +0 -48
  25. package/esm2022/drag-and-drop/editing-services/flat-editing.service.mjs +0 -141
  26. package/esm2022/drag-and-drop/editing-services/hierarchy-editing.service.mjs +0 -88
  27. package/esm2022/drag-and-drop/models/drop-action.mjs +0 -32
  28. package/esm2022/drag-and-drop/models/drop-position.mjs +0 -22
  29. package/esm2022/drag-and-drop/models/editing-service.mjs +0 -5
  30. package/esm2022/drag-and-drop/models/preventable-event.mjs +0 -25
  31. package/esm2022/drag-and-drop/models/scroll-direction.mjs +0 -12
  32. package/esm2022/drag-and-drop/models/scroll-settings.mjs +0 -5
  33. package/esm2022/drag-and-drop/models/tree-item-filter-state.mjs +0 -5
  34. package/esm2022/drag-and-drop/models/treeitem-add-remove-args.mjs +0 -5
  35. package/esm2022/drag-and-drop/models/treeitem-drag-event.mjs +0 -24
  36. package/esm2022/drag-and-drop/models/treeitem-drag-start-event.mjs +0 -25
  37. package/esm2022/drag-and-drop/models/treeitem-drop-event.mjs +0 -54
  38. package/esm2022/drag-and-drop/models.mjs +0 -14
  39. package/esm2022/expand-state.service.mjs +0 -24
  40. package/esm2022/expand.directive.mjs +0 -226
  41. package/esm2022/expandable-component.mjs +0 -19
  42. package/esm2022/filter-expand-settings.interface.mjs +0 -5
  43. package/esm2022/filter-state.interface.mjs +0 -5
  44. package/esm2022/filtering-base.mjs +0 -92
  45. package/esm2022/flat-binding.directive.mjs +0 -165
  46. package/esm2022/funcs.mjs +0 -9
  47. package/esm2022/hierarchy-binding.directive.mjs +0 -164
  48. package/esm2022/index-builder.service.mjs +0 -33
  49. package/esm2022/index.mjs +0 -31
  50. package/esm2022/load-more/load-more-button-template.directive.mjs +0 -41
  51. package/esm2022/load-more/load-more-request-args.mjs +0 -5
  52. package/esm2022/load-more/load-more-utils.mjs +0 -35
  53. package/esm2022/load-more/load-more.directive.mjs +0 -137
  54. package/esm2022/load-more/load-more.service.mjs +0 -5
  55. package/esm2022/loading-indicator.directive.mjs +0 -69
  56. package/esm2022/loading-notification.service.mjs +0 -21
  57. package/esm2022/localization/custom-messages.component.mjs +0 -54
  58. package/esm2022/localization/localized-messages.directive.mjs +0 -39
  59. package/esm2022/localization/messages.mjs +0 -27
  60. package/esm2022/navigation/navigation-item.interface.mjs +0 -5
  61. package/esm2022/navigation/navigation-model.mjs +0 -152
  62. package/esm2022/navigation/navigation-state.interface.mjs +0 -5
  63. package/esm2022/navigation/navigation.service.mjs +0 -248
  64. package/esm2022/node-children.service.mjs +0 -21
  65. package/esm2022/node-click-event.interface.mjs +0 -5
  66. package/esm2022/node-template.directive.mjs +0 -45
  67. package/esm2022/package-metadata.mjs +0 -16
  68. package/esm2022/progress-kendo-angular-treeview.mjs +0 -8
  69. package/esm2022/selection/select.directive.mjs +0 -174
  70. package/esm2022/selection/selectable-settings.mjs +0 -5
  71. package/esm2022/selection/selection-mode.mjs +0 -5
  72. package/esm2022/selection/selection.service.mjs +0 -33
  73. package/esm2022/size.mjs +0 -5
  74. package/esm2022/treeitem-lookup.interface.mjs +0 -5
  75. package/esm2022/treeitem.interface.mjs +0 -5
  76. package/esm2022/treeview-filter-settings.mjs +0 -12
  77. package/esm2022/treeview-group.component.mjs +0 -759
  78. package/esm2022/treeview-item-content.directive.mjs +0 -82
  79. package/esm2022/treeview-item.directive.mjs +0 -245
  80. package/esm2022/treeview-lookup.service.mjs +0 -89
  81. package/esm2022/treeview.component.mjs +0 -874
  82. package/esm2022/treeview.module.mjs +0 -74
  83. package/esm2022/utils.mjs +0 -301
@@ -1,759 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Component, HostBinding, Input, TemplateRef, ChangeDetectorRef, Renderer2 } from '@angular/core';
6
- import { trigger, style, animate, transition } from '@angular/animations';
7
- import { getter } from '@progress/kendo-common';
8
- import { ExpandStateService } from './expand-state.service';
9
- import { IndexBuilderService } from './index-builder.service';
10
- import { TreeViewLookupService } from './treeview-lookup.service';
11
- import { NavigationService } from './navigation/navigation.service';
12
- import { NodeChildrenService } from './node-children.service';
13
- import { isPresent, isArray } from './utils';
14
- import { LoadingNotificationService } from './loading-notification.service';
15
- import { Subscription, EMPTY, of } from 'rxjs';
16
- import { catchError, tap, finalize, filter } from 'rxjs/operators';
17
- import { DataChangeNotificationService } from './data-change-notification.service';
18
- import { caretAltDownIcon, caretAltLeftIcon, caretAltRightIcon } from '@progress/kendo-svg-icons';
19
- import { LocalizationService } from '@progress/kendo-angular-l10n';
20
- import { TreeViewItemContentDirective } from './treeview-item-content.directive';
21
- import { LoadingIndicatorDirective } from './loading-indicator.directive';
22
- import { TreeViewItemDirective } from './treeview-item.directive';
23
- import { NgClass, NgTemplateOutlet } from '@angular/common';
24
- import { IconWrapperComponent } from '@progress/kendo-angular-icons';
25
- import { CheckBoxComponent } from '@progress/kendo-angular-inputs';
26
- import * as i0 from "@angular/core";
27
- import * as i1 from "./expand-state.service";
28
- import * as i2 from "./loading-notification.service";
29
- import * as i3 from "./index-builder.service";
30
- import * as i4 from "./treeview-lookup.service";
31
- import * as i5 from "./navigation/navigation.service";
32
- import * as i6 from "./node-children.service";
33
- import * as i7 from "./data-change-notification.service";
34
- import * as i8 from "@progress/kendo-angular-l10n";
35
- const TOP_ITEM = 'k-treeview-top';
36
- const MID_ITEM = 'k-treeview-mid';
37
- const BOT_ITEM = 'k-treeview-bot';
38
- /**
39
- * @hidden
40
- */
41
- export class TreeViewGroupComponent {
42
- expandService;
43
- loadingService;
44
- indexBuilder;
45
- treeViewLookupService;
46
- navigationService;
47
- nodeChildrenService;
48
- dataChangeNotification;
49
- changeDetectorRef;
50
- localization;
51
- renderer;
52
- /**
53
- * @hidden
54
- */
55
- caretAltDownIcon = caretAltDownIcon;
56
- /**
57
- * @hidden
58
- */
59
- caretAltRightIcon = caretAltRightIcon;
60
- /**
61
- * @hidden
62
- */
63
- caretAltLeftIcon = caretAltLeftIcon;
64
- /**
65
- * @hidden
66
- */
67
- loadMoreTitle;
68
- kGroupClass = true;
69
- get role() {
70
- return this.parentIndex ? 'group' : 'tree';
71
- }
72
- checkboxes;
73
- expandIcons;
74
- disabled;
75
- selectable;
76
- touchActions;
77
- disableParentNodesOnly;
78
- loadOnDemand = true;
79
- trackBy;
80
- nodes;
81
- textField = "";
82
- parentDataItem;
83
- parentIndex;
84
- nodeTemplateRef;
85
- loadMoreButtonTemplateRef;
86
- loadMoreService;
87
- size = 'medium';
88
- expandDisabledNodes;
89
- initialNodesLoaded = false;
90
- loadingMoreNodes = false;
91
- isItemExpandable = (node, index) => this.expandDisabledNodes || !this.isItemDisabled(node, index);
92
- getFontIcon(node, index) {
93
- return this.isExpanded(node, index) ? 'caret-alt-down' : !this.localization.rtl ? 'caret-alt-right' : 'caret-alt-left';
94
- }
95
- getSvgIcon(node, index) {
96
- return this.isExpanded(node, index) ? caretAltDownIcon : !this.localization.rtl ? caretAltRightIcon : caretAltLeftIcon;
97
- }
98
- get moreNodesAvailable() {
99
- if (!isPresent(this.loadMoreService) || this.data.length === 0) {
100
- return false;
101
- }
102
- return this.pageSize < this.totalNodesCount || (this.data.length < this.totalNodesCount && this.data.length <= this.pageSize);
103
- }
104
- get pageSize() {
105
- if (!isPresent(this.loadMoreService)) {
106
- return null;
107
- }
108
- return this.loadMoreService.getGroupSize(this.parentDataItem);
109
- }
110
- set pageSize(pageSize) {
111
- this.loadMoreService.setGroupSize(this.parentDataItem, pageSize);
112
- }
113
- get data() {
114
- if (isPresent(this.pageSize)) {
115
- const normalizedSizeValue = this.pageSize > 0 ? this.pageSize : 0;
116
- return this._data.slice(0, normalizedSizeValue);
117
- }
118
- return this._data;
119
- }
120
- set data(data) {
121
- this._data = data;
122
- this.registerLoadedNodes(this.data);
123
- }
124
- get loadMoreButtonIndex() {
125
- if (!this.loadMoreService) {
126
- return null;
127
- }
128
- return this.nodeIndex(this.data.length);
129
- }
130
- /**
131
- * Represents the total number of nodes for the current level.
132
- */
133
- get totalNodesCount() {
134
- if (!this.loadMoreService) {
135
- return this.data.length;
136
- }
137
- return this.loadMoreService.getTotalNodesCount(this.parentDataItem, this._data.length);
138
- }
139
- _data = [];
140
- nodesSubscription;
141
- loadMoreNodesSubscription;
142
- singleRecordSubscriptions = new Subscription();
143
- localizationSubscriptions = new Subscription();
144
- constructor(expandService, loadingService, indexBuilder, treeViewLookupService, navigationService, nodeChildrenService, dataChangeNotification, changeDetectorRef, localization, renderer) {
145
- this.expandService = expandService;
146
- this.loadingService = loadingService;
147
- this.indexBuilder = indexBuilder;
148
- this.treeViewLookupService = treeViewLookupService;
149
- this.navigationService = navigationService;
150
- this.nodeChildrenService = nodeChildrenService;
151
- this.dataChangeNotification = dataChangeNotification;
152
- this.changeDetectorRef = changeDetectorRef;
153
- this.localization = localization;
154
- this.renderer = renderer;
155
- }
156
- isChecked = () => 'none';
157
- isDisabled = () => false;
158
- hasCheckbox = () => true;
159
- isExpanded = () => false;
160
- isVisible = () => true;
161
- isSelected = () => false;
162
- children = () => of([]);
163
- hasChildren = () => false;
164
- get hasTemplate() {
165
- return isPresent(this.nodeTemplateRef);
166
- }
167
- expandNode(index, dataItem, expand) {
168
- if (expand) {
169
- this.expandService.expand(index, dataItem);
170
- }
171
- else {
172
- this.expandService.collapse(index, dataItem);
173
- }
174
- }
175
- checkNode(index, checkBox) {
176
- this.navigationService.checkIndex(index);
177
- this.navigationService.activateIndex(index);
178
- if (checkBox?.input) {
179
- this.renderer.removeClass(checkBox.input.nativeElement, 'k-focus');
180
- }
181
- }
182
- nodeIndex(index) {
183
- return this.indexBuilder.nodeIndex(index.toString(), this.parentIndex);
184
- }
185
- nodeText(dataItem) {
186
- const textField = isArray(this.textField) ? this.textField[0] : this.textField;
187
- return getter(textField)(dataItem);
188
- }
189
- getCheckBoxState(item, index) {
190
- const state = this.isChecked(item, index);
191
- if (state === 'indeterminate') {
192
- return state;
193
- }
194
- return state === 'checked';
195
- }
196
- getCheckboxAttributes(index) {
197
- return { 'aria-hidden': 'true', role: 'none', 'aria-labelledby': this.nodeIndex(index) };
198
- }
199
- ngOnDestroy() {
200
- if (isPresent(this.nodesSubscription)) {
201
- this.nodesSubscription.unsubscribe();
202
- }
203
- if (isPresent(this.loadMoreNodesSubscription)) {
204
- this.loadMoreNodesSubscription.unsubscribe();
205
- }
206
- this.singleRecordSubscriptions.unsubscribe();
207
- this.localizationSubscriptions.unsubscribe();
208
- }
209
- ngOnInit() {
210
- this.subscribeToNodesChange();
211
- this.singleRecordSubscriptions.add(this.dataChangeNotification
212
- .changes
213
- .subscribe(this.subscribeToNodesChange.bind(this)));
214
- this.singleRecordSubscriptions.add(this.navigationService.loadMore
215
- .pipe(filter(index => index === this.loadMoreButtonIndex))
216
- .subscribe(this.loadMoreNodes.bind(this)));
217
- this.localizationSubscriptions.add(this.localization.changes.subscribe(this.l10nChange.bind(this)));
218
- }
219
- ngOnChanges(changes) {
220
- if (changes.parentIndex && this.loadOnDemand) {
221
- this.setNodeChildren(this.mapToTreeItem(this.data));
222
- }
223
- if (this.localization.get('loadMore')) {
224
- this.loadMoreTitle = this.localization.get('loadMore');
225
- }
226
- }
227
- l10nChange() {
228
- if (this.localization.get('loadMore')) {
229
- this.loadMoreTitle = this.localization.get('loadMore');
230
- }
231
- this.changeDetectorRef.markForCheck();
232
- }
233
- fetchChildren(node, index) {
234
- return this.children(node)
235
- .pipe(catchError(() => {
236
- this.loadingService.notifyLoaded(index);
237
- return EMPTY;
238
- }), tap(() => this.loadingService.notifyLoaded(index)));
239
- }
240
- get nextFields() {
241
- if (isArray(this.textField)) {
242
- return this.textField.length > 1 ? this.textField.slice(1) : this.textField;
243
- }
244
- return [this.textField];
245
- }
246
- loadMoreNodes() {
247
- if (isPresent(this.loadMoreService.loadMoreNodes)) {
248
- this.fetchMoreNodes();
249
- }
250
- else {
251
- this.loadMoreLocalNodes();
252
- }
253
- }
254
- /**
255
- * @hidden
256
- */
257
- isItemDisabled(node, index) {
258
- return (this.disabled && !this.disableParentNodesOnly) || this.isDisabled(node, this.nodeIndex(index));
259
- }
260
- /**
261
- * @hidden
262
- */
263
- setItemClasses(dataLength, index) {
264
- if (dataLength === 1) {
265
- return this.parentIndex ? BOT_ITEM : `${TOP_ITEM} ${BOT_ITEM}`;
266
- }
267
- if (index === 0) {
268
- return TOP_ITEM;
269
- }
270
- if (index > 0 && index < dataLength - 1) {
271
- return MID_ITEM;
272
- }
273
- return index === this.totalNodesCount - 1 ? BOT_ITEM : MID_ITEM;
274
- }
275
- loadMoreLocalNodes() {
276
- const initialLoadMoreButtonIndex = this.loadMoreButtonIndex;
277
- this.pageSize += this.loadMoreService.getInitialPageSize(this.parentDataItem);
278
- this.registerLoadedNodes(this.data);
279
- // forces the new items to be registered before the focus is changed
280
- this.changeDetectorRef.detectChanges();
281
- this.reselectItemAt(initialLoadMoreButtonIndex);
282
- }
283
- fetchMoreNodes() {
284
- if (this.loadingMoreNodes) {
285
- return;
286
- }
287
- this.loadingMoreNodes = true;
288
- if (isPresent(this.loadMoreNodesSubscription)) {
289
- this.loadMoreNodesSubscription.unsubscribe();
290
- }
291
- this.loadMoreNodesSubscription = this.loadMoreService
292
- .loadMoreNodes({
293
- dataItem: this.parentDataItem,
294
- skip: this.data.length,
295
- take: this.loadMoreService.getInitialPageSize(this.parentDataItem)
296
- })
297
- .pipe(finalize(() => this.loadingMoreNodes = false))
298
- .subscribe(items => {
299
- if (!(Array.isArray(items) && items.length > 0)) {
300
- return;
301
- }
302
- const initialLoadMoreButtonIndex = this.loadMoreButtonIndex;
303
- this.pageSize += items.length;
304
- this.data = this.data.concat(items);
305
- if (this.navigationService.isActive(initialLoadMoreButtonIndex)) {
306
- // forces the new items to be registered before the focus is changed
307
- this.changeDetectorRef.detectChanges();
308
- this.reselectItemAt(initialLoadMoreButtonIndex);
309
- }
310
- });
311
- }
312
- setNodeChildren(children) {
313
- this.treeViewLookupService.registerChildren(this.parentIndex, children);
314
- }
315
- mapToTreeItem(data) {
316
- if (!this.parentIndex) {
317
- return [];
318
- }
319
- return data.map((dataItem, idx) => ({ dataItem, index: this.nodeIndex(idx) }));
320
- }
321
- emitChildrenLoaded(children) {
322
- if (!this.parentIndex) {
323
- return;
324
- }
325
- // ignores the registered load-more button
326
- const contentChildren = children.filter(item => item.dataItem);
327
- this.nodeChildrenService.childrenLoaded({ dataItem: this.parentDataItem, index: this.parentIndex }, contentChildren);
328
- }
329
- subscribeToNodesChange() {
330
- if (this.nodesSubscription) {
331
- this.nodesSubscription.unsubscribe();
332
- }
333
- this.nodesSubscription = this.nodes(this.parentDataItem, this.parentIndex)
334
- .subscribe(data => {
335
- this.data = data;
336
- this.initialNodesLoaded = true;
337
- });
338
- }
339
- reselectItemAt(index) {
340
- if (!isPresent(index)) {
341
- return;
342
- }
343
- // make sure the old index is cleared first
344
- this.navigationService.deactivate();
345
- this.navigationService.activateIndex(index);
346
- }
347
- registerLoadedNodes(nodes = []) {
348
- const mappedChildren = this.mapToTreeItem(nodes);
349
- if (this.loadOnDemand) {
350
- this.setNodeChildren(mappedChildren);
351
- }
352
- this.emitChildrenLoaded(mappedChildren);
353
- }
354
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TreeViewGroupComponent, deps: [{ token: i1.ExpandStateService }, { token: i2.LoadingNotificationService }, { token: i3.IndexBuilderService }, { token: i4.TreeViewLookupService }, { token: i5.NavigationService }, { token: i6.NodeChildrenService }, { token: i7.DataChangeNotificationService }, { token: i0.ChangeDetectorRef }, { token: i8.LocalizationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
355
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TreeViewGroupComponent, isStandalone: true, selector: "[kendoTreeViewGroup]", inputs: { checkboxes: "checkboxes", expandIcons: "expandIcons", disabled: "disabled", selectable: "selectable", touchActions: "touchActions", disableParentNodesOnly: "disableParentNodesOnly", loadOnDemand: "loadOnDemand", trackBy: "trackBy", nodes: "nodes", textField: "textField", parentDataItem: "parentDataItem", parentIndex: "parentIndex", nodeTemplateRef: "nodeTemplateRef", loadMoreButtonTemplateRef: "loadMoreButtonTemplateRef", loadMoreService: "loadMoreService", size: "size", expandDisabledNodes: "expandDisabledNodes", isChecked: "isChecked", isDisabled: "isDisabled", hasCheckbox: "hasCheckbox", isExpanded: "isExpanded", isVisible: "isVisible", isSelected: "isSelected", children: "children", hasChildren: "hasChildren" }, host: { properties: { "class.k-treeview-group": "this.kGroupClass", "attr.role": "this.role" } }, usesOnChanges: true, ngImport: i0, template: `
356
- @for (node of data; track trackBy ? trackBy(index, node) : index; let index = $index) {
357
- <li
358
- class="k-treeview-item"
359
- [class.k-hidden]="!isVisible(node, nodeIndex(index))"
360
- kendoTreeViewItem
361
- [attr.aria-setsize]="totalNodesCount"
362
- [dataItem]="node"
363
- [index]="nodeIndex(index)"
364
- [parentDataItem]="parentDataItem"
365
- [parentIndex]="parentIndex"
366
- [loadOnDemand]="loadOnDemand"
367
- [checkable]="checkboxes"
368
- [isChecked]="isChecked(node, nodeIndex(index))"
369
- [isDisabled]="isItemDisabled(node, index)"
370
- [isVisible]="isVisible(node, nodeIndex(index))"
371
- [expandable]="expandIcons && hasChildren(node)"
372
- [isExpanded]="isExpanded(node, nodeIndex(index))"
373
- [selectable]="selectable"
374
- [isSelected]="isSelected(node, nodeIndex(index))"
375
- [attr.data-treeindex]="nodeIndex(index)"
376
- >
377
- <div [ngClass]="setItemClasses(data.length, index)">
378
- @if (expandIcons && hasChildren(node)) {
379
- <span
380
- [class.k-disabled]="!isItemExpandable(node, index)"
381
- class="k-treeview-toggle"
382
- [kendoTreeViewLoading]="nodeIndex(index)"
383
- (click)="expandNode(nodeIndex(index), node, !isExpanded(node, nodeIndex(index)))"
384
- >
385
- <kendo-icon-wrapper
386
- [name]="getFontIcon(node, nodeIndex(index))"
387
- [svgIcon]="getSvgIcon(node, nodeIndex(index))">
388
- </kendo-icon-wrapper>
389
- </span>
390
- }
391
- @if (checkboxes && hasCheckbox(node, nodeIndex(index))) {
392
- <kendo-checkbox
393
- #checkbox
394
- [disabled]="isItemDisabled(node, index)"
395
- [size]="size"
396
- [checkedState]="getCheckBoxState(node, nodeIndex(index))"
397
- (checkedStateChange)="checkNode(nodeIndex(index), checkbox)"
398
- [tabindex]="-1"
399
- [inputAttributes]="getCheckboxAttributes(index)"
400
- ></kendo-checkbox>
401
- }
402
- <span kendoTreeViewItemContent
403
- [id]="nodeIndex(index)"
404
- [attr.data-treeindex]="nodeIndex(index)"
405
- [dataItem]="node"
406
- [index]="nodeIndex(index)"
407
- [initialSelection]="isSelected(node, nodeIndex(index))"
408
- [isSelected]="isSelected"
409
- class="k-treeview-leaf"
410
- [style.touch-action]="touchActions ? '' : 'none'"
411
- [class.k-disabled]="isItemDisabled(node, index)"
412
- >
413
- <span class="k-treeview-leaf-text">
414
- @switch (hasTemplate) {
415
- @case (true) {
416
- <ng-template
417
- [ngTemplateOutlet]="nodeTemplateRef"
418
- [ngTemplateOutletContext]="{
419
- $implicit: node,
420
- index: nodeIndex(index)
421
- }"
422
- >
423
- </ng-template>
424
- }
425
- @default {
426
- {{nodeText(node)}}
427
- }
428
- }
429
- </span>
430
- </span>
431
- </div>
432
- @if (isExpanded(node, nodeIndex(index)) && hasChildren(node)) {
433
- <ul
434
- kendoTreeViewGroup
435
- role="group"
436
- [size]="size"
437
- [nodes]="fetchChildren"
438
- [loadOnDemand]="loadOnDemand"
439
- [checkboxes]="checkboxes"
440
- [expandIcons]="expandIcons"
441
- [selectable]="selectable"
442
- [touchActions]="touchActions"
443
- [children]="children"
444
- [hasChildren]="hasChildren"
445
- [isChecked]="isChecked"
446
- [isDisabled]="isDisabled"
447
- [hasCheckbox]="hasCheckbox"
448
- [disabled]="isItemDisabled(node, index)"
449
- [expandDisabledNodes]="expandDisabledNodes"
450
- [isExpanded]="isExpanded"
451
- [isSelected]="isSelected"
452
- [isVisible]="isVisible"
453
- [nodeTemplateRef]="nodeTemplateRef"
454
- [loadMoreButtonTemplateRef]="loadMoreButtonTemplateRef"
455
- [parentIndex]="nodeIndex(index)"
456
- [parentDataItem]="node"
457
- [textField]="nextFields"
458
- [loadMoreService]="loadMoreService"
459
- [@toggle]="true"
460
- [trackBy]="trackBy"
461
- [disableParentNodesOnly]="disableParentNodesOnly"
462
- >
463
- </ul>
464
- }
465
- </li>
466
- }
467
- @if (initialNodesLoaded && moreNodesAvailable) {
468
- <li
469
- class="k-treeview-item"
470
- [class.k-treeview-load-more-checkboxes-container]="checkboxes"
471
- kendoTreeViewItem
472
- role="button"
473
- [selectable]="false"
474
- [checkable]="false"
475
- [expandable]="false"
476
- [index]="loadMoreButtonIndex"
477
- [parentDataItem]="parentDataItem"
478
- [parentIndex]="parentIndex"
479
- [attr.data-treeindex]="loadMoreButtonIndex"
480
- >
481
- <div class="k-treeview-bot">
482
- @if (loadingMoreNodes) {
483
- <span
484
- class="k-icon k-i-loading"
485
- >
486
- </span>
487
- }
488
- <span
489
- class="k-treeview-leaf k-treeview-load-more-button"
490
- [attr.data-treeindex]="loadMoreButtonIndex"
491
- kendoTreeViewItemContent
492
- [index]="loadMoreButtonIndex"
493
- >
494
- <span class="k-treeview-leaf-text">
495
- @if (loadMoreButtonTemplateRef) {
496
- <ng-template
497
- [ngTemplateOutlet]="loadMoreButtonTemplateRef"
498
- [ngTemplateOutletContext]="{
499
- index: loadMoreButtonIndex
500
- }"
501
- >
502
- </ng-template>
503
- }
504
- @if (!loadMoreButtonTemplateRef) {
505
- {{ loadMoreTitle }}
506
- }
507
- </span>
508
- </span>
509
- </div>
510
- </li>
511
- }
512
- `, isInline: true, dependencies: [{ kind: "component", type: TreeViewGroupComponent, selector: "[kendoTreeViewGroup]", inputs: ["checkboxes", "expandIcons", "disabled", "selectable", "touchActions", "disableParentNodesOnly", "loadOnDemand", "trackBy", "nodes", "textField", "parentDataItem", "parentIndex", "nodeTemplateRef", "loadMoreButtonTemplateRef", "loadMoreService", "size", "expandDisabledNodes", "isChecked", "isDisabled", "hasCheckbox", "isExpanded", "isVisible", "isSelected", "children", "hasChildren"] }, { kind: "directive", type: TreeViewItemDirective, selector: "[kendoTreeViewItem]", inputs: ["dataItem", "index", "parentDataItem", "parentIndex", "role", "loadOnDemand", "checkable", "selectable", "expandable", "isChecked", "isDisabled", "isVisible", "isExpanded", "isSelected"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: LoadingIndicatorDirective, selector: "[kendoTreeViewLoading]", inputs: ["kendoTreeViewLoading"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: CheckBoxComponent, selector: "kendo-checkbox", inputs: ["checkedState", "rounded"], outputs: ["checkedStateChange"], exportAs: ["kendoCheckBox"] }, { kind: "directive", type: TreeViewItemContentDirective, selector: "[kendoTreeViewItemContent]", inputs: ["dataItem", "index", "initialSelection", "isSelected"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], animations: [
513
- trigger('toggle', [
514
- transition('void => *', [
515
- style({ height: 0 }),
516
- animate('0.1s ease-in', style({ height: "*" }))
517
- ]),
518
- transition('* => void', [
519
- style({ height: "*" }),
520
- animate('0.1s ease-in', style({ height: 0 }))
521
- ])
522
- ])
523
- ] });
524
- }
525
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TreeViewGroupComponent, decorators: [{
526
- type: Component,
527
- args: [{
528
- animations: [
529
- trigger('toggle', [
530
- transition('void => *', [
531
- style({ height: 0 }),
532
- animate('0.1s ease-in', style({ height: "*" }))
533
- ]),
534
- transition('* => void', [
535
- style({ height: "*" }),
536
- animate('0.1s ease-in', style({ height: 0 }))
537
- ])
538
- ])
539
- ],
540
- // eslint-disable-next-line
541
- selector: '[kendoTreeViewGroup]',
542
- template: `
543
- @for (node of data; track trackBy ? trackBy(index, node) : index; let index = $index) {
544
- <li
545
- class="k-treeview-item"
546
- [class.k-hidden]="!isVisible(node, nodeIndex(index))"
547
- kendoTreeViewItem
548
- [attr.aria-setsize]="totalNodesCount"
549
- [dataItem]="node"
550
- [index]="nodeIndex(index)"
551
- [parentDataItem]="parentDataItem"
552
- [parentIndex]="parentIndex"
553
- [loadOnDemand]="loadOnDemand"
554
- [checkable]="checkboxes"
555
- [isChecked]="isChecked(node, nodeIndex(index))"
556
- [isDisabled]="isItemDisabled(node, index)"
557
- [isVisible]="isVisible(node, nodeIndex(index))"
558
- [expandable]="expandIcons && hasChildren(node)"
559
- [isExpanded]="isExpanded(node, nodeIndex(index))"
560
- [selectable]="selectable"
561
- [isSelected]="isSelected(node, nodeIndex(index))"
562
- [attr.data-treeindex]="nodeIndex(index)"
563
- >
564
- <div [ngClass]="setItemClasses(data.length, index)">
565
- @if (expandIcons && hasChildren(node)) {
566
- <span
567
- [class.k-disabled]="!isItemExpandable(node, index)"
568
- class="k-treeview-toggle"
569
- [kendoTreeViewLoading]="nodeIndex(index)"
570
- (click)="expandNode(nodeIndex(index), node, !isExpanded(node, nodeIndex(index)))"
571
- >
572
- <kendo-icon-wrapper
573
- [name]="getFontIcon(node, nodeIndex(index))"
574
- [svgIcon]="getSvgIcon(node, nodeIndex(index))">
575
- </kendo-icon-wrapper>
576
- </span>
577
- }
578
- @if (checkboxes && hasCheckbox(node, nodeIndex(index))) {
579
- <kendo-checkbox
580
- #checkbox
581
- [disabled]="isItemDisabled(node, index)"
582
- [size]="size"
583
- [checkedState]="getCheckBoxState(node, nodeIndex(index))"
584
- (checkedStateChange)="checkNode(nodeIndex(index), checkbox)"
585
- [tabindex]="-1"
586
- [inputAttributes]="getCheckboxAttributes(index)"
587
- ></kendo-checkbox>
588
- }
589
- <span kendoTreeViewItemContent
590
- [id]="nodeIndex(index)"
591
- [attr.data-treeindex]="nodeIndex(index)"
592
- [dataItem]="node"
593
- [index]="nodeIndex(index)"
594
- [initialSelection]="isSelected(node, nodeIndex(index))"
595
- [isSelected]="isSelected"
596
- class="k-treeview-leaf"
597
- [style.touch-action]="touchActions ? '' : 'none'"
598
- [class.k-disabled]="isItemDisabled(node, index)"
599
- >
600
- <span class="k-treeview-leaf-text">
601
- @switch (hasTemplate) {
602
- @case (true) {
603
- <ng-template
604
- [ngTemplateOutlet]="nodeTemplateRef"
605
- [ngTemplateOutletContext]="{
606
- $implicit: node,
607
- index: nodeIndex(index)
608
- }"
609
- >
610
- </ng-template>
611
- }
612
- @default {
613
- {{nodeText(node)}}
614
- }
615
- }
616
- </span>
617
- </span>
618
- </div>
619
- @if (isExpanded(node, nodeIndex(index)) && hasChildren(node)) {
620
- <ul
621
- kendoTreeViewGroup
622
- role="group"
623
- [size]="size"
624
- [nodes]="fetchChildren"
625
- [loadOnDemand]="loadOnDemand"
626
- [checkboxes]="checkboxes"
627
- [expandIcons]="expandIcons"
628
- [selectable]="selectable"
629
- [touchActions]="touchActions"
630
- [children]="children"
631
- [hasChildren]="hasChildren"
632
- [isChecked]="isChecked"
633
- [isDisabled]="isDisabled"
634
- [hasCheckbox]="hasCheckbox"
635
- [disabled]="isItemDisabled(node, index)"
636
- [expandDisabledNodes]="expandDisabledNodes"
637
- [isExpanded]="isExpanded"
638
- [isSelected]="isSelected"
639
- [isVisible]="isVisible"
640
- [nodeTemplateRef]="nodeTemplateRef"
641
- [loadMoreButtonTemplateRef]="loadMoreButtonTemplateRef"
642
- [parentIndex]="nodeIndex(index)"
643
- [parentDataItem]="node"
644
- [textField]="nextFields"
645
- [loadMoreService]="loadMoreService"
646
- [@toggle]="true"
647
- [trackBy]="trackBy"
648
- [disableParentNodesOnly]="disableParentNodesOnly"
649
- >
650
- </ul>
651
- }
652
- </li>
653
- }
654
- @if (initialNodesLoaded && moreNodesAvailable) {
655
- <li
656
- class="k-treeview-item"
657
- [class.k-treeview-load-more-checkboxes-container]="checkboxes"
658
- kendoTreeViewItem
659
- role="button"
660
- [selectable]="false"
661
- [checkable]="false"
662
- [expandable]="false"
663
- [index]="loadMoreButtonIndex"
664
- [parentDataItem]="parentDataItem"
665
- [parentIndex]="parentIndex"
666
- [attr.data-treeindex]="loadMoreButtonIndex"
667
- >
668
- <div class="k-treeview-bot">
669
- @if (loadingMoreNodes) {
670
- <span
671
- class="k-icon k-i-loading"
672
- >
673
- </span>
674
- }
675
- <span
676
- class="k-treeview-leaf k-treeview-load-more-button"
677
- [attr.data-treeindex]="loadMoreButtonIndex"
678
- kendoTreeViewItemContent
679
- [index]="loadMoreButtonIndex"
680
- >
681
- <span class="k-treeview-leaf-text">
682
- @if (loadMoreButtonTemplateRef) {
683
- <ng-template
684
- [ngTemplateOutlet]="loadMoreButtonTemplateRef"
685
- [ngTemplateOutletContext]="{
686
- index: loadMoreButtonIndex
687
- }"
688
- >
689
- </ng-template>
690
- }
691
- @if (!loadMoreButtonTemplateRef) {
692
- {{ loadMoreTitle }}
693
- }
694
- </span>
695
- </span>
696
- </div>
697
- </li>
698
- }
699
- `,
700
- standalone: true,
701
- imports: [TreeViewItemDirective, NgClass, LoadingIndicatorDirective, IconWrapperComponent, CheckBoxComponent, TreeViewItemContentDirective, NgTemplateOutlet]
702
- }]
703
- }], ctorParameters: () => [{ type: i1.ExpandStateService }, { type: i2.LoadingNotificationService }, { type: i3.IndexBuilderService }, { type: i4.TreeViewLookupService }, { type: i5.NavigationService }, { type: i6.NodeChildrenService }, { type: i7.DataChangeNotificationService }, { type: i0.ChangeDetectorRef }, { type: i8.LocalizationService }, { type: i0.Renderer2 }], propDecorators: { kGroupClass: [{
704
- type: HostBinding,
705
- args: ["class.k-treeview-group"]
706
- }], role: [{
707
- type: HostBinding,
708
- args: ["attr.role"]
709
- }], checkboxes: [{
710
- type: Input
711
- }], expandIcons: [{
712
- type: Input
713
- }], disabled: [{
714
- type: Input
715
- }], selectable: [{
716
- type: Input
717
- }], touchActions: [{
718
- type: Input
719
- }], disableParentNodesOnly: [{
720
- type: Input
721
- }], loadOnDemand: [{
722
- type: Input
723
- }], trackBy: [{
724
- type: Input
725
- }], nodes: [{
726
- type: Input
727
- }], textField: [{
728
- type: Input
729
- }], parentDataItem: [{
730
- type: Input
731
- }], parentIndex: [{
732
- type: Input
733
- }], nodeTemplateRef: [{
734
- type: Input
735
- }], loadMoreButtonTemplateRef: [{
736
- type: Input
737
- }], loadMoreService: [{
738
- type: Input
739
- }], size: [{
740
- type: Input
741
- }], expandDisabledNodes: [{
742
- type: Input
743
- }], isChecked: [{
744
- type: Input
745
- }], isDisabled: [{
746
- type: Input
747
- }], hasCheckbox: [{
748
- type: Input
749
- }], isExpanded: [{
750
- type: Input
751
- }], isVisible: [{
752
- type: Input
753
- }], isSelected: [{
754
- type: Input
755
- }], children: [{
756
- type: Input
757
- }], hasChildren: [{
758
- type: Input
759
- }] } });