Skip to content

Commit 178782e

Browse files
committed
flex layout for array
1 parent 97fe50b commit 178782e

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
<ng-container *ngIf="state.schema.layout === 'vertical'">
1+
<div
2+
[ngStyle]="{display:'flex', 'flex-wrap': 'wrap', 'flex-direction': this.state.schema.layout === 'vertical' ? 'column':'row'}">
23
<div *ngFor="let s of states; let i = index" (mouseenter)="hover=i" (mouseleave)="hover=null">
34
<app-wrapper [state]="s"></app-wrapper>
45
<button mat-icon-button (click)="remove(i)" [style.visibility]="i===hover ? 'visible' : 'hidden'">
56
<mat-icon>remove_circle_outline</mat-icon>
67
</button>
78
</div>
8-
</ng-container>
9-
<ng-container *ngIf="state.schema.layout !== 'vertical'">
10-
<span *ngFor="let s of states; let i = index" (mouseenter)="hover=i" (mouseleave)="hover=null">
11-
<app-wrapper [state]="s"></app-wrapper>
12-
<button mat-icon-button (click)="remove(i)" [style.visibility]="i===hover ? 'visible' : 'hidden'">
13-
<mat-icon>remove_circle_outline</mat-icon>
14-
</button>
15-
</span>
16-
</ng-container>
17-
<button mat-icon-button (click)=" add()">
18-
<mat-icon>add_circle_outline</mat-icon>
19-
</button>
9+
<button mat-icon-button (click)=" add()">
10+
<mat-icon>add_circle_outline</mat-icon>
11+
</button>
12+
</div>

0 commit comments

Comments
 (0)