@progress/kendo-angular-treeview 16.5.0-develop.6 → 16.6.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 (57) hide show
  1. package/check.directive.d.ts +1 -1
  2. package/directives.d.ts +23 -0
  3. package/disable.directive.d.ts +1 -1
  4. package/drag-and-drop/drag-and-drop-editing.directive.d.ts +1 -1
  5. package/drag-and-drop/drag-and-drop.directive.d.ts +1 -1
  6. package/drag-and-drop/drag-clue/drag-clue-template.directive.d.ts +1 -1
  7. package/drag-and-drop/drag-clue/drag-clue.component.d.ts +1 -1
  8. package/drag-and-drop/drop-hint/drop-hint-template.directive.d.ts +1 -1
  9. package/drag-and-drop/drop-hint/drop-hint.component.d.ts +1 -1
  10. package/esm2020/check.directive.mjs +5 -2
  11. package/esm2020/directives.mjs +39 -0
  12. package/esm2020/disable.directive.mjs +5 -2
  13. package/esm2020/drag-and-drop/drag-and-drop-editing.directive.mjs +3 -2
  14. package/esm2020/drag-and-drop/drag-and-drop.directive.mjs +3 -2
  15. package/esm2020/drag-and-drop/drag-clue/drag-clue-template.directive.mjs +3 -2
  16. package/esm2020/drag-and-drop/drag-clue/drag-clue.component.mjs +7 -5
  17. package/esm2020/drag-and-drop/drop-hint/drop-hint-template.directive.mjs +3 -2
  18. package/esm2020/drag-and-drop/drop-hint/drop-hint.component.mjs +6 -4
  19. package/esm2020/expand.directive.mjs +5 -2
  20. package/esm2020/flat-binding.directive.mjs +5 -2
  21. package/esm2020/hierarchy-binding.directive.mjs +5 -2
  22. package/esm2020/index.mjs +1 -0
  23. package/esm2020/load-more/load-more-button-template.directive.mjs +3 -2
  24. package/esm2020/load-more/load-more.directive.mjs +3 -2
  25. package/esm2020/loading-indicator.directive.mjs +5 -2
  26. package/esm2020/localization/custom-messages.component.mjs +3 -2
  27. package/esm2020/localization/localized-messages.directive.mjs +3 -2
  28. package/esm2020/node-template.directive.mjs +3 -2
  29. package/esm2020/package-metadata.mjs +2 -2
  30. package/esm2020/selection/select.directive.mjs +5 -2
  31. package/esm2020/treeview-group.component.mjs +11 -9
  32. package/esm2020/treeview-item-content.directive.mjs +5 -2
  33. package/esm2020/treeview-item.directive.mjs +5 -2
  34. package/esm2020/treeview.component.mjs +10 -9
  35. package/esm2020/treeview.module.mjs +42 -54
  36. package/expand.directive.d.ts +1 -1
  37. package/fesm2015/progress-kendo-angular-treeview.mjs +1326 -1372
  38. package/fesm2020/progress-kendo-angular-treeview.mjs +1174 -1220
  39. package/flat-binding.directive.d.ts +1 -1
  40. package/hierarchy-binding.directive.d.ts +1 -1
  41. package/index.d.ts +1 -0
  42. package/load-more/load-more-button-template.directive.d.ts +1 -1
  43. package/load-more/load-more.directive.d.ts +1 -1
  44. package/loading-indicator.directive.d.ts +1 -1
  45. package/localization/custom-messages.component.d.ts +1 -1
  46. package/localization/localized-messages.directive.d.ts +1 -1
  47. package/node-template.directive.d.ts +1 -1
  48. package/package.json +6 -6
  49. package/schematics/ngAdd/index.js +4 -4
  50. package/selection/select.directive.d.ts +1 -1
  51. package/treeview-group.component.d.ts +1 -1
  52. package/treeview-item-content.directive.d.ts +1 -1
  53. package/treeview-item.directive.d.ts +1 -1
  54. package/treeview.component.d.ts +1 -1
  55. package/treeview.module.d.ts +16 -18
  56. package/esm2020/shared.module.mjs +0 -125
  57. package/shared.module.d.ts +0 -38
@@ -4,22 +4,21 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
6
  import { EventEmitter, Injectable, Directive, Optional, Input, HostBinding, Component, forwardRef, isDevMode, ViewContainerRef, ChangeDetectionStrategy, ViewChild, Output, ContentChild, Host, NgModule } from '@angular/core';
7
- import { isDocumentAvailable, Keys, anyChanged, hasObservers, isChanged, guid } from '@progress/kendo-angular-common';
7
+ import { isDocumentAvailable, Keys, anyChanged, hasObservers, isChanged, guid, ResizeBatchService } from '@progress/kendo-angular-common';
8
8
  import * as i1 from '@progress/kendo-angular-l10n';
9
9
  import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
10
10
  import { Subject, Subscription, of, EMPTY, BehaviorSubject, merge } from 'rxjs';
11
11
  import { validatePackage } from '@progress/kendo-licensing';
12
12
  import { getter, setter } from '@progress/kendo-common';
13
13
  import { caretAltDownIcon, caretAltRightIcon, caretAltLeftIcon, searchIcon, cancelIcon, insertMiddleIcon, insertBottomIcon, insertTopIcon, plusIcon } from '@progress/kendo-svg-icons';
14
- import * as i9 from '@angular/common';
15
- import { CommonModule } from '@angular/common';
16
- import * as i9$1 from '@progress/kendo-angular-inputs';
17
- import { InputsModule } from '@progress/kendo-angular-inputs';
18
- import * as i11 from '@progress/kendo-angular-icons';
19
- import { IconsModule } from '@progress/kendo-angular-icons';
14
+ import { CheckBoxComponent, TextBoxComponent, TextBoxPrefixTemplateDirective } from '@progress/kendo-angular-inputs';
20
15
  import { trigger, transition, style, animate } from '@angular/animations';
21
16
  import { filter, tap, switchMap, delay, takeUntil, catchError, finalize, take, map } from 'rxjs/operators';
17
+ import { NgFor, NgClass, NgIf, NgSwitch, NgSwitchCase, NgTemplateOutlet, NgSwitchDefault } from '@angular/common';
18
+ import { IconWrapperComponent, IconsService } from '@progress/kendo-angular-icons';
22
19
  import { Draggable } from '@progress/kendo-draggable';
20
+ import { DialogContainerService, DialogService, WindowService, WindowContainerService } from '@progress/kendo-angular-dialog';
21
+ import { PopupService } from '@progress/kendo-angular-popup';
23
22
 
24
23
  /**
25
24
  * @hidden
@@ -28,8 +27,8 @@ const packageMetadata = {
28
27
  name: '@progress/kendo-angular-treeview',
29
28
  productName: 'Kendo UI for Angular',
30
29
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
31
- publishDate: 1721766078,
32
- version: '16.5.0-develop.6',
30
+ publishDate: 1721827712,
31
+ version: '16.6.0-develop.1',
33
32
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
34
33
  };
35
34
 
@@ -899,11 +898,12 @@ class NodeTemplateDirective {
899
898
  }
900
899
  }
901
900
  NodeTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NodeTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
902
- NodeTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: NodeTemplateDirective, selector: "[kendoTreeViewNodeTemplate]", ngImport: i0 });
901
+ NodeTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: NodeTemplateDirective, isStandalone: true, selector: "[kendoTreeViewNodeTemplate]", ngImport: i0 });
903
902
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NodeTemplateDirective, decorators: [{
904
903
  type: Directive,
905
904
  args: [{
906
- selector: '[kendoTreeViewNodeTemplate]'
905
+ selector: '[kendoTreeViewNodeTemplate]',
906
+ standalone: true
907
907
  }]
908
908
  }], ctorParameters: function () {
909
909
  return [{ type: i0.TemplateRef, decorators: [{
@@ -927,11 +927,12 @@ class LoadMoreButtonTemplateDirective {
927
927
  }
928
928
  }
929
929
  LoadMoreButtonTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadMoreButtonTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
930
- LoadMoreButtonTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LoadMoreButtonTemplateDirective, selector: "[kendoTreeViewLoadMoreButtonTemplate]", ngImport: i0 });
930
+ LoadMoreButtonTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LoadMoreButtonTemplateDirective, isStandalone: true, selector: "[kendoTreeViewLoadMoreButtonTemplate]", ngImport: i0 });
931
931
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadMoreButtonTemplateDirective, decorators: [{
932
932
  type: Directive,
933
933
  args: [{
934
- selector: '[kendoTreeViewLoadMoreButtonTemplate]'
934
+ selector: '[kendoTreeViewLoadMoreButtonTemplate]',
935
+ standalone: true
935
936
  }]
936
937
  }], ctorParameters: function () {
937
938
  return [{ type: i0.TemplateRef, decorators: [{
@@ -1080,6 +1081,123 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1080
1081
  type: Injectable
1081
1082
  }] });
1082
1083
 
1084
+ /**
1085
+ * @hidden
1086
+ *
1087
+ * A directive which manages the expanded state of the TreeView.
1088
+ */
1089
+ class TreeViewItemContentDirective {
1090
+ constructor(element, navigationService, selectionService, renderer) {
1091
+ this.element = element;
1092
+ this.navigationService = navigationService;
1093
+ this.selectionService = selectionService;
1094
+ this.renderer = renderer;
1095
+ this.initialSelection = false;
1096
+ this.isSelected = isSelected;
1097
+ this.subscriptions = new Subscription();
1098
+ this.subscriptions.add(this.navigationService.moves
1099
+ .subscribe(this.updateFocusClass.bind(this)));
1100
+ this.subscriptions.add(this.navigationService.selects
1101
+ .pipe(filter((index) => index === this.index))
1102
+ .subscribe((index) => this.selectionService.select(index, this.dataItem)));
1103
+ this.subscriptions.add(this.selectionService.changes
1104
+ .subscribe(() => {
1105
+ this.updateSelectionClass(this.isSelected(this.dataItem, this.index));
1106
+ }));
1107
+ }
1108
+ ngOnChanges(changes) {
1109
+ if (changes['initialSelection']) {
1110
+ this.updateSelectionClass(this.initialSelection);
1111
+ }
1112
+ if (changes['index']) {
1113
+ this.updateFocusClass();
1114
+ }
1115
+ }
1116
+ ngOnDestroy() {
1117
+ this.subscriptions.unsubscribe();
1118
+ }
1119
+ updateFocusClass() {
1120
+ this.render(this.navigationService.isActive(this.index), 'k-focus');
1121
+ }
1122
+ updateSelectionClass(selected) {
1123
+ this.render(selected, 'k-selected');
1124
+ }
1125
+ render(addClass, className) {
1126
+ const action = addClass ? 'addClass' : 'removeClass';
1127
+ this.renderer[action](this.element.nativeElement, className);
1128
+ }
1129
+ }
1130
+ TreeViewItemContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewItemContentDirective, deps: [{ token: i0.ElementRef }, { token: NavigationService }, { token: SelectionService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
1131
+ TreeViewItemContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TreeViewItemContentDirective, isStandalone: true, selector: "[kendoTreeViewItemContent]", inputs: { dataItem: "dataItem", index: "index", initialSelection: "initialSelection", isSelected: "isSelected" }, usesOnChanges: true, ngImport: i0 });
1132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewItemContentDirective, decorators: [{
1133
+ type: Directive,
1134
+ args: [{
1135
+ selector: '[kendoTreeViewItemContent]',
1136
+ standalone: true
1137
+ }]
1138
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: NavigationService }, { type: SelectionService }, { type: i0.Renderer2 }]; }, propDecorators: { dataItem: [{
1139
+ type: Input
1140
+ }], index: [{
1141
+ type: Input
1142
+ }], initialSelection: [{
1143
+ type: Input
1144
+ }], isSelected: [{
1145
+ type: Input
1146
+ }] } });
1147
+
1148
+ /**
1149
+ * @hidden
1150
+ */
1151
+ class LoadingIndicatorDirective {
1152
+ constructor(expandService, loadingService, cd) {
1153
+ this.expandService = expandService;
1154
+ this.loadingService = loadingService;
1155
+ this.cd = cd;
1156
+ this._loading = false;
1157
+ }
1158
+ get loading() {
1159
+ return this._loading;
1160
+ }
1161
+ set loading(value) {
1162
+ this._loading = value;
1163
+ this.cd.markForCheck();
1164
+ }
1165
+ ngOnInit() {
1166
+ const loadingNotifications = this.loadingService
1167
+ .changes
1168
+ .pipe(filter(index => index === this.index));
1169
+ this.subscription = this.expandService
1170
+ .changes
1171
+ .pipe(filter(({ index }) => index === this.index), tap(({ expand }) => {
1172
+ if (!expand && this.loading) {
1173
+ this.loading = false;
1174
+ }
1175
+ }), filter(({ expand }) => expand), switchMap(x => of(x).pipe(delay(100), takeUntil(loadingNotifications))))
1176
+ .subscribe(() => this.loading = true);
1177
+ this.subscription.add(loadingNotifications.subscribe(() => this.loading = false));
1178
+ }
1179
+ ngOnDestroy() {
1180
+ if (this.subscription) {
1181
+ this.subscription.unsubscribe();
1182
+ }
1183
+ }
1184
+ }
1185
+ LoadingIndicatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadingIndicatorDirective, deps: [{ token: ExpandStateService }, { token: LoadingNotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
1186
+ LoadingIndicatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LoadingIndicatorDirective, isStandalone: true, selector: "[kendoTreeViewLoading]", inputs: { index: ["kendoTreeViewLoading", "index"] }, host: { properties: { "class.k-i-loading": "this.loading" } }, ngImport: i0 });
1187
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadingIndicatorDirective, decorators: [{
1188
+ type: Directive,
1189
+ args: [{
1190
+ selector: '[kendoTreeViewLoading]',
1191
+ standalone: true
1192
+ }]
1193
+ }], ctorParameters: function () { return [{ type: ExpandStateService }, { type: LoadingNotificationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { loading: [{
1194
+ type: HostBinding,
1195
+ args: ["class.k-i-loading"]
1196
+ }], index: [{
1197
+ type: Input,
1198
+ args: ["kendoTreeViewLoading"]
1199
+ }] } });
1200
+
1083
1201
  const buildItem = (index, dataItem) => ({ dataItem, index });
1084
1202
  let id = 0;
1085
1203
  const TREE_ITEM_ROLE = 'treeitem';
@@ -1254,10 +1372,13 @@ class TreeViewItemDirective {
1254
1372
  }
1255
1373
  }
1256
1374
  TreeViewItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewItemDirective, deps: [{ token: i0.ElementRef }, { token: ExpandStateService }, { token: NavigationService }, { token: SelectionService }, { token: TreeViewLookupService }, { token: i0.Renderer2 }, { token: IndexBuilderService }], target: i0.ɵɵFactoryTarget.Directive });
1257
- TreeViewItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TreeViewItemDirective, selector: "[kendoTreeViewItem]", inputs: { dataItem: "dataItem", index: "index", parentDataItem: "parentDataItem", parentIndex: "parentIndex", role: "role", loadOnDemand: "loadOnDemand", checkable: "checkable", selectable: "selectable", expandable: "expandable", isChecked: "isChecked", isDisabled: "isDisabled", isVisible: "isVisible", isExpanded: "isExpanded", isSelected: "isSelected" }, usesOnChanges: true, ngImport: i0 });
1375
+ TreeViewItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TreeViewItemDirective, isStandalone: true, selector: "[kendoTreeViewItem]", inputs: { dataItem: "dataItem", index: "index", parentDataItem: "parentDataItem", parentIndex: "parentIndex", role: "role", loadOnDemand: "loadOnDemand", checkable: "checkable", selectable: "selectable", expandable: "expandable", isChecked: "isChecked", isDisabled: "isDisabled", isVisible: "isVisible", isExpanded: "isExpanded", isSelected: "isSelected" }, usesOnChanges: true, ngImport: i0 });
1258
1376
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewItemDirective, decorators: [{
1259
1377
  type: Directive,
1260
- args: [{ selector: '[kendoTreeViewItem]' }]
1378
+ args: [{
1379
+ selector: '[kendoTreeViewItem]',
1380
+ standalone: true
1381
+ }]
1261
1382
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ExpandStateService }, { type: NavigationService }, { type: SelectionService }, { type: TreeViewLookupService }, { type: i0.Renderer2 }, { type: IndexBuilderService }]; }, propDecorators: { dataItem: [{
1262
1383
  type: Input
1263
1384
  }], index: [{
@@ -1288,117 +1409,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1288
1409
  type: Input
1289
1410
  }] } });
1290
1411
 
1291
- /**
1292
- * @hidden
1293
- *
1294
- * A directive which manages the expanded state of the TreeView.
1295
- */
1296
- class TreeViewItemContentDirective {
1297
- constructor(element, navigationService, selectionService, renderer) {
1298
- this.element = element;
1299
- this.navigationService = navigationService;
1300
- this.selectionService = selectionService;
1301
- this.renderer = renderer;
1302
- this.initialSelection = false;
1303
- this.isSelected = isSelected;
1304
- this.subscriptions = new Subscription();
1305
- this.subscriptions.add(this.navigationService.moves
1306
- .subscribe(this.updateFocusClass.bind(this)));
1307
- this.subscriptions.add(this.navigationService.selects
1308
- .pipe(filter((index) => index === this.index))
1309
- .subscribe((index) => this.selectionService.select(index, this.dataItem)));
1310
- this.subscriptions.add(this.selectionService.changes
1311
- .subscribe(() => {
1312
- this.updateSelectionClass(this.isSelected(this.dataItem, this.index));
1313
- }));
1314
- }
1315
- ngOnChanges(changes) {
1316
- if (changes['initialSelection']) {
1317
- this.updateSelectionClass(this.initialSelection);
1318
- }
1319
- if (changes['index']) {
1320
- this.updateFocusClass();
1321
- }
1322
- }
1323
- ngOnDestroy() {
1324
- this.subscriptions.unsubscribe();
1325
- }
1326
- updateFocusClass() {
1327
- this.render(this.navigationService.isActive(this.index), 'k-focus');
1328
- }
1329
- updateSelectionClass(selected) {
1330
- this.render(selected, 'k-selected');
1331
- }
1332
- render(addClass, className) {
1333
- const action = addClass ? 'addClass' : 'removeClass';
1334
- this.renderer[action](this.element.nativeElement, className);
1335
- }
1336
- }
1337
- TreeViewItemContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewItemContentDirective, deps: [{ token: i0.ElementRef }, { token: NavigationService }, { token: SelectionService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
1338
- TreeViewItemContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TreeViewItemContentDirective, selector: "[kendoTreeViewItemContent]", inputs: { dataItem: "dataItem", index: "index", initialSelection: "initialSelection", isSelected: "isSelected" }, usesOnChanges: true, ngImport: i0 });
1339
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewItemContentDirective, decorators: [{
1340
- type: Directive,
1341
- args: [{ selector: '[kendoTreeViewItemContent]' }]
1342
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: NavigationService }, { type: SelectionService }, { type: i0.Renderer2 }]; }, propDecorators: { dataItem: [{
1343
- type: Input
1344
- }], index: [{
1345
- type: Input
1346
- }], initialSelection: [{
1347
- type: Input
1348
- }], isSelected: [{
1349
- type: Input
1350
- }] } });
1351
-
1352
- /**
1353
- * @hidden
1354
- */
1355
- class LoadingIndicatorDirective {
1356
- constructor(expandService, loadingService, cd) {
1357
- this.expandService = expandService;
1358
- this.loadingService = loadingService;
1359
- this.cd = cd;
1360
- this._loading = false;
1361
- }
1362
- get loading() {
1363
- return this._loading;
1364
- }
1365
- set loading(value) {
1366
- this._loading = value;
1367
- this.cd.markForCheck();
1368
- }
1369
- ngOnInit() {
1370
- const loadingNotifications = this.loadingService
1371
- .changes
1372
- .pipe(filter(index => index === this.index));
1373
- this.subscription = this.expandService
1374
- .changes
1375
- .pipe(filter(({ index }) => index === this.index), tap(({ expand }) => {
1376
- if (!expand && this.loading) {
1377
- this.loading = false;
1378
- }
1379
- }), filter(({ expand }) => expand), switchMap(x => of(x).pipe(delay(100), takeUntil(loadingNotifications))))
1380
- .subscribe(() => this.loading = true);
1381
- this.subscription.add(loadingNotifications.subscribe(() => this.loading = false));
1382
- }
1383
- ngOnDestroy() {
1384
- if (this.subscription) {
1385
- this.subscription.unsubscribe();
1386
- }
1387
- }
1388
- }
1389
- LoadingIndicatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadingIndicatorDirective, deps: [{ token: ExpandStateService }, { token: LoadingNotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
1390
- LoadingIndicatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LoadingIndicatorDirective, selector: "[kendoTreeViewLoading]", inputs: { index: ["kendoTreeViewLoading", "index"] }, host: { properties: { "class.k-i-loading": "this.loading" } }, ngImport: i0 });
1391
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadingIndicatorDirective, decorators: [{
1392
- type: Directive,
1393
- args: [{ selector: '[kendoTreeViewLoading]' }]
1394
- }], ctorParameters: function () { return [{ type: ExpandStateService }, { type: LoadingNotificationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { loading: [{
1395
- type: HostBinding,
1396
- args: ["class.k-i-loading"]
1397
- }], index: [{
1398
- type: Input,
1399
- args: ["kendoTreeViewLoading"]
1400
- }] } });
1401
-
1402
1412
  const TOP_ITEM = 'k-treeview-top';
1403
1413
  const MID_ITEM = 'k-treeview-mid';
1404
1414
  const BOT_ITEM = 'k-treeview-bot';
@@ -1686,7 +1696,7 @@ class TreeViewGroupComponent {
1686
1696
  }
1687
1697
  }
