@ali-hm/angular-tree-component 20.3.4 → 21.0.0
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,
|
|
@@ -972,10 +972,10 @@ class TreeModel {
|
|
|
972
972
|
_setActiveNodeMulti(node, value) {
|
|
973
973
|
this._activeNodeIds.update(ids => ({ ...ids, [node.id]: value }));
|
|
974
974
|
}
|
|
975
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
976
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
975
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
976
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeModel }); }
|
|
977
977
|
}
|
|
978
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
978
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeModel, decorators: [{
|
|
979
979
|
type: Injectable
|
|
980
980
|
}] });
|
|
981
981
|
|
|
@@ -992,10 +992,10 @@ class TreeDraggedElement {
|
|
|
992
992
|
isDragging() {
|
|
993
993
|
return !!this.get();
|
|
994
994
|
}
|
|
995
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
996
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
995
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeDraggedElement, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
996
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeDraggedElement, providedIn: 'root' }); }
|
|
997
997
|
}
|
|
998
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
998
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeDraggedElement, decorators: [{
|
|
999
999
|
type: Injectable,
|
|
1000
1000
|
args: [{
|
|
1001
1001
|
providedIn: 'root'
|
|
@@ -1169,10 +1169,10 @@ class TreeVirtualScroll {
|
|
|
1169
1169
|
if (this.y > maxY)
|
|
1170
1170
|
this._setYBlocks(maxY / Y_EPSILON);
|
|
1171
1171
|
}
|
|
1172
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1173
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1172
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeVirtualScroll, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1173
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeVirtualScroll }); }
|
|
1174
1174
|
}
|
|
1175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeVirtualScroll, decorators: [{
|
|
1176
1176
|
type: Injectable
|
|
1177
1177
|
}], ctorParameters: () => [] });
|
|
1178
1178
|
function binarySearch(nodes, condition, firstIndex = 0) {
|
|
@@ -1198,8 +1198,8 @@ class LoadingComponent {
|
|
|
1198
1198
|
this.template = input(undefined, ...(ngDevMode ? [{ debugName: "template" }] : []));
|
|
1199
1199
|
this.node = input(undefined, ...(ngDevMode ? [{ debugName: "node" }] : []));
|
|
1200
1200
|
}
|
|
1201
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1202
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1201
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1202
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", 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
1203
|
@if (!template()) {
|
|
1204
1204
|
<span>loading...</span>
|
|
1205
1205
|
}
|
|
@@ -1210,7 +1210,7 @@ class LoadingComponent {
|
|
|
1210
1210
|
</ng-container>
|
|
1211
1211
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1212
1212
|
}
|
|
1213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1213
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: LoadingComponent, decorators: [{
|
|
1214
1214
|
type: Component,
|
|
1215
1215
|
args: [{
|
|
1216
1216
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -1227,16 +1227,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1227
1227
|
`,
|
|
1228
1228
|
imports: [NgTemplateOutlet]
|
|
1229
1229
|
}]
|
|
1230
|
-
}] });
|
|
1230
|
+
}], propDecorators: { template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }] } });
|
|
1231
1231
|
|
|
1232
1232
|
class TreeViewportComponent {
|
|
1233
1233
|
constructor() {
|
|
1234
1234
|
this.elementRef = inject(ElementRef);
|
|
1235
1235
|
this.virtualScroll = inject(TreeVirtualScroll);
|
|
1236
1236
|
this.injector = inject(Injector);
|
|
1237
|
+
this.renderer = inject(Renderer2);
|
|
1237
1238
|
this.setViewport = this.throttle(() => {
|
|
1238
1239
|
this.virtualScroll.setViewport(this.elementRef.nativeElement);
|
|
1239
1240
|
}, 17);
|
|
1241
|
+
this.removeScrollListener = null;
|
|
1240
1242
|
this.scrollEventHandler = this.setViewport.bind(this);
|
|
1241
1243
|
}
|
|
1242
1244
|
ngOnInit() {
|
|
@@ -1244,17 +1246,17 @@ class TreeViewportComponent {
|
|
|
1244
1246
|
this.virtualScroll.setupWatchers(this.injector);
|
|
1245
1247
|
}
|
|
1246
1248
|
ngAfterViewInit() {
|
|
1247
|
-
|
|
1249
|
+
afterNextRender(() => {
|
|
1248
1250
|
this.setViewport();
|
|
1249
1251
|
this.virtualScroll.fireEvent({ eventName: TREE_EVENTS.initialized });
|
|
1250
|
-
});
|
|
1251
|
-
|
|
1252
|
-
|
|
1252
|
+
}, { injector: this.injector });
|
|
1253
|
+
const el = this.elementRef.nativeElement;
|
|
1254
|
+
this.removeScrollListener = this.renderer.listen(el, 'scroll', this.scrollEventHandler);
|
|
1253
1255
|
}
|
|
1254
1256
|
ngOnDestroy() {
|
|
1255
1257
|
this.virtualScroll.clear();
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
+
this.removeScrollListener?.();
|
|
1259
|
+
this.removeScrollListener = null;
|
|
1258
1260
|
}
|
|
1259
1261
|
getTotalHeight() {
|
|
1260
1262
|
return ((this.virtualScroll.isEnabled() &&
|
|
@@ -1271,14 +1273,14 @@ class TreeViewportComponent {
|
|
|
1271
1273
|
}
|
|
1272
1274
|
};
|
|
1273
1275
|
}
|
|
1274
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1275
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1276
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeViewportComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1277
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: TreeViewportComponent, isStandalone: true, selector: "tree-viewport", providers: [TreeVirtualScroll], ngImport: i0, template: `
|
|
1276
1278
|
<div [style.height]="getTotalHeight()">
|
|
1277
1279
|
<ng-content></ng-content>
|
|
1278
1280
|
</div>
|
|
1279
1281
|
`, isInline: true }); }
|
|
1280
1282
|
}
|
|
1281
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1283
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeViewportComponent, decorators: [{
|
|
1282
1284
|
type: Component,
|
|
1283
1285
|
args: [{ selector: 'tree-viewport', providers: [TreeVirtualScroll], template: `
|
|
1284
1286
|
<div [style.height]="getTotalHeight()">
|
|
@@ -1287,7 +1289,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1287
1289
|
`, imports: [] }]
|
|
1288
1290
|
}], ctorParameters: () => [] });
|
|
1289
1291
|
|
|
1290
|
-
const DRAG_OVER_CLASS
|
|
1292
|
+
const DRAG_OVER_CLASS = 'is-dragging-over';
|
|
1291
1293
|
const DRAG_DISABLED_CLASS = 'is-dragging-over-disabled';
|
|
1292
1294
|
class TreeDropDirective {
|
|
1293
1295
|
allowDrop($event) {
|
|
@@ -1297,13 +1299,15 @@ class TreeDropDirective {
|
|
|
1297
1299
|
this.el = inject(ElementRef);
|
|
1298
1300
|
this.renderer = inject(Renderer2);
|
|
1299
1301
|
this.treeDraggedElement = inject(TreeDraggedElement);
|
|
1300
|
-
this.ngZone = inject(NgZone);
|
|
1301
1302
|
this.allowDragoverStyling = input(true, ...(ngDevMode ? [{ debugName: "allowDragoverStyling" }] : []));
|
|
1302
1303
|
this.treeAllowDrop = input(undefined, ...(ngDevMode ? [{ debugName: "treeAllowDrop" }] : []));
|
|
1303
1304
|
this.onDropCallback = output({ alias: 'treeDrop' });
|
|
1304
1305
|
this.onDragOverCallback = output({ alias: 'treeDropDragOver' });
|
|
1305
1306
|
this.onDragLeaveCallback = output({ alias: 'treeDropDragLeave' });
|
|
1306
1307
|
this.onDragEnterCallback = output({ alias: 'treeDropDragEnter' });
|
|
1308
|
+
this.dragOverUnlisten = null;
|
|
1309
|
+
this.dragEnterUnlisten = null;
|
|
1310
|
+
this.dragLeaveUnlisten = null;
|
|
1307
1311
|
this._allowDrop = (element, $event) => true;
|
|
1308
1312
|
this.dragOverEventHandler = this.onDragOver.bind(this);
|
|
1309
1313
|
this.dragEnterEventHandler = this.onDragEnter.bind(this);
|
|
@@ -1320,17 +1324,17 @@ class TreeDropDirective {
|
|
|
1320
1324
|
}
|
|
1321
1325
|
ngAfterViewInit() {
|
|
1322
1326
|
let el = this.el.nativeElement;
|
|
1323
|
-
this.
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
el.addEventListener('dragleave', this.dragLeaveEventHandler);
|
|
1327
|
-
});
|
|
1327
|
+
this.dragOverUnlisten = this.renderer.listen(el, 'dragover', this.dragOverEventHandler);
|
|
1328
|
+
this.dragEnterUnlisten = this.renderer.listen(el, 'dragenter', this.dragEnterEventHandler);
|
|
1329
|
+
this.dragLeaveUnlisten = this.renderer.listen(el, 'dragleave', this.dragLeaveEventHandler);
|
|
1328
1330
|
}
|
|
1329
1331
|
ngOnDestroy() {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1332
|
+
this.dragOverUnlisten?.();
|
|
1333
|
+
this.dragEnterUnlisten?.();
|
|
1334
|
+
this.dragLeaveUnlisten?.();
|
|
1335
|
+
this.dragOverUnlisten = null;
|
|
1336
|
+
this.dragEnterUnlisten = null;
|
|
1337
|
+
this.dragLeaveUnlisten = null;
|
|
1334
1338
|
}
|
|
1335
1339
|
onDragOver($event) {
|
|
1336
1340
|
if (!this.allowDrop($event)) {
|
|
@@ -1374,10 +1378,10 @@ class TreeDropDirective {
|
|
|
1374
1378
|
this.treeDraggedElement.set(null);
|
|
1375
1379
|
}
|
|
1376
1380
|
addClass() {
|
|
1377
|
-
this.renderer.addClass(this.el.nativeElement, DRAG_OVER_CLASS
|
|
1381
|
+
this.renderer.addClass(this.el.nativeElement, DRAG_OVER_CLASS);
|
|
1378
1382
|
}
|
|
1379
1383
|
removeClass() {
|
|
1380
|
-
this.renderer.removeClass(this.el.nativeElement, DRAG_OVER_CLASS
|
|
1384
|
+
this.renderer.removeClass(this.el.nativeElement, DRAG_OVER_CLASS);
|
|
1381
1385
|
}
|
|
1382
1386
|
addDisabledClass() {
|
|
1383
1387
|
this.renderer.addClass(this.el.nativeElement, DRAG_DISABLED_CLASS);
|
|
@@ -1385,13 +1389,13 @@ class TreeDropDirective {
|
|
|
1385
1389
|
removeDisabledClass() {
|
|
1386
1390
|
this.renderer.removeClass(this.el.nativeElement, DRAG_DISABLED_CLASS);
|
|
1387
1391
|
}
|
|
1388
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1389
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1392
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1393
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0", 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
1394
|
}
|
|
1391
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1395
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeDropDirective, decorators: [{
|
|
1392
1396
|
type: Directive,
|
|
1393
1397
|
args: [{ selector: '[treeDrop]' }]
|
|
1394
|
-
}], ctorParameters: () => [], propDecorators: { onDrop: [{
|
|
1398
|
+
}], 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
1399
|
type: HostListener,
|
|
1396
1400
|
args: ['drop', ['$event']]
|
|
1397
1401
|
}] } });
|
|
@@ -1410,8 +1414,8 @@ class TreeNodeDropSlot {
|
|
|
1410
1414
|
allowDrop(element, $event) {
|
|
1411
1415
|
return this.node().options.allowDrop(element, { parent: this.node(), index: this.dropIndex() }, $event);
|
|
1412
1416
|
}
|
|
1413
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1414
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1417
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeDropSlot, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1418
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.0", 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
1419
|
<div
|
|
1416
1420
|
class="node-drop-slot"
|
|
1417
1421
|
(treeDrop)="onDrop($event)"
|
|
@@ -1420,7 +1424,7 @@ class TreeNodeDropSlot {
|
|
|
1420
1424
|
></div>
|
|
1421
1425
|
`, isInline: true, dependencies: [{ kind: "directive", type: TreeDropDirective, selector: "[treeDrop]", inputs: ["allowDragoverStyling", "treeAllowDrop"], outputs: ["treeDrop", "treeDropDragOver", "treeDropDragLeave", "treeDropDragEnter"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1422
1426
|
}
|
|
1423
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1427
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeDropSlot, decorators: [{
|
|
1424
1428
|
type: Component,
|
|
1425
1429
|
args: [{ selector: 'TreeNodeDropSlot, tree-node-drop-slot', encapsulation: ViewEncapsulation.None, template: `
|
|
1426
1430
|
<div
|
|
@@ -1430,14 +1434,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1430
1434
|
[allowDragoverStyling]="true"
|
|
1431
1435
|
></div>
|
|
1432
1436
|
`, imports: [TreeDropDirective] }]
|
|
1433
|
-
}] });
|
|
1437
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }], dropIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropIndex", required: false }] }] } });
|
|
1434
1438
|
|
|
1435
1439
|
class TreeNodeCheckboxComponent {
|
|
1436
1440
|
constructor() {
|
|
1437
1441
|
this.node = input(undefined, ...(ngDevMode ? [{ debugName: "node" }] : []));
|
|
1438
1442
|
}
|
|
1439
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1440
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1443
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1444
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.0", type: TreeNodeCheckboxComponent, isStandalone: true, selector: "tree-node-checkbox", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1441
1445
|
<input
|
|
1442
1446
|
class="tree-node-checkbox"
|
|
1443
1447
|
type="checkbox"
|
|
@@ -1447,7 +1451,7 @@ class TreeNodeCheckboxComponent {
|
|
|
1447
1451
|
/>
|
|
1448
1452
|
`, isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1449
1453
|
}
|
|
1450
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1454
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeCheckboxComponent, decorators: [{
|
|
1451
1455
|
type: Component,
|
|
1452
1456
|
args: [{ selector: 'tree-node-checkbox', encapsulation: ViewEncapsulation.None, template: `
|
|
1453
1457
|
<input
|
|
@@ -1458,15 +1462,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1458
1462
|
[indeterminate]="node().isPartiallySelected"
|
|
1459
1463
|
/>
|
|
1460
1464
|
`, imports: [] }]
|
|
1461
|
-
}] });
|
|
1465
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }] } });
|
|
1462
1466
|
|
|
1463
1467
|
class TreeNodeExpanderComponent {
|
|
1464
1468
|
constructor() {
|
|
1465
1469
|
this.node = input(...(ngDevMode ? [undefined, { debugName: "node" }] : []));
|
|
1466
1470
|
this.hasChildren = computed(() => this.node().hasChildren, ...(ngDevMode ? [{ debugName: "hasChildren" }] : []));
|
|
1467
1471
|
}
|
|
1468
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1469
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1472
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeExpanderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1473
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: TreeNodeExpanderComponent, isStandalone: true, selector: "tree-node-expander", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1470
1474
|
@if (hasChildren()) {
|
|
1471
1475
|
<span
|
|
1472
1476
|
[class.toggle-children-wrapper-expanded]="node().isExpanded"
|
|
@@ -1481,7 +1485,7 @@ class TreeNodeExpanderComponent {
|
|
|
1481
1485
|
}
|
|
1482
1486
|
`, isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1483
1487
|
}
|
|
1484
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1488
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeExpanderComponent, decorators: [{
|
|
1485
1489
|
type: Component,
|
|
1486
1490
|
args: [{ selector: 'tree-node-expander', encapsulation: ViewEncapsulation.None, template: `
|
|
1487
1491
|
@if (hasChildren()) {
|
|
@@ -1497,31 +1501,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1497
1501
|
<span class="toggle-children-placeholder"></span>
|
|
1498
1502
|
}
|
|
1499
1503
|
`, imports: [] }]
|
|
1500
|
-
}] });
|
|
1504
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }] } });
|
|
1501
1505
|
|
|
1502
|
-
const DRAG_OVER_CLASS = 'is-dragging-over';
|
|
1503
1506
|
class TreeDragDirective {
|
|
1504
1507
|
constructor() {
|
|
1505
1508
|
this.el = inject(ElementRef);
|
|
1506
1509
|
this.renderer = inject(Renderer2);
|
|
1507
1510
|
this.treeDraggedElement = inject(TreeDraggedElement);
|
|
1508
|
-
this.ngZone = inject(NgZone);
|
|
1509
1511
|
this.draggedElement = input(undefined, ...(ngDevMode ? [{ debugName: "draggedElement", alias: "treeDrag" }] : [{ alias: "treeDrag" }]));
|
|
1510
1512
|
this.treeDragEnabled = input(undefined, ...(ngDevMode ? [{ debugName: "treeDragEnabled" }] : []));
|
|
1513
|
+
this.dragUnlisten = null;
|
|
1511
1514
|
this.dragEventHandler = this.onDrag.bind(this);
|
|
1512
1515
|
}
|
|
1513
1516
|
ngAfterViewInit() {
|
|
1514
1517
|
let el = this.el.nativeElement;
|
|
1515
|
-
this.
|
|
1516
|
-
el.addEventListener('drag', this.dragEventHandler);
|
|
1517
|
-
});
|
|
1518
|
+
this.dragUnlisten = this.renderer.listen(el, 'drag', this.dragEventHandler);
|
|
1518
1519
|
}
|
|
1519
1520
|
ngDoCheck() {
|
|
1520
1521
|
this.renderer.setAttribute(this.el.nativeElement, 'draggable', this.treeDragEnabled() ? 'true' : 'false');
|
|
1521
1522
|
}
|
|
1522
1523
|
ngOnDestroy() {
|
|
1523
|
-
|
|
1524
|
-
|
|
1524
|
+
this.dragUnlisten?.();
|
|
1525
|
+
this.dragUnlisten = null;
|
|
1525
1526
|
}
|
|
1526
1527
|
onDragStart(ev) {
|
|
1527
1528
|
// setting the data is required by firefox
|
|
@@ -1545,13 +1546,13 @@ class TreeDragDirective {
|
|
|
1545
1546
|
}
|
|
1546
1547
|
this.treeDraggedElement.set(null);
|
|
1547
1548
|
}
|
|
1548
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1549
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1549
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeDragDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1550
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0", 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
1551
|
}
|
|
1551
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1552
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeDragDirective, decorators: [{
|
|
1552
1553
|
type: Directive,
|
|
1553
1554
|
args: [{ selector: '[treeDrag]' }]
|
|
1554
|
-
}], ctorParameters: () => [], propDecorators: { onDragStart: [{
|
|
1555
|
+
}], 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
1556
|
type: HostListener,
|
|
1556
1557
|
args: ['dragstart', ['$event']]
|
|
1557
1558
|
}], onDragEnd: [{
|
|
@@ -1565,8 +1566,8 @@ class TreeNodeContent {
|
|
|
1565
1566
|
this.index = input(undefined, ...(ngDevMode ? [{ debugName: "index" }] : []));
|
|
1566
1567
|
this.template = input(undefined, ...(ngDevMode ? [{ debugName: "template" }] : []));
|
|
1567
1568
|
}
|
|
1568
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1569
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1569
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1570
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", 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
1571
|
@if (!template()) {
|
|
1571
1572
|
<span>{{ node().displayField }}</span>
|
|
1572
1573
|
}
|
|
@@ -1581,7 +1582,7 @@ class TreeNodeContent {
|
|
|
1581
1582
|
</ng-container>
|
|
1582
1583
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1583
1584
|
}
|
|
1584
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1585
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeContent, decorators: [{
|
|
1585
1586
|
type: Component,
|
|
1586
1587
|
args: [{
|
|
1587
1588
|
selector: 'tree-node-content',
|
|
@@ -1602,7 +1603,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1602
1603
|
`,
|
|
1603
1604
|
imports: [NgTemplateOutlet]
|
|
1604
1605
|
}]
|
|
1605
|
-
}] });
|
|
1606
|
+
}], 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
1607
|
|
|
1607
1608
|
class TreeNodeWrapperComponent {
|
|
1608
1609
|
constructor() {
|
|
@@ -1611,8 +1612,8 @@ class TreeNodeWrapperComponent {
|
|
|
1611
1612
|
this.templates = input(...(ngDevMode ? [undefined, { debugName: "templates" }] : []));
|
|
1612
1613
|
this.treeNodeWrapperTemplate = computed(() => this.templates().treeNodeWrapperTemplate, ...(ngDevMode ? [{ debugName: "treeNodeWrapperTemplate" }] : []));
|
|
1613
1614
|
}
|
|
1614
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1615
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1615
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1616
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", 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
1617
|
@if (!treeNodeWrapperTemplate()) {
|
|
1617
1618
|
<div class="node-wrapper" [style.padding-left]="node().getNodePadding()">
|
|
1618
1619
|
@if (node().options.useCheckbox) {
|
|
@@ -1658,7 +1659,7 @@ class TreeNodeWrapperComponent {
|
|
|
1658
1659
|
</ng-container>
|
|
1659
1660
|
`, 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
1661
|
}
|
|
1661
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1662
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeWrapperComponent, decorators: [{
|
|
1662
1663
|
type: Component,
|
|
1663
1664
|
args: [{ selector: 'tree-node-wrapper', encapsulation: ViewEncapsulation.None, template: `
|
|
1664
1665
|
@if (!treeNodeWrapperTemplate()) {
|
|
@@ -1712,7 +1713,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1712
1713
|
TreeNodeContent,
|
|
1713
1714
|
NgTemplateOutlet
|
|
1714
1715
|
] }]
|
|
1715
|
-
}] });
|
|
1716
|
+
}], 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
1717
|
|
|
1717
1718
|
const EASE_ACCELERATION = 1.005;
|
|
1718
1719
|
class TreeAnimateOpenDirective {
|
|
@@ -1730,6 +1731,9 @@ class TreeAnimateOpenDirective {
|
|
|
1730
1731
|
this.isEnabled = input(undefined, ...(ngDevMode ? [{ debugName: "isEnabled", alias: 'treeAnimateOpenEnabled' }] : [{
|
|
1731
1732
|
alias: 'treeAnimateOpenEnabled'
|
|
1732
1733
|
}]));
|
|
1734
|
+
this.startOpenTimeout = null;
|
|
1735
|
+
this.openInterval = null;
|
|
1736
|
+
this.closeInterval = null;
|
|
1733
1737
|
effect(() => {
|
|
1734
1738
|
const value = this.isOpen();
|
|
1735
1739
|
if (value) {
|
|
@@ -1751,21 +1755,26 @@ class TreeAnimateOpenDirective {
|
|
|
1751
1755
|
this.innerElement = this.viewContainerRef.createEmbeddedView(this.templateRef).rootNodes[0];
|
|
1752
1756
|
}
|
|
1753
1757
|
_hide() {
|
|
1758
|
+
this.clearTimers();
|
|
1754
1759
|
this.viewContainerRef.clear();
|
|
1755
1760
|
this.innerElement = null;
|
|
1756
1761
|
}
|
|
1757
1762
|
_animateOpen() {
|
|
1763
|
+
this.clearTimers();
|
|
1758
1764
|
let delta = this.animateSpeed();
|
|
1759
1765
|
let ease = this.animateAcceleration();
|
|
1760
1766
|
let maxHeight = 0;
|
|
1761
1767
|
// set height to 0
|
|
1762
1768
|
this.renderer.setStyle(this.innerElement, 'max-height', `0`);
|
|
1763
1769
|
// increase maxHeight until height doesn't change
|
|
1764
|
-
setTimeout(() => {
|
|
1770
|
+
this.startOpenTimeout = setTimeout(() => {
|
|
1771
|
+
this.startOpenTimeout = null;
|
|
1765
1772
|
// Allow inner element to create its content
|
|
1766
|
-
|
|
1767
|
-
if (!this.isOpen() || !this.innerElement)
|
|
1768
|
-
|
|
1773
|
+
this.openInterval = setInterval(() => {
|
|
1774
|
+
if (!this.isOpen() || !this.innerElement) {
|
|
1775
|
+
this.clearOpenInterval();
|
|
1776
|
+
return;
|
|
1777
|
+
}
|
|
1769
1778
|
maxHeight += delta;
|
|
1770
1779
|
const roundedMaxHeight = Math.round(maxHeight);
|
|
1771
1780
|
this.renderer.setStyle(this.innerElement, 'max-height', `${roundedMaxHeight}px`);
|
|
@@ -1777,7 +1786,7 @@ class TreeAnimateOpenDirective {
|
|
|
1777
1786
|
if (height < roundedMaxHeight) {
|
|
1778
1787
|
// Make maxHeight auto because animation finished and container might change height later on
|
|
1779
1788
|
this.renderer.setStyle(this.innerElement, 'max-height', null);
|
|
1780
|
-
|
|
1789
|
+
this.clearOpenInterval();
|
|
1781
1790
|
}
|
|
1782
1791
|
}, 17);
|
|
1783
1792
|
});
|
|
@@ -1785,13 +1794,16 @@ class TreeAnimateOpenDirective {
|
|
|
1785
1794
|
_animateClose() {
|
|
1786
1795
|
if (!this.innerElement)
|
|
1787
1796
|
return;
|
|
1797
|
+
this.clearTimers();
|
|
1788
1798
|
let delta = this.animateSpeed();
|
|
1789
1799
|
let ease = this.animateAcceleration();
|
|
1790
1800
|
let height = this.innerElement.getBoundingClientRect().height; // TBD use renderer
|
|
1791
1801
|
// slowly decrease maxHeight to 0, starting from current height
|
|
1792
|
-
|
|
1793
|
-
if (this.isOpen() || !this.innerElement)
|
|
1794
|
-
|
|
1802
|
+
this.closeInterval = setInterval(() => {
|
|
1803
|
+
if (this.isOpen() || !this.innerElement) {
|
|
1804
|
+
this.clearCloseInterval();
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1795
1807
|
height -= delta;
|
|
1796
1808
|
this.renderer.setStyle(this.innerElement, 'max-height', `${height}px`);
|
|
1797
1809
|
delta *= ease;
|
|
@@ -1800,17 +1812,40 @@ class TreeAnimateOpenDirective {
|
|
|
1800
1812
|
// after animation complete - remove child element
|
|
1801
1813
|
this.viewContainerRef.clear();
|
|
1802
1814
|
this.innerElement = null;
|
|
1803
|
-
|
|
1815
|
+
this.clearCloseInterval();
|
|
1804
1816
|
}
|
|
1805
1817
|
}, 17);
|
|
1806
1818
|
}
|
|
1807
|
-
|
|
1808
|
-
|
|
1819
|
+
ngOnDestroy() {
|
|
1820
|
+
this.clearTimers();
|
|
1821
|
+
}
|
|
1822
|
+
clearTimers() {
|
|
1823
|
+
if (this.startOpenTimeout !== null) {
|
|
1824
|
+
clearTimeout(this.startOpenTimeout);
|
|
1825
|
+
this.startOpenTimeout = null;
|
|
1826
|
+
}
|
|
1827
|
+
this.clearOpenInterval();
|
|
1828
|
+
this.clearCloseInterval();
|
|
1829
|
+
}
|
|
1830
|
+
clearOpenInterval() {
|
|
1831
|
+
if (this.openInterval !== null) {
|
|
1832
|
+
clearInterval(this.openInterval);
|
|
1833
|
+
this.openInterval = null;
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
clearCloseInterval() {
|
|
1837
|
+
if (this.closeInterval !== null) {
|
|
1838
|
+
clearInterval(this.closeInterval);
|
|
1839
|
+
this.closeInterval = null;
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeAnimateOpenDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1843
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0", 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
1844
|
}
|
|
1810
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1845
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeAnimateOpenDirective, decorators: [{
|
|
1811
1846
|
type: Directive,
|
|
1812
1847
|
args: [{ selector: '[treeAnimateOpen]' }]
|
|
1813
|
-
}], ctorParameters: () => [] });
|
|
1848
|
+
}], 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
1849
|
|
|
1815
1850
|
class TreeNodeChildrenComponent {
|
|
1816
1851
|
constructor() {
|
|
@@ -1818,8 +1853,8 @@ class TreeNodeChildrenComponent {
|
|
|
1818
1853
|
this.templates = input(undefined, ...(ngDevMode ? [{ debugName: "templates" }] : []));
|
|
1819
1854
|
this.children = computed(() => this.node().children, ...(ngDevMode ? [{ debugName: "children" }] : []));
|
|
1820
1855
|
}
|
|
1821
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1822
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1856
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeChildrenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1857
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", 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
1858
|
<div
|
|
1824
1859
|
[class.tree-children]="true"
|
|
1825
1860
|
[class.tree-children-no-padding]="node().options.levelPadding"
|
|
@@ -1848,7 +1883,7 @@ class TreeNodeChildrenComponent {
|
|
|
1848
1883
|
</div>
|
|
1849
1884
|
`, 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
1885
|
}
|
|
1851
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1886
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeChildrenComponent, decorators: [{
|
|
1852
1887
|
type: Component,
|
|
1853
1888
|
args: [{ selector: 'tree-node-children', encapsulation: ViewEncapsulation.None, template: `
|
|
1854
1889
|
<div
|
|
@@ -1882,7 +1917,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1882
1917
|
forwardRef((() => TreeNodeCollectionComponent)),
|
|
1883
1918
|
LoadingComponent
|
|
1884
1919
|
] }]
|
|
1885
|
-
}] });
|
|
1920
|
+
}], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }] } });
|
|
1886
1921
|
class TreeNodeCollectionComponent {
|
|
1887
1922
|
constructor() {
|
|
1888
1923
|
this.nodes = input(undefined, ...(ngDevMode ? [{ debugName: "nodes" }] : []));
|
|
@@ -1919,8 +1954,8 @@ class TreeNodeCollectionComponent {
|
|
|
1919
1954
|
trackNode(index, node) {
|
|
1920
1955
|
return node.id;
|
|
1921
1956
|
}
|
|
1922
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1923
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1957
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeCollectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1958
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", 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
1959
|
<div [style.margin-top]="marginTop()">
|
|
1925
1960
|
@for (node of viewportNodes(); track trackNode(i, node); let i = $index) {
|
|
1926
1961
|
<tree-node [node]="node" [index]="i" [templates]="templates()">
|
|
@@ -1929,7 +1964,7 @@ class TreeNodeCollectionComponent {
|
|
|
1929
1964
|
</div>
|
|
1930
1965
|
`, isInline: true, dependencies: [{ kind: "component", type: i0.forwardRef(() => TreeNodeComponent), selector: "TreeNode, tree-node", inputs: ["node", "index", "templates"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1931
1966
|
}
|
|
1932
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1967
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeCollectionComponent, decorators: [{
|
|
1933
1968
|
type: Component,
|
|
1934
1969
|
args: [{
|
|
1935
1970
|
selector: 'tree-node-collection',
|
|
@@ -1944,7 +1979,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1944
1979
|
`,
|
|
1945
1980
|
imports: [forwardRef((() => TreeNodeComponent))]
|
|
1946
1981
|
}]
|
|
1947
|
-
}] });
|
|
1982
|
+
}], 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
1983
|
class TreeNodeComponent {
|
|
1949
1984
|
constructor() {
|
|
1950
1985
|
this.node = input(undefined, ...(ngDevMode ? [{ debugName: "node" }] : []));
|
|
@@ -1952,8 +1987,8 @@ class TreeNodeComponent {
|
|
|
1952
1987
|
this.templates = input(...(ngDevMode ? [undefined, { debugName: "templates" }] : []));
|
|
1953
1988
|
this.treeNodeFullTemplate = computed(() => this.templates().treeNodeFullTemplate, ...(ngDevMode ? [{ debugName: "treeNodeFullTemplate" }] : []));
|
|
1954
1989
|
}
|
|
1955
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1956
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1990
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1991
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", 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
1992
|
@if (!treeNodeFullTemplate()) {
|
|
1958
1993
|
<div
|
|
1959
1994
|
[class]="node().getClass()"
|
|
@@ -1999,7 +2034,7 @@ class TreeNodeComponent {
|
|
|
1999
2034
|
</ng-container>
|
|
2000
2035
|
`, 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
2036
|
}
|
|
2002
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2037
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeNodeComponent, decorators: [{
|
|
2003
2038
|
type: Component,
|
|
2004
2039
|
args: [{ selector: 'TreeNode, tree-node', encapsulation: ViewEncapsulation.None, template: `
|
|
2005
2040
|
@if (!treeNodeFullTemplate()) {
|
|
@@ -2051,7 +2086,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
2051
2086
|
TreeNodeChildrenComponent,
|
|
2052
2087
|
NgTemplateOutlet
|
|
2053
2088
|
] }]
|
|
2054
|
-
}] });
|
|
2089
|
+
}], 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
2090
|
|
|
2056
2091
|
class TreeComponent {
|
|
2057
2092
|
// Will be handled in ngOnChanges
|
|
@@ -2110,38 +2145,40 @@ class TreeComponent {
|
|
|
2110
2145
|
return obj;
|
|
2111
2146
|
}, {});
|
|
2112
2147
|
}
|
|
2113
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2114
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2148
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2149
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", 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
2150
|
<tree-viewport #viewport>
|
|
2116
2151
|
<div
|
|
2117
2152
|
class="angular-tree-component"
|
|
2118
2153
|
[class.node-dragging]="treeDraggedElement.isDragging()"
|
|
2119
2154
|
[class.angular-tree-component-rtl]="treeModel.options.rtl"
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2155
|
+
>
|
|
2156
|
+
@if (treeModel.roots) {
|
|
2157
|
+
<tree-node-collection
|
|
2158
|
+
[nodes]="treeModel.roots"
|
|
2159
|
+
[treeModel]="treeModel"
|
|
2125
2160
|
[templates]="{
|
|
2126
2161
|
loadingTemplate: loadingTemplate,
|
|
2127
2162
|
treeNodeTemplate: treeNodeTemplate,
|
|
2128
2163
|
treeNodeWrapperTemplate: treeNodeWrapperTemplate,
|
|
2129
2164
|
treeNodeFullTemplate: treeNodeFullTemplate
|
|
2130
2165
|
}"
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2166
|
+
>
|
|
2167
|
+
</tree-node-collection>
|
|
2168
|
+
}
|
|
2169
|
+
@if (treeModel.isEmptyTree()) {
|
|
2170
|
+
<tree-node-drop-slot
|
|
2171
|
+
class="empty-tree-drop-slot"
|
|
2172
|
+
[dropIndex]="0"
|
|
2173
|
+
[node]="treeModel.virtualRoot"
|
|
2174
|
+
>
|
|
2175
|
+
</tree-node-drop-slot>
|
|
2176
|
+
}
|
|
2140
2177
|
</div>
|
|
2141
2178
|
</tree-viewport>
|
|
2142
|
-
|
|
2179
|
+
`, 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
2180
|
}
|
|
2144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeComponent, decorators: [{
|
|
2145
2182
|
type: Component,
|
|
2146
2183
|
args: [{ selector: 'Tree, tree-root', providers: [TreeModel], template: `
|
|
2147
2184
|
<tree-viewport #viewport>
|
|
@@ -2149,31 +2186,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
2149
2186
|
class="angular-tree-component"
|
|
2150
2187
|
[class.node-dragging]="treeDraggedElement.isDragging()"
|
|
2151
2188
|
[class.angular-tree-component-rtl]="treeModel.options.rtl"
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2189
|
+
>
|
|
2190
|
+
@if (treeModel.roots) {
|
|
2191
|
+
<tree-node-collection
|
|
2192
|
+
[nodes]="treeModel.roots"
|
|
2193
|
+
[treeModel]="treeModel"
|
|
2157
2194
|
[templates]="{
|
|
2158
2195
|
loadingTemplate: loadingTemplate,
|
|
2159
2196
|
treeNodeTemplate: treeNodeTemplate,
|
|
2160
2197
|
treeNodeWrapperTemplate: treeNodeWrapperTemplate,
|
|
2161
2198
|
treeNodeFullTemplate: treeNodeFullTemplate
|
|
2162
2199
|
}"
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2200
|
+
>
|
|
2201
|
+
</tree-node-collection>
|
|
2202
|
+
}
|
|
2203
|
+
@if (treeModel.isEmptyTree()) {
|
|
2204
|
+
<tree-node-drop-slot
|
|
2205
|
+
class="empty-tree-drop-slot"
|
|
2206
|
+
[dropIndex]="0"
|
|
2207
|
+
[node]="treeModel.virtualRoot"
|
|
2208
|
+
>
|
|
2209
|
+
</tree-node-drop-slot>
|
|
2210
|
+
}
|
|
2172
2211
|
</div>
|
|
2173
2212
|
</tree-viewport>
|
|
2174
|
-
|
|
2213
|
+
`, imports: [
|
|
2175
2214
|
TreeViewportComponent,
|
|
2176
|
-
NgIf,
|
|
2177
2215
|
TreeNodeCollectionComponent,
|
|
2178
2216
|
TreeNodeDropSlot
|
|
2179
2217
|
] }]
|
|
@@ -2243,8 +2281,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
2243
2281
|
}] } });
|
|
2244
2282
|
|
|
2245
2283
|
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: "
|
|
2284
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2285
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.0", ngImport: i0, type: TreeModule, imports: [CommonModule, TreeComponent,
|
|
2248
2286
|
TreeNodeComponent,
|
|
2249
2287
|
TreeNodeContent,
|
|
2250
2288
|
LoadingComponent,
|
|
@@ -2271,9 +2309,9 @@ class TreeModule {
|
|
|
2271
2309
|
TreeNodeWrapperComponent,
|
|
2272
2310
|
TreeNodeCheckboxComponent,
|
|
2273
2311
|
TreeAnimateOpenDirective] }); }
|
|
2274
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2312
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeModule, imports: [CommonModule] }); }
|
|
2275
2313
|
}
|
|
2276
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2314
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TreeModule, decorators: [{
|
|
2277
2315
|
type: NgModule,
|
|
2278
2316
|
args: [{
|
|
2279
2317
|
declarations: [],
|