mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.6 KiB
61 lines
2.6 KiB
<ng-container *ngIf="hasFields; else noFields">
|
|
<ng-container *ngIf="formModel.itemChanges | async; let items">
|
|
<div class="array-container" *ngIf="items.length > 0"
|
|
cdkDropList
|
|
[cdkDropListDisabled]="false"
|
|
[cdkDropListData]="items"
|
|
(cdkDropListDropped)="sort($event)">
|
|
<div *ngFor="let itemForm of items; index as i; last as isLast; first as isFirst" class="table-drag item"
|
|
cdkDrag
|
|
cdkDragLockAxis="y">
|
|
<sqx-array-item
|
|
[canUnset]="canUnset"
|
|
[form]="form"
|
|
[formContext]="formContext"
|
|
[formModel]="itemForm"
|
|
[index]="i"
|
|
[isDisabled]="isDisabled | async"
|
|
[isFirst]="isFirst"
|
|
[isLast]="isLast"
|
|
[language]="language"
|
|
[languages]="languages"
|
|
(clone)="addItem(itemForm)"
|
|
(itemRemove)="removeItem(i)"
|
|
(itemMove)="move(itemForm, $event)" >
|
|
<i cdkDragHandle class="icon-drag2"></i>
|
|
</sqx-array-item>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col">
|
|
<button type="button" class="btn btn-outline-success" [disabled]="isFull | async" (click)="addItem()">
|
|
{{ 'contents.arrayAddItem' | sqxTranslate }}
|
|
</button>
|
|
|
|
<button type="button" class="btn btn-text-danger ml-2"
|
|
(sqxConfirmClick)="clear()"
|
|
confirmTitle="i18n:contents.arrayClearConfirmTitle"
|
|
confirmText="i18n:contents.arrayClearConfirmText"
|
|
confirmRememberKey="leaveApp">
|
|
{{ 'contents.arrayClear' | sqxTranslate }}
|
|
</button>
|
|
</div>
|
|
|
|
<div class="col-auto" *ngIf="items.length > 0">
|
|
<button type="button" class="btn btn-text-secondary" (click)="expandAll()" title="i18n:contents.arrayExpandAll">
|
|
<i class="icon-plus-square"></i>
|
|
</button>
|
|
<button type="button" class="btn btn-text-secondary" (click)="collapseAll()" title="i18n:contents.arrayCollapseAll">
|
|
<i class="icon-minus-square"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</ng-container>
|
|
</ng-container>
|
|
|
|
<ng-template #noFields>
|
|
<small class="text-muted">
|
|
{{ 'contents.arrayNoFields' | sqxTranslate }}
|
|
</small>
|
|
</ng-template>
|