1688
1698
  TreeViewGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewGroupComponent, deps: [{ token: ExpandStateService }, { token: LoadingNotificationService }, { token: IndexBuilderService }, { token: TreeViewLookupService }, { token: NavigationService }, { token: NodeChildrenService }, { token: DataChangeNotificationService }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
1689
- TreeViewGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TreeViewGroupComponent, 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: `
1699
+ TreeViewGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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: `
1690
1700
  <li
1691
1701
  *ngFor="let node of data; let index = index; trackBy: trackBy"
1692
1702
  class="k-treeview-item"
@@ -1835,7 +1845,7 @@ TreeViewGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0",
1835
1845
  </span>
1836
1846
  </div>
1837
1847
  </li>
1838
- `, isInline: true, dependencies: [{ kind: "directive", type: i9.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i9.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i9.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i9.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i9$1.CheckBoxComponent, selector: "kendo-checkbox", inputs: ["checkedState", "rounded"], outputs: ["checkedStateChange"], exportAs: ["kendoCheckBox"] }, { kind: "component", type: i11.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { 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: TreeViewItemContentDirective, selector: "[kendoTreeViewItemContent]", inputs: ["dataItem", "index", "initialSelection", "isSelected"] }, { kind: "directive", type: LoadingIndicatorDirective, selector: "[kendoTreeViewLoading]", inputs: ["kendoTreeViewLoading"] }], animations: [
1848
+ `, 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: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgSwitchDefault, selector: "[ngSwitchDefault]" }], animations: [
1839
1849
  trigger('toggle', [
1840
1850
  transition('void => *', [
1841
1851
  style({ height: 0 }),
@@ -2013,7 +2023,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2013
2023
  </span>
2014
2024
  </div>
2015
2025
  </li>
2016
- `
2026
+ `,
2027
+ standalone: true,
2028
+ imports: [NgFor, TreeViewItemDirective, NgClass, NgIf, LoadingIndicatorDirective, IconWrapperComponent, CheckBoxComponent, TreeViewItemContentDirective, NgSwitch, NgSwitchCase, NgTemplateOutlet, NgSwitchDefault]
2017
2029
  }]
2018
2030
  }], ctorParameters: function () { return [{ type: ExpandStateService }, { type: LoadingNotificationService }, { type: IndexBuilderService }, { type: TreeViewLookupService }, { type: NavigationService }, { type: NodeChildrenService }, { type: DataChangeNotificationService }, { type: i0.ChangeDetectorRef }, { type: i1.LocalizationService }]; }, propDecorators: { kGroupClass: [{
2019
2031
  type: HostBinding,
@@ -2100,7 +2112,7 @@ class LocalizedMessagesDirective extends TreeViewMessages {
2100
2112
  }
2101
2113
  }
2102
2114
  LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
2103
- LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LocalizedMessagesDirective, selector: "[kendoTreeViewLocalizedMessages]", providers: [
2115
+ LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LocalizedMessagesDirective, isStandalone: true, selector: "[kendoTreeViewLocalizedMessages]", providers: [
2104
2116
  {
2105
2117
  provide: TreeViewMessages,
2106
2118
  useExisting: forwardRef(() => LocalizedMessagesDirective)
@@ -2115,7 +2127,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2115
2127
  useExisting: forwardRef(() => LocalizedMessagesDirective)
2116
2128
  }
2117
2129
  ],
2118
- selector: '[kendoTreeViewLocalizedMessages]'
2130
+ selector: '[kendoTreeViewLocalizedMessages]',
2131
+ standalone: true
2119
2132
  }]
2120
2133
  }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
2121
2134
 
@@ -2724,7 +2737,7 @@ class TreeViewComponent {
2724
2737
  }
2725
2738
  }
2726
2739
  TreeViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: ExpandStateService }, { token: NavigationService }, { token: NodeChildrenService }, { token: SelectionService }, { token: TreeViewLookupService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: DataChangeNotificationService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2727
- TreeViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TreeViewComponent, selector: "kendo-treeview", inputs: { filterInputPlaceholder: "filterInputPlaceholder", expandDisabledNodes: "expandDisabledNodes", animate: "animate", nodeTemplateRef: ["nodeTemplate", "nodeTemplateRef"], loadMoreButtonTemplateRef: ["loadMoreButtonTemplate", "loadMoreButtonTemplateRef"], trackBy: "trackBy", nodes: "nodes", textField: "textField", hasChildren: "hasChildren", isChecked: "isChecked", isDisabled: "isDisabled", hasCheckbox: "hasCheckbox", isExpanded: "isExpanded", isSelected: "isSelected", isVisible: "isVisible", navigable: "navigable", children: "children", loadOnDemand: "loadOnDemand", filterable: "filterable", filter: "filter", size: "size", disableParentNodesOnly: "disableParentNodesOnly" }, outputs: { childrenLoaded: "childrenLoaded", onBlur: "blur", onFocus: "focus", expand: "expand", collapse: "collapse", nodeDragStart: "nodeDragStart", nodeDrag: "nodeDrag", filterStateChange: "filterStateChange", nodeDrop: "nodeDrop", nodeDragEnd: "nodeDragEnd", addItem: "addItem", removeItem: "removeItem", checkedChange: "checkedChange", selectionChange: "selectionChange", filterChange: "filterChange", nodeClick: "nodeClick", nodeDblClick: "nodeDblClick" }, host: { properties: { "class.k-treeview": "this.classNames", "attr.dir": "this.direction", "@.disabled": "this.animate" } }, providers: providers, queries: [{ propertyName: "nodeTemplateQuery", first: true, predicate: NodeTemplateDirective, descendants: true }, { propertyName: "loadMoreButtonTemplateQuery", first: true, predicate: LoadMoreButtonTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "assetsContainer", first: true, predicate: ["assetsContainer"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "searchbox", first: true, predicate: ["searchbox"], descendants: true }], exportAs: ["kendoTreeView"], usesOnChanges: true, ngImport: i0, template: `
2740
+ TreeViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TreeViewComponent, isStandalone: true, selector: "kendo-treeview", inputs: { filterInputPlaceholder: "filterInputPlaceholder", expandDisabledNodes: "expandDisabledNodes", animate: "animate", nodeTemplateRef: ["nodeTemplate", "nodeTemplateRef"], loadMoreButtonTemplateRef: ["loadMoreButtonTemplate", "loadMoreButtonTemplateRef"], trackBy: "trackBy", nodes: "nodes", textField: "textField", hasChildren: "hasChildren", isChecked: "isChecked", isDisabled: "isDisabled", hasCheckbox: "hasCheckbox", isExpanded: "isExpanded", isSelected: "isSelected", isVisible: "isVisible", navigable: "navigable", children: "children", loadOnDemand: "loadOnDemand", filterable: "filterable", filter: "filter", size: "size", disableParentNodesOnly: "disableParentNodesOnly" }, outputs: { childrenLoaded: "childrenLoaded", onBlur: "blur", onFocus: "focus", expand: "expand", collapse: "collapse", nodeDragStart: "nodeDragStart", nodeDrag: "nodeDrag", filterStateChange: "filterStateChange", nodeDrop: "nodeDrop", nodeDragEnd: "nodeDragEnd", addItem: "addItem", removeItem: "removeItem", checkedChange: "checkedChange", selectionChange: "selectionChange", filterChange: "filterChange", nodeClick: "nodeClick", nodeDblClick: "nodeDblClick" }, host: { properties: { "class.k-treeview": "this.classNames", "attr.dir": "this.direction", "@.disabled": "this.animate" } }, providers: providers, queries: [{ propertyName: "nodeTemplateQuery", first: true, predicate: NodeTemplateDirective, descendants: true }, { propertyName: "loadMoreButtonTemplateQuery", first: true, predicate: LoadMoreButtonTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "assetsContainer", first: true, predicate: ["assetsContainer"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "searchbox", first: true, predicate: ["searchbox"], descendants: true }], exportAs: ["kendoTreeView"], usesOnChanges: true, ngImport: i0, template: `
2728
2741
  <ng-container kendoTreeViewLocalizedMessages
2729
2742
  i18n-loadMore="kendo.treeview.loadMore|The title of the Load More button"
2730
2743
  loadMore="Load more..."
@@ -2781,7 +2794,7 @@ TreeViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
2781
2794
  >
2782
2795
  </ul>
2783
2796
  <ng-container #assetsContainer></ng-container>
2784
- `, isInline: true, dependencies: [{ kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i9$1.TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }, { kind: "directive", type: i9$1.TextBoxPrefixTemplateDirective, selector: "[kendoTextBoxPrefixTemplate]", inputs: ["showSeparator"] }, { kind: "component", type: i11.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { 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: LocalizedMessagesDirective, selector: "[kendoTreeViewLocalizedMessages]" }], changeDetection: i0.ChangeDetectionStrategy.Default });
2797
+ `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoTreeViewLocalizedMessages]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "[kendoTextBoxPrefixTemplate]", inputs: ["showSeparator"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
2785
2798
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewComponent, decorators: [{
2786
2799
  type: Component,
2787
2800
  args: [{
@@ -2846,7 +2859,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2846
2859
  >
2847
2860
  </ul>
2848
2861
  <ng-container #assetsContainer></ng-container>
2849
- `
2862
+ `,
2863
+ standalone: true,
2864
+ imports: [LocalizedMessagesDirective, NgIf, TextBoxComponent, TextBoxPrefixTemplateDirective, IconWrapperComponent, TreeViewGroupComponent]
2850
2865
  }]
2851
2866
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: ExpandStateService }, { type: NavigationService }, { type: NodeChildrenService }, { type: SelectionService }, { type: TreeViewLookupService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: DataChangeNotificationService }, { type: i1.LocalizationService }]; }, propDecorators: { classNames: [{
2852
2867
  type: HostBinding,
@@ -3220,10 +3235,13 @@ class CheckDirective {
3220
3235
  }
3221
3236
  }
3222
3237
  CheckDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CheckDirective, deps: [{ token: TreeViewComponent }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
3223
- CheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: CheckDirective, selector: "[kendoTreeViewCheckable]", inputs: { isChecked: "isChecked", checkKey: ["checkBy", "checkKey"], checkedKeys: "checkedKeys", checkable: ["kendoTreeViewCheckable", "checkable"] }, outputs: { checkedKeysChange: "checkedKeysChange" }, usesOnChanges: true, ngImport: i0 });
3238
+ CheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: CheckDirective, isStandalone: true, selector: "[kendoTreeViewCheckable]", inputs: { isChecked: "isChecked", checkKey: ["checkBy", "checkKey"], checkedKeys: "checkedKeys", checkable: ["kendoTreeViewCheckable", "checkable"] }, outputs: { checkedKeysChange: "checkedKeysChange" }, usesOnChanges: true, ngImport: i0 });
3224
3239
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CheckDirective, decorators: [{
3225
3240
  type: Directive,
3226
- args: [{ selector: '[kendoTreeViewCheckable]' }]
3241
+ args: [{
3242
+ selector: '[kendoTreeViewCheckable]',
3243
+ standalone: true
3244
+ }]
3227
3245
  }], ctorParameters: function () { return [{ type: TreeViewComponent }, { type: i0.NgZone }]; }, propDecorators: { isChecked: [{
3228
3246
  type: Input
3229
3247
  }], checkKey: [{
@@ -3277,10 +3295,13 @@ class DisableDirective {
3277
3295
  }
3278
3296
  }
3279
3297
  DisableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DisableDirective, deps: [{ token: TreeViewComponent }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
3280
- DisableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DisableDirective, selector: "[kendoTreeViewDisable]", inputs: { isDisabled: "isDisabled", disableKey: ["kendoTreeViewDisable", "disableKey"], disabledKeys: "disabledKeys" }, usesOnChanges: true, ngImport: i0 });
3298
+ DisableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DisableDirective, isStandalone: true, selector: "[kendoTreeViewDisable]", inputs: { isDisabled: "isDisabled", disableKey: ["kendoTreeViewDisable", "disableKey"], disabledKeys: "disabledKeys" }, usesOnChanges: true, ngImport: i0 });
3281
3299
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DisableDirective, decorators: [{
3282
3300
  type: Directive,
3283
- args: [{ selector: '[kendoTreeViewDisable]' }]
3301
+ args: [{
3302
+ selector: '[kendoTreeViewDisable]',
3303
+ standalone: true
3304
+ }]
3284
3305
  }], ctorParameters: function () { return [{ type: TreeViewComponent }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { isDisabled: [{
3285
3306
  type: Input
3286
3307
  }], disableKey: [{
@@ -3290,371 +3311,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3290
3311
  type: Input
3291
3312
  }] } });
3292
3313
 
3293
- const DEFAULT_FILTER_EXPAND_SETTINGS = {
3294
- maxAutoExpandResults: -1,
3295
- expandMatches: false,
3296
- expandedOnClear: "none"
3297
- };
3298
3314
  /**
3299
- * A directive which manages the expanded state of the TreeView.
3300
- * ([see example]({% slug expandedstate_treeview %})).
3315
+ * A directive which enables the update of the initially provided data array during drag-and-drop.
3316
+ *
3317
+ * Either use this directive in combination with one of the data binding directives ([`kendoTreeViewHierarchyBinding`]({% slug api_treeview_hierarchybindingdirective %})
3318
+ * or [`kendoTreeViewFlatDataBinding`]({% slug api_treeview_flatdatabindingdirective %})) which set their own edit handlers, or provide
3319
+ * your own [`editService`]({% slug api_treeview_editservice %}) to this directive. The latter subscribes to and calls the
3320
+ * [`addItem`]({% slug api_treeview_treeviewcomponent %}#toc-additem) and [`removeItem`]({% slug api_treeview_treeviewcomponent %}#toc-removeitem)
3321
+ * handlers when the corresponding events are triggered by the TreeView component.
3301
3322
  */
3302
- class ExpandDirective {
3303
- constructor(component) {
3304
- this.component = component;
3305
- /**
3306
- * Whether or not to auto-expand the nodes leading from the root node to each filter result.
3307
- * To fine-tune this behavior, pass a [`FilterExpandSettings`]({% slug api_treeview_filterexpandsettings %}) object to this input.
3308
- * @default false
3309
- */
3310
- this.expandOnFilter = false;
3311
- /**
3312
- * Fires when the `expandedKeys` collection was updated.
3313
- */
3314
- this.expandedKeysChange = new EventEmitter();
3323
+ class DragAndDropEditingDirective {
3324
+ constructor(treeview) {
3325
+ this.treeview = treeview;
3315
3326
  this.subscriptions = new Subscription();
3316
- /**
3317
- * Reflectes the internal `expandedKeys` state.
3318
- */
3319
- this.state = new Set();
3320
- this.originalExpandedKeys = new Set();
3321
- this.isFiltered = false;
3322
- /**
3323
- * Fills array with the correct expand keys according to wrapper metadata.
3324
- */
3325
- this.updateExpandedNodes = (collection, node, autoExpandMatches) => {
3326
- if (node.containsMatches || node.isMatch && autoExpandMatches && isArrayWithAtLeastOneItem(node.children)) {
3327
- collection.push(this.itemKey({ dataItem: node.dataItem, index: node.index }));
3328
- }
3329
- if (isArrayWithAtLeastOneItem(node.children)) {
3330
- node.children.forEach(child => {
3331
- this.updateExpandedNodes(collection, child, autoExpandMatches);
3332
- });
3333
- }
3334
- };
3335
- /**
3336
- * Fills array with the expand key of every node.
3337
- */
3338
- this.getEveryExpandKey = (collection, node) => {
3339
- if (isArrayWithAtLeastOneItem(node.children)) {
3340
- collection.push(this.itemKey({ dataItem: node.dataItem, index: node.index }));
3341
- }
3342
- if (isArrayWithAtLeastOneItem(node.children)) {
3343
- node.children.forEach(child => {
3344
- this.getEveryExpandKey(collection, child);
3345
- });
3346
- }
3347
- };
3348
- this.subscriptions.add(merge(this.component.expand.pipe(map(e => (Object.assign({ expand: true }, e)))), this.component.collapse.pipe(map(e => (Object.assign({ expand: false }, e))))).subscribe(this.toggleExpand.bind(this)));
3349
- if (this.component.filterStateChange) {
3350
- this.subscriptions.add(this.component.filterStateChange.subscribe(this.handleAutoExpand.bind(this)));
3351
- }
3352
- this.component.isExpanded = (dataItem, index) => this.state.has(this.itemKey({ dataItem, index }));
3327
+ this.subscriptions.add(this.treeview.addItem.subscribe(this.handleAdd.bind(this)));
3328
+ this.subscriptions.add(this.treeview.removeItem.subscribe(this.handleRemove.bind(this)));
3353
3329
  }
3354
3330
  /**
3355
- * @hidden
3331
+ * Specifies the handlers called on drag-and-drop [`addItem`]({% slug api_treeview_treeviewcomponent %}#toc-additem)
3332
+ * and [`removeItem`]({% slug api_treeview_treeviewcomponent %}#toc-removeitem) events.
3356
3333
  */
3357
- set isExpanded(value) {
3358
- this.component.isExpanded = value;
3359
- }
3360
- get filterExpandSettings() {
3361
- const settings = isBoolean(this.expandOnFilter) ? { enabled: this.expandOnFilter } : Object.assign(Object.assign({}, this.expandOnFilter), { enabled: true });
3362
- return Object.assign({}, DEFAULT_FILTER_EXPAND_SETTINGS, settings);
3363
- }
3364
- ngOnChanges(changes) {
3365
- if (isChanged('expandedKeys', changes, false) && changes['expandedKeys'].currentValue !== this.lastChange) {
3366
- this.state = new Set(changes['expandedKeys'].currentValue);
3367
- }
3334
+ set editService(service) {
3335
+ this.treeview.editService = service;
3368
3336
  }
3369
3337
  ngOnDestroy() {
3370
3338
  this.subscriptions.unsubscribe();
3371
3339
  }
3372
- /**
3373
- * @hidden
3374
- */
3375
- itemKey(e) {
3376
- if (this.expandKey) {
3377
- if (typeof this.expandKey === "string") {
3378
- return e.dataItem[this.expandKey];
3379
- }
3380
- if (typeof this.expandKey === "function") {
3381
- return this.expandKey(e);
3382
- }
3383
- }
3384
- return e.index;
3385
- }
3386
- toggleExpand({ index, dataItem, expand }) {
3387
- const key = this.itemKey({ index, dataItem });
3388
- const isExpanded = this.state.has(key);
3389
- let notify = false;
3390
- if (isExpanded && !expand) {
3391
- this.state.delete(key);
3392
- notify = true;
3393
- }
3394
- else if (!isExpanded && expand) {
3395
- this.state.add(key);
3396
- notify = true;
3397
- }
3398
- if (notify) {
3399
- this.notify();
3340
+ handleAdd(args) {
3341
+ if (!isPresent(this.treeview.editService)) {
3342
+ throw new Error('No `editService` provided. Either provide your own implementation or use this directive in combination with one of the data binding directives (`kendoTreeViewHierarchyBinding` or `kendoTreeViewFlatDataBinding`).');
3400
3343
  }
3344
+ this.treeview.editService.add(args);
3401
3345
  }
3402
- handleAutoExpand({ nodes, matchCount, term }) {
3403
- if (!this.filterExpandSettings.enabled) {
3404
- return;
3405
- }
3406
- const { maxAutoExpandResults, expandMatches: autoExpandMatches, expandedOnClear } = this.filterExpandSettings;
3407
- if (!this.isFiltered) {
3408
- this.originalExpandedKeys = new Set(this.state);
3409
- }
3410
- const exitingFilteredState = this.isFiltered && !term;
3411
- const maxExceeded = maxAutoExpandResults !== -1 && matchCount > maxAutoExpandResults;
3412
- const exitAutoExpandedState = exitingFilteredState || maxExceeded;
3413
- if (exitAutoExpandedState) {
3414
- switch (expandedOnClear) {
3415
- case "initial": {
3416
- if (!sameValues(this.state, this.originalExpandedKeys)) {
3417
- this.state = this.originalExpandedKeys;
3418
- this.notify();
3419
- }
3420
- break;
3421
- }
3422
- case "all": {
3423
- this.state = new Set(nodes.reduce((acc, rootNode) => {
3424
- this.getEveryExpandKey(acc, rootNode);
3425
- return acc;
3426
- }, []));
3427
- this.notify();
3428
- break;
3429
- }
3430
- case "unchanged": {
3431
- break;
3432
- }
3433
- case "none":
3434
- default: {
3435
- if (this.state.size !== 0) {
3436
- this.state.clear();
3437
- this.notify();
3438
- }
3439
- break;
3440
- }
3441
- }
3442
- this.isFiltered = false;
3443
- return;
3444
- }
3445
- const indicesToExpand = new Set(nodes.reduce((acc, rootNode) => {
3446
- this.updateExpandedNodes(acc, rootNode, autoExpandMatches);
3447
- return acc;
3448
- }, []));
3449
- if (!sameValues(this.state, indicesToExpand)) {
3450
- this.state = indicesToExpand;
3451
- this.notify();
3346
+ handleRemove(args) {
3347
+ if (!isPresent(this.treeview.editService)) {
3348
+ throw new Error('No `editService` provided. Either provide your own implementation or use this directive in combination with one of the data binding directives (`kendoTreeViewHierarchyBinding` or `kendoTreeViewFlatDataBinding`).');
3452
3349
  }
3453
- this.isFiltered = true;
3454
- }
3455
- notify() {
3456
- this.lastChange = Array.from(this.state);
3457
- this.expandedKeysChange.emit(this.lastChange);
3350
+ this.treeview.editService.remove(args);
3458
3351
  }
3459
3352
  }
3460
- ExpandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExpandDirective, deps: [{ token: ExpandableComponent }], target: i0.ɵɵFactoryTarget.Directive });
3461
- ExpandDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ExpandDirective, selector: "[kendoTreeViewExpandable]", inputs: { isExpanded: "isExpanded", expandKey: ["expandBy", "expandKey"], expandOnFilter: "expandOnFilter", expandedKeys: "expandedKeys" }, outputs: { expandedKeysChange: "expandedKeysChange" }, usesOnChanges: true, ngImport: i0 });
3462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExpandDirective, decorators: [{
3353
+ DragAndDropEditingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropEditingDirective, deps: [{ token: TreeViewComponent }], target: i0.ɵɵFactoryTarget.Directive });
3354
+ DragAndDropEditingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragAndDropEditingDirective, isStandalone: true, selector: "[kendoTreeViewDragAndDropEditing]", inputs: { editService: "editService" }, ngImport: i0 });
3355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropEditingDirective, decorators: [{
3463
3356
  type: Directive,
3464
- args: [{ selector: '[kendoTreeViewExpandable]' }]
3465
- }], ctorParameters: function () { return [{ type: ExpandableComponent }]; }, propDecorators: { isExpanded: [{
3466
- type: Input
3467
- }], expandKey: [{
3468
- type: Input,
3469
- args: ["expandBy"]
3470
- }], expandOnFilter: [{
3471
- type: Input
3472
- }], expandedKeysChange: [{
3473
- type: Output
3474
- }], expandedKeys: [{
3357
+ args: [{
3358
+ selector: '[kendoTreeViewDragAndDropEditing]',
3359
+ standalone: true
3360
+ }]
3361
+ }], ctorParameters: function () { return [{ type: TreeViewComponent }]; }, propDecorators: { editService: [{
3475
3362
  type: Input
3476
3363
  }] } });
