|
9 | 9 |
|
10 | 10 | <div *ngIf="type !== 'String'" class="add-form-list">
|
11 | 11 | <div class="line" *ngFor="let v of getItemArray(); let i = index">
|
12 |
| - <mat-form-field *ngIf="type === 'List' || type === 'Set' || type === 'Ordered Set'"> |
13 |
| - <input matInput placeholder="Value" |
14 |
| - (change)="onValueChange()" |
15 |
| - [(ngModel)]="getItemArray()[i].value"> |
16 |
| - </mat-form-field> |
17 |
| - |
18 |
| - <mat-form-field *ngIf="type === 'Ordered Set'"> |
19 |
| - <input matInput type="number" placeholder="Score" |
20 |
| - (change)="onValueChange()" |
21 |
| - [(ngModel)]="getItemArray()[i].score" |
22 |
| - type="number"> |
23 |
| - </mat-form-field> |
24 |
| - |
25 | 12 | <mat-form-field *ngIf="type === 'Hash Map'" style="flex-grow:0">
|
26 |
| - <input matInput placeholder="Key" |
| 13 | + <textarea matInput placeholder="Key" |
27 | 14 | [readonly]="isEditMode && !v.isNew"
|
28 | 15 | (change)="onValueChange()"
|
29 |
| - [(ngModel)]="getItemArray()[i].key"> |
| 16 | + [(ngModel)]="getItemArray()[i].key" |
| 17 | + cdkTextareaAutosize |
| 18 | + cdkAutosizeMinRows="1" |
| 19 | + cdkAutosizeMaxRows="7"></textarea> |
30 | 20 | </mat-form-field>
|
31 | 21 |
|
32 |
| - <mat-form-field *ngIf="type === 'Hash Map'"> |
| 22 | + <mat-form-field *ngIf="type === 'List' || type === 'Set' || type === 'Ordered Set' || type === 'Hash Map'"> |
33 | 23 | <textarea matInput placeholder="Value"
|
34 | 24 | (change)="onValueChange()"
|
35 | 25 | [(ngModel)]="getItemArray()[i].value"
|
|
38 | 28 | cdkAutosizeMaxRows="7"></textarea>
|
39 | 29 | </mat-form-field>
|
40 | 30 |
|
| 31 | + <mat-form-field *ngIf="type === 'Ordered Set'"> |
| 32 | + <input matInput type="number" placeholder="Score" |
| 33 | + (change)="onValueChange()" |
| 34 | + [(ngModel)]="getItemArray()[i].score" |
| 35 | + type="number"> |
| 36 | + </mat-form-field> |
| 37 | + |
41 | 38 | <button mat-icon-button (click)="onRemoveItem(getItemArray(),i)" *ngIf="!isEditMode && getItemArray().length > 1"
|
42 | 39 | matTooltip="Delete">
|
43 | 40 | <i class="material-icons delete-icon">delete</i>
|
|
0 commit comments