@c10t/nice-component-library 0.0.26 → 0.0.27-a
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/components/tree/cva-flat-tree.component.d.ts +1 -1
- package/components/upload/cva-multi-upload.component.d.ts +2 -1
- package/fesm2022/c10t-nice-component-library.mjs +330 -327
- package/fesm2022/c10t-nice-component-library.mjs.map +1 -1
- package/models/components/flat-tree-node.model.d.ts +1 -0
- package/package.json +1 -1
|
@@ -436,6 +436,7 @@ class FlatTreeNodeModel {
|
|
|
436
436
|
children = [];
|
|
437
437
|
value;
|
|
438
438
|
displayValue = '';
|
|
439
|
+
iconClass = '';
|
|
439
440
|
checked;
|
|
440
441
|
checkedDisplay;
|
|
441
442
|
filterChecked;
|
|
@@ -5391,7 +5392,7 @@ class CvaSmartTableComponent {
|
|
|
5391
5392
|
[patternFilter]="column.patternFilter ? column.patternFilter : ''">
|
|
5392
5393
|
</cva-input>
|
|
5393
5394
|
<cva-input *ngSwitchCase="ColumnTypeEnum.INPUT_CURRENCY"
|
|
5394
|
-
|
|
5395
|
+
#cellComponentRef
|
|
5395
5396
|
[placeholder]="moduleName + '.table.placeholder.input.currency'"
|
|
5396
5397
|
[isFormControl]="false"
|
|
5397
5398
|
[alignText]="getAlign(column)"
|
|
@@ -5668,7 +5669,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
5668
5669
|
[patternFilter]="column.patternFilter ? column.patternFilter : ''">
|
|
5669
5670
|
</cva-input>
|
|
5670
5671
|
<cva-input *ngSwitchCase="ColumnTypeEnum.INPUT_CURRENCY"
|
|
5671
|
-
|
|
5672
|
+
#cellComponentRef
|
|
5672
5673
|
[placeholder]="moduleName + '.table.placeholder.input.currency'"
|
|
5673
5674
|
[isFormControl]="false"
|
|
5674
5675
|
[alignText]="getAlign(column)"
|
|
@@ -6375,6 +6376,7 @@ class CvaMultiUploadComponent {
|
|
|
6375
6376
|
maxSize = null;
|
|
6376
6377
|
accept = null;
|
|
6377
6378
|
label = '';
|
|
6379
|
+
placeholder = '';
|
|
6378
6380
|
required = '';
|
|
6379
6381
|
disabled = false;
|
|
6380
6382
|
/* percent label outside css */
|
|
@@ -6389,12 +6391,10 @@ class CvaMultiUploadComponent {
|
|
|
6389
6391
|
if (!obj) {
|
|
6390
6392
|
return;
|
|
6391
6393
|
}
|
|
6392
|
-
if (this.multiple) {
|
|
6393
|
-
this.files.
|
|
6394
|
-
}
|
|
6395
|
-
else {
|
|
6396
|
-
this.files = [obj];
|
|
6394
|
+
if (!this.multiple && this.files.length === 1) {
|
|
6395
|
+
this.files.length = 0;
|
|
6397
6396
|
}
|
|
6397
|
+
this.files.push(obj);
|
|
6398
6398
|
this.propagateChange(this.files);
|
|
6399
6399
|
}
|
|
6400
6400
|
registerOnChange(fn) {
|
|
@@ -6445,6 +6445,7 @@ class CvaMultiUploadComponent {
|
|
|
6445
6445
|
const target = event.target;
|
|
6446
6446
|
if (target && target.files) {
|
|
6447
6447
|
this.convertToUploadModel(target.files);
|
|
6448
|
+
target.value = '';
|
|
6448
6449
|
}
|
|
6449
6450
|
}
|
|
6450
6451
|
onFileDroppedAction(fileList) {
|
|
@@ -6466,41 +6467,43 @@ class CvaMultiUploadComponent {
|
|
|
6466
6467
|
return true;
|
|
6467
6468
|
}
|
|
6468
6469
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaMultiUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6469
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaMultiUploadComponent, isStandalone: false, selector: "cva-multi-upload", inputs: { files: "files", multiple: "multiple", maxSize: "maxSize", accept: "accept", label: "label", required: "required", disabled: "disabled", percentOfLabelOutside: "percentOfLabelOutside" }, outputs: { onFileChange: "onFileChange" }, providers: [
|
|
6470
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaMultiUploadComponent, isStandalone: false, selector: "cva-multi-upload", inputs: { files: "files", multiple: "multiple", maxSize: "maxSize", accept: "accept", label: "label", placeholder: "placeholder", required: "required", disabled: "disabled", percentOfLabelOutside: "percentOfLabelOutside" }, outputs: { onFileChange: "onFileChange" }, providers: [
|
|
6470
6471
|
{
|
|
6471
6472
|
provide: NG_VALUE_ACCESSOR,
|
|
6472
6473
|
useExisting: forwardRef(() => CvaMultiUploadComponent),
|
|
6473
6474
|
multi: true,
|
|
6474
6475
|
},
|
|
6475
6476
|
], viewQueries: [{ propertyName: "fileUpload", first: true, predicate: ["fileUpload"], descendants: true }], ngImport: i0, template: `
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6477
|
+
<div class="cva-multi-upload"
|
|
6478
|
+
fxLayout="row" fxLayout.lt-sm="row wrap">
|
|
6479
|
+
<mat-label *ngIf="label" class="label_width"
|
|
6480
|
+
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%">
|
|
6481
|
+
<div class="label">{{ (label ? label : '') | translate }}<span
|
|
6482
|
+
class="required-label-outside">{{ !!required ? '*' : '' }}</span></div>
|
|
6483
|
+
</mat-label>
|
|
6484
|
+
<div class="uploadArea"
|
|
6485
|
+
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%"
|
|
6486
|
+
appDragDrop (onFileDropped)="onFileDroppedAction($event)">
|
|
6487
|
+
<input type="file" [multiple]="multiple" #fileUpload (change)="onFileChangeAction($event)"
|
|
6488
|
+
[disabled]="disabled"
|
|
6489
|
+
accept="{{accept ? accept.join() : '*/*'}}">
|
|
6490
|
+
<mat-card>
|
|
6491
|
+
<mat-card-actions>
|
|
6492
|
+
<button mat-button class="upload-button" color="warn" (click)="onClick()">
|
|
6493
|
+
<mat-icon>add</mat-icon>
|
|
6494
|
+
<span>{{ !!placeholder ? placeholder : 'common.upload.file' | translate }}</span>
|
|
6495
|
+
</button>
|
|
6496
|
+
</mat-card-actions>
|
|
6497
|
+
<mat-card-content>
|
|
6498
|
+
</mat-card-content>
|
|
6499
|
+
</mat-card>
|
|
6500
|
+
<mat-error *ngIf="sizeError!==null">{{ sizeError + ' ' + ('common.is.over-size' | translate) }}
|
|
6501
|
+
</mat-error>
|
|
6502
|
+
<mat-error *ngIf="typeError!==null">{{ typeError + ' ' + ('common.is.not-accept' | translate) }}
|
|
6503
|
+
</mat-error>
|
|
6504
|
+
</div>
|
|
6505
|
+
</div>
|
|
6506
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3$3.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8$1.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"] }, { kind: "directive", type: i8$1.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"] }, { kind: "directive", type: DragDropDirective, selector: "[appDragDrop]", outputs: ["onFileDropped"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
|
|
6504
6507
|
}
|
|
6505
6508
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaMultiUploadComponent, decorators: [{
|
|
6506
6509
|
type: Component,
|
|
@@ -6508,34 +6511,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
6508
6511
|
selector: 'cva-multi-upload',
|
|
6509
6512
|
standalone: false,
|
|
6510
6513
|
template: `
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6514
|
+
<div class="cva-multi-upload"
|
|
6515
|
+
fxLayout="row" fxLayout.lt-sm="row wrap">
|
|
6516
|
+
<mat-label *ngIf="label" class="label_width"
|
|
6517
|
+
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%">
|
|
6518
|
+
<div class="label">{{ (label ? label : '') | translate }}<span
|
|
6519
|
+
class="required-label-outside">{{ !!required ? '*' : '' }}</span></div>
|
|
6520
|
+
</mat-label>
|
|
6521
|
+
<div class="uploadArea"
|
|
6522
|
+
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%"
|
|
6523
|
+
appDragDrop (onFileDropped)="onFileDroppedAction($event)">
|
|
6524
|
+
<input type="file" [multiple]="multiple" #fileUpload (change)="onFileChangeAction($event)"
|
|
6525
|
+
[disabled]="disabled"
|
|
6526
|
+
accept="{{accept ? accept.join() : '*/*'}}">
|
|
6527
|
+
<mat-card>
|
|
6528
|
+
<mat-card-actions>
|
|
6529
|
+
<button mat-button class="upload-button" color="warn" (click)="onClick()">
|
|
6530
|
+
<mat-icon>add</mat-icon>
|
|
6531
|
+
<span>{{ !!placeholder ? placeholder : 'common.upload.file' | translate }}</span>
|
|
6532
|
+
</button>
|
|
6533
|
+
</mat-card-actions>
|
|
6534
|
+
<mat-card-content>
|
|
6535
|
+
</mat-card-content>
|
|
6536
|
+
</mat-card>
|
|
6537
|
+
<mat-error *ngIf="sizeError!==null">{{ sizeError + ' ' + ('common.is.over-size' | translate) }}
|
|
6538
|
+
</mat-error>
|
|
6539
|
+
<mat-error *ngIf="typeError!==null">{{ typeError + ' ' + ('common.is.not-accept' | translate) }}
|
|
6540
|
+
</mat-error>
|
|
6541
|
+
</div>
|
|
6542
|
+
</div>
|
|
6543
|
+
`,
|
|
6539
6544
|
providers: [
|
|
6540
6545
|
{
|
|
6541
6546
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -6557,6 +6562,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
6557
6562
|
type: Input
|
|
6558
6563
|
}], label: [{
|
|
6559
6564
|
type: Input
|
|
6565
|
+
}], placeholder: [{
|
|
6566
|
+
type: Input
|
|
6560
6567
|
}], required: [{
|
|
6561
6568
|
type: Input
|
|
6562
6569
|
}], disabled: [{
|
|
@@ -7831,41 +7838,45 @@ class CvaFlatTreeNodeLeftComponent {
|
|
|
7831
7838
|
}
|
|
7832
7839
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaFlatTreeNodeLeftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7833
7840
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaFlatTreeNodeLeftComponent, isStandalone: false, selector: "cva-flat-tree-node-left", inputs: { treeControl: "treeControl", isHideCheckbox: "isHideCheckbox", node: "node", nodeClicked: "nodeClicked" }, outputs: { toggle: "toggle", onParentNodeClick: "onParentNodeClick", onLeafNodeClick: "onLeafNodeClick", ngModelParentChange: "ngModelParentChange", ngModelLeafChange: "ngModelLeafChange" }, ngImport: i0, template: `
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7841
|
+
<ng-container [ngSwitch]="hasChild(node)">
|
|
7842
|
+
<ng-container *ngSwitchCase="false">
|
|
7843
|
+
<div
|
|
7844
|
+
class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}} {{isHideCheckbox && nodeClicked?.value === node.value ? 'nodeSelected': ''}}"
|
|
7845
|
+
(click)="onLeafNodeClick.emit()"
|
|
7846
|
+
fxLayoutAlign="space-between center">
|
|
7847
|
+
<button *ngIf="node.level > 0" type="button" mat-icon-button disabled></button>
|
|
7848
|
+
<i *ngIf="node.iconClass" class="{{ node.iconClass }} icon-left"></i>
|
|
7849
|
+
{{ node.displayValue }}
|
|
7850
|
+
</div>
|
|
7851
|
+
<mat-checkbox [(ngModel)]="node.checked"
|
|
7852
|
+
[checked]="node.checked"
|
|
7853
|
+
(ngModelChange)="ngModelLeafChange.emit($event)"
|
|
7854
|
+
[disabled]="checkDisabledNode(node)"
|
|
7855
|
+
*ngIf="!isHideCheckbox">
|
|
7856
|
+
</mat-checkbox>
|
|
7857
|
+
</ng-container>
|
|
7858
|
+
<ng-container *ngSwitchCase="true">
|
|
7859
|
+
<div
|
|
7860
|
+
class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}} {{isHideCheckbox && nodeClicked?.value === node.value ? 'nodeSelected': ''}}"
|
|
7861
|
+
fxLayoutAlign="space-between center">
|
|
7862
|
+
<button type="button" mat-icon-button (click)="toggle.emit()"
|
|
7863
|
+
[attr.aria-label]="'toggle ' + node.displayValue">
|
|
7864
|
+
<i class="fas {{(treeControl && treeControl.isExpanded(node)) ? 'fa-chevron-up' : 'fa-chevron-down'}}"></i>
|
|
7865
|
+
</button>
|
|
7866
|
+
<span (click)="onParentNodeClick.emit()">
|
|
7867
|
+
<i *ngIf="node.iconClass" class="{{ node.iconClass }} icon-left"></i>
|
|
7868
|
+
{{ node.displayValue }}
|
|
7869
|
+
</span>
|
|
7870
|
+
</div>
|
|
7871
|
+
<mat-checkbox [(ngModel)]="node.checked"
|
|
7872
|
+
*ngIf="!isHideCheckbox"
|
|
7873
|
+
[checked]="descendantsAllSelected(node)"
|
|
7874
|
+
[disabled]="onDisabledParent(node) || getDisabledInputFunc(node)"
|
|
7875
|
+
[indeterminate]="descendantsPartiallySelected(node)"
|
|
7876
|
+
(ngModelChange)="ngModelParentChange.emit($event)">
|
|
7877
|
+
</mat-checkbox>
|
|
7878
|
+
</ng-container>
|
|
7867
7879
|
</ng-container>
|
|
7868
|
-
</ng-container>
|
|
7869
7880
|
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i8$1.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"] }] });
|
|
7870
7881
|
}
|
|
7871
7882
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaFlatTreeNodeLeftComponent, decorators: [{
|
|
@@ -7874,41 +7885,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
7874
7885
|
selector: 'cva-flat-tree-node-left',
|
|
7875
7886
|
standalone: false,
|
|
7876
7887
|
template: `
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7888
|
+
<ng-container [ngSwitch]="hasChild(node)">
|
|
7889
|
+
<ng-container *ngSwitchCase="false">
|
|
7890
|
+
<div
|
|
7891
|
+
class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}} {{isHideCheckbox && nodeClicked?.value === node.value ? 'nodeSelected': ''}}"
|
|
7892
|
+
(click)="onLeafNodeClick.emit()"
|
|
7893
|
+
fxLayoutAlign="space-between center">
|
|
7894
|
+
<button *ngIf="node.level > 0" type="button" mat-icon-button disabled></button>
|
|
7895
|
+
<i *ngIf="node.iconClass" class="{{ node.iconClass }} icon-left"></i>
|
|
7896
|
+
{{ node.displayValue }}
|
|
7897
|
+
</div>
|
|
7898
|
+
<mat-checkbox [(ngModel)]="node.checked"
|
|
7899
|
+
[checked]="node.checked"
|
|
7900
|
+
(ngModelChange)="ngModelLeafChange.emit($event)"
|
|
7901
|
+
[disabled]="checkDisabledNode(node)"
|
|
7902
|
+
*ngIf="!isHideCheckbox">
|
|
7903
|
+
</mat-checkbox>
|
|
7904
|
+
</ng-container>
|
|
7905
|
+
<ng-container *ngSwitchCase="true">
|
|
7906
|
+
<div
|
|
7907
|
+
class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}} {{isHideCheckbox && nodeClicked?.value === node.value ? 'nodeSelected': ''}}"
|
|
7908
|
+
fxLayoutAlign="space-between center">
|
|
7909
|
+
<button type="button" mat-icon-button (click)="toggle.emit()"
|
|
7910
|
+
[attr.aria-label]="'toggle ' + node.displayValue">
|
|
7911
|
+
<i class="fas {{(treeControl && treeControl.isExpanded(node)) ? 'fa-chevron-up' : 'fa-chevron-down'}}"></i>
|
|
7912
|
+
</button>
|
|
7913
|
+
<span (click)="onParentNodeClick.emit()">
|
|
7914
|
+
<i *ngIf="node.iconClass" class="{{ node.iconClass }} icon-left"></i>
|
|
7915
|
+
{{ node.displayValue }}
|
|
7916
|
+
</span>
|
|
7917
|
+
</div>
|
|
7918
|
+
<mat-checkbox [(ngModel)]="node.checked"
|
|
7919
|
+
*ngIf="!isHideCheckbox"
|
|
7920
|
+
[checked]="descendantsAllSelected(node)"
|
|
7921
|
+
[disabled]="onDisabledParent(node) || getDisabledInputFunc(node)"
|
|
7922
|
+
[indeterminate]="descendantsPartiallySelected(node)"
|
|
7923
|
+
(ngModelChange)="ngModelParentChange.emit($event)">
|
|
7924
|
+
</mat-checkbox>
|
|
7925
|
+
</ng-container>
|
|
7910
7926
|
</ng-container>
|
|
7911
|
-
</ng-container>
|
|
7912
7927
|
`,
|
|
7913
7928
|
}]
|
|
7914
7929
|
}], propDecorators: { treeControl: [{
|
|
@@ -8591,40 +8606,22 @@ class CvaFlatTreeComponent {
|
|
|
8591
8606
|
}
|
|
8592
8607
|
toggleNodeCheck(node, checked) {
|
|
8593
8608
|
const isLeaf = !FlatTreeService.hasChild(node);
|
|
8594
|
-
//
|
|
8595
|
-
const
|
|
8596
|
-
|
|
8597
|
-
|
|
8609
|
+
// Lấy danh sách node đang hiển thị (filtered)
|
|
8610
|
+
const visibleNodes = isLeaf
|
|
8611
|
+
? [node]
|
|
8612
|
+
: [...this.getAllChildNode(this.treeControl, node).filter(n => n.display), node];
|
|
8613
|
+
for (const leaf of visibleNodes) {
|
|
8598
8614
|
if (!leaf.display || this.checkDisabledNode(leaf))
|
|
8599
8615
|
continue;
|
|
8600
8616
|
const index = this.value.indexOf(leaf.value);
|
|
8601
8617
|
if (checked && index < 0) {
|
|
8602
8618
|
this.value.push(leaf.value);
|
|
8603
|
-
this.valueObjRef.set(leaf.value, leaf);
|
|
8604
|
-
leaf.checked = true;
|
|
8605
8619
|
}
|
|
8606
8620
|
if (!checked && index >= 0) {
|
|
8607
8621
|
this.value.splice(index, 1);
|
|
8608
|
-
this.valueObjRef.delete(leaf.value);
|
|
8609
|
-
leaf.checked = false;
|
|
8610
|
-
}
|
|
8611
|
-
const orgNodeIndex = this.mapIndexes.get(leaf.value);
|
|
8612
|
-
if (orgNodeIndex !== undefined) {
|
|
8613
|
-
this.fullDataTreeControl.dataNodes[orgNodeIndex].checked = leaf.checked;
|
|
8614
8622
|
}
|
|
8615
8623
|
}
|
|
8616
|
-
//
|
|
8617
|
-
if (!isLeaf) {
|
|
8618
|
-
node.checked = checked;
|
|
8619
|
-
const orgNodeIndex = this.mapIndexes.get(node.value);
|
|
8620
|
-
if (orgNodeIndex !== undefined) {
|
|
8621
|
-
this.fullDataTreeControl.dataNodes[orgNodeIndex].checked = checked;
|
|
8622
|
-
this.fullDataTreeControl.dataNodes[orgNodeIndex].isExpanded = false;
|
|
8623
|
-
}
|
|
8624
|
-
}
|
|
8625
|
-
else {
|
|
8626
|
-
node.checked = checked;
|
|
8627
|
-
}
|
|
8624
|
+
// Gọi writeValue để cập nhật cho FormControl
|
|
8628
8625
|
this.writeValue(this.value);
|
|
8629
8626
|
this.cdr.detectChanges();
|
|
8630
8627
|
}
|
|
@@ -8632,95 +8629,97 @@ class CvaFlatTreeComponent {
|
|
|
8632
8629
|
_isExpandable = (node) => FlatTreeService.hasChild(node);
|
|
8633
8630
|
_getChildren = (node) => of(node.children ? node.children : []);
|
|
8634
8631
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaFlatTreeComponent, deps: [{ token: i1.TranslateService }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }, { token: i1$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
8635
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaFlatTreeComponent, isStandalone: false, selector: "cva-flat-tree", inputs: { label: "label", required: "required", value: "value", multiple: "multiple", disabled: "disabled", isView: "isView", isDisplayChooseTreeOnly: "isDisplayChooseTreeOnly", isHideCheckbox: "isHideCheckbox", isCollapseSelected: "isCollapseSelected", selectedLabelTitle: "selectedLabelTitle", viewHeight: "viewHeight", itemSize: "itemSize", percentOfLabelOutside: "percentOfLabelOutside", treeConfig: "treeConfig", isSearchOutSide: "isSearchOutSide", searchTextOutSide: "searchTextOutSide", errorMessages: "errorMessages", fullDatasource: "fullDatasource", isFormControl: "isFormControl" }, outputs: { selectionChange: "selectionChange", onNodeClick: "onNodeClick" }, viewQueries: [{ propertyName: "chooseVirtualScroll", first: true, predicate: ["chooseAreaScrollViewport"], descendants: true }, { propertyName: "selectedVirtualScroll", first: true, predicate: ["selectedScrollViewport"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8632
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaFlatTreeComponent, isStandalone: false, selector: "cva-flat-tree", inputs: { label: "label", required: "required", value: "value", multiple: "multiple", disabled: "disabled", isView: "isView", isDisplayChooseTreeOnly: "isDisplayChooseTreeOnly", isHideCheckbox: "isHideCheckbox", isCollapseSelected: "isCollapseSelected", selectedLabelTitle: "selectedLabelTitle", viewHeight: "viewHeight", itemSize: "itemSize", percentOfLabelOutside: "percentOfLabelOutside", treeConfig: "treeConfig", isSearchOutSide: "isSearchOutSide", searchTextOutSide: "searchTextOutSide", errorMessages: "errorMessages", fullDatasource: "fullDatasource", nodeClicked: "nodeClicked", isFormControl: "isFormControl" }, outputs: { selectionChange: "selectionChange", onNodeClick: "onNodeClick" }, viewQueries: [{ propertyName: "chooseVirtualScroll", first: true, predicate: ["chooseAreaScrollViewport"], descendants: true }, { propertyName: "selectedVirtualScroll", first: true, predicate: ["selectedScrollViewport"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
8633
|
+
<div class="cva-flat-tree labelOutside"
|
|
8634
|
+
fxLayout="row" fxLayout.lt-sm="row wrap">
|
|
8635
|
+
<mat-label *ngIf="label && !isSearchOutSide" class="label_width"
|
|
8636
|
+
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%">
|
|
8637
|
+
<div class="label">
|
|
8638
|
+
<div>
|
|
8639
|
+
{{ (label ? label : '') | translate }}<span
|
|
8640
|
+
class="required-label-outside">{{ required ? '*' : '' }}</span>
|
|
8641
|
+
</div>
|
|
8642
|
+
</div>
|
|
8643
|
+
</mat-label>
|
|
8644
|
+
<div class="tree-area"
|
|
8639
8645
|
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%">
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8646
|
+
<div fxLayout="row wrap">
|
|
8647
|
+
<div class="choose-area"
|
|
8648
|
+
*ngIf="!checkIsView(isView) && !isCollapseSelected"
|
|
8649
|
+
fxLayout="column" fxFlex="1 1 {{isDisplayChooseTreeOnly ? '100%' : '50%'}}"
|
|
8650
|
+
fxFlex.lt-sm="100%">
|
|
8651
|
+
<div class="header-choose-area">
|
|
8652
|
+
<div class="title-choose-tree" fxLayout="row" fxLayout.lt-sm="row wrap">
|
|
8653
|
+
<mat-label fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%" class="label_width"
|
|
8654
|
+
*ngIf="label && isSearchOutSide">
|
|
8655
|
+
<div class="label">{{ (label ? label : '') | translate }}<span
|
|
8656
|
+
class="required-label-outside">{{ required ? '*' : '' }}</span></div>
|
|
8657
|
+
</mat-label>
|
|
8658
|
+
<mat-divider *ngIf="label && isSearchOutSide"></mat-divider>
|
|
8659
|
+
</div>
|
|
8660
|
+
<mat-form-field appearance="outline"
|
|
8661
|
+
*ngIf="!isSearchOutSide"
|
|
8662
|
+
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%">
|
|
8663
|
+
<input matInput
|
|
8664
|
+
placeholder="{{'common.searchText'|translate}}"
|
|
8665
|
+
[(ngModel)]="searchText"
|
|
8666
|
+
(ngModelChange)="onChangeSearchText()"
|
|
8667
|
+
autocomplete="off">
|
|
8668
|
+
</mat-form-field>
|
|
8669
|
+
</div>
|
|
8670
|
+
<cdk-virtual-scroll-viewport #chooseAreaScrollViewport itemSize="{{itemSize}}"
|
|
8671
|
+
[ngStyle]="{height: viewHeight + 'px'}">
|
|
8672
|
+
<ng-container *cdkVirtualFor="let node of dataSource">
|
|
8673
|
+
<cva-flat-tree-node-left
|
|
8674
|
+
[ngStyle]="{height: itemSize + 'px', padding: '0px 0px 0px '+ (node.level * paddingLeft) +'px'}"
|
|
8675
|
+
[attr.aria-level]="node.level"
|
|
8676
|
+
[treeControl]="treeControl"
|
|
8677
|
+
[isHideCheckbox]="isHideCheckbox"
|
|
8678
|
+
[nodeClicked]="nodeClicked"
|
|
8679
|
+
[node]="node"
|
|
8680
|
+
(toggle)="toggleTreeControl(treeControl, node)"
|
|
8681
|
+
(onParentNodeClick)="onParentNodeClick(node)"
|
|
8682
|
+
(onLeafNodeClick)="onLeafNodeClick(node)"
|
|
8683
|
+
(ngModelParentChange)="toggleNodeCheck(node, $event)"
|
|
8684
|
+
(ngModelLeafChange)="toggleNodeCheck(node, $event)">
|
|
8685
|
+
</cva-flat-tree-node-left>
|
|
8686
|
+
</ng-container>
|
|
8687
|
+
</cdk-virtual-scroll-viewport>
|
|
8688
|
+
</div>
|
|
8689
|
+
<div class="selected-area {{isCollapseSelected ? 'hiddenTree' : ''}}"
|
|
8690
|
+
*ngIf="!isDisplayChooseTreeOnly"
|
|
8691
|
+
fxLayout="column" fxFlex="1 1 {{checkIsView(isView) ? '100%' : '50%'}}" fxFlex.lt-sm="100%">
|
|
8692
|
+
<div class="header-area" *ngIf="!isView">
|
|
8693
|
+
<label>{{ selectedLabelTitle | translate }}{{ '(' + (value ? value.length : 0) + ')' }}</label>
|
|
8694
|
+
<div class="collapse-expand-all" (click)="toggleSelectedTree()">
|
|
8695
|
+
{{ (isCollapseSelected ? 'common.selected.tree.expandAll' : 'common.selected.tree.collapse') | translate }}
|
|
8696
|
+
<i class="fa {{isCollapseSelected ? 'fa-chevron-down' : 'fa-chevron-up'}}"></i>
|
|
8697
|
+
</div>
|
|
8698
|
+
</div>
|
|
8699
|
+
<cdk-virtual-scroll-viewport #selectedScrollViewport
|
|
8700
|
+
*ngIf="!isCollapseSelected"
|
|
8701
|
+
itemSize="{{itemSize}}" [ngStyle]="{height: viewHeight + 'px'}">
|
|
8702
|
+
<ng-container *cdkVirtualFor="let node of selectedDataSource">
|
|
8703
|
+
<cva-flat-tree-node-right
|
|
8704
|
+
[ngStyle]="{height: itemSize + 'px', padding: '0px 0px 0px '+ (node.level * paddingLeft) +'px'}"
|
|
8705
|
+
[attr.aria-level]="node.level"
|
|
8706
|
+
[treeControl]="selectedTreeControl"
|
|
8707
|
+
[node]="node"
|
|
8708
|
+
[isView]="isView"
|
|
8709
|
+
(toggle)="toggleSelectedTree(node)"
|
|
8710
|
+
(deSelectLeafNode)="deSelect(node)"
|
|
8711
|
+
(deSelectParentNode)="deSelectParent(node)">
|
|
8712
|
+
</cva-flat-tree-node-right>
|
|
8713
|
+
</ng-container>
|
|
8714
|
+
</cdk-virtual-scroll-viewport>
|
|
8715
|
+
</div>
|
|
8716
|
+
</div>
|
|
8717
|
+
<mat-hint *ngIf="NsValiator.invalid(formControl)">
|
|
8718
|
+
{{ NsValiator.getErrorMessage(formControl, errorMessages) | translate }}
|
|
8719
|
+
</mat-hint>
|
|
8699
8720
|
</div>
|
|
8700
|
-
<cdk-virtual-scroll-viewport #selectedScrollViewport
|
|
8701
|
-
*ngIf="!isCollapseSelected"
|
|
8702
|
-
itemSize="{{itemSize}}" [ngStyle]="{height: viewHeight + 'px'}">
|
|
8703
|
-
<ng-container *cdkVirtualFor="let node of selectedDataSource">
|
|
8704
|
-
<cva-flat-tree-node-right
|
|
8705
|
-
[ngStyle]="{height: itemSize + 'px', padding: '0px 0px 0px '+ (node.level * paddingLeft) +'px'}"
|
|
8706
|
-
[attr.aria-level]="node.level"
|
|
8707
|
-
[treeControl]="selectedTreeControl"
|
|
8708
|
-
[node]="node"
|
|
8709
|
-
[isView]="isView"
|
|
8710
|
-
(toggle)="toggleSelectedTree(node)"
|
|
8711
|
-
(deSelectLeafNode)="deSelect(node)"
|
|
8712
|
-
(deSelectParentNode)="deSelectParent(node)">
|
|
8713
|
-
</cva-flat-tree-node-right>
|
|
8714
|
-
</ng-container>
|
|
8715
|
-
</cdk-virtual-scroll-viewport>
|
|
8716
|
-
</div>
|
|
8717
8721
|
</div>
|
|
8718
|
-
|
|
8719
|
-
{{ NsValiator.getErrorMessage(formControl, errorMessages) | translate }}
|
|
8720
|
-
</mat-hint>
|
|
8721
|
-
</div>
|
|
8722
|
-
</div>
|
|
8723
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i6$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i10.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i10.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i10.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i8$1.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"] }, { kind: "directive", type: i8$1.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"] }, { kind: "directive", type: i9.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { kind: "component", type: CvaFlatTreeNodeLeftComponent, selector: "cva-flat-tree-node-left", inputs: ["treeControl", "isHideCheckbox", "node", "nodeClicked"], outputs: ["toggle", "onParentNodeClick", "onLeafNodeClick", "ngModelParentChange", "ngModelLeafChange"] }, { kind: "component", type: CvaFlatTreeNodeRightComponent, selector: "cva-flat-tree-node-right", inputs: ["treeControl", "node", "isView"], outputs: ["toggle", "deSelectLeafNode", "deSelectParentNode"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
|
|
8722
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i6$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i10.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i10.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i10.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i8$1.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"] }, { kind: "directive", type: i8$1.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"] }, { kind: "directive", type: i9.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { kind: "component", type: CvaFlatTreeNodeLeftComponent, selector: "cva-flat-tree-node-left", inputs: ["treeControl", "isHideCheckbox", "node", "nodeClicked"], outputs: ["toggle", "onParentNodeClick", "onLeafNodeClick", "ngModelParentChange", "ngModelLeafChange"] }, { kind: "component", type: CvaFlatTreeNodeRightComponent, selector: "cva-flat-tree-node-right", inputs: ["treeControl", "node", "isView"], outputs: ["toggle", "deSelectLeafNode", "deSelectParentNode"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
|
|
8724
8723
|
}
|
|
8725
8724
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaFlatTreeComponent, decorators: [{
|
|
8726
8725
|
type: Component,
|
|
@@ -8728,94 +8727,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
8728
8727
|
selector: 'cva-flat-tree',
|
|
8729
8728
|
standalone: false,
|
|
8730
8729
|
template: `
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8730
|
+
<div class="cva-flat-tree labelOutside"
|
|
8731
|
+
fxLayout="row" fxLayout.lt-sm="row wrap">
|
|
8732
|
+
<mat-label *ngIf="label && !isSearchOutSide" class="label_width"
|
|
8733
|
+
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%">
|
|
8734
|
+
<div class="label">
|
|
8735
|
+
<div>
|
|
8736
|
+
{{ (label ? label : '') | translate }}<span
|
|
8737
|
+
class="required-label-outside">{{ required ? '*' : '' }}</span>
|
|
8738
|
+
</div>
|
|
8739
|
+
</div>
|
|
8740
|
+
</mat-label>
|
|
8741
|
+
<div class="tree-area"
|
|
8734
8742
|
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%">
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8743
|
+
<div fxLayout="row wrap">
|
|
8744
|
+
<div class="choose-area"
|
|
8745
|
+
*ngIf="!checkIsView(isView) && !isCollapseSelected"
|
|
8746
|
+
fxLayout="column" fxFlex="1 1 {{isDisplayChooseTreeOnly ? '100%' : '50%'}}"
|
|
8747
|
+
fxFlex.lt-sm="100%">
|
|
8748
|
+
<div class="header-choose-area">
|
|
8749
|
+
<div class="title-choose-tree" fxLayout="row" fxLayout.lt-sm="row wrap">
|
|
8750
|
+
<mat-label fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%" class="label_width"
|
|
8751
|
+
*ngIf="label && isSearchOutSide">
|
|
8752
|
+
<div class="label">{{ (label ? label : '') | translate }}<span
|
|
8753
|
+
class="required-label-outside">{{ required ? '*' : '' }}</span></div>
|
|
8754
|
+
</mat-label>
|
|
8755
|
+
<mat-divider *ngIf="label && isSearchOutSide"></mat-divider>
|
|
8756
|
+
</div>
|
|
8757
|
+
<mat-form-field appearance="outline"
|
|
8758
|
+
*ngIf="!isSearchOutSide"
|
|
8759
|
+
fxLayout="column" fxFlex="auto" fxFlex.lt-md="100%">
|
|
8760
|
+
<input matInput
|
|
8761
|
+
placeholder="{{'common.searchText'|translate}}"
|
|
8762
|
+
[(ngModel)]="searchText"
|
|
8763
|
+
(ngModelChange)="onChangeSearchText()"
|
|
8764
|
+
autocomplete="off">
|
|
8765
|
+
</mat-form-field>
|
|
8766
|
+
</div>
|
|
8767
|
+
<cdk-virtual-scroll-viewport #chooseAreaScrollViewport itemSize="{{itemSize}}"
|
|
8768
|
+
[ngStyle]="{height: viewHeight + 'px'}">
|
|
8769
|
+
<ng-container *cdkVirtualFor="let node of dataSource">
|
|
8770
|
+
<cva-flat-tree-node-left
|
|
8771
|
+
[ngStyle]="{height: itemSize + 'px', padding: '0px 0px 0px '+ (node.level * paddingLeft) +'px'}"
|
|
8772
|
+
[attr.aria-level]="node.level"
|
|
8773
|
+
[treeControl]="treeControl"
|
|
8774
|
+
[isHideCheckbox]="isHideCheckbox"
|
|
8775
|
+
[nodeClicked]="nodeClicked"
|
|
8776
|
+
[node]="node"
|
|
8777
|
+
(toggle)="toggleTreeControl(treeControl, node)"
|
|
8778
|
+
(onParentNodeClick)="onParentNodeClick(node)"
|
|
8779
|
+
(onLeafNodeClick)="onLeafNodeClick(node)"
|
|
8780
|
+
(ngModelParentChange)="toggleNodeCheck(node, $event)"
|
|
8781
|
+
(ngModelLeafChange)="toggleNodeCheck(node, $event)">
|
|
8782
|
+
</cva-flat-tree-node-left>
|
|
8783
|
+
</ng-container>
|
|
8784
|
+
</cdk-virtual-scroll-viewport>
|
|
8785
|
+
</div>
|
|
8786
|
+
<div class="selected-area {{isCollapseSelected ? 'hiddenTree' : ''}}"
|
|
8787
|
+
*ngIf="!isDisplayChooseTreeOnly"
|
|
8788
|
+
fxLayout="column" fxFlex="1 1 {{checkIsView(isView) ? '100%' : '50%'}}" fxFlex.lt-sm="100%">
|
|
8789
|
+
<div class="header-area" *ngIf="!isView">
|
|
8790
|
+
<label>{{ selectedLabelTitle | translate }}{{ '(' + (value ? value.length : 0) + ')' }}</label>
|
|
8791
|
+
<div class="collapse-expand-all" (click)="toggleSelectedTree()">
|
|
8792
|
+
{{ (isCollapseSelected ? 'common.selected.tree.expandAll' : 'common.selected.tree.collapse') | translate }}
|
|
8793
|
+
<i class="fa {{isCollapseSelected ? 'fa-chevron-down' : 'fa-chevron-up'}}"></i>
|
|
8794
|
+
</div>
|
|
8795
|
+
</div>
|
|
8796
|
+
<cdk-virtual-scroll-viewport #selectedScrollViewport
|
|
8797
|
+
*ngIf="!isCollapseSelected"
|
|
8798
|
+
itemSize="{{itemSize}}" [ngStyle]="{height: viewHeight + 'px'}">
|
|
8799
|
+
<ng-container *cdkVirtualFor="let node of selectedDataSource">
|
|
8800
|
+
<cva-flat-tree-node-right
|
|
8801
|
+
[ngStyle]="{height: itemSize + 'px', padding: '0px 0px 0px '+ (node.level * paddingLeft) +'px'}"
|
|
8802
|
+
[attr.aria-level]="node.level"
|
|
8803
|
+
[treeControl]="selectedTreeControl"
|
|
8804
|
+
[node]="node"
|
|
8805
|
+
[isView]="isView"
|
|
8806
|
+
(toggle)="toggleSelectedTree(node)"
|
|
8807
|
+
(deSelectLeafNode)="deSelect(node)"
|
|
8808
|
+
(deSelectParentNode)="deSelectParent(node)">
|
|
8809
|
+
</cva-flat-tree-node-right>
|
|
8810
|
+
</ng-container>
|
|
8811
|
+
</cdk-virtual-scroll-viewport>
|
|
8812
|
+
</div>
|
|
8813
|
+
</div>
|
|
8814
|
+
<mat-hint *ngIf="NsValiator.invalid(formControl)">
|
|
8815
|
+
{{ NsValiator.getErrorMessage(formControl, errorMessages) | translate }}
|
|
8816
|
+
</mat-hint>
|
|
8794
8817
|
</div>
|
|
8795
|
-
<cdk-virtual-scroll-viewport #selectedScrollViewport
|
|
8796
|
-
*ngIf="!isCollapseSelected"
|
|
8797
|
-
itemSize="{{itemSize}}" [ngStyle]="{height: viewHeight + 'px'}">
|
|
8798
|
-
<ng-container *cdkVirtualFor="let node of selectedDataSource">
|
|
8799
|
-
<cva-flat-tree-node-right
|
|
8800
|
-
[ngStyle]="{height: itemSize + 'px', padding: '0px 0px 0px '+ (node.level * paddingLeft) +'px'}"
|
|
8801
|
-
[attr.aria-level]="node.level"
|
|
8802
|
-
[treeControl]="selectedTreeControl"
|
|
8803
|
-
[node]="node"
|
|
8804
|
-
[isView]="isView"
|
|
8805
|
-
(toggle)="toggleSelectedTree(node)"
|
|
8806
|
-
(deSelectLeafNode)="deSelect(node)"
|
|
8807
|
-
(deSelectParentNode)="deSelectParent(node)">
|
|
8808
|
-
</cva-flat-tree-node-right>
|
|
8809
|
-
</ng-container>
|
|
8810
|
-
</cdk-virtual-scroll-viewport>
|
|
8811
|
-
</div>
|
|
8812
8818
|
</div>
|
|
8813
|
-
|
|
8814
|
-
{{ NsValiator.getErrorMessage(formControl, errorMessages) | translate }}
|
|
8815
|
-
</mat-hint>
|
|
8816
|
-
</div>
|
|
8817
|
-
</div>
|
|
8818
|
-
`,
|
|
8819
|
+
`,
|
|
8819
8820
|
}]
|
|
8820
8821
|
}], ctorParameters: () => [{ type: i1.TranslateService }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: i1$2.NgControl, decorators: [{
|
|
8821
8822
|
type: Self
|
|
@@ -8861,6 +8862,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
8861
8862
|
type: Output
|
|
8862
8863
|
}], onNodeClick: [{
|
|
8863
8864
|
type: Output
|
|
8865
|
+
}], nodeClicked: [{
|
|
8866
|
+
type: Input
|
|
8864
8867
|
}], isFormControl: [{
|
|
8865
8868
|
type: Input
|
|
8866
8869
|
}], chooseVirtualScroll: [{
|