3477
3364
 
3478
3365
  /**
3479
- * A directive which manages the in-memory selection state of the TreeView node
3480
- * ([see example]({% slug selection_treeview %})).
3366
+ * Describes the attempted drop action during dragging.
3367
+ * Passed as `action` value to the [`kendoTreeViewDragClueTemplate`]({% slug api_treeview_dragcluetemplatedirective %}) directive.
3368
+ * By default, this value defines the rendered icon in the drag clue.
3481
3369
  */
3482
- class SelectDirective {
3483
- constructor(treeView, navigationService) {
3484
- this.treeView = treeView;
3485
- this.navigationService = navigationService;
3486
- /**
3487
- * Fires when the `selectedKeys` collection was updated.
3488
- */
3489
- this.selectedKeysChange = new EventEmitter();
3490
- this.subscriptions = new Subscription();
3491
- this.selectActions = {
3492
- 'multiple': (e) => this.selectMultiple(e),
3493
- 'single': (e) => this.selectSingle(e)
3494
- };
3495
- /**
3496
- * Reflectes the internal `selectedKeys` state.
3497
- */
3498
- this.state = new Set();
3499
- this.subscriptions.add(this.treeView.selectionChange.subscribe(this.select.bind(this)));
3500
- this.treeView.isSelected = (dataItem, index) => (this.state.has(this.itemKey({ dataItem, index })));
3501
- this.navigationService.deselectAllButCurrentItem.subscribe((node) => {
3502
- this.selectSingle(node);
3503
- });
3370
+ var DropAction;
3371
+ (function (DropAction) {
3372
+ DropAction[DropAction["Add"] = 0] = "Add";
3373
+ DropAction[DropAction["InsertTop"] = 1] = "InsertTop";
3374
+ DropAction[DropAction["InsertBottom"] = 2] = "InsertBottom";
3375
+ DropAction[DropAction["InsertMiddle"] = 3] = "InsertMiddle";
3376
+ DropAction[DropAction["Invalid"] = 4] = "Invalid";
3377
+ })(DropAction || (DropAction = {}));
3378
+
3379
+ /**
3380
+ * Describes where the dragged item is dropped relative to the drop target item.
3381
+ */
3382
+ var DropPosition;
3383
+ (function (DropPosition) {
3384
+ DropPosition[DropPosition["Over"] = 0] = "Over";
3385
+ DropPosition[DropPosition["Before"] = 1] = "Before";
3386
+ DropPosition[DropPosition["After"] = 2] = "After";
3387
+ })(DropPosition || (DropPosition = {}));
3388
+
3389
+ /**
3390
+ * @hidden
3391
+ */
3392
+ var ScrollDirection;
3393
+ (function (ScrollDirection) {
3394
+ ScrollDirection[ScrollDirection["Up"] = -1] = "Up";
3395
+ ScrollDirection[ScrollDirection["Down"] = 1] = "Down";
3396
+ })(ScrollDirection || (ScrollDirection = {}));
3397
+
3398
+ /**
3399
+ * @hidden
3400
+ */
3401
+ class PreventableEvent {
3402
+ constructor() {
3403
+ this.prevented = false;
3504
3404
  }
3505
3405
  /**
3506
- * @hidden
3406
+ * Prevents the default action for a specified event.
3407
+ * In this way, the source component suppresses the built-in behavior that follows the event.
3507
3408
  */
3508
- set isSelected(value) {
3509
- this.treeView.isSelected = value;
3510
- }
3511
- get getAriaMultiselectable() {
3512
- return this.options.mode === 'multiple';
3409
+ preventDefault() {
3410
+ this.prevented = true;
3513
3411
  }
3514
- get options() {
3515
- const defaultOptions = {
3516
- enabled: true,
3517
- mode: 'single'
3518
- };
3519
- if (!isPresent(this.selection) || typeof this.selection === 'string') {
3520
- return defaultOptions;
3521
- }
3522
- const selectionSettings = isBoolean(this.selection) ? { enabled: this.selection } : this.selection;
3523
- return Object.assign(defaultOptions, selectionSettings);
3524
- }
3525
- ngOnChanges(changes) {
3526
- var _a;
3527
- if (isChanged('selectedKeys', changes, false) && changes['selectedKeys'].currentValue !== this.lastChange) {
3528
- this.state = new Set(changes['selectedKeys'].currentValue);
3529
- }
3530
- const isSelectionBooleanTrue = typeof this.selection === 'boolean' && this.selection;
3531
- this.navigationService.selection = isSelectionBooleanTrue ? 'single' : (_a = this.selection) === null || _a === void 0 ? void 0 : _a.mode;
3532
- }
3533
- ngOnDestroy() {
3534
- this.subscriptions.unsubscribe();
3535
- }
3536
- itemKey(e) {
3537
- if (!this.selectKey) {
3538
- return e.index;
3539
- }
3540
- if (typeof this.selectKey === 'string') {
3541
- return e.dataItem[this.selectKey];
3542
- }
3543
- if (typeof this.selectKey === 'function') {
3544
- return this.selectKey(e);
3545
- }
3546
- }
3547
- select(e) {
3548
- const { enabled, mode } = this.options;
3549
- const performSelection = this.selectActions[mode] || noop;
3550
- if (!enabled) {
3551
- return;
3552
- }
3553
- performSelection(e);
3554
- }
3555
- selectSingle(node) {
3556
- const key = this.itemKey(node);
3557
- if (!this.state.has(key)) {
3558
- this.state.clear();
3559
- this.state.add(key);
3560
- this.notify();
3561
- }
3562
- }
3563
- selectMultiple(node) {
3564
- const key = this.itemKey(node);
3565
- const isSelected = this.state.has(key);
3566
- if (!isPresent(key)) {
3567
- return;
3568
- }
3569
- if (isSelected) {
3570
- this.state.delete(key);
3571
- }
3572
- else {
3573
- this.state.add(key);
3574
- }
3575
- this.notify();
3576
- }
3577
- notify() {
3578
- this.lastChange = Array.from(this.state);
3579
- this.selectedKeysChange.emit(this.lastChange);
3580
- }
3581
- }
3582
- SelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectDirective, deps: [{ token: TreeViewComponent }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Directive });
3583
- SelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: SelectDirective, selector: "[kendoTreeViewSelectable]", inputs: { isSelected: "isSelected", selectKey: ["selectBy", "selectKey"], selection: ["kendoTreeViewSelectable", "selection"], selectedKeys: "selectedKeys" }, outputs: { selectedKeysChange: "selectedKeysChange" }, host: { properties: { "attr.aria-multiselectable": "this.getAriaMultiselectable" } }, usesOnChanges: true, ngImport: i0 });
3584
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectDirective, decorators: [{
3585
- type: Directive,
3586
- args: [{ selector: '[kendoTreeViewSelectable]' }]
3587
- }], ctorParameters: function () { return [{ type: TreeViewComponent }, { type: NavigationService }]; }, propDecorators: { isSelected: [{
3588
- type: Input
3589
- }], selectKey: [{
3590
- type: Input,
3591
- args: ['selectBy']
3592
- }], selection: [{
3593
- type: Input,
3594
- args: ['kendoTreeViewSelectable']
3595
- }], selectedKeys: [{
3596
- type: Input
3597
- }], selectedKeysChange: [{
3598
- type: Output
3599
- }], getAriaMultiselectable: [{
3600
- type: HostBinding,
3601
- args: ['attr.aria-multiselectable']
3602
- }] } });
3603
-
3604
- /**
3605
- * Describes the attempted drop action during dragging.
3606
- * Passed as `action` value to the [`kendoTreeViewDragClueTemplate`]({% slug api_treeview_dragcluetemplatedirective %}) directive.
3607
- * By default, this value defines the rendered icon in the drag clue.
3608
- */
3609
- var DropAction;
3610
- (function (DropAction) {
3611
- DropAction[DropAction["Add"] = 0] = "Add";
3612
- DropAction[DropAction["InsertTop"] = 1] = "InsertTop";
3613
- DropAction[DropAction["InsertBottom"] = 2] = "InsertBottom";
3614
- DropAction[DropAction["InsertMiddle"] = 3] = "InsertMiddle";
3615
- DropAction[DropAction["Invalid"] = 4] = "Invalid";
3616
- })(DropAction || (DropAction = {}));
3617
-
3618
- /**
3619
- * Describes where the dragged item is dropped relative to the drop target item.
3620
- */
3621
- var DropPosition;
3622
- (function (DropPosition) {
3623
- DropPosition[DropPosition["Over"] = 0] = "Over";
3624
- DropPosition[DropPosition["Before"] = 1] = "Before";
3625
- DropPosition[DropPosition["After"] = 2] = "After";
3626
- })(DropPosition || (DropPosition = {}));
3627
-
3628
- /**
3629
- * @hidden
3630
- */
3631
- var ScrollDirection;
3632
- (function (ScrollDirection) {
3633
- ScrollDirection[ScrollDirection["Up"] = -1] = "Up";
3634
- ScrollDirection[ScrollDirection["Down"] = 1] = "Down";
3635
- })(ScrollDirection || (ScrollDirection = {}));
3636
-
3637
- /**
3638
- * @hidden
3639
- */
3640
- class PreventableEvent {
3641
- constructor() {
3642
- this.prevented = false;
3643
- }
3644
- /**
3645
- * Prevents the default action for a specified event.
3646
- * In this way, the source component suppresses the built-in behavior that follows the event.
3647
- */
3648
- preventDefault() {
3649
- this.prevented = true;
3650
- }
3651
- /**
3652
- * If the event is prevented by any of its subscribers, returns `true`.
3653
- *
3654
- * @returns `true` if the default action was prevented. Otherwise, returns `false`.
3655
- */
3656
- isDefaultPrevented() {
3657
- return this.prevented;
3412
+ /**
3413
+ * If the event is prevented by any of its subscribers, returns `true`.
3414
+ *
3415
+ * @returns `true` if the default action was prevented. Otherwise, returns `false`.
3416
+ */
3417
+ isDefaultPrevented() {
3418
+ return this.prevented;
3658
3419
  }
3659
3420
  }
3660
3421
 
@@ -3707,120 +3468,261 @@ class TreeItemDragEvent {
3707
3468
  constructor() { }
3708
3469
  }
3709
3470
 
3710
- /**
3711
- * Checks if the browser supports relative stacking context.
3712
- * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
3713
- */
3714
- const hasRelativeStackingContext = memoize(() => {
3715
- if (!(isDocumentAvailable() && isPresent(document.body))) {
3716
- return false;
3717
- }
3718
- const top = 10;
3719
- const parent = document.createElement("div");
3720
- parent.style.transform = "matrix(10, 0, 0, 10, 0, 0)";
3721
- const innerDiv = document.createElement('div');
3722
- innerDiv.innerText = 'child';
3723
- innerDiv.style.position = 'fixed';
3724
- innerDiv.style.top = `${top}px`;
3725
- parent.appendChild(innerDiv);
3726
- document.body.appendChild(parent);
3727
- const isDifferent = parent.children[0].getBoundingClientRect().top !== top;
3728
- document.body.removeChild(parent);
3729
- return isDifferent;
3730
- });
3731
- /**
3732
- * Stores the result of the passed function's first invokation and returns it instead of invoking it again afterwards.
3733
- */
3734
- function memoize(fn) {
3735
- let result;
3736
- let called = false;
3737
- return (...args) => {
3738
- if (called) {
3739
- return result;
3740
- }
3741
- result = fn(...args);
3742
- called = true;
3743
- return result;
3744
- };
3745
- }
3746
3471
  /**
3747
3472
  * @hidden
3748
- *
3749
- * Gets the offset of the parent element if the latter has the `transform` CSS prop applied.
3750
- * Transformed parents create new stacking context and the `fixed` children must be position based on the transformed parent.
3751
- * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
3752
- *
3753
- * If no parent container is `transform`-ed the function will return `{ left: 0, top: 0 }`;
3754
3473
  */
3755
- const getContainerOffset = (element) => {
3756
- if (!(element && hasRelativeStackingContext())) {
3757
- return { left: 0, top: 0 };
3474
+ class DragClueComponent {
3475
+ constructor(cdr) {
3476
+ this.cdr = cdr;
3477
+ this.hostClasses = true;
3478
+ this.posistionStyle = 'fixed';
3758
3479
  }
3759
- let offsetParent = element.parentElement;
3760
- while (offsetParent) {
3761
- if (window.getComputedStyle(offsetParent).transform !== 'none') {
3762
- break;
3480
+ get statusIconClass() {
3481
+ switch (this.action) {
3482
+ case DropAction.Add: return 'plus';
3483
+ case DropAction.InsertTop: return 'insert-top';
3484
+ case DropAction.InsertBottom: return 'insert-bottom';
3485
+ case DropAction.InsertMiddle: return 'insert-middle';
3486
+ case DropAction.Invalid:
3487
+ default: return 'cancel';
3763
3488
  }
3764
- offsetParent = offsetParent.parentElement;
3765
- }
3766
- if (offsetParent) {
3767
- const rect = offsetParent.getBoundingClientRect();
3768
- return {
3769
- left: rect.left - offsetParent.scrollLeft,
3770
- top: rect.top - offsetParent.scrollTop
3771
- };
3772
- }
3773
- return { left: 0, top: 0 };
3774
- };
3775
- /**
3776
- * @hidden
3777
- */
3778
- const getDropAction = (dropPosition, dropTarget) => {
3779
- if (!(isPresent(dropPosition) && isPresent(dropTarget))) {
3780
- return DropAction.Invalid;
3781
- }
3782
- switch (dropPosition) {
3783
- case DropPosition.Over:
3784
- return DropAction.Add;
3785
- case DropPosition.Before:
3786
- return isPresent(closestNode(dropTarget).previousElementSibling) ? DropAction.InsertMiddle : DropAction.InsertTop;
3787
- case DropPosition.After:
3788
- return isPresent(closestNode(dropTarget).nextElementSibling) ? DropAction.InsertMiddle : DropAction.InsertBottom;
3789
- default:
3790
- return DropAction.Invalid;
3791
- }
3792
- };
3793
- /**
3794
- * @hidden
3795
- */
3796
- const getDropPosition = (draggedItem, target, clientY, targetTreeView, containerOffset) => {
3797
- if (!(isPresent(draggedItem) && isPresent(target) && isPresent(targetTreeView) && isPresent(containerOffset))) {
3798
- return;
3799
3489
  }
3800
- // the .k-treeview-mid element starts just after the checkbox/expand arrow and stretches till the end of the treeview on the right
3801
- const item = closestWithMatch(target, '.k-treeview-top, .k-treeview-mid, .k-treeview-bot');
3802
- if (!isPresent(item)) {
3803
- return;
3490
+ get statusSVGIcon() {
3491
+ switch (this.action) {
3492
+ case DropAction.Add: return plusIcon;
3493
+ case DropAction.InsertTop: return insertTopIcon;
3494
+ case DropAction.InsertBottom: return insertBottomIcon;
3495
+ case DropAction.InsertMiddle: return insertMiddleIcon;
3496
+ case DropAction.Invalid:
3497
+ default: return cancelIcon;
3498
+ }
3804
3499
  }
3805
- // the content element (.k-treeview-leaf:not(.k-treeview-load-more-button)) holds just the treeview item text
3806
- const content = getContentElement(item);
3807
- const targetChildOfDraggedItem = hasParent(item, closestNode(draggedItem));
3808
- if (!isPresent(content) || (content === draggedItem) || targetChildOfDraggedItem) {
3809
- return;
3500
+ // exposed as a public method that can be called from outside as the component uses `OnPush` strategy
3501
+ detectChanges() {
3502
+ this.cdr.detectChanges();
3810
3503
  }
3811
- const itemViewPortCoords = content.getBoundingClientRect();
3812
- /*
3813
- if the user is hovering a treeview item, split the item height into four parts:
3814
- - dropping into the top quarter should insert the dragged item before the drop target
3815
- - dropping into the bottom quarter should insert the dragged item after the drop target
3816
- - dropping into the second or third quarter should add the item as child node of the drop target
3817
-
3818
- if the user is NOT hovering a treeview item (he's dragging somewhere on the right), split the item height to just two parts:
3819
- - dropping should insert before or after
3820
- */
3821
- const itemDivisionHeight = itemViewPortCoords.height / (isContent(target) ? 4 : 2);
3822
- // clear any possible container offset created by parent elements with `transform` css property set
3823
- const pointerPosition = clientY - containerOffset.top;
3504
+ }
3505
+ DragClueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3506
+ DragClueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DragClueComponent, isStandalone: true, selector: "kendo-treeview-drag-clue", host: { properties: { "class.k-header": "this.hostClasses", "class.k-drag-clue": "this.hostClasses", "style.position": "this.posistionStyle" } }, ngImport: i0, template: `
3507
+ <ng-container *ngIf="!template">
3508
+ <kendo-icon-wrapper
3509
+ innerCssClass="k-drag-status"
3510
+ [name]="statusIconClass"
3511
+ [svgIcon]="statusSVGIcon"
3512
+ >
3513
+ </kendo-icon-wrapper>
3514
+ <span>{{text}}</span>
3515
+ </ng-container>
3516
+
3517
+ <ng-template
3518
+ *ngIf="template"
3519
+ [ngTemplateOutlet]="template"
3520
+ [ngTemplateOutletContext]="{
3521
+ text: text,
3522
+ action: action,
3523
+ sourceItem: sourceItem,
3524
+ destinationItem: destinationItem
3525
+ }"
3526
+ >
3527
+ </ng-template>
3528
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueComponent, decorators: [{
3530
+ type: Component,
3531
+ args: [{
3532
+ changeDetection: ChangeDetectionStrategy.OnPush,
3533
+ selector: 'kendo-treeview-drag-clue',
3534
+ template: `
3535
+ <ng-container *ngIf="!template">
3536
+ <kendo-icon-wrapper
3537
+ innerCssClass="k-drag-status"
3538
+ [name]="statusIconClass"
3539
+ [svgIcon]="statusSVGIcon"
3540
+ >
3541
+ </kendo-icon-wrapper>
3542
+ <span>{{text}}</span>
3543
+ </ng-container>
3544
+
3545
+ <ng-template
3546
+ *ngIf="template"
3547
+ [ngTemplateOutlet]="template"
3548
+ [ngTemplateOutletContext]="{
3549
+ text: text,
3550
+ action: action,
3551
+ sourceItem: sourceItem,
3552
+ destinationItem: destinationItem
3553
+ }"
3554
+ >
3555
+ </ng-template>
3556
+ `,
3557
+ standalone: true,
3558
+ imports: [NgIf, IconWrapperComponent, NgTemplateOutlet]
3559
+ }]
3560
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClasses: [{
3561
+ type: HostBinding,
3562
+ args: ['class.k-header']
3563
+ }, {
3564
+ type: HostBinding,
3565
+ args: ['class.k-drag-clue']
3566
+ }], posistionStyle: [{
3567
+ type: HostBinding,
3568
+ args: ['style.position']
3569
+ }] } });
3570
+
3571
+ /**
3572
+ * @hidden
3573
+ */
3574
+ class DragAndDropAssetService {
3575
+ get componentRef() {
3576
+ if (!isPresent(this._componentRef)) {
3577
+ throw new Error('The `initalize` method must be called before calling other service methods.');
3578
+ }
3579
+ return this._componentRef;
3580
+ }
3581
+ set componentRef(componentRef) {
3582
+ this._componentRef = componentRef;
3583
+ }
3584
+ get element() {
3585
+ return this.componentRef.location.nativeElement;
3586
+ }
3587
+ ngOnDestroy() {
3588
+ if (!isPresent(this._componentRef)) {
3589
+ return;
3590
+ }
3591
+ this.element.parentElement.removeChild(this.element);
3592
+ this.componentRef.destroy();
3593
+ this.componentRef = null;
3594
+ }
3595
+ show() {
3596
+ this.element.style.display = '';
3597
+ }
3598
+ hide() {
3599
+ this.element.style.display = 'none';
3600
+ }
3601
+ move(left, top, offset = 0) {
3602
+ this.element.style.left = `${left + offset}px`;
3603
+ this.element.style.top = `${top + offset}px`;
3604
+ }
3605
+ }
3606
+ DragAndDropAssetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropAssetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3607
+ DragAndDropAssetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropAssetService });
3608
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropAssetService, decorators: [{
3609
+ type: Injectable
3610
+ }] });
3611
+
3612
+ /**
3613
+ * Checks if the browser supports relative stacking context.
3614
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
3615
+ */
3616
+ const hasRelativeStackingContext = memoize(() => {
3617
+ if (!(isDocumentAvailable() && isPresent(document.body))) {
3618
+ return false;
3619
+ }
3620
+ const top = 10;
3621
+ const parent = document.createElement("div");
3622
+ parent.style.transform = "matrix(10, 0, 0, 10, 0, 0)";
3623
+ const innerDiv = document.createElement('div');
3624
+ innerDiv.innerText = 'child';
3625
+ innerDiv.style.position = 'fixed';
3626
+ innerDiv.style.top = `${top}px`;
3627
+ parent.appendChild(innerDiv);
3628
+ document.body.appendChild(parent);
3629
+ const isDifferent = parent.children[0].getBoundingClientRect().top !== top;
3630
+ document.body.removeChild(parent);
3631
+ return isDifferent;
3632
+ });
3633
+ /**
3634
+ * Stores the result of the passed function's first invokation and returns it instead of invoking it again afterwards.
3635
+ */
3636
+ function memoize(fn) {
3637
+ let result;
3638
+ let called = false;
3639
+ return (...args) => {
3640
+ if (called) {
3641
+ return result;
3642
+ }
3643
+ result = fn(...args);
3644
+ called = true;
3645
+ return result;
3646
+ };
3647
+ }
3648
+ /**
3649
+ * @hidden
3650
+ *
3651
+ * Gets the offset of the parent element if the latter has the `transform` CSS prop applied.
3652
+ * Transformed parents create new stacking context and the `fixed` children must be position based on the transformed parent.
3653
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
3654
+ *
3655
+ * If no parent container is `transform`-ed the function will return `{ left: 0, top: 0 }`;
3656
+ */
3657
+ const getContainerOffset = (element) => {
3658
+ if (!(element && hasRelativeStackingContext())) {
3659
+ return { left: 0, top: 0 };
3660
+ }
3661
+ let offsetParent = element.parentElement;
3662
+ while (offsetParent) {
3663
+ if (window.getComputedStyle(offsetParent).transform !== 'none') {
3664
+ break;
3665
+ }
3666
+ offsetParent = offsetParent.parentElement;
3667
+ }
3668
+ if (offsetParent) {
3669
+ const rect = offsetParent.getBoundingClientRect();
3670
+ return {
3671
+ left: rect.left - offsetParent.scrollLeft,
3672
+ top: rect.top - offsetParent.scrollTop
3673
+ };
3674
+ }
3675
+ return { left: 0, top: 0 };
3676
+ };
3677
+ /**
3678
+ * @hidden
3679
+ */
3680
+ const getDropAction = (dropPosition, dropTarget) => {
3681
+ if (!(isPresent(dropPosition) && isPresent(dropTarget))) {
3682
+ return DropAction.Invalid;
3683
+ }
3684
+ switch (dropPosition) {
3685
+ case DropPosition.Over:
3686
+ return DropAction.Add;
3687
+ case DropPosition.Before:
3688
+ return isPresent(closestNode(dropTarget).previousElementSibling) ? DropAction.InsertMiddle : DropAction.InsertTop;
3689
+ case DropPosition.After:
3690
+ return isPresent(closestNode(dropTarget).nextElementSibling) ? DropAction.InsertMiddle : DropAction.InsertBottom;
3691
+ default:
3692
+ return DropAction.Invalid;
3693
+ }
3694
+ };
3695
+ /**
3696
+ * @hidden
3697
+ */
3698
+ const getDropPosition = (draggedItem, target, clientY, targetTreeView, containerOffset) => {
3699
+ if (!(isPresent(draggedItem) && isPresent(target) && isPresent(targetTreeView) && isPresent(containerOffset))) {
3700
+ return;
3701
+ }
3702
+ // the .k-treeview-mid element starts just after the checkbox/expand arrow and stretches till the end of the treeview on the right
3703
+ const item = closestWithMatch(target, '.k-treeview-top, .k-treeview-mid, .k-treeview-bot');
3704
+ if (!isPresent(item)) {
3705
+ return;
3706
+ }
3707
+ // the content element (.k-treeview-leaf:not(.k-treeview-load-more-button)) holds just the treeview item text
3708
+ const content = getContentElement(item);
3709
+ const targetChildOfDraggedItem = hasParent(item, closestNode(draggedItem));
3710
+ if (!isPresent(content) || (content === draggedItem) || targetChildOfDraggedItem) {
3711
+ return;
3712
+ }
3713
+ const itemViewPortCoords = content.getBoundingClientRect();
3714
+ /*
3715
+ if the user is hovering a treeview item, split the item height into four parts:
3716
+ - dropping into the top quarter should insert the dragged item before the drop target
3717
+ - dropping into the bottom quarter should insert the dragged item after the drop target
3718
+ - dropping into the second or third quarter should add the item as child node of the drop target
3719
+
3720
+ if the user is NOT hovering a treeview item (he's dragging somewhere on the right), split the item height to just two parts:
3721
+ - dropping should insert before or after
3722
+ */
3723
+ const itemDivisionHeight = itemViewPortCoords.height / (isContent(target) ? 4 : 2);
3724
+ // clear any possible container offset created by parent elements with `transform` css property set
3725
+ const pointerPosition = clientY - containerOffset.top;
3824
3726
  const itemTop = itemViewPortCoords.top - containerOffset.top;
3825
3727
  if (pointerPosition < itemTop + itemDivisionHeight) {
3826
3728
  return DropPosition.Before;
@@ -3974,465 +3876,133 @@ const scrollElementBy = (element, step, direction) => {
3974
3876
  /**
3975
3877
  * @hidden
3976
3878
  */
3977
- const copyPageSize = (treeview, source, target) => {
3978
- if (!isPresent(treeview.loadMoreService)) {
3979
- return;
3980
- }
3981
- const sourceGroupSize = treeview.getNodePageSize(source);
3982
- treeview.setNodePageSize(target, sourceGroupSize);
3983
- };
3984
- /**
3985
- * @hidden
3986
- */
3987
- const incrementPageSize = (treeview, dataItem) => {
3988
- if (!isPresent(treeview.loadMoreService)) {
3989
- return;
3990
- }
3991
- const currentPageSize = treeview.getNodePageSize(dataItem);
3992
- treeview.setNodePageSize(dataItem, currentPageSize + 1);
3993
- };
3879
+ const CLUE_OFFSET = 10;
3994
3880
  /**
3995
3881
  * @hidden
3996
3882
  */
3997
- const decrementPageSize = (treeview, dataItem) => {
3998
- if (!isPresent(treeview.loadMoreService)) {
3999
- return;
4000
- }
4001
- const currentPageSize = treeview.getNodePageSize(dataItem);
4002
- treeview.setNodePageSize(dataItem, currentPageSize - 1);
4003
- };
4004
-
3883
+ const RETURN_ANIMATION_DURATION = 200;
4005
3884
  /**
4006
3885
  * @hidden
4007
3886
  */
4008
- class HierarchyEditingService {
4009
- constructor(hierarchyBinding) {
4010
- this.hierarchyBinding = hierarchyBinding;
3887
+ class DragClueService extends DragAndDropAssetService {
3888
+ constructor(componentFactoryResolver) {
3889
+ super();
3890
+ this.componentFactoryResolver = componentFactoryResolver;
4011
3891
  }
4012
- add({ sourceItem, destinationItem, dropPosition, sourceTree, destinationTree }) {
4013
- // shallow clone the item as not to mistake it for its 'older' version when the remove handler kicks in to splice the item at its old position
4014
- const clonedSourceDataItem = Object.assign({}, getDataItem(sourceItem));
4015
- if (dropPosition === DropPosition.Over) {
4016
- // expand the item that was dropped into
4017
- expandDropTarget(destinationItem, destinationTree);
4018
- const destinationChildren = this.childrenFor(getDataItem(destinationItem));
4019
- // add the moved node just before the load more button if load more is enabled
4020
- const targetIndex = isPresent(destinationTree.loadMoreService) ?
4021
- Math.min(destinationTree.loadMoreService.getGroupSize(getDataItem(destinationItem)), destinationChildren.length) : // the page size might be greater than the actual children array length
4022
- destinationChildren.length;
4023
- destinationChildren.splice(targetIndex, 0, clonedSourceDataItem);
4024
- setter(this.hierarchyBinding.childrenField)(getDataItem(destinationItem), destinationChildren);
4025
- this.movedItemNewIndex = buildTreeIndex(destinationItem.item.index, targetIndex);
4026
- }
4027
- else {
4028
- const destinationParentNodes = this.getParentNodes(destinationItem, destinationTree);
4029
- const shiftIndex = dropPosition === DropPosition.After ? 1 : 0;
4030
- const targetIndex = destinationParentNodes.indexOf(getDataItem(destinationItem)) + shiftIndex;
4031
- destinationParentNodes.splice(targetIndex, 0, clonedSourceDataItem);
4032
- const parentIndex = destinationItem.parent ? destinationItem.parent.item.index : null;
4033
- this.movedItemNewIndex = buildTreeIndex(parentIndex, targetIndex);
4034
- }
4035
- // increment the parent page size => an item is moved into it
4036
- const updatedParent = dropPosition === DropPosition.Over ? getDataItem(destinationItem) : getDataItem(destinationItem.parent);
4037
- incrementPageSize(destinationTree, updatedParent);
4038
- // the page sizes are stored by data-item reference => copy the old item ref page size to the new item reference
4039
- copyPageSize(destinationTree, getDataItem(sourceItem), clonedSourceDataItem);
4040
- // the source tree nodes are reloaded on `removeItem` - reload the destination tree nodes if the soruce and the destination tree are different
4041
- if (sourceTree !== destinationTree && !destinationTree.loadOnDemand) {
4042
- destinationTree.preloadChildNodes();
4043
- }
4044
- // if the source and destination trees are the same, focusing the moved item here will not have the desired effect
4045
- // as the `remove` handler has not yet kicked-in to remove the item from its old position
4046
- if (sourceTree !== destinationTree) {
4047
- // ensure the focus target is rendered and registered
4048
- destinationTree.changeDetectorRef.detectChanges();
4049
- destinationTree.focus(this.movedItemNewIndex);
4050
- }
4051
- }
4052
- remove({ sourceItem, sourceTree, destinationTree }) {
4053
- const sourceParentNodes = this.getParentNodes(sourceItem, sourceTree);
4054
- const sourceItemIndex = sourceParentNodes.indexOf(getDataItem(sourceItem));
4055
- sourceParentNodes.splice(sourceItemIndex, 1);
4056
- // emit collapse for the parent node if its last child node was spliced
4057
- collapseEmptyParent(sourceItem.parent, sourceParentNodes, sourceTree);
4058
- // decrement source item parent page size => an item has been removed from it
4059
- decrementPageSize(sourceTree, getDataItem(sourceItem.parent));
4060
- // reload the treeview nodes
4061
- if (!sourceTree.loadOnDemand) {
4062
- sourceTree.preloadChildNodes();
4063
- }
4064
- // if the source and destination trees are different we want to focus only the moved item in the destination tree
4065
- if (sourceTree === destinationTree) {
4066
- // ensure the focus target is rendered and registered
4067
- destinationTree.changeDetectorRef.detectChanges();
4068
- // after the source item is removed from its original position, the candidate index might have to be corrected
4069
- const index = updateMovedItemIndex(this.movedItemNewIndex, sourceItem.item.index);
4070
- destinationTree.focus(index);
3892
+ initialize(container, template) {
3893
+ if (isPresent(this._componentRef)) {
3894
+ this.ngOnDestroy();
4071
3895
  }
3896
+ const clueComponentFactory = this.componentFactoryResolver.resolveComponentFactory(DragClueComponent);
3897
+ this.componentRef = container.createComponent(clueComponentFactory);
3898
+ this.hide();
3899
+ this.componentRef.instance.template = template;
3900
+ this.componentRef.changeDetectorRef.detectChanges();
4072
3901
  }
4073
- getParentNodes(node, treeView) {
4074
- return isPresent(node.parent) ?
4075
- this.childrenFor(getDataItem(node.parent)) :
4076
- treeView.nodes;
3902
+ ngOnDestroy() {
3903
+ this.cancelReturnAnimation();
3904
+ this.cancelScroll();
3905
+ super.ngOnDestroy();
4077
3906
  }
4078
- childrenFor(dataItem) {
4079
- return getter(this.hierarchyBinding.childrenField)(dataItem) || [];
3907
+ move(left, top) {
3908
+ super.move(left, top, CLUE_OFFSET);
4080
3909
  }
4081
- }
4082
-
4083
- /**
4084
- * @hidden
4085
- */
4086
- const DEFAULT_FILTER_SETTINGS = {
4087
- operator: 'contains',
4088
- ignoreCase: true,
4089
- mode: "lenient"
4090
- };
4091
-
4092
- /**
4093
- * @hidden
4094
- */
4095
- class FilteringBase {
4096
- constructor(component) {
4097
- this.component = component;
4098
- this.visibleNodes = new Set();
4099
- this._filterSettings = DEFAULT_FILTER_SETTINGS;
3910
+ animateDragClueToElementPosition(target) {
3911
+ if (!(isPresent(target) && isPresent(this.element.animate))) {
3912
+ this.hide();
3913
+ return;
3914
+ }
3915
+ const targetElementViewPortCoords = target.getBoundingClientRect();
3916
+ const clueElementViewPortCoords = this.element.getBoundingClientRect();
3917
+ this.returnAnimation = this.element.animate([
3918
+ { transform: 'translate(0, 0)' },
3919
+ { transform: `translate(${targetElementViewPortCoords.left - clueElementViewPortCoords.left}px, ${targetElementViewPortCoords.top - clueElementViewPortCoords.top}px)` }
3920
+ ], RETURN_ANIMATION_DURATION);
3921
+ this.returnAnimation.onfinish = () => this.hide();
4100
3922
  }
4101
- /**
4102
- * The settings which are applied when performing a filter on the component's data.
4103
- */
4104
- set filterSettings(settings) {
4105
- this._filterSettings = Object.assign(Object.assign({}, DEFAULT_FILTER_SETTINGS), settings);
3923
+ cancelReturnAnimation() {
3924
+ if (!isPresent(this.returnAnimation)) {
3925
+ return;
3926
+ }
3927
+ this.returnAnimation.cancel();
3928
+ this.returnAnimation = null;
4106
3929
  }
4107
- get filterSettings() {
4108
- return this._filterSettings;
3930
+ updateDragClueData(action, sourceItem, destinationItem) {
3931
+ const dragClue = this.componentRef.instance;
3932
+ if (action === dragClue.action && dataItemsEqual(sourceItem, dragClue.sourceItem) && dataItemsEqual(destinationItem, dragClue.destinationItem)) {
3933
+ return;
3934
+ }
3935
+ dragClue.action = action;
3936
+ dragClue.sourceItem = sourceItem;
3937
+ dragClue.destinationItem = destinationItem;
3938
+ dragClue.detectChanges();
4109
3939
  }
4110
- /**
4111
- * Applies a filter and changes the visibility of the component's nodes accordingly.
4112
- */
4113
- set filter(term) {
4114
- this.handleFilterChange(term);
3940
+ updateText(text) {
3941
+ if (text === this.componentRef.instance.text) {
3942
+ return;
3943
+ }
3944
+ this.componentRef.instance.text = text;
3945
+ this.componentRef.instance.detectChanges();
4115
3946
  }
4116
3947
  /**
4117
- * @hidden
3948
+ * Triggers the first scrollable parent to scroll upwards or downwards.
3949
+ * Uses setInterval, so should be called outside the angular zone.
4118
3950
  */
4119
- handleFilterChange(term) {
4120
- if (!this.filterData) {
3951
+ scrollIntoView({ step, interval }) {
3952
+ this.cancelScroll();
3953
+ const scrollableContainer = getScrollableContainer(this.element);
3954
+ if (!isPresent(scrollableContainer)) {
4121
3955
  return;
4122
3956
  }
4123
- this.resetNodesVisibility(this.filterData);
4124
- if (term) {
4125
- filterTree(this.filterData, term, this.filterSettings, this.component.textField);
3957
+ const containerRect = scrollableContainer.getBoundingClientRect();
3958
+ const clueRect = this.element.getBoundingClientRect();
3959
+ // if the beginning of the scrollable container is above the current viewport, fall-back to 0
3960
+ const firstVisibleClientTopPart = Math.max(containerRect.top, 0);
3961
+ // start scrolling up when the first visible item is dragged over
3962
+ const topLimit = firstVisibleClientTopPart + clueRect.height;
3963
+ // if the end of the scrollable container is beneath the current viewport, fall-back to its client height
3964
+ // add the distance from the start of the viewport to the beginning of the container to ensure scrolling bottom begins when the actual end of the container is reached
3965
+ const bottomLimit = firstVisibleClientTopPart + Math.min(containerRect.bottom, scrollableContainer.clientHeight);
3966
+ if (clueRect.top < topLimit) {
3967
+ this.scrollInterval = setInterval(() => scrollElementBy(scrollableContainer, step, ScrollDirection.Up), interval);
4126
3968
  }
4127
- this.updateVisibleNodes(this.filterData);
4128
- if (isPresent(this.component.filterStateChange)) {
4129
- this.component.filterStateChange.emit({
4130
- nodes: this.filterData,
4131
- matchCount: this.visibleNodes.size,
4132
- term,
4133
- filterSettings: this.filterSettings
4134
- });
3969
+ else if (clueRect.bottom > bottomLimit) {
3970
+ this.scrollInterval = setInterval(() => scrollElementBy(scrollableContainer, step, ScrollDirection.Down), interval);
4135
3971
  }
4136
3972
  }
4137
- updateVisibleNodes(items) {
4138
- items.forEach((wrapper) => {
4139
- if (wrapper.visible) {
4140
- this.visibleNodes.add(wrapper.dataItem);
4141
- }
4142
- if (wrapper.children) {
4143
- this.updateVisibleNodes(wrapper.children);
4144
- }
4145
- });
4146
- }
4147
- resetNodesVisibility(items) {
4148
- this.visibleNodes.clear();
4149
- items.forEach((wrapper) => {
4150
- wrapper.visible = true;
4151
- if (wrapper.children) {
4152
- this.resetNodesVisibility(wrapper.children);
4153
- }
4154
- });
3973
+ /**
3974
+ * Cancels out the on-going scroll animation, if present.
3975
+ */
3976
+ cancelScroll() {
3977
+ if (isPresent(this.scrollInterval)) {
3978
+ clearInterval(this.scrollInterval);
3979
+ this.scrollInterval = null;
3980
+ }
4155
3981
  }
4156
3982
  }
4157
- FilteringBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilteringBase, deps: [{ token: DataBoundComponent }], target: i0.ɵɵFactoryTarget.Directive });
4158
- FilteringBasedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FilteringBase, inputs: { filterSettings: "filterSettings", filter: "filter" }, ngImport: i0 });
4159
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilteringBase, decorators: [{
4160
- type: Directive
4161
- }], ctorParameters: function () { return [{ type: DataBoundComponent }]; }, propDecorators: { filterSettings: [{
4162
- type: Input
4163
- }], filter: [{
4164
- type: Input
4165
- }] } });
3983
+ DragClueService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueService, deps: [{ token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable });
3984
+ DragClueServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueService });
3985
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueService, decorators: [{
3986
+ type: Injectable
3987
+ }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }]; } });
4166
3988
 
4167
3989
  /**
4168
3990
  * @hidden
4169
3991
  */
4170
- class DragClueComponent {
4171
- constructor(cdr) {
4172
- this.cdr = cdr;
4173
- this.hostClasses = true;
4174
- this.posistionStyle = 'fixed';
4175
- }
4176
- get statusIconClass() {
4177
- switch (this.action) {
4178
- case DropAction.Add: return 'plus';
4179
- case DropAction.InsertTop: return 'insert-top';
4180
- case DropAction.InsertBottom: return 'insert-bottom';
4181
- case DropAction.InsertMiddle: return 'insert-middle';
4182
- case DropAction.Invalid:
4183
- default: return 'cancel';
4184
- }
4185
- }
4186
- get statusSVGIcon() {
4187
- switch (this.action) {
4188
- case DropAction.Add: return plusIcon;
4189
- case DropAction.InsertTop: return insertTopIcon;
4190
- case DropAction.InsertBottom: return insertBottomIcon;
4191
- case DropAction.InsertMiddle: return insertMiddleIcon;
4192
- case DropAction.Invalid:
4193
- default: return cancelIcon;
4194
- }
3992
+ class DropHintComponent {
3993
+ constructor(changeDetectorRef) {
3994
+ this.changeDetectorRef = changeDetectorRef;
3995
+ this.hostClass = true;
3996
+ this.position = 'fixed';
3997
+ this.pointerEvents = 'none';
4195
3998
  }
4196
3999
  // exposed as a public method that can be called from outside as the component uses `OnPush` strategy
4197
4000
  detectChanges() {
4198
- this.cdr.detectChanges();
4199
- }
4200
- }
4201
- DragClueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
4202
- DragClueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DragClueComponent, selector: "kendo-treeview-drag-clue", host: { properties: { "class.k-header": "this.hostClasses", "class.k-drag-clue": "this.hostClasses", "style.position": "this.posistionStyle" } }, ngImport: i0, template: `
4203
- <ng-container *ngIf="!template">
4204
- <kendo-icon-wrapper
4205
- innerCssClass="k-drag-status"
4206
- [name]="statusIconClass"
4207
- [svgIcon]="statusSVGIcon"
4208
- >
4209
- </kendo-icon-wrapper>
4210
- <span>{{text}}</span>
4211
- </ng-container>
4212
-
4213
- <ng-template
4214
- *ngIf="template"
4215
- [ngTemplateOutlet]="template"
4216
- [ngTemplateOutletContext]="{
4217
- text: text,
4218
- action: action,
4219
- sourceItem: sourceItem,
4220
- destinationItem: destinationItem
4221
- }"
4222
- >
4223
- </ng-template>
4224
- `, isInline: true, dependencies: [{ kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i11.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueComponent, decorators: [{
4226
- type: Component,
4227
- args: [{
4228
- changeDetection: ChangeDetectionStrategy.OnPush,
4229
- selector: 'kendo-treeview-drag-clue',
4230
- template: `
4231
- <ng-container *ngIf="!template">
4232
- <kendo-icon-wrapper
4233
- innerCssClass="k-drag-status"
4234
- [name]="statusIconClass"
4235
- [svgIcon]="statusSVGIcon"
4236
- >
4237
- </kendo-icon-wrapper>
4238
- <span>{{text}}</span>
4239
- </ng-container>
4240
-
4241
- <ng-template
4242
- *ngIf="template"
4243
- [ngTemplateOutlet]="template"
4244
- [ngTemplateOutletContext]="{
4245
- text: text,
4246
- action: action,
4247
- sourceItem: sourceItem,
4248
- destinationItem: destinationItem
4249
- }"
4250
- >
4251
- </ng-template>
4252
- `
4253
- }]
4254
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClasses: [{
4255
- type: HostBinding,
4256
- args: ['class.k-header']
4257
- }, {
4258
- type: HostBinding,
4259
- args: ['class.k-drag-clue']
4260
- }], posistionStyle: [{
4261
- type: HostBinding,
4262
- args: ['style.position']
4263
- }] } });
4264
-
4265
- /**
4266
- * @hidden
4267
- */
4268
- class DragAndDropAssetService {
4269
- get componentRef() {
4270
- if (!isPresent(this._componentRef)) {
4271
- throw new Error('The `initalize` method must be called before calling other service methods.');
4272
- }
4273
- return this._componentRef;
4274
- }
4275
- set componentRef(componentRef) {
4276
- this._componentRef = componentRef;
4277
- }
4278
- get element() {
4279
- return this.componentRef.location.nativeElement;
4280
- }
4281
- ngOnDestroy() {
4282
- if (!isPresent(this._componentRef)) {
4283
- return;
4284
- }
4285
- this.element.parentElement.removeChild(this.element);
4286
- this.componentRef.destroy();
4287
- this.componentRef = null;
4288
- }
4289
- show() {
4290
- this.element.style.display = '';
4291
- }
4292
- hide() {
4293
- this.element.style.display = 'none';
4294
- }
4295
- move(left, top, offset = 0) {
4296
- this.element.style.left = `${left + offset}px`;
4297
- this.element.style.top = `${top + offset}px`;
4298
- }
4299
- }
4300
- DragAndDropAssetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropAssetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4301
- DragAndDropAssetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropAssetService });
4302
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropAssetService, decorators: [{
4303
- type: Injectable
4304
- }] });
4305
-
4306
- /**
4307
- * @hidden
4308
- */
4309
- const CLUE_OFFSET = 10;
4310
- /**
4311
- * @hidden
4312
- */
4313
- const RETURN_ANIMATION_DURATION = 200;
4314
- /**
4315
- * @hidden
4316
- */
4317
- class DragClueService extends DragAndDropAssetService {
4318
- constructor(componentFactoryResolver) {
4319
- super();
4320
- this.componentFactoryResolver = componentFactoryResolver;
4321
- }
4322
- initialize(container, template) {
4323
- if (isPresent(this._componentRef)) {
4324
- this.ngOnDestroy();
4325
- }
4326
- const clueComponentFactory = this.componentFactoryResolver.resolveComponentFactory(DragClueComponent);
4327
- this.componentRef = container.createComponent(clueComponentFactory);
4328
- this.hide();
4329
- this.componentRef.instance.template = template;
4330
- this.componentRef.changeDetectorRef.detectChanges();
4331
- }
4332
- ngOnDestroy() {
4333
- this.cancelReturnAnimation();
4334
- this.cancelScroll();
4335
- super.ngOnDestroy();
4336
- }
4337
- move(left, top) {
4338
- super.move(left, top, CLUE_OFFSET);
4339
- }
4340
- animateDragClueToElementPosition(target) {
4341
- if (!(isPresent(target) && isPresent(this.element.animate))) {
4342
- this.hide();
4343
- return;
4344
- }
4345
- const targetElementViewPortCoords = target.getBoundingClientRect();
4346
- const clueElementViewPortCoords = this.element.getBoundingClientRect();
4347
- this.returnAnimation = this.element.animate([
4348
- { transform: 'translate(0, 0)' },
4349
- { transform: `translate(${targetElementViewPortCoords.left - clueElementViewPortCoords.left}px, ${targetElementViewPortCoords.top - clueElementViewPortCoords.top}px)` }
4350
- ], RETURN_ANIMATION_DURATION);
4351
- this.returnAnimation.onfinish = () => this.hide();
4352
- }
4353
- cancelReturnAnimation() {
4354
- if (!isPresent(this.returnAnimation)) {
4355
- return;
4356
- }
4357
- this.returnAnimation.cancel();
4358
- this.returnAnimation = null;
4359
- }
4360
- updateDragClueData(action, sourceItem, destinationItem) {
4361
- const dragClue = this.componentRef.instance;
4362
- if (action === dragClue.action && dataItemsEqual(sourceItem, dragClue.sourceItem) && dataItemsEqual(destinationItem, dragClue.destinationItem)) {
4363
- return;
4364
- }
4365
- dragClue.action = action;
4366
- dragClue.sourceItem = sourceItem;
4367
- dragClue.destinationItem = destinationItem;
4368
- dragClue.detectChanges();
4369
- }
4370
- updateText(text) {
4371
- if (text === this.componentRef.instance.text) {
4372
- return;
4373
- }
4374
- this.componentRef.instance.text = text;
4375
- this.componentRef.instance.detectChanges();
4376
- }
4377
- /**
4378
- * Triggers the first scrollable parent to scroll upwards or downwards.
4379
- * Uses setInterval, so should be called outside the angular zone.
4380
- */
4381
- scrollIntoView({ step, interval }) {
4382
- this.cancelScroll();
4383
- const scrollableContainer = getScrollableContainer(this.element);
4384
- if (!isPresent(scrollableContainer)) {
4385
- return;
4386
- }
4387
- const containerRect = scrollableContainer.getBoundingClientRect();
4388
- const clueRect = this.element.getBoundingClientRect();
4389
- // if the beginning of the scrollable container is above the current viewport, fall-back to 0
4390
- const firstVisibleClientTopPart = Math.max(containerRect.top, 0);
4391
- // start scrolling up when the first visible item is dragged over
4392
- const topLimit = firstVisibleClientTopPart + clueRect.height;
4393
- // if the end of the scrollable container is beneath the current viewport, fall-back to its client height
4394
- // add the distance from the start of the viewport to the beginning of the container to ensure scrolling bottom begins when the actual end of the container is reached
4395
- const bottomLimit = firstVisibleClientTopPart + Math.min(containerRect.bottom, scrollableContainer.clientHeight);
4396
- if (clueRect.top < topLimit) {
4397
- this.scrollInterval = setInterval(() => scrollElementBy(scrollableContainer, step, ScrollDirection.Up), interval);
4398
- }
4399
- else if (clueRect.bottom > bottomLimit) {
4400
- this.scrollInterval = setInterval(() => scrollElementBy(scrollableContainer, step, ScrollDirection.Down), interval);
4401
- }
4402
- }
4403
- /**
4404
- * Cancels out the on-going scroll animation, if present.
4405
- */
4406
- cancelScroll() {
4407
- if (isPresent(this.scrollInterval)) {
4408
- clearInterval(this.scrollInterval);
4409
- this.scrollInterval = null;
4410
- }
4411
- }
4412
- }
4413
- DragClueService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueService, deps: [{ token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable });
4414
- DragClueService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueService });
4415
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueService, decorators: [{
4416
- type: Injectable
4417
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }]; } });
4418
-
4419
- /**
4420
- * @hidden
4421
- */
4422
- class DropHintComponent {
4423
- constructor(changeDetectorRef) {
4424
- this.changeDetectorRef = changeDetectorRef;
4425
- this.hostClass = true;
4426
- this.position = 'fixed';
4427
- this.pointerEvents = 'none';
4428
- }
4429
- // exposed as a public method that can be called from outside as the component uses `OnPush` strategy
4430
- detectChanges() {
4431
- this.changeDetectorRef.detectChanges();
4001
+ this.changeDetectorRef.detectChanges();
4432
4002
  }
4433
4003
  }
4434
4004
  DropHintComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropHintComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
4435
- DropHintComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DropHintComponent, selector: "kendo-treeview-drop-hint", host: { properties: { "class.k-drop-hint-container": "this.hostClass", "style.position": "this.position", "style.pointer-events": "this.pointerEvents" } }, ngImport: i0, template: `
4005
+ DropHintComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DropHintComponent, isStandalone: true, selector: "kendo-treeview-drop-hint", host: { properties: { "class.k-drop-hint-container": "this.hostClass", "style.position": "this.position", "style.pointer-events": "this.pointerEvents" } }, ngImport: i0, template: `
4436
4006
  <div
4437
4007
  *ngIf="!template"
4438
4008
  class="k-drop-hint k-drop-hint-h"
@@ -4451,7 +4021,7 @@ DropHintComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
4451
4021
  }"
4452
4022
  >
4453
4023
  <ng-template>
4454
- `, isInline: true, dependencies: [{ kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4024
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4455
4025
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropHintComponent, decorators: [{
4456
4026
  type: Component,
4457
4027
  args: [{
@@ -4476,7 +4046,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4476
4046
  }"
4477
4047
  >
4478
4048
  <ng-template>
4479
- `
4049
+ `,
4050
+ standalone: true,
4051
+ imports: [NgIf, NgTemplateOutlet]
4480
4052
  }]
4481
4053
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClass: [{
4482
4054
  type: HostBinding,
@@ -4544,11 +4116,12 @@ class DragClueTemplateDirective {
4544
4116
  }
4545
4117
  }
4546
4118
  DragClueTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
4547
- DragClueTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragClueTemplateDirective, selector: "[kendoTreeViewDragClueTemplate]", ngImport: i0 });
4119
+ DragClueTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragClueTemplateDirective, isStandalone: true, selector: "[kendoTreeViewDragClueTemplate]", ngImport: i0 });
4548
4120
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueTemplateDirective, decorators: [{
4549
4121
  type: Directive,
4550
4122
  args: [{
4551
- selector: '[kendoTreeViewDragClueTemplate]'
4123
+ selector: '[kendoTreeViewDragClueTemplate]',
4124
+ standalone: true
4552
4125
  }]
4553
4126
  }], ctorParameters: function () {
4554
4127
  return [{ type: i0.TemplateRef, decorators: [{
@@ -4573,11 +4146,12 @@ class DropHintTemplateDirective {
4573
4146
  }
4574
4147
  }
4575
4148
  DropHintTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropHintTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
4576
- DropHintTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DropHintTemplateDirective, selector: "[kendoTreeViewDropHintTemplate]", ngImport: i0 });
4149
+ DropHintTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DropHintTemplateDirective, isStandalone: true, selector: "[kendoTreeViewDropHintTemplate]", ngImport: i0 });
4577
4150
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropHintTemplateDirective, decorators: [{
4578
4151
  type: Directive,
4579
4152
  args: [{
4580
- selector: '[kendoTreeViewDropHintTemplate]'
4153
+ selector: '[kendoTreeViewDropHintTemplate]',
4154
+ standalone: true
4581
4155
  }]
4582
4156
  }], ctorParameters: function () {
4583
4157
  return [{ type: i0.TemplateRef, decorators: [{
@@ -4840,7 +4414,7 @@ class DragAndDropDirective {
4840
4414
  }
4841
4415
  }
4842
4416
  DragAndDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: TreeViewComponent }, { token: DragClueService }, { token: DropHintService }], target: i0.ɵɵFactoryTarget.Directive });
4843
- DragAndDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragAndDropDirective, selector: "[kendoTreeViewDragAndDrop]", inputs: { allowCopy: "allowCopy", dropZoneTreeViews: "dropZoneTreeViews", startDragAfter: "startDragAfter", autoScroll: "autoScroll" }, host: { properties: { "style.user-select": "this.userSelectStyle", "style.-ms-user-select": "this.userSelectStyle", "style.-moz-user-select": "this.userSelectStyle", "style.-webkit-user-select": "this.userSelectStyle" } }, providers: [
4417
+ DragAndDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragAndDropDirective, isStandalone: true, selector: "[kendoTreeViewDragAndDrop]", inputs: { allowCopy: "allowCopy", dropZoneTreeViews: "dropZoneTreeViews", startDragAfter: "startDragAfter", autoScroll: "autoScroll" }, host: { properties: { "style.user-select": "this.userSelectStyle", "style.-ms-user-select": "this.userSelectStyle", "style.-moz-user-select": "this.userSelectStyle", "style.-webkit-user-select": "this.userSelectStyle" } }, providers: [
4844
4418
  DragClueService,
4845
4419
  DropHintService
4846
4420
  ], queries: [{ propertyName: "dragClueTemplate", first: true, predicate: DragClueTemplateDirective, descendants: true }, { propertyName: "dropHintTemplate", first: true, predicate: DropHintTemplateDirective, descendants: true }], ngImport: i0 });
@@ -4851,7 +4425,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4851
4425
  providers: [
4852
4426
  DragClueService,
4853
4427
  DropHintService
4854
- ]
4428
+ ],
4429
+ standalone: true
4855
4430
  }]
