44 lines
2.1 KiB
HTML
44 lines
2.1 KiB
HTML
<div class="dynamic-form-section row">
|
|
<mat-accordion class="col-12">
|
|
<mat-expansion-panel class="row expansion-panel" expanded=true>
|
|
<mat-expansion-panel-header>
|
|
<mat-panel-title>
|
|
<h6>{{section.numbering}} {{section.title}}</h6>
|
|
</mat-panel-title>
|
|
<mat-panel-description>
|
|
<h3 *ngIf="section.description">{{section.description}}</h3>
|
|
<!-- <h4 *ngIf="section.extendedDescription">{{section.extendedDescription}}</h4> -->
|
|
</mat-panel-description>
|
|
</mat-expansion-panel-header>
|
|
|
|
<div *ngFor="let compositeField of section.compositeFields; let i = index; trackBy: trackByFn" class="col-12">
|
|
<div *ngIf="isElementVisible(compositeField)" class="row">
|
|
<div *ngIf="(compositeField?.multiplicity?.max - 1) > (compositeField?.multiplicityItems?.length)" class="col-12">
|
|
<button mat-button color="primary" (click)="addMultipleField(i)">
|
|
Add one more fieldset +
|
|
</button>
|
|
</div>
|
|
<app-form-composite-field class="col-12" [compositeField]="compositeField"></app-form-composite-field>
|
|
<div *ngIf="compositeField" class="col-12">
|
|
<div class="row">
|
|
<app-form-composite-field class="col-12" *ngFor="let multipleCompositeField of compositeField.multiplicityItems; let j = index; trackBy: trackByFn" [compositeField]="multipleCompositeField"></app-form-composite-field>
|
|
<mat-form-field *ngIf="compositeField.hasCommentField" class="col-12" [formGroup]="form.get('compositeFields').get(''+i)">
|
|
<input matInput formControlName="commentFieldValue" placeholder="comment">
|
|
</mat-form-field>
|
|
<div class="col"></div>
|
|
<button class="col-auto" mat-icon-button type="button" (click)="next(compositeField)">
|
|
<mat-icon>expand_more</mat-icon>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="section?.sections" class="col-12">
|
|
<div *ngFor="let itemsection of section.sections; let j = index;" class="row">
|
|
<app-form-section class="col-12" [section]="itemsection" [path]="path+'.'+(j+1)" [pathName]="pathName+'.sections.'+j"></app-form-section>
|
|
</div>
|
|
</div>
|
|
</mat-expansion-panel>
|
|
</mat-accordion>
|
|
</div>
|