@progress/kendo-angular-treeview 16.5.0 → 16.6.0-develop.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.txt +12 -19
- package/check.directive.d.ts +1 -1
- package/directives.d.ts +23 -0
- package/disable.directive.d.ts +1 -1
- package/drag-and-drop/drag-and-drop-editing.directive.d.ts +1 -1
- package/drag-and-drop/drag-and-drop.directive.d.ts +1 -1
- package/drag-and-drop/drag-clue/drag-clue-template.directive.d.ts +1 -1
- package/drag-and-drop/drag-clue/drag-clue.component.d.ts +1 -1
- package/drag-and-drop/drop-hint/drop-hint-template.directive.d.ts +1 -1
- package/drag-and-drop/drop-hint/drop-hint.component.d.ts +1 -1
- package/esm2020/check.directive.mjs +5 -2
- package/esm2020/directives.mjs +39 -0
- package/esm2020/disable.directive.mjs +5 -2
- package/esm2020/drag-and-drop/drag-and-drop-editing.directive.mjs +3 -2
- package/esm2020/drag-and-drop/drag-and-drop.directive.mjs +3 -2
- package/esm2020/drag-and-drop/drag-clue/drag-clue-template.directive.mjs +3 -2
- package/esm2020/drag-and-drop/drag-clue/drag-clue.component.mjs +7 -5
- package/esm2020/drag-and-drop/drop-hint/drop-hint-template.directive.mjs +3 -2
- package/esm2020/drag-and-drop/drop-hint/drop-hint.component.mjs +6 -4
- package/esm2020/expand.directive.mjs +5 -2
- package/esm2020/flat-binding.directive.mjs +5 -2
- package/esm2020/hierarchy-binding.directive.mjs +5 -2
- package/esm2020/index.mjs +1 -0
- package/esm2020/load-more/load-more-button-template.directive.mjs +3 -2
- package/esm2020/load-more/load-more.directive.mjs +3 -2
- package/esm2020/loading-indicator.directive.mjs +5 -2
- package/esm2020/localization/custom-messages.component.mjs +3 -2
- package/esm2020/localization/localized-messages.directive.mjs +3 -2
- package/esm2020/node-template.directive.mjs +3 -2
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/selection/select.directive.mjs +5 -2
- package/esm2020/treeview-group.component.mjs +11 -9
- package/esm2020/treeview-item-content.directive.mjs +5 -2
- package/esm2020/treeview-item.directive.mjs +5 -2
- package/esm2020/treeview.component.mjs +10 -14
- package/esm2020/treeview.module.mjs +42 -54
- package/expand.directive.d.ts +1 -1
- package/fesm2015/progress-kendo-angular-treeview.mjs +1326 -1377
- package/fesm2020/progress-kendo-angular-treeview.mjs +1174 -1225
- package/flat-binding.directive.d.ts +1 -1
- package/hierarchy-binding.directive.d.ts +1 -1
- package/index.d.ts +1 -0
- package/load-more/load-more-button-template.directive.d.ts +1 -1
- package/load-more/load-more.directive.d.ts +1 -1
- package/loading-indicator.directive.d.ts +1 -1
- package/localization/custom-messages.component.d.ts +1 -1
- package/localization/localized-messages.directive.d.ts +1 -1
- package/node-template.directive.d.ts +1 -1
- package/package.json +6 -6
- package/schematics/ngAdd/index.js +4 -4
- package/selection/select.directive.d.ts +1 -1
- package/treeview-group.component.d.ts +1 -1
- package/treeview-item-content.directive.d.ts +1 -1
- package/treeview-item.directive.d.ts +1 -1
- package/treeview.component.d.ts +1 -6
- package/treeview.module.d.ts +16 -18
- package/esm2020/shared.module.mjs +0 -125
- 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
|
|
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:
|
|
32
|
-
version: '16.
|
|
30
|
+
publishDate: 1722606887,
|
|
31
|
+
version: '16.6.0-develop.10',
|
|
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: [{
|
|
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: "
|
|
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
|
|
|
@@ -2147,11 +2160,6 @@ const providers = [
|
|
|
2147
2160
|
/**
|
|
2148
2161
|
* Represents the [Kendo UI TreeView component for Angular]({% slug overview_treeview %}).
|
|
2149
2162
|
*
|
|
2150
|
-
* {% meta height:450 %}
|
|
2151
|
-
* {% embed_file get-started/app.component.ts preview %}
|
|
2152
|
-
* {% embed_file get-started/app.module.ts %}
|
|
2153
|
-
* {% embed_file shared/main.ts %}
|
|
2154
|
-
* {% endmeta %}
|
|
2155
2163
|
*/
|
|
2156
2164
|
class TreeViewComponent {
|
|
2157
2165
|
constructor(element, changeDetectorRef, expandService, navigationService, nodeChildrenService, selectionService, treeViewLookupService, ngZone, renderer, dataChangeNotification, localization) {
|
|
@@ -2724,7 +2732,7 @@ class TreeViewComponent {
|
|
|
2724
2732
|
}
|
|
2725
2733
|
}
|
|
2726
2734
|
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: `
|
|
2735
|
+
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
2736
|
<ng-container kendoTreeViewLocalizedMessages
|
|
2729
2737
|
i18n-loadMore="kendo.treeview.loadMore|The title of the Load More button"
|
|
2730
2738
|
loadMore="Load more..."
|
|
@@ -2781,7 +2789,7 @@ TreeViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
2781
2789
|
>
|
|
2782
2790
|
</ul>
|
|
2783
2791
|
<ng-container #assetsContainer></ng-container>
|
|
2784
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
2792
|
+
`, 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
2793
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewComponent, decorators: [{
|
|
2786
2794
|
type: Component,
|
|
2787
2795
|
args: [{
|
|
@@ -2846,7 +2854,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2846
2854
|
>
|
|
2847
2855
|
</ul>
|
|
2848
2856
|
<ng-container #assetsContainer></ng-container>
|
|
2849
|
-
|
|
2857
|
+
`,
|
|
2858
|
+
standalone: true,
|
|
2859
|
+
imports: [LocalizedMessagesDirective, NgIf, TextBoxComponent, TextBoxPrefixTemplateDirective, IconWrapperComponent, TreeViewGroupComponent]
|
|
2850
2860
|
}]
|
|
2851
2861
|
}], 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
2862
|
type: HostBinding,
|
|
@@ -3220,10 +3230,13 @@ class CheckDirective {
|
|
|
3220
3230
|
}
|
|
3221
3231
|
}
|
|
3222
3232
|
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 });
|
|
3233
|
+
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
3234
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CheckDirective, decorators: [{
|
|
3225
3235
|
type: Directive,
|
|
3226
|
-
args: [{
|
|
3236
|
+
args: [{
|
|
3237
|
+
selector: '[kendoTreeViewCheckable]',
|
|
3238
|
+
standalone: true
|
|
3239
|
+
}]
|
|
3227
3240
|
}], ctorParameters: function () { return [{ type: TreeViewComponent }, { type: i0.NgZone }]; }, propDecorators: { isChecked: [{
|
|
3228
3241
|
type: Input
|
|
3229
3242
|
}], checkKey: [{
|
|
@@ -3277,10 +3290,13 @@ class DisableDirective {
|
|
|
3277
3290
|
}
|
|
3278
3291
|
}
|
|
3279
3292
|
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 });
|
|
3293
|
+
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
3294
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DisableDirective, decorators: [{
|
|
3282
3295
|
type: Directive,
|
|
3283
|
-
args: [{
|
|
3296
|
+
args: [{
|
|
3297
|
+
selector: '[kendoTreeViewDisable]',
|
|
3298
|
+
standalone: true
|
|
3299
|
+
}]
|
|
3284
3300
|
}], ctorParameters: function () { return [{ type: TreeViewComponent }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { isDisabled: [{
|
|
3285
3301
|
type: Input
|
|
3286
3302
|
}], disableKey: [{
|
|
@@ -3290,371 +3306,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3290
3306
|
type: Input
|
|
3291
3307
|
}] } });
|
|
3292
3308
|
|
|
3293
|
-
const DEFAULT_FILTER_EXPAND_SETTINGS = {
|
|
3294
|
-
maxAutoExpandResults: -1,
|
|
3295
|
-
expandMatches: false,
|
|
3296
|
-
expandedOnClear: "none"
|
|
3297
|
-
};
|
|
3298
3309
|
/**
|
|
3299
|
-
* A directive which
|
|
3300
|
-
*
|
|
3310
|
+
* A directive which enables the update of the initially provided data array during drag-and-drop.
|
|
3311
|
+
*
|
|
3312
|
+
* Either use this directive in combination with one of the data binding directives ([`kendoTreeViewHierarchyBinding`]({% slug api_treeview_hierarchybindingdirective %})
|
|
3313
|
+
* or [`kendoTreeViewFlatDataBinding`]({% slug api_treeview_flatdatabindingdirective %})) which set their own edit handlers, or provide
|
|
3314
|
+
* your own [`editService`]({% slug api_treeview_editservice %}) to this directive. The latter subscribes to and calls the
|
|
3315
|
+
* [`addItem`]({% slug api_treeview_treeviewcomponent %}#toc-additem) and [`removeItem`]({% slug api_treeview_treeviewcomponent %}#toc-removeitem)
|
|
3316
|
+
* handlers when the corresponding events are triggered by the TreeView component.
|
|
3301
3317
|
*/
|
|
3302
|
-
class
|
|
3303
|
-
constructor(
|
|
3304
|
-
this.
|
|
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();
|
|
3318
|
+
class DragAndDropEditingDirective {
|
|
3319
|
+
constructor(treeview) {
|
|
3320
|
+
this.treeview = treeview;
|
|
3315
3321
|
this.subscriptions = new Subscription();
|
|
3316
|
-
|
|
3317
|
-
|
|
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 }));
|
|
3322
|
+
this.subscriptions.add(this.treeview.addItem.subscribe(this.handleAdd.bind(this)));
|
|
3323
|
+
this.subscriptions.add(this.treeview.removeItem.subscribe(this.handleRemove.bind(this)));
|
|
3353
3324
|
}
|
|
3354
3325
|
/**
|
|
3355
|
-
*
|
|
3326
|
+
* Specifies the handlers called on drag-and-drop [`addItem`]({% slug api_treeview_treeviewcomponent %}#toc-additem)
|
|
3327
|
+
* and [`removeItem`]({% slug api_treeview_treeviewcomponent %}#toc-removeitem) events.
|
|
3356
3328
|
*/
|
|
3357
|
-
set
|
|
3358
|
-
this.
|
|
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
|
-
}
|
|
3329
|
+
set editService(service) {
|
|
3330
|
+
this.treeview.editService = service;
|
|
3368
3331
|
}
|
|
3369
3332
|
ngOnDestroy() {
|
|
3370
3333
|
this.subscriptions.unsubscribe();
|
|
3371
3334
|
}
|
|
3372
|
-
|
|
3373
|
-
|
|
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();
|
|
3335
|
+
handleAdd(args) {
|
|
3336
|
+
if (!isPresent(this.treeview.editService)) {
|
|
3337
|
+
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
3338
|
}
|
|
3339
|
+
this.treeview.editService.add(args);
|
|
3401
3340
|
}
|
|
3402
|
-
|
|
3403
|
-
if (!this.
|
|
3404
|
-
|
|
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();
|
|
3341
|
+
handleRemove(args) {
|
|
3342
|
+
if (!isPresent(this.treeview.editService)) {
|
|
3343
|
+
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
3344
|
}
|
|
3453
|
-
this.
|
|
3454
|
-
}
|
|
3455
|
-
notify() {
|
|
3456
|
-
this.lastChange = Array.from(this.state);
|
|
3457
|
-
this.expandedKeysChange.emit(this.lastChange);
|
|
3345
|
+
this.treeview.editService.remove(args);
|
|
3458
3346
|
}
|
|
3459
3347
|
}
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
3348
|
+
DragAndDropEditingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropEditingDirective, deps: [{ token: TreeViewComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3349
|
+
DragAndDropEditingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragAndDropEditingDirective, isStandalone: true, selector: "[kendoTreeViewDragAndDropEditing]", inputs: { editService: "editService" }, ngImport: i0 });
|
|
3350
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropEditingDirective, decorators: [{
|
|
3463
3351
|
type: Directive,
|
|
3464
|
-
args: [{
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
args: ["expandBy"]
|
|
3470
|
-
}], expandOnFilter: [{
|
|
3471
|
-
type: Input
|
|
3472
|
-
}], expandedKeysChange: [{
|
|
3473
|
-
type: Output
|
|
3474
|
-
}], expandedKeys: [{
|
|
3352
|
+
args: [{
|
|
3353
|
+
selector: '[kendoTreeViewDragAndDropEditing]',
|
|
3354
|
+
standalone: true
|
|
3355
|
+
}]
|
|
3356
|
+
}], ctorParameters: function () { return [{ type: TreeViewComponent }]; }, propDecorators: { editService: [{
|
|
3475
3357
|
type: Input
|
|
3476
3358
|
}] } });
|
|
3477
3359
|
|
|
3478
3360
|
/**
|
|
3479
|
-
*
|
|
3480
|
-
*
|
|
3361
|
+
* Describes the attempted drop action during dragging.
|
|
3362
|
+
* Passed as `action` value to the [`kendoTreeViewDragClueTemplate`]({% slug api_treeview_dragcluetemplatedirective %}) directive.
|
|
3363
|
+
* By default, this value defines the rendered icon in the drag clue.
|
|
3481
3364
|
*/
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3365
|
+
var DropAction;
|
|
3366
|
+
(function (DropAction) {
|
|
3367
|
+
DropAction[DropAction["Add"] = 0] = "Add";
|
|
3368
|
+
DropAction[DropAction["InsertTop"] = 1] = "InsertTop";
|
|
3369
|
+
DropAction[DropAction["InsertBottom"] = 2] = "InsertBottom";
|
|
3370
|
+
DropAction[DropAction["InsertMiddle"] = 3] = "InsertMiddle";
|
|
3371
|
+
DropAction[DropAction["Invalid"] = 4] = "Invalid";
|
|
3372
|
+
})(DropAction || (DropAction = {}));
|
|
3373
|
+
|
|
3374
|
+
/**
|
|
3375
|
+
* Describes where the dragged item is dropped relative to the drop target item.
|
|
3376
|
+
*/
|
|
3377
|
+
var DropPosition;
|
|
3378
|
+
(function (DropPosition) {
|
|
3379
|
+
DropPosition[DropPosition["Over"] = 0] = "Over";
|
|
3380
|
+
DropPosition[DropPosition["Before"] = 1] = "Before";
|
|
3381
|
+
DropPosition[DropPosition["After"] = 2] = "After";
|
|
3382
|
+
})(DropPosition || (DropPosition = {}));
|
|
3383
|
+
|
|
3384
|
+
/**
|
|
3385
|
+
* @hidden
|
|
3386
|
+
*/
|
|
3387
|
+
var ScrollDirection;
|
|
3388
|
+
(function (ScrollDirection) {
|
|
3389
|
+
ScrollDirection[ScrollDirection["Up"] = -1] = "Up";
|
|
3390
|
+
ScrollDirection[ScrollDirection["Down"] = 1] = "Down";
|
|
3391
|
+
})(ScrollDirection || (ScrollDirection = {}));
|
|
3392
|
+
|
|
3393
|
+
/**
|
|
3394
|
+
* @hidden
|
|
3395
|
+
*/
|
|
3396
|
+
class PreventableEvent {
|
|
3397
|
+
constructor() {
|
|
3398
|
+
this.prevented = false;
|
|
3504
3399
|
}
|
|
3505
3400
|
/**
|
|
3506
|
-
*
|
|
3401
|
+
* Prevents the default action for a specified event.
|
|
3402
|
+
* In this way, the source component suppresses the built-in behavior that follows the event.
|
|
3507
3403
|
*/
|
|
3508
|
-
|
|
3509
|
-
this.
|
|
3510
|
-
}
|
|
3511
|
-
get getAriaMultiselectable() {
|
|
3512
|
-
return this.options.mode === 'multiple';
|
|
3404
|
+
preventDefault() {
|
|
3405
|
+
this.prevented = true;
|
|
3513
3406
|
}
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
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;
|
|
3407
|
+
/**
|
|
3408
|
+
* If the event is prevented by any of its subscribers, returns `true`.
|
|
3409
|
+
*
|
|
3410
|
+
* @returns `true` if the default action was prevented. Otherwise, returns `false`.
|
|
3411
|
+
*/
|
|
3412
|
+
isDefaultPrevented() {
|
|
3413
|
+
return this.prevented;
|
|
3658
3414
|
}
|
|
3659
3415
|
}
|
|
3660
3416
|
|
|
@@ -3707,120 +3463,261 @@ class TreeItemDragEvent {
|
|
|
3707
3463
|
constructor() { }
|
|
3708
3464
|
}
|
|
3709
3465
|
|
|
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
3466
|
/**
|
|
3747
3467
|
* @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
3468
|
*/
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3469
|
+
class DragClueComponent {
|
|
3470
|
+
constructor(cdr) {
|
|
3471
|
+
this.cdr = cdr;
|
|
3472
|
+
this.hostClasses = true;
|
|
3473
|
+
this.posistionStyle = 'fixed';
|
|
3758
3474
|
}
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3475
|
+
get statusIconClass() {
|
|
3476
|
+
switch (this.action) {
|
|
3477
|
+
case DropAction.Add: return 'plus';
|
|
3478
|
+
case DropAction.InsertTop: return 'insert-top';
|
|
3479
|
+
case DropAction.InsertBottom: return 'insert-bottom';
|
|
3480
|
+
case DropAction.InsertMiddle: return 'insert-middle';
|
|
3481
|
+
case DropAction.Invalid:
|
|
3482
|
+
default: return 'cancel';
|
|
3763
3483
|
}
|
|
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
3484
|
}
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3485
|
+
get statusSVGIcon() {
|
|
3486
|
+
switch (this.action) {
|
|
3487
|
+
case DropAction.Add: return plusIcon;
|
|
3488
|
+
case DropAction.InsertTop: return insertTopIcon;
|
|
3489
|
+
case DropAction.InsertBottom: return insertBottomIcon;
|
|
3490
|
+
case DropAction.InsertMiddle: return insertMiddleIcon;
|
|
3491
|
+
case DropAction.Invalid:
|
|
3492
|
+
default: return cancelIcon;
|
|
3493
|
+
}
|
|
3804
3494
|
}
|
|
3805
|
-
//
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
if (!isPresent(content) || (content === draggedItem) || targetChildOfDraggedItem) {
|
|
3809
|
-
return;
|
|
3495
|
+
// exposed as a public method that can be called from outside as the component uses `OnPush` strategy
|
|
3496
|
+
detectChanges() {
|
|
3497
|
+
this.cdr.detectChanges();
|
|
3810
3498
|
}
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3499
|
+
}
|
|
3500
|
+
DragClueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3501
|
+
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: `
|
|
3502
|
+
<ng-container *ngIf="!template">
|
|
3503
|
+
<kendo-icon-wrapper
|
|
3504
|
+
innerCssClass="k-drag-status"
|
|
3505
|
+
[name]="statusIconClass"
|
|
3506
|
+
[svgIcon]="statusSVGIcon"
|
|
3507
|
+
>
|
|
3508
|
+
</kendo-icon-wrapper>
|
|
3509
|
+
<span>{{text}}</span>
|
|
3510
|
+
</ng-container>
|
|
3511
|
+
|
|
3512
|
+
<ng-template
|
|
3513
|
+
*ngIf="template"
|
|
3514
|
+
[ngTemplateOutlet]="template"
|
|
3515
|
+
[ngTemplateOutletContext]="{
|
|
3516
|
+
text: text,
|
|
3517
|
+
action: action,
|
|
3518
|
+
sourceItem: sourceItem,
|
|
3519
|
+
destinationItem: destinationItem
|
|
3520
|
+
}"
|
|
3521
|
+
>
|
|
3522
|
+
</ng-template>
|
|
3523
|
+
`, 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 });
|
|
3524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueComponent, decorators: [{
|
|
3525
|
+
type: Component,
|
|
3526
|
+
args: [{
|
|
3527
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3528
|
+
selector: 'kendo-treeview-drag-clue',
|
|
3529
|
+
template: `
|
|
3530
|
+
<ng-container *ngIf="!template">
|
|
3531
|
+
<kendo-icon-wrapper
|
|
3532
|
+
innerCssClass="k-drag-status"
|
|
3533
|
+
[name]="statusIconClass"
|
|
3534
|
+
[svgIcon]="statusSVGIcon"
|
|
3535
|
+
>
|
|
3536
|
+
</kendo-icon-wrapper>
|
|
3537
|
+
<span>{{text}}</span>
|
|
3538
|
+
</ng-container>
|
|
3539
|
+
|
|
3540
|
+
<ng-template
|
|
3541
|
+
*ngIf="template"
|
|
3542
|
+
[ngTemplateOutlet]="template"
|
|
3543
|
+
[ngTemplateOutletContext]="{
|
|
3544
|
+
text: text,
|
|
3545
|
+
action: action,
|
|
3546
|
+
sourceItem: sourceItem,
|
|
3547
|
+
destinationItem: destinationItem
|
|
3548
|
+
}"
|
|
3549
|
+
>
|
|
3550
|
+
</ng-template>
|
|
3551
|
+
`,
|
|
3552
|
+
standalone: true,
|
|
3553
|
+
imports: [NgIf, IconWrapperComponent, NgTemplateOutlet]
|
|
3554
|
+
}]
|
|
3555
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClasses: [{
|
|
3556
|
+
type: HostBinding,
|
|
3557
|
+
args: ['class.k-header']
|
|
3558
|
+
}, {
|
|
3559
|
+
type: HostBinding,
|
|
3560
|
+
args: ['class.k-drag-clue']
|
|
3561
|
+
}], posistionStyle: [{
|
|
3562
|
+
type: HostBinding,
|
|
3563
|
+
args: ['style.position']
|
|
3564
|
+
}] } });
|
|
3565
|
+
|
|
3566
|
+
/**
|
|
3567
|
+
* @hidden
|
|
3568
|
+
*/
|
|
3569
|
+
class DragAndDropAssetService {
|
|
3570
|
+
get componentRef() {
|
|
3571
|
+
if (!isPresent(this._componentRef)) {
|
|
3572
|
+
throw new Error('The `initalize` method must be called before calling other service methods.');
|
|
3573
|
+
}
|
|
3574
|
+
return this._componentRef;
|
|
3575
|
+
}
|
|
3576
|
+
set componentRef(componentRef) {
|
|
3577
|
+
this._componentRef = componentRef;
|
|
3578
|
+
}
|
|
3579
|
+
get element() {
|
|
3580
|
+
return this.componentRef.location.nativeElement;
|
|
3581
|
+
}
|
|
3582
|
+
ngOnDestroy() {
|
|
3583
|
+
if (!isPresent(this._componentRef)) {
|
|
3584
|
+
return;
|
|
3585
|
+
}
|
|
3586
|
+
this.element.parentElement.removeChild(this.element);
|
|
3587
|
+
this.componentRef.destroy();
|
|
3588
|
+
this.componentRef = null;
|
|
3589
|
+
}
|
|
3590
|
+
show() {
|
|
3591
|
+
this.element.style.display = '';
|
|
3592
|
+
}
|
|
3593
|
+
hide() {
|
|
3594
|
+
this.element.style.display = 'none';
|
|
3595
|
+
}
|
|
3596
|
+
move(left, top, offset = 0) {
|
|
3597
|
+
this.element.style.left = `${left + offset}px`;
|
|
3598
|
+
this.element.style.top = `${top + offset}px`;
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3601
|
+
DragAndDropAssetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropAssetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3602
|
+
DragAndDropAssetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropAssetService });
|
|
3603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragAndDropAssetService, decorators: [{
|
|
3604
|
+
type: Injectable
|
|
3605
|
+
}] });
|
|
3606
|
+
|
|
3607
|
+
/**
|
|
3608
|
+
* Checks if the browser supports relative stacking context.
|
|
3609
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
|
|
3610
|
+
*/
|
|
3611
|
+
const hasRelativeStackingContext = memoize(() => {
|
|
3612
|
+
if (!(isDocumentAvailable() && isPresent(document.body))) {
|
|
3613
|
+
return false;
|
|
3614
|
+
}
|
|
3615
|
+
const top = 10;
|
|
3616
|
+
const parent = document.createElement("div");
|
|
3617
|
+
parent.style.transform = "matrix(10, 0, 0, 10, 0, 0)";
|
|
3618
|
+
const innerDiv = document.createElement('div');
|
|
3619
|
+
innerDiv.innerText = 'child';
|
|
3620
|
+
innerDiv.style.position = 'fixed';
|
|
3621
|
+
innerDiv.style.top = `${top}px`;
|
|
3622
|
+
parent.appendChild(innerDiv);
|
|
3623
|
+
document.body.appendChild(parent);
|
|
3624
|
+
const isDifferent = parent.children[0].getBoundingClientRect().top !== top;
|
|
3625
|
+
document.body.removeChild(parent);
|
|
3626
|
+
return isDifferent;
|
|
3627
|
+
});
|
|
3628
|
+
/**
|
|
3629
|
+
* Stores the result of the passed function's first invokation and returns it instead of invoking it again afterwards.
|
|
3630
|
+
*/
|
|
3631
|
+
function memoize(fn) {
|
|
3632
|
+
let result;
|
|
3633
|
+
let called = false;
|
|
3634
|
+
return (...args) => {
|
|
3635
|
+
if (called) {
|
|
3636
|
+
return result;
|
|
3637
|
+
}
|
|
3638
|
+
result = fn(...args);
|
|
3639
|
+
called = true;
|
|
3640
|
+
return result;
|
|
3641
|
+
};
|
|
3642
|
+
}
|
|
3643
|
+
/**
|
|
3644
|
+
* @hidden
|
|
3645
|
+
*
|
|
3646
|
+
* Gets the offset of the parent element if the latter has the `transform` CSS prop applied.
|
|
3647
|
+
* Transformed parents create new stacking context and the `fixed` children must be position based on the transformed parent.
|
|
3648
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
|
|
3649
|
+
*
|
|
3650
|
+
* If no parent container is `transform`-ed the function will return `{ left: 0, top: 0 }`;
|
|
3651
|
+
*/
|
|
3652
|
+
const getContainerOffset = (element) => {
|
|
3653
|
+
if (!(element && hasRelativeStackingContext())) {
|
|
3654
|
+
return { left: 0, top: 0 };
|
|
3655
|
+
}
|
|
3656
|
+
let offsetParent = element.parentElement;
|
|
3657
|
+
while (offsetParent) {
|
|
3658
|
+
if (window.getComputedStyle(offsetParent).transform !== 'none') {
|
|
3659
|
+
break;
|
|
3660
|
+
}
|
|
3661
|
+
offsetParent = offsetParent.parentElement;
|
|
3662
|
+
}
|
|
3663
|
+
if (offsetParent) {
|
|
3664
|
+
const rect = offsetParent.getBoundingClientRect();
|
|
3665
|
+
return {
|
|
3666
|
+
left: rect.left - offsetParent.scrollLeft,
|
|
3667
|
+
top: rect.top - offsetParent.scrollTop
|
|
3668
|
+
};
|
|
3669
|
+
}
|
|
3670
|
+
return { left: 0, top: 0 };
|
|
3671
|
+
};
|
|
3672
|
+
/**
|
|
3673
|
+
* @hidden
|
|
3674
|
+
*/
|
|
3675
|
+
const getDropAction = (dropPosition, dropTarget) => {
|
|
3676
|
+
if (!(isPresent(dropPosition) && isPresent(dropTarget))) {
|
|
3677
|
+
return DropAction.Invalid;
|
|
3678
|
+
}
|
|
3679
|
+
switch (dropPosition) {
|
|
3680
|
+
case DropPosition.Over:
|
|
3681
|
+
return DropAction.Add;
|
|
3682
|
+
case DropPosition.Before:
|
|
3683
|
+
return isPresent(closestNode(dropTarget).previousElementSibling) ? DropAction.InsertMiddle : DropAction.InsertTop;
|
|
3684
|
+
case DropPosition.After:
|
|
3685
|
+
return isPresent(closestNode(dropTarget).nextElementSibling) ? DropAction.InsertMiddle : DropAction.InsertBottom;
|
|
3686
|
+
default:
|
|
3687
|
+
return DropAction.Invalid;
|
|
3688
|
+
}
|
|
3689
|
+
};
|
|
3690
|
+
/**
|
|
3691
|
+
* @hidden
|
|
3692
|
+
*/
|
|
3693
|
+
const getDropPosition = (draggedItem, target, clientY, targetTreeView, containerOffset) => {
|
|
3694
|
+
if (!(isPresent(draggedItem) && isPresent(target) && isPresent(targetTreeView) && isPresent(containerOffset))) {
|
|
3695
|
+
return;
|
|
3696
|
+
}
|
|
3697
|
+
// the .k-treeview-mid element starts just after the checkbox/expand arrow and stretches till the end of the treeview on the right
|
|
3698
|
+
const item = closestWithMatch(target, '.k-treeview-top, .k-treeview-mid, .k-treeview-bot');
|
|
3699
|
+
if (!isPresent(item)) {
|
|
3700
|
+
return;
|
|
3701
|
+
}
|
|
3702
|
+
// the content element (.k-treeview-leaf:not(.k-treeview-load-more-button)) holds just the treeview item text
|
|
3703
|
+
const content = getContentElement(item);
|
|
3704
|
+
const targetChildOfDraggedItem = hasParent(item, closestNode(draggedItem));
|
|
3705
|
+
if (!isPresent(content) || (content === draggedItem) || targetChildOfDraggedItem) {
|
|
3706
|
+
return;
|
|
3707
|
+
}
|
|
3708
|
+
const itemViewPortCoords = content.getBoundingClientRect();
|
|
3709
|
+
/*
|
|
3710
|
+
if the user is hovering a treeview item, split the item height into four parts:
|
|
3711
|
+
- dropping into the top quarter should insert the dragged item before the drop target
|
|
3712
|
+
- dropping into the bottom quarter should insert the dragged item after the drop target
|
|
3713
|
+
- dropping into the second or third quarter should add the item as child node of the drop target
|
|
3714
|
+
|
|
3715
|
+
if the user is NOT hovering a treeview item (he's dragging somewhere on the right), split the item height to just two parts:
|
|
3716
|
+
- dropping should insert before or after
|
|
3717
|
+
*/
|
|
3718
|
+
const itemDivisionHeight = itemViewPortCoords.height / (isContent(target) ? 4 : 2);
|
|
3719
|
+
// clear any possible container offset created by parent elements with `transform` css property set
|
|
3720
|
+
const pointerPosition = clientY - containerOffset.top;
|
|
3824
3721
|
const itemTop = itemViewPortCoords.top - containerOffset.top;
|
|
3825
3722
|
if (pointerPosition < itemTop + itemDivisionHeight) {
|
|
3826
3723
|
return DropPosition.Before;
|
|
@@ -3974,465 +3871,133 @@ const scrollElementBy = (element, step, direction) => {
|
|
|
3974
3871
|
/**
|
|
3975
3872
|
* @hidden
|
|
3976
3873
|
*/
|
|
3977
|
-
const
|
|
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
|
-
};
|
|
3874
|
+
const CLUE_OFFSET = 10;
|
|
3994
3875
|
/**
|
|
3995
3876
|
* @hidden
|
|
3996
3877
|
*/
|
|
3997
|
-
const
|
|
3998
|
-
if (!isPresent(treeview.loadMoreService)) {
|
|
3999
|
-
return;
|
|
4000
|
-
}
|
|
4001
|
-
const currentPageSize = treeview.getNodePageSize(dataItem);
|
|
4002
|
-
treeview.setNodePageSize(dataItem, currentPageSize - 1);
|
|
4003
|
-
};
|
|
4004
|
-
|
|
3878
|
+
const RETURN_ANIMATION_DURATION = 200;
|
|
4005
3879
|
/**
|
|
4006
3880
|
* @hidden
|
|
4007
3881
|
*/
|
|
4008
|
-
class
|
|
4009
|
-
constructor(
|
|
4010
|
-
|
|
3882
|
+
class DragClueService extends DragAndDropAssetService {
|
|
3883
|
+
constructor(componentFactoryResolver) {
|
|
3884
|
+
super();
|
|
3885
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
4011
3886
|
}
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
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);
|
|
3887
|
+
initialize(container, template) {
|
|
3888
|
+
if (isPresent(this._componentRef)) {
|
|
3889
|
+
this.ngOnDestroy();
|
|
4071
3890
|
}
|
|
3891
|
+
const clueComponentFactory = this.componentFactoryResolver.resolveComponentFactory(DragClueComponent);
|
|
3892
|
+
this.componentRef = container.createComponent(clueComponentFactory);
|
|
3893
|
+
this.hide();
|
|
3894
|
+
this.componentRef.instance.template = template;
|
|
3895
|
+
this.componentRef.changeDetectorRef.detectChanges();
|
|
4072
3896
|
}
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
3897
|
+
ngOnDestroy() {
|
|
3898
|
+
this.cancelReturnAnimation();
|
|
3899
|
+
this.cancelScroll();
|
|
3900
|
+
super.ngOnDestroy();
|
|
4077
3901
|
}
|
|
4078
|
-
|
|
4079
|
-
|
|
3902
|
+
move(left, top) {
|
|
3903
|
+
super.move(left, top, CLUE_OFFSET);
|
|
4080
3904
|
}
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
const
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
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;
|
|
3905
|
+
animateDragClueToElementPosition(target) {
|
|
3906
|
+
if (!(isPresent(target) && isPresent(this.element.animate))) {
|
|
3907
|
+
this.hide();
|
|
3908
|
+
return;
|
|
3909
|
+
}
|
|
3910
|
+
const targetElementViewPortCoords = target.getBoundingClientRect();
|
|
3911
|
+
const clueElementViewPortCoords = this.element.getBoundingClientRect();
|
|
3912
|
+
this.returnAnimation = this.element.animate([
|
|
3913
|
+
{ transform: 'translate(0, 0)' },
|
|
3914
|
+
{ transform: `translate(${targetElementViewPortCoords.left - clueElementViewPortCoords.left}px, ${targetElementViewPortCoords.top - clueElementViewPortCoords.top}px)` }
|
|
3915
|
+
], RETURN_ANIMATION_DURATION);
|
|
3916
|
+
this.returnAnimation.onfinish = () => this.hide();
|
|
4100
3917
|
}
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
this.
|
|
3918
|
+
cancelReturnAnimation() {
|
|
3919
|
+
if (!isPresent(this.returnAnimation)) {
|
|
3920
|
+
return;
|
|
3921
|
+
}
|
|
3922
|
+
this.returnAnimation.cancel();
|
|
3923
|
+
this.returnAnimation = null;
|
|
4106
3924
|
}
|
|
4107
|
-
|
|
4108
|
-
|
|
3925
|
+
updateDragClueData(action, sourceItem, destinationItem) {
|
|
3926
|
+
const dragClue = this.componentRef.instance;
|
|
3927
|
+
if (action === dragClue.action && dataItemsEqual(sourceItem, dragClue.sourceItem) && dataItemsEqual(destinationItem, dragClue.destinationItem)) {
|
|
3928
|
+
return;
|
|
3929
|
+
}
|
|
3930
|
+
dragClue.action = action;
|
|
3931
|
+
dragClue.sourceItem = sourceItem;
|
|
3932
|
+
dragClue.destinationItem = destinationItem;
|
|
3933
|
+
dragClue.detectChanges();
|
|
4109
3934
|
}
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
this.
|
|
3935
|
+
updateText(text) {
|
|
3936
|
+
if (text === this.componentRef.instance.text) {
|
|
3937
|
+
return;
|
|
3938
|
+
}
|
|
3939
|
+
this.componentRef.instance.text = text;
|
|
3940
|
+
this.componentRef.instance.detectChanges();
|
|
4115
3941
|
}
|
|
4116
3942
|
/**
|
|
4117
|
-
*
|
|
3943
|
+
* Triggers the first scrollable parent to scroll upwards or downwards.
|
|
3944
|
+
* Uses setInterval, so should be called outside the angular zone.
|
|
4118
3945
|
*/
|
|
4119
|
-
|
|
4120
|
-
|
|
3946
|
+
scrollIntoView({ step, interval }) {
|
|
3947
|
+
this.cancelScroll();
|
|
3948
|
+
const scrollableContainer = getScrollableContainer(this.element);
|
|
3949
|
+
if (!isPresent(scrollableContainer)) {
|
|
4121
3950
|
return;
|
|
4122
3951
|
}
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
3952
|
+
const containerRect = scrollableContainer.getBoundingClientRect();
|
|
3953
|
+
const clueRect = this.element.getBoundingClientRect();
|
|
3954
|
+
// if the beginning of the scrollable container is above the current viewport, fall-back to 0
|
|
3955
|
+
const firstVisibleClientTopPart = Math.max(containerRect.top, 0);
|
|
3956
|
+
// start scrolling up when the first visible item is dragged over
|
|
3957
|
+
const topLimit = firstVisibleClientTopPart + clueRect.height;
|
|
3958
|
+
// if the end of the scrollable container is beneath the current viewport, fall-back to its client height
|
|
3959
|
+
// 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
|
|
3960
|
+
const bottomLimit = firstVisibleClientTopPart + Math.min(containerRect.bottom, scrollableContainer.clientHeight);
|
|
3961
|
+
if (clueRect.top < topLimit) {
|
|
3962
|
+
this.scrollInterval = setInterval(() => scrollElementBy(scrollableContainer, step, ScrollDirection.Up), interval);
|
|
4126
3963
|
}
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
this.component.filterStateChange.emit({
|
|
4130
|
-
nodes: this.filterData,
|
|
4131
|
-
matchCount: this.visibleNodes.size,
|
|
4132
|
-
term,
|
|
4133
|
-
filterSettings: this.filterSettings
|
|
4134
|
-
});
|
|
3964
|
+
else if (clueRect.bottom > bottomLimit) {
|
|
3965
|
+
this.scrollInterval = setInterval(() => scrollElementBy(scrollableContainer, step, ScrollDirection.Down), interval);
|
|
4135
3966
|
}
|
|
4136
3967
|
}
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
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
|
-
});
|
|
3968
|
+
/**
|
|
3969
|
+
* Cancels out the on-going scroll animation, if present.
|
|
3970
|
+
*/
|
|
3971
|
+
cancelScroll() {
|
|
3972
|
+
if (isPresent(this.scrollInterval)) {
|
|
3973
|
+
clearInterval(this.scrollInterval);
|
|
3974
|
+
this.scrollInterval = null;
|
|
3975
|
+
}
|
|
4155
3976
|
}
|
|
4156
3977
|
}
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
4160
|
-
type:
|
|
4161
|
-
}], ctorParameters: function () { return [{ type:
|
|
4162
|
-
type: Input
|
|
4163
|
-
}], filter: [{
|
|
4164
|
-
type: Input
|
|
4165
|
-
}] } });
|
|
3978
|
+
DragClueService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueService, deps: [{ token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3979
|
+
DragClueService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueService });
|
|
3980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueService, decorators: [{
|
|
3981
|
+
type: Injectable
|
|
3982
|
+
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }]; } });
|
|
4166
3983
|
|
|
4167
3984
|
/**
|
|
4168
3985
|
* @hidden
|
|
4169
3986
|
*/
|
|
4170
|
-
class
|
|
4171
|
-
constructor(
|
|
4172
|
-
this.
|
|
4173
|
-
this.
|
|
4174
|
-
this.
|
|
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
|
-
}
|
|
3987
|
+
class DropHintComponent {
|
|
3988
|
+
constructor(changeDetectorRef) {
|
|
3989
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
3990
|
+
this.hostClass = true;
|
|
3991
|
+
this.position = 'fixed';
|
|
3992
|
+
this.pointerEvents = 'none';
|
|
4195
3993
|
}
|
|
4196
3994
|
// exposed as a public method that can be called from outside as the component uses `OnPush` strategy
|
|
4197
3995
|
detectChanges() {
|
|
4198
|
-
this.
|
|
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();
|
|
3996
|
+
this.changeDetectorRef.detectChanges();
|
|
4432
3997
|
}
|
|
4433
3998
|
}
|
|
4434
3999
|
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: `
|
|
4000
|
+
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
4001
|
<div
|
|
4437
4002
|
*ngIf="!template"
|
|
4438
4003
|
class="k-drop-hint k-drop-hint-h"
|
|
@@ -4451,7 +4016,7 @@ DropHintComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
4451
4016
|
}"
|
|
4452
4017
|
>
|
|
4453
4018
|
<ng-template>
|
|
4454
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
4019
|
+
`, 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
4020
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropHintComponent, decorators: [{
|
|
4456
4021
|
type: Component,
|
|
4457
4022
|
args: [{
|
|
@@ -4476,7 +4041,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4476
4041
|
}"
|
|
4477
4042
|
>
|
|
4478
4043
|
<ng-template>
|
|
4479
|
-
|
|
4044
|
+
`,
|
|
4045
|
+
standalone: true,
|
|
4046
|
+
imports: [NgIf, NgTemplateOutlet]
|
|
4480
4047
|
}]
|
|
4481
4048
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClass: [{
|
|
4482
4049
|
type: HostBinding,
|
|
@@ -4544,11 +4111,12 @@ class DragClueTemplateDirective {
|
|
|
4544
4111
|
}
|
|
4545
4112
|
}
|
|
4546
4113
|
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 });
|
|
4114
|
+
DragClueTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragClueTemplateDirective, isStandalone: true, selector: "[kendoTreeViewDragClueTemplate]", ngImport: i0 });
|
|
4548
4115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragClueTemplateDirective, decorators: [{
|
|
4549
4116
|
type: Directive,
|
|
4550
4117
|
args: [{
|
|
4551
|
-
selector: '[kendoTreeViewDragClueTemplate]'
|
|
4118
|
+
selector: '[kendoTreeViewDragClueTemplate]',
|
|
4119
|
+
standalone: true
|
|
4552
4120
|
}]
|
|
4553
4121
|
}], ctorParameters: function () {
|
|
4554
4122
|
return [{ type: i0.TemplateRef, decorators: [{
|
|
@@ -4573,11 +4141,12 @@ class DropHintTemplateDirective {
|
|
|
4573
4141
|
}
|
|
4574
4142
|
}
|
|
4575
4143
|
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 });
|
|
4144
|
+
DropHintTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DropHintTemplateDirective, isStandalone: true, selector: "[kendoTreeViewDropHintTemplate]", ngImport: i0 });
|
|
4577
4145
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropHintTemplateDirective, decorators: [{
|
|
4578
4146
|
type: Directive,
|
|
4579
4147
|
args: [{
|
|
4580
|
-
selector: '[kendoTreeViewDropHintTemplate]'
|
|
4148
|
+
selector: '[kendoTreeViewDropHintTemplate]',
|
|
4149
|
+
standalone: true
|
|
4581
4150
|
}]
|
|
4582
4151
|
}], ctorParameters: function () {
|
|
4583
4152
|
return [{ type: i0.TemplateRef, decorators: [{
|
|
@@ -4840,7 +4409,7 @@ class DragAndDropDirective {
|
|
|
4840
4409
|
}
|
|
4841
4410
|
}
|
|
4842
4411
|
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: [
|
|
4412
|
+
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
4413
|
DragClueService,
|
|
4845
4414
|
DropHintService
|
|
4846
4415
|
], queries: [{ propertyName: "dragClueTemplate", first: true, predicate: DragClueTemplateDirective, descendants: true }, { propertyName: "dropHintTemplate", first: true, predicate: DropHintTemplateDirective, descendants: true }], ngImport: i0 });
|
|
@@ -4851,7 +4420,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4851
4420
|
providers: [
|
|
4852
4421
|
DragClueService,
|
|
4853
4422
|
DropHintService
|
|
4854
|
-
]
|
|
4423
|
+
],
|
|
4424
|
+
standalone: true
|
|
4855
4425
|
}]
|
|
4856
4426
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: TreeViewComponent }, { type: DragClueService }, { type: DropHintService }]; }, propDecorators: { allowCopy: [{
|
|
4857
4427
|
type: Input
|
|
@@ -4859,30 +4429,470 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4859
4429
|
type: Input
|
|
4860
4430
|
}], startDragAfter: [{
|
|
4861
4431
|
type: Input
|
|
4862
|
-
}], autoScroll: [{
|
|
4432
|
+
}], autoScroll: [{
|
|
4433
|
+
type: Input
|
|
4434
|
+
}], dragClueTemplate: [{
|
|
4435
|
+
type: ContentChild,
|
|
4436
|
+
args: [DragClueTemplateDirective, { static: false }]
|
|
4437
|
+
}], dropHintTemplate: [{
|
|
4438
|
+
type: ContentChild,
|
|
4439
|
+
args: [DropHintTemplateDirective, { static: false }]
|
|
4440
|
+
}], userSelectStyle: [{
|
|
4441
|
+
type: HostBinding,
|
|
4442
|
+
args: ['style.user-select']
|
|
4443
|
+
}, {
|
|
4444
|
+
type: HostBinding,
|
|
4445
|
+
args: ['style.-ms-user-select']
|
|
4446
|
+
}, {
|
|
4447
|
+
type: HostBinding,
|
|
4448
|
+
args: ['style.-moz-user-select']
|
|
4449
|
+
}, {
|
|
4450
|
+
type: HostBinding,
|
|
4451
|
+
args: ['style.-webkit-user-select']
|
|
4452
|
+
}] } });
|
|
4453
|
+
|
|
4454
|
+
const DEFAULT_FILTER_EXPAND_SETTINGS = {
|
|
4455
|
+
maxAutoExpandResults: -1,
|
|
4456
|
+
expandMatches: false,
|
|
4457
|
+
expandedOnClear: "none"
|
|
4458
|
+
};
|
|
4459
|
+
/**
|
|
4460
|
+
* A directive which manages the expanded state of the TreeView.
|
|
4461
|
+
* ([see example]({% slug expandedstate_treeview %})).
|
|
4462
|
+
*/
|
|
4463
|
+
class ExpandDirective {
|
|
4464
|
+
constructor(component) {
|
|
4465
|
+
this.component = component;
|
|
4466
|
+
/**
|
|
4467
|
+
* Whether or not to auto-expand the nodes leading from the root node to each filter result.
|
|
4468
|
+
* To fine-tune this behavior, pass a [`FilterExpandSettings`]({% slug api_treeview_filterexpandsettings %}) object to this input.
|
|
4469
|
+
* @default false
|
|
4470
|
+
*/
|
|
4471
|
+
this.expandOnFilter = false;
|
|
4472
|
+
/**
|
|
4473
|
+
* Fires when the `expandedKeys` collection was updated.
|
|
4474
|
+
*/
|
|
4475
|
+
this.expandedKeysChange = new EventEmitter();
|
|
4476
|
+
this.subscriptions = new Subscription();
|
|
4477
|
+
/**
|
|
4478
|
+
* Reflectes the internal `expandedKeys` state.
|
|
4479
|
+
*/
|
|
4480
|
+
this.state = new Set();
|
|
4481
|
+
this.originalExpandedKeys = new Set();
|
|
4482
|
+
this.isFiltered = false;
|
|
4483
|
+
/**
|
|
4484
|
+
* Fills array with the correct expand keys according to wrapper metadata.
|
|
4485
|
+
*/
|
|
4486
|
+
this.updateExpandedNodes = (collection, node, autoExpandMatches) => {
|
|
4487
|
+
if (node.containsMatches || node.isMatch && autoExpandMatches && isArrayWithAtLeastOneItem(node.children)) {
|
|
4488
|
+
collection.push(this.itemKey({ dataItem: node.dataItem, index: node.index }));
|
|
4489
|
+
}
|
|
4490
|
+
if (isArrayWithAtLeastOneItem(node.children)) {
|
|
4491
|
+
node.children.forEach(child => {
|
|
4492
|
+
this.updateExpandedNodes(collection, child, autoExpandMatches);
|
|
4493
|
+
});
|
|
4494
|
+
}
|
|
4495
|
+
};
|
|
4496
|
+
/**
|
|
4497
|
+
* Fills array with the expand key of every node.
|
|
4498
|
+
*/
|
|
4499
|
+
this.getEveryExpandKey = (collection, node) => {
|
|
4500
|
+
if (isArrayWithAtLeastOneItem(node.children)) {
|
|
4501
|
+
collection.push(this.itemKey({ dataItem: node.dataItem, index: node.index }));
|
|
4502
|
+
}
|
|
4503
|
+
if (isArrayWithAtLeastOneItem(node.children)) {
|
|
4504
|
+
node.children.forEach(child => {
|
|
4505
|
+
this.getEveryExpandKey(collection, child);
|
|
4506
|
+
});
|
|
4507
|
+
}
|
|
4508
|
+
};
|
|
4509
|
+
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)));
|
|
4510
|
+
if (this.component.filterStateChange) {
|
|
4511
|
+
this.subscriptions.add(this.component.filterStateChange.subscribe(this.handleAutoExpand.bind(this)));
|
|
4512
|
+
}
|
|
4513
|
+
this.component.isExpanded = (dataItem, index) => this.state.has(this.itemKey({ dataItem, index }));
|
|
4514
|
+
}
|
|
4515
|
+
/**
|
|
4516
|
+
* @hidden
|
|
4517
|
+
*/
|
|
4518
|
+
set isExpanded(value) {
|
|
4519
|
+
this.component.isExpanded = value;
|
|
4520
|
+
}
|
|
4521
|
+
get filterExpandSettings() {
|
|
4522
|
+
const settings = isBoolean(this.expandOnFilter) ? { enabled: this.expandOnFilter } : Object.assign(Object.assign({}, this.expandOnFilter), { enabled: true });
|
|
4523
|
+
return Object.assign({}, DEFAULT_FILTER_EXPAND_SETTINGS, settings);
|
|
4524
|
+
}
|
|
4525
|
+
ngOnChanges(changes) {
|
|
4526
|
+
if (isChanged('expandedKeys', changes, false) && changes['expandedKeys'].currentValue !== this.lastChange) {
|
|
4527
|
+
this.state = new Set(changes['expandedKeys'].currentValue);
|
|
4528
|
+
}
|
|
4529
|
+
}
|
|
4530
|
+
ngOnDestroy() {
|
|
4531
|
+
this.subscriptions.unsubscribe();
|
|
4532
|
+
}
|
|
4533
|
+
/**
|
|
4534
|
+
* @hidden
|
|
4535
|
+
*/
|
|
4536
|
+
itemKey(e) {
|
|
4537
|
+
if (this.expandKey) {
|
|
4538
|
+
if (typeof this.expandKey === "string") {
|
|
4539
|
+
return e.dataItem[this.expandKey];
|
|
4540
|
+
}
|
|
4541
|
+
if (typeof this.expandKey === "function") {
|
|
4542
|
+
return this.expandKey(e);
|
|
4543
|
+
}
|
|
4544
|
+
}
|
|
4545
|
+
return e.index;
|
|
4546
|
+
}
|
|
4547
|
+
toggleExpand({ index, dataItem, expand }) {
|
|
4548
|
+
const key = this.itemKey({ index, dataItem });
|
|
4549
|
+
const isExpanded = this.state.has(key);
|
|
4550
|
+
let notify = false;
|
|
4551
|
+
if (isExpanded && !expand) {
|
|
4552
|
+
this.state.delete(key);
|
|
4553
|
+
notify = true;
|
|
4554
|
+
}
|
|
4555
|
+
else if (!isExpanded && expand) {
|
|
4556
|
+
this.state.add(key);
|
|
4557
|
+
notify = true;
|
|
4558
|
+
}
|
|
4559
|
+
if (notify) {
|
|
4560
|
+
this.notify();
|
|
4561
|
+
}
|
|
4562
|
+
}
|
|
4563
|
+
handleAutoExpand({ nodes, matchCount, term }) {
|
|
4564
|
+
if (!this.filterExpandSettings.enabled) {
|
|
4565
|
+
return;
|
|
4566
|
+
}
|
|
4567
|
+
const { maxAutoExpandResults, expandMatches: autoExpandMatches, expandedOnClear } = this.filterExpandSettings;
|
|
4568
|
+
if (!this.isFiltered) {
|
|
4569
|
+
this.originalExpandedKeys = new Set(this.state);
|
|
4570
|
+
}
|
|
4571
|
+
const exitingFilteredState = this.isFiltered && !term;
|
|
4572
|
+
const maxExceeded = maxAutoExpandResults !== -1 && matchCount > maxAutoExpandResults;
|
|
4573
|
+
const exitAutoExpandedState = exitingFilteredState || maxExceeded;
|
|
4574
|
+
if (exitAutoExpandedState) {
|
|
4575
|
+
switch (expandedOnClear) {
|
|
4576
|
+
case "initial": {
|
|
4577
|
+
if (!sameValues(this.state, this.originalExpandedKeys)) {
|
|
4578
|
+
this.state = this.originalExpandedKeys;
|
|
4579
|
+
this.notify();
|
|
4580
|
+
}
|
|
4581
|
+
break;
|
|
4582
|
+
}
|
|
4583
|
+
case "all": {
|
|
4584
|
+
this.state = new Set(nodes.reduce((acc, rootNode) => {
|
|
4585
|
+
this.getEveryExpandKey(acc, rootNode);
|
|
4586
|
+
return acc;
|
|
4587
|
+
}, []));
|
|
4588
|
+
this.notify();
|
|
4589
|
+
break;
|
|
4590
|
+
}
|
|
4591
|
+
case "unchanged": {
|
|
4592
|
+
break;
|
|
4593
|
+
}
|
|
4594
|
+
case "none":
|
|
4595
|
+
default: {
|
|
4596
|
+
if (this.state.size !== 0) {
|
|
4597
|
+
this.state.clear();
|
|
4598
|
+
this.notify();
|
|
4599
|
+
}
|
|
4600
|
+
break;
|
|
4601
|
+
}
|
|
4602
|
+
}
|
|
4603
|
+
this.isFiltered = false;
|
|
4604
|
+
return;
|
|
4605
|
+
}
|
|
4606
|
+
const indicesToExpand = new Set(nodes.reduce((acc, rootNode) => {
|
|
4607
|
+
this.updateExpandedNodes(acc, rootNode, autoExpandMatches);
|
|
4608
|
+
return acc;
|
|
4609
|
+
}, []));
|
|
4610
|
+
if (!sameValues(this.state, indicesToExpand)) {
|
|
4611
|
+
this.state = indicesToExpand;
|
|
4612
|
+
this.notify();
|
|
4613
|
+
}
|
|
4614
|
+
this.isFiltered = true;
|
|
4615
|
+
}
|
|
4616
|
+
notify() {
|
|
4617
|
+
this.lastChange = Array.from(this.state);
|
|
4618
|
+
this.expandedKeysChange.emit(this.lastChange);
|
|
4619
|
+
}
|
|
4620
|
+
}
|
|
4621
|
+
ExpandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExpandDirective, deps: [{ token: ExpandableComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4622
|
+
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 });
|
|
4623
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExpandDirective, decorators: [{
|
|
4624
|
+
type: Directive,
|
|
4625
|
+
args: [{
|
|
4626
|
+
selector: '[kendoTreeViewExpandable]',
|
|
4627
|
+
standalone: true
|
|
4628
|
+
}]
|
|
4629
|
+
}], ctorParameters: function () { return [{ type: ExpandableComponent }]; }, propDecorators: { isExpanded: [{
|
|
4630
|
+
type: Input
|
|
4631
|
+
}], expandKey: [{
|
|
4632
|
+
type: Input,
|
|
4633
|
+
args: ["expandBy"]
|
|
4634
|
+
}], expandOnFilter: [{
|
|
4635
|
+
type: Input
|
|
4636
|
+
}], expandedKeysChange: [{
|
|
4637
|
+
type: Output
|
|
4638
|
+
}], expandedKeys: [{
|
|
4639
|
+
type: Input
|
|
4640
|
+
}] } });
|
|
4641
|
+
|
|
4642
|
+
/**
|
|
4643
|
+
* @hidden
|
|
4644
|
+
* Performs the right-to-left function composition. Functions must have a unary.
|
|
4645
|
+
*/
|
|
4646
|
+
const compose = (...args) => (data) => args.reduceRight((acc, curr) => curr(acc), data);
|
|
4647
|
+
|
|
4648
|
+
/**
|
|
4649
|
+
* @hidden
|
|
4650
|
+
*/
|
|
4651
|
+
const copyPageSize = (treeview, source, target) => {
|
|
4652
|
+
if (!isPresent(treeview.loadMoreService)) {
|
|
4653
|
+
return;
|
|
4654
|
+
}
|
|
4655
|
+
const sourceGroupSize = treeview.getNodePageSize(source);
|
|
4656
|
+
treeview.setNodePageSize(target, sourceGroupSize);
|
|
4657
|
+
};
|
|
4658
|
+
/**
|
|
4659
|
+
* @hidden
|
|
4660
|
+
*/
|
|
4661
|
+
const incrementPageSize = (treeview, dataItem) => {
|
|
4662
|
+
if (!isPresent(treeview.loadMoreService)) {
|
|
4663
|
+
return;
|
|
4664
|
+
}
|
|
4665
|
+
const currentPageSize = treeview.getNodePageSize(dataItem);
|
|
4666
|
+
treeview.setNodePageSize(dataItem, currentPageSize + 1);
|
|
4667
|
+
};
|
|
4668
|
+
/**
|
|
4669
|
+
* @hidden
|
|
4670
|
+
*/
|
|
4671
|
+
const decrementPageSize = (treeview, dataItem) => {
|
|
4672
|
+
if (!isPresent(treeview.loadMoreService)) {
|
|
4673
|
+
return;
|
|
4674
|
+
}
|
|
4675
|
+
const currentPageSize = treeview.getNodePageSize(dataItem);
|
|
4676
|
+
treeview.setNodePageSize(dataItem, currentPageSize - 1);
|
|
4677
|
+
};
|
|
4678
|
+
|
|
4679
|
+
/**
|
|
4680
|
+
* @hidden
|
|
4681
|
+
*/
|
|
4682
|
+
class FlatEditingService {
|
|
4683
|
+
constructor(flatBinding) {
|
|
4684
|
+
this.flatBinding = flatBinding;
|
|
4685
|
+
}
|
|
4686
|
+
add({ sourceItem, destinationItem, dropPosition, sourceTree, destinationTree }) {
|
|
4687
|
+
// 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
|
|
4688
|
+
const clonedSourceDataItem = Object.assign({}, getDataItem(sourceItem));
|
|
4689
|
+
if (dropPosition === DropPosition.Over) {
|
|
4690
|
+
// expand the item that was dropped into
|
|
4691
|
+
expandDropTarget(destinationItem, destinationTree);
|
|
4692
|
+
const destinationItemId = getter(this.flatBinding.idField)(getDataItem(destinationItem));
|
|
4693
|
+
setter(this.flatBinding.parentIdField)(clonedSourceDataItem, destinationItemId);
|
|
4694
|
+
const lastChildNodeIndex = this.getLastVisibleChildNodeIndex(destinationTree, this.flatBinding.originalData, getDataItem(destinationItem));
|
|
4695
|
+
// insert after the last visible child
|
|
4696
|
+
const targetIndex = lastChildNodeIndex + 1;
|
|
4697
|
+
this.flatBinding.originalData.splice(targetIndex, 0, clonedSourceDataItem);
|
|
4698
|
+
// rebind the treeview data before searching for the focus target index
|
|
4699
|
+
this.rebindData();
|
|
4700
|
+
const focusTarget = this.fetchChildNodes(getDataItem(destinationItem), destinationTree).indexOf(clonedSourceDataItem);
|
|
4701
|
+
this.movedItemNewIndex = buildTreeIndex(destinationItem.item.index, focusTarget);
|
|
4702
|
+
}
|
|
4703
|
+
else {
|
|
4704
|
+
const shiftIndex = dropPosition === DropPosition.After ? 1 : 0;
|
|
4705
|
+
const targetIndex = this.flatBinding.originalData.indexOf(getDataItem(destinationItem)) + shiftIndex;
|
|
4706
|
+
this.flatBinding.originalData.splice(targetIndex, 0, clonedSourceDataItem);
|
|
4707
|
+
const destinationItemParentId = getter(this.flatBinding.parentIdField)(getDataItem(destinationItem));
|
|
4708
|
+
setter(this.flatBinding.parentIdField)(clonedSourceDataItem, destinationItemParentId);
|
|
4709
|
+
// rebind the treeview data before searching for the focus target index
|
|
4710
|
+
this.rebindData();
|
|
4711
|
+
const parentIndex = destinationItem.parent ?
|
|
4712
|
+
destinationItem.parent.item.index :
|
|
4713
|
+
null;
|
|
4714
|
+
const parentContainer = destinationItem.parent ?
|
|
4715
|
+
this.fetchChildNodes(getDataItem(destinationItem.parent), destinationTree) :
|
|
4716
|
+
destinationTree.nodes;
|
|
4717
|
+
const focusTarget = parentContainer.indexOf(clonedSourceDataItem);
|
|
4718
|
+
this.movedItemNewIndex = buildTreeIndex(parentIndex, focusTarget);
|
|
4719
|
+
}
|
|
4720
|
+
if (sourceTree !== destinationTree) {
|
|
4721
|
+
this.addChildNodes(clonedSourceDataItem, sourceTree);
|
|
4722
|
+
}
|
|
4723
|
+
// increment the parent page size => an item is moved into it
|
|
4724
|
+
const updatedParent = dropPosition === DropPosition.Over ? getDataItem(destinationItem) : getDataItem(destinationItem.parent);
|
|
4725
|
+
incrementPageSize(destinationTree, updatedParent);
|
|
4726
|
+
// the page sizes are stored by data-item reference => copy the old item ref page size to the new item reference
|
|
4727
|
+
copyPageSize(destinationTree, getDataItem(sourceItem), clonedSourceDataItem);
|
|
4728
|
+
// the source tree nodes are reloaded on `removeItem` - reload the destination tree nodes if the soruce and the destination tree are different
|
|
4729
|
+
if (sourceTree !== destinationTree && !destinationTree.loadOnDemand) {
|
|
4730
|
+
destinationTree.preloadChildNodes();
|
|
4731
|
+
}
|
|
4732
|
+
// if the source and destination trees are the same, focusing the moved item here will not have the desired effect
|
|
4733
|
+
// as the `remove` handler has not yet kicked-in to remove the item from its old position
|
|
4734
|
+
if (sourceTree !== destinationTree) {
|
|
4735
|
+
// ensure the focus target is rendered and registered
|
|
4736
|
+
destinationTree.changeDetectorRef.detectChanges();
|
|
4737
|
+
destinationTree.focus(this.movedItemNewIndex);
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4740
|
+
remove({ sourceItem, sourceTree, destinationTree }) {
|
|
4741
|
+
const sourceDataItem = getDataItem(sourceItem);
|
|
4742
|
+
const sourceItemIndex = this.flatBinding.originalData.indexOf(sourceDataItem);
|
|
4743
|
+
this.flatBinding.originalData.splice(sourceItemIndex, 1);
|
|
4744
|
+
if (sourceTree !== destinationTree) {
|
|
4745
|
+
this.removeChildNodes(sourceDataItem, sourceTree);
|
|
4746
|
+
}
|
|
4747
|
+
this.rebindData();
|
|
4748
|
+
// emit collapse for the parent node if its last child node was spliced
|
|
4749
|
+
const parentChildren = sourceItem.parent ? sourceItem.parent.children : [];
|
|
4750
|
+
collapseEmptyParent(sourceItem.parent, parentChildren, sourceTree);
|
|
4751
|
+
// decrement source item parent page size => an item has been removed from it
|
|
4752
|
+
decrementPageSize(sourceTree, getDataItem(sourceItem.parent));
|
|
4753
|
+
// reload the treeview nodes
|
|
4754
|
+
if (!sourceTree.loadOnDemand) {
|
|
4755
|
+
sourceTree.preloadChildNodes();
|
|
4756
|
+
}
|
|
4757
|
+
// if the source and destination trees are different we want to focus only the moved item in the destination tree
|
|
4758
|
+
if (sourceTree === destinationTree) {
|
|
4759
|
+
// ensure the focus target is rendered and registered
|
|
4760
|
+
destinationTree.changeDetectorRef.detectChanges();
|
|
4761
|
+
// after the source item is removed from its original position, the candidate index might have to be corrected
|
|
4762
|
+
const index = updateMovedItemIndex(this.movedItemNewIndex, sourceItem.item.index);
|
|
4763
|
+
destinationTree.focus(index);
|
|
4764
|
+
}
|
|
4765
|
+
}
|
|
4766
|
+
addChildNodes(dataItem, source) {
|
|
4767
|
+
const itemChildren = this.fetchAllDescendantNodes(dataItem, source);
|
|
4768
|
+
this.flatBinding.originalData.push(...itemChildren);
|
|
4769
|
+
}
|
|
4770
|
+
removeChildNodes(dataItem, source) {
|
|
4771
|
+
const sourceChildren = this.fetchAllDescendantNodes(dataItem, source);
|
|
4772
|
+
sourceChildren.forEach(item => {
|
|
4773
|
+
const index = this.flatBinding.originalData.indexOf(item);
|
|
4774
|
+
this.flatBinding.originalData.splice(index, 1);
|
|
4775
|
+
});
|
|
4776
|
+
}
|
|
4777
|
+
fetchAllDescendantNodes(node, treeview) {
|
|
4778
|
+
let nodes = this.fetchChildNodes(node, treeview);
|
|
4779
|
+
nodes.forEach(node => nodes = nodes.concat(this.fetchAllDescendantNodes(node, treeview) || []));
|
|
4780
|
+
return nodes;
|
|
4781
|
+
}
|
|
4782
|
+
fetchChildNodes(node, treeview) {
|
|
4783
|
+
if (!node) {
|
|
4784
|
+
return [];
|
|
4785
|
+
}
|
|
4786
|
+
let nodes = [];
|
|
4787
|
+
treeview
|
|
4788
|
+
.children(node)
|
|
4789
|
+
.pipe(take(1))
|
|
4790
|
+
.subscribe(children => nodes = nodes.concat(children || []));
|
|
4791
|
+
return nodes;
|
|
4792
|
+
}
|
|
4793
|
+
getLastVisibleChildNodeIndex(treeview, data, node) {
|
|
4794
|
+
if (!isPresent(treeview.loadMoreService) || !treeview.hasChildren(node)) {
|
|
4795
|
+
return data.length;
|
|
4796
|
+
}
|
|
4797
|
+
const visibleNodesCount = treeview.loadMoreService.getGroupSize(node);
|
|
4798
|
+
const visibleChildren = this.fetchChildNodes(node, treeview).slice(0, visibleNodesCount);
|
|
4799
|
+
const lastNode = visibleChildren[visibleChildren.length - 1];
|
|
4800
|
+
const lastNodeIndex = data.indexOf(lastNode);
|
|
4801
|
+
return lastNodeIndex;
|
|
4802
|
+
}
|
|
4803
|
+
rebindData() {
|
|
4804
|
+
this.flatBinding.nodes = this.flatBinding.originalData;
|
|
4805
|
+
this.flatBinding.updateNodes(this.flatBinding.originalData);
|
|
4806
|
+
}
|
|
4807
|
+
}
|
|
4808
|
+
|
|
4809
|
+
/**
|
|
4810
|
+
* @hidden
|
|
4811
|
+
*/
|
|
4812
|
+
const DEFAULT_FILTER_SETTINGS = {
|
|
4813
|
+
operator: 'contains',
|
|
4814
|
+
ignoreCase: true,
|
|
4815
|
+
mode: "lenient"
|
|
4816
|
+
};
|
|
4817
|
+
|
|
4818
|
+
/**
|
|
4819
|
+
* @hidden
|
|
4820
|
+
*/
|
|
4821
|
+
class FilteringBase {
|
|
4822
|
+
constructor(component) {
|
|
4823
|
+
this.component = component;
|
|
4824
|
+
this.visibleNodes = new Set();
|
|
4825
|
+
this._filterSettings = DEFAULT_FILTER_SETTINGS;
|
|
4826
|
+
}
|
|
4827
|
+
/**
|
|
4828
|
+
* The settings which are applied when performing a filter on the component's data.
|
|
4829
|
+
*/
|
|
4830
|
+
set filterSettings(settings) {
|
|
4831
|
+
this._filterSettings = Object.assign(Object.assign({}, DEFAULT_FILTER_SETTINGS), settings);
|
|
4832
|
+
}
|
|
4833
|
+
get filterSettings() {
|
|
4834
|
+
return this._filterSettings;
|
|
4835
|
+
}
|
|
4836
|
+
/**
|
|
4837
|
+
* Applies a filter and changes the visibility of the component's nodes accordingly.
|
|
4838
|
+
*/
|
|
4839
|
+
set filter(term) {
|
|
4840
|
+
this.handleFilterChange(term);
|
|
4841
|
+
}
|
|
4842
|
+
/**
|
|
4843
|
+
* @hidden
|
|
4844
|
+
*/
|
|
4845
|
+
handleFilterChange(term) {
|
|
4846
|
+
if (!this.filterData) {
|
|
4847
|
+
return;
|
|
4848
|
+
}
|
|
4849
|
+
this.resetNodesVisibility(this.filterData);
|
|
4850
|
+
if (term) {
|
|
4851
|
+
filterTree(this.filterData, term, this.filterSettings, this.component.textField);
|
|
4852
|
+
}
|
|
4853
|
+
this.updateVisibleNodes(this.filterData);
|
|
4854
|
+
if (isPresent(this.component.filterStateChange)) {
|
|
4855
|
+
this.component.filterStateChange.emit({
|
|
4856
|
+
nodes: this.filterData,
|
|
4857
|
+
matchCount: this.visibleNodes.size,
|
|
4858
|
+
term,
|
|
4859
|
+
filterSettings: this.filterSettings
|
|
4860
|
+
});
|
|
4861
|
+
}
|
|
4862
|
+
}
|
|
4863
|
+
updateVisibleNodes(items) {
|
|
4864
|
+
items.forEach((wrapper) => {
|
|
4865
|
+
if (wrapper.visible) {
|
|
4866
|
+
this.visibleNodes.add(wrapper.dataItem);
|
|
4867
|
+
}
|
|
4868
|
+
if (wrapper.children) {
|
|
4869
|
+
this.updateVisibleNodes(wrapper.children);
|
|
4870
|
+
}
|
|
4871
|
+
});
|
|
4872
|
+
}
|
|
4873
|
+
resetNodesVisibility(items) {
|
|
4874
|
+
this.visibleNodes.clear();
|
|
4875
|
+
items.forEach((wrapper) => {
|
|
4876
|
+
wrapper.visible = true;
|
|
4877
|
+
if (wrapper.children) {
|
|
4878
|
+
this.resetNodesVisibility(wrapper.children);
|
|
4879
|
+
}
|
|
4880
|
+
});
|
|
4881
|
+
}
|
|
4882
|
+
}
|
|
4883
|
+
FilteringBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilteringBase, deps: [{ token: DataBoundComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4884
|
+
FilteringBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FilteringBase, inputs: { filterSettings: "filterSettings", filter: "filter" }, ngImport: i0 });
|
|
4885
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilteringBase, decorators: [{
|
|
4886
|
+
type: Directive
|
|
4887
|
+
}], ctorParameters: function () { return [{ type: DataBoundComponent }]; }, propDecorators: { filterSettings: [{
|
|
4888
|
+
type: Input
|
|
4889
|
+
}], filter: [{
|
|
4863
4890
|
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
4891
|
}] } });
|
|
4883
4892
|
|
|
4893
|
+
const findChildren = (prop, nodes, value) => nodes.filter((x) => prop(x) === value);
|
|
4884
4894
|
const indexBuilder$1 = new IndexBuilderService();
|
|
4885
|
-
const
|
|
4895
|
+
const mapToTree = (currentLevelNodes, allNodes, parentIdField, idField, parent = null, parentIndex = '') => {
|
|
4886
4896
|
if (!isArrayWithAtLeastOneItem(currentLevelNodes)) {
|
|
4887
4897
|
return [];
|
|
4888
4898
|
}
|
|
@@ -4894,40 +4904,26 @@ const mapToWrappers = (currentLevelNodes, childrenField, parent = null, parentIn
|
|
|
4894
4904
|
parent,
|
|
4895
4905
|
visible: true
|
|
4896
4906
|
};
|
|
4897
|
-
wrapper.children =
|
|
4907
|
+
wrapper.children = mapToTree(findChildren(getter(parentIdField), allNodes || [], getter(idField)(node)), allNodes, parentIdField, idField, wrapper, index);
|
|
4898
4908
|
return wrapper;
|
|
4899
4909
|
});
|
|
4900
4910
|
};
|
|
4901
4911
|
/**
|
|
4902
|
-
* A directive which encapsulates the retrieval of child nodes.
|
|
4912
|
+
* A directive which encapsulates the retrieval of the child nodes.
|
|
4903
4913
|
*/
|
|
4904
|
-
class
|
|
4905
|
-
constructor(component
|
|
4914
|
+
class FlatDataBindingDirective extends FilteringBase {
|
|
4915
|
+
constructor(component) {
|
|
4906
4916
|
super(component);
|
|
4907
4917
|
this.component = component;
|
|
4908
|
-
this.dragAndDropDirective = dragAndDropDirective;
|
|
4909
4918
|
/**
|
|
4910
4919
|
* @hidden
|
|
4911
4920
|
*/
|
|
4912
4921
|
this.loadOnDemand = true;
|
|
4922
|
+
/**
|
|
4923
|
+
* @hidden
|
|
4924
|
+
*/
|
|
4913
4925
|
this.originalData = [];
|
|
4914
|
-
|
|
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;
|
|
4926
|
+
this.component.isVisible = (node) => this.visibleNodes.has(node);
|
|
4931
4927
|
}
|
|
4932
4928
|
/**
|
|
4933
4929
|
* @hidden
|
|
@@ -4936,14 +4932,15 @@ class HierarchyBindingDirective extends FilteringBase {
|
|
|
4936
4932
|
set isVisible(fn) {
|
|
4937
4933
|
this.component.isVisible = fn;
|
|
4938
4934
|
}
|
|
4935
|
+
/**
|
|
4936
|
+
* @hidden
|
|
4937
|
+
*/
|
|
4939
4938
|
ngOnInit() {
|
|
4940
|
-
if (isPresent(this.
|
|
4941
|
-
|
|
4942
|
-
this.component.hasChildren =
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
};
|
|
4946
|
-
this.component.editService = new HierarchyEditingService(this);
|
|
4939
|
+
if (isPresent(this.parentIdField) && isPresent(this.idField)) {
|
|
4940
|
+
const fetchChildren = (node) => findChildren(getter(this.parentIdField), this.originalData || [], getter(this.idField)(node));
|
|
4941
|
+
this.component.hasChildren = (node) => fetchChildren(node).length > 0;
|
|
4942
|
+
this.component.children = (node) => of(fetchChildren(node));
|
|
4943
|
+
this.component.editService = new FlatEditingService(this);
|
|
4947
4944
|
this.component.filterChange.subscribe(this.handleFilterChange.bind(this));
|
|
4948
4945
|
if (this.component.filter) {
|
|
4949
4946
|
this.handleFilterChange(this.component.filter);
|
|
@@ -4953,8 +4950,11 @@ class HierarchyBindingDirective extends FilteringBase {
|
|
|
4953
4950
|
}
|
|
4954
4951
|
}
|
|
4955
4952
|
}
|
|
4953
|
+
/**
|
|
4954
|
+
* @hidden
|
|
4955
|
+
*/
|
|
4956
4956
|
ngOnChanges(changes) {
|
|
4957
|
-
if (isChanged('
|
|
4957
|
+
if (isChanged('parentIdField', changes, false)) {
|
|
4958
4958
|
this.nodes = this.originalData;
|
|
4959
4959
|
this.updateNodes(this.originalData);
|
|
4960
4960
|
}
|
|
@@ -4971,43 +4971,43 @@ class HierarchyBindingDirective extends FilteringBase {
|
|
|
4971
4971
|
*/
|
|
4972
4972
|
updateNodes(values) {
|
|
4973
4973
|
this.originalData = values || [];
|
|
4974
|
-
|
|
4975
|
-
|
|
4974
|
+
if (!isNullOrEmptyString(this.parentIdField)) {
|
|
4975
|
+
const prop = getter(this.parentIdField);
|
|
4976
|
+
this.component.nodes = this.originalData.filter(compose(isBlank, prop));
|
|
4977
|
+
this.filterData = mapToTree(this.component.nodes, this.originalData, this.parentIdField, this.idField);
|
|
4978
|
+
this.updateVisibleNodes(this.filterData);
|
|
4979
|
+
}
|
|
4980
|
+
else {
|
|
4981
|
+
this.component.nodes = this.originalData.slice(0);
|
|
4982
|
+
}
|
|
4976
4983
|
}
|
|
4977
4984
|
}
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
4985
|
+
FlatDataBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FlatDataBindingDirective, deps: [{ token: DataBoundComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4986
|
+
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 });
|
|
4987
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FlatDataBindingDirective, decorators: [{
|
|
4981
4988
|
type: Directive,
|
|
4982
|
-
args: [{
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
type: Host
|
|
4988
|
-
}] }];
|
|
4989
|
-
}, propDecorators: { childrenField: [{
|
|
4989
|
+
args: [{
|
|
4990
|
+
selector: "[kendoTreeViewFlatDataBinding]",
|
|
4991
|
+
standalone: true
|
|
4992
|
+
}]
|
|
4993
|
+
}], ctorParameters: function () { return [{ type: DataBoundComponent }]; }, propDecorators: { nodes: [{
|
|
4990
4994
|
type: Input
|
|
4991
|
-
}],
|
|
4995
|
+
}], parentIdField: [{
|
|
4992
4996
|
type: Input
|
|
4993
|
-
}],
|
|
4997
|
+
}], idField: [{
|
|
4994
4998
|
type: Input
|
|
4995
4999
|
}], loadOnDemand: [{
|
|
4996
5000
|
type: Input
|
|
5001
|
+
}], isVisible: [{
|
|
5002
|
+
type: Input
|
|
4997
5003
|
}] } });
|
|
4998
5004
|
|
|
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
5005
|
/**
|
|
5006
5006
|
* @hidden
|
|
5007
5007
|
*/
|
|
5008
|
-
class
|
|
5009
|
-
constructor(
|
|
5010
|
-
this.
|
|
5008
|
+
class HierarchyEditingService {
|
|
5009
|
+
constructor(hierarchyBinding) {
|
|
5010
|
+
this.hierarchyBinding = hierarchyBinding;
|
|
5011
5011
|
}
|
|
5012
5012
|
add({ sourceItem, destinationItem, dropPosition, sourceTree, destinationTree }) {
|
|
5013
5013
|
// 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 +5015,22 @@ class FlatEditingService {
|
|
|
5015
5015
|
if (dropPosition === DropPosition.Over) {
|
|
5016
5016
|
// expand the item that was dropped into
|
|
5017
5017
|
expandDropTarget(destinationItem, destinationTree);
|
|
5018
|
-
const
|
|
5019
|
-
|
|
5020
|
-
const
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
this.
|
|
5026
|
-
const focusTarget = this.fetchChildNodes(getDataItem(destinationItem), destinationTree).indexOf(clonedSourceDataItem);
|
|
5027
|
-
this.movedItemNewIndex = buildTreeIndex(destinationItem.item.index, focusTarget);
|
|
5018
|
+
const destinationChildren = this.childrenFor(getDataItem(destinationItem));
|
|
5019
|
+
// add the moved node just before the load more button if load more is enabled
|
|
5020
|
+
const targetIndex = isPresent(destinationTree.loadMoreService) ?
|
|
5021
|
+
Math.min(destinationTree.loadMoreService.getGroupSize(getDataItem(destinationItem)), destinationChildren.length) : // the page size might be greater than the actual children array length
|
|
5022
|
+
destinationChildren.length;
|
|
5023
|
+
destinationChildren.splice(targetIndex, 0, clonedSourceDataItem);
|
|
5024
|
+
setter(this.hierarchyBinding.childrenField)(getDataItem(destinationItem), destinationChildren);
|
|
5025
|
+
this.movedItemNewIndex = buildTreeIndex(destinationItem.item.index, targetIndex);
|
|
5028
5026
|
}
|
|
5029
5027
|
else {
|
|
5028
|
+
const destinationParentNodes = this.getParentNodes(destinationItem, destinationTree);
|
|
5030
5029
|
const shiftIndex = dropPosition === DropPosition.After ? 1 : 0;
|
|
5031
|
-
const targetIndex =
|
|
5032
|
-
|
|
5033
|
-
const
|
|
5034
|
-
|
|
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);
|
|
5030
|
+
const targetIndex = destinationParentNodes.indexOf(getDataItem(destinationItem)) + shiftIndex;
|
|
5031
|
+
destinationParentNodes.splice(targetIndex, 0, clonedSourceDataItem);
|
|
5032
|
+
const parentIndex = destinationItem.parent ? destinationItem.parent.item.index : null;
|
|
5033
|
+
this.movedItemNewIndex = buildTreeIndex(parentIndex, targetIndex);
|
|
5048
5034
|
}
|
|
5049
5035
|
// increment the parent page size => an item is moved into it
|
|
5050
5036
|
const updatedParent = dropPosition === DropPosition.Over ? getDataItem(destinationItem) : getDataItem(destinationItem.parent);
|
|
@@ -5064,16 +5050,11 @@ class FlatEditingService {
|
|
|
5064
5050
|
}
|
|
5065
5051
|
}
|
|
5066
5052
|
remove({ sourceItem, sourceTree, destinationTree }) {
|
|
5067
|
-
const
|
|
5068
|
-
const sourceItemIndex =
|
|
5069
|
-
|
|
5070
|
-
if (sourceTree !== destinationTree) {
|
|
5071
|
-
this.removeChildNodes(sourceDataItem, sourceTree);
|
|
5072
|
-
}
|
|
5073
|
-
this.rebindData();
|
|
5053
|
+
const sourceParentNodes = this.getParentNodes(sourceItem, sourceTree);
|
|
5054
|
+
const sourceItemIndex = sourceParentNodes.indexOf(getDataItem(sourceItem));
|
|
5055
|
+
sourceParentNodes.splice(sourceItemIndex, 1);
|
|
5074
5056
|
// emit collapse for the parent node if its last child node was spliced
|
|
5075
|
-
|
|
5076
|
-
collapseEmptyParent(sourceItem.parent, parentChildren, sourceTree);
|
|
5057
|
+
collapseEmptyParent(sourceItem.parent, sourceParentNodes, sourceTree);
|
|
5077
5058
|
// decrement source item parent page size => an item has been removed from it
|
|
5078
5059
|
decrementPageSize(sourceTree, getDataItem(sourceItem.parent));
|
|
5079
5060
|
// reload the treeview nodes
|
|
@@ -5089,52 +5070,18 @@ class FlatEditingService {
|
|
|
5089
5070
|
destinationTree.focus(index);
|
|
5090
5071
|
}
|
|
5091
5072
|
}
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
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;
|
|
5073
|
+
getParentNodes(node, treeView) {
|
|
5074
|
+
return isPresent(node.parent) ?
|
|
5075
|
+
this.childrenFor(getDataItem(node.parent)) :
|
|
5076
|
+
treeView.nodes;
|
|
5128
5077
|
}
|
|
5129
|
-
|
|
5130
|
-
this.
|
|
5131
|
-
this.flatBinding.updateNodes(this.flatBinding.originalData);
|
|
5078
|
+
childrenFor(dataItem) {
|
|
5079
|
+
return getter(this.hierarchyBinding.childrenField)(dataItem) || [];
|
|
5132
5080
|
}
|
|
5133
5081
|
}
|
|
5134
5082
|
|
|
5135
|
-
const findChildren = (prop, nodes, value) => nodes.filter((x) => prop(x) === value);
|
|
5136
5083
|
const indexBuilder = new IndexBuilderService();
|
|
5137
|
-
const
|
|
5084
|
+
const mapToWrappers = (currentLevelNodes, childrenField, parent = null, parentIndex = '') => {
|
|
5138
5085
|
if (!isArrayWithAtLeastOneItem(currentLevelNodes)) {
|
|
5139
5086
|
return [];
|
|
5140
5087
|
}
|
|
@@ -5146,26 +5093,40 @@ const mapToTree = (currentLevelNodes, allNodes, parentIdField, idField, parent =
|
|
|
5146
5093
|
parent,
|
|
5147
5094
|
visible: true
|
|
5148
5095
|
};
|
|
5149
|
-
wrapper.children =
|
|
5096
|
+
wrapper.children = mapToWrappers(getter(childrenField)(node), childrenField, wrapper, index);
|
|
5150
5097
|
return wrapper;
|
|
5151
5098
|
});
|
|
5152
5099
|
};
|
|
5153
5100
|
/**
|
|
5154
|
-
* A directive which encapsulates the retrieval of
|
|
5101
|
+
* A directive which encapsulates the retrieval of child nodes.
|
|
5155
5102
|
*/
|
|
5156
|
-
class
|
|
5157
|
-
constructor(component) {
|
|
5103
|
+
class HierarchyBindingDirective extends FilteringBase {
|
|
5104
|
+
constructor(component, dragAndDropDirective) {
|
|
5158
5105
|
super(component);
|
|
5159
5106
|
this.component = component;
|
|
5107
|
+
this.dragAndDropDirective = dragAndDropDirective;
|
|
5160
5108
|
/**
|
|
5161
5109
|
* @hidden
|
|
5162
5110
|
*/
|
|
5163
5111
|
this.loadOnDemand = true;
|
|
5164
|
-
/**
|
|
5165
|
-
* @hidden
|
|
5166
|
-
*/
|
|
5167
5112
|
this.originalData = [];
|
|
5168
|
-
|
|
5113
|
+
const shouldFilter = !isPresent(this.dragAndDropDirective);
|
|
5114
|
+
this.component.isVisible = shouldFilter ? (node) => this.visibleNodes.has(node) : isVisible;
|
|
5115
|
+
}
|
|
5116
|
+
/**
|
|
5117
|
+
* The field name which holds the data items of the child component.
|
|
5118
|
+
*/
|
|
5119
|
+
set childrenField(value) {
|
|
5120
|
+
if (!value) {
|
|
5121
|
+
throw new Error("'childrenField' cannot be empty");
|
|
5122
|
+
}
|
|
5123
|
+
this._childrenField = value;
|
|
5124
|
+
}
|
|
5125
|
+
/**
|
|
5126
|
+
* The field name which holds the data items of the child component.
|
|
5127
|
+
*/
|
|
5128
|
+
get childrenField() {
|
|
5129
|
+
return this._childrenField;
|
|
5169
5130
|
}
|
|
5170
5131
|
/**
|
|
5171
5132
|
* @hidden
|
|
@@ -5174,15 +5135,14 @@ class FlatDataBindingDirective extends FilteringBase {
|
|
|
5174
5135
|
set isVisible(fn) {
|
|
5175
5136
|
this.component.isVisible = fn;
|
|
5176
5137
|
}
|
|
5177
|
-
/**
|
|
5178
|
-
* @hidden
|
|
5179
|
-
*/
|
|
5180
5138
|
ngOnInit() {
|
|
5181
|
-
if (isPresent(this.
|
|
5182
|
-
|
|
5183
|
-
this.component.hasChildren =
|
|
5184
|
-
|
|
5185
|
-
|
|
5139
|
+
if (isPresent(this.childrenField)) {
|
|
5140
|
+
this.component.children = item => of(getter(this.childrenField)(item));
|
|
5141
|
+
this.component.hasChildren = item => {
|
|
5142
|
+
const children = getter(this.childrenField)(item);
|
|
5143
|
+
return Boolean(children && children.length);
|
|
5144
|
+
};
|
|
5145
|
+
this.component.editService = new HierarchyEditingService(this);
|
|
5186
5146
|
this.component.filterChange.subscribe(this.handleFilterChange.bind(this));
|
|
5187
5147
|
if (this.component.filter) {
|
|
5188
5148
|
this.handleFilterChange(this.component.filter);
|
|
@@ -5192,11 +5152,8 @@ class FlatDataBindingDirective extends FilteringBase {
|
|
|
5192
5152
|
}
|
|
5193
5153
|
}
|
|
5194
5154
|
}
|
|
5195
|
-
/**
|
|
5196
|
-
* @hidden
|
|
5197
|
-
*/
|
|
5198
5155
|
ngOnChanges(changes) {
|
|
5199
|
-
if (isChanged('
|
|
5156
|
+
if (isChanged('childrenField', changes, false)) {
|
|
5200
5157
|
this.nodes = this.originalData;
|
|
5201
5158
|
this.updateNodes(this.originalData);
|
|
5202
5159
|
}
|
|
@@ -5213,81 +5170,31 @@ class FlatDataBindingDirective extends FilteringBase {
|
|
|
5213
5170
|
*/
|
|
5214
5171
|
updateNodes(values) {
|
|
5215
5172
|
this.originalData = values || [];
|
|
5216
|
-
|
|
5217
|
-
|
|
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
|
-
}
|
|
5173
|
+
this.filterData = mapToWrappers(values, this.childrenField) || [];
|
|
5174
|
+
this.updateVisibleNodes(this.filterData);
|
|
5225
5175
|
}
|
|
5226
5176
|
}
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
5177
|
+
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 });
|
|
5178
|
+
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 });
|
|
5179
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyBindingDirective, decorators: [{
|
|
5230
5180
|
type: Directive,
|
|
5231
|
-
args: [{
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5181
|
+
args: [{
|
|
5182
|
+
selector: '[kendoTreeViewHierarchyBinding]',
|
|
5183
|
+
standalone: true
|
|
5184
|
+
}]
|
|
5185
|
+
}], ctorParameters: function () {
|
|
5186
|
+
return [{ type: DataBoundComponent }, { type: DragAndDropDirective, decorators: [{
|
|
5187
|
+
type: Optional
|
|
5188
|
+
}, {
|
|
5189
|
+
type: Host
|
|
5190
|
+
}] }];
|
|
5191
|
+
}, propDecorators: { childrenField: [{
|
|
5237
5192
|
type: Input
|
|
5238
|
-
}],
|
|
5193
|
+
}], nodes: [{
|
|
5239
5194
|
type: Input
|
|
5240
5195
|
}], isVisible: [{
|
|
5241
5196
|
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: [{
|
|
5197
|
+
}], loadOnDemand: [{
|
|
5291
5198
|
type: Input
|
|
5292
5199
|
}] } });
|
|
5293
5200
|
|
|
@@ -5368,11 +5275,12 @@ class LoadMoreDirective {
|
|
|
5368
5275
|
}
|
|
5369
5276
|
}
|
|
5370
5277
|
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 });
|
|
5278
|
+
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
5279
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadMoreDirective, decorators: [{
|
|
5373
5280
|
type: Directive,
|
|
5374
5281
|
args: [{
|
|
5375
|
-
selector: '[kendoTreeViewLoadMore]'
|
|
5282
|
+
selector: '[kendoTreeViewLoadMore]',
|
|
5283
|
+
standalone: true
|
|
5376
5284
|
}]
|
|
5377
5285
|
}], ctorParameters: function () { return [{ type: TreeViewComponent }]; }, propDecorators: { loadMoreNodes: [{
|
|
5378
5286
|
type: Input,
|
|
@@ -5398,7 +5306,7 @@ class CustomMessagesComponent extends TreeViewMessages {
|
|
|
5398
5306
|
}
|
|
5399
5307
|
}
|
|
5400
5308
|
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: [
|
|
5309
|
+
CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomMessagesComponent, isStandalone: true, selector: "kendo-treeview-messages", providers: [
|
|
5402
5310
|
{
|
|
5403
5311
|
provide: TreeViewMessages,
|
|
5404
5312
|
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
@@ -5414,106 +5322,144 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5414
5322
|
}
|
|
5415
5323
|
],
|
|
5416
5324
|
selector: 'kendo-treeview-messages',
|
|
5417
|
-
template:
|
|
5325
|
+
template: ``,
|
|
5326
|
+
standalone: true
|
|
5418
5327
|
}]
|
|
5419
5328
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
5420
5329
|
|
|
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
5330
|
/**
|
|
5446
|
-
*
|
|
5331
|
+
* A directive which manages the in-memory selection state of the TreeView node
|
|
5332
|
+
* ([see example]({% slug selection_treeview %})).
|
|
5447
5333
|
*/
|
|
5448
|
-
class
|
|
5334
|
+
class SelectDirective {
|
|
5335
|
+
constructor(treeView, navigationService) {
|
|
5336
|
+
this.treeView = treeView;
|
|
5337
|
+
this.navigationService = navigationService;
|
|
5338
|
+
/**
|
|
5339
|
+
* Fires when the `selectedKeys` collection was updated.
|
|
5340
|
+
*/
|
|
5341
|
+
this.selectedKeysChange = new EventEmitter();
|
|
5342
|
+
this.subscriptions = new Subscription();
|
|
5343
|
+
this.selectActions = {
|
|
5344
|
+
'multiple': (e) => this.selectMultiple(e),
|
|
5345
|
+
'single': (e) => this.selectSingle(e)
|
|
5346
|
+
};
|
|
5347
|
+
/**
|
|
5348
|
+
* Reflectes the internal `selectedKeys` state.
|
|
5349
|
+
*/
|
|
5350
|
+
this.state = new Set();
|
|
5351
|
+
this.subscriptions.add(this.treeView.selectionChange.subscribe(this.select.bind(this)));
|
|
5352
|
+
this.treeView.isSelected = (dataItem, index) => (this.state.has(this.itemKey({ dataItem, index })));
|
|
5353
|
+
this.navigationService.deselectAllButCurrentItem.subscribe((node) => {
|
|
5354
|
+
this.selectSingle(node);
|
|
5355
|
+
});
|
|
5356
|
+
}
|
|
5357
|
+
/**
|
|
5358
|
+
* @hidden
|
|
5359
|
+
*/
|
|
5360
|
+
set isSelected(value) {
|
|
5361
|
+
this.treeView.isSelected = value;
|
|
5362
|
+
}
|
|
5363
|
+
get getAriaMultiselectable() {
|
|
5364
|
+
return this.options.mode === 'multiple';
|
|
5365
|
+
}
|
|
5366
|
+
get options() {
|
|
5367
|
+
const defaultOptions = {
|
|
5368
|
+
enabled: true,
|
|
5369
|
+
mode: 'single'
|
|
5370
|
+
};
|
|
5371
|
+
if (!isPresent(this.selection) || typeof this.selection === 'string') {
|
|
5372
|
+
return defaultOptions;
|
|
5373
|
+
}
|
|
5374
|
+
const selectionSettings = isBoolean(this.selection) ? { enabled: this.selection } : this.selection;
|
|
5375
|
+
return Object.assign(defaultOptions, selectionSettings);
|
|
5376
|
+
}
|
|
5377
|
+
ngOnChanges(changes) {
|
|
5378
|
+
var _a;
|
|
5379
|
+
if (isChanged('selectedKeys', changes, false) && changes['selectedKeys'].currentValue !== this.lastChange) {
|
|
5380
|
+
this.state = new Set(changes['selectedKeys'].currentValue);
|
|
5381
|
+
}
|
|
5382
|
+
const isSelectionBooleanTrue = typeof this.selection === 'boolean' && this.selection;
|
|
5383
|
+
this.navigationService.selection = isSelectionBooleanTrue ? 'single' : (_a = this.selection) === null || _a === void 0 ? void 0 : _a.mode;
|
|
5384
|
+
}
|
|
5385
|
+
ngOnDestroy() {
|
|
5386
|
+
this.subscriptions.unsubscribe();
|
|
5387
|
+
}
|
|
5388
|
+
itemKey(e) {
|
|
5389
|
+
if (!this.selectKey) {
|
|
5390
|
+
return e.index;
|
|
5391
|
+
}
|
|
5392
|
+
if (typeof this.selectKey === 'string') {
|
|
5393
|
+
return e.dataItem[this.selectKey];
|
|
5394
|
+
}
|
|
5395
|
+
if (typeof this.selectKey === 'function') {
|
|
5396
|
+
return this.selectKey(e);
|
|
5397
|
+
}
|
|
5398
|
+
}
|
|
5399
|
+
select(e) {
|
|
5400
|
+
const { enabled, mode } = this.options;
|
|
5401
|
+
const performSelection = this.selectActions[mode] || noop;
|
|
5402
|
+
if (!enabled) {
|
|
5403
|
+
return;
|
|
5404
|
+
}
|
|
5405
|
+
performSelection(e);
|
|
5406
|
+
}
|
|
5407
|
+
selectSingle(node) {
|
|
5408
|
+
const key = this.itemKey(node);
|
|
5409
|
+
if (!this.state.has(key)) {
|
|
5410
|
+
this.state.clear();
|
|
5411
|
+
this.state.add(key);
|
|
5412
|
+
this.notify();
|
|
5413
|
+
}
|
|
5414
|
+
}
|
|
5415
|
+
selectMultiple(node) {
|
|
5416
|
+
const key = this.itemKey(node);
|
|
5417
|
+
const isSelected = this.state.has(key);
|
|
5418
|
+
if (!isPresent(key)) {
|
|
5419
|
+
return;
|
|
5420
|
+
}
|
|
5421
|
+
if (isSelected) {
|
|
5422
|
+
this.state.delete(key);
|
|
5423
|
+
}
|
|
5424
|
+
else {
|
|
5425
|
+
this.state.add(key);
|
|
5426
|
+
}
|
|
5427
|
+
this.notify();
|
|
5428
|
+
}
|
|
5429
|
+
notify() {
|
|
5430
|
+
this.lastChange = Array.from(this.state);
|
|
5431
|
+
this.selectedKeysChange.emit(this.lastChange);
|
|
5432
|
+
}
|
|
5449
5433
|
}
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
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,
|
|
5434
|
+
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 });
|
|
5435
|
+
SelectDirective.ɵdir = 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 });
|
|
5436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectDirective, decorators: [{
|
|
5437
|
+
type: Directive,
|
|
5501
5438
|
args: [{
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
imports: [
|
|
5505
|
-
CommonModule,
|
|
5506
|
-
InputsModule,
|
|
5507
|
-
IconsModule
|
|
5508
|
-
],
|
|
5509
|
-
entryComponents: [
|
|
5510
|
-
DragClueComponent,
|
|
5511
|
-
DropHintComponent
|
|
5512
|
-
]
|
|
5439
|
+
selector: '[kendoTreeViewSelectable]',
|
|
5440
|
+
standalone: true
|
|
5513
5441
|
}]
|
|
5514
|
-
}] }
|
|
5442
|
+
}], ctorParameters: function () { return [{ type: TreeViewComponent }, { type: NavigationService }]; }, propDecorators: { isSelected: [{
|
|
5443
|
+
type: Input
|
|
5444
|
+
}], selectKey: [{
|
|
5445
|
+
type: Input,
|
|
5446
|
+
args: ['selectBy']
|
|
5447
|
+
}], selection: [{
|
|
5448
|
+
type: Input,
|
|
5449
|
+
args: ['kendoTreeViewSelectable']
|
|
5450
|
+
}], selectedKeys: [{
|
|
5451
|
+
type: Input
|
|
5452
|
+
}], selectedKeysChange: [{
|
|
5453
|
+
type: Output
|
|
5454
|
+
}], getAriaMultiselectable: [{
|
|
5455
|
+
type: HostBinding,
|
|
5456
|
+
args: ['attr.aria-multiselectable']
|
|
5457
|
+
}] } });
|
|
5515
5458
|
|
|
5516
|
-
|
|
5459
|
+
/**
|
|
5460
|
+
* Utility array that contains all `@progress/kendo-angular-treeview` related components and directives
|
|
5461
|
+
*/
|
|
5462
|
+
const KENDO_TREEVIEW = [
|
|
5517
5463
|
TreeViewComponent,
|
|
5518
5464
|
NodeTemplateDirective,
|
|
5519
5465
|
CheckDirective,
|
|
@@ -5528,37 +5474,40 @@ const EXPORTS = [
|
|
|
5528
5474
|
DragAndDropEditingDirective,
|
|
5529
5475
|
LoadMoreDirective,
|
|
5530
5476
|
LoadMoreButtonTemplateDirective,
|
|
5531
|
-
|
|
5532
|
-
CustomMessagesComponent,
|
|
5477
|
+
CustomMessagesComponent
|
|
5533
5478
|
];
|
|
5479
|
+
|
|
5480
|
+
//IMPORTANT: NgModule export kept for backwards compatibility
|
|
5534
5481
|
/**
|
|
5535
5482
|
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the TreeView component.
|
|
5536
5483
|
*/
|
|
5537
5484
|
class TreeViewModule {
|
|
5538
5485
|
}
|
|
5539
5486
|
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: [
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
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] });
|
|
5487
|
+
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] });
|
|
5488
|
+
TreeViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewModule, providers: [
|
|
5489
|
+
IconsService,
|
|
5490
|
+
PopupService,
|
|
5491
|
+
ResizeBatchService,
|
|
5492
|
+
DialogContainerService,
|
|
5493
|
+
DialogService,
|
|
5494
|
+
WindowService,
|
|
5495
|
+
WindowContainerService
|
|
5496
|
+
], imports: [TreeViewComponent, CustomMessagesComponent] });
|
|
5557
5497
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TreeViewModule, decorators: [{
|
|
5558
5498
|
type: NgModule,
|
|
5559
5499
|
args: [{
|
|
5560
|
-
|
|
5561
|
-
|
|
5500
|
+
imports: [...KENDO_TREEVIEW],
|
|
5501
|
+
exports: [...KENDO_TREEVIEW],
|
|
5502
|
+
providers: [
|
|
5503
|
+
IconsService,
|
|
5504
|
+
PopupService,
|
|
5505
|
+
ResizeBatchService,
|
|
5506
|
+
DialogContainerService,
|
|
5507
|
+
DialogService,
|
|
5508
|
+
WindowService,
|
|
5509
|
+
WindowContainerService
|
|
5510
|
+
]
|
|
5562
5511
|
}]
|
|
5563
5512
|
}] });
|
|
5564
5513
|
|
|
@@ -5566,5 +5515,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5566
5515
|
* Generated bundle index. Do not edit.
|
|
5567
5516
|
*/
|
|
5568
5517
|
|
|
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 };
|
|
5518
|
+
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
5519
|
|