@rxap/tree 16.0.0 → 16.0.1-dev.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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/esm2022/lib/search.form.mjs +2 -2
- package/esm2022/lib/tree.component.mjs +25 -13
- package/esm2022/lib/tree.data-source.mjs +36 -30
- package/fesm2022/rxap-tree.mjs +91 -34
- package/fesm2022/rxap-tree.mjs.map +1 -1
- package/lib/search.form.d.ts +7 -11
- package/lib/tree.component.d.ts +8 -5
- package/lib/tree.data-source.d.ts +17 -7
- package/package.json +2 -1
- package/theme.css +1 -1
package/fesm2022/rxap-tree.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import { __decorate, __metadata } from 'tslib';
|
|
|
2
2
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
3
3
|
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { InjectionToken, isDevMode, Injectable, Inject, Optional, TemplateRef, Directive, EventEmitter, signal, ViewContainerRef, ChangeDetectorRef, Component, ChangeDetectionStrategy, Input, ContentChild, Output, ViewChild, HostListener } from '@angular/core';
|
|
5
|
+
import { InjectionToken, isDevMode, Injectable, Inject, Optional, TemplateRef, Directive, INJECTOR, SkipSelf, EventEmitter, signal, ViewContainerRef, ChangeDetectorRef, Component, ChangeDetectionStrategy, Input, ContentChild, Output, ViewChild, HostListener } from '@angular/core';
|
|
6
6
|
import { BaseDataSource, RXAP_DATA_SOURCE_METADATA, RxapDataSource } from '@rxap/data-source';
|
|
7
7
|
import { Node } from '@rxap/data-structure-tree';
|
|
8
8
|
import { ToggleSubject } from '@rxap/rxjs';
|
|
9
|
-
import { coerceArray, joinPath, Required, DebounceCall } from '@rxap/utilities';
|
|
9
|
+
import { coerceArray, getIdentifierPropertyValue, joinPath, Required, DebounceCall } from '@rxap/utilities';
|
|
10
10
|
import { BehaviorSubject, Subject, combineLatest, from, merge } from 'rxjs';
|
|
11
11
|
import { switchMap, map, tap, startWith } from 'rxjs/operators';
|
|
12
12
|
import * as i8 from '@angular/cdk/portal';
|
|
@@ -28,6 +28,7 @@ import * as i2 from '@angular/material/tree';
|
|
|
28
28
|
import { MatTreeModule } from '@angular/material/tree';
|
|
29
29
|
import { ContenteditableDirective } from '@rxap/contenteditable';
|
|
30
30
|
import { IconDirective } from '@rxap/material-directives/icon';
|
|
31
|
+
import { UseFormControl, RxapFormControl, RxapForm, RxapFormBuilder, RXAP_FORM_DEFINITION, RXAP_FORM_INITIAL_STATE } from '@rxap/forms';
|
|
31
32
|
|
|
32
33
|
function isSelectionChange(obj) {
|
|
33
34
|
return !!obj && obj['added'] !== undefined && obj['removed'] !== undefined;
|
|
@@ -72,7 +73,7 @@ class DefaultTreeApplyFilterMethod {
|
|
|
72
73
|
}
|
|
73
74
|
const hasScopeFilter = (filter.scope &&
|
|
74
75
|
Object.keys(filter.scope) &&
|
|
75
|
-
Object.values(filter.scope).some(list => list.length > 0));
|
|
76
|
+
Object.values(filter.scope).some((list) => list.length > 0));
|
|
76
77
|
// if not scope and the search filter is an empty string, collapse all non-root nodes
|
|
77
78
|
if (!filter.search && filter.search !== this.lastFilter?.search) {
|
|
78
79
|
nodes
|
|
@@ -84,7 +85,7 @@ class DefaultTreeApplyFilterMethod {
|
|
|
84
85
|
for (const [type, list] of Object.entries(filter.scope ?? {})) {
|
|
85
86
|
for (const node of nodes) {
|
|
86
87
|
if (node.type === type) {
|
|
87
|
-
if (list.some(item => item
|
|
88
|
+
if (list.some(item => getIdentifierPropertyValue(item) === node.id)) {
|
|
88
89
|
node.show({ forEachChildren: true });
|
|
89
90
|
}
|
|
90
91
|
}
|
|
@@ -165,14 +166,14 @@ let TreeDataSource = class TreeDataSource extends BaseDataSource {
|
|
|
165
166
|
this.rootRemoteMethod = rootRemoteMethod;
|
|
166
167
|
this.childrenRemoteMethod = childrenRemoteMethod;
|
|
167
168
|
this.tree$ = new BehaviorSubject([]);
|
|
168
|
-
this._expandedLocalStorageSubscription = null;
|
|
169
|
-
this._selectedLocalStorageSubscription = null;
|
|
170
169
|
// TODO : änlich problem wie bei der redundaten expand SelectionModel.
|
|
171
170
|
this.loading$ = new ToggleSubject(true);
|
|
172
171
|
this.searchForm = null;
|
|
172
|
+
this._data$ = new BehaviorSubject([]);
|
|
173
|
+
this._expandedLocalStorageSubscription = null;
|
|
174
|
+
this._selectedLocalStorageSubscription = null;
|
|
173
175
|
// im localStorage wird nur die id gespeichert.
|
|
174
176
|
this._preSelected = [];
|
|
175
|
-
this._data$ = new BehaviorSubject([]);
|
|
176
177
|
this._refreshMatchFilter = new Subject();
|
|
177
178
|
this._nodeParameters = null;
|
|
178
179
|
this.toDisplay = () => 'to display function not defined';
|
|
@@ -186,6 +187,13 @@ let TreeDataSource = class TreeDataSource extends BaseDataSource {
|
|
|
186
187
|
this.initSelected();
|
|
187
188
|
this.initExpanded();
|
|
188
189
|
}
|
|
190
|
+
get nodeParameters() {
|
|
191
|
+
return this._nodeParameters;
|
|
192
|
+
}
|
|
193
|
+
set nodeParameters(nodeParameters) {
|
|
194
|
+
this._nodeParameters = nodeParameters;
|
|
195
|
+
this.tree$.value.forEach(node => node.parameters = nodeParameters);
|
|
196
|
+
}
|
|
189
197
|
ngOnInit() {
|
|
190
198
|
if (this.searchForm) {
|
|
191
199
|
combineLatest([
|
|
@@ -202,16 +210,9 @@ let TreeDataSource = class TreeDataSource extends BaseDataSource {
|
|
|
202
210
|
this.tree$.pipe(map(tree => flatTree(tree).filter(node => node.isVisible)), tap(nodes => nodes.forEach(node => node.show()))).subscribe(data => this._data$.next(data));
|
|
203
211
|
}
|
|
204
212
|
}
|
|
205
|
-
|
|
206
|
-
return this._nodeParameters;
|
|
207
|
-
}
|
|
208
|
-
set nodeParameters(nodeParameters) {
|
|
209
|
-
this._nodeParameters = nodeParameters;
|
|
210
|
-
this.tree$.value.forEach(node => node.parameters = nodeParameters);
|
|
211
|
-
}
|
|
212
|
-
async getTreeRoot() {
|
|
213
|
+
async getTreeRoot(options = {}) {
|
|
213
214
|
this.loading$.enable();
|
|
214
|
-
const root = await this.getRoot();
|
|
215
|
+
const root = await this.getRoot(options);
|
|
215
216
|
let rootNodes;
|
|
216
217
|
if (Array.isArray(root)) {
|
|
217
218
|
rootNodes = await Promise.all(root.map((node) => this._toNode(null, node)));
|
|
@@ -309,12 +310,12 @@ let TreeDataSource = class TreeDataSource extends BaseDataSource {
|
|
|
309
310
|
}
|
|
310
311
|
return this.childrenRemoteMethod.call(node);
|
|
311
312
|
}
|
|
312
|
-
async getRoot() {
|
|
313
|
-
const rootParameters = await this.getRootParameters();
|
|
313
|
+
async getRoot(options = {}) {
|
|
314
|
+
const rootParameters = await this.getRootParameters(options);
|
|
314
315
|
return this.rootRemoteMethod.call(rootParameters);
|
|
315
316
|
}
|
|
316
|
-
async getRootParameters() {
|
|
317
|
-
return
|
|
317
|
+
async getRootParameters(options = {}) {
|
|
318
|
+
return options;
|
|
318
319
|
}
|
|
319
320
|
// TODO : find better solution to allow the overwrite of the toNode method
|
|
320
321
|
// without losing the custom preselect and preexpand function
|
|
@@ -373,7 +374,7 @@ let TreeDataSource = class TreeDataSource extends BaseDataSource {
|
|
|
373
374
|
this._refreshMatchFilter.next();
|
|
374
375
|
}
|
|
375
376
|
async refresh() {
|
|
376
|
-
const rootNodes = await this.getTreeRoot();
|
|
377
|
+
const rootNodes = await this.getTreeRoot({ cache: false });
|
|
377
378
|
// refresh all expanded nodes;
|
|
378
379
|
const loadExpandedNodes = async (children) => {
|
|
379
380
|
for (const child of children) {
|
|
@@ -390,11 +391,11 @@ let TreeDataSource = class TreeDataSource extends BaseDataSource {
|
|
|
390
391
|
await Promise.all(rootNodes
|
|
391
392
|
.filter((node) => node.hasChildren)
|
|
392
393
|
.map((node) => loadExpandedNodes(node.children)));
|
|
393
|
-
const selected = this.selected.selected
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
this.selected.clear();
|
|
397
|
-
this.selected.select(...selected);
|
|
394
|
+
// const selected: Array<Node<Data>> = this.selected.selected
|
|
395
|
+
// .map((node) => this.getNodeById(node.id))
|
|
396
|
+
// .filter(Boolean) as any;
|
|
397
|
+
// this.selected.clear();
|
|
398
|
+
// this.selected.select(...selected);
|
|
398
399
|
}
|
|
399
400
|
reset() {
|
|
400
401
|
this.selected.clear();
|
|
@@ -441,6 +442,12 @@ let TreeDataSource = class TreeDataSource extends BaseDataSource {
|
|
|
441
442
|
if (this.tree$.value.length === 0) {
|
|
442
443
|
loadRoot = this.getTreeRoot();
|
|
443
444
|
}
|
|
445
|
+
if (this.metadata.autoRefreshWithoutCache) {
|
|
446
|
+
loadRoot = loadRoot.then(data => {
|
|
447
|
+
this.refresh();
|
|
448
|
+
return data;
|
|
449
|
+
});
|
|
450
|
+
}
|
|
444
451
|
return from(loadRoot).pipe(tap((rootNodes) => {
|
|
445
452
|
if (rootNodes) {
|
|
446
453
|
const promises = [];
|
|
@@ -565,12 +572,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
565
572
|
|
|
566
573
|
const RXAP_TREE_CONTENT_EDITABLE_METHOD = new InjectionToken('rxap/tree-content-editable-method');
|
|
567
574
|
|
|
575
|
+
let SearchForm = class SearchForm {
|
|
576
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SearchForm, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
577
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SearchForm }); }
|
|
578
|
+
};
|
|
579
|
+
__decorate([
|
|
580
|
+
UseFormControl(),
|
|
581
|
+
__metadata("design:type", RxapFormControl)
|
|
582
|
+
], SearchForm.prototype, "search", void 0);
|
|
583
|
+
__decorate([
|
|
584
|
+
UseFormControl(),
|
|
585
|
+
__metadata("design:type", RxapFormControl)
|
|
586
|
+
], SearchForm.prototype, "scope", void 0);
|
|
587
|
+
SearchForm = __decorate([
|
|
588
|
+
RxapForm({
|
|
589
|
+
id: 'search',
|
|
590
|
+
autoSubmit: 500,
|
|
591
|
+
})
|
|
592
|
+
], SearchForm);
|
|
593
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SearchForm, decorators: [{
|
|
594
|
+
type: Injectable
|
|
595
|
+
}], propDecorators: { search: [], scope: [] } });
|
|
596
|
+
function FormFactory(injector, state, existingFormDefinition) {
|
|
597
|
+
if (existingFormDefinition) {
|
|
598
|
+
return existingFormDefinition;
|
|
599
|
+
}
|
|
600
|
+
return new RxapFormBuilder(SearchForm, injector).build(state ?? {});
|
|
601
|
+
}
|
|
602
|
+
const SearchFormProviders = [
|
|
603
|
+
SearchForm,
|
|
604
|
+
{
|
|
605
|
+
provide: RXAP_FORM_DEFINITION,
|
|
606
|
+
useFactory: FormFactory,
|
|
607
|
+
deps: [
|
|
608
|
+
INJECTOR,
|
|
609
|
+
[new Optional(), RXAP_FORM_INITIAL_STATE],
|
|
610
|
+
[new SkipSelf(), new Optional(), RXAP_FORM_DEFINITION],
|
|
611
|
+
],
|
|
612
|
+
},
|
|
613
|
+
];
|
|
614
|
+
|
|
568
615
|
class TreeComponent {
|
|
569
|
-
constructor(viewContainerRef, cdr, contentEditableMethod, renderer, elementRef) {
|
|
616
|
+
constructor(viewContainerRef, cdr, contentEditableMethod, renderer, elementRef, searchForm) {
|
|
570
617
|
this.viewContainerRef = viewContainerRef;
|
|
571
618
|
this.cdr = cdr;
|
|
572
619
|
this.renderer = renderer;
|
|
573
620
|
this.elementRef = elementRef;
|
|
621
|
+
this.searchForm = searchForm;
|
|
574
622
|
this.multiple = false;
|
|
575
623
|
this.hideLeafIcon = false;
|
|
576
624
|
this.details = new EventEmitter();
|
|
@@ -602,11 +650,13 @@ class TreeComponent {
|
|
|
602
650
|
return ['rxap', 'tree', this.id].join('/');
|
|
603
651
|
}
|
|
604
652
|
ngOnInit() {
|
|
653
|
+
this.dataSource.searchForm = this.searchForm;
|
|
605
654
|
this.dataSource.setTreeControl(this.treeControl);
|
|
606
655
|
this.dataSource.setToDisplay(this.toDisplay);
|
|
607
656
|
this.dataSource.setGetIcon(this.getIcon);
|
|
608
657
|
this.dataSource.setHasDetails(this.hasDetails);
|
|
609
658
|
this.dataSource.setGetStyle(this.getStyle);
|
|
659
|
+
this.dataSource.setGetType(this.getType);
|
|
610
660
|
this.multiple = this.dataSource.metadata.selectMultiple ?? this.multiple;
|
|
611
661
|
if (this.dataSource.selected.hasValue()) {
|
|
612
662
|
this.dataSource.selected.selected.forEach((node) => this.openDetails(node));
|
|
@@ -654,6 +704,9 @@ class TreeComponent {
|
|
|
654
704
|
this.setDividerOffset(offset);
|
|
655
705
|
}
|
|
656
706
|
}
|
|
707
|
+
toggleTreeNavigation() {
|
|
708
|
+
this.showTreeNavigation.update((value) => !value);
|
|
709
|
+
}
|
|
657
710
|
setDividerOffset(offset) {
|
|
658
711
|
this.dividerOffset = offset;
|
|
659
712
|
this.renderer.setStyle(this.treeContainer.nativeElement, 'max-width', offset);
|
|
@@ -661,11 +714,8 @@ class TreeComponent {
|
|
|
661
714
|
this.renderer.setStyle(this.treeContainer.nativeElement, 'flex-basis', offset);
|
|
662
715
|
localStorage.setItem(this.cacheId, offset);
|
|
663
716
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}
|
|
667
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TreeComponent, deps: [{ token: ViewContainerRef }, { token: ChangeDetectorRef }, { token: RXAP_TREE_CONTENT_EDITABLE_METHOD, optional: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
668
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TreeComponent, isStandalone: true, selector: "rxap-tree", inputs: { dataSource: "dataSource", contentEditableMethod: "contentEditableMethod", toDisplay: "toDisplay", getIcon: "getIcon", getStyle: "getStyle", 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, template: "<div class=\"grow flex flex-col gap-2\">\n <button type=\"button\" (click)=\"toggleTreeNavigation()\" class=\"!justify-start\" mat-button>\n <span class=\"flex flex-row justify-start items-center gap-6\">\n <ng-template [ngIf]=\"showTreeNavigation()\">\n <mat-icon>arrow_back</mat-icon>\n <span i18n>Hide tree navigation</span>\n </ng-template>\n <ng-template [ngIf]=\"!showTreeNavigation()\">\n <mat-icon>arrow_forward</mat-icon>\n <span i18n>Show tree navigation</span>\n </ng-template>\n </span>\n </button>\n <div class=\"flex flex-row grow\">\n <div #treeContainer [ngClass]=\"{ 'hidden': !showTreeNavigation() }\"\n [ngStyle]=\"{ maxWidth: dividerOffset, minWidth: dividerOffset, flexBasis: dividerOffset }\"\n class=\"w-fit grow-0 overflow-y-auto\">\n <mat-progress-bar *ngIf=\"!dataSource || (dataSource.loading$ | async)\" mode=\"indeterminate\"></mat-progress-bar>\n <ng-content select=\"[searchHeader]\"></ng-content>\n <mat-tree *ngIf=\"dataSource; else loading\" [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n\n <!-- Node without children -->\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding>\n <div class=\"flex flex-row justify-start items-center gap-2\">\n <mat-icon [ngClass]=\"{ 'hidden': hideLeafIcon }\">subdirectory_arrow_right</mat-icon>\n <ng-container *ngIf=\"node.icon?.length\">\n <mat-icon *ngFor=\"let icon of node.icon\" [rxapIcon]=\"$any(icon)\"></mat-icon>\n </ng-container>\n <ng-template [ngIf]=\"multiple\">\n <mat-checkbox\n (change)=\"node.toggleSelect()\"\n [checked]=\"node.selected\"\n [disabled]=\"!node.hasDetails\"\n [ngStyle]=\"node.style\"\n class=\"grow-0\">\n {{ node.display }}\n </mat-checkbox>\n </ng-template>\n <ng-template [ngIf]=\"!multiple\">\n <button\n type=\"button\"\n (click)=\"node.select()\"\n [color]=\"node.selected ? 'primary' : undefined\"\n [disabled]=\"!node.hasDetails\"\n [ngStyle]=\"node.style\"\n class=\"grow-0\"\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 type=\"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 class=\"flex flex-row justify-start items-center gap-2\">\n <ng-container *ngIf=\"node.icon?.length else withoutIcon\">\n <mat-icon *ngFor=\"let icon of node.icon\" [rxapIcon]=\"$any(icon)\"></mat-icon>\n </ng-container>\n <ng-template #withoutIcon>\n <div></div>\n </ng-template>\n <ng-template [ngIfElse]=\"withoutDetails\" [ngIf]=\"node.hasDetails\">\n <button\n type=\"button\"\n (click)=\"node.select()\"\n [color]=\"node.selected ? 'primary' : undefined\"\n [ngStyle]=\"node.style\"\n class=\"grow-0\"\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 [ngStyle]=\"node.style\"\n class=\"grow-0\"\n rxapContenteditable>\n {{ node.display }}\n </span>\n </ng-template>\n <mat-progress-spinner\n *ngIf=\"node.isLoading$ | async\"\n [diameter]=\"16\"\n class=\"grow-0 pl-4\"\n mode=\"indeterminate\"\n ></mat-progress-spinner>\n </div>\n </mat-tree-node>\n\n </mat-tree>\n </div>\n\n <div (mousedown)=\"onMousedown()\" *ngIf=\"showTreeNavigation()\"\n class=\"divider cursor-ew-resize px-3 grow-0\">\n <mat-divider [vertical]=\"true\" class=\"h-full\"></mat-divider>\n </div>\n\n <div class=\"grow\">\n <ng-container *ngIf=\"portal\">\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n </ng-container>\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #loading>Load data source</ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i2.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i2.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i2.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i2.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i2.MatTreeNode, selector: "mat-tree-node", inputs: ["role", "disabled", "tabIndex"], exportAs: ["matTreeNode"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: ContenteditableDirective, selector: "[rxapContenteditable]", inputs: ["rxapContenteditable", "disabled"], outputs: ["change"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i7.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i8.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
717
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TreeComponent, deps: [{ token: ViewContainerRef }, { token: ChangeDetectorRef }, { token: RXAP_TREE_CONTENT_EDITABLE_METHOD, optional: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: RXAP_FORM_DEFINITION, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
718
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TreeComponent, isStandalone: true, selector: "rxap-tree", inputs: { dataSource: "dataSource", contentEditableMethod: "contentEditableMethod", toDisplay: "toDisplay", getIcon: "getIcon", getType: "getType", getStyle: "getStyle", 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, template: "<div class=\"grow flex flex-col gap-2 justify-start items-start\">\n <button (click)=\"toggleTreeNavigation()\" class=\"!justify-start\" mat-button type=\"button\">\n <span class=\"flex flex-row justify-start items-center gap-6\">\n <ng-template [ngIf]=\"showTreeNavigation()\">\n <mat-icon>arrow_back</mat-icon>\n <span i18n>Hide tree navigation</span>\n </ng-template>\n <ng-template [ngIf]=\"!showTreeNavigation()\">\n <mat-icon>arrow_forward</mat-icon>\n <span i18n>Show tree navigation</span>\n </ng-template>\n </span>\n </button>\n <div class=\"flex flex-row grow w-full\">\n <div #treeContainer [ngClass]=\"{ 'hidden': !showTreeNavigation() }\"\n [ngStyle]=\"{ maxWidth: dividerOffset, minWidth: dividerOffset, flexBasis: dividerOffset }\"\n class=\"w-fit grow-0 overflow-y-auto\">\n <mat-progress-bar *ngIf=\"!dataSource || (dataSource.loading$ | async)\" mode=\"indeterminate\"></mat-progress-bar>\n <ng-content select=\"[searchHeader]\"></ng-content>\n <mat-tree *ngIf=\"dataSource; else loading\" [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n\n <!-- Node without children -->\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding>\n <div class=\"flex flex-row justify-start items-center gap-2\">\n <mat-icon [ngClass]=\"{ 'hidden': hideLeafIcon }\">subdirectory_arrow_right</mat-icon>\n <ng-container *ngIf=\"node.icon?.length\">\n <mat-icon *ngFor=\"let icon of node.icon\" [rxapIcon]=\"$any(icon)\"></mat-icon>\n </ng-container>\n <ng-template [ngIf]=\"multiple\">\n <mat-checkbox\n (change)=\"node.toggleSelect()\"\n [checked]=\"node.selected\"\n [disabled]=\"!node.hasDetails\"\n [ngStyle]=\"node.style\"\n class=\"grow-0\">\n {{ node.display }}\n </mat-checkbox>\n </ng-template>\n <ng-template [ngIf]=\"!multiple\">\n <button\n (click)=\"node.select()\"\n [color]=\"node.selected ? 'primary' : undefined\"\n [disabled]=\"!node.hasDetails\"\n [ngStyle]=\"node.style\"\n class=\"grow-0\"\n mat-button\n type=\"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 type=\"button\">\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <div class=\"flex flex-row justify-start items-center gap-2\">\n <ng-container *ngIf=\"node.icon?.length else withoutIcon\">\n <mat-icon *ngFor=\"let icon of node.icon\" [rxapIcon]=\"$any(icon)\"></mat-icon>\n </ng-container>\n <ng-template #withoutIcon>\n <div></div>\n </ng-template>\n <ng-template [ngIfElse]=\"withoutDetails\" [ngIf]=\"node.hasDetails\">\n <button\n (click)=\"node.select()\"\n [color]=\"node.selected ? 'primary' : undefined\"\n [ngStyle]=\"node.style\"\n class=\"grow-0\"\n mat-button\n type=\"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 [ngStyle]=\"node.style\"\n class=\"grow-0\"\n rxapContenteditable>\n {{ node.display }}\n </span>\n </ng-template>\n <mat-progress-spinner\n *ngIf=\"node.isLoading$ | async\"\n [diameter]=\"16\"\n class=\"grow-0 pl-4\"\n mode=\"indeterminate\"\n ></mat-progress-spinner>\n </div>\n </mat-tree-node>\n\n </mat-tree>\n </div>\n\n <div (mousedown)=\"onMousedown()\" *ngIf=\"showTreeNavigation()\"\n class=\"divider cursor-ew-resize px-3 grow-0\">\n <mat-divider [vertical]=\"true\" class=\"h-full\"></mat-divider>\n </div>\n\n <div class=\"grow\">\n <ng-container *ngIf=\"portal\">\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n </ng-container>\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #loading>Load data source</ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i2.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i2.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i2.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i2.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i2.MatTreeNode, selector: "mat-tree-node", inputs: ["role", "disabled", "tabIndex"], exportAs: ["matTreeNode"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: ContenteditableDirective, selector: "[rxapContenteditable]", inputs: ["rxapContenteditable", "disabled"], outputs: ["change"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i7.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i8.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
669
719
|
}
|
|
670
720
|
__decorate([
|
|
671
721
|
DebounceCall(100),
|
|
@@ -691,7 +741,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
691
741
|
AsyncPipe,
|
|
692
742
|
NgClass,
|
|
693
743
|
NgForOf,
|
|
694
|
-
], template: "<div class=\"grow flex flex-col gap-2\">\n <button
|
|
744
|
+
], template: "<div class=\"grow flex flex-col gap-2 justify-start items-start\">\n <button (click)=\"toggleTreeNavigation()\" class=\"!justify-start\" mat-button type=\"button\">\n <span class=\"flex flex-row justify-start items-center gap-6\">\n <ng-template [ngIf]=\"showTreeNavigation()\">\n <mat-icon>arrow_back</mat-icon>\n <span i18n>Hide tree navigation</span>\n </ng-template>\n <ng-template [ngIf]=\"!showTreeNavigation()\">\n <mat-icon>arrow_forward</mat-icon>\n <span i18n>Show tree navigation</span>\n </ng-template>\n </span>\n </button>\n <div class=\"flex flex-row grow w-full\">\n <div #treeContainer [ngClass]=\"{ 'hidden': !showTreeNavigation() }\"\n [ngStyle]=\"{ maxWidth: dividerOffset, minWidth: dividerOffset, flexBasis: dividerOffset }\"\n class=\"w-fit grow-0 overflow-y-auto\">\n <mat-progress-bar *ngIf=\"!dataSource || (dataSource.loading$ | async)\" mode=\"indeterminate\"></mat-progress-bar>\n <ng-content select=\"[searchHeader]\"></ng-content>\n <mat-tree *ngIf=\"dataSource; else loading\" [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n\n <!-- Node without children -->\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding>\n <div class=\"flex flex-row justify-start items-center gap-2\">\n <mat-icon [ngClass]=\"{ 'hidden': hideLeafIcon }\">subdirectory_arrow_right</mat-icon>\n <ng-container *ngIf=\"node.icon?.length\">\n <mat-icon *ngFor=\"let icon of node.icon\" [rxapIcon]=\"$any(icon)\"></mat-icon>\n </ng-container>\n <ng-template [ngIf]=\"multiple\">\n <mat-checkbox\n (change)=\"node.toggleSelect()\"\n [checked]=\"node.selected\"\n [disabled]=\"!node.hasDetails\"\n [ngStyle]=\"node.style\"\n class=\"grow-0\">\n {{ node.display }}\n </mat-checkbox>\n </ng-template>\n <ng-template [ngIf]=\"!multiple\">\n <button\n (click)=\"node.select()\"\n [color]=\"node.selected ? 'primary' : undefined\"\n [disabled]=\"!node.hasDetails\"\n [ngStyle]=\"node.style\"\n class=\"grow-0\"\n mat-button\n type=\"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 type=\"button\">\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <div class=\"flex flex-row justify-start items-center gap-2\">\n <ng-container *ngIf=\"node.icon?.length else withoutIcon\">\n <mat-icon *ngFor=\"let icon of node.icon\" [rxapIcon]=\"$any(icon)\"></mat-icon>\n </ng-container>\n <ng-template #withoutIcon>\n <div></div>\n </ng-template>\n <ng-template [ngIfElse]=\"withoutDetails\" [ngIf]=\"node.hasDetails\">\n <button\n (click)=\"node.select()\"\n [color]=\"node.selected ? 'primary' : undefined\"\n [ngStyle]=\"node.style\"\n class=\"grow-0\"\n mat-button\n type=\"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 [ngStyle]=\"node.style\"\n class=\"grow-0\"\n rxapContenteditable>\n {{ node.display }}\n </span>\n </ng-template>\n <mat-progress-spinner\n *ngIf=\"node.isLoading$ | async\"\n [diameter]=\"16\"\n class=\"grow-0 pl-4\"\n mode=\"indeterminate\"\n ></mat-progress-spinner>\n </div>\n </mat-tree-node>\n\n </mat-tree>\n </div>\n\n <div (mousedown)=\"onMousedown()\" *ngIf=\"showTreeNavigation()\"\n class=\"divider cursor-ew-resize px-3 grow-0\">\n <mat-divider [vertical]=\"true\" class=\"h-full\"></mat-divider>\n </div>\n\n <div class=\"grow\">\n <ng-container *ngIf=\"portal\">\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n </ng-container>\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #loading>Load data source</ng-template>\n" }]
|
|
695
745
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef, decorators: [{
|
|
696
746
|
type: Inject,
|
|
697
747
|
args: [ViewContainerRef]
|
|
@@ -703,7 +753,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
703
753
|
}, {
|
|
704
754
|
type: Inject,
|
|
705
755
|
args: [RXAP_TREE_CONTENT_EDITABLE_METHOD]
|
|
706
|
-
}] }, { type: i0.Renderer2 }, { type: i0.ElementRef }
|
|
756
|
+
}] }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: SearchForm, decorators: [{
|
|
757
|
+
type: Optional
|
|
758
|
+
}, {
|
|
759
|
+
type: Inject,
|
|
760
|
+
args: [RXAP_FORM_DEFINITION]
|
|
761
|
+
}] }]; }, propDecorators: { dataSource: [{
|
|
707
762
|
type: Input,
|
|
708
763
|
args: [{ required: true }]
|
|
709
764
|
}], contentEditableMethod: [{
|
|
@@ -712,6 +767,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
712
767
|
type: Input
|
|
713
768
|
}], getIcon: [{
|
|
714
769
|
type: Input
|
|
770
|
+
}], getType: [{
|
|
771
|
+
type: Input
|
|
715
772
|
}], getStyle: [{
|
|
716
773
|
type: Input
|
|
717
774
|
}], multiple: [{
|