@rxap/tree 12.5.1 → 13.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1078 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('@angular/cdk/tree'), require('@angular/cdk/collections'), require('rxjs/operators'), require('@rxap/data-source'), require('@rxap/utilities'), require('@angular/core'), require('@rxap/utilities/rxjs'), require('@angular/cdk/portal'), require('@angular/material/progress-bar'), require('@angular/material/tree'), require('@angular/material/icon'), require('@angular/material/checkbox'), require('@angular/material/button'), require('@angular/material/progress-spinner'), require('@angular/material/divider'), require('@angular/flex-layout/flex'), require('@angular/common'), require('@angular/flex-layout/extended'), require('@rxap/material-directives/icon'), require('@rxap/contenteditable'), require('@angular/flex-layout')) :
3
- typeof define === 'function' && define.amd ? define('@rxap/tree', ['exports', 'rxjs', '@angular/cdk/tree', '@angular/cdk/collections', 'rxjs/operators', '@rxap/data-source', '@rxap/utilities', '@angular/core', '@rxap/utilities/rxjs', '@angular/cdk/portal', '@angular/material/progress-bar', '@angular/material/tree', '@angular/material/icon', '@angular/material/checkbox', '@angular/material/button', '@angular/material/progress-spinner', '@angular/material/divider', '@angular/flex-layout/flex', '@angular/common', '@angular/flex-layout/extended', '@rxap/material-directives/icon', '@rxap/contenteditable', '@angular/flex-layout'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.rxap = global.rxap || {}, global.rxap.tree = {}), global.rxjs, global.ng.cdk.tree, global.ng.cdk.collections, global.rxjs.operators, global.dataSource, global.utilities, global.ng.core, global.rxjs$1, global.ng.cdk.portal, global.ng.material.progressBar, global.ng.material.tree, global.ng.material.icon, global.ng.material.checkbox, global.ng.material.button, global.ng.material.progressSpinner, global.ng.material.divider, global.ng.flexLayout.flex, global.ng.common, global.ng.flexLayout.extended, global.i11, global.i12, global.ng.flexLayout));
5
- })(this, (function (exports, rxjs, tree, collections, operators, dataSource, utilities, i0, rxjs$1, i13, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, flexLayout) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i13__namespace = /*#__PURE__*/_interopNamespace(i13);
27
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
28
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
29
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
30
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
31
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
32
- var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
33
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
34
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
35
- var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
36
- var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
37
- var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
38
- var i12__namespace = /*#__PURE__*/_interopNamespace(i12);
39
-
40
- /*! *****************************************************************************
41
- Copyright (c) Microsoft Corporation.
42
-
43
- Permission to use, copy, modify, and/or distribute this software for any
44
- purpose with or without fee is hereby granted.
45
-
46
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
47
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
48
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
49
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
50
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
51
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
52
- PERFORMANCE OF THIS SOFTWARE.
53
- ***************************************************************************** */
54
- /* global Reflect, Promise */
55
- var extendStatics = function (d, b) {
56
- extendStatics = Object.setPrototypeOf ||
57
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
58
- function (d, b) { for (var p in b)
59
- if (Object.prototype.hasOwnProperty.call(b, p))
60
- d[p] = b[p]; };
61
- return extendStatics(d, b);
62
- };
63
- function __extends(d, b) {
64
- if (typeof b !== "function" && b !== null)
65
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
66
- extendStatics(d, b);
67
- function __() { this.constructor = d; }
68
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
69
- }
70
- var __assign = function () {
71
- __assign = Object.assign || function __assign(t) {
72
- for (var s, i = 1, n = arguments.length; i < n; i++) {
73
- s = arguments[i];
74
- for (var p in s)
75
- if (Object.prototype.hasOwnProperty.call(s, p))
76
- t[p] = s[p];
77
- }
78
- return t;
79
- };
80
- return __assign.apply(this, arguments);
81
- };
82
- function __rest(s, e) {
83
- var t = {};
84
- for (var p in s)
85
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
86
- t[p] = s[p];
87
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
88
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
89
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
90
- t[p[i]] = s[p[i]];
91
- }
92
- return t;
93
- }
94
- function __decorate(decorators, target, key, desc) {
95
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
96
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
97
- r = Reflect.decorate(decorators, target, key, desc);
98
- else
99
- for (var i = decorators.length - 1; i >= 0; i--)
100
- if (d = decorators[i])
101
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
102
- return c > 3 && r && Object.defineProperty(target, key, r), r;
103
- }
104
- function __param(paramIndex, decorator) {
105
- return function (target, key) { decorator(target, key, paramIndex); };
106
- }
107
- function __metadata(metadataKey, metadataValue) {
108
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
109
- return Reflect.metadata(metadataKey, metadataValue);
110
- }
111
- function __awaiter(thisArg, _arguments, P, generator) {
112
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
113
- return new (P || (P = Promise))(function (resolve, reject) {
114
- function fulfilled(value) { try {
115
- step(generator.next(value));
116
- }
117
- catch (e) {
118
- reject(e);
119
- } }
120
- function rejected(value) { try {
121
- step(generator["throw"](value));
122
- }
123
- catch (e) {
124
- reject(e);
125
- } }
126
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
127
- step((generator = generator.apply(thisArg, _arguments || [])).next());
128
- });
129
- }
130
- function __generator(thisArg, body) {
131
- var _ = { label: 0, sent: function () { if (t[0] & 1)
132
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
133
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
134
- function verb(n) { return function (v) { return step([n, v]); }; }
135
- function step(op) {
136
- if (f)
137
- throw new TypeError("Generator is already executing.");
138
- while (_)
139
- try {
140
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
141
- return t;
142
- if (y = 0, t)
143
- op = [op[0] & 2, t.value];
144
- switch (op[0]) {
145
- case 0:
146
- case 1:
147
- t = op;
148
- break;
149
- case 4:
150
- _.label++;
151
- return { value: op[1], done: false };
152
- case 5:
153
- _.label++;
154
- y = op[1];
155
- op = [0];
156
- continue;
157
- case 7:
158
- op = _.ops.pop();
159
- _.trys.pop();
160
- continue;
161
- default:
162
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
163
- _ = 0;
164
- continue;
165
- }
166
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
167
- _.label = op[1];
168
- break;
169
- }
170
- if (op[0] === 6 && _.label < t[1]) {
171
- _.label = t[1];
172
- t = op;
173
- break;
174
- }
175
- if (t && _.label < t[2]) {
176
- _.label = t[2];
177
- _.ops.push(op);
178
- break;
179
- }
180
- if (t[2])
181
- _.ops.pop();
182
- _.trys.pop();
183
- continue;
184
- }
185
- op = body.call(thisArg, _);
186
- }
187
- catch (e) {
188
- op = [6, e];
189
- y = 0;
190
- }
191
- finally {
192
- f = t = 0;
193
- }
194
- if (op[0] & 5)
195
- throw op[1];
196
- return { value: op[0] ? op[1] : void 0, done: true };
197
- }
198
- }
199
- var __createBinding = Object.create ? (function (o, m, k, k2) {
200
- if (k2 === undefined)
201
- k2 = k;
202
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
203
- }) : (function (o, m, k, k2) {
204
- if (k2 === undefined)
205
- k2 = k;
206
- o[k2] = m[k];
207
- });
208
- function __exportStar(m, o) {
209
- for (var p in m)
210
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
211
- __createBinding(o, m, p);
212
- }
213
- function __values(o) {
214
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
215
- if (m)
216
- return m.call(o);
217
- if (o && typeof o.length === "number")
218
- return {
219
- next: function () {
220
- if (o && i >= o.length)
221
- o = void 0;
222
- return { value: o && o[i++], done: !o };
223
- }
224
- };
225
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
226
- }
227
- function __read(o, n) {
228
- var m = typeof Symbol === "function" && o[Symbol.iterator];
229
- if (!m)
230
- return o;
231
- var i = m.call(o), r, ar = [], e;
232
- try {
233
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
234
- ar.push(r.value);
235
- }
236
- catch (error) {
237
- e = { error: error };
238
- }
239
- finally {
240
- try {
241
- if (r && !r.done && (m = i["return"]))
242
- m.call(i);
243
- }
244
- finally {
245
- if (e)
246
- throw e.error;
247
- }
248
- }
249
- return ar;
250
- }
251
- /** @deprecated */
252
- function __spread() {
253
- for (var ar = [], i = 0; i < arguments.length; i++)
254
- ar = ar.concat(__read(arguments[i]));
255
- return ar;
256
- }
257
- /** @deprecated */
258
- function __spreadArrays() {
259
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
260
- s += arguments[i].length;
261
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
262
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
263
- r[k] = a[j];
264
- return r;
265
- }
266
- function __spreadArray(to, from) {
267
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
268
- to[j] = from[i];
269
- return to;
270
- }
271
- function __await(v) {
272
- return this instanceof __await ? (this.v = v, this) : new __await(v);
273
- }
274
- function __asyncGenerator(thisArg, _arguments, generator) {
275
- if (!Symbol.asyncIterator)
276
- throw new TypeError("Symbol.asyncIterator is not defined.");
277
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
278
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
279
- function verb(n) { if (g[n])
280
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
281
- function resume(n, v) { try {
282
- step(g[n](v));
283
- }
284
- catch (e) {
285
- settle(q[0][3], e);
286
- } }
287
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
288
- function fulfill(value) { resume("next", value); }
289
- function reject(value) { resume("throw", value); }
290
- function settle(f, v) { if (f(v), q.shift(), q.length)
291
- resume(q[0][0], q[0][1]); }
292
- }
293
- function __asyncDelegator(o) {
294
- var i, p;
295
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
296
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
297
- }
298
- function __asyncValues(o) {
299
- if (!Symbol.asyncIterator)
300
- throw new TypeError("Symbol.asyncIterator is not defined.");
301
- var m = o[Symbol.asyncIterator], i;
302
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
303
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
304
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
305
- }
306
- function __makeTemplateObject(cooked, raw) {
307
- if (Object.defineProperty) {
308
- Object.defineProperty(cooked, "raw", { value: raw });
309
- }
310
- else {
311
- cooked.raw = raw;
312
- }
313
- return cooked;
314
- }
315
- ;
316
- var __setModuleDefault = Object.create ? (function (o, v) {
317
- Object.defineProperty(o, "default", { enumerable: true, value: v });
318
- }) : function (o, v) {
319
- o["default"] = v;
320
- };
321
- function __importStar(mod) {
322
- if (mod && mod.__esModule)
323
- return mod;
324
- var result = {};
325
- if (mod != null)
326
- for (var k in mod)
327
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
328
- __createBinding(result, mod, k);
329
- __setModuleDefault(result, mod);
330
- return result;
331
- }
332
- function __importDefault(mod) {
333
- return (mod && mod.__esModule) ? mod : { default: mod };
334
- }
335
- function __classPrivateFieldGet(receiver, state, kind, f) {
336
- if (kind === "a" && !f)
337
- throw new TypeError("Private accessor was defined without a getter");
338
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
339
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
340
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
341
- }
342
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
343
- if (kind === "m")
344
- throw new TypeError("Private method is not writable");
345
- if (kind === "a" && !f)
346
- throw new TypeError("Private accessor was defined without a setter");
347
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
348
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
349
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
350
- }
351
-
352
- function isSelectionChange(obj) {
353
- return !!obj && obj.hasOwnProperty('added') && obj.hasOwnProperty('removed');
354
- }
355
- var RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD = new i0.InjectionToken('rxap/tree/data-source/root-remote-method');
356
- var RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD = new i0.InjectionToken('rxap/tree/data-source/children-remote-method');
357
- var TreeDataSource = /** @class */ (function (_super) {
358
- __extends(TreeDataSource, _super);
359
- function TreeDataSource(rootRemoteMethod, childrenRemoteMethod, metadata) {
360
- if (metadata === void 0) { metadata = null; }
361
- var _this = _super.call(this, metadata) || this;
362
- _this.rootRemoteMethod = rootRemoteMethod;
363
- _this.childrenRemoteMethod = childrenRemoteMethod;
364
- _this.tree$ = new rxjs.BehaviorSubject([]);
365
- _this._expandedLocalStorageSubscription = null;
366
- _this._selectedLocalStorageSubscription = null;
367
- // TODO : änlich problem wie bei der redundaten expand SelectionModel.
368
- // im localStorage wird nur die id gespeichert.
369
- _this._preSelected = [];
370
- _this._data$ = new rxjs.BehaviorSubject([]);
371
- _this.loading$ = new rxjs$1.ToggleSubject(true);
372
- _this.toDisplay = function () { return 'to display function not defined'; };
373
- _this.getIcon = function () { return null; };
374
- _this.hasDetails = function () { return true; };
375
- _this.matchFilter = function () { return true; };
376
- _this._refreshMatchFilter = new rxjs.Subject();
377
- _this.tree$
378
- .pipe(operators.map(function (tree) { return tree
379
- .map(function (child) { return _this.flatTree(child); })
380
- .reduce(function (acc, nodes) { return __spreadArray(__spreadArray([], __read(acc)), __read(nodes)); }, []); }))
381
- .subscribe(_this._data$);
382
- // TODO add new SelectModel class that saves the select model to the localStorage
383
- _this.initSelected();
384
- _this.initExpanded();
385
- return _this;
386
- }
387
- TreeDataSource.prototype.getTreeRoot = function () {
388
- return __awaiter(this, void 0, void 0, function () {
389
- var root, rootNodes;
390
- var _this = this;
391
- return __generator(this, function (_b) {
392
- switch (_b.label) {
393
- case 0:
394
- this.loading$.enable();
395
- return [4 /*yield*/, this.getRoot()];
396
- case 1:
397
- root = _b.sent();
398
- if (!Array.isArray(root)) return [3 /*break*/, 3];
399
- return [4 /*yield*/, Promise.all(root.map(function (node) { return _this._toNode(node); }))];
400
- case 2:
401
- rootNodes = _b.sent();
402
- return [3 /*break*/, 5];
403
- case 3: return [4 /*yield*/, this._toNode(root)];
404
- case 4:
405
- rootNodes = [_b.sent()];
406
- _b.label = 5;
407
- case 5:
408
- this.tree$.next(rootNodes);
409
- this.loading$.disable();
410
- return [2 /*return*/, rootNodes];
411
- }
412
- });
413
- });
414
- };
415
- TreeDataSource.prototype.selectNode = function (node) {
416
- if (!this.selected.isMultipleSelection()) {
417
- if (this.selected.hasValue()) {
418
- var currentSelectedNode = this.selected.selected[0];
419
- currentSelectedNode.deselect();
420
- }
421
- }
422
- this.selected.select(node);
423
- return Promise.resolve();
424
- };
425
- TreeDataSource.prototype.setTreeControl = function (treeControl) {
426
- this.treeControl = treeControl;
427
- };
428
- TreeDataSource.prototype.setMatchFilter = function (matchFilter) {
429
- this.matchFilter = matchFilter;
430
- };
431
- TreeDataSource.prototype.setToDisplay = function (toDisplay) {
432
- if (toDisplay === void 0) { toDisplay = this.toDisplay; }
433
- this.toDisplay = toDisplay;
434
- };
435
- TreeDataSource.prototype.setGetIcon = function (getIcon) {
436
- if (getIcon === void 0) { getIcon = this.getIcon; }
437
- this.getIcon = getIcon;
438
- };
439
- TreeDataSource.prototype.setHasDetails = function (hasDetails) {
440
- if (hasDetails === void 0) { hasDetails = this.hasDetails; }
441
- this.hasDetails = hasDetails;
442
- };
443
- TreeDataSource.prototype.deselectNode = function (node) {
444
- this.selected.deselect(node);
445
- return Promise.resolve();
446
- };
447
- // - the SelectModel that stores the selection into the local storage?
448
- TreeDataSource.prototype._toNode = function (item, depth, onExpand, onCollapse, onSelect, onDeselect) {
449
- if (depth === void 0) { depth = 0; }
450
- if (onExpand === void 0) { onExpand = this.expandNode.bind(this); }
451
- if (onCollapse === void 0) { onCollapse = this.collapseNode.bind(this); }
452
- if (onSelect === void 0) { onSelect = this.selectNode.bind(this); }
453
- if (onDeselect === void 0) { onDeselect = this.deselectNode.bind(this); }
454
- return __awaiter(this, void 0, void 0, function () {
455
- var node;
456
- var _this = this;
457
- return __generator(this, function (_b) {
458
- switch (_b.label) {
459
- case 0: return [4 /*yield*/, this.toNode(item, depth, onExpand, onCollapse, onSelect, onDeselect)];
460
- case 1:
461
- node = _b.sent();
462
- if (this.expanded.isSelected(node.id)) {
463
- node
464
- .expand()
465
- .then(function () {
466
- // TODO : remove redundant this.expanded SelectionModel. Only store expanded nodes in this.treeControl.expansionModel
467
- // das problem ist das ich beim speicher in localStorage nur die id speicher.
468
- // Des wegen kann ich beim laden aus dem localStorage this.treeControl.expansionModel
469
- // nicht einfach mit den expanend nodes fullen. Da dort das node object benötigt wird
470
- // möglich lösungen:
471
- // - das node object läde die entity mithilfe der id automatisch nach
472
- _this.treeControl.expansionModel.select(node);
473
- console.debug("Restore expand for node '" + node.id + "' SUCCESSFULLY");
474
- })
475
- .catch(function () { return console.debug("Restore expand for node '" + node.id + "' FAILED"); });
476
- }
477
- if (!this._preSelected.includes(node.id)) return [3 /*break*/, 3];
478
- return [4 /*yield*/, node
479
- .select()
480
- .then(function () { return console.debug("Restore select for node '" + node.id + "' SUCCESSFULLY"); })
481
- .catch(function () { return console.debug("Restore select for node '" + node.id + "' FAILED"); })];
482
- case 2:
483
- _b.sent();
484
- _b.label = 3;
485
- case 3: return [2 /*return*/, node];
486
- }
487
- });
488
- });
489
- };
490
- TreeDataSource.prototype.expandNode = function (node) {
491
- var _a;
492
- return __awaiter(this, void 0, void 0, function () {
493
- var children, _b, _c;
494
- var _this = this;
495
- return __generator(this, function (_d) {
496
- switch (_d.label) {
497
- case 0:
498
- if (!(node.item.hasChildren && !((_a = node.item.children) === null || _a === void 0 ? void 0 : _a.length))) return [3 /*break*/, 3];
499
- node.isLoading$.enable();
500
- return [4 /*yield*/, this.getChildren(node)];
501
- case 1:
502
- children = _d.sent();
503
- // add the loaded children to the item object
504
- node.item.children = children;
505
- _c = (_b = node).addChildren;
506
- return [4 /*yield*/, Promise.all(children.map(function (child) { return _this._toNode(child, node.depth + 1, node.onExpand, node.onCollapse); }))];
507
- case 2:
508
- _c.apply(_b, [_d.sent()]);
509
- node.isLoading$.disable();
510
- _d.label = 3;
511
- case 3:
512
- this.expanded.select(node.id);
513
- this.tree$.next(this.tree$.value);
514
- return [2 /*return*/];
515
- }
516
- });
517
- });
518
- };
519
- TreeDataSource.prototype.getChildren = function (node) {
520
- return __awaiter(this, void 0, void 0, function () {
521
- return __generator(this, function (_b) {
522
- return [2 /*return*/, this.childrenRemoteMethod.call(node)];
523
- });
524
- });
525
- };
526
- TreeDataSource.prototype.getRoot = function () {
527
- return __awaiter(this, void 0, void 0, function () {
528
- var rootParameters;
529
- return __generator(this, function (_b) {
530
- switch (_b.label) {
531
- case 0: return [4 /*yield*/, this.getRootParameters()];
532
- case 1:
533
- rootParameters = _b.sent();
534
- return [2 /*return*/, this.rootRemoteMethod.call(rootParameters)];
535
- }
536
- });
537
- });
538
- };
539
- TreeDataSource.prototype.getRootParameters = function () {
540
- return __awaiter(this, void 0, void 0, function () {
541
- return __generator(this, function (_b) {
542
- return [2 /*return*/, undefined];
543
- });
544
- });
545
- };
546
- // TODO : find better solution to allow the overwrite of the toNode method
547
- // without losing the custom preselect and preexpand function
548
- TreeDataSource.prototype.getNodeById = function (id) {
549
- function getNodeById(node, nodeId) {
550
- if (node.id === nodeId) {
551
- return node;
552
- }
553
- if (node.hasNode(nodeId)) {
554
- return node.getNode(nodeId);
555
- }
556
- else {
557
- return null;
558
- }
559
- }
560
- return (this.tree$.value
561
- .map(function (node) { return getNodeById(node, id); })
562
- .filter(Boolean)[0] || null);
563
- };
564
- TreeDataSource.prototype.toNode = function (item, depth, onExpand, onCollapse, onSelect, onDeselect) {
565
- if (depth === void 0) { depth = 0; }
566
- if (onExpand === void 0) { onExpand = this.expandNode.bind(this); }
567
- if (onCollapse === void 0) { onCollapse = this.collapseNode.bind(this); }
568
- if (onSelect === void 0) { onSelect = this.selectNode.bind(this); }
569
- if (onDeselect === void 0) { onDeselect = this.deselectNode.bind(this); }
570
- return __awaiter(this, void 0, void 0, function () {
571
- return __generator(this, function (_b) {
572
- return [2 /*return*/, rxjs$1.Node.ToNode(item, depth, onExpand, onCollapse, this.toDisplay, this.getIcon, onSelect, onDeselect, this.hasDetails)];
573
- });
574
- });
575
- };
576
- TreeDataSource.prototype.collapseNode = function (node) {
577
- this.expanded.deselect(node.id);
578
- this.tree$.next(this.tree$.value);
579
- return Promise.resolve();
580
- };
581
- TreeDataSource.prototype.flatTree = function (tree) {
582
- var _this = this;
583
- function flat(acc, list) {
584
- return __spreadArray(__spreadArray([], __read(acc)), __read(list));
585
- }
586
- var flatTree = function (node) {
587
- if (!Array.isArray(node.children)) {
588
- if (i0.isDevMode()) {
589
- console.log(node);
590
- }
591
- throw new Error('Node has not defined children');
592
- }
593
- if (node.expanded || _this.expanded.isSelected(node.id)) {
594
- return __spreadArray([
595
- node
596
- ], __read(node.children.map(function (child) { return flatTree(child); }).reduce(flat, [])));
597
- }
598
- else {
599
- return [node];
600
- }
601
- };
602
- return flatTree(tree);
603
- };
604
- TreeDataSource.prototype.destroy = function () {
605
- _super.prototype.destroy.call(this);
606
- // TODO : add subscription handler to BaseDataSource
607
- if (this._expandedLocalStorageSubscription) {
608
- this._expandedLocalStorageSubscription.unsubscribe();
609
- }
610
- if (this._selectedLocalStorageSubscription) {
611
- this._selectedLocalStorageSubscription.unsubscribe();
612
- }
613
- };
614
- TreeDataSource.prototype.refreshMatchFilter = function () {
615
- this._refreshMatchFilter.next();
616
- };
617
- TreeDataSource.prototype._connect = function (collectionViewer) {
618
- var _this = this;
619
- this.treeControl.expansionModel.changed.subscribe(function (change) {
620
- if (isSelectionChange(change)) {
621
- if (change.added) {
622
- change.added.forEach(function (node) { return node.expand(); });
623
- }
624
- if (change.removed) {
625
- change.removed
626
- .slice()
627
- .reverse()
628
- .forEach(function (node) { return node.collapse(); });
629
- }
630
- }
631
- });
632
- var loadRoot = Promise.resolve();
633
- if (this.tree$.value.length === 0) {
634
- loadRoot = this.getTreeRoot();
635
- }
636
- return rxjs.from(loadRoot).pipe(operators.tap(function (rootNodes) {
637
- if (rootNodes) {
638
- var promises = [];
639
- if (_this.metadata.selectMultiple) {
640
- if (!_this.selected.hasValue()) {
641
- promises.push.apply(promises, __spreadArray([], __read(rootNodes
642
- .filter(function (node) { return node.hasDetails; })
643
- .map(function (node) { return node.select(); }))));
644
- }
645
- if (!_this.expanded.hasValue()) {
646
- promises.push.apply(promises, __spreadArray([], __read(rootNodes
647
- .filter(function (node) { return node.hasChildren; })
648
- .map(function (node) { return node.expand(); }))));
649
- }
650
- }
651
- else if (rootNodes.length) {
652
- var rootNode = rootNodes[0];
653
- if (!_this.selected.hasValue()) {
654
- // TODO : rename hasDetails to isSelectable
655
- if (rootNode.hasDetails) {
656
- promises.push(rootNode.select());
657
- }
658
- }
659
- if (!_this.expanded.hasValue()) {
660
- promises.push(rootNode.expand());
661
- }
662
- }
663
- return Promise.all(promises);
664
- }
665
- return Promise.resolve();
666
- }), operators.switchMap(function () { return rxjs.merge(collectionViewer.viewChange, _this._data$).pipe(operators.map(function () { return _this._data$.value; })); }), operators.switchMap(function (nodeList) { return _this._refreshMatchFilter.pipe(operators.startWith(null), operators.map(function () { return nodeList.filter(function (node) { return _this.matchFilter(node); }); })); }));
667
- };
668
- TreeDataSource.prototype.refresh = function () {
669
- return __awaiter(this, void 0, void 0, function () {
670
- var rootNodes, loadExpandedNodes, selected;
671
- var _b;
672
- var _this = this;
673
- return __generator(this, function (_c) {
674
- switch (_c.label) {
675
- case 0: return [4 /*yield*/, this.getTreeRoot()];
676
- case 1:
677
- rootNodes = _c.sent();
678
- loadExpandedNodes = function (children) { return __awaiter(_this, void 0, void 0, function () {
679
- var children_1, children_1_1, child, e_1_1;
680
- var e_1, _b;
681
- return __generator(this, function (_c) {
682
- switch (_c.label) {
683
- case 0:
684
- _c.trys.push([0, 7, 8, 9]);
685
- children_1 = __values(children), children_1_1 = children_1.next();
686
- _c.label = 1;
687
- case 1:
688
- if (!!children_1_1.done) return [3 /*break*/, 6];
689
- child = children_1_1.value;
690
- if (!this.expanded.isSelected(child.id)) return [3 /*break*/, 3];
691
- // call the node method to ensure that the expanded property of
692
- // Node is set.
693
- return [4 /*yield*/, child.expand()];
694
- case 2:
695
- // call the node method to ensure that the expanded property of
696
- // Node is set.
697
- _c.sent();
698
- _c.label = 3;
699
- case 3:
700
- if (!child.hasChildren) return [3 /*break*/, 5];
701
- return [4 /*yield*/, loadExpandedNodes(child.children)];
702
- case 4:
703
- _c.sent();
704
- _c.label = 5;
705
- case 5:
706
- children_1_1 = children_1.next();
707
- return [3 /*break*/, 1];
708
- case 6: return [3 /*break*/, 9];
709
- case 7:
710
- e_1_1 = _c.sent();
711
- e_1 = { error: e_1_1 };
712
- return [3 /*break*/, 9];
713
- case 8:
714
- try {
715
- if (children_1_1 && !children_1_1.done && (_b = children_1.return)) _b.call(children_1);
716
- }
717
- finally { if (e_1) throw e_1.error; }
718
- return [7 /*endfinally*/];
719
- case 9: return [2 /*return*/];
720
- }
721
- });
722
- }); };
723
- return [4 /*yield*/, Promise.all(rootNodes
724
- .filter(function (node) { return node.hasChildren; })
725
- .map(function (node) { return loadExpandedNodes(node.children); }))];
726
- case 2:
727
- _c.sent();
728
- selected = this.selected.selected
729
- .map(function (node) { return _this.getNodeById(node.id); })
730
- .filter(Boolean);
731
- this.selected.clear();
732
- (_b = this.selected).select.apply(_b, __spreadArray([], __read(selected)));
733
- return [2 /*return*/];
734
- }
735
- });
736
- });
737
- };
738
- TreeDataSource.prototype.initSelected = function () {
739
- var _this = this;
740
- var key = utilities.joinPath('rxap/tree', this.id, 'selected');
741
- if (this.metadata.cacheSelected) {
742
- if (localStorage.getItem(key)) {
743
- try {
744
- this._preSelected = JSON.parse(localStorage.getItem(key));
745
- }
746
- catch (e) {
747
- console.debug('parse expanded tree data source nodes failed');
748
- }
749
- }
750
- }
751
- this.selected = new collections.SelectionModel(!!this.metadata.selectMultiple, []);
752
- if (this.metadata.cacheSelected) {
753
- this._selectedLocalStorageSubscription = this.selected.changed
754
- .pipe(operators.tap(function () { return localStorage.setItem(key, JSON.stringify(_this.selected.selected.map(function (s) { return s.id; }))); }))
755
- .subscribe();
756
- }
757
- };
758
- TreeDataSource.prototype.reset = function () {
759
- this.selected.clear();
760
- this.expanded.clear();
761
- return this.getTreeRoot();
762
- };
763
- TreeDataSource.prototype.initExpanded = function () {
764
- var _this = this;
765
- var key = utilities.joinPath('rxap/tree', this.id, 'expanded');
766
- var expanded = [];
767
- if (this.metadata.cacheExpanded) {
768
- if (localStorage.getItem(key)) {
769
- try {
770
- expanded = JSON.parse(localStorage.getItem(key));
771
- }
772
- catch (e) {
773
- console.debug('parse expanded tree data source nodes failed');
774
- }
775
- }
776
- }
777
- this.expanded = new collections.SelectionModel(this.metadata.expandMultiple !== false, expanded);
778
- if (this.metadata.cacheExpanded) {
779
- this._expandedLocalStorageSubscription = this.expanded.changed
780
- .pipe(operators.tap(function () { return localStorage.setItem(key, JSON.stringify(_this.expanded.selected)); }))
781
- .subscribe();
782
- }
783
- };
784
- return TreeDataSource;
785
- }(dataSource.BaseDataSource));
786
- TreeDataSource.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeDataSource, deps: [{ token: RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD }, { token: RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD }, { token: dataSource.RXAP_DATA_SOURCE_METADATA }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
787
- TreeDataSource.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeDataSource });
788
- __decorate([
789
- utilities.Required,
790
- __metadata("design:type", tree.FlatTreeControl)
791
- ], TreeDataSource.prototype, "treeControl", void 0);
792
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeDataSource, decorators: [{
793
- type: i0.Injectable
794
- }], ctorParameters: function () {
795
- return [{ type: undefined, decorators: [{
796
- type: i0.Inject,
797
- args: [RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD]
798
- }] }, { type: undefined, decorators: [{
799
- type: i0.Inject,
800
- args: [RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD]
801
- }] }, { type: undefined, decorators: [{
802
- type: i0.Inject,
803
- args: [dataSource.RXAP_DATA_SOURCE_METADATA]
804
- }] }];
805
- }, propDecorators: { treeControl: [] } });
806
-
807
- var TreeContentDirective = /** @class */ (function () {
808
- function TreeContentDirective(template) {
809
- this.template = template;
810
- }
811
- return TreeContentDirective;
812
- }());
813
- TreeContentDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeContentDirective, deps: [{ token: i0.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
814
- TreeContentDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TreeContentDirective, selector: "ng-template[rxapTreeContent]", ngImport: i0__namespace });
815
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeContentDirective, decorators: [{
816
- type: i0.Directive,
817
- args: [{
818
- // tslint:disable-next-line:directive-selector
819
- selector: 'ng-template[rxapTreeContent]',
820
- }]
821
- }], ctorParameters: function () {
822
- return [{ type: i0__namespace.TemplateRef, decorators: [{
823
- type: i0.Inject,
824
- args: [i0.TemplateRef]
825
- }] }];
826
- } });
827
-
828
- var RXAP_TREE_CONTENT_EDITABLE_METHOD = new i0.InjectionToken('rxap/tree-content-editable-method');
829
-
830
- var TreeComponent = /** @class */ (function () {
831
- function TreeComponent(viewContainerRef, cdr, contentEditableMethod, renderer) {
832
- this.viewContainerRef = viewContainerRef;
833
- this.cdr = cdr;
834
- this.renderer = renderer;
835
- this.multiple = false;
836
- this.hideLeafIcon = false;
837
- this.details = new i0.EventEmitter();
838
- this.dividerOffset = '256px';
839
- this.portal = null;
840
- this.getLevel = function (node) { return node.depth; };
841
- this.isExpandable = function (node) { return node.hasChildren; };
842
- this.hasChild = function (_, nodeData) { return nodeData.hasChildren; };
843
- /**
844
- * Indicates that the divider is moved with mouse down
845
- * @private
846
- */
847
- this._moveDivider = false;
848
- /**
849
- * Holds the current tree container width.
850
- * If null the move divider feature was not yet used and the initial
851
- * container width is not calculated
852
- * @private
853
- */
854
- this._treeContainerWidth = null;
855
- this.treeControl = new tree.FlatTreeControl(this.getLevel, this.isExpandable);
856
- this.contentEditableMethod = contentEditableMethod;
857
- }
858
- Object.defineProperty(TreeComponent.prototype, "nodeDisplayEditable", {
859
- get: function () {
860
- return !!this.contentEditableMethod;
861
- },
862
- enumerable: false,
863
- configurable: true
864
- });
865
- Object.defineProperty(TreeComponent.prototype, "cacheId", {
866
- get: function () {
867
- return ['rxap', 'tree', this.id].join('/');
868
- },
869
- enumerable: false,
870
- configurable: true
871
- });
872
- TreeComponent.prototype.ngOnInit = function () {
873
- var _this = this;
874
- var _a;
875
- this.dataSource.setTreeControl(this.treeControl);
876
- this.dataSource.setToDisplay(this.toDisplay);
877
- this.dataSource.setGetIcon(this.getIcon);
878
- this.dataSource.setHasDetails(this.hasDetails);
879
- this.multiple = (_a = this.dataSource.metadata.selectMultiple) !== null && _a !== void 0 ? _a : this.multiple;
880
- if (this.dataSource.selected.hasValue()) {
881
- this.dataSource.selected.selected.forEach(function (node) { return _this.openDetails(node); });
882
- }
883
- var cachedOffset = localStorage.getItem(this.cacheId);
884
- if (cachedOffset && cachedOffset.match(/^(\d+\.)?\d+px$/)) {
885
- this.setDividerOffset(cachedOffset);
886
- }
887
- else if (i0.isDevMode()) {
888
- console.log("Divider offset cache is not available or invalid: " + cachedOffset);
889
- }
890
- };
891
- TreeComponent.prototype.ngAfterContentInit = function () {
892
- var _this = this;
893
- this.dataSource.selected.changed
894
- .pipe(operators.map(function ($event) { return $event.source.selected; }), operators.startWith(this.dataSource.selected.selected), operators.tap(function (selected) { return selected.forEach(function (node) { return _this.openDetails(node); }); }))
895
- .subscribe();
896
- };
897
- TreeComponent.prototype.openDetails = function (node) {
898
- if (this.content) {
899
- this.portal = new i13.TemplatePortal(this.content.template, this.viewContainerRef, {
900
- $implicit: node.item,
901
- node: node,
902
- });
903
- this.cdr.markForCheck();
904
- }
905
- this.details.emit(node.item);
906
- };
907
- TreeComponent.prototype.onContentEditableChange = function (value, node) {
908
- var _a;
909
- return (_a = this.contentEditableMethod) === null || _a === void 0 ? void 0 : _a.call(value, node.item, node);
910
- };
911
- TreeComponent.prototype.onMousedown = function () {
912
- this._moveDivider = true;
913
- };
914
- TreeComponent.prototype.onMouseup = function () {
915
- this._moveDivider = false;
916
- };
917
- TreeComponent.prototype.onMousemove = function ($event) {
918
- if (this._moveDivider) {
919
- if (!this._treeContainerWidth) {
920
- this._treeContainerWidth = this.treeContainer.nativeElement.clientWidth;
921
- }
922
- this._treeContainerWidth = $event.clientX - 75;
923
- var offset = this._treeContainerWidth + 'px';
924
- this.setDividerOffset(offset);
925
- }
926
- };
927
- TreeComponent.prototype.setDividerOffset = function (offset) {
928
- if (i0.isDevMode()) {
929
- console.log("set divider offset to: " + offset);
930
- }
931
- this.dividerOffset = offset;
932
- this.renderer.setStyle(this.treeContainer.nativeElement, 'max-width', offset);
933
- this.renderer.setStyle(this.treeContainer.nativeElement, 'min-width', offset);
934
- this.renderer.setStyle(this.treeContainer.nativeElement, 'flex-basis', offset);
935
- localStorage.setItem(this.cacheId, offset);
936
- };
937
- return TreeComponent;
938
- }());
939
- TreeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: RXAP_TREE_CONTENT_EDITABLE_METHOD, optional: true }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Component });
940
- TreeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TreeComponent, selector: "rxap-tree", inputs: { dataSource: "dataSource", contentEditableMethod: "contentEditableMethod", toDisplay: "toDisplay", getIcon: "getIcon", multiple: "multiple", hasDetails: "hasDetails", hideLeafIcon: "hideLeafIcon", id: "id", dividerOffset: "dividerOffset" }, outputs: { details: "details" }, host: { listeners: { "mouseup": "onMouseup()", "mousemove": "onMousemove($event)" } }, queries: [{ propertyName: "content", first: true, predicate: TreeContentDirective, descendants: true, static: true }], viewQueries: [{ propertyName: "treeContainer", first: true, predicate: ["treeContainer"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div class=\"container\" fxLayout=\"row\">\n <div [ngStyle]=\"{ maxWidth: dividerOffset, minWidth: dividerOffset, flexBasis: dividerOffset }\" #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", styles: [".container{height:100%}.tree-view{background-color:transparent;background-color:initial}.details,.tree-container{max-height:calc(100vh - 64px - 32px);overflow-y:auto}.tree-container{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.divider{cursor:ew-resize;padding:12px}.divider ::ng-deep .mat-divider{height:100%}"], components: [{ type: i1__namespace.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "mode", "value", "bufferValue"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i2__namespace.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { type: i3__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4__namespace.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i6__namespace.MatProgressSpinner, selector: "mat-progress-spinner", inputs: ["color", "mode", "diameter", "strokeWidth", "value"], exportAs: ["matProgressSpinner"] }, { type: i7__namespace.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i8__namespace.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i8__namespace.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i9__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i10__namespace.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { type: i9__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { type: i2__namespace.MatTreeNode, selector: "mat-tree-node", inputs: ["role", "disabled", "tabIndex"], exportAs: ["matTreeNode"] }, { type: i2__namespace.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { type: i8__namespace.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i10__namespace.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { type: i11__namespace.IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }, { type: i2__namespace.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { type: i12__namespace.ContenteditableDirective, selector: "[rxapContenteditable]", inputs: ["rxapContenteditable", "disabled"], outputs: ["change"] }, { type: i8__namespace.DefaultFlexOffsetDirective, selector: " [fxFlexOffset], [fxFlexOffset.xs], [fxFlexOffset.sm], [fxFlexOffset.md], [fxFlexOffset.lg], [fxFlexOffset.xl], [fxFlexOffset.lt-sm], [fxFlexOffset.lt-md], [fxFlexOffset.lt-lg], [fxFlexOffset.lt-xl], [fxFlexOffset.gt-xs], [fxFlexOffset.gt-sm], [fxFlexOffset.gt-md], [fxFlexOffset.gt-lg]", inputs: ["fxFlexOffset", "fxFlexOffset.xs", "fxFlexOffset.sm", "fxFlexOffset.md", "fxFlexOffset.lg", "fxFlexOffset.xl", "fxFlexOffset.lt-sm", "fxFlexOffset.lt-md", "fxFlexOffset.lt-lg", "fxFlexOffset.lt-xl", "fxFlexOffset.gt-xs", "fxFlexOffset.gt-sm", "fxFlexOffset.gt-md", "fxFlexOffset.gt-lg"] }, { type: i13__namespace.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], pipes: { "async": i9__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
941
- __decorate([
942
- utilities.Required,
943
- __metadata("design:type", TreeDataSource)
944
- ], TreeComponent.prototype, "dataSource", void 0);
945
- __decorate([
946
- utilities.DebounceCall(100),
947
- __metadata("design:type", Function),
948
- __metadata("design:paramtypes", [rxjs$1.Node]),
949
- __metadata("design:returntype", void 0)
950
- ], TreeComponent.prototype, "openDetails", null);
951
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeComponent, decorators: [{
952
- type: i0.Component,
953
- args: [{
954
- // tslint:disable-next-line:component-selector
955
- selector: 'rxap-tree',
956
- templateUrl: './tree.component.html',
957
- styleUrls: ['./tree.component.scss'],
958
- changeDetection: i0.ChangeDetectionStrategy.OnPush
959
- }]
960
- }], ctorParameters: function () {
961
- return [{ type: i0__namespace.ViewContainerRef, decorators: [{
962
- type: i0.Inject,
963
- args: [i0.ViewContainerRef]
964
- }] }, { type: i0__namespace.ChangeDetectorRef, decorators: [{
965
- type: i0.Inject,
966
- args: [i0.ChangeDetectorRef]
967
- }] }, { type: undefined, decorators: [{
968
- type: i0.Optional
969
- }, {
970
- type: i0.Inject,
971
- args: [RXAP_TREE_CONTENT_EDITABLE_METHOD]
972
- }] }, { type: i0__namespace.Renderer2 }];
973
- }, propDecorators: { dataSource: [{
974
- type: i0.Input
975
- }], contentEditableMethod: [{
976
- type: i0.Input
977
- }], toDisplay: [{
978
- type: i0.Input
979
- }], getIcon: [{
980
- type: i0.Input
981
- }], multiple: [{
982
- type: i0.Input
983
- }], hasDetails: [{
984
- type: i0.Input
985
- }], content: [{
986
- type: i0.ContentChild,
987
- args: [TreeContentDirective, { static: true }]
988
- }], hideLeafIcon: [{
989
- type: i0.Input
990
- }], id: [{
991
- type: i0.Input
992
- }], details: [{
993
- type: i0.Output
994
- }], dividerOffset: [{
995
- type: i0.Input
996
- }], treeContainer: [{
997
- type: i0.ViewChild,
998
- args: ['treeContainer', { static: true }]
999
- }], openDetails: [], onMouseup: [{
1000
- type: i0.HostListener,
1001
- args: ['mouseup']
1002
- }], onMousemove: [{
1003
- type: i0.HostListener,
1004
- args: ['mousemove', ['$event']]
1005
- }] } });
1006
-
1007
- var TreeComponentModule = /** @class */ (function () {
1008
- function TreeComponentModule() {
1009
- }
1010
- return TreeComponentModule;
1011
- }());
1012
- TreeComponentModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeComponentModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1013
- TreeComponentModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeComponentModule, declarations: [TreeComponent, TreeContentDirective], imports: [i9.CommonModule,
1014
- i2.MatTreeModule,
1015
- i5.MatButtonModule,
1016
- i3.MatIconModule,
1017
- flexLayout.FlexLayoutModule,
1018
- i7.MatDividerModule,
1019
- i6.MatProgressSpinnerModule,
1020
- i13.PortalModule,
1021
- i12.ContenteditableDirectiveModule,
1022
- i11.IconDirectiveModule,
1023
- i4.MatCheckboxModule,
1024
- i1.MatProgressBarModule], exports: [TreeComponent, TreeContentDirective] });
1025
- TreeComponentModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeComponentModule, imports: [[
1026
- i9.CommonModule,
1027
- i2.MatTreeModule,
1028
- i5.MatButtonModule,
1029
- i3.MatIconModule,
1030
- flexLayout.FlexLayoutModule,
1031
- i7.MatDividerModule,
1032
- i6.MatProgressSpinnerModule,
1033
- i13.PortalModule,
1034
- i12.ContenteditableDirectiveModule,
1035
- i11.IconDirectiveModule,
1036
- i4.MatCheckboxModule,
1037
- i1.MatProgressBarModule
1038
- ]] });
1039
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TreeComponentModule, decorators: [{
1040
- type: i0.NgModule,
1041
- args: [{
1042
- imports: [
1043
- i9.CommonModule,
1044
- i2.MatTreeModule,
1045
- i5.MatButtonModule,
1046
- i3.MatIconModule,
1047
- flexLayout.FlexLayoutModule,
1048
- i7.MatDividerModule,
1049
- i6.MatProgressSpinnerModule,
1050
- i13.PortalModule,
1051
- i12.ContenteditableDirectiveModule,
1052
- i11.IconDirectiveModule,
1053
- i4.MatCheckboxModule,
1054
- i1.MatProgressBarModule
1055
- ],
1056
- declarations: [TreeComponent, TreeContentDirective],
1057
- exports: [TreeComponent, TreeContentDirective],
1058
- entryComponents: [TreeComponent]
1059
- }]
1060
- }] });
1061
-
1062
- /**
1063
- * Generated bundle index. Do not edit.
1064
- */
1065
-
1066
- exports.RXAP_TREE_CONTENT_EDITABLE_METHOD = RXAP_TREE_CONTENT_EDITABLE_METHOD;
1067
- exports.RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD = RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD;
1068
- exports.RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD = RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD;
1069
- exports.TreeComponent = TreeComponent;
1070
- exports.TreeComponentModule = TreeComponentModule;
1071
- exports.TreeContentDirective = TreeContentDirective;
1072
- exports.TreeDataSource = TreeDataSource;
1073
- exports.isSelectionChange = isSelectionChange;
1074
-
1075
- Object.defineProperty(exports, '__esModule', { value: true });
1076
-
1077
- }));
1078
- //# sourceMappingURL=rxap-tree.umd.js.map