@ali-hm/angular-tree-component 20.3.4 → 21.0.2
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, effect, Injectable, inject, input, ViewEncapsulation, Component, ElementRef, Injector, Renderer2,
|
|
3
|
-
import { NgTemplateOutlet,
|
|
2
|
+
import { signal, effect, Injectable, inject, input, ViewEncapsulation, Component, ElementRef, Injector, Renderer2, afterNextRender, output, HostListener, Directive, computed, TemplateRef, ViewContainerRef, forwardRef, EventEmitter, Output, Input, ViewChild, ContentChild, NgModule } from '@angular/core';
|
|
3
|
+
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
4
4
|
|
|
5
5
|
const KEYS = {
|
|
6
6
|
LEFT: 37,
|
|
@@ -244,7 +244,7 @@ class TreeNode {
|
|
|
244
244
|
return this.options.allowDragoverStyling;
|
|
245
245
|
};
|
|
246
246
|
if (this.id === undefined || this.id === null) {
|
|
247
|
-
this.id = uuid();
|
|
247
|
+
this.id = this.treeModel.uuid();
|
|
248
248
|
} // Make sure there's a unique id without overriding existing ids to work with immutable data structures
|
|
249
249
|
this.index = index;
|
|
250
250
|
if (this.getField('children')) {
|
|
@@ -524,9 +524,6 @@ class TreeNode {
|
|
|
524
524
|
.map((c, index) => new TreeNode(c, this, this.treeModel, index));
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
|
-
function uuid() {
|
|
528
|
-
return Math.floor(Math.random() * 10000000000000);
|
|
529
|
-
}
|
|
530
527
|
|
|
531
528
|
class TreeModel {
|
|
532
529
|
constructor() {
|
|
@@ -538,10 +535,12 @@ class TreeModel {
|
|
|
538
535
|
this._selectedLeafNodeIds = signal({}, ...(ngDevMode ? [{ debugName: "_selectedLeafNodeIds" }] : []));
|
|
539
536
|
this._activeNodeIds = signal({}, ...(ngDevMode ? [{ debugName: "_activeNodeIds" }] : []));
|
|
540
537
|
this._hiddenNodeIds = signal({}, ...(ngDevMode ? [{ debugName: "_hiddenNodeIds" }] : []));
|
|
538
|
+
this._hiddenNodes = [];
|
|
541
539
|
this._focusedNodeId = signal(null, ...(ngDevMode ? [{ debugName: "_focusedNodeId" }] : []));
|
|
542
540
|
this._virtualRoot = signal(undefined, ...(ngDevMode ? [{ debugName: "_virtualRoot" }] : []));
|
|
543
541
|
this.firstUpdate = true;
|
|
544
542
|
this.subscriptions = [];
|
|
543
|
+
this.generatedIds = {};
|
|
545
544
|
}
|
|
546
545
|
static { this.focusedTree = null; }
|
|
547
546
|
// Public getters/setters to maintain API compatibility
|
|
@@ -567,10 +566,14 @@ class TreeModel {
|
|
|
567
566
|
return nodes.filter(Boolean);
|
|
568
567
|
}
|
|
569
568
|
get hiddenNodes() {
|
|
570
|
-
const ids = this._hiddenNodeIds();
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
569
|
+
/*const ids = this._hiddenNodeIds();
|
|
570
|
+
var ids2 = Object.keys(ids).filter((id) => ids[id]);
|
|
571
|
+
//const nodes = ids2.map((id) => this.getNodeById(id));
|
|
572
|
+
var nodes=[];
|
|
573
|
+
for(var i=0;i<ids2.length;i++){
|
|
574
|
+
nodes.push(this.getNodeById(ids2[i]));
|
|
575
|
+
}*/
|
|
576
|
+
const nodes = this._hiddenNodes;
|
|
574
577
|
return nodes.filter(Boolean);
|
|
575
578
|
}
|
|
576
579
|
get selectedLeafNodes() {
|
|
@@ -840,8 +843,10 @@ class TreeModel {
|
|
|
840
843
|
return;
|
|
841
844
|
}
|
|
842
845
|
const ids = {};
|
|
843
|
-
|
|
846
|
+
var hiddenNodes = [];
|
|
847
|
+
this.roots.forEach((node) => this._filterNode(ids, node, filterFn, autoShow, hiddenNodes));
|
|
844
848
|
this._hiddenNodeIds.set(ids);
|
|
849
|
+
this._hiddenNodes = hiddenNodes;
|
|
845
850
|
this.fireEvent({ eventName: TREE_EVENTS.changeFilter });
|
|
846
851
|
}
|
|
847
852
|
clearFilter() {
|
|
@@ -924,13 +929,13 @@ class TreeModel {
|
|
|
924
929
|
this._calculateExpandedNodes();
|
|
925
930
|
}
|
|
926
931
|
// private methods
|
|
927
|
-
_filterNode(ids, node, filterFn, autoShow) {
|
|
932
|
+
_filterNode(ids, node, filterFn, autoShow, hiddenNodes) {
|
|
928
933
|
// if node passes function then it's visible
|
|
929
934
|
let isVisible = filterFn(node);
|
|
930
935
|
if (node.children) {
|
|
931
936
|
// if one of node's children passes filter then this node is also visible
|
|
932
937
|
node.children.forEach((child) => {
|
|
933
|
-
if (this._filterNode(ids, child, filterFn, autoShow)) {
|
|
938
|
+
if (this._filterNode(ids, child, filterFn, autoShow, hiddenNodes)) {
|
|
934
939
|
isVisible = true;
|
|
935
940
|
}
|
|
936
941
|
});
|
|
@@ -938,6 +943,7 @@ class TreeModel {
|
|
|
938
943
|
// mark node as hidden
|
|
939
944
|
if (!isVisible) {
|
|
940
945
|
ids[node.id] = true;
|
|
946
|
+
hiddenNodes.push(node);
|
|
941
947
|
}
|
|
942
948
|
// auto expand parents to make sure the filtered nodes are visible
|
|
943
949
|
if (autoShow && isVisible) {
|
|
@@ -972,10 +978,18 @@ class TreeModel {
|
|
|
972
978
|
_setActiveNodeMulti(node, value) {
|
|
973
979
|
this._activeNodeIds.update(ids => ({ ...ids, [node.id]: value }));
|
|
974
980
|
}
|
|
975
|
-
|
|
976
|
-
|
|
981
|
+
uuid() {
|
|
982
|
+
var res = Math.floor(Math.random() * 10000000000000);
|
|
983
|
+
while (this.generatedIds[res]) {
|
|
984
|
+
res = Math.floor(Math.random() * 10000000000000);
|
|
985
|
+
}
|
|
986
|
+
this.generatedIds[res] = true;
|
|
987
|
+
return res;
|
|
988
|
+
}
|
|
989
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
990
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeModel }); }
|
|
977
991
|
}
|
|
978
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
992
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeModel, decorators: [{
|
|
979
993
|
type: Injectable
|
|
980
994
|
}] });
|
|
981
995
|
|
|
@@ -992,10 +1006,10 @@ class TreeDraggedElement {
|
|
|
992
1006
|
isDragging() {
|
|
993
1007
|
return !!this.get();
|
|
994
1008
|
}
|
|
995
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
996
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1009
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeDraggedElement, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1010
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeDraggedElement, providedIn: 'root' }); }
|
|
997
1011
|
}
|
|
998
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1012
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeDraggedElement, decorators: [{
|
|
999
1013
|
type: Injectable,
|
|
1000
1014
|
args: [{
|
|
1001
1015
|
providedIn: 'root'
|
|
@@ -1043,19 +1057,19 @@ class TreeVirtualScroll {
|
|
|
1043
1057
|
const totalHeight = this.totalHeight;
|
|
1044
1058
|
const viewportHeight = this._viewportHeight();
|
|
1045
1059
|
this.fixScroll();
|
|
1046
|
-
}, ...(ngDevMode ?
|
|
1060
|
+
}, { ...(ngDevMode ? { debugName: "fixScrollEffect" } : {}), injector });
|
|
1047
1061
|
const rootsEffect = effect(() => {
|
|
1048
1062
|
const roots = this.treeModel.roots;
|
|
1049
1063
|
fn();
|
|
1050
|
-
}, ...(ngDevMode ?
|
|
1064
|
+
}, { ...(ngDevMode ? { debugName: "rootsEffect" } : {}), injector });
|
|
1051
1065
|
const expandedEffect = effect(() => {
|
|
1052
1066
|
const expandedNodes = this.treeModel.expandedNodes;
|
|
1053
1067
|
fn();
|
|
1054
|
-
}, ...(ngDevMode ?
|
|
1068
|
+
}, { ...(ngDevMode ? { debugName: "expandedEffect" } : {}), injector });
|
|
1055
1069
|
const hiddenEffect = effect(() => {
|
|
1056
1070
|
const hiddenNodes = this.treeModel.hiddenNodes;
|
|
1057
1071
|
fn();
|
|
1058
|
-
}, ...(ngDevMode ?
|
|
1072
|
+
}, { ...(ngDevMode ? { debugName: "hiddenEffect" } : {}), injector });
|
|
1059
1073
|
this._dispose = [
|
|
1060
1074
|
() => fixScrollEffect.destroy(),
|
|
1061
1075
|
() => rootsEffect.destroy(),
|
|
@@ -1169,10 +1183,10 @@ class TreeVirtualScroll {
|
|
|
1169
1183
|
if (this.y > maxY)
|
|
1170
1184
|
this._setYBlocks(maxY / Y_EPSILON);
|
|
1171
1185
|
}
|
|
1172
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1173
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1186
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeVirtualScroll, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1187
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeVirtualScroll }); }
|
|
1174
1188
|
}
|
|
1175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeVirtualScroll, decorators: [{
|
|
1176
1190
|
type: Injectable
|
|
1177
1191
|
}], ctorParameters: () => [] });
|
|
1178
1192
|
function binarySearch(nodes, condition, firstIndex = 0) {
|
|
@@ -1198,8 +1212,8 @@ class LoadingComponent {
|
|
|
1198
1212
|
this.template = input(undefined, ...(ngDevMode ? [{ debugName: "template" }] : []));
|
|
1199
1213
|
this.node = input(undefined, ...(ngDevMode ? [{ debugName: "node" }] : []));
|
|
1200
1214
|
}
|
|
1201
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1202
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1215
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1216
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: LoadingComponent, isStandalone: true, selector: "tree-loading-component", inputs: { template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1203
1217
|
@if (!template()) {
|
|
1204
1218
|
<span>loading...</span>
|
|
1205
1219
|
}
|
|
@@ -1210,7 +1224,7 @@ class LoadingComponent {
|
|
|
1210
1224
|
</ng-container>
|
|
1211
1225
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1212
1226
|
}
|
|
1213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LoadingComponent, decorators: [{
|
|
1214
1228
|
type: Component,
|
|
1215
1229
|
args: [{
|
|
1216
1230
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -1227,16 +1241,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1227
1241
|
`,
|
|
1228
1242
|
imports: [NgTemplateOutlet]
|
|
1229
1243
|
}]
|
|
1230
|
-
}] });
|
|
1244
|
+
}], propDecorators: { template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }] } });
|
|
1231
1245
|
|
|
1232
1246
|
class TreeViewportComponent {
|
|
1233
1247
|
constructor() {
|
|
1234
1248
|
this.elementRef = inject(ElementRef);
|
|
1235
1249
|
this.virtualScroll = inject(TreeVirtualScroll);
|
|
1236
1250
|
this.injector = inject(Injector);
|
|
1251
|
+
this.renderer = inject(Renderer2);
|
|
1237
1252
|
this.setViewport = this.throttle(() => {
|
|
1238
1253
|
this.virtualScroll.setViewport(this.elementRef.nativeElement);
|
|
1239
1254
|
}, 17);
|
|
1255
|
+
this.removeScrollListener = null;
|
|
1240
1256
|
this.scrollEventHandler = this.setViewport.bind(this);
|
|
1241
1257
|
}
|
|
1242
1258
|
ngOnInit() {
|
|
@@ -1244,17 +1260,17 @@ class TreeViewportComponent {
|
|
|
1244
1260
|
this.virtualScroll.setupWatchers(this.injector);
|
|
1245
1261
|
}
|
|
1246
1262
|
ngAfterViewInit() {
|
|
1247
|
-
|
|
1263
|
+
afterNextRender(() => {
|
|
1248
1264
|
this.setViewport();
|
|
1249
1265
|
this.virtualScroll.fireEvent({ eventName: TREE_EVENTS.initialized });
|
|
1250
|
-
});
|
|
1251
|
-
|
|
1252
|
-
|
|
1266
|
+
}, { injector: this.injector });
|
|
1267
|
+
const el = this.elementRef.nativeElement;
|
|
1268
|
+
this.removeScrollListener = this.renderer.listen(el, 'scroll', this.scrollEventHandler);
|
|
1253
1269
|
}
|
|
1254
1270
|
ngOnDestroy() {
|
|
1255
1271
|
this.virtualScroll.clear();
|
|
1256
|
-
|
|
1257
|
-
|
|
1272
|
+
this.removeScrollListener?.();
|
|
1273
|
+
this.removeScrollListener = null;
|
|
1258
1274
|
}
|
|
1259
1275
|
getTotalHeight() {
|
|
1260
1276
|
return ((this.virtualScroll.isEnabled() &&
|
|
@@ -1271,14 +1287,14 @@ class TreeViewportComponent {
|
|
|
1271
1287
|
}
|
|
1272
1288
|
};
|
|
1273
1289
|
}
|
|
1274
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1275
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1290
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeViewportComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1291
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: TreeViewportComponent, isStandalone: true, selector: "tree-viewport", providers: [TreeVirtualScroll], ngImport: i0, template: `
|
|
1276
1292
|
<div [style.height]="getTotalHeight()">
|
|
1277
1293
|
<ng-content></ng-content>
|
|
1278
1294
|
</div>
|
|
1279
1295
|
`, isInline: true }); }
|
|
1280
1296
|
}
|
|
1281
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1297
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeViewportComponent, decorators: [{
|
|
1282
1298
|
type: Component,
|
|
1283
1299
|
args: [{ selector: 'tree-viewport', providers: [TreeVirtualScroll], template: `
|
|
1284
1300
|
<div [style.height]="getTotalHeight()">
|
|
@@ -1287,7 +1303,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1287
1303
|
`, imports: [] }]
|
|
1288
1304
|
}], ctorParameters: () => [] });
|
|
1289
1305
|
|
|
1290
|
-
const DRAG_OVER_CLASS
|
|
1306
|
+
const DRAG_OVER_CLASS = 'is-dragging-over';
|
|
1291
1307
|
const DRAG_DISABLED_CLASS = 'is-dragging-over-disabled';
|
|
1292
1308
|
class TreeDropDirective {
|
|
1293
1309
|
allowDrop($event) {
|
|
@@ -1297,13 +1313,15 @@ class TreeDropDirective {
|
|
|
1297
1313
|
this.el = inject(ElementRef);
|
|
1298
1314
|
this.renderer = inject(Renderer2);
|
|
1299
1315
|
this.treeDraggedElement = inject(TreeDraggedElement);
|
|
1300
|
-
this.ngZone = inject(NgZone);
|
|
1301
1316
|
this.allowDragoverStyling = input(true, ...(ngDevMode ? [{ debugName: "allowDragoverStyling" }] : []));
|
|
1302
1317
|
this.treeAllowDrop = input(undefined, ...(ngDevMode ? [{ debugName: "treeAllowDrop" }] : []));
|
|
1303
1318
|
this.onDropCallback = output({ alias: 'treeDrop' });
|
|
1304
1319
|
this.onDragOverCallback = output({ alias: 'treeDropDragOver' });
|
|
1305
1320
|
this.onDragLeaveCallback = output({ alias: 'treeDropDragLeave' });
|
|
1306
1321
|
this.onDragEnterCallback = output({ alias: 'treeDropDragEnter' });
|
|
1322
|
+
this.dragOverUnlisten = null;
|
|
1323
|
+
this.dragEnterUnlisten = null;
|
|
1324
|
+
this.dragLeaveUnlisten = null;
|
|
1307
1325
|
this._allowDrop = (element, $event) => true;
|
|
1308
1326
|
this.dragOverEventHandler = this.onDragOver.bind(this);
|
|
1309
1327
|
this.dragEnterEventHandler = this.onDragEnter.bind(this);
|
|
@@ -1320,17 +1338,17 @@ class TreeDropDirective {
|
|
|
1320
1338
|
}
|
|
1321
1339
|
ngAfterViewInit() {
|
|
1322
1340
|
let el = this.el.nativeElement;
|
|
1323
|
-
this.
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
el.addEventListener('dragleave', this.dragLeaveEventHandler);
|
|
1327
|
-
});
|
|
1341
|
+
this.dragOverUnlisten = this.renderer.listen(el, 'dragover', this.dragOverEventHandler);
|
|
1342
|
+
this.dragEnterUnlisten = this.renderer.listen(el, 'dragenter', this.dragEnterEventHandler);
|
|
1343
|
+
this.dragLeaveUnlisten = this.renderer.listen(el, 'dragleave', this.dragLeaveEventHandler);
|
|
1328
1344
|
}
|
|
1329
1345
|
ngOnDestroy() {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1346
|
+
this.dragOverUnlisten?.();
|
|
1347
|
+
this.dragEnterUnlisten?.();
|
|
1348
|
+
this.dragLeaveUnlisten?.();
|
|
1349
|
+
this.dragOverUnlisten = null;
|
|
1350
|
+
this.dragEnterUnlisten = null;
|
|
1351
|
+
this.dragLeaveUnlisten = null;
|
|
1334
1352
|
}
|
|
1335
1353
|
onDragOver($event) {
|
|
1336
1354
|
if (!this.allowDrop($event)) {
|
|
@@ -1374,10 +1392,10 @@ class TreeDropDirective {
|
|
|
1374
1392
|
this.treeDraggedElement.set(null);
|
|
1375
1393
|
}
|
|
1376
1394
|
addClass() {
|
|
1377
|
-
this.renderer.addClass(this.el.nativeElement, DRAG_OVER_CLASS
|
|
1395
|
+
this.renderer.addClass(this.el.nativeElement, DRAG_OVER_CLASS);
|
|
1378
1396
|
}
|
|
1379
1397
|
removeClass() {
|
|
1380
|
-
this.renderer.removeClass(this.el.nativeElement, DRAG_OVER_CLASS
|
|
1398
|
+
this.renderer.removeClass(this.el.nativeElement, DRAG_OVER_CLASS);
|
|
1381
1399
|
}
|
|
1382
1400
|
addDisabledClass() {
|
|
1383
1401
|
this.renderer.addClass(this.el.nativeElement, DRAG_DISABLED_CLASS);
|
|
@@ -1385,13 +1403,13 @@ class TreeDropDirective {
|
|
|
1385
1403
|
removeDisabledClass() {
|
|
1386
1404
|
this.renderer.removeClass(this.el.nativeElement, DRAG_DISABLED_CLASS);
|
|
1387
1405
|
}
|
|
1388
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1389
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1406
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1407
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.3", type: TreeDropDirective, isStandalone: true, selector: "[treeDrop]", inputs: { allowDragoverStyling: { classPropertyName: "allowDragoverStyling", publicName: "allowDragoverStyling", isSignal: true, isRequired: false, transformFunction: null }, treeAllowDrop: { classPropertyName: "treeAllowDrop", publicName: "treeAllowDrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDropCallback: "treeDrop", onDragOverCallback: "treeDropDragOver", onDragLeaveCallback: "treeDropDragLeave", onDragEnterCallback: "treeDropDragEnter" }, host: { listeners: { "drop": "onDrop($event)" } }, ngImport: i0 }); }
|
|
1390
1408
|
}
|
|
1391
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1409
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeDropDirective, decorators: [{
|
|
1392
1410
|
type: Directive,
|
|
1393
1411
|
args: [{ selector: '[treeDrop]' }]
|
|
1394
|
-
}], ctorParameters: () => [], propDecorators: { onDrop: [{
|
|
1412
|
+
}], ctorParameters: () => [], propDecorators: { allowDragoverStyling: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowDragoverStyling", required: false }] }], treeAllowDrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeAllowDrop", required: false }] }], onDropCallback: [{ type: i0.Output, args: ["treeDrop"] }], onDragOverCallback: [{ type: i0.Output, args: ["treeDropDragOver"] }], onDragLeaveCallback: [{ type: i0.Output, args: ["treeDropDragLeave"] }], onDragEnterCallback: [{ type: i0.Output, args: ["treeDropDragEnter"] }], onDrop: [{
|
|
1395
1413
|
type: HostListener,
|
|
1396
1414
|
args: ['drop', ['$event']]
|
|
1397
1415
|
}] } });
|
|
@@ -1410,8 +1428,8 @@ class TreeNodeDropSlot {
|
|
|
1410
1428
|
allowDrop(element, $event) {
|
|
1411
1429
|
return this.node().options.allowDrop(element, { parent: this.node(), index: this.dropIndex() }, $event);
|
|
1412
1430
|
}
|
|
1413
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1414
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1431
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeDropSlot, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1432
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: TreeNodeDropSlot, isStandalone: true, selector: "TreeNodeDropSlot, tree-node-drop-slot", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, dropIndex: { classPropertyName: "dropIndex", publicName: "dropIndex", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1415
1433
|
<div
|
|
1416
1434
|
class="node-drop-slot"
|
|
1417
1435
|
(treeDrop)="onDrop($event)"
|
|
@@ -1420,7 +1438,7 @@ class TreeNodeDropSlot {
|
|
|
1420
1438
|
></div>
|
|
1421
1439
|
`, isInline: true, dependencies: [{ kind: "directive", type: TreeDropDirective, selector: "[treeDrop]", inputs: ["allowDragoverStyling", "treeAllowDrop"], outputs: ["treeDrop", "treeDropDragOver", "treeDropDragLeave", "treeDropDragEnter"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1422
1440
|
}
|
|
1423
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1441
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeDropSlot, decorators: [{
|
|
1424
1442
|
type: Component,
|
|
1425
1443
|
args: [{ selector: 'TreeNodeDropSlot, tree-node-drop-slot', encapsulation: ViewEncapsulation.None, template: `
|
|
1426
1444
|
<div
|
|
@@ -1430,14 +1448,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1430
1448
|
[allowDragoverStyling]="true"
|
|
1431
1449
|
></div>
|
|
1432
1450
|
`, imports: [TreeDropDirective] }]
|
|
1433
|
-
}] });
|
|
1451
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }], dropIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropIndex", required: false }] }] } });
|
|
1434
1452
|
|
|
1435
1453
|
class TreeNodeCheckboxComponent {
|
|
1436
1454
|
constructor() {
|
|
1437
1455
|
this.node = input(undefined, ...(ngDevMode ? [{ debugName: "node" }] : []));
|
|
1438
1456
|
}
|
|
1439
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1440
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1457
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1458
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: TreeNodeCheckboxComponent, isStandalone: true, selector: "tree-node-checkbox", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1441
1459
|
<input
|
|
1442
1460
|
class="tree-node-checkbox"
|
|
1443
1461
|
type="checkbox"
|
|
@@ -1447,7 +1465,7 @@ class TreeNodeCheckboxComponent {
|
|
|
1447
1465
|
/>
|
|
1448
1466
|
`, isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1449
1467
|
}
|
|
1450
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeCheckboxComponent, decorators: [{
|
|
1451
1469
|
type: Component,
|
|
1452
1470
|
args: [{ selector: 'tree-node-checkbox', encapsulation: ViewEncapsulation.None, template: `
|
|
1453
1471
|
<input
|
|
@@ -1458,15 +1476,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1458
1476
|
[indeterminate]="node().isPartiallySelected"
|
|
1459
1477
|
/>
|
|
1460
1478
|
`, imports: [] }]
|
|
1461
|
-
}] });
|
|
1479
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }] } });
|
|
1462
1480
|
|
|
1463
1481
|
class TreeNodeExpanderComponent {
|
|
1464
1482
|
constructor() {
|
|
1465
1483
|
this.node = input(...(ngDevMode ? [undefined, { debugName: "node" }] : []));
|
|
1466
1484
|
this.hasChildren = computed(() => this.node().hasChildren, ...(ngDevMode ? [{ debugName: "hasChildren" }] : []));
|
|
1467
1485
|
}
|
|
1468
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1469
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1486
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeExpanderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1487
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TreeNodeExpanderComponent, isStandalone: true, selector: "tree-node-expander", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1470
1488
|
@if (hasChildren()) {
|
|
1471
1489
|
<span
|
|
1472
1490
|
[class.toggle-children-wrapper-expanded]="node().isExpanded"
|
|
@@ -1481,7 +1499,7 @@ class TreeNodeExpanderComponent {
|
|
|
1481
1499
|
}
|
|
1482
1500
|
`, isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1483
1501
|
}
|
|
1484
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeExpanderComponent, decorators: [{
|
|
1485
1503
|
type: Component,
|
|
1486
1504
|
args: [{ selector: 'tree-node-expander', encapsulation: ViewEncapsulation.None, template: `
|
|
1487
1505
|
@if (hasChildren()) {
|
|
@@ -1497,31 +1515,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1497
1515
|
<span class="toggle-children-placeholder"></span>
|
|
1498
1516
|
}
|
|
1499
1517
|
`, imports: [] }]
|
|
1500
|
-
}] });
|
|
1518
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }] } });
|
|
1501
1519
|
|
|
1502
|
-
const DRAG_OVER_CLASS = 'is-dragging-over';
|
|
1503
1520
|
class TreeDragDirective {
|
|
1504
1521
|
constructor() {
|
|
1505
1522
|
this.el = inject(ElementRef);
|
|
1506
1523
|
this.renderer = inject(Renderer2);
|
|
1507
1524
|
this.treeDraggedElement = inject(TreeDraggedElement);
|
|
1508
|
-
this.
|
|
1509
|
-
this.draggedElement = input(undefined, ...(ngDevMode ? [{ debugName: "draggedElement", alias: "treeDrag" }] : [{ alias: "treeDrag" }]));
|
|
1525
|
+
this.draggedElement = input(undefined, { ...(ngDevMode ? { debugName: "draggedElement" } : {}), alias: "treeDrag" });
|
|
1510
1526
|
this.treeDragEnabled = input(undefined, ...(ngDevMode ? [{ debugName: "treeDragEnabled" }] : []));
|
|
1527
|
+
this.dragUnlisten = null;
|
|
1511
1528
|
this.dragEventHandler = this.onDrag.bind(this);
|
|
1512
1529
|
}
|
|
1513
1530
|
ngAfterViewInit() {
|
|
1514
1531
|
let el = this.el.nativeElement;
|
|
1515
|
-
this.
|
|
1516
|
-
el.addEventListener('drag', this.dragEventHandler);
|
|
1517
|
-
});
|
|
1532
|
+
this.dragUnlisten = this.renderer.listen(el, 'drag', this.dragEventHandler);
|
|
1518
1533
|
}
|
|
1519
1534
|
ngDoCheck() {
|
|
1520
1535
|
this.renderer.setAttribute(this.el.nativeElement, 'draggable', this.treeDragEnabled() ? 'true' : 'false');
|
|
1521
1536
|
}
|
|
1522
1537
|
ngOnDestroy() {
|
|
1523
|
-
|
|
1524
|
-
|
|
1538
|
+
this.dragUnlisten?.();
|
|
1539
|
+
this.dragUnlisten = null;
|
|
1525
1540
|
}
|
|
1526
1541
|
onDragStart(ev) {
|
|
1527
1542
|
// setting the data is required by firefox
|
|
@@ -1545,13 +1560,13 @@ class TreeDragDirective {
|
|
|
1545
1560
|
}
|
|
1546
1561
|
this.treeDraggedElement.set(null);
|
|
1547
1562
|
}
|
|
1548
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1549
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1563
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeDragDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1564
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.3", type: TreeDragDirective, isStandalone: true, selector: "[treeDrag]", inputs: { draggedElement: { classPropertyName: "draggedElement", publicName: "treeDrag", isSignal: true, isRequired: false, transformFunction: null }, treeDragEnabled: { classPropertyName: "treeDragEnabled", publicName: "treeDragEnabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "dragstart": "onDragStart($event)", "dragend": "onDragEnd()" } }, ngImport: i0 }); }
|
|
1550
1565
|
}
|
|
1551
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeDragDirective, decorators: [{
|
|
1552
1567
|
type: Directive,
|
|
1553
1568
|
args: [{ selector: '[treeDrag]' }]
|
|
1554
|
-
}], ctorParameters: () => [], propDecorators: { onDragStart: [{
|
|
1569
|
+
}], ctorParameters: () => [], propDecorators: { draggedElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeDrag", required: false }] }], treeDragEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeDragEnabled", required: false }] }], onDragStart: [{
|
|
1555
1570
|
type: HostListener,
|
|
1556
1571
|
args: ['dragstart', ['$event']]
|
|
1557
1572
|
}], onDragEnd: [{
|
|
@@ -1565,8 +1580,8 @@ class TreeNodeContent {
|
|
|
1565
1580
|
this.index = input(undefined, ...(ngDevMode ? [{ debugName: "index" }] : []));
|
|
1566
1581
|
this.template = input(undefined, ...(ngDevMode ? [{ debugName: "template" }] : []));
|
|
1567
1582
|
}
|
|
1568
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1569
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1583
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1584
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TreeNodeContent, isStandalone: true, selector: "tree-node-content", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1570
1585
|
@if (!template()) {
|
|
1571
1586
|
<span>{{ node().displayField }}</span>
|
|
1572
1587
|
}
|
|
@@ -1581,7 +1596,7 @@ class TreeNodeContent {
|
|
|
1581
1596
|
</ng-container>
|
|
1582
1597
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1583
1598
|
}
|
|
1584
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1599
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeContent, decorators: [{
|
|
1585
1600
|
type: Component,
|
|
1586
1601
|
args: [{
|
|
1587
1602
|
selector: 'tree-node-content',
|
|
@@ -1602,7 +1617,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1602
1617
|
`,
|
|
1603
1618
|
imports: [NgTemplateOutlet]
|
|
1604
1619
|
}]
|
|
1605
|
-
}] });
|
|
1620
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }] } });
|
|
1606
1621
|
|
|
1607
1622
|
class TreeNodeWrapperComponent {
|
|
1608
1623
|
constructor() {
|
|
@@ -1611,8 +1626,8 @@ class TreeNodeWrapperComponent {
|
|
|
1611
1626
|
this.templates = input(...(ngDevMode ? [undefined, { debugName: "templates" }] : []));
|
|
1612
1627
|
this.treeNodeWrapperTemplate = computed(() => this.templates().treeNodeWrapperTemplate, ...(ngDevMode ? [{ debugName: "treeNodeWrapperTemplate" }] : []));
|
|
1613
1628
|
}
|
|
1614
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1615
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1629
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1630
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TreeNodeWrapperComponent, isStandalone: true, selector: "tree-node-wrapper", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1616
1631
|
@if (!treeNodeWrapperTemplate()) {
|
|
1617
1632
|
<div class="node-wrapper" [style.padding-left]="node().getNodePadding()">
|
|
1618
1633
|
@if (node().options.useCheckbox) {
|
|
@@ -1658,7 +1673,7 @@ class TreeNodeWrapperComponent {
|
|
|
1658
1673
|
</ng-container>
|
|
1659
1674
|
`, isInline: true, dependencies: [{ kind: "component", type: TreeNodeCheckboxComponent, selector: "tree-node-checkbox", inputs: ["node"] }, { kind: "component", type: TreeNodeExpanderComponent, selector: "tree-node-expander", inputs: ["node"] }, { kind: "directive", type: TreeDragDirective, selector: "[treeDrag]", inputs: ["treeDrag", "treeDragEnabled"] }, { kind: "directive", type: TreeDropDirective, selector: "[treeDrop]", inputs: ["allowDragoverStyling", "treeAllowDrop"], outputs: ["treeDrop", "treeDropDragOver", "treeDropDragLeave", "treeDropDragEnter"] }, { kind: "component", type: TreeNodeContent, selector: "tree-node-content", inputs: ["node", "index", "template"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1660
1675
|
}
|
|
1661
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeWrapperComponent, decorators: [{
|
|
1662
1677
|
type: Component,
|
|
1663
1678
|
args: [{ selector: 'tree-node-wrapper', encapsulation: ViewEncapsulation.None, template: `
|
|
1664
1679
|
@if (!treeNodeWrapperTemplate()) {
|
|
@@ -1712,7 +1727,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1712
1727
|
TreeNodeContent,
|
|
1713
1728
|
NgTemplateOutlet
|
|
1714
1729
|
] }]
|
|
1715
|
-
}] });
|
|
1730
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }] } });
|
|
1716
1731
|
|
|
1717
1732
|
const EASE_ACCELERATION = 1.005;
|
|
1718
1733
|
class TreeAnimateOpenDirective {
|
|
@@ -1720,16 +1735,13 @@ class TreeAnimateOpenDirective {
|
|
|
1720
1735
|
this.renderer = inject(Renderer2);
|
|
1721
1736
|
this.templateRef = inject(TemplateRef);
|
|
1722
1737
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
1723
|
-
this.isOpen = input(undefined, ...(ngDevMode ?
|
|
1724
|
-
this.animateSpeed = input(undefined, ...(ngDevMode ?
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
this.
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
this.isEnabled = input(undefined, ...(ngDevMode ? [{ debugName: "isEnabled", alias: 'treeAnimateOpenEnabled' }] : [{
|
|
1731
|
-
alias: 'treeAnimateOpenEnabled'
|
|
1732
|
-
}]));
|
|
1738
|
+
this.isOpen = input(undefined, { ...(ngDevMode ? { debugName: "isOpen" } : {}), alias: 'treeAnimateOpen' });
|
|
1739
|
+
this.animateSpeed = input(undefined, { ...(ngDevMode ? { debugName: "animateSpeed" } : {}), alias: 'treeAnimateOpenSpeed' });
|
|
1740
|
+
this.animateAcceleration = input(undefined, { ...(ngDevMode ? { debugName: "animateAcceleration" } : {}), alias: 'treeAnimateOpenAcceleration' });
|
|
1741
|
+
this.isEnabled = input(undefined, { ...(ngDevMode ? { debugName: "isEnabled" } : {}), alias: 'treeAnimateOpenEnabled' });
|
|
1742
|
+
this.startOpenTimeout = null;
|
|
1743
|
+
this.openInterval = null;
|
|
1744
|
+
this.closeInterval = null;
|
|
1733
1745
|
effect(() => {
|
|
1734
1746
|
const value = this.isOpen();
|
|
1735
1747
|
if (value) {
|
|
@@ -1751,21 +1763,26 @@ class TreeAnimateOpenDirective {
|
|
|
1751
1763
|
this.innerElement = this.viewContainerRef.createEmbeddedView(this.templateRef).rootNodes[0];
|
|
1752
1764
|
}
|
|
1753
1765
|
_hide() {
|
|
1766
|
+
this.clearTimers();
|
|
1754
1767
|
this.viewContainerRef.clear();
|
|
1755
1768
|
this.innerElement = null;
|
|
1756
1769
|
}
|
|
1757
1770
|
_animateOpen() {
|
|
1771
|
+
this.clearTimers();
|
|
1758
1772
|
let delta = this.animateSpeed();
|
|
1759
1773
|
let ease = this.animateAcceleration();
|
|
1760
1774
|
let maxHeight = 0;
|
|
1761
1775
|
// set height to 0
|
|
1762
1776
|
this.renderer.setStyle(this.innerElement, 'max-height', `0`);
|
|
1763
1777
|
// increase maxHeight until height doesn't change
|
|
1764
|
-
setTimeout(() => {
|
|
1778
|
+
this.startOpenTimeout = setTimeout(() => {
|
|
1779
|
+
this.startOpenTimeout = null;
|
|
1765
1780
|
// Allow inner element to create its content
|
|
1766
|
-
|
|
1767
|
-
if (!this.isOpen() || !this.innerElement)
|
|
1768
|
-
|
|
1781
|
+
this.openInterval = setInterval(() => {
|
|
1782
|
+
if (!this.isOpen() || !this.innerElement) {
|
|
1783
|
+
this.clearOpenInterval();
|
|
1784
|
+
return;
|
|
1785
|
+
}
|
|
1769
1786
|
maxHeight += delta;
|
|
1770
1787
|
const roundedMaxHeight = Math.round(maxHeight);
|
|
1771
1788
|
this.renderer.setStyle(this.innerElement, 'max-height', `${roundedMaxHeight}px`);
|
|
@@ -1777,7 +1794,7 @@ class TreeAnimateOpenDirective {
|
|
|
1777
1794
|
if (height < roundedMaxHeight) {
|
|
1778
1795
|
// Make maxHeight auto because animation finished and container might change height later on
|
|
1779
1796
|
this.renderer.setStyle(this.innerElement, 'max-height', null);
|
|
1780
|
-
|
|
1797
|
+
this.clearOpenInterval();
|
|
1781
1798
|
}
|
|
1782
1799
|
}, 17);
|
|
1783
1800
|
});
|
|
@@ -1785,13 +1802,16 @@ class TreeAnimateOpenDirective {
|
|
|
1785
1802
|
_animateClose() {
|
|
1786
1803
|
if (!this.innerElement)
|
|
1787
1804
|
return;
|
|
1805
|
+
this.clearTimers();
|
|
1788
1806
|
let delta = this.animateSpeed();
|
|
1789
1807
|
let ease = this.animateAcceleration();
|
|
1790
1808
|
let height = this.innerElement.getBoundingClientRect().height; // TBD use renderer
|
|
1791
1809
|
// slowly decrease maxHeight to 0, starting from current height
|
|
1792
|
-
|
|
1793
|
-
if (this.isOpen() || !this.innerElement)
|
|
1794
|
-
|
|
1810
|
+
this.closeInterval = setInterval(() => {
|
|
1811
|
+
if (this.isOpen() || !this.innerElement) {
|
|
1812
|
+
this.clearCloseInterval();
|
|
1813
|
+
return;
|
|
1814
|
+
}
|
|
1795
1815
|
height -= delta;
|
|
1796
1816
|
this.renderer.setStyle(this.innerElement, 'max-height', `${height}px`);
|
|
1797
1817
|
delta *= ease;
|
|
@@ -1800,17 +1820,40 @@ class TreeAnimateOpenDirective {
|
|
|
1800
1820
|
// after animation complete - remove child element
|
|
1801
1821
|
this.viewContainerRef.clear();
|
|
1802
1822
|
this.innerElement = null;
|
|
1803
|
-
|
|
1823
|
+
this.clearCloseInterval();
|
|
1804
1824
|
}
|
|
1805
1825
|
}, 17);
|
|
1806
1826
|
}
|
|
1807
|
-
|
|
1808
|
-
|
|
1827
|
+
ngOnDestroy() {
|
|
1828
|
+
this.clearTimers();
|
|
1829
|
+
}
|
|
1830
|
+
clearTimers() {
|
|
1831
|
+
if (this.startOpenTimeout !== null) {
|
|
1832
|
+
clearTimeout(this.startOpenTimeout);
|
|
1833
|
+
this.startOpenTimeout = null;
|
|
1834
|
+
}
|
|
1835
|
+
this.clearOpenInterval();
|
|
1836
|
+
this.clearCloseInterval();
|
|
1837
|
+
}
|
|
1838
|
+
clearOpenInterval() {
|
|
1839
|
+
if (this.openInterval !== null) {
|
|
1840
|
+
clearInterval(this.openInterval);
|
|
1841
|
+
this.openInterval = null;
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
clearCloseInterval() {
|
|
1845
|
+
if (this.closeInterval !== null) {
|
|
1846
|
+
clearInterval(this.closeInterval);
|
|
1847
|
+
this.closeInterval = null;
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeAnimateOpenDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1851
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.3", type: TreeAnimateOpenDirective, isStandalone: true, selector: "[treeAnimateOpen]", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "treeAnimateOpen", isSignal: true, isRequired: false, transformFunction: null }, animateSpeed: { classPropertyName: "animateSpeed", publicName: "treeAnimateOpenSpeed", isSignal: true, isRequired: false, transformFunction: null }, animateAcceleration: { classPropertyName: "animateAcceleration", publicName: "treeAnimateOpenAcceleration", isSignal: true, isRequired: false, transformFunction: null }, isEnabled: { classPropertyName: "isEnabled", publicName: "treeAnimateOpenEnabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
1809
1852
|
}
|
|
1810
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1853
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeAnimateOpenDirective, decorators: [{
|
|
1811
1854
|
type: Directive,
|
|
1812
1855
|
args: [{ selector: '[treeAnimateOpen]' }]
|
|
1813
|
-
}], ctorParameters: () => [] });
|
|
1856
|
+
}], ctorParameters: () => [], propDecorators: { isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeAnimateOpen", required: false }] }], animateSpeed: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeAnimateOpenSpeed", required: false }] }], animateAcceleration: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeAnimateOpenAcceleration", required: false }] }], isEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeAnimateOpenEnabled", required: false }] }] } });
|
|
1814
1857
|
|
|
1815
1858
|
class TreeNodeChildrenComponent {
|
|
1816
1859
|
constructor() {
|
|
@@ -1818,8 +1861,8 @@ class TreeNodeChildrenComponent {
|
|
|
1818
1861
|
this.templates = input(undefined, ...(ngDevMode ? [{ debugName: "templates" }] : []));
|
|
1819
1862
|
this.children = computed(() => this.node().children, ...(ngDevMode ? [{ debugName: "children" }] : []));
|
|
1820
1863
|
}
|
|
1821
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1822
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1864
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeChildrenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1865
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TreeNodeChildrenComponent, isStandalone: true, selector: "tree-node-children", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1823
1866
|
<div
|
|
1824
1867
|
[class.tree-children]="true"
|
|
1825
1868
|
[class.tree-children-no-padding]="node().options.levelPadding"
|
|
@@ -1848,7 +1891,7 @@ class TreeNodeChildrenComponent {
|
|
|
1848
1891
|
</div>
|
|
1849
1892
|
`, isInline: true, dependencies: [{ kind: "directive", type: i0.forwardRef(() => TreeAnimateOpenDirective), selector: "[treeAnimateOpen]", inputs: ["treeAnimateOpen", "treeAnimateOpenSpeed", "treeAnimateOpenAcceleration", "treeAnimateOpenEnabled"] }, { kind: "component", type: i0.forwardRef(() => TreeNodeCollectionComponent), selector: "tree-node-collection", inputs: ["nodes", "treeModel", "templates"] }, { kind: "component", type: i0.forwardRef(() => LoadingComponent), selector: "tree-loading-component", inputs: ["template", "node"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1850
1893
|
}
|
|
1851
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeChildrenComponent, decorators: [{
|
|
1852
1895
|
type: Component,
|
|
1853
1896
|
args: [{ selector: 'tree-node-children', encapsulation: ViewEncapsulation.None, template: `
|
|
1854
1897
|
<div
|
|
@@ -1882,7 +1925,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1882
1925
|
forwardRef((() => TreeNodeCollectionComponent)),
|
|
1883
1926
|
LoadingComponent
|
|
1884
1927
|
] }]
|
|
1885
|
-
}] });
|
|
1928
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }] } });
|
|
1886
1929
|
class TreeNodeCollectionComponent {
|
|
1887
1930
|
constructor() {
|
|
1888
1931
|
this.nodes = input(undefined, ...(ngDevMode ? [{ debugName: "nodes" }] : []));
|
|
@@ -1910,7 +1953,7 @@ class TreeNodeCollectionComponent {
|
|
|
1910
1953
|
const viewportNodes = this.virtualScroll.getViewportNodes(nodes);
|
|
1911
1954
|
this.viewportNodes.set(viewportNodes);
|
|
1912
1955
|
}
|
|
1913
|
-
}, ...(ngDevMode ?
|
|
1956
|
+
}, { ...(ngDevMode ? { debugName: "viewportEffect" } : {}), injector: this.injector });
|
|
1914
1957
|
this._disposeEffects = [() => viewportEffect.destroy()];
|
|
1915
1958
|
}
|
|
1916
1959
|
ngOnDestroy() {
|
|
@@ -1919,8 +1962,8 @@ class TreeNodeCollectionComponent {
|
|
|
1919
1962
|
trackNode(index, node) {
|
|
1920
1963
|
return node.id;
|
|
1921
1964
|
}
|
|
1922
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1923
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1965
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeCollectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1966
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TreeNodeCollectionComponent, isStandalone: true, selector: "tree-node-collection", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, treeModel: { classPropertyName: "treeModel", publicName: "treeModel", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1924
1967
|
<div [style.margin-top]="marginTop()">
|
|
1925
1968
|
@for (node of viewportNodes(); track trackNode(i, node); let i = $index) {
|
|
1926
1969
|
<tree-node [node]="node" [index]="i" [templates]="templates()">
|
|
@@ -1929,7 +1972,7 @@ class TreeNodeCollectionComponent {
|
|
|
1929
1972
|
</div>
|
|
1930
1973
|
`, isInline: true, dependencies: [{ kind: "component", type: i0.forwardRef(() => TreeNodeComponent), selector: "TreeNode, tree-node", inputs: ["node", "index", "templates"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1931
1974
|
}
|
|
1932
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1975
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeCollectionComponent, decorators: [{
|
|
1933
1976
|
type: Component,
|
|
1934
1977
|
args: [{
|
|
1935
1978
|
selector: 'tree-node-collection',
|
|
@@ -1944,7 +1987,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1944
1987
|
`,
|
|
1945
1988
|
imports: [forwardRef((() => TreeNodeComponent))]
|
|
1946
1989
|
}]
|
|
1947
|
-
}] });
|
|
1990
|
+
}], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: false }] }], treeModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeModel", required: false }] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }] } });
|
|
1948
1991
|
class TreeNodeComponent {
|
|
1949
1992
|
constructor() {
|
|
1950
1993
|
this.node = input(undefined, ...(ngDevMode ? [{ debugName: "node" }] : []));
|
|
@@ -1952,8 +1995,8 @@ class TreeNodeComponent {
|
|
|
1952
1995
|
this.templates = input(...(ngDevMode ? [undefined, { debugName: "templates" }] : []));
|
|
1953
1996
|
this.treeNodeFullTemplate = computed(() => this.templates().treeNodeFullTemplate, ...(ngDevMode ? [{ debugName: "treeNodeFullTemplate" }] : []));
|
|
1954
1997
|
}
|
|
1955
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1956
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1998
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1999
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TreeNodeComponent, isStandalone: true, selector: "TreeNode, tree-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1957
2000
|
@if (!treeNodeFullTemplate()) {
|
|
1958
2001
|
<div
|
|
1959
2002
|
[class]="node().getClass()"
|
|
@@ -1999,7 +2042,7 @@ class TreeNodeComponent {
|
|
|
1999
2042
|
</ng-container>
|
|
2000
2043
|
`, isInline: true, dependencies: [{ kind: "component", type: TreeNodeDropSlot, selector: "TreeNodeDropSlot, tree-node-drop-slot", inputs: ["node", "dropIndex"] }, { kind: "component", type: TreeNodeWrapperComponent, selector: "tree-node-wrapper", inputs: ["node", "index", "templates"] }, { kind: "component", type: TreeNodeChildrenComponent, selector: "tree-node-children", inputs: ["node", "templates"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
2001
2044
|
}
|
|
2002
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2045
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeNodeComponent, decorators: [{
|
|
2003
2046
|
type: Component,
|
|
2004
2047
|
args: [{ selector: 'TreeNode, tree-node', encapsulation: ViewEncapsulation.None, template: `
|
|
2005
2048
|
@if (!treeNodeFullTemplate()) {
|
|
@@ -2051,7 +2094,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
2051
2094
|
TreeNodeChildrenComponent,
|
|
2052
2095
|
NgTemplateOutlet
|
|
2053
2096
|
] }]
|
|
2054
|
-
}] });
|
|
2097
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }] } });
|
|
2055
2098
|
|
|
2056
2099
|
class TreeComponent {
|
|
2057
2100
|
// Will be handled in ngOnChanges
|
|
@@ -2110,38 +2153,40 @@ class TreeComponent {
|
|
|
2110
2153
|
return obj;
|
|
2111
2154
|
}, {});
|
|
2112
2155
|
}
|
|
2113
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2114
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2156
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2157
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TreeComponent, isStandalone: true, selector: "Tree, tree-root", inputs: { nodes: "nodes", options: "options", focused: "focused", state: "state" }, outputs: { toggleExpanded: "toggleExpanded", activate: "activate", deactivate: "deactivate", nodeActivate: "nodeActivate", nodeDeactivate: "nodeDeactivate", select: "select", deselect: "deselect", focus: "focus", blur: "blur", updateData: "updateData", initialized: "initialized", moveNode: "moveNode", copyNode: "copyNode", loadNodeChildren: "loadNodeChildren", changeFilter: "changeFilter", event: "event", stateChange: "stateChange" }, host: { listeners: { "body: keydown": "onKeydown($event)", "body: mousedown": "onMousedown($event)" } }, providers: [TreeModel], queries: [{ propertyName: "loadingTemplate", first: true, predicate: ["loadingTemplate"], descendants: true }, { propertyName: "treeNodeTemplate", first: true, predicate: ["treeNodeTemplate"], descendants: true }, { propertyName: "treeNodeWrapperTemplate", first: true, predicate: ["treeNodeWrapperTemplate"], descendants: true }, { propertyName: "treeNodeFullTemplate", first: true, predicate: ["treeNodeFullTemplate"], descendants: true }], viewQueries: [{ propertyName: "viewportComponent", first: true, predicate: ["viewport"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
2115
2158
|
<tree-viewport #viewport>
|
|
2116
2159
|
<div
|
|
2117
2160
|
class="angular-tree-component"
|
|
2118
2161
|
[class.node-dragging]="treeDraggedElement.isDragging()"
|
|
2119
2162
|
[class.angular-tree-component-rtl]="treeModel.options.rtl"
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2163
|
+
>
|
|
2164
|
+
@if (treeModel.roots) {
|
|
2165
|
+
<tree-node-collection
|
|
2166
|
+
[nodes]="treeModel.roots"
|
|
2167
|
+
[treeModel]="treeModel"
|
|
2125
2168
|
[templates]="{
|
|
2126
2169
|
loadingTemplate: loadingTemplate,
|
|
2127
2170
|
treeNodeTemplate: treeNodeTemplate,
|
|
2128
2171
|
treeNodeWrapperTemplate: treeNodeWrapperTemplate,
|
|
2129
2172
|
treeNodeFullTemplate: treeNodeFullTemplate
|
|
2130
2173
|
}"
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2174
|
+
>
|
|
2175
|
+
</tree-node-collection>
|
|
2176
|
+
}
|
|
2177
|
+
@if (treeModel.isEmptyTree()) {
|
|
2178
|
+
<tree-node-drop-slot
|
|
2179
|
+
class="empty-tree-drop-slot"
|
|
2180
|
+
[dropIndex]="0"
|
|
2181
|
+
[node]="treeModel.virtualRoot"
|
|
2182
|
+
>
|
|
2183
|
+
</tree-node-drop-slot>
|
|
2184
|
+
}
|
|
2140
2185
|
</div>
|
|
2141
2186
|
</tree-viewport>
|
|
2142
|
-
|
|
2187
|
+
`, isInline: true, dependencies: [{ kind: "component", type: TreeViewportComponent, selector: "tree-viewport" }, { kind: "component", type: TreeNodeCollectionComponent, selector: "tree-node-collection", inputs: ["nodes", "treeModel", "templates"] }, { kind: "component", type: TreeNodeDropSlot, selector: "TreeNodeDropSlot, tree-node-drop-slot", inputs: ["node", "dropIndex"] }] }); }
|
|
2143
2188
|
}
|
|
2144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeComponent, decorators: [{
|
|
2145
2190
|
type: Component,
|
|
2146
2191
|
args: [{ selector: 'Tree, tree-root', providers: [TreeModel], template: `
|
|
2147
2192
|
<tree-viewport #viewport>
|
|
@@ -2149,31 +2194,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
2149
2194
|
class="angular-tree-component"
|
|
2150
2195
|
[class.node-dragging]="treeDraggedElement.isDragging()"
|
|
2151
2196
|
[class.angular-tree-component-rtl]="treeModel.options.rtl"
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2197
|
+
>
|
|
2198
|
+
@if (treeModel.roots) {
|
|
2199
|
+
<tree-node-collection
|
|
2200
|
+
[nodes]="treeModel.roots"
|
|
2201
|
+
[treeModel]="treeModel"
|
|
2157
2202
|
[templates]="{
|
|
2158
2203
|
loadingTemplate: loadingTemplate,
|
|
2159
2204
|
treeNodeTemplate: treeNodeTemplate,
|
|
2160
2205
|
treeNodeWrapperTemplate: treeNodeWrapperTemplate,
|
|
2161
2206
|
treeNodeFullTemplate: treeNodeFullTemplate
|
|
2162
2207
|
}"
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2208
|
+
>
|
|
2209
|
+
</tree-node-collection>
|
|
2210
|
+
}
|
|
2211
|
+
@if (treeModel.isEmptyTree()) {
|
|
2212
|
+
<tree-node-drop-slot
|
|
2213
|
+
class="empty-tree-drop-slot"
|
|
2214
|
+
[dropIndex]="0"
|
|
2215
|
+
[node]="treeModel.virtualRoot"
|
|
2216
|
+
>
|
|
2217
|
+
</tree-node-drop-slot>
|
|
2218
|
+
}
|
|
2172
2219
|
</div>
|
|
2173
2220
|
</tree-viewport>
|
|
2174
|
-
|
|
2221
|
+
`, imports: [
|
|
2175
2222
|
TreeViewportComponent,
|
|
2176
|
-
NgIf,
|
|
2177
2223
|
TreeNodeCollectionComponent,
|
|
2178
2224
|
TreeNodeDropSlot
|
|
2179
2225
|
] }]
|
|
@@ -2243,8 +2289,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
2243
2289
|
}] } });
|
|
2244
2290
|
|
|
2245
2291
|
class TreeModule {
|
|
2246
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2247
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
2292
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2293
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: TreeModule, imports: [CommonModule, TreeComponent,
|
|
2248
2294
|
TreeNodeComponent,
|
|
2249
2295
|
TreeNodeContent,
|
|
2250
2296
|
LoadingComponent,
|
|
@@ -2271,9 +2317,9 @@ class TreeModule {
|
|
|
2271
2317
|
TreeNodeWrapperComponent,
|
|
2272
2318
|
TreeNodeCheckboxComponent,
|
|
2273
2319
|
TreeAnimateOpenDirective] }); }
|
|
2274
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2320
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeModule, imports: [CommonModule] }); }
|
|
2275
2321
|
}
|
|
2276
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TreeModule, decorators: [{
|
|
2277
2323
|
type: NgModule,
|
|
2278
2324
|
args: [{
|
|
2279
2325
|
declarations: [],
|