4856
4431
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: TreeViewComponent }, { type: DragClueService }, { type: DropHintService }]; }, propDecorators: { allowCopy: [{
4857
4432
  type: Input
@@ -4859,30 +4434,470 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4859
4434
  type: Input
4860
4435
  }], startDragAfter: [{
4861
4436
  type: Input
4862
- }], autoScroll: [{
4437
+ }], autoScroll: [{
4438
+ type: Input
4439
+ }], dragClueTemplate: [{
4440
+ type: ContentChild,
4441
+ args: [DragClueTemplateDirective, { static: false }]
4442
+ }], dropHintTemplate: [{
4443
+ type: ContentChild,
4444
+ args: [DropHintTemplateDirective, { static: false }]
4445
+ }], userSelectStyle: [{
4446
+ type: HostBinding,
4447
+ args: ['style.user-select']
4448
+ }, {
4449
+ type: HostBinding,
4450
+ args: ['style.-ms-user-select']
4451
+ }, {
4452
+ type: HostBinding,
4453
+ args: ['style.-moz-user-select']
4454
+ }, {
4455
+ type: HostBinding,
4456
+ args: ['style.-webkit-user-select']
4457
+ }] } });
4458
+
4459
+ const DEFAULT_FILTER_EXPAND_SETTINGS = {
4460
+ maxAutoExpandResults: -1,
4461
+ expandMatches: false,
4462
+ expandedOnClear: "none"
4463
+ };
4464
+ /**
4465
+ * A directive which manages the expanded state of the TreeView.
4466
+ * ([see example]({% slug expandedstate_treeview %})).
4467
+ */
4468
+ class ExpandDirective {
4469
+ constructor(component) {
4470
+ this.component = component;
4471
+ /**
4472
+ * Whether or not to auto-expand the nodes leading from the root node to each filter result.
4473
+ * To fine-tune this behavior, pass a [`FilterExpandSettings`]({% slug api_treeview_filterexpandsettings %}) object to this input.
4474
+ * @default false
4475
+ */
4476
+ this.expandOnFilter = false;
4477
+ /**
4478
+ * Fires when the `expandedKeys` collection was updated.
4479
+ */
4480
+ this.expandedKeysChange = new EventEmitter();
4481
+ this.subscriptions = new Subscription();
4482
+ /**
4483
+ * Reflectes the internal `expandedKeys` state.
4484
+ */
4485
+ this.state = new Set();
4486
+ this.originalExpandedKeys = new Set();
4487
+ this.isFiltered = false;
4488
+ /**
4489
+ * Fills array with the correct expand keys according to wrapper metadata.
4490
+ */
4491
+ this.updateExpandedNodes = (collection, node, autoExpandMatches) => {
4492
+ if (node.containsMatches || node.isMatch && autoExpandMatches && isArrayWithAtLeastOneItem(node.children)) {
4493
+ collection.push(this.itemKey({ dataItem: node.dataItem, index: node.index }));
4494
+ }
4495
+ if (isArrayWithAtLeastOneItem(node.children)) {
4496
+ node.children.forEach(child => {
4497
+ this.updateExpandedNodes(collection, child, autoExpandMatches);
4498
+ });
4499
+ }
4500
+ };
4501
+ /**
4502
+ * Fills array with the expand key of every node.
4503
+ */
4504
+ this.getEveryExpandKey = (collection, node) => {
4505
+ if (isArrayWithAtLeastOneItem(node.children)) {
4506
+ collection.push(this.itemKey({ dataItem: node.dataItem, index: node.index }));
4507
+ }
4508
+ if (isArrayWithAtLeastOneItem(node.children)) {
4509
+ node.children.forEach(child => {
4510
+ this.getEveryExpandKey(collection, child);
4511
+ });
4512
+ }
4513
+ };
4514
+ this.subscriptions.add(merge(this.component.expand.pipe(map(e => (Object.assign({ expand: true }, e)))), this.component.collapse.pipe(map(e => (Object.assign({ expand: false }, e))))).subscribe(this.toggleExpand.bind(this)));
4515
+ if (this.component.filterStateChange) {
4516
+ this.subscriptions.add(this.component.filterStateChange.subscribe(this.handleAutoExpand.bind(this)));
4517
+ }
4518
+ this.component.isExpanded = (dataItem, index) => this.state.has(this.itemKey({ dataItem, index }));
4519
+ }
4520
+ /**
4521
+ * @hidden
4522
+ */
4523
+ set isExpanded(value) {
4524
+ this.component.isExpanded = value;
4525
+ }
4526
+ get filterExpandSettings() {
4527
+ const settings = isBoolean(this.expandOnFilter) ? { enabled: this.expandOnFilter } : Object.assign(Object.assign({}, this.expandOnFilter), { enabled: true });
4528
+ return Object.assign({}, DEFAULT_FILTER_EXPAND_SETTINGS, settings);
4529
+ }
4530
+ ngOnChanges(changes) {
4531
+ if (isChanged('expandedKeys', changes, false) && changes['expandedKeys'].currentValue !== this.lastChange) {
4532
+ this.state = new Set(changes['expandedKeys'].currentValue);
4533
+ }
4534
+ }
4535
+ ngOnDestroy() {
4536
+ this.subscriptions.unsubscribe();
4537
+ }
4538
+ /**
4539
+ * @hidden
4540
+ */
4541
+ itemKey(e) {
4542
+ if (this.expandKey) {
4543
+ if (typeof this.expandKey === "string") {
4544
+ return e.dataItem[this.expandKey];
4545
+ }
4546
+ if (typeof this.expandKey === "function") {
4547
+ return this.expandKey(e);
4548
+ }
4549
+ }
4550
+ return e.index;
4551
+ }
4552
+ toggleExpand({ index, dataItem, expand }) {
4553
+ const key = this.itemKey({ index, dataItem });
4554
+ const isExpanded = this.state.has(key);
4555
+ let notify = false;
4556
+ if (isExpanded && !expand) {
4557
+ this.state.delete(key);
4558
+ notify = true;
4559
+ }
4560
+ else if (!isExpanded && expand) {
4561
+ this.state.add(key);
4562
+ notify = true;
4563
+ }
4564
+ if (notify) {
4565
+ this.notify();
4566
+ }
4567
+ }
4568
+ handleAutoExpand({ nodes, matchCount, term }) {
4569
+ if (!this.filterExpandSettings.enabled) {
4570
+ return;
4571
+ }
4572
+ const { maxAutoExpandResults, expandMatches: autoExpandMatches, expandedOnClear } = this.filterExpandSettings;
4573
+ if (!this.isFiltered) {
4574
+ this.originalExpandedKeys = new Set(this.state);
4575
+ }
4576
+ const exitingFilteredState = this.isFiltered && !term;
4577
+ const maxExceeded = maxAutoExpandResults !== -1 && matchCount > maxAutoExpandResults;
4578
+ const exitAutoExpandedState = exitingFilteredState || maxExceeded;
4579
+ if (exitAutoExpandedState) {
4580
+ switch (expandedOnClear) {
4581
+ case "initial": {
4582
+ if (!sameValues(this.state, this.originalExpandedKeys)) {
4583
+ this.state = this.originalExpandedKeys;
4584
+ this.notify();
4585
+ }
4586
+ break;
4587
+ }
4588
+ case "all": {
4589
+ this.state = new Set(nodes.reduce((acc, rootNode) => {
4590
+ this.getEveryExpandKey(acc, rootNode);
4591
+ return acc;
4592
+ }, []));
4593
+ this.notify();
4594
+ break;
4595
+ }
4596
+ case "unchanged": {
4597
+ break;
4598
+ }
4599
+ case "none":
4600
+ default: {
4601
+ if (this.state.size !== 0) {
4602
+ this.state.clear();
4603
+ this.notify();
4604
+ }
4605
+ break;
4606
+ }
4607
+ }
4608
+ this.isFiltered = false;
4609
+ return;
4610
+ }
4611
+ const indicesToExpand = new Set(nodes.reduce((acc, rootNode) => {
4612
+ this.updateExpandedNodes(acc, rootNode, autoExpandMatches);
4613
+ return acc;
4614
+ }, []));
4615
+ if (!sameValues(this.state, indicesToExpand)) {
4616
+ this.state = indicesToExpand;
4617
+ this.notify();
4618
+ }
4619
+ this.isFiltered = true;
4620
+ }
4621
+ notify() {
4622
+ this.lastChange = Array.from(this.state);
4623
+ this.expandedKeysChange.emit(this.lastChange);
4624
+ }
4625
+ }
4626
+ ExpandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExpandDirective, deps: [{ token: ExpandableComponent }], target: i0.ɵɵFactoryTarget.Directive });
4627
+ ExpandDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ExpandDirective, isStandalone: true, selector: "[kendoTreeViewExpandable]", inputs: { isExpanded: "isExpanded", expandKey: ["expandBy", "expandKey"], expandOnFilter: "expandOnFilter", expandedKeys: "expandedKeys" }, outputs: { expandedKeysChange: "expandedKeysChange" }, usesOnChanges: true, ngImport: i0 });
4628
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExpandDirective, decorators: [{
4629
+ type: Directive,
4630
+ args: [{
4631
+ selector: '[kendoTreeViewExpandable]',
4632
+ standalone: true
4633
+ }]
4634
+ }], ctorParameters: function () { return [{ type: ExpandableComponent }]; }, propDecorators: { isExpanded: [{
4635
+ type: Input
4636
+ }], expandKey: [{
4637
+ type: Input,
4638
+ args: ["expandBy"]
4639
+ }], expandOnFilter: [{
4640
+ type: Input
4641
+ }], expandedKeysChange: [{
4642
+ type: Output
4643
+ }], expandedKeys: [{
4644
+ type: Input
4645
+ }] } });
4646
+
4647
+ /**
4648
+ * @hidden
4649
+ * Performs the right-to-left function composition. Functions must have a unary.
4650
+ */
4651
+ const compose = (...args) => (data) => args.reduceRight((acc, curr) => curr(acc), data);
4652
+
4653
+ /**
4654
+ * @hidden
4655
+ */
4656
+ const copyPageSize = (treeview, source, target) => {
4657
+ if (!isPresent(treeview.loadMoreService)) {
4658
+ return;
4659
+ }
4660
+ const sourceGroupSize = treeview.getNodePageSize(source);
4661
+ treeview.setNodePageSize(target, sourceGroupSize);
4662
+ };
4663
+ /**
4664
+ * @hidden
4665
+ */
4666
+ const incrementPageSize = (treeview, dataItem) => {
4667
+ if (!isPresent(treeview.loadMoreService)) {
4668
+ return;
4669
+ }
4670
+ const currentPageSize = treeview.getNodePageSize(dataItem);
4671
+ treeview.setNodePageSize(dataItem, currentPageSize + 1);
4672
+ };
4673
+ /**
4674
+ * @hidden
4675
+ */
4676
+ const decrementPageSize = (treeview, dataItem) => {
4677
+ if (!isPresent(treeview.loadMoreService)) {
4678
+ return;
4679
+ }
4680
+ const currentPageSize = treeview.getNodePageSize(dataItem);
4681
+ treeview.setNodePageSize(dataItem, currentPageSize - 1);
4682
+ };
4683
+
4684
+ /**
4685
+ * @hidden
4686
+ */
4687
+ class FlatEditingService {
4688
+ constructor(flatBinding) {
4689
+ this.flatBinding = flatBinding;
4690
+ }
4691
+ add({ sourceItem, destinationItem, dropPosition, sourceTree, destinationTree }) {
4692
+ // shallow clone the item as not to mistake it for its 'older' version when the remove handler kicks in to splice the item at its old position
4693
+ const clonedSourceDataItem = Object.assign({}, getDataItem(sourceItem));
4694
+ if (dropPosition === DropPosition.Over) {
4695
+ // expand the item that was dropped into
4696
+ expandDropTarget(destinationItem, destinationTree);
4697
+ const destinationItemId = getter(this.flatBinding.idField)(getDataItem(destinationItem));
4698
+ setter(this.flatBinding.parentIdField)(clonedSourceDataItem, destinationItemId);
4699
+ const lastChildNodeIndex = this.getLastVisibleChildNodeIndex(destinationTree, this.flatBinding.originalData, getDataItem(destinationItem));
4700
+ // insert after the last visible child
4701
+ const targetIndex = lastChildNodeIndex + 1;
4702
+ this.flatBinding.originalData.splice(targetIndex, 0, clonedSourceDataItem);
4703
+ // rebind the treeview data before searching for the focus target index
4704
+ this.rebindData();
4705
+ const focusTarget = this.fetchChildNodes(getDataItem(destinationItem), destinationTree).indexOf(clonedSourceDataItem);
4706
+ this.movedItemNewIndex = buildTreeIndex(destinationItem.item.index, focusTarget);
4707
+ }
4708
+ else {
4709
+ const shiftIndex = dropPosition === DropPosition.After ? 1 : 0;
4710
+ const targetIndex = this.flatBinding.originalData.indexOf(getDataItem(destinationItem)) + shiftIndex;
4711
+ this.flatBinding.originalData.splice(targetIndex, 0, clonedSourceDataItem);
4712
+ const destinationItemParentId = getter(this.flatBinding.parentIdField)(getDataItem(destinationItem));
4713
+ setter(this.flatBinding.parentIdField)(clonedSourceDataItem, destinationItemParentId);
4714
+ // rebind the treeview data before searching for the focus target index
4715
+ this.rebindData();
4716
+ const parentIndex = destinationItem.parent ?
4717
+ destinationItem.parent.item.index :
4718
+ null;
4719
+ const parentContainer = destinationItem.parent ?
4720
+ this.fetchChildNodes(getDataItem(destinationItem.parent), destinationTree) :
4721
+ destinationTree.nodes;
4722
+ const focusTarget = parentContainer.indexOf(clonedSourceDataItem);
4723
+ this.movedItemNewIndex = buildTreeIndex(parentIndex, focusTarget);
4724
+ }
4725
+ if (sourceTree !== destinationTree) {
4726
+ this.addChildNodes(clonedSourceDataItem, sourceTree);
4727
+ }
4728
+ // increment the parent page size => an item is moved into it
4729
+ const updatedParent = dropPosition === DropPosition.Over ? getDataItem(destinationItem) : getDataItem(destinationItem.parent);
4730
+ incrementPageSize(destinationTree, updatedParent);
4731
+ // the page sizes are stored by data-item reference => copy the old item ref page size to the new item reference
4732
+ copyPageSize(destinationTree, getDataItem(sourceItem), clonedSourceDataItem);
4733
+ // the source tree nodes are reloaded on `removeItem` - reload the destination tree nodes if the soruce and the destination tree are different
4734
+ if (sourceTree !== destinationTree && !destinationTree.loadOnDemand) {
4735
+ destinationTree.preloadChildNodes();
4736
+ }
4737
+ // if the source and destination trees are the same, focusing the moved item here will not have the desired effect
4738
+ // as the `remove` handler has not yet kicked-in to remove the item from its old position
4739
+ if (sourceTree !== destinationTree) {
4740
+ // ensure the focus target is rendered and registered
4741
+ destinationTree.changeDetectorRef.detectChanges();
4742
+ destinationTree.focus(this.movedItemNewIndex);
4743
+ }
4744
+ }
4745
+ remove({ sourceItem, sourceTree, destinationTree }) {
4746
+ const sourceDataItem = getDataItem(sourceItem);
4747
+ const sourceItemIndex = this.flatBinding.originalData.indexOf(sourceDataItem);
4748
+ this.flatBinding.originalData.splice(sourceItemIndex, 1);
4749
+ if (sourceTree !== destinationTree) {
4750
+ this.removeChildNodes(sourceDataItem, sourceTree);
4751
+ }
4752
+ this.rebindData();
4753
+ // emit collapse for the parent node if its last child node was spliced
4754
+ const parentChildren = sourceItem.parent ? sourceItem.parent.children : [];
4755
+ collapseEmptyParent(sourceItem.parent, parentChildren, sourceTree);
4756
+ // decrement source item parent page size => an item has been removed from it
4757
+ decrementPageSize(sourceTree, getDataItem(sourceItem.parent));
4758
+ // reload the treeview nodes
4759
+ if (!sourceTree.loadOnDemand) {
4760
+ sourceTree.preloadChildNodes();
4761
+ }
4762
+ // if the source and destination trees are different we want to focus only the moved item in the destination tree
4763
+ if (sourceTree === destinationTree) {
4764
+ // ensure the focus target is rendered and registered
4765
+ destinationTree.changeDetectorRef.detectChanges();
4766
+ // after the source item is removed from its original position, the candidate index might have to be corrected
4767
+ const index = updateMovedItemIndex(this.movedItemNewIndex, sourceItem.item.index);
4768
+ destinationTree.focus(index);
4769
+ }
4770
+ }
4771
+ addChildNodes(dataItem, source) {
4772
+ const itemChildren = this.fetchAllDescendantNodes(dataItem, source);
4773
+ this.flatBinding.originalData.push(...itemChildren);
4774
+ }
4775
+ removeChildNodes(dataItem, source) {
4776
+ const sourceChildren = this.fetchAllDescendantNodes(dataItem, source);
4777
+ sourceChildren.forEach(item => {
4778
+ const index = this.flatBinding.originalData.indexOf(item);
4779
+ this.flatBinding.originalData.splice(index, 1);
4780
+ });
4781
+ }
4782
+ fetchAllDescendantNodes(node, treeview) {
4783
+ let nodes = this.fetchChildNodes(node, treeview);
4784
+ nodes.forEach(node => nodes = nodes.concat(this.fetchAllDescendantNodes(node, treeview) || []));
4785
+ return nodes;
4786
+ }
4787
+ fetchChildNodes(node, treeview) {
4788
+ if (!node) {
4789
+ return [];
4790
+ }
4791
+ let nodes = [];
4792
+ treeview
4793
+ .children(node)
4794
+ .pipe(take(1))
4795
+ .subscribe(children => nodes = nodes.concat(children || []));
4796
+ return nodes;
4797
+ }
4798
+ getLastVisibleChildNodeIndex(treeview, data, node) {
4799
+ if (!isPresent(treeview.loadMoreService) || !treeview.hasChildren(node)) {
4800
+ return data.length;
4801
+ }
4802
+ const visibleNodesCount = treeview.loadMoreService.getGroupSize(node);
4803
+ const visibleChildren = this.fetchChildNodes(node, treeview).slice(0, visibleNodesCount);
4804
+ const lastNode = visibleChildren[visibleChildren.length - 1];
4805
+ const lastNodeIndex = data.indexOf(lastNode);
4806
+ return lastNodeIndex;
4807
+ }
4808
+ rebindData() {
4809
+ this.flatBinding.nodes = this.flatBinding.originalData;
4810
+ this.flatBinding.updateNodes(this.flatBinding.originalData);
4811
+ }
4812
+ }
4813
+
4814
+ /**
4815
+ * @hidden
4816
+ */
4817
+ const DEFAULT_FILTER_SETTINGS = {
4818
+ operator: 'contains',
4819
+ ignoreCase: true,
4820
+ mode: "lenient"
4821
+ };
4822
+
4823
+ /**
4824
+ * @hidden
4825
+ */
4826
+ class FilteringBase {
4827
+ constructor(component) {
4828
+ this.component = component;
4829
+ this.visibleNodes = new Set();
4830
+ this._filterSettings = DEFAULT_FILTER_SETTINGS;
4831
+ }
4832
+ /**
4833
+ * The settings which are applied when performing a filter on the component's data.
4834
+ */
4835
+ set filterSettings(settings) {
4836
+ this._filterSettings = Object.assign(Object.assign({}, DEFAULT_FILTER_SETTINGS), settings);
4837
+ }
4838
+ get filterSettings() {
4839
+ return this._filterSettings;
4840
+ }
4841
+ /**
4842
+ * Applies a filter and changes the visibility of the component's nodes accordingly.
4843
+ */
4844
+ set filter(term) {
4845
+ this.handleFilterChange(term);
4846
+ }
4847
+ /**
4848
+ * @hidden
4849
+ */
4850
+ handleFilterChange(term) {
4851
+ if (!this.filterData) {
4852
+ return;
4853
+ }
4854
+ this.resetNodesVisibility(this.filterData);
4855
+ if (term) {
4856
+ filterTree(this.filterData, term, this.filterSettings, this.component.textField);
4857
+ }
4858
+ this.updateVisibleNodes(this.filterData);
4859
+ if (isPresent(this.component.filterStateChange)) {
4860
+ this.component.filterStateChange.emit({
4861
+ nodes: this.filterData,
4862
+ matchCount: this.visibleNodes.size,
4863
+ term,
4864
+ filterSettings: this.filterSettings
4865
+ });
4866
+ }
4867
+ }
4868
+ updateVisibleNodes(items) {
4869
+ items.forEach((wrapper) => {
4870
+ if (wrapper.visible) {
4871
+ this.visibleNodes.add(wrapper.dataItem);
4872
+ }
4873
+ if (wrapper.children) {
4874
+ this.updateVisibleNodes(wrapper.children);
4875
+ }
4876
+ });
4877
+ }
4878
+ resetNodesVisibility(items) {
4879
+ this.visibleNodes.clear();
4880
+ items.forEach((wrapper) => {
4881
+ wrapper.visible = true;
4882
+ if (wrapper.children) {
4883
+ this.resetNodesVisibility(wrapper.children);
4884
+ }
4885
+ });
4886
+ }
4887
+ }
4888
+ FilteringBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilteringBase, deps: [{ token: DataBoundComponent }], target: i0.ɵɵFactoryTarget.Directive });
4889
+ FilteringBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FilteringBase, inputs: { filterSettings: "filterSettings", filter: "filter" }, ngImport: i0 });
4890
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilteringBase, decorators: [{
4891
+ type: Directive
4892
+ }], ctorParameters: function () { return [{ type: DataBoundComponent }]; }, propDecorators: { filterSettings: [{
4893
+ type: Input
4894
+ }], filter: [{
4863
4895
  type: Input
4864
- }], dragClueTemplate: [{
4865
- type: ContentChild,
4866
- args: [DragClueTemplateDirective, { static: false }]
4867
- }], dropHintTemplate: [{
4868
- type: ContentChild,
4869
- args: [DropHintTemplateDirective, { static: false }]
4870
- }], userSelectStyle: [{
4871
- type: HostBinding,
4872
- args: ['style.user-select']
4873
- }, {
4874
- type: HostBinding,
4875
- args: ['style.-ms-user-select']
4876
- }, {
4877
- type: HostBinding,
4878
- args: ['style.-moz-user-select']
4879
- }, {
4880
- type: HostBinding,
4881
- args: ['style.-webkit-user-select']
4882
4896
  }] } });
