@rxap/tree 12.3.0 → 13.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/index.mjs +6 -0
- package/esm2020/lib/tokens.mjs +3 -0
- package/esm2020/lib/tree-content.directive.mjs +20 -0
- package/esm2020/lib/tree.component.mjs +157 -0
- package/esm2020/lib/tree.component.module.mjs +67 -0
- package/esm2020/lib/tree.data-source.mjs +331 -0
- package/esm2020/rxap-tree.mjs +5 -0
- package/fesm2015/{rxap-tree.js → rxap-tree.mjs} +172 -149
- package/fesm2015/rxap-tree.mjs.map +1 -0
- package/fesm2020/rxap-tree.mjs +567 -0
- package/fesm2020/rxap-tree.mjs.map +1 -0
- package/lib/tree.component.module.d.ts +2 -1
- package/lib/tree.data-source.d.ts +9 -4
- package/package.json +39 -25
- package/src/schematics/ng-add/index.js +1 -1
- package/src/schematics/ng-add/index.js.map +1 -1
- package/bundles/rxap-tree.umd.js +0 -1030
- package/bundles/rxap-tree.umd.js.map +0 -1
- package/esm2015/index.js +0 -6
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/tokens.js +0 -3
- package/esm2015/lib/tokens.js.map +0 -1
- package/esm2015/lib/tree-content.directive.js +0 -20
- package/esm2015/lib/tree-content.directive.js.map +0 -1
- package/esm2015/lib/tree.component.js +0 -164
- package/esm2015/lib/tree.component.js.map +0 -1
- package/esm2015/lib/tree.component.module.js +0 -64
- package/esm2015/lib/tree.component.module.js.map +0 -1
- package/esm2015/lib/tree.data-source.js +0 -329
- package/esm2015/lib/tree.data-source.js.map +0 -1
- package/esm2015/rxap-tree.js +0 -5
- package/esm2015/rxap-tree.js.map +0 -1
- package/fesm2015/rxap-tree.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter, __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { BehaviorSubject, from, merge } from 'rxjs';
|
|
2
|
+
import { BehaviorSubject, Subject, from, merge } from 'rxjs';
|
|
3
3
|
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
4
4
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
5
5
|
import { map, tap, switchMap, startWith } from 'rxjs/operators';
|
|
@@ -7,28 +7,30 @@ import { BaseDataSource, RXAP_DATA_SOURCE_METADATA } from '@rxap/data-source';
|
|
|
7
7
|
import { joinPath, Required, DebounceCall } from '@rxap/utilities';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
9
|
import { InjectionToken, Injectable, Inject, TemplateRef, Directive, EventEmitter, ViewContainerRef, ChangeDetectorRef, Component, ChangeDetectionStrategy, Optional, Input, ContentChild, Output, ViewChild, HostListener, NgModule } from '@angular/core';
|
|
10
|
-
import { Node } from '@rxap/utilities/rxjs';
|
|
11
|
-
import * as
|
|
10
|
+
import { ToggleSubject, Node } from '@rxap/utilities/rxjs';
|
|
11
|
+
import * as i13 from '@angular/cdk/portal';
|
|
12
12
|
import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
13
|
-
import * as i1 from '@angular/material/
|
|
13
|
+
import * as i1 from '@angular/material/progress-bar';
|
|
14
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
15
|
+
import * as i2 from '@angular/material/tree';
|
|
14
16
|
import { MatTreeModule } from '@angular/material/tree';
|
|
15
|
-
import * as
|
|
17
|
+
import * as i3 from '@angular/material/icon';
|
|
16
18
|
import { MatIconModule } from '@angular/material/icon';
|
|
17
|
-
import * as
|
|
19
|
+
import * as i4 from '@angular/material/checkbox';
|
|
18
20
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
19
|
-
import * as
|
|
21
|
+
import * as i5 from '@angular/material/button';
|
|
20
22
|
import { MatButtonModule } from '@angular/material/button';
|
|
21
|
-
import * as
|
|
23
|
+
import * as i6 from '@angular/material/progress-spinner';
|
|
22
24
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
23
|
-
import * as
|
|
25
|
+
import * as i7 from '@angular/material/divider';
|
|
24
26
|
import { MatDividerModule } from '@angular/material/divider';
|
|
25
|
-
import * as
|
|
26
|
-
import * as
|
|
27
|
+
import * as i8 from '@angular/flex-layout/flex';
|
|
28
|
+
import * as i9 from '@angular/common';
|
|
27
29
|
import { CommonModule } from '@angular/common';
|
|
28
|
-
import * as
|
|
29
|
-
import * as
|
|
30
|
+
import * as i10 from '@angular/flex-layout/extended';
|
|
31
|
+
import * as i11 from '@rxap/material-directives/icon';
|
|
30
32
|
import { IconDirectiveModule } from '@rxap/material-directives/icon';
|
|
31
|
-
import * as
|
|
33
|
+
import * as i12 from '@rxap/contenteditable';
|
|
32
34
|
import { ContenteditableDirectiveModule } from '@rxap/contenteditable';
|
|
33
35
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
34
36
|
|
|
@@ -49,9 +51,12 @@ class TreeDataSource extends BaseDataSource {
|
|
|
49
51
|
// im localStorage wird nur die id gespeichert.
|
|
50
52
|
this._preSelected = [];
|
|
51
53
|
this._data$ = new BehaviorSubject([]);
|
|
54
|
+
this.loading$ = new ToggleSubject(true);
|
|
52
55
|
this.toDisplay = () => 'to display function not defined';
|
|
53
56
|
this.getIcon = () => null;
|
|
54
57
|
this.hasDetails = () => true;
|
|
58
|
+
this.matchFilter = () => true;
|
|
59
|
+
this._refreshMatchFilter = new Subject();
|
|
55
60
|
this.tree$
|
|
56
61
|
.pipe(map((tree) => tree
|
|
57
62
|
.map((child) => this.flatTree(child))
|
|
@@ -63,6 +68,7 @@ class TreeDataSource extends BaseDataSource {
|
|
|
63
68
|
}
|
|
64
69
|
getTreeRoot() {
|
|
65
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
this.loading$.enable();
|
|
66
72
|
const root = yield this.getRoot();
|
|
67
73
|
let rootNodes;
|
|
68
74
|
if (Array.isArray(root)) {
|
|
@@ -72,6 +78,7 @@ class TreeDataSource extends BaseDataSource {
|
|
|
72
78
|
rootNodes = [yield this._toNode(root)];
|
|
73
79
|
}
|
|
74
80
|
this.tree$.next(rootNodes);
|
|
81
|
+
this.loading$.disable();
|
|
75
82
|
return rootNodes;
|
|
76
83
|
});
|
|
77
84
|
}
|
|
@@ -88,6 +95,9 @@ class TreeDataSource extends BaseDataSource {
|
|
|
88
95
|
setTreeControl(treeControl) {
|
|
89
96
|
this.treeControl = treeControl;
|
|
90
97
|
}
|
|
98
|
+
setMatchFilter(matchFilter) {
|
|
99
|
+
this.matchFilter = matchFilter;
|
|
100
|
+
}
|
|
91
101
|
setToDisplay(toDisplay = this.toDisplay) {
|
|
92
102
|
this.toDisplay = toDisplay;
|
|
93
103
|
}
|
|
@@ -106,7 +116,7 @@ class TreeDataSource extends BaseDataSource {
|
|
|
106
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
117
|
const node = yield this.toNode(item, depth, onExpand, onCollapse, onSelect, onDeselect);
|
|
108
118
|
if (this.expanded.isSelected(node.id)) {
|
|
109
|
-
|
|
119
|
+
node
|
|
110
120
|
.expand()
|
|
111
121
|
.then(() => {
|
|
112
122
|
// TODO : remove redundant this.expanded SelectionModel. Only store expanded nodes in this.treeControl.expansionModel
|
|
@@ -162,6 +172,66 @@ class TreeDataSource extends BaseDataSource {
|
|
|
162
172
|
}
|
|
163
173
|
// TODO : find better solution to allow the overwrite of the toNode method
|
|
164
174
|
// without losing the custom preselect and preexpand function
|
|
175
|
+
getNodeById(id) {
|
|
176
|
+
function getNodeById(node, nodeId) {
|
|
177
|
+
if (node.id === nodeId) {
|
|
178
|
+
return node;
|
|
179
|
+
}
|
|
180
|
+
if (node.hasNode(nodeId)) {
|
|
181
|
+
return node.getNode(nodeId);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return (this.tree$.value
|
|
188
|
+
.map((node) => getNodeById(node, id))
|
|
189
|
+
.filter(Boolean)[0] || null);
|
|
190
|
+
}
|
|
191
|
+
toNode(item, depth = 0, onExpand = this.expandNode.bind(this), onCollapse = this.collapseNode.bind(this), onSelect = this.selectNode.bind(this), onDeselect = this.deselectNode.bind(this)) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
return Node.ToNode(item, depth, onExpand, onCollapse, this.toDisplay, this.getIcon, onSelect, onDeselect, this.hasDetails);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
collapseNode(node) {
|
|
197
|
+
this.expanded.deselect(node.id);
|
|
198
|
+
this.tree$.next(this.tree$.value);
|
|
199
|
+
return Promise.resolve();
|
|
200
|
+
}
|
|
201
|
+
flatTree(tree) {
|
|
202
|
+
function flat(acc, list) {
|
|
203
|
+
return [...acc, ...list];
|
|
204
|
+
}
|
|
205
|
+
const flatTree = (node) => {
|
|
206
|
+
if (!Array.isArray(node.children)) {
|
|
207
|
+
console.log(node);
|
|
208
|
+
throw new Error('Node has not defined children');
|
|
209
|
+
}
|
|
210
|
+
if (node.expanded || this.expanded.isSelected(node.id)) {
|
|
211
|
+
return [
|
|
212
|
+
node,
|
|
213
|
+
...node.children.map((child) => flatTree(child)).reduce(flat, []),
|
|
214
|
+
];
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
return [node];
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
return flatTree(tree);
|
|
221
|
+
}
|
|
222
|
+
destroy() {
|
|
223
|
+
super.destroy();
|
|
224
|
+
// TODO : add subscription handler to BaseDataSource
|
|
225
|
+
if (this._expandedLocalStorageSubscription) {
|
|
226
|
+
this._expandedLocalStorageSubscription.unsubscribe();
|
|
227
|
+
}
|
|
228
|
+
if (this._selectedLocalStorageSubscription) {
|
|
229
|
+
this._selectedLocalStorageSubscription.unsubscribe();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
refreshMatchFilter() {
|
|
233
|
+
this._refreshMatchFilter.next();
|
|
234
|
+
}
|
|
165
235
|
_connect(collectionViewer) {
|
|
166
236
|
this.treeControl.expansionModel.changed.subscribe((change) => {
|
|
167
237
|
if (isSelectionChange(change)) {
|
|
@@ -210,79 +280,7 @@ class TreeDataSource extends BaseDataSource {
|
|
|
210
280
|
return Promise.all(promises);
|
|
211
281
|
}
|
|
212
282
|
return Promise.resolve();
|
|
213
|
-
}), switchMap(() => merge(collectionViewer.viewChange, this._data$).pipe(map(() => this._data$.value))));
|
|
214
|
-
}
|
|
215
|
-
toNode(item, depth = 0, onExpand = this.expandNode.bind(this), onCollapse = this.collapseNode.bind(this), onSelect = this.selectNode.bind(this), onDeselect = this.deselectNode.bind(this)) {
|
|
216
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
-
return Node.ToNode(item, depth, onExpand, onCollapse, this.toDisplay, this.getIcon, onSelect, onDeselect, this.hasDetails);
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
collapseNode(node) {
|
|
221
|
-
this.expanded.deselect(node.id);
|
|
222
|
-
this.tree$.next(this.tree$.value);
|
|
223
|
-
return Promise.resolve();
|
|
224
|
-
}
|
|
225
|
-
flatTree(tree) {
|
|
226
|
-
function flat(acc, list) {
|
|
227
|
-
return [...acc, ...list];
|
|
228
|
-
}
|
|
229
|
-
const flatTree = (node) => {
|
|
230
|
-
if (!Array.isArray(node.children)) {
|
|
231
|
-
console.log(node);
|
|
232
|
-
throw new Error('Node has not defined children');
|
|
233
|
-
}
|
|
234
|
-
if (node.expanded || this.expanded.isSelected(node.id)) {
|
|
235
|
-
return [
|
|
236
|
-
node,
|
|
237
|
-
...node.children.map((child) => flatTree(child)).reduce(flat, []),
|
|
238
|
-
];
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
return [node];
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
return flatTree(tree);
|
|
245
|
-
}
|
|
246
|
-
destroy() {
|
|
247
|
-
super.destroy();
|
|
248
|
-
// TODO : add subscription handler to BaseDataSource
|
|
249
|
-
if (this._expandedLocalStorageSubscription) {
|
|
250
|
-
this._expandedLocalStorageSubscription.unsubscribe();
|
|
251
|
-
}
|
|
252
|
-
if (this._selectedLocalStorageSubscription) {
|
|
253
|
-
this._selectedLocalStorageSubscription.unsubscribe();
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
getNodeById(id) {
|
|
257
|
-
function getNodeById(node, nodeId) {
|
|
258
|
-
if (node.id === nodeId) {
|
|
259
|
-
return node;
|
|
260
|
-
}
|
|
261
|
-
if (node.hasNode(nodeId)) {
|
|
262
|
-
return node.getNode(nodeId);
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
return null;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return (this.tree$.value
|
|
269
|
-
.map((node) => getNodeById(node, id))
|
|
270
|
-
.filter(Boolean)[0] || null);
|
|
271
|
-
}
|
|
272
|
-
initSelected() {
|
|
273
|
-
const key = joinPath('rxap/tree', this.id, 'selected');
|
|
274
|
-
if (localStorage.getItem(key)) {
|
|
275
|
-
try {
|
|
276
|
-
this._preSelected = JSON.parse(localStorage.getItem(key));
|
|
277
|
-
}
|
|
278
|
-
catch (e) {
|
|
279
|
-
console.debug('parse expanded tree data source nodes failed');
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
this.selected = new SelectionModel(!!this.metadata.selectMultiple, []);
|
|
283
|
-
this._selectedLocalStorageSubscription = this.selected.changed
|
|
284
|
-
.pipe(tap(() => localStorage.setItem(key, JSON.stringify(this.selected.selected.map((s) => s.id)))))
|
|
285
|
-
.subscribe();
|
|
283
|
+
}), 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))))));
|
|
286
284
|
}
|
|
287
285
|
refresh() {
|
|
288
286
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -310,6 +308,25 @@ class TreeDataSource extends BaseDataSource {
|
|
|
310
308
|
this.selected.select(...selected);
|
|
311
309
|
});
|
|
312
310
|
}
|
|
311
|
+
initSelected() {
|
|
312
|
+
const key = joinPath('rxap/tree', this.id, 'selected');
|
|
313
|
+
if (this.metadata.cacheSelected) {
|
|
314
|
+
if (localStorage.getItem(key)) {
|
|
315
|
+
try {
|
|
316
|
+
this._preSelected = JSON.parse(localStorage.getItem(key));
|
|
317
|
+
}
|
|
318
|
+
catch (e) {
|
|
319
|
+
console.debug('parse expanded tree data source nodes failed');
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
this.selected = new SelectionModel(!!this.metadata.selectMultiple, []);
|
|
324
|
+
if (this.metadata.cacheSelected) {
|
|
325
|
+
this._selectedLocalStorageSubscription = this.selected.changed
|
|
326
|
+
.pipe(tap(() => localStorage.setItem(key, JSON.stringify(this.selected.selected.map((s) => s.id)))))
|
|
327
|
+
.subscribe();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
313
330
|
reset() {
|
|
314
331
|
this.selected.clear();
|
|
315
332
|
this.expanded.clear();
|
|
@@ -318,56 +335,64 @@ class TreeDataSource extends BaseDataSource {
|
|
|
318
335
|
initExpanded() {
|
|
319
336
|
const key = joinPath('rxap/tree', this.id, 'expanded');
|
|
320
337
|
let expanded = [];
|
|
321
|
-
if (
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
338
|
+
if (this.metadata.cacheExpanded) {
|
|
339
|
+
if (localStorage.getItem(key)) {
|
|
340
|
+
try {
|
|
341
|
+
expanded = JSON.parse(localStorage.getItem(key));
|
|
342
|
+
}
|
|
343
|
+
catch (e) {
|
|
344
|
+
console.debug('parse expanded tree data source nodes failed');
|
|
345
|
+
}
|
|
327
346
|
}
|
|
328
347
|
}
|
|
329
348
|
this.expanded = new SelectionModel(this.metadata.expandMultiple !== false, expanded);
|
|
330
|
-
|
|
331
|
-
.
|
|
332
|
-
|
|
349
|
+
if (this.metadata.cacheExpanded) {
|
|
350
|
+
this._expandedLocalStorageSubscription = this.expanded.changed
|
|
351
|
+
.pipe(tap(() => localStorage.setItem(key, JSON.stringify(this.expanded.selected))))
|
|
352
|
+
.subscribe();
|
|
353
|
+
}
|
|
333
354
|
}
|
|
334
355
|
}
|
|
335
|
-
TreeDataSource.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
336
|
-
TreeDataSource.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
356
|
+
TreeDataSource.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", 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 });
|
|
357
|
+
TreeDataSource.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeDataSource });
|
|
337
358
|
__decorate([
|
|
338
359
|
Required,
|
|
339
360
|
__metadata("design:type", FlatTreeControl)
|
|
340
361
|
], TreeDataSource.prototype, "treeControl", void 0);
|
|
341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
362
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeDataSource, decorators: [{
|
|
342
363
|
type: Injectable
|
|
343
|
-
}], ctorParameters: function () {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
type:
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
type:
|
|
351
|
-
|
|
352
|
-
|
|
364
|
+
}], ctorParameters: function () {
|
|
365
|
+
return [{ type: undefined, decorators: [{
|
|
366
|
+
type: Inject,
|
|
367
|
+
args: [RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD]
|
|
368
|
+
}] }, { type: undefined, decorators: [{
|
|
369
|
+
type: Inject,
|
|
370
|
+
args: [RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD]
|
|
371
|
+
}] }, { type: undefined, decorators: [{
|
|
372
|
+
type: Inject,
|
|
373
|
+
args: [RXAP_DATA_SOURCE_METADATA]
|
|
374
|
+
}] }];
|
|
375
|
+
}, propDecorators: { treeControl: [] } });
|
|
353
376
|
|
|
354
377
|
class TreeContentDirective {
|
|
355
378
|
constructor(template) {
|
|
356
379
|
this.template = template;
|
|
357
380
|
}
|
|
358
381
|
}
|
|
359
|
-
TreeContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
360
|
-
TreeContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
382
|
+
TreeContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeContentDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
383
|
+
TreeContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: TreeContentDirective, selector: "ng-template[rxapTreeContent]", ngImport: i0 });
|
|
384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeContentDirective, decorators: [{
|
|
362
385
|
type: Directive,
|
|
363
386
|
args: [{
|
|
364
387
|
// tslint:disable-next-line:directive-selector
|
|
365
388
|
selector: 'ng-template[rxapTreeContent]',
|
|
366
389
|
}]
|
|
367
|
-
}], ctorParameters: function () {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
390
|
+
}], ctorParameters: function () {
|
|
391
|
+
return [{ type: i0.TemplateRef, decorators: [{
|
|
392
|
+
type: Inject,
|
|
393
|
+
args: [TemplateRef]
|
|
394
|
+
}] }];
|
|
395
|
+
} });
|
|
371
396
|
|
|
372
397
|
const RXAP_TREE_CONTENT_EDITABLE_METHOD = new InjectionToken('rxap/tree-content-editable-method');
|
|
373
398
|
|
|
@@ -450,8 +475,8 @@ class TreeComponent {
|
|
|
450
475
|
}
|
|
451
476
|
}
|
|
452
477
|
}
|
|
453
|
-
TreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
454
|
-
TreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.1", type: TreeComponent, selector: "rxap-tree", inputs: { dataSource: "dataSource", contentEditableMethod: "contentEditableMethod", toDisplay: "toDisplay", getIcon: "getIcon", multiple: "multiple", hasDetails: "hasDetails", hideLeafIcon: "hideLeafIcon" }, 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, template: "<div class=\"container\" fxLayout=\"row\">\n <div #treeContainer class=\"tree-container\" fxFlex=\"nogrow\">\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{min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.divider{cursor:ew-resize;padding:12px}.divider ::ng-deep .mat-divider{height:100%}"], components: [{ type: i1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3.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: i4.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: i5.MatProgressSpinner, selector: "mat-progress-spinner", inputs: ["color", "mode", "diameter", "strokeWidth", "value"], exportAs: ["matProgressSpinner"] }, { type: i6.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i7.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: i7.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: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { type: i1.MatTreeNode, selector: "mat-tree-node", inputs: ["role", "disabled", "tabIndex"], exportAs: ["matTreeNode"] }, { type: i1.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { type: i7.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: i9.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: i10.IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }, { type: i1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { type: i11.ContenteditableDirective, selector: "[rxapContenteditable]", inputs: ["rxapContenteditable", "disabled"], outputs: ["change"] }, { type: i7.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: i12.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], pipes: { "async": i8.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
478
|
+
TreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeComponent, deps: [{ token: ViewContainerRef }, { token: ChangeDetectorRef }, { token: RXAP_TREE_CONTENT_EDITABLE_METHOD, optional: true }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
479
|
+
TreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TreeComponent, selector: "rxap-tree", inputs: { dataSource: "dataSource", contentEditableMethod: "contentEditableMethod", toDisplay: "toDisplay", getIcon: "getIcon", multiple: "multiple", hasDetails: "hasDetails", hideLeafIcon: "hideLeafIcon" }, 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, template: "<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", styles: [".container{height:100%}.tree-view{background-color:initial}.details{max-height:calc(100vh - 96px);overflow-y:auto}.tree-container{max-height:calc(100vh - 96px);overflow-y:auto;min-width:256px;width:-moz-fit-content;width:fit-content}.divider{cursor:ew-resize;padding:12px}.divider ::ng-deep .mat-divider{height:100%}\n"], components: [{ type: i1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i2.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5.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.MatProgressSpinner, selector: "mat-progress-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { type: i7.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i8.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.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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { type: i2.MatTreeNode, selector: "mat-tree-node", inputs: ["role", "disabled", "tabIndex"], exportAs: ["matTreeNode"] }, { type: i2.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { type: i8.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.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.IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }, { type: i2.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { type: i12.ContenteditableDirective, selector: "[rxapContenteditable]", inputs: ["rxapContenteditable", "disabled"], outputs: ["change"] }, { type: i8.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.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
455
480
|
__decorate([
|
|
456
481
|
Required,
|
|
457
482
|
__metadata("design:type", TreeDataSource)
|
|
@@ -462,27 +487,23 @@ __decorate([
|
|
|
462
487
|
__metadata("design:paramtypes", [Node]),
|
|
463
488
|
__metadata("design:returntype", void 0)
|
|
464
489
|
], TreeComponent.prototype, "openDetails", null);
|
|
465
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
490
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeComponent, decorators: [{
|
|
466
491
|
type: Component,
|
|
467
|
-
args: [{
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
type:
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}, {
|
|
483
|
-
type: Inject,
|
|
484
|
-
args: [RXAP_TREE_CONTENT_EDITABLE_METHOD]
|
|
485
|
-
}] }, { type: i0.Renderer2 }]; }, propDecorators: { dataSource: [{
|
|
492
|
+
args: [{ selector: 'rxap-tree', changeDetection: ChangeDetectionStrategy.OnPush, template: "<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", styles: [".container{height:100%}.tree-view{background-color:initial}.details{max-height:calc(100vh - 96px);overflow-y:auto}.tree-container{max-height:calc(100vh - 96px);overflow-y:auto;min-width:256px;width:-moz-fit-content;width:fit-content}.divider{cursor:ew-resize;padding:12px}.divider ::ng-deep .mat-divider{height:100%}\n"] }]
|
|
493
|
+
}], ctorParameters: function () {
|
|
494
|
+
return [{ type: i0.ViewContainerRef, decorators: [{
|
|
495
|
+
type: Inject,
|
|
496
|
+
args: [ViewContainerRef]
|
|
497
|
+
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
498
|
+
type: Inject,
|
|
499
|
+
args: [ChangeDetectorRef]
|
|
500
|
+
}] }, { type: undefined, decorators: [{
|
|
501
|
+
type: Optional
|
|
502
|
+
}, {
|
|
503
|
+
type: Inject,
|
|
504
|
+
args: [RXAP_TREE_CONTENT_EDITABLE_METHOD]
|
|
505
|
+
}] }, { type: i0.Renderer2 }];
|
|
506
|
+
}, propDecorators: { dataSource: [{
|
|
486
507
|
type: Input
|
|
487
508
|
}], contentEditableMethod: [{
|
|
488
509
|
type: Input
|
|
@@ -514,8 +535,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImpor
|
|
|
514
535
|
|
|
515
536
|
class TreeComponentModule {
|
|
516
537
|
}
|
|
517
|
-
TreeComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
518
|
-
TreeComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
538
|
+
TreeComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
539
|
+
TreeComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeComponentModule, declarations: [TreeComponent, TreeContentDirective], imports: [CommonModule,
|
|
519
540
|
MatTreeModule,
|
|
520
541
|
MatButtonModule,
|
|
521
542
|
MatIconModule,
|
|
@@ -525,8 +546,9 @@ TreeComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
|
|
|
525
546
|
PortalModule,
|
|
526
547
|
ContenteditableDirectiveModule,
|
|
527
548
|
IconDirectiveModule,
|
|
528
|
-
MatCheckboxModule
|
|
529
|
-
|
|
549
|
+
MatCheckboxModule,
|
|
550
|
+
MatProgressBarModule], exports: [TreeComponent, TreeContentDirective] });
|
|
551
|
+
TreeComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeComponentModule, imports: [[
|
|
530
552
|
CommonModule,
|
|
531
553
|
MatTreeModule,
|
|
532
554
|
MatButtonModule,
|
|
@@ -537,9 +559,10 @@ TreeComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
|
|
|
537
559
|
PortalModule,
|
|
538
560
|
ContenteditableDirectiveModule,
|
|
539
561
|
IconDirectiveModule,
|
|
540
|
-
MatCheckboxModule
|
|
562
|
+
MatCheckboxModule,
|
|
563
|
+
MatProgressBarModule
|
|
541
564
|
]] });
|
|
542
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
565
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeComponentModule, decorators: [{
|
|
543
566
|
type: NgModule,
|
|
544
567
|
args: [{
|
|
545
568
|
imports: [
|
|
@@ -553,11 +576,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImpor
|
|
|
553
576
|
PortalModule,
|
|
554
577
|
ContenteditableDirectiveModule,
|
|
555
578
|
IconDirectiveModule,
|
|
556
|
-
MatCheckboxModule
|
|
579
|
+
MatCheckboxModule,
|
|
580
|
+
MatProgressBarModule
|
|
557
581
|
],
|
|
558
582
|
declarations: [TreeComponent, TreeContentDirective],
|
|
559
|
-
exports: [TreeComponent, TreeContentDirective]
|
|
560
|
-
entryComponents: [TreeComponent]
|
|
583
|
+
exports: [TreeComponent, TreeContentDirective]
|
|
561
584
|
}]
|
|
562
585
|
}] });
|
|
563
586
|
|
|
@@ -566,4 +589,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImpor
|
|
|
566
589
|
*/
|
|
567
590
|
|
|
568
591
|
export { RXAP_TREE_CONTENT_EDITABLE_METHOD, RXAP_TREE_DATA_SOURCE_CHILDREN_REMOTE_METHOD, RXAP_TREE_DATA_SOURCE_ROOT_REMOTE_METHOD, TreeComponent, TreeComponentModule, TreeContentDirective, TreeDataSource, isSelectionChange };
|
|
569
|
-
//# sourceMappingURL=rxap-tree.
|
|
592
|
+
//# sourceMappingURL=rxap-tree.mjs.map
|