@tetacom/ng-components 1.5.2 → 1.5.4
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/component/tree/tree/tree.component.d.ts +16 -22
- package/component/tree/tree-item/tree-item.component.d.ts +14 -18
- package/component/tree/tree-item-toggle/tree-item-toggle.component.d.ts +8 -10
- package/fesm2022/tetacom-ng-components.mjs +80 -115
- package/fesm2022/tetacom-ng-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,44 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventEmitter, OnChanges, OnDestroy, OnInit, AfterViewInit } from '@angular/core';
|
|
2
2
|
import { ITreeData } from '../../../common/contract/i-tree-data';
|
|
3
3
|
import { TreeService } from '../tree.service';
|
|
4
4
|
import { TetaTemplateDirective } from '../../../directive/teta-template/teta-template.directive';
|
|
5
5
|
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class TreeComponent implements OnInit, OnChanges, OnDestroy {
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
height: number;
|
|
18
|
-
set openItems(items: ITreeData[]);
|
|
7
|
+
export declare class TreeComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit {
|
|
8
|
+
private treeService;
|
|
9
|
+
private elementRef;
|
|
10
|
+
private ngZone;
|
|
11
|
+
data: import("@angular/core").InputSignal<ITreeData[]>;
|
|
12
|
+
padding: import("@angular/core").InputSignal<number>;
|
|
13
|
+
childNodeName: import("@angular/core").InputSignal<string>;
|
|
14
|
+
virtual: import("@angular/core").InputSignal<boolean>;
|
|
15
|
+
height: import("@angular/core").InputSignal<number>;
|
|
16
|
+
openItems: import("@angular/core").ModelSignal<ITreeData[]>;
|
|
19
17
|
service: EventEmitter<TreeService>;
|
|
20
|
-
openItemsChange: EventEmitter<any>;
|
|
21
18
|
viewport: CdkVirtualScrollViewport;
|
|
22
19
|
template: TetaTemplateDirective;
|
|
23
|
-
childPadding: boolean
|
|
24
|
-
displayData: ITreeData[]
|
|
25
|
-
private _data;
|
|
26
|
-
private _openItems;
|
|
20
|
+
childPadding: import("@angular/core").Signal<boolean>;
|
|
21
|
+
displayData: import("@angular/core").Signal<ITreeData[]>;
|
|
27
22
|
private _alive;
|
|
28
23
|
private _obs;
|
|
29
|
-
constructor(
|
|
24
|
+
constructor();
|
|
30
25
|
set compareItems(func: (item: ITreeData) => any);
|
|
31
26
|
get compareItems(): (item: ITreeData) => any;
|
|
32
27
|
private readonly treeClass;
|
|
33
28
|
ngOnInit(): void;
|
|
34
|
-
ngOnChanges(
|
|
29
|
+
ngOnChanges(): void;
|
|
35
30
|
ngOnDestroy(): void;
|
|
36
31
|
ngAfterViewInit(): void;
|
|
37
32
|
trackRow: (index: number, item: ITreeData) => any;
|
|
38
|
-
private hasChildren;
|
|
39
33
|
private getDisplayData;
|
|
40
34
|
private addResizeObserver;
|
|
41
35
|
private removeResizeObserver;
|
|
42
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeComponent, never>;
|
|
43
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TreeComponent, "teta-tree", never, { "data": { "alias": "data"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "childNodeName": { "alias": "childNodeName"; "required": false; }; "virtual": { "alias": "virtual"; "required": false; }; "height": { "alias": "height"; "required": false; }; "openItems": { "alias": "openItems"; "required": false; }; "compareItems": { "alias": "compareItems"; "required": false; }; }, { "
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeComponent, "teta-tree", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "padding": { "alias": "padding"; "required": false; "isSignal": true; }; "childNodeName": { "alias": "childNodeName"; "required": false; "isSignal": true; }; "virtual": { "alias": "virtual"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "openItems": { "alias": "openItems"; "required": false; "isSignal": true; }; "compareItems": { "alias": "compareItems"; "required": false; }; }, { "openItems": "openItemsChange"; "service": "service"; }, ["template"], never, true, never>;
|
|
44
38
|
}
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Signal, TemplateRef } from '@angular/core';
|
|
2
2
|
import { ITreeData } from '../../../common/contract/i-tree-data';
|
|
3
3
|
import { TreeService } from '../tree.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: Lazy загрузка дочерних элементов, Output onExpand, шаблон для иконки expand
|
|
7
7
|
*/
|
|
8
|
-
export declare class TreeItemComponent
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
export declare class TreeItemComponent {
|
|
9
|
+
treeService: TreeService;
|
|
10
|
+
item: import("@angular/core").InputSignal<ITreeData>;
|
|
11
|
+
depth: import("@angular/core").InputSignal<number>;
|
|
12
|
+
padding: import("@angular/core").InputSignal<number>;
|
|
13
|
+
childNodeName: import("@angular/core").InputSignal<string>;
|
|
14
|
+
template: import("@angular/core").InputSignal<TemplateRef<any>>;
|
|
15
|
+
childPadding: import("@angular/core").InputSignal<boolean>;
|
|
16
|
+
openItems: Signal<ITreeData[]>;
|
|
17
17
|
private readonly treeItemClass;
|
|
18
|
-
itemIsOpen: boolean
|
|
19
|
-
private _alive;
|
|
18
|
+
itemIsOpen: Signal<boolean>;
|
|
20
19
|
private readonly treeItemInstance;
|
|
21
|
-
|
|
22
|
-
constructor(
|
|
20
|
+
computedDepth: Signal<number>;
|
|
21
|
+
constructor();
|
|
23
22
|
openItem(): void;
|
|
24
|
-
ngOnInit(): void;
|
|
25
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
26
|
-
ngOnDestroy(): void;
|
|
27
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeItemComponent, never>;
|
|
28
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TreeItemComponent, "teta-tree-item", never, { "item": { "alias": "item"; "required": false; }; "depth": { "alias": "depth"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "childNodeName": { "alias": "childNodeName"; "required": false; }; "template": { "alias": "template"; "required": false; }; "childPadding": { "alias": "childPadding"; "required": false; }; }, {}, never, never, true, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeItemComponent, "teta-tree-item", never, { "item": { "alias": "item"; "required": false; "isSignal": true; }; "depth": { "alias": "depth"; "required": false; "isSignal": true; }; "padding": { "alias": "padding"; "required": false; "isSignal": true; }; "childNodeName": { "alias": "childNodeName"; "required": false; "isSignal": true; }; "template": { "alias": "template"; "required": false; "isSignal": true; }; "childPadding": { "alias": "childPadding"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
29
25
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
2
|
import { TreeService } from '../tree.service';
|
|
3
3
|
import { ITreeData } from '../../../common/contract/i-tree-data';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class TreeItemToggleComponent
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
constructor(
|
|
12
|
-
ngOnInit(): void;
|
|
5
|
+
export declare class TreeItemToggleComponent {
|
|
6
|
+
treeService: TreeService;
|
|
7
|
+
item: import("@angular/core").InputSignal<ITreeData>;
|
|
8
|
+
open: Signal<boolean>;
|
|
9
|
+
openItems: Signal<ITreeData[]>;
|
|
10
|
+
constructor();
|
|
13
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeItemToggleComponent, never>;
|
|
14
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TreeItemToggleComponent, "teta-tree-item-toggle", never, { "item": { "alias": "item"; "required": false; }; }, {}, never, never, true, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeItemToggleComponent, "teta-tree-item-toggle", never, { "item": { "alias": "item"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
15
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, HostBinding, Directive, Optional, Inject, ContentChild, Input, Injectable, Host, HostListener, ViewChild, forwardRef, ElementRef, EventEmitter, Output, TemplateRef, Injector, ViewContainerRef, Pipe, ViewEncapsulation, ChangeDetectorRef, inject, NgModule, input, computed, output, contentChildren, effect, ContentChildren, SkipSelf, PLATFORM_ID, InjectionToken } from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, HostBinding, Directive, Optional, Inject, ContentChild, Input, Injectable, Host, HostListener, ViewChild, forwardRef, ElementRef, EventEmitter, Output, TemplateRef, Injector, ViewContainerRef, Pipe, ViewEncapsulation, ChangeDetectorRef, inject, NgModule, input, computed, output, contentChildren, effect, NgZone, model, ContentChildren, SkipSelf, PLATFORM_ID, InjectionToken } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
import { NgTemplateOutlet, DOCUMENT, NgClass, AsyncPipe, DatePipe, CommonModule, isPlatformBrowser } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
@@ -20,6 +20,7 @@ import * as i1$2 from '@jsverse/transloco';
|
|
|
20
20
|
import { TranslocoModule, TRANSLOCO_SCOPE, TranslocoService } from '@jsverse/transloco';
|
|
21
21
|
import { CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf } from '@angular/cdk/scrolling';
|
|
22
22
|
import objectHash from 'object-hash';
|
|
23
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
23
24
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
24
25
|
import isLeapYear from 'dayjs/plugin/isLeapYear';
|
|
25
26
|
import utc from 'dayjs/plugin/utc';
|
|
@@ -7716,6 +7717,12 @@ class CellComponentBase {
|
|
|
7716
7717
|
if (this.index === cellValue.row && this.column.name === cellValue.column) {
|
|
7717
7718
|
this.row.data[this.column.name] = cellValue.value;
|
|
7718
7719
|
this.setupControl();
|
|
7720
|
+
for (const controlsKey in this.formGroup.controls) {
|
|
7721
|
+
this.formGroup.controls[controlsKey].updateValueAndValidity({
|
|
7722
|
+
emitEvent: false,
|
|
7723
|
+
onlySelf: true,
|
|
7724
|
+
});
|
|
7725
|
+
}
|
|
7719
7726
|
this.formGroup.updateValueAndValidity();
|
|
7720
7727
|
this.row.valid = this.formGroup.valid;
|
|
7721
7728
|
this.cdr.detectChanges();
|
|
@@ -7763,7 +7770,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
7763
7770
|
type: Component,
|
|
7764
7771
|
args: [{
|
|
7765
7772
|
template: '',
|
|
7766
|
-
standalone: false
|
|
7773
|
+
standalone: false,
|
|
7767
7774
|
}]
|
|
7768
7775
|
}], ctorParameters: () => [{ type: TableService }, { type: i0.ChangeDetectorRef }], propDecorators: { cellClass: [{
|
|
7769
7776
|
type: HostBinding,
|
|
@@ -8593,25 +8600,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
8593
8600
|
}], ctorParameters: () => [] });
|
|
8594
8601
|
|
|
8595
8602
|
class TreeItemToggleComponent {
|
|
8596
|
-
constructor(
|
|
8597
|
-
this.
|
|
8598
|
-
this.
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
}));
|
|
8603
|
+
constructor() {
|
|
8604
|
+
this.treeService = inject(TreeService);
|
|
8605
|
+
this.item = input();
|
|
8606
|
+
this.openItems = toSignal(this.treeService.openItems);
|
|
8607
|
+
this.open = computed(() => {
|
|
8608
|
+
const found = this.openItems()?.find((x) => this.treeService.compareItems(x) === this.treeService.compareItems(this.item()));
|
|
8609
|
+
return !!found;
|
|
8610
|
+
});
|
|
8605
8611
|
}
|
|
8606
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TreeItemToggleComponent, deps: [
|
|
8607
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
8612
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TreeItemToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8613
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: TreeItemToggleComponent, isStandalone: true, selector: "teta-tree-item-toggle", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<teta-icon [name]=\"open() ? 'arrowDownKey' : 'arrowRightKey'\" class=\"tree__icon\"></teta-icon>\n", styles: [":host{display:inline-flex;align-items:center}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "teta-icon", inputs: ["name", "size", "palette", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8608
8614
|
}
|
|
8609
8615
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TreeItemToggleComponent, decorators: [{
|
|
8610
8616
|
type: Component,
|
|
8611
|
-
args: [{ selector: 'teta-tree-item-toggle', changeDetection: ChangeDetectionStrategy.OnPush, imports: [IconComponent
|
|
8612
|
-
}], ctorParameters: () => [
|
|
8613
|
-
type: Input
|
|
8614
|
-
}] } });
|
|
8617
|
+
args: [{ selector: 'teta-tree-item-toggle', changeDetection: ChangeDetectionStrategy.OnPush, imports: [IconComponent], template: "<teta-icon [name]=\"open() ? 'arrowDownKey' : 'arrowRightKey'\" class=\"tree__icon\"></teta-icon>\n", styles: [":host{display:inline-flex;align-items:center}\n"] }]
|
|
8618
|
+
}], ctorParameters: () => [] });
|
|
8615
8619
|
|
|
8616
8620
|
class TetaTemplateDirective {
|
|
8617
8621
|
constructor(template) {
|
|
@@ -8638,36 +8642,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
8638
8642
|
* TODO: Lazy загрузка дочерних элементов, Output onExpand, шаблон для иконки expand
|
|
8639
8643
|
*/
|
|
8640
8644
|
class TreeItemComponent {
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
this.
|
|
8646
|
-
this.
|
|
8647
|
-
this.
|
|
8648
|
-
this.
|
|
8649
|
-
this.childNodeName = 'children';
|
|
8645
|
+
constructor() {
|
|
8646
|
+
this.treeService = inject(TreeService);
|
|
8647
|
+
this.item = input();
|
|
8648
|
+
this.depth = input(0);
|
|
8649
|
+
this.padding = input(16);
|
|
8650
|
+
this.childNodeName = input('children');
|
|
8651
|
+
this.template = input();
|
|
8652
|
+
this.childPadding = input();
|
|
8650
8653
|
this.treeItemClass = true;
|
|
8651
|
-
this.itemIsOpen = false;
|
|
8652
|
-
this._alive = true;
|
|
8653
8654
|
this.treeItemInstance = true;
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
this.itemIsOpen = found != null;
|
|
8662
|
-
this._cdr.markForCheck();
|
|
8655
|
+
this.computedDepth = computed(() => {
|
|
8656
|
+
return this.depth() + (this.item()[this.childNodeName()]?.length > 0 ? 0 : this.childPadding() ? 2 : 1);
|
|
8657
|
+
});
|
|
8658
|
+
this.openItems = toSignal(this.treeService.openItems);
|
|
8659
|
+
this.itemIsOpen = computed(() => {
|
|
8660
|
+
const found = this.openItems()?.find((x) => this.treeService.compareItems(x) === this.treeService.compareItems(this.item()));
|
|
8661
|
+
return !!found;
|
|
8663
8662
|
});
|
|
8664
8663
|
}
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
this._alive = false;
|
|
8664
|
+
openItem() {
|
|
8665
|
+
this.treeService.openItem(this.item());
|
|
8668
8666
|
}
|
|
8669
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TreeItemComponent, deps: [
|
|
8670
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
8667
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TreeItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8668
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: TreeItemComponent, isStandalone: true, selector: "teta-tree-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null }, depth: { classPropertyName: "depth", publicName: "depth", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, childNodeName: { classPropertyName: "childNodeName", publicName: "childNodeName", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, childPadding: { classPropertyName: "childPadding", publicName: "childPadding", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.tree__item-container": "this.treeItemClass", "@treeItemInstance": "this.treeItemInstance" } }, ngImport: i0, template: "<div class=\"tree__item_content\" [ngClass]=\"'tree__item_content-' + computedDepth()\" (click)=\"openItem()\">\n <ng-container\n *ngTemplateOutlet=\"\n template();\n context: { $implicit: item(), item: item(), open: itemIsOpen(), service: treeService, depth: depth() }\n \"\n ></ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], animations: [
|
|
8671
8669
|
trigger('treeItemInstance', [
|
|
8672
8670
|
transition('void => *', [style({ opacity: '0' }), animate(200, style({ opacity: '1' }))]),
|
|
8673
8671
|
// transition('* => void', [animate(200, style({opacity: '0'}))]),
|
|
@@ -8681,20 +8679,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
8681
8679
|
transition('void => *', [style({ opacity: '0' }), animate(200, style({ opacity: '1' }))]),
|
|
8682
8680
|
// transition('* => void', [animate(200, style({opacity: '0'}))]),
|
|
8683
8681
|
]),
|
|
8684
|
-
], imports: [NgClass, NgTemplateOutlet], template: "<div class=\"tree__item_content\" [ngClass]=\"'tree__item_content-' + computedDepth\" (click)=\"openItem()\">\n <ng-container\n *ngTemplateOutlet=\"\n template;\n context: { $implicit: item, item: item, open: itemIsOpen, service:
|
|
8685
|
-
}], ctorParameters: () => [
|
|
8686
|
-
type: Input
|
|
8687
|
-
}], depth: [{
|
|
8688
|
-
type: Input
|
|
8689
|
-
}], padding: [{
|
|
8690
|
-
type: Input
|
|
8691
|
-
}], childNodeName: [{
|
|
8692
|
-
type: Input
|
|
8693
|
-
}], template: [{
|
|
8694
|
-
type: Input
|
|
8695
|
-
}], childPadding: [{
|
|
8696
|
-
type: Input
|
|
8697
|
-
}], treeItemClass: [{
|
|
8682
|
+
], imports: [NgClass, NgTemplateOutlet], template: "<div class=\"tree__item_content\" [ngClass]=\"'tree__item_content-' + computedDepth()\" (click)=\"openItem()\">\n <ng-container\n *ngTemplateOutlet=\"\n template();\n context: { $implicit: item(), item: item(), open: itemIsOpen(), service: treeService, depth: depth() }\n \"\n ></ng-container>\n</div>\n" }]
|
|
8683
|
+
}], ctorParameters: () => [], propDecorators: { treeItemClass: [{
|
|
8698
8684
|
type: HostBinding,
|
|
8699
8685
|
args: ['class.tree__item-container']
|
|
8700
8686
|
}], treeItemInstance: [{
|
|
@@ -8703,26 +8689,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
8703
8689
|
}] } });
|
|
8704
8690
|
|
|
8705
8691
|
class TreeComponent {
|
|
8706
|
-
|
|
8707
|
-
this.
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
this.
|
|
8714
|
-
this.
|
|
8715
|
-
|
|
8716
|
-
constructor(_service, _elementRef, _cdr, _zone) {
|
|
8717
|
-
this._service = _service;
|
|
8718
|
-
this._elementRef = _elementRef;
|
|
8719
|
-
this._cdr = _cdr;
|
|
8720
|
-
this._zone = _zone;
|
|
8721
|
-
this.padding = 8;
|
|
8722
|
-
this.childNodeName = 'children';
|
|
8723
|
-
this.height = 28;
|
|
8692
|
+
constructor() {
|
|
8693
|
+
this.treeService = inject(TreeService);
|
|
8694
|
+
this.elementRef = inject(ElementRef);
|
|
8695
|
+
this.ngZone = inject(NgZone);
|
|
8696
|
+
this.data = input([]);
|
|
8697
|
+
this.padding = input(8);
|
|
8698
|
+
this.childNodeName = input('children');
|
|
8699
|
+
this.virtual = input(false);
|
|
8700
|
+
this.height = input(28);
|
|
8701
|
+
this.openItems = model([]);
|
|
8724
8702
|
this.service = new EventEmitter();
|
|
8725
|
-
this.
|
|
8703
|
+
this.childPadding = computed(() => {
|
|
8704
|
+
return this.data()?.some((_) => _[this.childNodeName()]?.length > 0);
|
|
8705
|
+
});
|
|
8706
|
+
this.displayData = computed(() => {
|
|
8707
|
+
return this.getDisplayData(this.data(), 0);
|
|
8708
|
+
});
|
|
8726
8709
|
this._alive = true;
|
|
8727
8710
|
this.treeClass = true;
|
|
8728
8711
|
this.trackRow = (index, item) => {
|
|
@@ -8731,28 +8714,27 @@ class TreeComponent {
|
|
|
8731
8714
|
}
|
|
8732
8715
|
return index;
|
|
8733
8716
|
};
|
|
8734
|
-
|
|
8735
|
-
.
|
|
8717
|
+
effect(() => {
|
|
8718
|
+
this.treeService.setOpenItems(this.openItems());
|
|
8719
|
+
});
|
|
8720
|
+
this.treeService.openItems
|
|
8721
|
+
.pipe(takeWhile((_) => this._alive), filter$1((_) => this.openItems() !== _))
|
|
8736
8722
|
.subscribe((_) => {
|
|
8737
|
-
this.
|
|
8738
|
-
this.displayData = this.getDisplayData(this._data, 0);
|
|
8739
|
-
this.openItemsChange.emit(_);
|
|
8723
|
+
this.openItems.set(_);
|
|
8740
8724
|
this.viewport?.checkViewportSize();
|
|
8741
8725
|
});
|
|
8742
8726
|
}
|
|
8743
8727
|
set compareItems(func) {
|
|
8744
|
-
this.
|
|
8728
|
+
this.treeService.compareItems = func;
|
|
8745
8729
|
}
|
|
8746
8730
|
get compareItems() {
|
|
8747
|
-
return this.
|
|
8731
|
+
return this.treeService.compareItems;
|
|
8748
8732
|
}
|
|
8749
8733
|
ngOnInit() {
|
|
8750
|
-
this.service.emit(this.
|
|
8734
|
+
this.service.emit(this.treeService);
|
|
8751
8735
|
this.addResizeObserver();
|
|
8752
8736
|
}
|
|
8753
|
-
ngOnChanges(
|
|
8754
|
-
this.displayData = this.getDisplayData(this._data, 0);
|
|
8755
|
-
this.childPadding = this.hasChildren(this._data);
|
|
8737
|
+
ngOnChanges() {
|
|
8756
8738
|
this.viewport?.checkViewportSize();
|
|
8757
8739
|
}
|
|
8758
8740
|
ngOnDestroy() {
|
|
@@ -8760,25 +8742,22 @@ class TreeComponent {
|
|
|
8760
8742
|
this.removeResizeObserver();
|
|
8761
8743
|
}
|
|
8762
8744
|
ngAfterViewInit() {
|
|
8763
|
-
this.
|
|
8764
|
-
this.
|
|
8745
|
+
this.treeService.scrollToIndex.pipe(takeWhile(() => this._alive)).subscribe((index) => {
|
|
8746
|
+
this.ngZone.runOutsideAngular(() => {
|
|
8765
8747
|
setTimeout(() => {
|
|
8766
8748
|
this.viewport?.scrollToIndex(index, 'smooth');
|
|
8767
8749
|
});
|
|
8768
8750
|
});
|
|
8769
8751
|
});
|
|
8770
8752
|
}
|
|
8771
|
-
hasChildren(data) {
|
|
8772
|
-
return data?.some((_) => _[this.childNodeName]?.length > 0);
|
|
8773
|
-
}
|
|
8774
8753
|
getDisplayData(data, level) {
|
|
8775
8754
|
const result = [];
|
|
8776
8755
|
data?.forEach((item) => {
|
|
8777
8756
|
item['level'] = level;
|
|
8778
8757
|
result.push(item);
|
|
8779
|
-
if (item[this.childNodeName]?.length > 0 &&
|
|
8780
|
-
this.
|
|
8781
|
-
result.push(...this.getDisplayData(item[this.childNodeName], level + 1));
|
|
8758
|
+
if (item[this.childNodeName()]?.length > 0 &&
|
|
8759
|
+
this.openItems()?.find((openItem) => this.compareItems(openItem) === this.compareItems(item))) {
|
|
8760
|
+
result.push(...this.getDisplayData(item[this.childNodeName()], level + 1));
|
|
8782
8761
|
}
|
|
8783
8762
|
});
|
|
8784
8763
|
return result;
|
|
@@ -8787,14 +8766,14 @@ class TreeComponent {
|
|
|
8787
8766
|
this._obs = new ResizeObserver((_) => {
|
|
8788
8767
|
this.viewport?.checkViewportSize();
|
|
8789
8768
|
});
|
|
8790
|
-
this._obs.observe(this.
|
|
8769
|
+
this._obs.observe(this.elementRef.nativeElement);
|
|
8791
8770
|
}
|
|
8792
8771
|
removeResizeObserver() {
|
|
8793
|
-
this._obs.unobserve(this.
|
|
8772
|
+
this._obs.unobserve(this.elementRef.nativeElement);
|
|
8794
8773
|
this._obs.disconnect();
|
|
8795
8774
|
}
|
|
8796
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TreeComponent, deps: [
|
|
8797
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: TreeComponent, isStandalone: true, selector: "teta-tree", inputs: { data: "data", padding: "padding", childNodeName: "childNodeName", virtual: "virtual", height: "height", openItems: "openItems", compareItems: "compareItems" }, outputs: {
|
|
8775
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8776
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: TreeComponent, isStandalone: true, selector: "teta-tree", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, childNodeName: { classPropertyName: "childNodeName", publicName: "childNodeName", isSignal: true, isRequired: false, transformFunction: null }, virtual: { classPropertyName: "virtual", publicName: "virtual", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, openItems: { classPropertyName: "openItems", publicName: "openItems", isSignal: true, isRequired: false, transformFunction: null }, compareItems: { classPropertyName: "compareItems", publicName: "compareItems", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { openItems: "openItemsChange", service: "service" }, host: { properties: { "class.tree": "this.treeClass" } }, providers: [TreeService], queries: [{ propertyName: "template", first: true, predicate: TetaTemplateDirective, descendants: true, static: true }], viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (virtual()) {\n <teta-scrollable class=\"column column_auto\">\n <cdk-virtual-scroll-viewport tetaScrollable class=\"table-body-container\" [itemSize]=\"height()\">\n <teta-tree-item\n *cdkVirtualFor=\"let item of displayData(); templateCacheSize: 0; trackBy: trackRow\"\n [item]=\"item\"\n [style.height.px]=\"height()\"\n [depth]=\"item['level']\"\n [padding]=\"padding()\"\n [childNodeName]=\"childNodeName()\"\n [childPadding]=\"childPadding()\"\n [template]=\"template?.template\"\n ></teta-tree-item>\n </cdk-virtual-scroll-viewport>\n </teta-scrollable>\n} @else {\n <teta-scrollable class=\"column column_auto\" direction=\"column\">\n @for (item of displayData(); track trackRow($index, item)) {\n <teta-tree-item\n [item]=\"item\"\n [style.height.px]=\"height()\"\n [depth]=\"item['level']\"\n [padding]=\"padding()\"\n [childNodeName]=\"childNodeName()\"\n [childPadding]=\"childPadding()\"\n [template]=\"template?.template\"\n ></teta-tree-item>\n }\n </teta-scrollable>\n}\n", styles: [""], dependencies: [{ kind: "component", type: ScrollableComponent, selector: "teta-scrollable", inputs: ["direction", "showScrollbars", "contentClass"], outputs: ["scroll"] }, { kind: "component", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: ScrollableDirective, selector: "[tetaScrollable]" }, { kind: "directive", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: TreeItemComponent, selector: "teta-tree-item", inputs: ["item", "depth", "padding", "childNodeName", "template", "childPadding"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8798
8777
|
}
|
|
8799
8778
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TreeComponent, decorators: [{
|
|
8800
8779
|
type: Component,
|
|
@@ -8805,22 +8784,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
8805
8784
|
ScrollableDirective,
|
|
8806
8785
|
CdkVirtualForOf,
|
|
8807
8786
|
TreeItemComponent,
|
|
8808
|
-
], template: "@if (virtual) {\n <teta-scrollable class=\"column column_auto\">\n <cdk-virtual-scroll-viewport tetaScrollable class=\"table-body-container\" [itemSize]=\"height\">\n <teta-tree-item\n *cdkVirtualFor=\"let item of displayData; templateCacheSize: 0; trackBy: trackRow\"\n [item]=\"item\"\n [style.height.px]=\"height\"\n [depth]=\"item['level']\"\n [padding]=\"padding\"\n [childNodeName]=\"childNodeName\"\n [childPadding]=\"childPadding\"\n [template]=\"template?.template\"\n ></teta-tree-item>\n </cdk-virtual-scroll-viewport>\n </teta-scrollable>\n} @else {\n <teta-scrollable class=\"column column_auto\" direction=\"column\">\n @for (item of displayData; track trackRow($index, item)) {\n <teta-tree-item\n [item]=\"item\"\n [style.height.px]=\"height\"\n [depth]=\"item['level']\"\n [padding]=\"padding\"\n [childNodeName]=\"childNodeName\"\n [childPadding]=\"childPadding\"\n [template]=\"template?.template\"\n ></teta-tree-item>\n }\n </teta-scrollable>\n}\n" }]
|
|
8809
|
-
}], ctorParameters: () => [
|
|
8810
|
-
type: Input
|
|
8811
|
-
}], padding: [{
|
|
8812
|
-
type: Input
|
|
8813
|
-
}], childNodeName: [{
|
|
8814
|
-
type: Input
|
|
8815
|
-
}], virtual: [{
|
|
8816
|
-
type: Input
|
|
8817
|
-
}], height: [{
|
|
8818
|
-
type: Input
|
|
8819
|
-
}], openItems: [{
|
|
8820
|
-
type: Input
|
|
8821
|
-
}], service: [{
|
|
8822
|
-
type: Output
|
|
8823
|
-
}], openItemsChange: [{
|
|
8787
|
+
], template: "@if (virtual()) {\n <teta-scrollable class=\"column column_auto\">\n <cdk-virtual-scroll-viewport tetaScrollable class=\"table-body-container\" [itemSize]=\"height()\">\n <teta-tree-item\n *cdkVirtualFor=\"let item of displayData(); templateCacheSize: 0; trackBy: trackRow\"\n [item]=\"item\"\n [style.height.px]=\"height()\"\n [depth]=\"item['level']\"\n [padding]=\"padding()\"\n [childNodeName]=\"childNodeName()\"\n [childPadding]=\"childPadding()\"\n [template]=\"template?.template\"\n ></teta-tree-item>\n </cdk-virtual-scroll-viewport>\n </teta-scrollable>\n} @else {\n <teta-scrollable class=\"column column_auto\" direction=\"column\">\n @for (item of displayData(); track trackRow($index, item)) {\n <teta-tree-item\n [item]=\"item\"\n [style.height.px]=\"height()\"\n [depth]=\"item['level']\"\n [padding]=\"padding()\"\n [childNodeName]=\"childNodeName()\"\n [childPadding]=\"childPadding()\"\n [template]=\"template?.template\"\n ></teta-tree-item>\n }\n </teta-scrollable>\n}\n" }]
|
|
8788
|
+
}], ctorParameters: () => [], propDecorators: { service: [{
|
|
8824
8789
|
type: Output
|
|
8825
8790
|
}], viewport: [{
|
|
8826
8791
|
type: ViewChild,
|
|
@@ -8942,7 +8907,7 @@ class VisibilityDropdownTabComponent {
|
|
|
8942
8907
|
this._alive = false;
|
|
8943
8908
|
}
|
|
8944
8909
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: VisibilityDropdownTabComponent, deps: [{ token: TableService }, { token: TetaConfigService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8945
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: VisibilityDropdownTabComponent, isStandalone: true, selector: "teta-visibility-dropdown-tab", inputs: { columns: "columns", column: "column", state: "state", data: "data", close: "close" }, ngImport: i0, template: "@if (locale | async; as loc) {\n <div class=\"list-item padding-left-6 padding-top-2\" [class.padding-left-9]=\"childMode\">\n <teta-checkbox\n [binary]=\"true\"\n [allowNull]=\"true\"\n [ngModel]=\"allColumnsVisible()\"\n (ngModelChange)=\"setAllColumns($event)\"\n >\n {{ loc.all }}\n </teta-checkbox>\n </div>\n <div class=\"list-divider\"></div>\n <teta-scrollable class=\"padding-v-2 column column_auto\">\n <teta-tree\n [data]=\"columns\"\n [openItems]=\"openItems\"\n (openItemsChange)=\"openItems = $event\"\n [childNodeName]=\"'columns'\"\n [compareItems]=\"compareItems\"\n >\n <ng-template tetaTemplate let-item>\n <div class=\"tree__item\" style=\"align-items: unset\">\n @if (item.columns?.length > 0) {\n <teta-tree-item-toggle [item]=\"item\"></teta-tree-item-toggle>\n }\n <teta-checkbox\n style=\"flex-grow: 1\"\n [ngModel]=\"!columnIsHidden(item)\"\n (ngModelChange)=\"setColumnVisibility(item, $event)\"\n (click)=\"$event.stopPropagation()\"\n [binary]=\"true\"\n >\n {{ item.caption }}\n </teta-checkbox>\n </div>\n </ng-template>\n </teta-tree>\n </teta-scrollable>\n <teta-toolbar class=\"justify-content-end\">\n <button\n type=\"button\"\n teta-button\n [disabled]=\"allColumnsVisible() === false\"\n [palette]=\"'primary'\"\n (click)=\"setColumnsVisibility()\"\n >\n {{ loc.apply }}\n </button>\n </teta-toolbar>\n}\n", styles: [":host{display:flex;flex-direction:column;flex-grow:1;min-height:0}\n"], dependencies: [{ kind: "component", type: CheckboxComponent, selector: "teta-checkbox", inputs: ["class", "palette", "noLabel", "disabled", "value", "binary", "labelPosition", "allowNull"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ScrollableComponent, selector: "teta-scrollable", inputs: ["direction", "showScrollbars", "contentClass"], outputs: ["scroll"] }, { kind: "component", type: TreeComponent, selector: "teta-tree", inputs: ["data", "padding", "childNodeName", "virtual", "height", "openItems", "compareItems"], outputs: ["
|
|
8910
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: VisibilityDropdownTabComponent, isStandalone: true, selector: "teta-visibility-dropdown-tab", inputs: { columns: "columns", column: "column", state: "state", data: "data", close: "close" }, ngImport: i0, template: "@if (locale | async; as loc) {\n <div class=\"list-item padding-left-6 padding-top-2\" [class.padding-left-9]=\"childMode\">\n <teta-checkbox\n [binary]=\"true\"\n [allowNull]=\"true\"\n [ngModel]=\"allColumnsVisible()\"\n (ngModelChange)=\"setAllColumns($event)\"\n >\n {{ loc.all }}\n </teta-checkbox>\n </div>\n <div class=\"list-divider\"></div>\n <teta-scrollable class=\"padding-v-2 column column_auto\">\n <teta-tree\n [data]=\"columns\"\n [openItems]=\"openItems\"\n (openItemsChange)=\"openItems = $event\"\n [childNodeName]=\"'columns'\"\n [compareItems]=\"compareItems\"\n >\n <ng-template tetaTemplate let-item>\n <div class=\"tree__item\" style=\"align-items: unset\">\n @if (item.columns?.length > 0) {\n <teta-tree-item-toggle [item]=\"item\"></teta-tree-item-toggle>\n }\n <teta-checkbox\n style=\"flex-grow: 1\"\n [ngModel]=\"!columnIsHidden(item)\"\n (ngModelChange)=\"setColumnVisibility(item, $event)\"\n (click)=\"$event.stopPropagation()\"\n [binary]=\"true\"\n >\n {{ item.caption }}\n </teta-checkbox>\n </div>\n </ng-template>\n </teta-tree>\n </teta-scrollable>\n <teta-toolbar class=\"justify-content-end\">\n <button\n type=\"button\"\n teta-button\n [disabled]=\"allColumnsVisible() === false\"\n [palette]=\"'primary'\"\n (click)=\"setColumnsVisibility()\"\n >\n {{ loc.apply }}\n </button>\n </teta-toolbar>\n}\n", styles: [":host{display:flex;flex-direction:column;flex-grow:1;min-height:0}\n"], dependencies: [{ kind: "component", type: CheckboxComponent, selector: "teta-checkbox", inputs: ["class", "palette", "noLabel", "disabled", "value", "binary", "labelPosition", "allowNull"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ScrollableComponent, selector: "teta-scrollable", inputs: ["direction", "showScrollbars", "contentClass"], outputs: ["scroll"] }, { kind: "component", type: TreeComponent, selector: "teta-tree", inputs: ["data", "padding", "childNodeName", "virtual", "height", "openItems", "compareItems"], outputs: ["openItemsChange", "service"] }, { kind: "directive", type: TetaTemplateDirective, selector: "[tetaTemplate]", inputs: ["tetaTemplate"] }, { kind: "component", type: TreeItemToggleComponent, selector: "teta-tree-item-toggle", inputs: ["item"] }, { kind: "component", type: ToolbarComponent, selector: "teta-toolbar", inputs: ["palette", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[teta-button], teta-button", inputs: ["palette", "class", "view", "square", "viewType", "size"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8946
8911
|
}
|
|
8947
8912
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: VisibilityDropdownTabComponent, decorators: [{
|
|
8948
8913
|
type: Component,
|