4883
4897
 
4898
+ const findChildren = (prop, nodes, value) => nodes.filter((x) => prop(x) === value);
4884
4899
  const indexBuilder$1 = new IndexBuilderService();
4885
- const mapToWrappers = (currentLevelNodes, childrenField, parent = null, parentIndex = '') => {
4900
+ const mapToTree = (currentLevelNodes, allNodes, parentIdField, idField, parent = null, parentIndex = '') => {
4886
4901
  if (!isArrayWithAtLeastOneItem(currentLevelNodes)) {
4887
4902
  return [];
4888
4903
  }
@@ -4894,40 +4909,26 @@ const mapToWrappers = (currentLevelNodes, childrenField, parent = null, parentIn
4894
4909
  parent,
4895
4910
  visible: true
4896
4911
  };
4897
- wrapper.children = mapToWrappers(getter(childrenField)(node), childrenField, wrapper, index);
4912
+ wrapper.children = mapToTree(findChildren(getter(parentIdField), allNodes || [], getter(idField)(node)), allNodes, parentIdField, idField, wrapper, index);
4898
4913
  return wrapper;
4899
4914
  });
4900
4915
  };
4901
4916
  /**
4902
- * A directive which encapsulates the retrieval of child nodes.
4917
+ * A directive which encapsulates the retrieval of the child nodes.
4903
4918
  */
