|
@@ -15,75 +15,73 @@
|
|
|
</ng-container>
|
|
|
|
|
|
<ng-template #recursiveDynaform>
|
|
|
-
|
|
|
- <div *ngIf="isRepeatingField(meta)" class="dyna-rf-container">
|
|
|
- <div *ngFor="let field of meta.meta; let i = index" class="dyna-rc-container">
|
|
|
- <button *ngIf="meta.showDeleteControl"
|
|
|
- class="btn btn-sm btn-icon btn-outline-danger dyna-rc-btn-delete"
|
|
|
- [disabled]="!deleteAllowed(meta.name)"
|
|
|
- (click)="deleteRepeatingMember(meta.name, i)">
|
|
|
- <clr-icon shape="trash"></clr-icon>
|
|
|
- </button>
|
|
|
- <ng-container *ngTemplateOutlet="dynafield; context: getRepeatingTemplateContext(meta.name, i)"></ng-container>
|
|
|
- </div>
|
|
|
- <div *ngIf="meta.showAddControl" class="clr-row">
|
|
|
- <div class="clr-col-sm-12">
|
|
|
+ <ng-container [ngSwitch]="meta.type">
|
|
|
+
|
|
|
+ <div *ngSwitchCase="'RepeatingField'" class="dyna-rf-container">
|
|
|
+ <div *ngFor="let field of meta.meta; let i = index" class="dyna-rf-field">
|
|
|
+ <button *ngIf="meta.showDeleteControl"
|
|
|
+ class="btn btn-sm btn-icon btn-outline-danger dyna-rep-btn-delete"
|
|
|
+ [disabled]="!deleteAllowed(meta.name)"
|
|
|
+ (click)="deleteRepeatingMember(meta.name, i)">
|
|
|
+ <clr-icon shape="trash"></clr-icon>
|
|
|
+ </button>
|
|
|
+ <ng-container *ngTemplateOutlet="dynafield; context: getRepeatingTemplateContext(meta.name, i)"></ng-container>
|
|
|
+ </div>
|
|
|
+ <div *ngIf="meta.showAddControl">
|
|
|
<button
|
|
|
- class="btn btn-sm btn-success dyna-rc-btn-add"
|
|
|
+ class="btn btn-sm btn-icon btn-outline-success dyna-rep-btn-add"
|
|
|
[disabled]="!addAllowed(meta.name)"
|
|
|
(click)="addRepeatingFieldMember(meta.name)">
|
|
|
- <clr-icon shape="plus-circle" class="is-solid"></clr-icon> Add Another
|
|
|
+ <clr-icon shape="plus"></clr-icon>
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <ng-container *ngIf="isRepeatingContainer(meta); else container">
|
|
|
- <div *ngIf="meta.display === 'SINGLE'" class="clr-row dyna-rc-selector">
|
|
|
- <div class="clr-col-sm-2 text-right dyna-rc-focus-block">
|
|
|
- <b>FOCUS ></b>
|
|
|
+
|
|
|
+ <ng-container *ngSwitchCase="'RepeatingContainer'">
|
|
|
+ <div *ngIf="meta.display === 'SINGLE'" class="clr-row dyna-rc-selector">
|
|
|
+ <div class="clr-col-sm-2 text-right dyna-rc-focus-block">
|
|
|
+ <b>FOCUS ></b>
|
|
|
+ </div>
|
|
|
+ <div class="clr-col-sm-10">
|
|
|
+ <button *ngFor="let container of meta.meta; let i = index"
|
|
|
+ class="btn btn-sm dyna-rc-btn-focus"
|
|
|
+ [ngClass]="container.focussed ? 'btn-primary' : ''"
|
|
|
+ (click)="focusContainer(meta.name, i)">
|
|
|
+ {{ getRepeatingContainerLabel(meta.name, i) }}
|
|
|
+ </button>
|
|
|
+ <button *ngIf="meta.showAddControl"
|
|
|
+ class="btn btn-sm btn-icon btn-outline-success dyna-rep-btn-add"
|
|
|
+ [disabled]="!addAllowed(meta.name)"
|
|
|
+ (click)="addRepeatingContainerMember(meta.name)">
|
|
|
+ <clr-icon shape="plus"></clr-icon>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="clr-col-sm-10">
|
|
|
- <button *ngFor="let container of meta.meta; let i = index"
|
|
|
- class="btn btn-sm dyna-rc-btn-focus"
|
|
|
- [ngClass]="container.focussed ? 'btn-primary' : ''"
|
|
|
- (click)="focusContainer(meta.name, i)">
|
|
|
- {{ getRepeatingContainerLabel(meta.name, i) }}
|
|
|
- </button>
|
|
|
- <button *ngIf="meta.showAddControl"
|
|
|
- class="btn btn-sm btn-success dyna-rc-btn-add"
|
|
|
- [disabled]="!addAllowed(meta.name)"
|
|
|
- (click)="addRepeatingContainerMember(meta.name)">
|
|
|
- <clr-icon shape="plus-circle" class="is-solid"></clr-icon> Add New
|
|
|
+ <div *ngFor="let container of meta.meta; let i = index" class="dyna-rc-container" [ngClass]="{ 'dyna-rc-display-all': meta.display === 'ALL' }">
|
|
|
+ <button *ngIf="meta.showDeleteControl"
|
|
|
+ class="btn btn-sm btn-icon btn-outline-danger dyna-rep-btn-delete"
|
|
|
+ [ngClass]="{ 'dyna-hidden': !meta.meta[i].focussed }"
|
|
|
+ [disabled]="!deleteAllowed(meta.name)"
|
|
|
+ (click)="deleteRepeatingMember(meta.name, i)">
|
|
|
+ <clr-icon shape="trash"></clr-icon>
|
|
|
</button>
|
|
|
+ <ng-container *ngTemplateOutlet="dynaform; context: getRepeatingTemplateContext(meta.name, i)"></ng-container>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div *ngFor="let container of meta.meta; let i = index" class="dyna-rc-container" [ngClass]="{ 'dyna-rc-display-all': meta.display === 'ALL' }">
|
|
|
- <button *ngIf="meta.showDeleteControl"
|
|
|
- class="btn btn-sm btn-icon btn-outline-danger dyna-rc-btn-delete"
|
|
|
- [ngClass]="{ 'dyna-hidden': !meta.meta[i].focussed }"
|
|
|
- [disabled]="!deleteAllowed(meta.name)"
|
|
|
- (click)="deleteRepeatingMember(meta.name, i)">
|
|
|
- <clr-icon shape="trash"></clr-icon>
|
|
|
- </button>
|
|
|
- <ng-container *ngTemplateOutlet="dynaform; context: getRepeatingTemplateContext(meta.name, i)"></ng-container>
|
|
|
- </div>
|
|
|
- <div *ngIf="meta.showAddControl && meta.display === 'ALL'" class="clr-row">
|
|
|
- <div class="clr-col-sm-12">
|
|
|
+ <div *ngIf="meta.showAddControl && meta.display === 'ALL'">
|
|
|
<button
|
|
|
- class="btn btn-sm btn-success dyna-rc-btn-add"
|
|
|
+ class="btn btn-sm btn-icon btn-outline-success dyna-rep-btn-add"
|
|
|
[disabled]="!addAllowed(meta.name)"
|
|
|
(click)="addRepeatingContainerMember(meta.name)">
|
|
|
- <clr-icon shape="plus-circle" class="is-solid"></clr-icon> Add Another
|
|
|
+ <clr-icon shape="plus"></clr-icon>
|
|
|
</button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </ng-container>
|
|
|
+ </ng-container>
|
|
|
|
|
|
- </ng-template>
|
|
|
+ <ng-container *ngSwitchCase="'Container'">
|
|
|
+ <ng-container *ngTemplateOutlet="dynaform; context: { control: control, meta: meta }"></ng-container>
|
|
|
+ </ng-container>
|
|
|
|
|
|
- <ng-template #container>
|
|
|
- <ng-container *ngTemplateOutlet="dynaform; context: { control: control, meta: meta }"></ng-container>
|
|
|
+ </ng-container>
|
|
|
</ng-template>
|
|
|
|
|
|
<ng-template #fullWidth>
|