@rxap/tree 12.5.0 → 13.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,350 +0,0 @@
1
- import { __awaiter, __decorate, __metadata } from "tslib";
2
- import { BehaviorSubject, from, merge, Subject } from 'rxjs';
3
- import { FlatTreeControl } from '@angular/cdk/tree';
4
- import { SelectionModel } from '@angular/cdk/collections';
5
- import { map, startWith, switchMap, tap } from 'rxjs/operators';
6
- import { BaseDataSource, RXAP_DATA_SOURCE_METADATA } from '@rxap/data-source';
7
- import { joinPath, Required } from '@rxap/utilities';
8
- import { Inject, Injectable, InjectionToken, isDevMode } from '@angular/core';
9
- import { Node, ToggleSubject } from '@rxap/utilities/rxjs';
10
- import * as i0 from "@angular/core";
11
- export function isSelectionChange(obj) {
12
- return !!obj && obj.hasOwnProperty('added') && obj.hasOwnProperty('removed');
13
- }
14
- export const RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD = new InjectionToken('rxap/tree/data-source/root-remote-method');
15
- export const RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD = new InjectionToken('rxap/tree/data-source/children-remote-method');
16
- export class TreeDataSource extends BaseDataSource {
17
- constructor(rootRemoteMethod, childrenRemoteMethod, metadata = null) {
18
- super(metadata);
19
- this.rootRemoteMethod = rootRemoteMethod;
20
- this.childrenRemoteMethod = childrenRemoteMethod;
21
- this.tree$ = new BehaviorSubject([]);
22
- this._expandedLocalStorageSubscription = null;
23
- this._selectedLocalStorageSubscription = null;
24
- // TODO : änlich problem wie bei der redundaten expand SelectionModel.
25
- // im localStorage wird nur die id gespeichert.
26
- this._preSelected = [];
27
- this._data$ = new BehaviorSubject([]);
28
- this.loading$ = new ToggleSubject(true);
29
- this.toDisplay = () => 'to display function not defined';
30
- this.getIcon = () => null;
31
- this.hasDetails = () => true;
32
- this.matchFilter = () => true;
33
- this._refreshMatchFilter = new Subject();
34
- this.tree$
35
- .pipe(map((tree) => tree
36
- .map((child) => this.flatTree(child))
37
- .reduce((acc, nodes) => [...acc, ...nodes], [])))
38
- .subscribe(this._data$);
39
- // TODO add new SelectModel class that saves the select model to the localStorage
40
- this.initSelected();
41
- this.initExpanded();
42
- }
43
- getTreeRoot() {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- this.loading$.enable();
46
- const root = yield this.getRoot();
47
- let rootNodes;
48
- if (Array.isArray(root)) {
49
- rootNodes = yield Promise.all(root.map((node) => this._toNode(node)));
50
- }
51
- else {
52
- rootNodes = [yield this._toNode(root)];
53
- }
54
- this.tree$.next(rootNodes);
55
- this.loading$.disable();
56
- return rootNodes;
57
- });
58
- }
59
- selectNode(node) {
60
- if (!this.selected.isMultipleSelection()) {
61
- if (this.selected.hasValue()) {
62
- const currentSelectedNode = this.selected.selected[0];
63
- currentSelectedNode.deselect();
64
- }
65
- }
66
- this.selected.select(node);
67
- return Promise.resolve();
68
- }
69
- setTreeControl(treeControl) {
70
- this.treeControl = treeControl;
71
- }
72
- setMatchFilter(matchFilter) {
73
- this.matchFilter = matchFilter;
74
- }
75
- setToDisplay(toDisplay = this.toDisplay) {
76
- this.toDisplay = toDisplay;
77
- }
78
- setGetIcon(getIcon = this.getIcon) {
79
- this.getIcon = getIcon;
80
- }
81
- setHasDetails(hasDetails = this.hasDetails) {
82
- this.hasDetails = hasDetails;
83
- }
84
- deselectNode(node) {
85
- this.selected.deselect(node);
86
- return Promise.resolve();
87
- }
88
- // - the SelectModel that stores the selection into the local storage?
89
- _toNode(item, depth = 0, onExpand = this.expandNode.bind(this), onCollapse = this.collapseNode.bind(this), onSelect = this.selectNode.bind(this), onDeselect = this.deselectNode.bind(this)) {
90
- return __awaiter(this, void 0, void 0, function* () {
91
- const node = yield this.toNode(item, depth, onExpand, onCollapse, onSelect, onDeselect);
92
- if (this.expanded.isSelected(node.id)) {
93
- node
94
- .expand()
95
- .then(() => {
96
- // TODO : remove redundant this.expanded SelectionModel. Only store expanded nodes in this.treeControl.expansionModel
97
- // das problem ist das ich beim speicher in localStorage nur die id speicher.
98
- // Des wegen kann ich beim laden aus dem localStorage this.treeControl.expansionModel
99
- // nicht einfach mit den expanend nodes fullen. Da dort das node object benötigt wird
100
- // möglich lösungen:
101
- // - das node object läde die entity mithilfe der id automatisch nach
102
- this.treeControl.expansionModel.select(node);
103
- console.debug(`Restore expand for node '${node.id}' SUCCESSFULLY`);
104
- })
105
- .catch(() => console.debug(`Restore expand for node '${node.id}' FAILED`));
106
- }
107
- if (this._preSelected.includes(node.id)) {
108
- yield node
109
- .select()
110
- .then(() => console.debug(`Restore select for node '${node.id}' SUCCESSFULLY`))
111
- .catch(() => console.debug(`Restore select for node '${node.id}' FAILED`));
112
- }
113
- return node;
114
- });
115
- }
116
- expandNode(node) {
117
- var _a;
118
- return __awaiter(this, void 0, void 0, function* () {
119
- if (node.item.hasChildren && !((_a = node.item.children) === null || _a === void 0 ? void 0 : _a.length)) {
120
- node.isLoading$.enable();
121
- const children = yield this.getChildren(node);
122
- // add the loaded children to the item object
123
- node.item.children = children;
124
- node.addChildren(yield Promise.all(children.map((child) => this._toNode(child, node.depth + 1, node.onExpand, node.onCollapse))));
125
- node.isLoading$.disable();
126
- }
127
- this.expanded.select(node.id);
128
- this.tree$.next(this.tree$.value);
129
- });
130
- }
131
- getChildren(node) {
132
- return __awaiter(this, void 0, void 0, function* () {
133
- return this.childrenRemoteMethod.call(node);
134
- });
135
- }
136
- getRoot() {
137
- return __awaiter(this, void 0, void 0, function* () {
138
- const rootParameters = yield this.getRootParameters();
139
- return this.rootRemoteMethod.call(rootParameters);
140
- });
141
- }
142
- getRootParameters() {
143
- return __awaiter(this, void 0, void 0, function* () {
144
- return undefined;
145
- });
146
- }
147
- // TODO : find better solution to allow the overwrite of the toNode method
148
- // without losing the custom preselect and preexpand function
149
- getNodeById(id) {
150
- function getNodeById(node, nodeId) {
151
- if (node.id === nodeId) {
152
- return node;
153
- }
154
- if (node.hasNode(nodeId)) {
155
- return node.getNode(nodeId);
156
- }
157
- else {
158
- return null;
159
- }
160
- }
161
- return (this.tree$.value
162
- .map((node) => getNodeById(node, id))
163
- .filter(Boolean)[0] || null);
164
- }
165
- toNode(item, depth = 0, onExpand = this.expandNode.bind(this), onCollapse = this.collapseNode.bind(this), onSelect = this.selectNode.bind(this), onDeselect = this.deselectNode.bind(this)) {
166
- return __awaiter(this, void 0, void 0, function* () {
167
- return Node.ToNode(item, depth, onExpand, onCollapse, this.toDisplay, this.getIcon, onSelect, onDeselect, this.hasDetails);
168
- });
169
- }
170
- collapseNode(node) {
171
- this.expanded.deselect(node.id);
172
- this.tree$.next(this.tree$.value);
173
- return Promise.resolve();
174
- }
175
- flatTree(tree) {
176
- function flat(acc, list) {
177
- return [...acc, ...list];
178
- }
179
- const flatTree = (node) => {
180
- if (!Array.isArray(node.children)) {
181
- if (isDevMode()) {
182
- console.log(node);
183
- }
184
- throw new Error('Node has not defined children');
185
- }
186
- if (node.expanded || this.expanded.isSelected(node.id)) {
187
- return [
188
- node,
189
- ...node.children.map((child) => flatTree(child)).reduce(flat, []),
190
- ];
191
- }
192
- else {
193
- return [node];
194
- }
195
- };
196
- return flatTree(tree);
197
- }
198
- destroy() {
199
- super.destroy();
200
- // TODO : add subscription handler to BaseDataSource
201
- if (this._expandedLocalStorageSubscription) {
202
- this._expandedLocalStorageSubscription.unsubscribe();
203
- }
204
- if (this._selectedLocalStorageSubscription) {
205
- this._selectedLocalStorageSubscription.unsubscribe();
206
- }
207
- }
208
- refreshMatchFilter() {
209
- this._refreshMatchFilter.next();
210
- }
211
- _connect(collectionViewer) {
212
- this.treeControl.expansionModel.changed.subscribe((change) => {
213
- if (isSelectionChange(change)) {
214
- if (change.added) {
215
- change.added.forEach((node) => node.expand());
216
- }
217
- if (change.removed) {
218
- change.removed
219
- .slice()
220
- .reverse()
221
- .forEach((node) => node.collapse());
222
- }
223
- }
224
- });
225
- let loadRoot = Promise.resolve();
226
- if (this.tree$.value.length === 0) {
227
- loadRoot = this.getTreeRoot();
228
- }
229
- return from(loadRoot).pipe(tap((rootNodes) => {
230
- if (rootNodes) {
231
- const promises = [];
232
- if (this.metadata.selectMultiple) {
233
- if (!this.selected.hasValue()) {
234
- promises.push(...rootNodes
235
- .filter((node) => node.hasDetails)
236
- .map((node) => node.select()));
237
- }
238
- if (!this.expanded.hasValue()) {
239
- promises.push(...rootNodes
240
- .filter((node) => node.hasChildren)
241
- .map((node) => node.expand()));
242
- }
243
- }
244
- else if (rootNodes.length) {
245
- const rootNode = rootNodes[0];
246
- if (!this.selected.hasValue()) {
247
- // TODO : rename hasDetails to isSelectable
248
- if (rootNode.hasDetails) {
249
- promises.push(rootNode.select());
250
- }
251
- }
252
- if (!this.expanded.hasValue()) {
253
- promises.push(rootNode.expand());
254
- }
255
- }
256
- return Promise.all(promises);
257
- }
258
- return Promise.resolve();
259
- }), switchMap(() => merge(collectionViewer.viewChange, this._data$).pipe(map(() => this._data$.value))), switchMap(nodeList => this._refreshMatchFilter.pipe(startWith(null), map(() => nodeList.filter(node => this.matchFilter(node))))));
260
- }
261
- refresh() {
262
- return __awaiter(this, void 0, void 0, function* () {
263
- const rootNodes = yield this.getTreeRoot();
264
- // refresh all expanded nodes;
265
- const loadExpandedNodes = (children) => __awaiter(this, void 0, void 0, function* () {
266
- for (const child of children) {
267
- if (this.expanded.isSelected(child.id)) {
268
- // call the node method to ensure that the expanded property of
269
- // Node is set.
270
- yield child.expand();
271
- }
272
- if (child.hasChildren) {
273
- yield loadExpandedNodes(child.children);
274
- }
275
- }
276
- });
277
- yield Promise.all(rootNodes
278
- .filter((node) => node.hasChildren)
279
- .map((node) => loadExpandedNodes(node.children)));
280
- const selected = this.selected.selected
281
- .map((node) => this.getNodeById(node.id))
282
- .filter(Boolean);
283
- this.selected.clear();
284
- this.selected.select(...selected);
285
- });
286
- }
287
- initSelected() {
288
- const key = joinPath('rxap/tree', this.id, 'selected');
289
- if (this.metadata.cacheSelected) {
290
- if (localStorage.getItem(key)) {
291
- try {
292
- this._preSelected = JSON.parse(localStorage.getItem(key));
293
- }
294
- catch (e) {
295
- console.debug('parse expanded tree data source nodes failed');
296
- }
297
- }
298
- }
299
- this.selected = new SelectionModel(!!this.metadata.selectMultiple, []);
300
- if (this.metadata.cacheSelected) {
301
- this._selectedLocalStorageSubscription = this.selected.changed
302
- .pipe(tap(() => localStorage.setItem(key, JSON.stringify(this.selected.selected.map((s) => s.id)))))
303
- .subscribe();
304
- }
305
- }
306
- reset() {
307
- this.selected.clear();
308
- this.expanded.clear();
309
- return this.getTreeRoot();
310
- }
311
- initExpanded() {
312
- const key = joinPath('rxap/tree', this.id, 'expanded');
313
- let expanded = [];
314
- if (this.metadata.cacheExpanded) {
315
- if (localStorage.getItem(key)) {
316
- try {
317
- expanded = JSON.parse(localStorage.getItem(key));
318
- }
319
- catch (e) {
320
- console.debug('parse expanded tree data source nodes failed');
321
- }
322
- }
323
- }
324
- this.expanded = new SelectionModel(this.metadata.expandMultiple !== false, expanded);
325
- if (this.metadata.cacheExpanded) {
326
- this._expandedLocalStorageSubscription = this.expanded.changed
327
- .pipe(tap(() => localStorage.setItem(key, JSON.stringify(this.expanded.selected))))
328
- .subscribe();
329
- }
330
- }
331
- }
332
- TreeDataSource.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TreeDataSource, deps: [{ token: RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD }, { token: RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD }, { token: RXAP_DATA_SOURCE_METADATA }], target: i0.ɵɵFactoryTarget.Injectable });
333
- TreeDataSource.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TreeDataSource });
334
- __decorate([
335
- Required,
336
- __metadata("design:type", FlatTreeControl)
337
- ], TreeDataSource.prototype, "treeControl", void 0);
338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TreeDataSource, decorators: [{
339
- type: Injectable
340
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
341
- type: Inject,
342
- args: [RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD]
343
- }] }, { type: undefined, decorators: [{
344
- type: Inject,
345
- args: [RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD]
346
- }] }, { type: undefined, decorators: [{
347
- type: Inject,
348
- args: [RXAP_DATA_SOURCE_METADATA]
349
- }] }]; }, propDecorators: { treeControl: [] } });
350
- //# sourceMappingURL=tree.data-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree.data-source.js","sourceRoot":"","sources":["../../../../../libs/tree/src/lib/tree.data-source.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,IAAI,EACJ,KAAK,EAEL,OAAO,EAER,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAEL,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,GAAG,EACH,SAAS,EACT,SAAS,EACT,GAAG,EACJ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EAGd,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,QAAQ,EACR,QAAQ,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,MAAM,EACN,UAAU,EACV,cAAc,EACd,SAAS,EACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,IAAI,EAKJ,aAAa,EACd,MAAM,sBAAsB,CAAC;;AAE9B,MAAM,UAAU,iBAAiB,CAAI,GAAQ;IAC3C,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AAC/E,CAAC;AAOD,MAAM,CAAC,MAAM,wCAAwC,GAAG,IAAI,cAAc,CACxE,0CAA0C,CAC3C,CAAC;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kBAD1B,UAAU;;0BA+BN,MAAM;2BAAC,wCAAwC;;0BAE/C,MAAM;2BAAC,4CAA4C;;0BAEnD,MAAM;2BAAC,yBAAyB;4CA7BlB,WAAW","sourcesContent":["import {\n BehaviorSubject,\n from,\n merge,\n Observable,\n Subject,\n Subscription\n} from 'rxjs';\nimport { FlatTreeControl } from '@angular/cdk/tree';\nimport {\n SelectionChange,\n SelectionModel\n} from '@angular/cdk/collections';\nimport {\n map,\n startWith,\n switchMap,\n tap\n} from 'rxjs/operators';\nimport {\n BaseDataSource,\n BaseDataSourceMetadata,\n BaseDataSourceViewer,\n RXAP_DATA_SOURCE_METADATA\n} from '@rxap/data-source';\nimport {\n joinPath,\n Required,\n WithChildren,\n WithIdentifier\n} from '@rxap/utilities';\nimport {\n Inject,\n Injectable,\n InjectionToken,\n isDevMode\n} from '@angular/core';\nimport {\n ExpandNodeFunction,\n Node,\n NodeGetIconFunction,\n NodeHasDetailsFunction,\n NodeToDisplayFunction,\n Method,\n ToggleSubject\n} from '@rxap/utilities/rxjs';\n\nexport function isSelectionChange<T>(obj: any): obj is SelectionChange<T> {\n return !!obj && obj.hasOwnProperty('added') && obj.hasOwnProperty('removed');\n}\n\nexport interface TreeDataSourceMetadata extends BaseDataSourceMetadata {\n selectMultiple?: boolean;\n expandMultiple?: boolean;\n}\n\nexport const RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD = new InjectionToken(\n 'rxap/tree/data-source/root-remote-method'\n);\nexport const RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD = new InjectionToken(\n 'rxap/tree/data-source/children-remote-method'\n);\n\n@Injectable()\nexport class TreeDataSource<\n Data extends WithIdentifier & WithChildren = any,\n RootParameters = any\n > extends BaseDataSource<Array<Node<Data>>> {\n public tree$ = new BehaviorSubject<Array<Node<Data>>>([]);\n @Required public treeControl!: FlatTreeControl<Node<Data>>;\n public selected!: SelectionModel<Node<Data>>;\n public expanded!: SelectionModel<string>;\n\n private _expandedLocalStorageSubscription: Subscription | null = null;\n private _selectedLocalStorageSubscription: Subscription | null = null;\n\n // TODO : änlich problem wie bei der redundaten expand SelectionModel.\n // im localStorage wird nur die id gespeichert.\n private _preSelected: string[] = [];\n\n protected _data$ = new BehaviorSubject<Array<Node<Data>>>([]);\n public metadata!: TreeDataSourceMetadata;\n\n public loading$ = new ToggleSubject(true);\n\n public toDisplay: NodeToDisplayFunction<Data> = () =>\n 'to display function not defined';\n public getIcon: NodeGetIconFunction<Data> = () => null;\n public hasDetails: NodeHasDetailsFunction<Data> = () => true;\n public matchFilter: (node: Node<Data>) => boolean = () => true;\n\n private _refreshMatchFilter = new Subject();\n\n constructor(\n @Inject(RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD)\n public readonly rootRemoteMethod: Method<Data | Data[], RootParameters>,\n @Inject(RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD)\n public readonly childrenRemoteMethod: Method<Data[], Node<Data>>,\n @Inject(RXAP_DATA_SOURCE_METADATA)\n metadata: TreeDataSourceMetadata | null = null\n ) {\n super(metadata);\n this.tree$\n .pipe(\n map((tree) =>\n tree\n .map((child) => this.flatTree(child))\n .reduce((acc, nodes) => [...acc, ...nodes], [])\n )\n )\n .subscribe(this._data$);\n\n // TODO add new SelectModel class that saves the select model to the localStorage\n this.initSelected();\n this.initExpanded();\n }\n\n public async getTreeRoot(): Promise<Array<Node<Data>>> {\n this.loading$.enable();\n const root: Data | Data[] = await this.getRoot();\n\n let rootNodes: Array<Node<Data>>;\n\n if (Array.isArray(root)) {\n rootNodes = await Promise.all(root.map((node) => this._toNode(node)));\n } else {\n rootNodes = [await this._toNode(root)];\n }\n\n this.tree$.next(rootNodes);\n\n this.loading$.disable();\n\n return rootNodes;\n }\n\n public selectNode(node: Node<Data>): Promise<void> {\n if (!this.selected.isMultipleSelection()) {\n if (this.selected.hasValue()) {\n const currentSelectedNode = this.selected.selected[0];\n currentSelectedNode.deselect();\n }\n }\n this.selected.select(node);\n return Promise.resolve();\n }\n\n public setTreeControl(treeControl: FlatTreeControl<Node<Data>>): void {\n this.treeControl = treeControl;\n }\n\n public setMatchFilter(matchFilter: (node: Node<Data>) => boolean): void {\n this.matchFilter = matchFilter;\n }\n\n public setToDisplay(\n toDisplay: NodeToDisplayFunction<Data> = this.toDisplay\n ): void {\n this.toDisplay = toDisplay;\n }\n\n public setGetIcon(getIcon: NodeGetIconFunction<Data> = this.getIcon): void {\n this.getIcon = getIcon;\n }\n\n public setHasDetails(\n hasDetails: NodeHasDetailsFunction<Data> = this.hasDetails\n ): void {\n this.hasDetails = hasDetails;\n }\n\n public deselectNode(node: Node<Data>): Promise<void> {\n this.selected.deselect(node);\n return Promise.resolve();\n }\n\n // - the SelectModel that stores the selection into the local storage?\n public async _toNode(\n item: Data,\n depth: number = 0,\n onExpand: ExpandNodeFunction<Data> = this.expandNode.bind(this),\n onCollapse: ExpandNodeFunction<Data> = this.collapseNode.bind(this),\n onSelect: ExpandNodeFunction<Data> = this.selectNode.bind(this),\n onDeselect: ExpandNodeFunction<Data> = this.deselectNode.bind(this)\n ): Promise<Node<Data>> {\n const node = await this.toNode(\n item,\n depth,\n onExpand,\n onCollapse,\n onSelect,\n onDeselect\n );\n\n if (this.expanded.isSelected(node.id)) {\n node\n .expand()\n .then(() => {\n // TODO : remove redundant this.expanded SelectionModel. Only store expanded nodes in this.treeControl.expansionModel\n // das problem ist das ich beim speicher in localStorage nur die id speicher.\n // Des wegen kann ich beim laden aus dem localStorage this.treeControl.expansionModel\n // nicht einfach mit den expanend nodes fullen. Da dort das node object benötigt wird\n // möglich lösungen:\n // - das node object läde die entity mithilfe der id automatisch nach\n this.treeControl.expansionModel.select(node);\n console.debug(`Restore expand for node '${node.id}' SUCCESSFULLY`);\n })\n .catch(() =>\n console.debug(`Restore expand for node '${node.id}' FAILED`)\n );\n }\n\n if (this._preSelected.includes(node.id)) {\n await node\n .select()\n .then(() =>\n console.debug(`Restore select for node '${node.id}' SUCCESSFULLY`)\n )\n .catch(() =>\n console.debug(`Restore select for node '${node.id}' FAILED`)\n );\n }\n\n return node;\n }\n\n public async expandNode(node: Node<Data>): Promise<void> {\n if (node.item.hasChildren && !node.item.children?.length) {\n node.isLoading$.enable();\n\n const children = await this.getChildren(node);\n\n // add the loaded children to the item object\n node.item.children = children;\n\n node.addChildren(\n await Promise.all(children.map((child) =>\n this._toNode(child, node.depth + 1, node.onExpand, node.onCollapse)\n ))\n );\n\n node.isLoading$.disable();\n }\n\n this.expanded.select(node.id);\n\n this.tree$.next(this.tree$.value);\n }\n\n public async getChildren(node: Node<Data>): Promise<Data[]> {\n return this.childrenRemoteMethod.call(node);\n }\n\n public async getRoot(): Promise<Data | Data[]> {\n const rootParameters = await this.getRootParameters();\n return this.rootRemoteMethod.call(rootParameters);\n }\n\n public async getRootParameters(): Promise<RootParameters> {\n return undefined as any;\n }\n\n // TODO : find better solution to allow the overwrite of the toNode method\n // without losing the custom preselect and preexpand function\n\n public getNodeById(id: string): Node<Data> | null {\n function getNodeById(node: Node<Data>, nodeId: string) {\n if (node.id === nodeId) {\n return node;\n }\n if (node.hasNode(nodeId)) {\n return node.getNode(nodeId);\n } else {\n return null;\n }\n }\n\n return (\n this.tree$.value\n .map((node) => getNodeById(node, id))\n .filter(Boolean)[0] || null\n );\n }\n\n public async toNode(\n item: Data,\n depth: number = 0,\n onExpand: ExpandNodeFunction<Data> = this.expandNode.bind(this),\n onCollapse: ExpandNodeFunction<Data> = this.collapseNode.bind(this),\n onSelect: ExpandNodeFunction<Data> = this.selectNode.bind(this),\n onDeselect: ExpandNodeFunction<Data> = this.deselectNode.bind(this)\n ): Promise<Node<Data>> {\n return Node.ToNode(\n item,\n depth,\n onExpand,\n onCollapse,\n this.toDisplay,\n this.getIcon,\n onSelect,\n onDeselect,\n this.hasDetails\n );\n }\n\n public collapseNode(node: Node<Data>): Promise<void> {\n this.expanded.deselect(node.id);\n\n this.tree$.next(this.tree$.value);\n\n return Promise.resolve();\n }\n\n public flatTree(tree: Node<Data>): Array<Node<Data>> {\n function flat(acc: any[], list: any[]) {\n return [...acc, ...list];\n }\n\n const flatTree = (node: Node<Data>): Array<Node<Data>> => {\n if (!Array.isArray(node.children)) {\n if (isDevMode()) {\n console.log(node);\n }\n throw new Error('Node has not defined children');\n }\n\n if (node.expanded || this.expanded.isSelected(node.id)) {\n return [\n node,\n ...node.children.map((child) => flatTree(child)).reduce(flat, []),\n ];\n } else {\n return [node];\n }\n };\n\n return flatTree(tree);\n }\n\n public destroy(): void {\n super.destroy();\n // TODO : add subscription handler to BaseDataSource\n if (this._expandedLocalStorageSubscription) {\n this._expandedLocalStorageSubscription.unsubscribe();\n }\n if (this._selectedLocalStorageSubscription) {\n this._selectedLocalStorageSubscription.unsubscribe();\n }\n }\n\n public refreshMatchFilter(): void {\n this._refreshMatchFilter.next();\n }\n\n protected _connect(\n collectionViewer: Required<BaseDataSourceViewer>\n ): Observable<Array<Node<Data>>> {\n this.treeControl.expansionModel.changed.subscribe((change: any) => {\n if (isSelectionChange<Node<Data>>(change)) {\n if (change.added) {\n change.added.forEach((node) => node.expand());\n }\n if (change.removed) {\n change.removed\n .slice()\n .reverse()\n .forEach((node) => node.collapse());\n }\n }\n });\n\n let loadRoot: Promise<Array<Node<Data>> | void> = Promise.resolve();\n\n if (this.tree$.value.length === 0) {\n loadRoot = this.getTreeRoot();\n }\n\n return from(loadRoot).pipe(\n tap((rootNodes) => {\n if (rootNodes) {\n const promises: Promise<any>[] = [];\n if (this.metadata.selectMultiple) {\n if (!this.selected.hasValue()) {\n promises.push(\n ...rootNodes\n .filter((node) => node.hasDetails)\n .map((node) => node.select())\n );\n }\n if (!this.expanded.hasValue()) {\n promises.push(\n ...rootNodes\n .filter((node) => node.hasChildren)\n .map((node) => node.expand())\n );\n }\n } else if (rootNodes.length) {\n const rootNode = rootNodes[0];\n if (!this.selected.hasValue()) {\n // TODO : rename hasDetails to isSelectable\n if (rootNode.hasDetails) {\n promises.push(rootNode.select());\n }\n }\n if (!this.expanded.hasValue()) {\n promises.push(rootNode.expand());\n }\n }\n return Promise.all(promises);\n }\n return Promise.resolve();\n }),\n switchMap(() =>\n merge(collectionViewer.viewChange, this._data$).pipe(\n map(() => this._data$.value)\n )\n ),\n switchMap(nodeList => this._refreshMatchFilter.pipe(\n startWith(null),\n map(() => nodeList.filter(node => this.matchFilter(node)))\n )),\n );\n }\n\n public async refresh(): Promise<any> {\n const rootNodes = await this.getTreeRoot();\n\n // refresh all expanded nodes;\n\n const loadExpandedNodes = async (children: ReadonlyArray<Node<Data>>) => {\n for (const child of children) {\n if (this.expanded.isSelected(child.id)) {\n // call the node method to ensure that the expanded property of\n // Node is set.\n await child.expand();\n }\n\n if (child.hasChildren) {\n await loadExpandedNodes(child.children);\n }\n }\n };\n\n await Promise.all(\n rootNodes\n .filter((node) => node.hasChildren)\n .map((node) => loadExpandedNodes(node.children))\n );\n\n const selected: Array<Node<Data>> = this.selected.selected\n .map((node) => this.getNodeById(node.id))\n .filter(Boolean) as any;\n this.selected.clear();\n this.selected.select(...selected);\n }\n\n private initSelected(): void {\n const key = joinPath('rxap/tree', this.id, 'selected');\n if (this.metadata.cacheSelected) {\n if (localStorage.getItem(key)) {\n try {\n this._preSelected = JSON.parse(localStorage.getItem(key)!);\n } catch (e) {\n console.debug('parse expanded tree data source nodes failed');\n }\n }\n }\n\n this.selected = new SelectionModel<Node<Data>>(\n !!this.metadata.selectMultiple,\n []\n );\n if (this.metadata.cacheSelected) {\n this._selectedLocalStorageSubscription = this.selected.changed\n .pipe(\n tap(() =>\n localStorage.setItem(\n key,\n JSON.stringify(this.selected.selected.map((s) => s.id))\n )\n )\n )\n .subscribe();\n }\n }\n\n public reset(): any {\n this.selected.clear();\n this.expanded.clear();\n return this.getTreeRoot();\n }\n\n private initExpanded(): void {\n const key = joinPath('rxap/tree', this.id, 'expanded');\n let expanded = [];\n if (this.metadata.cacheExpanded) {\n if (localStorage.getItem(key)) {\n try {\n expanded = JSON.parse(localStorage.getItem(key)!);\n } catch (e) {\n console.debug('parse expanded tree data source nodes failed');\n }\n }\n }\n\n this.expanded = new SelectionModel<string>(\n this.metadata.expandMultiple !== false,\n expanded\n );\n if (this.metadata.cacheExpanded) {\n this._expandedLocalStorageSubscription = this.expanded.changed\n .pipe(\n tap(() =>\n localStorage.setItem(key, JSON.stringify(this.expanded.selected))\n )\n )\n .subscribe();\n }\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=rxap-tree.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rxap-tree.js","sourceRoot":"","sources":["../../../../libs/tree/src/rxap-tree.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"rxap-tree.js","sources":["../../../../libs/tree/src/lib/tree.data-source.ts","../../../../libs/tree/src/lib/tree-content.directive.ts","../../../../libs/tree/src/lib/tokens.ts","../../../../libs/tree/src/lib/tree.component.ts","../../../../libs/tree/src/lib/tree.component.html","../../../../libs/tree/src/lib/tree.component.module.ts","../../../../libs/tree/src/rxap-tree.ts"],"sourcesContent":["import {\n BehaviorSubject,\n from,\n merge,\n Observable,\n Subject,\n Subscription\n} from 'rxjs';\nimport { FlatTreeControl } from '@angular/cdk/tree';\nimport {\n SelectionChange,\n SelectionModel\n} from '@angular/cdk/collections';\nimport {\n map,\n startWith,\n switchMap,\n tap\n} from 'rxjs/operators';\nimport {\n BaseDataSource,\n BaseDataSourceMetadata,\n BaseDataSourceViewer,\n RXAP_DATA_SOURCE_METADATA\n} from '@rxap/data-source';\nimport {\n joinPath,\n Required,\n WithChildren,\n WithIdentifier\n} from '@rxap/utilities';\nimport {\n Inject,\n Injectable,\n InjectionToken,\n isDevMode\n} from '@angular/core';\nimport {\n ExpandNodeFunction,\n Node,\n NodeGetIconFunction,\n NodeHasDetailsFunction,\n NodeToDisplayFunction,\n Method,\n ToggleSubject\n} from '@rxap/utilities/rxjs';\n\nexport function isSelectionChange<T>(obj: any): obj is SelectionChange<T> {\n return !!obj && obj.hasOwnProperty('added') && obj.hasOwnProperty('removed');\n}\n\nexport interface TreeDataSourceMetadata extends BaseDataSourceMetadata {\n selectMultiple?: boolean;\n expandMultiple?: boolean;\n}\n\nexport const RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD = new InjectionToken(\n 'rxap/tree/data-source/root-remote-method'\n);\nexport const RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD = new InjectionToken(\n 'rxap/tree/data-source/children-remote-method'\n);\n\n@Injectable()\nexport class TreeDataSource<\n Data extends WithIdentifier & WithChildren = any,\n RootParameters = any\n > extends BaseDataSource<Array<Node<Data>>> {\n public tree$ = new BehaviorSubject<Array<Node<Data>>>([]);\n @Required public treeControl!: FlatTreeControl<Node<Data>>;\n public selected!: SelectionModel<Node<Data>>;\n public expanded!: SelectionModel<string>;\n\n private _expandedLocalStorageSubscription: Subscription | null = null;\n private _selectedLocalStorageSubscription: Subscription | null = null;\n\n // TODO : änlich problem wie bei der redundaten expand SelectionModel.\n // im localStorage wird nur die id gespeichert.\n private _preSelected: string[] = [];\n\n protected _data$ = new BehaviorSubject<Array<Node<Data>>>([]);\n public metadata!: TreeDataSourceMetadata;\n\n public loading$ = new ToggleSubject(true);\n\n public toDisplay: NodeToDisplayFunction<Data> = () =>\n 'to display function not defined';\n public getIcon: NodeGetIconFunction<Data> = () => null;\n public hasDetails: NodeHasDetailsFunction<Data> = () => true;\n public matchFilter: (node: Node<Data>) => boolean = () => true;\n\n private _refreshMatchFilter = new Subject();\n\n constructor(\n @Inject(RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD)\n public readonly rootRemoteMethod: Method<Data | Data[], RootParameters>,\n @Inject(RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD)\n public readonly childrenRemoteMethod: Method<Data[], Node<Data>>,\n @Inject(RXAP_DATA_SOURCE_METADATA)\n metadata: TreeDataSourceMetadata | null = null\n ) {\n super(metadata);\n this.tree$\n .pipe(\n map((tree) =>\n tree\n .map((child) => this.flatTree(child))\n .reduce((acc, nodes) => [...acc, ...nodes], [])\n )\n )\n .subscribe(this._data$);\n\n // TODO add new SelectModel class that saves the select model to the localStorage\n this.initSelected();\n this.initExpanded();\n }\n\n public async getTreeRoot(): Promise<Array<Node<Data>>> {\n this.loading$.enable();\n const root: Data | Data[] = await this.getRoot();\n\n let rootNodes: Array<Node<Data>>;\n\n if (Array.isArray(root)) {\n rootNodes = await Promise.all(root.map((node) => this._toNode(node)));\n } else {\n rootNodes = [await this._toNode(root)];\n }\n\n this.tree$.next(rootNodes);\n\n this.loading$.disable();\n\n return rootNodes;\n }\n\n public selectNode(node: Node<Data>): Promise<void> {\n if (!this.selected.isMultipleSelection()) {\n if (this.selected.hasValue()) {\n const currentSelectedNode = this.selected.selected[0];\n currentSelectedNode.deselect();\n }\n }\n this.selected.select(node);\n return Promise.resolve();\n }\n\n public setTreeControl(treeControl: FlatTreeControl<Node<Data>>): void {\n this.treeControl = treeControl;\n }\n\n public setMatchFilter(matchFilter: (node: Node<Data>) => boolean): void {\n this.matchFilter = matchFilter;\n }\n\n public setToDisplay(\n toDisplay: NodeToDisplayFunction<Data> = this.toDisplay\n ): void {\n this.toDisplay = toDisplay;\n }\n\n public setGetIcon(getIcon: NodeGetIconFunction<Data> = this.getIcon): void {\n this.getIcon = getIcon;\n }\n\n public setHasDetails(\n hasDetails: NodeHasDetailsFunction<Data> = this.hasDetails\n ): void {\n this.hasDetails = hasDetails;\n }\n\n public deselectNode(node: Node<Data>): Promise<void> {\n this.selected.deselect(node);\n return Promise.resolve();\n }\n\n // - the SelectModel that stores the selection into the local storage?\n public async _toNode(\n item: Data,\n depth: number = 0,\n onExpand: ExpandNodeFunction<Data> = this.expandNode.bind(this),\n onCollapse: ExpandNodeFunction<Data> = this.collapseNode.bind(this),\n onSelect: ExpandNodeFunction<Data> = this.selectNode.bind(this),\n onDeselect: ExpandNodeFunction<Data> = this.deselectNode.bind(this)\n ): Promise<Node<Data>> {\n const node = await this.toNode(\n item,\n depth,\n onExpand,\n onCollapse,\n onSelect,\n onDeselect\n );\n\n if (this.expanded.isSelected(node.id)) {\n node\n .expand()\n .then(() => {\n // TODO : remove redundant this.expanded SelectionModel. Only store expanded nodes in this.treeControl.expansionModel\n // das problem ist das ich beim speicher in localStorage nur die id speicher.\n // Des wegen kann ich beim laden aus dem localStorage this.treeControl.expansionModel\n // nicht einfach mit den expanend nodes fullen. Da dort das node object benötigt wird\n // möglich lösungen:\n // - das node object läde die entity mithilfe der id automatisch nach\n this.treeControl.expansionModel.select(node);\n console.debug(`Restore expand for node '${node.id}' SUCCESSFULLY`);\n })\n .catch(() =>\n console.debug(`Restore expand for node '${node.id}' FAILED`)\n );\n }\n\n if (this._preSelected.includes(node.id)) {\n await node\n .select()\n .then(() =>\n console.debug(`Restore select for node '${node.id}' SUCCESSFULLY`)\n )\n .catch(() =>\n console.debug(`Restore select for node '${node.id}' FAILED`)\n );\n }\n\n return node;\n }\n\n public async expandNode(node: Node<Data>): Promise<void> {\n if (node.item.hasChildren && !node.item.children?.length) {\n node.isLoading$.enable();\n\n const children = await this.getChildren(node);\n\n // add the loaded children to the item object\n node.item.children = children;\n\n node.addChildren(\n await Promise.all(children.map((child) =>\n this._toNode(child, node.depth + 1, node.onExpand, node.onCollapse)\n ))\n );\n\n node.isLoading$.disable();\n }\n\n this.expanded.select(node.id);\n\n this.tree$.next(this.tree$.value);\n }\n\n public async getChildren(node: Node<Data>): Promise<Data[]> {\n return this.childrenRemoteMethod.call(node);\n }\n\n public async getRoot(): Promise<Data | Data[]> {\n const rootParameters = await this.getRootParameters();\n return this.rootRemoteMethod.call(rootParameters);\n }\n\n public async getRootParameters(): Promise<RootParameters> {\n return undefined as any;\n }\n\n // TODO : find better solution to allow the overwrite of the toNode method\n // without losing the custom preselect and preexpand function\n\n public getNodeById(id: string): Node<Data> | null {\n function getNodeById(node: Node<Data>, nodeId: string) {\n if (node.id === nodeId) {\n return node;\n }\n if (node.hasNode(nodeId)) {\n return node.getNode(nodeId);\n } else {\n return null;\n }\n }\n\n return (\n this.tree$.value\n .map((node) => getNodeById(node, id))\n .filter(Boolean)[0] || null\n );\n }\n\n public async toNode(\n item: Data,\n depth: number = 0,\n onExpand: ExpandNodeFunction<Data> = this.expandNode.bind(this),\n onCollapse: ExpandNodeFunction<Data> = this.collapseNode.bind(this),\n onSelect: ExpandNodeFunction<Data> = this.selectNode.bind(this),\n onDeselect: ExpandNodeFunction<Data> = this.deselectNode.bind(this)\n ): Promise<Node<Data>> {\n return Node.ToNode(\n item,\n depth,\n onExpand,\n onCollapse,\n this.toDisplay,\n this.getIcon,\n onSelect,\n onDeselect,\n this.hasDetails\n );\n }\n\n public collapseNode(node: Node<Data>): Promise<void> {\n this.expanded.deselect(node.id);\n\n this.tree$.next(this.tree$.value);\n\n return Promise.resolve();\n }\n\n public flatTree(tree: Node<Data>): Array<Node<Data>> {\n function flat(acc: any[], list: any[]) {\n return [...acc, ...list];\n }\n\n const flatTree = (node: Node<Data>): Array<Node<Data>> => {\n if (!Array.isArray(node.children)) {\n if (isDevMode()) {\n console.log(node);\n }\n throw new Error('Node has not defined children');\n }\n\n if (node.expanded || this.expanded.isSelected(node.id)) {\n return [\n node,\n ...node.children.map((child) => flatTree(child)).reduce(flat, []),\n ];\n } else {\n return [node];\n }\n };\n\n return flatTree(tree);\n }\n\n public destroy(): void {\n super.destroy();\n // TODO : add subscription handler to BaseDataSource\n if (this._expandedLocalStorageSubscription) {\n this._expandedLocalStorageSubscription.unsubscribe();\n }\n if (this._selectedLocalStorageSubscription) {\n this._selectedLocalStorageSubscription.unsubscribe();\n }\n }\n\n public refreshMatchFilter(): void {\n this._refreshMatchFilter.next();\n }\n\n protected _connect(\n collectionViewer: Required<BaseDataSourceViewer>\n ): Observable<Array<Node<Data>>> {\n this.treeControl.expansionModel.changed.subscribe((change: any) => {\n if (isSelectionChange<Node<Data>>(change)) {\n if (change.added) {\n change.added.forEach((node) => node.expand());\n }\n if (change.removed) {\n change.removed\n .slice()\n .reverse()\n .forEach((node) => node.collapse());\n }\n }\n });\n\n let loadRoot: Promise<Array<Node<Data>> | void> = Promise.resolve();\n\n if (this.tree$.value.length === 0) {\n loadRoot = this.getTreeRoot();\n }\n\n return from(loadRoot).pipe(\n tap((rootNodes) => {\n if (rootNodes) {\n const promises: Promise<any>[] = [];\n if (this.metadata.selectMultiple) {\n if (!this.selected.hasValue()) {\n promises.push(\n ...rootNodes\n .filter((node) => node.hasDetails)\n .map((node) => node.select())\n );\n }\n if (!this.expanded.hasValue()) {\n promises.push(\n ...rootNodes\n .filter((node) => node.hasChildren)\n .map((node) => node.expand())\n );\n }\n } else if (rootNodes.length) {\n const rootNode = rootNodes[0];\n if (!this.selected.hasValue()) {\n // TODO : rename hasDetails to isSelectable\n if (rootNode.hasDetails) {\n promises.push(rootNode.select());\n }\n }\n if (!this.expanded.hasValue()) {\n promises.push(rootNode.expand());\n }\n }\n return Promise.all(promises);\n }\n return Promise.resolve();\n }),\n switchMap(() =>\n merge(collectionViewer.viewChange, this._data$).pipe(\n map(() => this._data$.value)\n )\n ),\n switchMap(nodeList => this._refreshMatchFilter.pipe(\n startWith(null),\n map(() => nodeList.filter(node => this.matchFilter(node)))\n )),\n );\n }\n\n public async refresh(): Promise<any> {\n const rootNodes = await this.getTreeRoot();\n\n // refresh all expanded nodes;\n\n const loadExpandedNodes = async (children: ReadonlyArray<Node<Data>>) => {\n for (const child of children) {\n if (this.expanded.isSelected(child.id)) {\n // call the node method to ensure that the expanded property of\n // Node is set.\n await child.expand();\n }\n\n if (child.hasChildren) {\n await loadExpandedNodes(child.children);\n }\n }\n };\n\n await Promise.all(\n rootNodes\n .filter((node) => node.hasChildren)\n .map((node) => loadExpandedNodes(node.children))\n );\n\n const selected: Array<Node<Data>> = this.selected.selected\n .map((node) => this.getNodeById(node.id))\n .filter(Boolean) as any;\n this.selected.clear();\n this.selected.select(...selected);\n }\n\n private initSelected(): void {\n const key = joinPath('rxap/tree', this.id, 'selected');\n if (this.metadata.cacheSelected) {\n if (localStorage.getItem(key)) {\n try {\n this._preSelected = JSON.parse(localStorage.getItem(key)!);\n } catch (e) {\n console.debug('parse expanded tree data source nodes failed');\n }\n }\n }\n\n this.selected = new SelectionModel<Node<Data>>(\n !!this.metadata.selectMultiple,\n []\n );\n if (this.metadata.cacheSelected) {\n this._selectedLocalStorageSubscription = this.selected.changed\n .pipe(\n tap(() =>\n localStorage.setItem(\n key,\n JSON.stringify(this.selected.selected.map((s) => s.id))\n )\n )\n )\n .subscribe();\n }\n }\n\n public reset(): any {\n this.selected.clear();\n this.expanded.clear();\n return this.getTreeRoot();\n }\n\n private initExpanded(): void {\n const key = joinPath('rxap/tree', this.id, 'expanded');\n let expanded = [];\n if (this.metadata.cacheExpanded) {\n if (localStorage.getItem(key)) {\n try {\n expanded = JSON.parse(localStorage.getItem(key)!);\n } catch (e) {\n console.debug('parse expanded tree data source nodes failed');\n }\n }\n }\n\n this.expanded = new SelectionModel<string>(\n this.metadata.expandMultiple !== false,\n expanded\n );\n if (this.metadata.cacheExpanded) {\n this._expandedLocalStorageSubscription = this.expanded.changed\n .pipe(\n tap(() =>\n localStorage.setItem(key, JSON.stringify(this.expanded.selected))\n )\n )\n .subscribe();\n }\n }\n}\n","import { Directive, TemplateRef, Inject } from '@angular/core';\n\n@Directive({\n // tslint:disable-next-line:directive-selector\n selector: 'ng-template[rxapTreeContent]',\n})\nexport class TreeContentDirective {\n constructor(\n @Inject(TemplateRef)\n public readonly template: TemplateRef<any>\n ) {}\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const RXAP_TREE_CONTENT_EDITABLE_METHOD = new InjectionToken('rxap/tree-content-editable-method');\n","import {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n EventEmitter,\n Inject,\n Input,\n OnInit,\n Optional,\n Output,\n ViewContainerRef,\n ElementRef,\n ViewChild,\n Renderer2,\n HostListener\n} from '@angular/core';\nimport {\n DebounceCall,\n Required,\n WithChildren,\n WithIdentifier\n} from '@rxap/utilities';\nimport { FlatTreeControl } from '@angular/cdk/tree';\nimport {\n map,\n startWith,\n tap\n} from 'rxjs/operators';\nimport { TreeContentDirective } from './tree-content.directive';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { RXAP_TREE_CONTENT_EDITABLE_METHOD } from './tokens';\nimport { TreeDataSource } from './tree.data-source';\nimport {\n Method,\n Node,\n NodeGetIconFunction,\n NodeHasDetailsFunction,\n NodeToDisplayFunction,\n ToggleSubject\n} from '@rxap/utilities/rxjs';\n\n@Component({\n // tslint:disable-next-line:component-selector\n selector: 'rxap-tree',\n templateUrl: './tree.component.html',\n styleUrls: [ './tree.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TreeComponent<Data extends WithIdentifier & WithChildren = any>\n implements OnInit, AfterContentInit {\n public get nodeDisplayEditable(): boolean {\n return !!this.contentEditableMethod;\n }\n\n public treeControl: FlatTreeControl<Node<Data>>;\n @Input()\n @Required\n public dataSource!: TreeDataSource<Data>;\n @Input()\n public contentEditableMethod?: Method<any, string | null> | null;\n @Input()\n public toDisplay?: NodeToDisplayFunction<any>;\n\n @Input()\n public getIcon?: NodeGetIconFunction<any>;\n\n @Input()\n public multiple: boolean = false;\n\n @Input()\n public hasDetails?: NodeHasDetailsFunction<any>;\n\n @ContentChild(TreeContentDirective, { static: true })\n public content?: TreeContentDirective;\n\n @Input()\n public hideLeafIcon: boolean = false;\n\n @Input()\n public id?: string;\n\n @Output()\n public details = new EventEmitter();\n\n public get cacheId() {\n return ['rxap', 'tree', this.id].join('/');\n }\n\n public portal: TemplatePortal | null = null;\n public getLevel = (node: Node<Data>) => node.depth;\n public isExpandable = (node: Node<Data>) => node.hasChildren;\n public hasChild = (_: number, nodeData: Node<Data>) => nodeData.hasChildren;\n\n @ViewChild('treeContainer', { static: true })\n public treeContainer!: ElementRef;\n\n /**\n * Indicates that the divider is moved with mouse down\n * @private\n */\n private _moveDivider = false;\n\n /**\n * Holds the current tree container width.\n * If null the move divider feature was not yet used and the initial\n * container width is not calculated\n * @private\n */\n private _treeContainerWidth: number | null = null;\n\n constructor(\n @Inject(ViewContainerRef)\n private readonly viewContainerRef: ViewContainerRef,\n @Inject(ChangeDetectorRef)\n private readonly cdr: ChangeDetectorRef,\n @Optional()\n @Inject(RXAP_TREE_CONTENT_EDITABLE_METHOD)\n contentEditableMethod: Method<any, string | null> | null,\n private readonly renderer: Renderer2\n ) {\n this.treeControl = new FlatTreeControl(this.getLevel, this.isExpandable);\n this.contentEditableMethod = contentEditableMethod;\n }\n\n public ngOnInit() {\n this.dataSource.setTreeControl(this.treeControl);\n this.dataSource.setToDisplay(this.toDisplay);\n this.dataSource.setGetIcon(this.getIcon);\n this.dataSource.setHasDetails(this.hasDetails);\n this.multiple = this.dataSource.metadata.selectMultiple ?? this.multiple;\n\n if (this.dataSource.selected.hasValue()) {\n this.dataSource.selected.selected.forEach((node) =>\n this.openDetails(node)\n );\n }\n\n const cachedOffset = localStorage.getItem(this.cacheId);\n if (cachedOffset && cachedOffset.match(/^(\\d+\\.)?\\d+px$/)) {\n this.setDividerOffset(cachedOffset);\n }\n }\n\n public ngAfterContentInit(): void {\n this.dataSource.selected.changed\n .pipe(\n map(($event) => $event.source.selected),\n startWith(this.dataSource.selected.selected),\n tap((selected) => selected.forEach((node) => this.openDetails(node)))\n )\n .subscribe();\n }\n\n @DebounceCall(100)\n public openDetails(node: Node<Data>): void {\n if (this.content) {\n this.portal = new TemplatePortal<any>(\n this.content.template,\n this.viewContainerRef,\n {\n $implicit: node.item,\n node,\n }\n );\n this.cdr.markForCheck();\n }\n this.details.emit(node.item);\n }\n\n public onContentEditableChange(value: string | null, node: Node<Data>) {\n return this.contentEditableMethod?.call(value, node.item, node);\n }\n\n\n onMousedown() {\n this._moveDivider = true;\n }\n\n @HostListener('mouseup')\n onMouseup() {\n this._moveDivider = false;\n }\n\n @HostListener('mousemove', [ '$event' ])\n onMousemove($event: MouseEvent) {\n if (this._moveDivider) {\n if (!this._treeContainerWidth) {\n this._treeContainerWidth = this.treeContainer.nativeElement.clientWidth as number;\n }\n this._treeContainerWidth = $event.clientX - 75;\n const offset = this._treeContainerWidth + 'px';\n this.setDividerOffset(offset);\n }\n }\n\n private setDividerOffset(offset: string) {\n this.renderer.setStyle(this.treeContainer.nativeElement, 'max-width', offset);\n this.renderer.setStyle(this.treeContainer.nativeElement, 'min-width', offset);\n this.renderer.setStyle(this.treeContainer.nativeElement, 'flex-basis', offset);\n localStorage.setItem(this.cacheId, offset);\n }\n\n}\n","<div class=\"container\" fxLayout=\"row\">\n <div #treeContainer class=\"tree-container\" fxFlex=\"nogrow\">\n <mat-progress-bar *ngIf=\"!dataSource || (dataSource.loading$ | async)\" mode=\"indeterminate\"></mat-progress-bar>\n <mat-tree *ngIf=\"dataSource; else loading\" [dataSource]=\"dataSource\" [treeControl]=\"treeControl\" class=\"tree-view\">\n\n <!-- Node without children -->\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding>\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon [fxHide]=\"hideLeafIcon\" fxFlex=\"40px\">subdirectory_arrow_right</mat-icon>\n <mat-icon *ngIf=\"node.icon\" [rxapIcon]=\"node.icon\" fxFlex=\"40px\"></mat-icon>\n <ng-template [ngIf]=\"multiple\">\n <mat-checkbox (change)=\"node.toggleSelect()\" [checked]=\"node.selected\" [disabled]=\"!node.hasDetails\" fxFlex=\"nogrow\">{{ node.display }}</mat-checkbox>\n </ng-template>\n <ng-template [ngIf]=\"!multiple\">\n <button\n (click)=\"node.select()\"\n [color]=\"node.selected ? 'primary' : null\"\n [disabled]=\"!node.hasDetails\"\n fxFlex=\"nogrow\"\n mat-button\n >\n {{ node.display }}\n </button>\n </ng-template>\n </div>\n </mat-tree-node>\n\n <!-- Node with children -->\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding>\n <button [attr.aria-label]=\"'toggle ' + node.filename\" mat-icon-button matTreeNodeToggle>\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon *ngIf=\"node.icon; else withoutIcon\" [rxapIcon]=\"node.icon\" fxFlex=\"40px\"></mat-icon>\n <ng-template #withoutIcon>\n <div fxFlex=\"0\"></div>\n </ng-template>\n <ng-template [ngIfElse]=\"withoutDetails\" [ngIf]=\"node.hasDetails\">\n <button\n (click)=\"node.select()\"\n [color]=\"node.selected ? 'primary' : null\"\n fxFlex=\"nogrow\"\n mat-button\n >\n {{ node.display }}\n </button>\n </ng-template>\n <ng-template #withoutDetails>\n <span\n (change)=\"onContentEditableChange($event, node)\"\n [disabled]=\"!nodeDisplayEditable\"\n fxFlex=\"nogrow\"\n rxapContenteditable>\n {{ node.display }}\n </span>\n </ng-template>\n <mat-progress-spinner\n *ngIf=\"node.isLoading$ | async\"\n [diameter]=\"16\"\n fxFlex=\"nogrow\"\n fxFlexOffset=\"16px\"\n mode=\"indeterminate\"\n ></mat-progress-spinner>\n </div>\n </mat-tree-node>\n\n </mat-tree>\n </div>\n\n <div (mousedown)=\"onMousedown()\"\n class=\"divider\"\n fxFlex=\"nogrow\">\n <mat-divider\n [vertical]=\"true\"\n >\n </mat-divider>\n </div>\n\n <div class=\"details\" fxFlex=\"grow\">\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n <ng-content></ng-content>\n </div>\n</div>\n\n<ng-template #loading>Load data source</ng-template>\n","import { NgModule } from '@angular/core';\nimport { TreeComponent } from './tree.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatTreeModule } from '@angular/material/tree';\nimport { CommonModule } from '@angular/common';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { TreeContentDirective } from './tree-content.directive';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { ContenteditableDirectiveModule } from '@rxap/contenteditable';\nimport { IconDirectiveModule } from '@rxap/material-directives/icon';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n@NgModule({\n imports: [\n CommonModule,\n MatTreeModule,\n MatButtonModule,\n MatIconModule,\n FlexLayoutModule,\n MatDividerModule,\n MatProgressSpinnerModule,\n PortalModule,\n ContenteditableDirectiveModule,\n IconDirectiveModule,\n MatCheckboxModule,\n MatProgressBarModule\n ],\n declarations: [ TreeComponent, TreeContentDirective ],\n exports: [ TreeComponent, TreeContentDirective ],\n entryComponents: [ TreeComponent ]\n})\nexport class TreeComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA+CgB,iBAAiB,CAAI,GAAQ;IAC3C,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AAC/E,CAAC;MAOY,wCAAwC,GAAG,IAAI,cAAc,CACxE,0CAA0C,EAC1C;MACW,4CAA4C,GAAG,IAAI,cAAc,CAC5E,8CAA8C,EAC9C;MAGW,cAGT,SAAQ,cAAiC;IA0B3C,YAEkB,gBAAuD,EAEvD,oBAAgD,EAE9D,WAA0C,IAAI;QAEhD,KAAK,CAAC,QAAQ,CAAC,CAAC;QANA,qBAAgB,GAAhB,gBAAgB,CAAuC;QAEvD,yBAAoB,GAApB,oBAAoB,CAA4B;QA7B3D,UAAK,GAAG,IAAI,eAAe,CAAoB,EAAE,CAAC,CAAC;QAKlD,sCAAiC,G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