4904
- class HierarchyBindingDirective extends FilteringBase {
4905
- constructor(component, dragAndDropDirective) {
4919
+ class FlatDataBindingDirective extends FilteringBase {
4920
+ constructor(component) {
4906
4921
  super(component);
4907
4922
  this.component = component;
4908
- this.dragAndDropDirective = dragAndDropDirective;
4909
4923
  /**
4910
4924
  * @hidden
4911
4925
  */
4912
4926
  this.loadOnDemand = true;
4927
+ /**
4928
+ * @hidden
4929
+ */
4913
4930
  this.originalData = [];
4914
- const shouldFilter = !isPresent(this.dragAndDropDirective);
4915
- this.component.isVisible = shouldFilter ? (node) => this.visibleNodes.has(node) : isVisible;
4916
- }
4917
- /**
4918
- * The field name which holds the data items of the child component.
4919
- */
4920
- set childrenField(value) {
4921
- if (!value) {
4922
- throw new Error("'childrenField' cannot be empty");
4923
- }
4924
- this._childrenField = value;
4925
- }
4926
- /**
4927
- * The field name which holds the data items of the child component.
4928
- */
4929
- get childrenField() {
4930
- return this._childrenField;
4931
+ this.component.isVisible = (node) => this.visibleNodes.has(node);
4931
4932
  }
4932
4933
  /**
4933
4934
  * @hidden
@@ -4936,14 +4937,15 @@ class HierarchyBindingDirective extends FilteringBase {
4936
4937
  set isVisible(fn) {
4937
4938
  this.component.isVisible = fn;
4938
4939
  }
4940
+ /**
4941
+ * @hidden
4942
+ */
4939
4943
  ngOnInit() {
4940
- if (isPresent(this.childrenField)) {
4941
- this.component.children = item => of(getter(this.childrenField)(item));
4942
- this.component.hasChildren = item => {
4943
- const children = getter(this.childrenField)(item);
4944
- return Boolean(children && children.length);
4945
- };
4946
- this.component.editService = new HierarchyEditingService(this);
4944
+ if (isPresent(this.parentIdField) && isPresent(this.idField)) {
4945
+ const fetchChildren = (node) => findChildren(getter(this.parentIdField), this.originalData || [], getter(this.idField)(node));
4946
+ this.component.hasChildren = (node) => fetchChildren(node).length > 0;
4947
+ this.component.children = (node) => of(fetchChildren(node));
4948
+ this.component.editService = new FlatEditingService(this);
4947
4949
  this.component.filterChange.subscribe(this.handleFilterChange.bind(this));
4948
4950
  if (this.component.filter) {
4949
4951
  this.handleFilterChange(this.component.filter);
@@ -4953,8 +4955,11 @@ class HierarchyBindingDirective extends FilteringBase {
4953
4955
  }
4954
4956
  }
4955
4957
  }
4958
+ /**
4959
+ * @hidden
4960
+ */
4956
4961
  ngOnChanges(changes) {
4957
- if (isChanged('childrenField', changes, false)) {
4962
+ if (isChanged('parentIdField', changes, false)) {
4958
4963
  this.nodes = this.originalData;
4959
4964
  this.updateNodes(this.originalData);
4960
4965
  }
@@ -4971,43 +4976,43 @@ class HierarchyBindingDirective extends FilteringBase {
4971
4976
  */
4972
4977
  updateNodes(values) {
4973
4978
  this.originalData = values || [];
4974
- this.filterData = mapToWrappers(values, this.childrenField) || [];
4975
- this.updateVisibleNodes(this.filterData);
4979
+ if (!isNullOrEmptyString(this.parentIdField)) {
4980
+ const prop = getter(this.parentIdField);
4981
+ this.component.nodes = this.originalData.filter(compose(isBlank, prop));
4982
+ this.filterData = mapToTree(this.component.nodes, this.originalData, this.parentIdField, this.idField);
4983
+ this.updateVisibleNodes(this.filterData);
4984
+ }
4985
+ else {
4986
+ this.component.nodes = this.originalData.slice(0);
4987
+ }
4976
4988
  }
4977
4989
  }
4978
- HierarchyBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: DataBoundComponent }, { token: DragAndDropDirective, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
4979
- HierarchyBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: HierarchyBindingDirective, selector: "[kendoTreeViewHierarchyBinding]", inputs: { childrenField: "childrenField", nodes: "nodes", isVisible: "isVisible", loadOnDemand: "loadOnDemand" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
4980
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyBindingDirective, decorators: [{
4990
+ FlatDataBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FlatDataBindingDirective, deps: [{ token: DataBoundComponent }], target: i0.ɵɵFactoryTarget.Directive });
4991
+ FlatDataBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FlatDataBindingDirective, isStandalone: true, selector: "[kendoTreeViewFlatDataBinding]", inputs: { nodes: "nodes", parentIdField: "parentIdField", idField: "idField", loadOnDemand: "loadOnDemand", isVisible: "isVisible" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
4992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FlatDataBindingDirective, decorators: [{
4981
4993
  type: Directive,
4982
- args: [{ selector: '[kendoTreeViewHierarchyBinding]' }]
4983
- }], ctorParameters: function () {
4984
- return [{ type: DataBoundComponent }, { type: DragAndDropDirective, decorators: [{
4985
- type: Optional
4986
- }, {
4987
- type: Host
4988
- }] }];
4989
- }, propDecorators: { childrenField: [{
4994
+ args: [{
4995
+ selector: "[kendoTreeViewFlatDataBinding]",
4996
+ standalone: true
4997
+ }]
4998
+ }], ctorParameters: function () { return [{ type: DataBoundComponent }]; }, propDecorators: { nodes: [{
4990
4999
  type: Input
4991
- }], nodes: [{
5000
+ }], parentIdField: [{
4992
5001
  type: Input
4993
- }], isVisible: [{
5002
+ }], idField: [{
4994
5003
  type: Input
4995
5004
  }], loadOnDemand: [{
4996
5005
  type: Input
5006
+ }], isVisible: [{
5007
+ type: Input
4997
5008
  }] } });
4998
5009
 
4999
- /**
5000
- * @hidden
5001
- * Performs the right-to-left function composition. Functions must have a unary.
5002
- */
5003
- const compose = (...args) => (data) => args.reduceRight((acc, curr) => curr(acc), data);
5004
-
5005
5010
  /**
5006
5011
  * @hidden
5007
5012
  */
5008
- class FlatEditingService {
5009
- constructor(flatBinding) {
5010
- this.flatBinding = flatBinding;
5013
+ class HierarchyEditingService {
5014
+ constructor(hierarchyBinding) {
5015
+ this.hierarchyBinding = hierarchyBinding;
5011
5016
  }
5012
5017
  add({ sourceItem, destinationItem, dropPosition, sourceTree, destinationTree }) {
5013
5018
  // shallow clone the item as not to mistake it for its 'older' version when the remove handler kicks in to splice the item at its old position
@@ -5015,36 +5020,22 @@ class FlatEditingService {
5015
5020
  if (dropPosition === DropPosition.Over) {
5016
5021
  // expand the item that was dropped into
5017
5022
  expandDropTarget(destinationItem, destinationTree);
5018
- const destinationItemId = getter(this.flatBinding.idField)(getDataItem(destinationItem));
5019
- setter(this.flatBinding.parentIdField)(clonedSourceDataItem, destinationItemId);
5020
- const lastChildNodeIndex = this.getLastVisibleChildNodeIndex(destinationTree, this.flatBinding.originalData, getDataItem(destinationItem));
5021
- // insert after the last visible child
5022
- const targetIndex = lastChildNodeIndex + 1;
5023
- this.flatBinding.originalData.splice(targetIndex, 0, clonedSourceDataItem);
5024
- // rebind the treeview data before searching for the focus target index
5025
- this.rebindData();
5026
- const focusTarget = this.fetchChildNodes(getDataItem(destinationItem), destinationTree).indexOf(clonedSourceDataItem);
5027
- this.movedItemNewIndex = buildTreeIndex(destinationItem.item.index, focusTarget);
5023
+ const destinationChildren = this.childrenFor(getDataItem(destinationItem));
5024
+ // add the moved node just before the load more button if load more is enabled
5025
+ const targetIndex = isPresent(destinationTree.loadMoreService) ?
5026
+ Math.min(destinationTree.loadMoreService.getGroupSize(getDataItem(destinationItem)), destinationChildren.length) : // the page size might be greater than the actual children array length
5027
+ destinationChildren.length;
5028
+ destinationChildren.splice(targetIndex, 0, clonedSourceDataItem);
5029
+ setter(this.hierarchyBinding.childrenField)(getDataItem(destinationItem), destinationChildren);
5030
+ this.movedItemNewIndex = buildTreeIndex(destinationItem.item.index, targetIndex);
5028
5031
  }
5029
5032
  else {
5033
+ const destinationParentNodes = this.getParentNodes(destinationItem, destinationTree);
5030
5034
  const shiftIndex = dropPosition === DropPosition.After ? 1 : 0;
5031
- const targetIndex = this.flatBinding.originalData.indexOf(getDataItem(destinationItem)) + shiftIndex;
5032
- this.flatBinding.originalData.splice(targetIndex, 0, clonedSourceDataItem);
5033
- const destinationItemParentId = getter(this.flatBinding.parentIdField)(getDataItem(destinationItem));
5034
- setter(this.flatBinding.parentIdField)(clonedSourceDataItem, destinationItemParentId);
5035
- // rebind the treeview data before searching for the focus target index
5036
- this.rebindData();
5037
- const parentIndex = destinationItem.parent ?
5038
- destinationItem.parent.item.index :
5039
- null;
5040
- const parentContainer = destinationItem.parent ?
5041
- this.fetchChildNodes(getDataItem(destinationItem.parent), destinationTree) :
5042
- destinationTree.nodes;
5043
- const focusTarget = parentContainer.indexOf(clonedSourceDataItem);
5044
- this.movedItemNewIndex = buildTreeIndex(parentIndex, focusTarget);
5045
- }
5046
- if (sourceTree !== destinationTree) {
5047
- this.addChildNodes(clonedSourceDataItem, sourceTree);
5035
+ const targetIndex = destinationParentNodes.indexOf(getDataItem(destinationItem)) + shiftIndex;
5036
+ destinationParentNodes.splice(targetIndex, 0, clonedSourceDataItem);
5037
+ const parentIndex = destinationItem.parent ? destinationItem.parent.item.index : null;
5038
+ this.movedItemNewIndex = buildTreeIndex(parentIndex, targetIndex);
5048
5039
  }
5049
5040
  // increment the parent page size => an item is moved into it
5050
5041
  const updatedParent = dropPosition === DropPosition.Over ? getDataItem(destinationItem) : getDataItem(destinationItem.parent);
@@ -5064,16 +5055,11 @@ class FlatEditingService {
5064
5055
  }
5065
5056
  }
5066
5057
  remove({ sourceItem, sourceTree, destinationTree }) {
5067
- const sourceDataItem = getDataItem(sourceItem);
5068
- const sourceItemIndex = this.flatBinding.originalData.indexOf(sourceDataItem);
5069
- this.flatBinding.originalData.splice(sourceItemIndex, 1);
5070
- if (sourceTree !== destinationTree) {
5071
- this.removeChildNodes(sourceDataItem, sourceTree);
5072
- }
5073
- this.rebindData();
5058
+ const sourceParentNodes = this.getParentNodes(sourceItem, sourceTree);
5059
+ const sourceItemIndex = sourceParentNodes.indexOf(getDataItem(sourceItem));
5060
+ sourceParentNodes.splice(sourceItemIndex, 1);
5074
5061
  // emit collapse for the parent node if its last child node was spliced
5075
- const parentChildren = sourceItem.parent ? sourceItem.parent.children : [];
5076
- collapseEmptyParent(sourceItem.parent, parentChildren, sourceTree);
5062
+ collapseEmptyParent(sourceItem.parent, sourceParentNodes, sourceTree);
5077
5063
  // decrement source item parent page size => an item has been removed from it
5078
5064
  decrementPageSize(sourceTree, getDataItem(sourceItem.parent));
5079
5065
  // reload the treeview nodes
@@ -5089,52 +5075,18 @@ class FlatEditingService {
5089
5075
  destinationTree.focus(index);
5090
5076
  }
5091
5077
  }
5092
- addChildNodes(dataItem, source) {
5093
- const itemChildren = this.fetchAllDescendantNodes(dataItem, source);
5094
- this.flatBinding.originalData.push(...itemChildren);
5095
- }
5096
- removeChildNodes(dataItem, source) {
5097
- const sourceChildren = this.fetchAllDescendantNodes(dataItem, source);
5098
- sourceChildren.forEach(item => {
5099
- const index = this.flatBinding.originalData.indexOf(item);
5100
- this.flatBinding.originalData.splice(index, 1);
5101
- });
5102
- }
5103
- fetchAllDescendantNodes(node, treeview) {
5104
- let nodes = this.fetchChildNodes(node, treeview);
5105
- nodes.forEach(node => nodes = nodes.concat(this.fetchAllDescendantNodes(node, treeview) || []));
5106
- return nodes;
5107
- }
5108
- fetchChildNodes(node, treeview) {
5109
- if (!node) {
5110
- return [];
5111
- }
5112
- let nodes = [];
5113
- treeview
5114
- .children(node)
5115
- .pipe(take(1))
5116
- .subscribe(children => nodes = nodes.concat(children || []));
5117
- return nodes;
5118
- }
5119
- getLastVisibleChildNodeIndex(treeview, data, node) {
5120
- if (!isPresent(treeview.loadMoreService) || !treeview.hasChildren(node)) {
5121
- return data.length;
5122
- }
5123
- const visibleNodesCount = treeview.loadMoreService.getGroupSize(node);
5124
- const visibleChildren = this.fetchChildNodes(node, treeview).slice(0, visibleNodesCount);
5125
- const lastNode = visibleChildren[visibleChildren.length - 1];
5126
- const lastNodeIndex = data.indexOf(lastNode);
5127
- return lastNodeIndex;
5078
+ getParentNodes(node, treeView) {
5079
+ return isPresent(node.parent) ?
5080
+ this.childrenFor(getDataItem(node.parent)) :
5081
+ treeView.nodes;
5128
5082
  }
5129
- rebindData() {
5130
- this.flatBinding.nodes = this.flatBinding.originalData;
5131
- this.flatBinding.updateNodes(this.flatBinding.originalData);
5083
+ childrenFor(dataItem) {
5084
+ return getter(this.hierarchyBinding.childrenField)(dataItem) || [];
5132
5085
  }
5133
5086
  }
5134
5087
 
5135
- const findChildren = (prop, nodes, value) => nodes.filter((x) => prop(x) === value);
5136
5088
  const indexBuilder = new IndexBuilderService();
5137
- const mapToTree = (currentLevelNodes, allNodes, parentIdField, idField, parent = null, parentIndex = '') => {
5089
+ const mapToWrappers = (currentLevelNodes, childrenField, parent = null, parentIndex = '') => {
5138
5090
  if (!isArrayWithAtLeastOneItem(currentLevelNodes)) {
5139
5091
  return [];
5140
5092
  }
@@ -5146,26 +5098,40 @@ const mapToTree = (currentLevelNodes, allNodes, parentIdField, idField, parent =
5146
5098
  parent,
5147
5099
  visible: true
5148
5100
  };
5149
- wrapper.children = mapToTree(findChildren(getter(parentIdField), allNodes || [], getter(idField)(node)), allNodes, parentIdField, idField, wrapper, index);
5101
+ wrapper.children = mapToWrappers(getter(childrenField)(node), childrenField, wrapper, index);
5150
5102
  return wrapper;
5151
5103
  });
5152
5104
  };
5153
5105
  /**
5154
- * A directive which encapsulates the retrieval of the child nodes.
5106
+ * A directive which encapsulates the retrieval of child nodes.
5155
5107
  */
5156
- class FlatDataBindingDirective extends FilteringBase {
5157
- constructor(component) {
5108
+ class HierarchyBindingDirective extends FilteringBase {
5109
+ constructor(component, dragAndDropDirective) {
5158
5110
  super(component);
5159
5111
  this.component = component;
5112
+ this.dragAndDropDirective = dragAndDropDirective;
5160
5113
  /**
5161
5114
  * @hidden
5162
5115
  */
5163
5116
  this.loadOnDemand = true;
5164
- /**
5165
- * @hidden
5166
- */
5167
5117
  this.originalData = [];
5168
- this.component.isVisible = (node) => this.visibleNodes.has(node);
5118
+ const shouldFilter = !isPresent(this.dragAndDropDirective);
5119
+ this.component.isVisible = shouldFilter ? (node) => this.visibleNodes.has(node) : isVisible;
5120
+ }
5121
+ /**
5122
+ * The field name which holds the data items of the child component.
5123
+ */
5124
+ set childrenField(value) {
5125
+ if (!value) {
5126
+ throw new Error("'childrenField' cannot be empty");
5127
+ }
5128
+ this._childrenField = value;
5129
+ }
5130
+ /**
5131
+ * The field name which holds the data items of the child component.
5132
+ */
5133
+ get childrenField() {
5134
+ return this._childrenField;
5169
5135
  }
5170
5136
  /**
5171
5137
  * @hidden
@@ -5174,15 +5140,14 @@ class FlatDataBindingDirective extends FilteringBase {
5174
5140
  set isVisible(fn) {
5175
5141
  this.component.isVisible = fn;
5176
5142
  }
5177
- /**
5178
- * @hidden
5179
- */
5180
5143
  ngOnInit() {
5181
- if (isPresent(this.parentIdField) && isPresent(this.idField)) {
5182
- const fetchChildren = (node) => findChildren(getter(this.parentIdField), this.originalData || [], getter(this.idField)(node));
5183
- this.component.hasChildren = (node) => fetchChildren(node).length > 0;
5184
- this.component.children = (node) => of(fetchChildren(node));
5185
- this.component.editService = new FlatEditingService(this);
5144
+ if (isPresent(this.childrenField)) {
5145
+ this.component.children = item => of(getter(this.childrenField)(item));
5146
+ this.component.hasChildren = item => {
5147
+ const children = getter(this.childrenField)(item);
5148
+ return Boolean(children && children.length);
5149
+ };
5150
+ this.component.editService = new HierarchyEditingService(this);
5186
5151
  this.component.filterChange.subscribe(this.handleFilterChange.bind(this));
5187
5152
  if (this.component.filter) {
5188
5153
  this.handleFilterChange(this.component.filter);
@@ -5192,11 +5157,8 @@ class FlatDataBindingDirective extends FilteringBase {
5192
5157
  }
5193
5158
  }
5194
5159
  }
5195
- /**
5196
- * @hidden
5197
- */
5198
5160
  ngOnChanges(changes) {
5199
- if (isChanged('parentIdField', changes, false)) {
5161
+ if (isChanged('childrenField', changes, false)) {
5200
5162
  this.nodes = this.originalData;
5201
5163
  this.updateNodes(this.originalData);
5202
5164
  }
@@ -5213,81 +5175,31 @@ class FlatDataBindingDirective extends FilteringBase {
5213
5175
  */
5214
5176
  updateNodes(values) {
5215
5177
  this.originalData = values || [];
5216
- if (!isNullOrEmptyString(this.parentIdField)) {
5217
- const prop = getter(this.parentIdField);
5218
- this.component.nodes = this.originalData.filter(compose(isBlank, prop));
5219
- this.filterData = mapToTree(this.component.nodes, this.originalData, this.parentIdField, this.idField);
5220
- this.updateVisibleNodes(this.filterData);
5221
- }
5222
- else {
5223
- this.component.nodes = this.originalData.slice(0);
5224
- }
5178
+ this.filterData = mapToWrappers(values, this.childrenField) || [];
5179
+ this.updateVisibleNodes(this.filterData);
5225
5180
  }
5226
5181
  }
5227
- FlatDataBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FlatDataBindingDirective, deps: [{ token: DataBoundComponent }], target: i0.ɵɵFactoryTarget.Directive });
5228
- FlatDataBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FlatDataBindingDirective, selector: "[kendoTreeViewFlatDataBinding]", inputs: { nodes: "nodes", parentIdField: "parentIdField", idField: "idField", loadOnDemand: "loadOnDemand", isVisible: "isVisible" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
5229
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FlatDataBindingDirective, decorators: [{
5182
+ HierarchyBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: DataBoundComponent }, { token: DragAndDropDirective, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
5183
+ HierarchyBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: HierarchyBindingDirective, isStandalone: true, selector: "[kendoTreeViewHierarchyBinding]", inputs: { childrenField: "childrenField", nodes: "nodes", isVisible: "isVisible", loadOnDemand: "loadOnDemand" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
5184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyBindingDirective, decorators: [{
5230
5185
  type: Directive,
5231
- args: [{ selector: "[kendoTreeViewFlatDataBinding]" }]
5232
- }], ctorParameters: function () { return [{ type: DataBoundComponent }]; }, propDecorators: { nodes: [{
5233
- type: Input
5234
- }], parentIdField: [{
5235
- type: Input
5236
- }], idField: [{
5186
+ args: [{
5187
+ selector: '[kendoTreeViewHierarchyBinding]',
5188
+ standalone: true
5189
+ }]
5190
+ }], ctorParameters: function () {
5191
+ return [{ type: DataBoundComponent }, { type: DragAndDropDirective, decorators: [{
5192
+ type: Optional
5193
+ }, {
5194
+ type: Host
5195
+ }] }];
5196
+ }, propDecorators: { childrenField: [{
5237
5197
  type: Input
5238
- }], loadOnDemand: [{
5198
+ }], nodes: [{
5239
5199
  type: Input
5240
5200
  }], isVisible: [{
5241
5201
  type: Input
5242
- }] } });
5243
-
5244
- /**
5245
- * A directive which enables the update of the initially provided data array during drag-and-drop.
5246
- *
5247
- * Either use this directive in combination with one of the data binding directives ([`kendoTreeViewHierarchyBinding`]({% slug api_treeview_hierarchybindingdirective %})
5248
- * or [`kendoTreeViewFlatDataBinding`]({% slug api_treeview_flatdatabindingdirective %})) which set their own edit handlers, or provide
5249
- * your own [`editService`]({% slug api_treeview_editservice %}) to this directive. The latter subscribes to and calls the
5250
- * [`addItem`]({% slug api_treeview_treeviewcomponent %}#toc-additem) and [`removeItem`]({% slug api_treeview_treeviewcomponent %}#toc-removeitem)
5251
- * handlers when the corresponding events are triggered by the TreeView component.
5252
- */
5253
- class DragAndDropEditingDirective {
5254
- constructor(treeview) {
5255
- this.treeview = treeview;
5256
- this.subscriptions = new Subscription();
5257
- this.subscriptions.add(this.treeview.addItem.subscribe(this.handleAdd.bind(this)));
5258
- this.subscriptions.add(this.treeview.removeItem.subscribe(this.handleRemove.bind(this)));
5259
- }
5260
- /**
5261
- * Specifies the handlers called on drag-and-drop [`addItem`]({% slug api_treeview_treeviewcomponent %}#toc-additem)
5262
- * and [`removeItem`]({% slug api_treeview_treeviewcomponent %}#toc-removeitem) events.
5263
- */
5264
- set editService(service) {
5265
- this.treeview.editService = service;
5266
- }
5267
- ngOnDestroy() {
5268
- this.subscriptions.unsubscribe();
5269
- }
5270
- handleAdd(args) {
5271
- if (!isPresent(this.treeview.editService)) {
5272
- throw new Error('No `editService` provided. Either provide your own implementation or use this directive in combination with one of the data binding directives (`kendoTreeViewHierarchyBinding` or `kendoTreeViewFlatDataBinding`).');
5273
- }
5274
- this.treeview.editService.add(args);
5275
- }
5276
- handleRemove(args) {
5277
- if (!isPresent(this.treeview.editService)) {
5278
- throw new Error('No `editService` provided. Either provide your own implementation or use this directive in combination with one of the data binding directives (`kendoTreeViewHierarchyBinding` or `kendoTreeViewFlatDataBinding`).');
5279
- }
5280
- this.treeview.editService.remove(args);
5281
- }
5282
- }
5283
- DragAndDropEditingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropEditingDirective, deps: [{ token: TreeViewComponent }], target: i0.ɵɵFactoryTarget.Directive });
5284
- DragAndDropEditingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragAndDropEditingDirective, selector: "[kendoTreeViewDragAndDropEditing]", inputs: { editService: "editService" }, ngImport: i0 });
5285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropEditingDirective, decorators: [{
5286
- type: Directive,
5287
- args: [{
5288
- selector: '[kendoTreeViewDragAndDropEditing]'
5289
- }]
5290
- }], ctorParameters: function () { return [{ type: TreeViewComponent }]; }, propDecorators: { editService: [{
5202
+ }], loadOnDemand: [{
5291
5203
  type: Input
5292
5204
  }] } });
5293
5205
 
@@ -5368,11 +5280,12 @@ class LoadMoreDirective {
5368
5280
  }
5369
5281
  }
5370
5282
  LoadMoreDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadMoreDirective, deps: [{ token: TreeViewComponent }], target: i0.ɵɵFactoryTarget.Directive });
5371
- LoadMoreDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LoadMoreDirective, selector: "[kendoTreeViewLoadMore]", inputs: { loadMoreNodes: ["kendoTreeViewLoadMore", "loadMoreNodes"], pageSize: "pageSize", totalRootNodes: "totalRootNodes", totalField: "totalField" }, usesOnChanges: true, ngImport: i0 });
5283
+ LoadMoreDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LoadMoreDirective, isStandalone: true, selector: "[kendoTreeViewLoadMore]", inputs: { loadMoreNodes: ["kendoTreeViewLoadMore", "loadMoreNodes"], pageSize: "pageSize", totalRootNodes: "totalRootNodes", totalField: "totalField" }, usesOnChanges: true, ngImport: i0 });
5372
5284
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadMoreDirective, decorators: [{
5373
5285
  type: Directive,
5374
5286
  args: [{
5375
- selector: '[kendoTreeViewLoadMore]'
5287
+ selector: '[kendoTreeViewLoadMore]',
5288
+ standalone: true
5376
5289
  }]
5377
5290
  }], ctorParameters: function () { return [{ type: TreeViewComponent }]; }, propDecorators: { loadMoreNodes: [{
5378
5291
  type: Input,
@@ -5398,7 +5311,7 @@ class CustomMessagesComponent extends TreeViewMessages {
5398
5311
  }
5399
5312
  }
5400
5313
  CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
5401
- CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomMessagesComponent, selector: "kendo-treeview-messages", providers: [
5314
+ CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomMessagesComponent, isStandalone: true, selector: "kendo-treeview-messages", providers: [
5402
5315
  {
5403
5316
  provide: TreeViewMessages,
5404
5317
  useExisting: forwardRef(() => CustomMessagesComponent)
@@ -5414,106 +5327,144 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
5414
5327
  }
5415
5328
  ],
5416
5329
  selector: 'kendo-treeview-messages',
5417
- template: ``
5330
+ template: ``,
5331
+ standalone: true
5418
5332
  }]
5419
5333
  }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
5420
5334
 
5421
- const COMPONENT_DIRECTIVES = [
5422
- TreeViewComponent,
5423
- TreeViewGroupComponent,
5424
- TreeViewItemDirective,
5425
- TreeViewItemContentDirective,
5426
- NodeTemplateDirective,
5427
- CheckDirective,
5428
- DisableDirective,
5429
- ExpandDirective,
5430
- SelectDirective,
5431
- HierarchyBindingDirective,
5432
- LoadingIndicatorDirective,
5433
- FlatDataBindingDirective,
5434
- DragAndDropDirective,
5435
- DragClueTemplateDirective,
5436
- DragClueComponent,
5437
- DropHintTemplateDirective,
5438
- DropHintComponent,
5439
- DragAndDropEditingDirective,
5440
- LoadMoreDirective,
5441
- LoadMoreButtonTemplateDirective,
5442
- LocalizedMessagesDirective,
5443
- CustomMessagesComponent,
5444
- ];
5445
5335
  /**
5446
- * @hidden
5336
+ * A directive which manages the in-memory selection state of the TreeView node
5337
+ * ([see example]({% slug selection_treeview %})).
5447
5338
  */
5448
- class SharedModule {
5339
+ class SelectDirective {
5340
+ constructor(treeView, navigationService) {
5341
+ this.treeView = treeView;
5342
+ this.navigationService = navigationService;
5343
+ /**
5344
+ * Fires when the `selectedKeys` collection was updated.
5345
+ */
5346
+ this.selectedKeysChange = new EventEmitter();
5347
+ this.subscriptions = new Subscription();
5348
+ this.selectActions = {
5349
+ 'multiple': (e) => this.selectMultiple(e),
5350
+ 'single': (e) => this.selectSingle(e)
5351
+ };
5352
+ /**
5353
+ * Reflectes the internal `selectedKeys` state.
5354
+ */
5355
+ this.state = new Set();
5356
+ this.subscriptions.add(this.treeView.selectionChange.subscribe(this.select.bind(this)));
5357
+ this.treeView.isSelected = (dataItem, index) => (this.state.has(this.itemKey({ dataItem, index })));
5358
+ this.navigationService.deselectAllButCurrentItem.subscribe((node) => {
5359
+ this.selectSingle(node);
5360
+ });
5361
+ }
5362
+ /**
5363
+ * @hidden
5364
+ */
5365
+ set isSelected(value) {
5366
+ this.treeView.isSelected = value;
5367
+ }
5368
+ get getAriaMultiselectable() {
5369
+ return this.options.mode === 'multiple';
5370
+ }
5371
+ get options() {
5372
+ const defaultOptions = {
5373
+ enabled: true,
5374
+ mode: 'single'
5375
+ };
5376
+ if (!isPresent(this.selection) || typeof this.selection === 'string') {
5377
+ return defaultOptions;
5378
+ }
5379
+ const selectionSettings = isBoolean(this.selection) ? { enabled: this.selection } : this.selection;
5380
+ return Object.assign(defaultOptions, selectionSettings);
5381
+ }
5382
+ ngOnChanges(changes) {
5383
+ var _a;
5384
+ if (isChanged('selectedKeys', changes, false) && changes['selectedKeys'].currentValue !== this.lastChange) {
5385
+ this.state = new Set(changes['selectedKeys'].currentValue);
5386
+ }
5387
+ const isSelectionBooleanTrue = typeof this.selection === 'boolean' && this.selection;
5388
+ this.navigationService.selection = isSelectionBooleanTrue ? 'single' : (_a = this.selection) === null || _a === void 0 ? void 0 : _a.mode;
5389
+ }
5390
+ ngOnDestroy() {
5391
+ this.subscriptions.unsubscribe();
5392
+ }
5393
+ itemKey(e) {
5394
+ if (!this.selectKey) {
5395
+ return e.index;
5396
+ }
5397
+ if (typeof this.selectKey === 'string') {
5398
+ return e.dataItem[this.selectKey];
5399
+ }
5400
+ if (typeof this.selectKey === 'function') {
5401
+ return this.selectKey(e);
5402
+ }
5403
+ }
5404
+ select(e) {
5405
+ const { enabled, mode } = this.options;
5406
+ const performSelection = this.selectActions[mode] || noop;
5407
+ if (!enabled) {
5408
+ return;
5409
+ }
5410
+ performSelection(e);
5411
+ }
5412
+ selectSingle(node) {
5413
+ const key = this.itemKey(node);
5414
+ if (!this.state.has(key)) {
5415
+ this.state.clear();
5416
+ this.state.add(key);
5417
+ this.notify();
5418
+ }
5419
+ }
5420
+ selectMultiple(node) {
5421
+ const key = this.itemKey(node);
5422
+ const isSelected = this.state.has(key);
5423
+ if (!isPresent(key)) {
5424
+ return;
5425
+ }
5426
+ if (isSelected) {
5427
+ this.state.delete(key);
5428
+ }
5429
+ else {
5430
+ this.state.add(key);
5431
+ }
5432
+ this.notify();
5433
+ }
5434
+ notify() {
5435
+ this.lastChange = Array.from(this.state);
5436
+ this.selectedKeysChange.emit(this.lastChange);
5437
+ }
5449
5438
  }
5450
- SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5451
- SharedModulemod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, declarations: [TreeViewComponent,
5452
- TreeViewGroupComponent,
5453
- TreeViewItemDirective,
5454
- TreeViewItemContentDirective,
5455
- NodeTemplateDirective,
5456
- CheckDirective,
5457
- DisableDirective,
5458
- ExpandDirective,
5459
- SelectDirective,
5460
- HierarchyBindingDirective,
5461
- LoadingIndicatorDirective,
5462
- FlatDataBindingDirective,
5463
- DragAndDropDirective,
5464
- DragClueTemplateDirective,
5465
- DragClueComponent,
5466
- DropHintTemplateDirective,
5467
- DropHintComponent,
5468
- DragAndDropEditingDirective,
5469
- LoadMoreDirective,
5470
- LoadMoreButtonTemplateDirective,
5471
- LocalizedMessagesDirective,
5472
- CustomMessagesComponent], imports: [CommonModule,
5473
- InputsModule,
5474
- IconsModule], exports: [TreeViewComponent,
5475
- TreeViewGroupComponent,
5476
- TreeViewItemDirective,
5477
- TreeViewItemContentDirective,
5478
- NodeTemplateDirective,
5479
- CheckDirective,
5480
- DisableDirective,
5481
- ExpandDirective,
5482
- SelectDirective,
5483
- HierarchyBindingDirective,
5484
- LoadingIndicatorDirective,
5485
- FlatDataBindingDirective,
5486
- DragAndDropDirective,
5487
- DragClueTemplateDirective,
5488
- DragClueComponent,
5489
- DropHintTemplateDirective,
5490
- DropHintComponent,
5491
- DragAndDropEditingDirective,
5492
- LoadMoreDirective,
5493
- LoadMoreButtonTemplateDirective,
5494
- LocalizedMessagesDirective,
5495
- CustomMessagesComponent] });
5496
- SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, imports: [CommonModule,
5497
- InputsModule,
5498
- IconsModule] });
5499
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, decorators: [{
5500
- type: NgModule,
5439
+ SelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectDirective, deps: [{ token: TreeViewComponent }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Directive });
5440
+ SelectDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: SelectDirective, isStandalone: true, selector: "[kendoTreeViewSelectable]", inputs: { isSelected: "isSelected", selectKey: ["selectBy", "selectKey"], selection: ["kendoTreeViewSelectable", "selection"], selectedKeys: "selectedKeys" }, outputs: { selectedKeysChange: "selectedKeysChange" }, host: { properties: { "attr.aria-multiselectable": "this.getAriaMultiselectable" } }, usesOnChanges: true, ngImport: i0 });
5441
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectDirective, decorators: [{
5442
+ type: Directive,
5501
5443
  args: [{
5502
- declarations: [COMPONENT_DIRECTIVES],
5503
- exports: [COMPONENT_DIRECTIVES],
5504
- imports: [
5505
- CommonModule,
5506
- InputsModule,
5507
- IconsModule
5508
- ],
5509
- entryComponents: [
5510
- DragClueComponent,
5511
- DropHintComponent
5512
- ]
5444
+ selector: '[kendoTreeViewSelectable]',
5445
+ standalone: true
5513
5446
  }]
5514
- }] });
5447
+ }], ctorParameters: function () { return [{ type: TreeViewComponent }, { type: NavigationService }]; }, propDecorators: { isSelected: [{
5448
+ type: Input
5449
+ }], selectKey: [{
5450
+ type: Input,
5451
+ args: ['selectBy']
5452
+ }], selection: [{
5453
+ type: Input,
5454
+ args: ['kendoTreeViewSelectable']
5455
+ }], selectedKeys: [{
5456
+ type: Input
5457
+ }], selectedKeysChange: [{
5458
+ type: Output
5459
+ }], getAriaMultiselectable: [{
5460
+ type: HostBinding,
5461
+ args: ['attr.aria-multiselectable']
5462
+ }] } });
5515
5463
 
