Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions src/app/components/add-value-form/add-value-form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,17 @@

<div *ngIf="type !== 'String'" class="add-form-list">
<div class="line" *ngFor="let v of getItemArray(); let i = index">
<mat-form-field *ngIf="type === 'List' || type === 'Set' || type === 'Ordered Set'">
<input matInput placeholder="Value"
(change)="onValueChange()"
[(ngModel)]="getItemArray()[i].value">
</mat-form-field>

<mat-form-field *ngIf="type === 'Ordered Set'">
<input matInput type="number" placeholder="Score"
(change)="onValueChange()"
[(ngModel)]="getItemArray()[i].score"
type="number">
</mat-form-field>

<mat-form-field *ngIf="type === 'Hash Map'" style="flex-grow:0">
<input matInput placeholder="Key"
<textarea matInput placeholder="Key"
[readonly]="isEditMode && !v.isNew"
(change)="onValueChange()"
[(ngModel)]="getItemArray()[i].key">
[(ngModel)]="getItemArray()[i].key"
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="7"></textarea>
</mat-form-field>

<mat-form-field *ngIf="type === 'Hash Map'">
<mat-form-field *ngIf="type === 'List' || type === 'Set' || type === 'Ordered Set' || type === 'Hash Map'">
<textarea matInput placeholder="Value"
(change)="onValueChange()"
[(ngModel)]="getItemArray()[i].value"
Expand All @@ -38,6 +28,13 @@
cdkAutosizeMaxRows="7"></textarea>
</mat-form-field>

<mat-form-field *ngIf="type === 'Ordered Set'">
<input matInput type="number" placeholder="Score"
(change)="onValueChange()"
[(ngModel)]="getItemArray()[i].score"
type="number">
</mat-form-field>

<button mat-icon-button (click)="onRemoveItem(getItemArray(),i)" *ngIf="!isEditMode && getItemArray().length > 1"
matTooltip="Delete">
<i class="material-icons delete-icon">delete</i>
Expand Down