-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathwidget.component.html
More file actions
59 lines (53 loc) · 2.22 KB
/
Copy pathwidget.component.html
File metadata and controls
59 lines (53 loc) · 2.22 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<span *ngIf="widget.field_name; else fieldsSelect" class="widget-field-name">
{{ widget.field_name }}
</span>
<ng-template #fieldsSelect>
<mat-form-field appearance="outline">
<mat-label>Field</mat-label>
<mat-select [(ngModel)]="widget.field_name" name="{{widget.field_name}}-field-name">
<mat-option *ngFor="let field of fields"
[value]="field" (click)="onSelectWidgetField.emit(field)">{{ field }}</mat-option>
</mat-select>
</mat-form-field>
</ng-template>
<div class="widget-type">
<mat-form-field appearance="outline">
<mat-label>Displayed field type</mat-label>
<mat-select name="{{widget.field_name}}-field-type"
[(ngModel)]="widget.widget_type"
(ngModelChange)="onWidgetTypeChange.emit(widget.field_name)">
<mat-option *ngFor="let widgetType of widgetTypes"
[value]="widgetType">{{ widgetType }}</mat-option>
</mat-select>
<mat-hint *ngIf="docsUrls[widgetType]">
<a mat-stroked-button [href]="docsUrls[widgetType]" target="_blank" color="primary">
Docs
<mat-icon>open_in_new</mat-icon>
</a>
</mat-hint>
</mat-form-field>
</div>
<div class="code-editor-box">
<ngs-code-editor
name="{{widget.field_name}}-params-editor"
[theme]="codeEditorTheme"
[codeModel]="mutableWidgetParams"
[options]="paramsEditorOptions"
[readOnly]="isReadonlyParams"
(valueChanged)="onWidgetParamsChange.emit({value: $event, fieldName: widget.field_name})"
>
</ngs-code-editor>
</div>
<mat-form-field appearance="outline">
<mat-label>Displayed field name</mat-label>
<input matInput [(ngModel)]="widget.name" name="{{widget.field_name}}-field-new-name">
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Displayed field description</mat-label>
<textarea matInput [(ngModel)]="widget.description" name="{{widget.field_name}}-field-description"></textarea>
</mat-form-field>
<button mat-icon-button type="button" class="widget-delete-button"
matTooltip="Delete widget"
(click)="onWidgetDelete.emit(widget.field_name)">
<mat-icon>delete</mat-icon>
</button>