5516
- const EXPORTS = [
5464
+ /**
5465
+ * Utility array that contains all `@progress/kendo-angular-treeview` related components and directives
5466
+ */
5467
+ const KENDO_TREEVIEW = [
5517
5468
  TreeViewComponent,
5518
5469
  NodeTemplateDirective,
5519
5470
  CheckDirective,
@@ -5528,37 +5479,40 @@ const EXPORTS = [
5528
5479
  DragAndDropEditingDirective,
5529
5480
  LoadMoreDirective,
5530
5481
  LoadMoreButtonTemplateDirective,
5531
- LocalizedMessagesDirective,
5532
- CustomMessagesComponent,
5482
+ CustomMessagesComponent
5533
5483
  ];
5484
+
5485
+ //IMPORTANT: NgModule export kept for backwards compatibility
5534
5486
  /**
5535
5487
  * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the TreeView component.
5536
5488
  */
5537
5489
  class TreeViewModule {
5538
5490
  }
5539
5491
  TreeViewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5540
- TreeViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: TreeViewModule, imports: [SharedModule], exports: [TreeViewComponent,
5541
- NodeTemplateDirective,
5542
- CheckDirective,
5543
- DisableDirective,
5544
- ExpandDirective,
5545
- SelectDirective,
5546
- HierarchyBindingDirective,
5547
- FlatDataBindingDirective,
5548
- DragAndDropDirective,
5549
- DragClueTemplateDirective,
5550
- DropHintTemplateDirective,
5551
- DragAndDropEditingDirective,
5552
- LoadMoreDirective,
5553
- LoadMoreButtonTemplateDirective,
5554
- LocalizedMessagesDirective,
5555
- CustomMessagesComponent] });
5556
- TreeViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewModule, imports: [SharedModule] });
5492
+ TreeViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: TreeViewModule, imports: [TreeViewComponent, NodeTemplateDirective, CheckDirective, DisableDirective, ExpandDirective, SelectDirective, HierarchyBindingDirective, FlatDataBindingDirective, DragAndDropDirective, DragClueTemplateDirective, DropHintTemplateDirective, DragAndDropEditingDirective, LoadMoreDirective, LoadMoreButtonTemplateDirective, CustomMessagesComponent], exports: [TreeViewComponent, NodeTemplateDirective, CheckDirective, DisableDirective, ExpandDirective, SelectDirective, HierarchyBindingDirective, FlatDataBindingDirective, DragAndDropDirective, DragClueTemplateDirective, DropHintTemplateDirective, DragAndDropEditingDirective, LoadMoreDirective, LoadMoreButtonTemplateDirective, CustomMessagesComponent] });
5493
+ TreeViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewModule, providers: [
5494
+ IconsService,
5495
+ PopupService,
5496
+ ResizeBatchService,
5497
+ DialogContainerService,
5498
+ DialogService,
5499
+ WindowService,
5500
+ WindowContainerService
5501
+ ], imports: [TreeViewComponent, CustomMessagesComponent] });
5557
5502
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewModule, decorators: [{
5558
5503
  type: NgModule,
5559
5504
  args: [{
5560
- exports: [EXPORTS],
5561
- imports: [SharedModule]
5505
+ imports: [...KENDO_TREEVIEW],
5506
+ exports: [...KENDO_TREEVIEW],
5507
+ providers: [
5508
+ IconsService,
5509
+ PopupService,
5510
+ ResizeBatchService,
5511
+ DialogContainerService,
5512
+ DialogService,
5513
+ WindowService,
5514
+ WindowContainerService
5515
+ ]
5562
5516
  }]
5563
5517
  }] });
