@cluetec/ngcx-tree 0.1.0-angular-15

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.
@@ -0,0 +1,410 @@
1
+ import * as i2 from '@angular/cdk/drag-drop';
2
+ import { DragDropModule } from '@angular/cdk/drag-drop';
3
+ import * as i1 from '@angular/cdk/tree';
4
+ import { CdkTreeModule, NestedTreeControl } from '@angular/cdk/tree';
5
+ import { NgTemplateOutlet, NgIf } from '@angular/common';
6
+ import * as i0 from '@angular/core';
7
+ import { EventEmitter, ViewContainerRef, Component, Input, Output, ViewChild, HostListener } from '@angular/core';
8
+ import { DataSource } from '@angular/cdk/collections';
9
+ import { BehaviorSubject, Subject, takeUntil } from 'rxjs';
10
+
11
+ class NgcxTreeDataSource extends DataSource {
12
+ constructor(data) {
13
+ super();
14
+ this.data$ = new BehaviorSubject(data);
15
+ }
16
+ connect() {
17
+ return this.data$.asObservable();
18
+ }
19
+ disconnect() { }
20
+ update(data) {
21
+ this.data$.next([...data]);
22
+ }
23
+ }
24
+
25
+ class NgcxTreeNodeComponent {
26
+ constructor() {
27
+ this.isSelected = false;
28
+ this.customEvent = new EventEmitter();
29
+ this.clickEvent = new EventEmitter();
30
+ this.ngUnsubscribe = new Subject();
31
+ }
32
+ ngOnInit() {
33
+ var _a, _b;
34
+ if (this.vcRef && ((_a = this.treeConfig) === null || _a === void 0 ? void 0 : _a.treeNodeContentComponent)) {
35
+ const nodeComponent = this.vcRef.createComponent(this.treeConfig.treeNodeContentComponent);
36
+ nodeComponent.instance.nodeWrapper = this.nodeWrapper;
37
+ (_b = nodeComponent.instance.customEvent) === null || _b === void 0 ? void 0 : _b.pipe(takeUntil(this.ngUnsubscribe)).subscribe((value) => this.customEvent.emit(value));
38
+ }
39
+ }
40
+ ngOnDestroy() {
41
+ this.ngUnsubscribe.next(undefined);
42
+ this.ngUnsubscribe.complete();
43
+ }
44
+ }
45
+ NgcxTreeNodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgcxTreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
46
+ NgcxTreeNodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: NgcxTreeNodeComponent, isStandalone: true, selector: "ngcx-tree-node", inputs: { nodeWrapper: "nodeWrapper", treeControl: "treeControl", treeConfig: "treeConfig", isSelected: "isSelected" }, outputs: { customEvent: "customEvent", clickEvent: "clickEvent" }, viewQueries: [{ propertyName: "vcRef", first: true, predicate: ["ref"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n class=\"tree-node-content-container\"\n [class.selected]=\"isSelected\"\n [class.first]=\"nodeWrapper.isFirstChild\"\n [class.last]=\"nodeWrapper.isLastChild\"\n [class.is-selectable]=\"nodeWrapper.isSelectable\"\n (click)=\"clickEvent.emit()\">\n <div class=\"tree-node-expand-container\">\n <button\n *ngIf=\"nodeWrapper.children.length > 0\"\n class=\"tree-node-expand\"\n cdkTreeNodeToggle\n [attr.aria-label]=\"'Toggle ' + nodeWrapper.data.title\"\n (click)=\"$event.preventDefault()\">\n <div class=\"chevron\" [class.rotate]=\"treeControl.isExpanded(nodeWrapper)\">\n <svg id=\"a\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 9\">\n <path\n d=\"m2.83.09l4.2,4.2c.05.05.09.14.09.21s-.04.15-.09.21l-4.2,4.2c-.05.05-.14.09-.21.09s-.15-.04-.21-.09l-.45-.45c-.05-.05-.09-.13-.09-.21,0-.07.04-.15.09-.21l3.54-3.54L1.97.96c-.05-.05-.09-.14-.09-.21s.04-.15.09-.21l.45-.45c.05-.05.14-.09.21-.09s.15.04.21.09Z\"\n style=\"fill: var(--icon-color, #333); stroke-width: 0px\" />\n </svg>\n </div>\n </button>\n </div>\n <div class=\"small-horizontal-tree-line\"></div>\n <div class=\"tree-node-icon-container\" *ngIf=\"nodeWrapper.data.faIcon\">\n <i class=\"fa\" [class]=\"nodeWrapper.data.faIcon\"></i>\n </div>\n <div class=\"tree-node-content\">\n <span\n *ngIf=\"\n !treeConfig?.treeNodeContentComponent &&\n !treeConfig?.treeNodeContentTemplate\n \">\n {{ nodeWrapper.data.title }}\n </span>\n <ng-container #ref></ng-container>\n <ng-container *ngIf=\"treeConfig?.treeNodeContentTemplate as template\">\n <ng-container\n *ngTemplateOutlet=\"\n template;\n context: {\n nodeWrapper: nodeWrapper\n }\n \"></ng-container>\n </ng-container>\n </div>\n</div>\n", styles: [".tree-node-content-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;width:100%}.tree-node-content-container.is-selectable{cursor:pointer}.tree-node-content-container .tree-node-expand-container{display:flex;flex-direction:row;justify-content:center;align-items:center;width:30px;height:30px;margin-right:5px}.tree-node-content-container .tree-node-expand-container>.tree-node-expand{color:#2587be;background:none;border:none;font:inherit;cursor:pointer;outline:inherit;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.tree-node-content-container .tree-node-expand-container>.tree-node-expand .chevron{width:10px;transition:transform .1s ease-in-out}.tree-node-content-container .tree-node-expand-container>.tree-node-expand .chevron.rotate{transform:rotate(90deg)}.tree-node-content-container .tree-node-icon-container{margin-right:7px;color:#2587be}\n"], dependencies: [{ kind: "ngmodule", type: CdkTreeModule }, { kind: "directive", type: i1.CdkTreeNodeToggle, selector: "[cdkTreeNodeToggle]", inputs: ["cdkTreeNodeToggleRecursive"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgcxTreeNodeComponent, decorators: [{
48
+ type: Component,
49
+ args: [{ selector: 'ngcx-tree-node', standalone: true, imports: [CdkTreeModule, NgTemplateOutlet, NgIf], template: "<div\n class=\"tree-node-content-container\"\n [class.selected]=\"isSelected\"\n [class.first]=\"nodeWrapper.isFirstChild\"\n [class.last]=\"nodeWrapper.isLastChild\"\n [class.is-selectable]=\"nodeWrapper.isSelectable\"\n (click)=\"clickEvent.emit()\">\n <div class=\"tree-node-expand-container\">\n <button\n *ngIf=\"nodeWrapper.children.length > 0\"\n class=\"tree-node-expand\"\n cdkTreeNodeToggle\n [attr.aria-label]=\"'Toggle ' + nodeWrapper.data.title\"\n (click)=\"$event.preventDefault()\">\n <div class=\"chevron\" [class.rotate]=\"treeControl.isExpanded(nodeWrapper)\">\n <svg id=\"a\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 9\">\n <path\n d=\"m2.83.09l4.2,4.2c.05.05.09.14.09.21s-.04.15-.09.21l-4.2,4.2c-.05.05-.14.09-.21.09s-.15-.04-.21-.09l-.45-.45c-.05-.05-.09-.13-.09-.21,0-.07.04-.15.09-.21l3.54-3.54L1.97.96c-.05-.05-.09-.14-.09-.21s.04-.15.09-.21l.45-.45c.05-.05.14-.09.21-.09s.15.04.21.09Z\"\n style=\"fill: var(--icon-color, #333); stroke-width: 0px\" />\n </svg>\n </div>\n </button>\n </div>\n <div class=\"small-horizontal-tree-line\"></div>\n <div class=\"tree-node-icon-container\" *ngIf=\"nodeWrapper.data.faIcon\">\n <i class=\"fa\" [class]=\"nodeWrapper.data.faIcon\"></i>\n </div>\n <div class=\"tree-node-content\">\n <span\n *ngIf=\"\n !treeConfig?.treeNodeContentComponent &&\n !treeConfig?.treeNodeContentTemplate\n \">\n {{ nodeWrapper.data.title }}\n </span>\n <ng-container #ref></ng-container>\n <ng-container *ngIf=\"treeConfig?.treeNodeContentTemplate as template\">\n <ng-container\n *ngTemplateOutlet=\"\n template;\n context: {\n nodeWrapper: nodeWrapper\n }\n \"></ng-container>\n </ng-container>\n </div>\n</div>\n", styles: [".tree-node-content-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;width:100%}.tree-node-content-container.is-selectable{cursor:pointer}.tree-node-content-container .tree-node-expand-container{display:flex;flex-direction:row;justify-content:center;align-items:center;width:30px;height:30px;margin-right:5px}.tree-node-content-container .tree-node-expand-container>.tree-node-expand{color:#2587be;background:none;border:none;font:inherit;cursor:pointer;outline:inherit;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.tree-node-content-container .tree-node-expand-container>.tree-node-expand .chevron{width:10px;transition:transform .1s ease-in-out}.tree-node-content-container .tree-node-expand-container>.tree-node-expand .chevron.rotate{transform:rotate(90deg)}.tree-node-content-container .tree-node-icon-container{margin-right:7px;color:#2587be}\n"] }]
50
+ }], propDecorators: { nodeWrapper: [{
51
+ type: Input
52
+ }], treeControl: [{
53
+ type: Input
54
+ }], treeConfig: [{
55
+ type: Input
56
+ }], isSelected: [{
57
+ type: Input
58
+ }], customEvent: [{
59
+ type: Output
60
+ }], clickEvent: [{
61
+ type: Output
62
+ }], vcRef: [{
63
+ type: ViewChild,
64
+ args: ['ref', { read: ViewContainerRef, static: true }]
65
+ }] } });
66
+
67
+ const isParentOf = (parent, node) => {
68
+ if (!node.parent) {
69
+ return false;
70
+ }
71
+ if (parent.id === node.parent.id) {
72
+ return true;
73
+ }
74
+ return isParentOf(parent, node.parent);
75
+ };
76
+
77
+ class NgcxTreeComponent {
78
+ constructor() {
79
+ this.nodeMoved = new EventEmitter();
80
+ this.customEvent = new EventEmitter();
81
+ this.clickEvent = new EventEmitter();
82
+ this.selectEvent = new EventEmitter();
83
+ this.api = new NgcxTreeControl(this);
84
+ this.dataSource = new NgcxTreeDataSource([]);
85
+ this.treeControl = new NestedTreeControl((node) => node.children, {
86
+ trackBy: (node) => node.id,
87
+ });
88
+ this.DropType = DropType;
89
+ this.disable = () => false;
90
+ this.hasChild = (_, node) => node.children.length > 0;
91
+ }
92
+ ngOnInit() {
93
+ this.updateTree();
94
+ }
95
+ ngOnChanges(changes) {
96
+ if (changes['nodes']) {
97
+ if (this.treeControl) {
98
+ // initialized already
99
+ this.updateTree();
100
+ }
101
+ if (this.selectedNode) {
102
+ const selectedNodeId = this.selectedNode.id;
103
+ setTimeout(() => this.api.selectNodeById(selectedNodeId));
104
+ }
105
+ }
106
+ }
107
+ updateTree() {
108
+ var _a;
109
+ const wrapperNodes = this.createWrapperNodes((_a = this.nodes) !== null && _a !== void 0 ? _a : []);
110
+ this.dataSource = new NgcxTreeDataSource(wrapperNodes);
111
+ this.treeControl.dataNodes = this.dataSource.data$.value;
112
+ }
113
+ createWrapperNodes(nodes, parent, depth = 0) {
114
+ const childCount = nodes.length;
115
+ const wrapperNodes = nodes.map((node, idx) => {
116
+ const nodeWrapper = {
117
+ id: node.id,
118
+ data: node,
119
+ isFirstChild: idx === 0,
120
+ isLastChild: idx === childCount - 1,
121
+ index: idx,
122
+ parent: parent,
123
+ depth: depth,
124
+ children: [],
125
+ };
126
+ nodeWrapper.children = node.children
127
+ ? this.createWrapperNodes(node.children, nodeWrapper, depth + 1)
128
+ : [];
129
+ return nodeWrapper;
130
+ });
131
+ wrapperNodes.forEach((wrapperNode) => {
132
+ var _a, _b;
133
+ if (!wrapperNode.isLastChild) {
134
+ wrapperNode.next = wrapperNodes[wrapperNode.index + 1];
135
+ }
136
+ if (!wrapperNode.isFirstChild) {
137
+ wrapperNode.previous = wrapperNodes[wrapperNode.index - 1];
138
+ }
139
+ if ((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.allowSelection) === null || _b === void 0 ? void 0 : _b.call(_a, wrapperNode)) {
140
+ wrapperNode.isSelectable = true;
141
+ }
142
+ });
143
+ return wrapperNodes;
144
+ }
145
+ allowDrop(dropNode, dropType) {
146
+ var _a, _b, _c, _d;
147
+ if (!this.dragging ||
148
+ this.dragging.id === dropNode.id ||
149
+ isParentOf(this.dragging, dropNode)) {
150
+ return false;
151
+ }
152
+ if (dropType == DropType.DROP_INTO &&
153
+ dropNode.id === ((_a = this.dragging.parent) === null || _a === void 0 ? void 0 : _a.id)) {
154
+ return false;
155
+ }
156
+ if (dropType == DropType.DROP_AFTER &&
157
+ ((_b = dropNode.next) === null || _b === void 0 ? void 0 : _b.id) === this.dragging.id) {
158
+ return false;
159
+ }
160
+ if (dropType == DropType.DROP_BEFORE &&
161
+ ((_c = dropNode.previous) === null || _c === void 0 ? void 0 : _c.id) === this.dragging.id) {
162
+ return false;
163
+ }
164
+ const intoNode = dropType == DropType.DROP_INTO ? dropNode : dropNode.parent;
165
+ if ((_d = this.config) === null || _d === void 0 ? void 0 : _d.allowDrop) {
166
+ return this.config.allowDrop(this.dragging, intoNode);
167
+ }
168
+ return true;
169
+ }
170
+ // prevent drop directly after a node on same level, that is expanded
171
+ sortPredicate() {
172
+ return (index, _drag, drop) => {
173
+ return index == 0 || !this.treeControl.isExpanded(drop.data);
174
+ };
175
+ }
176
+ disableDrag(node) {
177
+ var _a;
178
+ return ((_a = this.config) === null || _a === void 0 ? void 0 : _a.allowDrag) ? !this.config.allowDrag(node) : false;
179
+ }
180
+ keyDownArrowUp(event) {
181
+ console.log('arrow up');
182
+ if (this.selectedNode) {
183
+ if (!this.selectedNode.isFirstChild) {
184
+ this.selectNode(this.selectedNode.previous);
185
+ }
186
+ else if (this.selectedNode.parent) {
187
+ this.selectNode(this.selectedNode.parent);
188
+ }
189
+ }
190
+ else {
191
+ const nodes = this.dataSource.data$.value;
192
+ if (nodes.length > 0) {
193
+ this.selectNode(nodes[nodes.length - 1]);
194
+ }
195
+ }
196
+ event.preventDefault();
197
+ }
198
+ keyDownArrowDown(event) {
199
+ var _a;
200
+ if (this.selectedNode) {
201
+ if (!this.selectedNode.isLastChild) {
202
+ this.selectNode(this.selectedNode.next);
203
+ }
204
+ else if ((_a = this.selectedNode.parent) === null || _a === void 0 ? void 0 : _a.next) {
205
+ this.selectNode(this.selectedNode.parent.next);
206
+ }
207
+ }
208
+ else {
209
+ const nodes = this.dataSource.data$.value;
210
+ if (nodes.length > 0) {
211
+ this.selectNode(nodes[0]);
212
+ }
213
+ }
214
+ event.preventDefault();
215
+ }
216
+ keyDownArrowLeft(event) {
217
+ var _a;
218
+ if ((_a = this.selectedNode) === null || _a === void 0 ? void 0 : _a.parent) {
219
+ this.selectNode(this.selectedNode.parent);
220
+ }
221
+ else if (!this.selectedNode) {
222
+ const nodes = this.dataSource.data$.value;
223
+ if (nodes.length > 0) {
224
+ this.selectNode(nodes[0]);
225
+ }
226
+ }
227
+ event.preventDefault();
228
+ }
229
+ keyDownArrowRight(event) {
230
+ if (this.selectedNode && this.selectedNode.children.length > 0) {
231
+ this.selectNode(this.selectedNode.children[0]);
232
+ }
233
+ else if (!this.selectedNode) {
234
+ const nodes = this.dataSource.data$.value;
235
+ if (nodes.length > 0) {
236
+ this.selectNode(nodes[0]);
237
+ }
238
+ }
239
+ event.preventDefault();
240
+ }
241
+ keyEscapeWhileDragging() {
242
+ if (this.dragging) {
243
+ this.canceledByEsq = true;
244
+ document.dispatchEvent(new Event('mouseup'));
245
+ }
246
+ }
247
+ handleDragRelease(event) {
248
+ var _a, _b, _c;
249
+ this.dragging = undefined;
250
+ const movedNode = event.source.data;
251
+ const dropZoneId = event.event.target.id;
252
+ if (!dropZoneId) {
253
+ // no valid drop zone
254
+ return;
255
+ }
256
+ const dropZoneInfo = new DropZoneInfo(dropZoneId);
257
+ const toNode = this.api.findNodeById(dropZoneInfo.nodeId);
258
+ if (!toNode) {
259
+ console.error(`node with id '${dropZoneInfo.nodeId}' could not be found`);
260
+ return;
261
+ }
262
+ // dropType undefined can happen if dropped directly without moving
263
+ if (this.canceledByEsq || dropZoneInfo.dropType === undefined) {
264
+ this.canceledByEsq = false;
265
+ return;
266
+ }
267
+ const insertIntoNode = dropZoneInfo.dropType === DropType.DROP_INTO ? toNode : toNode.parent;
268
+ const wrapperList = (_a = insertIntoNode === null || insertIntoNode === void 0 ? void 0 : insertIntoNode.children) !== null && _a !== void 0 ? _a : this.dataSource.data$.value;
269
+ const addAtNodeIdx = this.findAddIndex(dropZoneInfo, insertIntoNode, wrapperList);
270
+ const removedFromIdx = this.removeElementFromPreviousPosition(movedNode);
271
+ // add element to new Position, subtract one if inserted in same list after the remove position
272
+ ((_b = insertIntoNode === null || insertIntoNode === void 0 ? void 0 : insertIntoNode.data.children) !== null && _b !== void 0 ? _b : this.nodes).splice(((_c = movedNode.parent) === null || _c === void 0 ? void 0 : _c.id) === (insertIntoNode === null || insertIntoNode === void 0 ? void 0 : insertIntoNode.id) &&
273
+ removedFromIdx < addAtNodeIdx
274
+ ? addAtNodeIdx - 1
275
+ : addAtNodeIdx, 0, movedNode.data);
276
+ const afterNodeIdx = addAtNodeIdx - 1;
277
+ const afterNode = afterNodeIdx > -1 && wrapperList.length > afterNodeIdx
278
+ ? wrapperList[afterNodeIdx]
279
+ : undefined;
280
+ const beforeNode = addAtNodeIdx > -1 && wrapperList.length > addAtNodeIdx
281
+ ? wrapperList[addAtNodeIdx]
282
+ : undefined;
283
+ this.nodeMoved.emit({
284
+ node: movedNode,
285
+ parent: dropZoneInfo.dropType === DropType.DROP_INTO ? toNode : toNode.parent,
286
+ afterNode: afterNode,
287
+ beforeNode: beforeNode,
288
+ });
289
+ this.dataSource = new NgcxTreeDataSource(this.createWrapperNodes(this.nodes));
290
+ this.treeControl.dataNodes = this.dataSource.data$.value;
291
+ }
292
+ findAddIndex(dropZoneInfo, insertIntoNode, insertIntoList) {
293
+ if (insertIntoNode &&
294
+ dropZoneInfo.dropType === DropType.DROP_INTO &&
295
+ !insertIntoNode.data.children) {
296
+ insertIntoNode.data.children = [];
297
+ }
298
+ let addAtNodeIdx = 0;
299
+ if (dropZoneInfo.dropType === DropType.DROP_AFTER ||
300
+ dropZoneInfo.dropType === DropType.DROP_BEFORE) {
301
+ addAtNodeIdx = insertIntoList.findIndex((child) => child.id === dropZoneInfo.nodeId);
302
+ if (dropZoneInfo.dropType === DropType.DROP_AFTER) {
303
+ addAtNodeIdx++;
304
+ }
305
+ }
306
+ return addAtNodeIdx;
307
+ }
308
+ removeElementFromPreviousPosition(movedNode) {
309
+ var _a, _b;
310
+ const removeFromList = (_b = (_a = movedNode.parent) === null || _a === void 0 ? void 0 : _a.data.children) !== null && _b !== void 0 ? _b : this.nodes;
311
+ const removeIndex = removeFromList.findIndex((child) => child.id === movedNode.id);
312
+ removeFromList.splice(removeIndex, 1);
313
+ return removeIndex;
314
+ }
315
+ nodeClicked(nodeWrapper) {
316
+ var _a;
317
+ this.clickEvent.emit(nodeWrapper);
318
+ if (nodeWrapper.isSelectable) {
319
+ this.selectedNode =
320
+ nodeWrapper.id === ((_a = this.selectedNode) === null || _a === void 0 ? void 0 : _a.id) ? undefined : nodeWrapper;
321
+ this.selectEvent.emit(this.selectedNode);
322
+ }
323
+ }
324
+ selectNode(nodeWrapper) {
325
+ var _a;
326
+ if (!nodeWrapper || nodeWrapper.isSelectable) {
327
+ this.selectedNode = nodeWrapper;
328
+ let expandNode = (_a = this.selectedNode) === null || _a === void 0 ? void 0 : _a.parent;
329
+ while (expandNode) {
330
+ this.treeControl.expand(expandNode);
331
+ expandNode = expandNode.parent;
332
+ }
333
+ this.selectEvent.emit(this.selectedNode);
334
+ }
335
+ }
336
+ }
337
+ NgcxTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgcxTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
338
+ NgcxTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: NgcxTreeComponent, isStandalone: true, selector: "ngcx-tree", inputs: { nodes: "nodes", config: "config" }, outputs: { nodeMoved: "nodeMoved", customEvent: "customEvent", clickEvent: "clickEvent", selectEvent: "selectEvent" }, host: { listeners: { "window:keydown.escape": "keyEscapeWhileDragging()" } }, usesOnChanges: true, ngImport: i0, template: "<cdk-tree\n #tree\n class=\"ngcx-tree\"\n *ngIf=\"dataSource\"\n [dataSource]=\"dataSource\"\n [treeControl]=\"treeControl\"\n cdkDropListGroup\n [class.dragging]=\"dragging\"\n (keyup.arrowup)=\"keyDownArrowUp($event)\"\n (keydown.arrowdown)=\"keyDownArrowDown($event)\"\n (keydown.arrowleft)=\"keyDownArrowLeft($event)\"\n (keydown.arrowright)=\"keyDownArrowRight($event)\"\n tabindex=\"0\">\n <cdk-nested-tree-node *cdkTreeNodeDef=\"let node\" class=\"tree-node\">\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_AFTER\"\n class=\"tree-node-container-drop-zone after-expanded-node\"\n [class.hide]=\"\n !dragging ||\n !allowDrop(node, DropType.DROP_AFTER) ||\n !treeControl.isExpanded(node)\n \">\n <div class=\"drop-insert-line\"></div>\n </div>\n <div class=\"tree-node-container\">\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_BEFORE\"\n class=\"tree-node-container-drop-zone before-node\"\n [class.hide]=\"\n !dragging ||\n !node.isFirstChild ||\n !allowDrop(node, DropType.DROP_BEFORE)\n \">\n <div class=\"drop-insert-line\"></div>\n </div>\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_INTO\"\n class=\"tree-node-container-drop-zone into-node\"\n [class.hide]=\"!dragging || !allowDrop(node, DropType.DROP_INTO)\"></div>\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_AFTER\"\n class=\"tree-node-container-drop-zone after-node\"\n [class.last]=\"node.isLastChild\"\n [class.hide]=\"\n !dragging ||\n treeControl.isExpanded(node) ||\n !allowDrop(node, DropType.DROP_AFTER)\n \">\n <div class=\"drop-insert-line\"></div>\n </div>\n <div\n cdkDropList\n [cdkDropListData]=\"node\"\n [cdkDropListEnterPredicate]=\"disable\"\n [cdkDropListSortPredicate]=\"disable\">\n <div\n cdkDrag\n [cdkDragDisabled]=\"disableDrag(node)\"\n [cdkDragData]=\"node\"\n (cdkDragStarted)=\"dragging = node\"\n (cdkDragReleased)=\"handleDragRelease($event)\">\n <div *cdkDragPlaceholder></div>\n <div\n class=\"tree-node-content-container\"\n [class.first]=\"node.isFirstChild\"\n [class.last]=\"node.isLastChild\"\n [class.expanded]=\"treeControl.isExpanded(node)\">\n <ngcx-tree-node\n style=\"width: 100%\"\n [nodeWrapper]=\"node\"\n [isSelected]=\"node.id === selectedNode?.id\"\n [treeControl]=\"treeControl\"\n [treeConfig]=\"config\"\n (customEvent)=\"customEvent.emit($event)\"\n (clickEvent)=\"nodeClicked(node)\"></ngcx-tree-node>\n </div>\n </div>\n <ngcx-tree-node\n *ngIf=\"node.id === dragging?.id\"\n [nodeWrapper]=\"node\"\n [treeControl]=\"treeControl\"\n [treeConfig]=\"config\"></ngcx-tree-node>\n </div>\n </div>\n <div\n *ngIf=\"treeControl.isExpanded(node)\"\n class=\"tree-node-children-container\"\n [class.first]=\"node.isFirstChild\"\n [class.last]=\"node.isLastChild\">\n <div cdkTreeNodeOutlet></div>\n </div>\n </cdk-nested-tree-node>\n</cdk-tree>\n", styles: [".ngcx-tree{height:auto}.ngcx-tree ul,.ngcx-tree li{margin-top:0;margin-bottom:0;list-style-type:none}.tree-node{display:flex;flex-direction:column;position:relative}.tree-node .tree-node{margin-left:20px}.tree-node-container{width:100%;min-height:30px;display:flex;flex-direction:row;justify-content:flex-start;align-items:center;position:relative;cursor:default}.tree-node-container .tree-node-content-container{width:100%}.tree-node-container .cdk-drag{width:100%;display:flex;flex-direction:row;justify-content:flex-start;align-items:center}.tree-node-container-drop-zone{height:100%;left:25px;right:5px;position:absolute;z-index:1;display:flex;justify-content:center;flex-direction:column}.tree-node-container-drop-zone:hover.into-node{border:1.5px dashed rgba(0,0,0,.5)}.tree-node-container-drop-zone:hover .drop-insert-line{border-top:1.5px dashed rgba(0,0,0,.5)}.tree-node-container-drop-zone.hide{height:0!important}.tree-node-container-drop-zone.hide .drop-insert-line{border-top:solid transparent 0px!important}.tree-node-container-drop-zone.before-node{height:20px;z-index:2;top:-10px}.tree-node-container-drop-zone.after-node{height:20px;z-index:3;top:calc(100% - 10px)}.tree-node-container-drop-zone.after-node.last{height:10px}.tree-node-container-drop-zone.after-expanded-node{position:absolute;height:20px;z-index:3;bottom:-10px;display:flex;justify-content:center;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: CdkTreeModule }, { kind: "directive", type: i1.CdkNestedTreeNode, selector: "cdk-nested-tree-node", inputs: ["role", "disabled", "tabIndex"], exportAs: ["cdkNestedTreeNode"] }, { kind: "directive", type: i1.CdkTreeNodeDef, selector: "[cdkTreeNodeDef]", inputs: ["cdkTreeNodeDefWhen"] }, { kind: "component", type: i1.CdkTree, selector: "cdk-tree", inputs: ["dataSource", "treeControl", "trackBy"], exportAs: ["cdkTree"] }, { kind: "directive", type: i1.CdkTreeNodeOutlet, selector: "[cdkTreeNodeOutlet]" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDropListGroup, selector: "[cdkDropListGroup]", inputs: ["cdkDropListGroupDisabled"], exportAs: ["cdkDropListGroup"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "component", type: NgcxTreeNodeComponent, selector: "ngcx-tree-node", inputs: ["nodeWrapper", "treeControl", "treeConfig", "isSelected"], outputs: ["customEvent", "clickEvent"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgcxTreeComponent, decorators: [{
340
+ type: Component,
341
+ args: [{ selector: 'ngcx-tree', standalone: true, imports: [CdkTreeModule, DragDropModule, NgcxTreeNodeComponent, NgIf], template: "<cdk-tree\n #tree\n class=\"ngcx-tree\"\n *ngIf=\"dataSource\"\n [dataSource]=\"dataSource\"\n [treeControl]=\"treeControl\"\n cdkDropListGroup\n [class.dragging]=\"dragging\"\n (keyup.arrowup)=\"keyDownArrowUp($event)\"\n (keydown.arrowdown)=\"keyDownArrowDown($event)\"\n (keydown.arrowleft)=\"keyDownArrowLeft($event)\"\n (keydown.arrowright)=\"keyDownArrowRight($event)\"\n tabindex=\"0\">\n <cdk-nested-tree-node *cdkTreeNodeDef=\"let node\" class=\"tree-node\">\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_AFTER\"\n class=\"tree-node-container-drop-zone after-expanded-node\"\n [class.hide]=\"\n !dragging ||\n !allowDrop(node, DropType.DROP_AFTER) ||\n !treeControl.isExpanded(node)\n \">\n <div class=\"drop-insert-line\"></div>\n </div>\n <div class=\"tree-node-container\">\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_BEFORE\"\n class=\"tree-node-container-drop-zone before-node\"\n [class.hide]=\"\n !dragging ||\n !node.isFirstChild ||\n !allowDrop(node, DropType.DROP_BEFORE)\n \">\n <div class=\"drop-insert-line\"></div>\n </div>\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_INTO\"\n class=\"tree-node-container-drop-zone into-node\"\n [class.hide]=\"!dragging || !allowDrop(node, DropType.DROP_INTO)\"></div>\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_AFTER\"\n class=\"tree-node-container-drop-zone after-node\"\n [class.last]=\"node.isLastChild\"\n [class.hide]=\"\n !dragging ||\n treeControl.isExpanded(node) ||\n !allowDrop(node, DropType.DROP_AFTER)\n \">\n <div class=\"drop-insert-line\"></div>\n </div>\n <div\n cdkDropList\n [cdkDropListData]=\"node\"\n [cdkDropListEnterPredicate]=\"disable\"\n [cdkDropListSortPredicate]=\"disable\">\n <div\n cdkDrag\n [cdkDragDisabled]=\"disableDrag(node)\"\n [cdkDragData]=\"node\"\n (cdkDragStarted)=\"dragging = node\"\n (cdkDragReleased)=\"handleDragRelease($event)\">\n <div *cdkDragPlaceholder></div>\n <div\n class=\"tree-node-content-container\"\n [class.first]=\"node.isFirstChild\"\n [class.last]=\"node.isLastChild\"\n [class.expanded]=\"treeControl.isExpanded(node)\">\n <ngcx-tree-node\n style=\"width: 100%\"\n [nodeWrapper]=\"node\"\n [isSelected]=\"node.id === selectedNode?.id\"\n [treeControl]=\"treeControl\"\n [treeConfig]=\"config\"\n (customEvent)=\"customEvent.emit($event)\"\n (clickEvent)=\"nodeClicked(node)\"></ngcx-tree-node>\n </div>\n </div>\n <ngcx-tree-node\n *ngIf=\"node.id === dragging?.id\"\n [nodeWrapper]=\"node\"\n [treeControl]=\"treeControl\"\n [treeConfig]=\"config\"></ngcx-tree-node>\n </div>\n </div>\n <div\n *ngIf=\"treeControl.isExpanded(node)\"\n class=\"tree-node-children-container\"\n [class.first]=\"node.isFirstChild\"\n [class.last]=\"node.isLastChild\">\n <div cdkTreeNodeOutlet></div>\n </div>\n </cdk-nested-tree-node>\n</cdk-tree>\n", styles: [".ngcx-tree{height:auto}.ngcx-tree ul,.ngcx-tree li{margin-top:0;margin-bottom:0;list-style-type:none}.tree-node{display:flex;flex-direction:column;position:relative}.tree-node .tree-node{margin-left:20px}.tree-node-container{width:100%;min-height:30px;display:flex;flex-direction:row;justify-content:flex-start;align-items:center;position:relative;cursor:default}.tree-node-container .tree-node-content-container{width:100%}.tree-node-container .cdk-drag{width:100%;display:flex;flex-direction:row;justify-content:flex-start;align-items:center}.tree-node-container-drop-zone{height:100%;left:25px;right:5px;position:absolute;z-index:1;display:flex;justify-content:center;flex-direction:column}.tree-node-container-drop-zone:hover.into-node{border:1.5px dashed rgba(0,0,0,.5)}.tree-node-container-drop-zone:hover .drop-insert-line{border-top:1.5px dashed rgba(0,0,0,.5)}.tree-node-container-drop-zone.hide{height:0!important}.tree-node-container-drop-zone.hide .drop-insert-line{border-top:solid transparent 0px!important}.tree-node-container-drop-zone.before-node{height:20px;z-index:2;top:-10px}.tree-node-container-drop-zone.after-node{height:20px;z-index:3;top:calc(100% - 10px)}.tree-node-container-drop-zone.after-node.last{height:10px}.tree-node-container-drop-zone.after-expanded-node{position:absolute;height:20px;z-index:3;bottom:-10px;display:flex;justify-content:center;flex-direction:column}\n"] }]
342
+ }], propDecorators: { nodes: [{
343
+ type: Input
344
+ }], config: [{
345
+ type: Input
346
+ }], nodeMoved: [{
347
+ type: Output
348
+ }], customEvent: [{
349
+ type: Output
350
+ }], clickEvent: [{
351
+ type: Output
352
+ }], selectEvent: [{
353
+ type: Output
354
+ }], keyEscapeWhileDragging: [{
355
+ type: HostListener,
356
+ args: ['window:keydown.escape']
357
+ }] } });
358
+ var DropType;
359
+ (function (DropType) {
360
+ DropType["DROP_AFTER"] = "DROP_AFTER";
361
+ DropType["DROP_BEFORE"] = "DROP_BEFORE";
362
+ DropType["DROP_INTO"] = "DROP_INTO";
363
+ })(DropType || (DropType = {}));
364
+ class NgcxTreeControl {
365
+ constructor(treeComponent) {
366
+ this.treeComponent = treeComponent;
367
+ }
368
+ get treeControl() {
369
+ return this.treeComponent.treeControl;
370
+ }
371
+ selectNodeById(id) {
372
+ this.treeComponent.selectNode(this.findNodeById(id));
373
+ }
374
+ findNodeById(id) {
375
+ return this.findNodeByIdInNodes(this.treeComponent.dataSource.data$.value, id);
376
+ }
377
+ findNodeByIdInNodes(nodes, id) {
378
+ var _a;
379
+ for (const node of nodes) {
380
+ if (node.id === id) {
381
+ return node;
382
+ }
383
+ if (((_a = node.children) === null || _a === void 0 ? void 0 : _a.length) > 0) {
384
+ const foundNode = this.findNodeByIdInNodes(node.children, id);
385
+ if (foundNode) {
386
+ return foundNode;
387
+ }
388
+ }
389
+ }
390
+ return undefined;
391
+ }
392
+ }
393
+ class DropZoneInfo {
394
+ constructor(id) {
395
+ const pos = id.indexOf('_');
396
+ this.nodeId = id.substring(0, pos);
397
+ this.dropType = id.substring(pos + 1);
398
+ }
399
+ }
400
+
401
+ /*
402
+ * Public API Surface of ngcx-tree
403
+ */
404
+
405
+ /**
406
+ * Generated bundle index. Do not edit.
407
+ */
408
+
409
+ export { NgcxTreeComponent, NgcxTreeControl };
410
+ //# sourceMappingURL=cluetec-ngcx-tree.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cluetec-ngcx-tree.mjs","sources":["../../../projects/ngcx-tree/src/lib/ngcx-tree/ngcx-tree-data.source.ts","../../../projects/ngcx-tree/src/lib/ngcx-tree/ngcx-tree-node/ngcx-tree-node.component.ts","../../../projects/ngcx-tree/src/lib/ngcx-tree/ngcx-tree-node/ngcx-tree-node.component.html","../../../projects/ngcx-tree/src/lib/ngcx-tree/ngcx-tree-utils.ts","../../../projects/ngcx-tree/src/lib/ngcx-tree/ngcx-tree.component.ts","../../../projects/ngcx-tree/src/lib/ngcx-tree/ngcx-tree.component.html","../../../projects/ngcx-tree/src/public-api.ts","../../../projects/ngcx-tree/src/cluetec-ngcx-tree.ts"],"sourcesContent":["import { DataSource } from '@angular/cdk/collections';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nexport class NgcxTreeDataSource<T> extends DataSource<T> {\n data$: BehaviorSubject<T[]>;\n\n constructor(data: T[]) {\n super();\n this.data$ = new BehaviorSubject(data);\n }\n\n connect(): Observable<readonly T[]> {\n return this.data$.asObservable();\n }\n disconnect(): void {}\n\n update(data: T[]) {\n this.data$.next([...data]);\n }\n}\n","import { CdkTreeModule, NestedTreeControl } from '@angular/cdk/tree';\nimport {\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { NgcxTreeConfig, NgcxTreeNodeWrapper } from '../ngcx-tree-models';\n\nimport { NgIf, NgTemplateOutlet } from '@angular/common';\nimport { Subject, takeUntil } from 'rxjs';\n\n@Component({\n selector: 'ngcx-tree-node',\n templateUrl: './ngcx-tree-node.component.html',\n styleUrls: ['./ngcx-tree-node.component.scss'],\n standalone: true,\n imports: [CdkTreeModule, NgTemplateOutlet, NgIf],\n})\nexport class NgcxTreeNodeComponent implements OnInit, OnDestroy {\n @Input() nodeWrapper!: NgcxTreeNodeWrapper<any>;\n @Input() treeControl!: NestedTreeControl<NgcxTreeNodeWrapper<any>, string>;\n @Input() treeConfig?: NgcxTreeConfig<any>;\n @Input() isSelected = false;\n\n @Output() customEvent = new EventEmitter<any>();\n @Output() clickEvent = new EventEmitter<void>();\n\n @ViewChild('ref', { read: ViewContainerRef, static: true })\n vcRef?: ViewContainerRef;\n\n ngUnsubscribe = new Subject();\n\n ngOnInit() {\n if (this.vcRef && this.treeConfig?.treeNodeContentComponent) {\n const nodeComponent = this.vcRef.createComponent(\n this.treeConfig.treeNodeContentComponent\n );\n nodeComponent.instance.nodeWrapper = this.nodeWrapper;\n\n nodeComponent.instance.customEvent\n ?.pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: any) => this.customEvent.emit(value));\n }\n }\n\n ngOnDestroy(): void {\n this.ngUnsubscribe.next(undefined);\n this.ngUnsubscribe.complete();\n }\n}\n","<div\n class=\"tree-node-content-container\"\n [class.selected]=\"isSelected\"\n [class.first]=\"nodeWrapper.isFirstChild\"\n [class.last]=\"nodeWrapper.isLastChild\"\n [class.is-selectable]=\"nodeWrapper.isSelectable\"\n (click)=\"clickEvent.emit()\">\n <div class=\"tree-node-expand-container\">\n <button\n *ngIf=\"nodeWrapper.children.length > 0\"\n class=\"tree-node-expand\"\n cdkTreeNodeToggle\n [attr.aria-label]=\"'Toggle ' + nodeWrapper.data.title\"\n (click)=\"$event.preventDefault()\">\n <div class=\"chevron\" [class.rotate]=\"treeControl.isExpanded(nodeWrapper)\">\n <svg id=\"a\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 9 9\">\n <path\n d=\"m2.83.09l4.2,4.2c.05.05.09.14.09.21s-.04.15-.09.21l-4.2,4.2c-.05.05-.14.09-.21.09s-.15-.04-.21-.09l-.45-.45c-.05-.05-.09-.13-.09-.21,0-.07.04-.15.09-.21l3.54-3.54L1.97.96c-.05-.05-.09-.14-.09-.21s.04-.15.09-.21l.45-.45c.05-.05.14-.09.21-.09s.15.04.21.09Z\"\n style=\"fill: var(--icon-color, #333); stroke-width: 0px\" />\n </svg>\n </div>\n </button>\n </div>\n <div class=\"small-horizontal-tree-line\"></div>\n <div class=\"tree-node-icon-container\" *ngIf=\"nodeWrapper.data.faIcon\">\n <i class=\"fa\" [class]=\"nodeWrapper.data.faIcon\"></i>\n </div>\n <div class=\"tree-node-content\">\n <span\n *ngIf=\"\n !treeConfig?.treeNodeContentComponent &&\n !treeConfig?.treeNodeContentTemplate\n \">\n {{ nodeWrapper.data.title }}\n </span>\n <ng-container #ref></ng-container>\n <ng-container *ngIf=\"treeConfig?.treeNodeContentTemplate as template\">\n <ng-container\n *ngTemplateOutlet=\"\n template;\n context: {\n nodeWrapper: nodeWrapper\n }\n \"></ng-container>\n </ng-container>\n </div>\n</div>\n","import { NgcxTreeNodeWrapper } from './ngcx-tree-models';\n\nexport const isParentOf = (\n parent: NgcxTreeNodeWrapper<any>,\n node: NgcxTreeNodeWrapper<any>\n): boolean => {\n if (!node.parent) {\n return false;\n }\n if (parent.id === node.parent.id) {\n return true;\n }\n return isParentOf(parent, node.parent);\n};\n","import {\n CdkDrag,\n CdkDragRelease,\n CdkDropList,\n DragDropModule,\n} from '@angular/cdk/drag-drop';\nimport { CdkTreeModule, NestedTreeControl } from '@angular/cdk/tree';\nimport { NgIf } from '@angular/common';\nimport {\n Component,\n EventEmitter,\n HostListener,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport { NgcxTreeDataSource } from './ngcx-tree-data.source';\nimport {\n NgcxTreeApi,\n NgcxTreeConfig,\n NgcxTreeNode,\n NgcxTreeNodeMovedEvent,\n NgcxTreeNodeWrapper,\n} from './ngcx-tree-models';\nimport { NgcxTreeNodeComponent } from './ngcx-tree-node/ngcx-tree-node.component';\nimport { isParentOf } from './ngcx-tree-utils';\n\n@Component({\n selector: 'ngcx-tree',\n templateUrl: 'ngcx-tree.component.html',\n styleUrls: ['ngcx-tree.component.scss'],\n standalone: true,\n imports: [CdkTreeModule, DragDropModule, NgcxTreeNodeComponent, NgIf],\n})\nexport class NgcxTreeComponent implements OnChanges, OnInit {\n @Input() nodes?: NgcxTreeNode[];\n @Input() config?: NgcxTreeConfig<any>;\n\n @Output() nodeMoved = new EventEmitter<NgcxTreeNodeMovedEvent<any>>();\n @Output() customEvent = new EventEmitter<any>();\n @Output() clickEvent = new EventEmitter<NgcxTreeNodeWrapper<any>>();\n @Output() selectEvent = new EventEmitter<NgcxTreeNodeWrapper<any>>();\n\n public readonly api: NgcxTreeApi<any> = new NgcxTreeControl(this);\n\n dataSource: NgcxTreeDataSource<NgcxTreeNodeWrapper<any>> =\n new NgcxTreeDataSource<NgcxTreeNodeWrapper<any>>([]);\n treeControl: NestedTreeControl<NgcxTreeNodeWrapper<any>, string> =\n new NestedTreeControl<NgcxTreeNodeWrapper<any>, string>(\n (node) => node.children,\n {\n trackBy: (node: NgcxTreeNodeWrapper<any>) => node.id,\n }\n );\n dragging?: NgcxTreeNodeWrapper<any>;\n\n selectedNode?: NgcxTreeNodeWrapper<any>;\n\n DropType = DropType;\n\n disable = () => false;\n\n private canceledByEsq?: boolean;\n\n ngOnInit(): void {\n this.updateTree();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['nodes']) {\n if (this.treeControl) {\n // initialized already\n this.updateTree();\n }\n if (this.selectedNode) {\n const selectedNodeId = this.selectedNode.id;\n setTimeout(() => this.api.selectNodeById(selectedNodeId));\n }\n }\n }\n\n updateTree() {\n const wrapperNodes = this.createWrapperNodes(this.nodes ?? []);\n this.dataSource = new NgcxTreeDataSource(wrapperNodes);\n this.treeControl.dataNodes = this.dataSource.data$.value;\n }\n\n createWrapperNodes(\n nodes: NgcxTreeNode[],\n parent?: NgcxTreeNodeWrapper<any>,\n depth: number = 0\n ): NgcxTreeNodeWrapper<any>[] {\n const childCount = nodes.length;\n const wrapperNodes = nodes.map((node, idx) => {\n const nodeWrapper: NgcxTreeNodeWrapper<any> = {\n id: node.id,\n data: node,\n isFirstChild: idx === 0,\n isLastChild: idx === childCount - 1,\n index: idx,\n parent: parent,\n depth: depth,\n children: [],\n };\n nodeWrapper.children = node.children\n ? this.createWrapperNodes(node.children, nodeWrapper, depth + 1)\n : [];\n\n return nodeWrapper;\n });\n wrapperNodes.forEach((wrapperNode) => {\n if (!wrapperNode.isLastChild) {\n wrapperNode.next = wrapperNodes[wrapperNode.index + 1];\n }\n if (!wrapperNode.isFirstChild) {\n wrapperNode.previous = wrapperNodes[wrapperNode.index - 1];\n }\n if (this.config?.allowSelection?.(wrapperNode)) {\n wrapperNode.isSelectable = true;\n }\n });\n return wrapperNodes;\n }\n\n hasChild = (_: number, node: NgcxTreeNodeWrapper<any>) =>\n node.children.length > 0;\n\n allowDrop(dropNode: NgcxTreeNodeWrapper<any>, dropType: DropType): boolean {\n if (\n !this.dragging ||\n this.dragging.id === dropNode.id ||\n isParentOf(this.dragging, dropNode)\n ) {\n return false;\n }\n if (\n dropType == DropType.DROP_INTO &&\n dropNode.id === this.dragging.parent?.id\n ) {\n return false;\n }\n if (\n dropType == DropType.DROP_AFTER &&\n dropNode.next?.id === this.dragging.id\n ) {\n return false;\n }\n if (\n dropType == DropType.DROP_BEFORE &&\n dropNode.previous?.id === this.dragging.id\n ) {\n return false;\n }\n\n const intoNode =\n dropType == DropType.DROP_INTO ? dropNode : dropNode.parent;\n if (this.config?.allowDrop) {\n return this.config.allowDrop(this.dragging, intoNode);\n }\n return true;\n }\n\n // prevent drop directly after a node on same level, that is expanded\n sortPredicate(): (\n index: number,\n drag: CdkDrag,\n drop: CdkDropList\n ) => boolean {\n return (\n index: number,\n _drag: CdkDrag<NgcxTreeNodeWrapper<any>>,\n drop: CdkDropList<NgcxTreeNodeWrapper<any>>\n ) => {\n return index == 0 || !this.treeControl.isExpanded(drop.data);\n };\n }\n\n disableDrag(node: NgcxTreeNodeWrapper<any>) {\n return this.config?.allowDrag ? !this.config.allowDrag(node) : false;\n }\n\n keyDownArrowUp(event: Event) {\n console.log('arrow up');\n\n if (this.selectedNode) {\n if (!this.selectedNode.isFirstChild) {\n this.selectNode(this.selectedNode.previous);\n } else if (this.selectedNode.parent) {\n this.selectNode(this.selectedNode.parent);\n }\n } else {\n const nodes = this.dataSource.data$.value;\n if (nodes.length > 0) {\n this.selectNode(nodes[nodes.length - 1]);\n }\n }\n event.preventDefault();\n }\n\n keyDownArrowDown(event: Event) {\n if (this.selectedNode) {\n if (!this.selectedNode.isLastChild) {\n this.selectNode(this.selectedNode.next);\n } else if (this.selectedNode.parent?.next) {\n this.selectNode(this.selectedNode.parent.next);\n }\n } else {\n const nodes = this.dataSource.data$.value;\n if (nodes.length > 0) {\n this.selectNode(nodes[0]);\n }\n }\n event.preventDefault();\n }\n\n keyDownArrowLeft(event: Event) {\n if (this.selectedNode?.parent) {\n this.selectNode(this.selectedNode.parent);\n } else if (!this.selectedNode) {\n const nodes = this.dataSource.data$.value;\n if (nodes.length > 0) {\n this.selectNode(nodes[0]);\n }\n }\n event.preventDefault();\n }\n\n keyDownArrowRight(event: Event) {\n if (this.selectedNode && this.selectedNode.children.length > 0) {\n this.selectNode(this.selectedNode.children[0]);\n } else if (!this.selectedNode) {\n const nodes = this.dataSource.data$.value;\n if (nodes.length > 0) {\n this.selectNode(nodes[0]);\n }\n }\n event.preventDefault();\n }\n\n @HostListener('window:keydown.escape')\n keyEscapeWhileDragging() {\n if (this.dragging) {\n this.canceledByEsq = true;\n document.dispatchEvent(new Event('mouseup'));\n }\n }\n\n handleDragRelease(event: CdkDragRelease<NgcxTreeNodeWrapper<any>>) {\n this.dragging = undefined;\n const movedNode = event.source.data;\n const dropZoneId = (<any>event.event.target).id;\n if (!dropZoneId) {\n // no valid drop zone\n return;\n }\n\n const dropZoneInfo = new DropZoneInfo(dropZoneId);\n const toNode = this.api.findNodeById(dropZoneInfo.nodeId);\n if (!toNode) {\n console.error(`node with id '${dropZoneInfo.nodeId}' could not be found`);\n return;\n }\n\n // dropType undefined can happen if dropped directly without moving\n if (this.canceledByEsq || dropZoneInfo.dropType === undefined) {\n this.canceledByEsq = false;\n return;\n }\n\n const insertIntoNode =\n dropZoneInfo.dropType === DropType.DROP_INTO ? toNode : toNode.parent;\n const wrapperList = insertIntoNode?.children ?? this.dataSource.data$.value;\n const addAtNodeIdx = this.findAddIndex(\n dropZoneInfo,\n insertIntoNode,\n wrapperList\n );\n\n const removedFromIdx = this.removeElementFromPreviousPosition(movedNode);\n // add element to new Position, subtract one if inserted in same list after the remove position\n (insertIntoNode?.data.children ?? this.nodes!).splice(\n movedNode.parent?.id === insertIntoNode?.id &&\n removedFromIdx < addAtNodeIdx\n ? addAtNodeIdx - 1\n : addAtNodeIdx,\n 0,\n movedNode.data\n );\n\n const afterNodeIdx = addAtNodeIdx - 1;\n const afterNode =\n afterNodeIdx > -1 && wrapperList.length > afterNodeIdx\n ? wrapperList[afterNodeIdx]\n : undefined;\n\n const beforeNode =\n addAtNodeIdx > -1 && wrapperList.length > addAtNodeIdx\n ? wrapperList[addAtNodeIdx]\n : undefined;\n this.nodeMoved.emit({\n node: movedNode,\n parent:\n dropZoneInfo.dropType === DropType.DROP_INTO ? toNode : toNode.parent,\n afterNode: afterNode,\n beforeNode: beforeNode,\n });\n this.dataSource = new NgcxTreeDataSource(\n this.createWrapperNodes(this.nodes!)\n );\n this.treeControl.dataNodes = this.dataSource.data$.value;\n }\n\n private findAddIndex(\n dropZoneInfo: DropZoneInfo,\n insertIntoNode: NgcxTreeNodeWrapper<any> | undefined,\n insertIntoList: NgcxTreeNodeWrapper<any>[]\n ) {\n if (\n insertIntoNode &&\n dropZoneInfo.dropType === DropType.DROP_INTO &&\n !insertIntoNode.data.children\n ) {\n insertIntoNode.data.children = [];\n }\n let addAtNodeIdx = 0;\n if (\n dropZoneInfo.dropType === DropType.DROP_AFTER ||\n dropZoneInfo.dropType === DropType.DROP_BEFORE\n ) {\n addAtNodeIdx = insertIntoList.findIndex(\n (child) => child.id === dropZoneInfo.nodeId\n );\n if (dropZoneInfo.dropType === DropType.DROP_AFTER) {\n addAtNodeIdx++;\n }\n }\n return addAtNodeIdx;\n }\n\n private removeElementFromPreviousPosition(\n movedNode: NgcxTreeNodeWrapper<any>\n ): number {\n const removeFromList = movedNode.parent?.data.children ?? this.nodes!;\n const removeIndex = removeFromList.findIndex(\n (child: any) => child.id === movedNode.id\n );\n removeFromList.splice(removeIndex, 1);\n return removeIndex;\n }\n\n nodeClicked(nodeWrapper: NgcxTreeNodeWrapper<any>) {\n this.clickEvent.emit(nodeWrapper);\n if (nodeWrapper.isSelectable) {\n this.selectedNode =\n nodeWrapper.id === this.selectedNode?.id ? undefined : nodeWrapper;\n this.selectEvent.emit(this.selectedNode);\n }\n }\n\n selectNode(nodeWrapper: NgcxTreeNodeWrapper<any> | undefined) {\n if (!nodeWrapper || nodeWrapper.isSelectable) {\n this.selectedNode = nodeWrapper;\n let expandNode = this.selectedNode?.parent;\n while (expandNode) {\n this.treeControl.expand(expandNode);\n expandNode = expandNode.parent;\n }\n this.selectEvent.emit(this.selectedNode);\n }\n }\n}\n\nenum DropType {\n DROP_AFTER = 'DROP_AFTER',\n DROP_BEFORE = 'DROP_BEFORE',\n DROP_INTO = 'DROP_INTO',\n}\n\nexport class NgcxTreeControl implements NgcxTreeApi<any> {\n constructor(private treeComponent: NgcxTreeComponent) {}\n\n get treeControl(): NestedTreeControl<NgcxTreeNodeWrapper<any>, string> {\n return this.treeComponent.treeControl;\n }\n\n selectNodeById(id: string) {\n this.treeComponent.selectNode(this.findNodeById(id));\n }\n\n findNodeById(id: string): NgcxTreeNodeWrapper<any> | undefined {\n return this.findNodeByIdInNodes(\n this.treeComponent.dataSource.data$.value,\n id\n );\n }\n\n private findNodeByIdInNodes(\n nodes: NgcxTreeNodeWrapper<any>[],\n id: string\n ): NgcxTreeNodeWrapper<any> | undefined {\n for (const node of nodes) {\n if (node.id === id) {\n return node;\n }\n if (node.children?.length > 0) {\n const foundNode = this.findNodeByIdInNodes(node.children, id);\n if (foundNode) {\n return foundNode;\n }\n }\n }\n\n return undefined;\n }\n}\n\nclass DropZoneInfo {\n dropType: DropType;\n nodeId: string;\n\n constructor(id: string) {\n const pos = id.indexOf('_');\n this.nodeId = id.substring(0, pos);\n this.dropType = <any>id.substring(pos + 1);\n }\n}\n","<cdk-tree\n #tree\n class=\"ngcx-tree\"\n *ngIf=\"dataSource\"\n [dataSource]=\"dataSource\"\n [treeControl]=\"treeControl\"\n cdkDropListGroup\n [class.dragging]=\"dragging\"\n (keyup.arrowup)=\"keyDownArrowUp($event)\"\n (keydown.arrowdown)=\"keyDownArrowDown($event)\"\n (keydown.arrowleft)=\"keyDownArrowLeft($event)\"\n (keydown.arrowright)=\"keyDownArrowRight($event)\"\n tabindex=\"0\">\n <cdk-nested-tree-node *cdkTreeNodeDef=\"let node\" class=\"tree-node\">\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_AFTER\"\n class=\"tree-node-container-drop-zone after-expanded-node\"\n [class.hide]=\"\n !dragging ||\n !allowDrop(node, DropType.DROP_AFTER) ||\n !treeControl.isExpanded(node)\n \">\n <div class=\"drop-insert-line\"></div>\n </div>\n <div class=\"tree-node-container\">\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_BEFORE\"\n class=\"tree-node-container-drop-zone before-node\"\n [class.hide]=\"\n !dragging ||\n !node.isFirstChild ||\n !allowDrop(node, DropType.DROP_BEFORE)\n \">\n <div class=\"drop-insert-line\"></div>\n </div>\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_INTO\"\n class=\"tree-node-container-drop-zone into-node\"\n [class.hide]=\"!dragging || !allowDrop(node, DropType.DROP_INTO)\"></div>\n <div\n cdkDropList\n [id]=\"node.id + '_' + DropType.DROP_AFTER\"\n class=\"tree-node-container-drop-zone after-node\"\n [class.last]=\"node.isLastChild\"\n [class.hide]=\"\n !dragging ||\n treeControl.isExpanded(node) ||\n !allowDrop(node, DropType.DROP_AFTER)\n \">\n <div class=\"drop-insert-line\"></div>\n </div>\n <div\n cdkDropList\n [cdkDropListData]=\"node\"\n [cdkDropListEnterPredicate]=\"disable\"\n [cdkDropListSortPredicate]=\"disable\">\n <div\n cdkDrag\n [cdkDragDisabled]=\"disableDrag(node)\"\n [cdkDragData]=\"node\"\n (cdkDragStarted)=\"dragging = node\"\n (cdkDragReleased)=\"handleDragRelease($event)\">\n <div *cdkDragPlaceholder></div>\n <div\n class=\"tree-node-content-container\"\n [class.first]=\"node.isFirstChild\"\n [class.last]=\"node.isLastChild\"\n [class.expanded]=\"treeControl.isExpanded(node)\">\n <ngcx-tree-node\n style=\"width: 100%\"\n [nodeWrapper]=\"node\"\n [isSelected]=\"node.id === selectedNode?.id\"\n [treeControl]=\"treeControl\"\n [treeConfig]=\"config\"\n (customEvent)=\"customEvent.emit($event)\"\n (clickEvent)=\"nodeClicked(node)\"></ngcx-tree-node>\n </div>\n </div>\n <ngcx-tree-node\n *ngIf=\"node.id === dragging?.id\"\n [nodeWrapper]=\"node\"\n [treeControl]=\"treeControl\"\n [treeConfig]=\"config\"></ngcx-tree-node>\n </div>\n </div>\n <div\n *ngIf=\"treeControl.isExpanded(node)\"\n class=\"tree-node-children-container\"\n [class.first]=\"node.isFirstChild\"\n [class.last]=\"node.isLastChild\">\n <div cdkTreeNodeOutlet></div>\n </div>\n </cdk-nested-tree-node>\n</cdk-tree>\n","/*\n * Public API Surface of ngcx-tree\n */\n\nexport * from './lib/ngcx-tree/ngcx-tree-models';\nexport * from './lib/ngcx-tree/ngcx-tree.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAGM,MAAO,kBAAsB,SAAQ,UAAa,CAAA;AAGtD,IAAA,WAAA,CAAY,IAAS,EAAA;AACnB,QAAA,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KACxC;IAED,OAAO,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;KAClC;AACD,IAAA,UAAU,MAAW;AAErB,IAAA,MAAM,CAAC,IAAS,EAAA;QACd,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;KAC5B;AACF;;MCIY,qBAAqB,CAAA;AAPlC,IAAA,WAAA,GAAA;AAWW,QAAA,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;AAElB,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAO,CAAC;AACtC,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAQ,CAAC;AAKhD,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,OAAO,EAAE,CAAC;KAmB/B;IAjBC,QAAQ,GAAA;;QACN,IAAI,IAAI,CAAC,KAAK,KAAI,CAAA,EAAA,GAAA,IAAI,CAAC,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,wBAAwB,CAAA,EAAE;AAC3D,YAAA,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAC9C,IAAI,CAAC,UAAU,CAAC,wBAAwB,CACzC,CAAC;YACF,aAAa,CAAC,QAAQ,CAAC,WAAW,GAAG,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