|
1 | | -<div [formGroup]="formGroup" class="flex flex-col"> |
2 | | - <!-- Header --> |
3 | | - <h2> |
4 | | - {{ 'components.widget.settings.grid.buttons.title' | translate }} |
5 | | - </h2> |
6 | | - <!-- <ui-alert class="mb-4"> |
| 1 | +<!-- Header --> |
| 2 | +<h2> |
| 3 | + {{ 'components.widget.settings.grid.buttons.title' | translate }} |
| 4 | +</h2> |
| 5 | +<!-- <ui-alert class="mb-4"> |
7 | 6 | {{ 'components.widget.settings.grid.hint.buttons' | translate }} |
8 | 7 | </ui-alert> --> |
9 | | - <!-- Add new button --> |
10 | | - <ui-button |
11 | | - class="self-end" |
12 | | - icon="add" |
13 | | - variant="primary" |
14 | | - (click)="addButton($event)" |
15 | | - > |
| 8 | +<!-- Add new button --> |
| 9 | +<div class="flex justify-end mb-4"> |
| 10 | + <ui-button icon="add" variant="primary" (click)="addButton($event)"> |
16 | 11 | {{ 'components.widget.settings.grid.buttons.create' | translate }} |
17 | 12 | </ui-button> |
18 | | - <!-- Available buttons --> |
19 | | - <ui-tabs |
20 | | - *ngIf="buttons.length > 0" |
21 | | - cdkDropListOrientation="horizontal" |
22 | | - cdkDropList |
23 | | - (cdkDropListDropped)="onReorder($event)" |
24 | | - > |
25 | | - <ui-tab *ngFor="let button of buttons.controls; let i = index" cdkDrag> |
26 | | - <!-- Button label - tab label --> |
27 | | - <ng-container ngProjectAs="label"> |
28 | | - <div class="flex items-center"> |
29 | | - <!-- Error indicator --> |
30 | | - <ui-icon |
31 | | - *ngIf="button.invalid" |
32 | | - icon="error_outline" |
33 | | - variant="danger" |
34 | | - [size]="18" |
35 | | - ></ui-icon> |
36 | | - <!-- Button name --> |
37 | | - <span |
38 | | - class="max-w-[100px] overflow-hidden text-ellipsis whitespace-nowrap" |
39 | | - >{{ |
40 | | - button.value.name.length > 0 |
41 | | - ? button.value.name |
42 | | - : ('components.widget.settings.grid.buttons.defaultName' |
43 | | - | translate) |
44 | | - }} |
45 | | - </span> |
46 | | - <!-- Reorder --> |
47 | | - <ui-button |
48 | | - variant="grey" |
49 | | - [isIcon]="true" |
50 | | - size="small" |
51 | | - cdkDragHandle |
52 | | - icon="drag_indicator" |
53 | | - class="draggable" |
54 | | - [uiTooltip]="'models.page.tooltip.drag' | translate" |
55 | | - > |
56 | | - </ui-button> |
57 | | - </div> |
58 | | - </ng-container> |
59 | | - <!-- Button form - tab content --> |
60 | | - <shared-button-config |
61 | | - [formGroup]="$any(button)" |
62 | | - [fields]="fields" |
63 | | - [channels]="channels" |
64 | | - [templates]="templates" |
65 | | - [distributionLists]="distributionLists" |
66 | | - [relatedForms]="relatedForms" |
67 | | - (deleteButton)="deleteButton(i)" |
68 | | - > |
69 | | - </shared-button-config> |
70 | | - </ui-tab> |
71 | | - </ui-tabs> |
72 | 13 | </div> |
| 14 | +<!-- Available buttons --> |
| 15 | +<ui-tabs |
| 16 | + class="grow" |
| 17 | + *ngIf="buttons.length > 0" |
| 18 | + cdkDropListOrientation="horizontal" |
| 19 | + cdkDropList |
| 20 | + (cdkDropListDropped)="onReorder($event)" |
| 21 | +> |
| 22 | + <ui-tab *ngFor="let button of buttons.controls; let i = index" cdkDrag> |
| 23 | + <!-- Button label - tab label --> |
| 24 | + <ng-container ngProjectAs="label"> |
| 25 | + <div class="flex items-center"> |
| 26 | + <!-- Error indicator --> |
| 27 | + <ui-icon |
| 28 | + *ngIf="button.invalid" |
| 29 | + icon="error_outline" |
| 30 | + variant="danger" |
| 31 | + [size]="18" |
| 32 | + ></ui-icon> |
| 33 | + <!-- Button name --> |
| 34 | + <span |
| 35 | + class="max-w-[100px] overflow-hidden text-ellipsis whitespace-nowrap" |
| 36 | + >{{ |
| 37 | + button.value.name.length > 0 |
| 38 | + ? button.value.name |
| 39 | + : ('components.widget.settings.grid.buttons.defaultName' |
| 40 | + | translate) |
| 41 | + }} |
| 42 | + </span> |
| 43 | + <!-- Reorder --> |
| 44 | + <ui-button |
| 45 | + variant="grey" |
| 46 | + [isIcon]="true" |
| 47 | + size="small" |
| 48 | + cdkDragHandle |
| 49 | + icon="drag_indicator" |
| 50 | + class="draggable" |
| 51 | + [uiTooltip]="'models.page.tooltip.drag' | translate" |
| 52 | + > |
| 53 | + </ui-button> |
| 54 | + </div> |
| 55 | + </ng-container> |
| 56 | + <!-- Button form - tab content --> |
| 57 | + <shared-button-config |
| 58 | + [formGroup]="$any(button)" |
| 59 | + [fields]="fields" |
| 60 | + [channels]="channels" |
| 61 | + [templates]="templates" |
| 62 | + [distributionLists]="distributionLists" |
| 63 | + [relatedForms]="relatedForms" |
| 64 | + (deleteButton)="deleteButton(i)" |
| 65 | + > |
| 66 | + </shared-button-config> |
| 67 | + </ui-tab> |
| 68 | +</ui-tabs> |
0 commit comments