5564
5518
 
@@ -5566,5 +5520,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
5566
5520
  * Generated bundle index. Do not edit.
5567
5521
  */
5568
5522
 
5569
- export { CheckDirective, CustomMessagesComponent, DataBoundComponent, DisableDirective, DragAndDropDirective, DragAndDropEditingDirective, DragClueService, DragClueTemplateDirective, DropAction, DropHintService, DropHintTemplateDirective, DropPosition, ExpandDirective, ExpandableComponent, FlatDataBindingDirective, HierarchyBindingDirective, LoadMoreButtonTemplateDirective, LoadMoreDirective, LocalizedMessagesDirective, NodeTemplateDirective, SelectDirective, TreeItemDragEvent, TreeItemDragStartEvent, TreeItemDropEvent, TreeViewComponent, TreeViewModule };
5523
+ export { CheckDirective, CustomMessagesComponent, DataBoundComponent, DisableDirective, DragAndDropDirective, DragAndDropEditingDirective, DragClueService, DragClueTemplateDirective, DropAction, DropHintService, DropHintTemplateDirective, DropPosition, ExpandDirective, ExpandableComponent, FlatDataBindingDirective, HierarchyBindingDirective, KENDO_TREEVIEW, LoadMoreButtonTemplateDirective, LoadMoreDirective, LocalizedMessagesDirective, NodeTemplateDirective, SelectDirective, TreeItemDragEvent, TreeItemDragStartEvent, TreeItemDropEvent, TreeViewComponent, TreeViewModule };
5570
5524