|
13 | 13 | (ngbEvent)="onCustomEvent($event)"> |
14 | 14 | <ng-template modelType="ARRAY" let-group let-index="index" let-context="context"> |
15 | 15 | <!--Array with repeatable items--> |
16 | | - <div *ngIf="(!context.notRepeatable) && !isVirtual(context, index)" |
| 16 | + <div *ngIf="(!context.notRepeatable) && !isVirtual(context, index) && group.context.groups.length !== 1 && !isItemReadOnly(context, index)" |
17 | 17 | class="col-xs-2 d-flex flex-column justify-content-sm-start align-items-end"> |
18 | 18 | <button type="button" class="btn btn-secondary" role="button" |
19 | 19 | title="{{'form.remove' | translate}}" |
20 | 20 | attr.aria-label="{{'form.remove' | translate}}" |
21 | | - (click)="removeItem($event, context, index)" |
22 | | - [disabled]="group.context.groups.length === 1 || isItemReadOnly(context, index)"> |
| 21 | + (click)="removeItem($event, context, index)"> |
23 | 22 | <span><i class="fas fa-trash" aria-hidden="true"></i></span> |
24 | 23 | </button> |
25 | 24 | </div> |
26 | | - <div *ngIf="(!context.notRepeatable) && index === (group.context.groups.length - 1)" class="clearfix pl-4 w-100"> |
| 25 | + <div *ngIf="(!context.notRepeatable) && index === (group.context.groups.length - 1) && !isItemReadOnly(context, index)" class="clearfix pl-4 w-100"> |
27 | 26 | <div class="btn-group" role="group"> |
28 | 27 | <button type="button" role="button" class="ds-form-add-more btn btn-link" |
29 | 28 | title="{{'form.add' | translate}}" |
30 | 29 | attr.aria-label="{{'form.add' | translate}}" |
31 | | - [disabled]="isItemReadOnly(context, index)" |
32 | 30 | (click)="insertItem($event, group.context, group.context.groups.length)"> |
33 | 31 | <span><i class="fas fa-plus"></i> {{'form.add' | translate}}</span> |
34 | 32 | </button> |
|
0 commit comments