Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { LikertElementRow } from '../../../../../common/models/compound-elements/likert-element-row';
import { LikertColumn } from '../../../../../common/interfaces/UIElementInterfaces';
@Component({
selector: 'app-likert-row-edit-dialog',
template: `
<mat-dialog-content fxLayout="column">
<mat-form-field>
<mat-label>{{'text' | translate }}</mat-label>
<input #textField matInput type="text" [value]="data.row.text">
</mat-form-field>
<mat-form-field>
<mat-label>{{'id' | translate }}</mat-label>
<input #idField matInput type="text" [value]="data.row.id">
</mat-form-field>
{{'preset' | translate }}
<mat-select #valueField [value]="data.row.value">
<mat-option [value]="null">{{'propertiesPanel.undefined' | translate }}</mat-option>
<mat-option *ngFor="let column of data.columns; let i = index" [value]="i">
{{column.text}}
</mat-option>
</mat-select>
</mat-dialog-content>
<mat-dialog-actions>
<button mat-button
[mat-dialog-close]="{ text: textField.value, id: idField.value, value: valueField.value }">
{{'save' | translate }}
</button>
<button mat-button mat-dialog-close>{{'cancel' | translate }}</button>
</mat-dialog-actions>
`
})
export class LikertRowEditDialogComponent {
constructor(@Inject(MAT_DIALOG_DATA) public data: { row: LikertElementRow, columns: LikertColumn[] }) { }
}