1
1
< div [ngSwitch] ="field.getView('form') " *ngIf ="group " [formGroup] ="group ">
2
- < input [id] ="field.id " *ngSwitchCase ="'string' " type ="text " [formControl] ="control "
3
- [placeholder] ="field.getPlaceholder() " [readonly] ="formService.isReadOnly(field, item) " class ="input "
4
- [ecFocus] ="focusEvent " />
2
+ < input
3
+ [id] ="field.id "
4
+ *ngSwitchCase ="'string' "
5
+ type ="text "
6
+ [formControl] ="control "
7
+ [placeholder] ="field.getPlaceholder() "
8
+ class ="input "
9
+ [ecFocus] ="focusEvent "
10
+ />
5
11
6
- < textarea [id] ="field.id " *ngSwitchCase ="'textarea' " type ="text " [formControl] ="control "
7
- [placeholder] ="field.getPlaceholder() " [readonly] ="formService.isReadOnly(field, item) " class ="input "
8
- [ecFocus] ="focusEvent "> </ textarea >
12
+ < textarea
13
+ [id] ="field.id "
14
+ *ngSwitchCase ="'textarea' "
15
+ type ="text "
16
+ [formControl] ="control "
17
+ [placeholder] ="field.getPlaceholder() "
18
+ class ="input "
19
+ [ecFocus] ="focusEvent "
20
+ > </ textarea >
9
21
10
- < input [id] ="field.id " *ngSwitchCase ="'number' " type ="number " [formControl] ="control "
11
- [placeholder] ="field.getPlaceholder() " [readonly] ="formService.isReadOnly(field, item) " class ="input "
12
- [ecFocus] ="focusEvent ">
22
+ < input
23
+ [id] ="field.id "
24
+ *ngSwitchCase ="'number' "
25
+ type ="number "
26
+ [formControl] ="control "
27
+ [placeholder] ="field.getPlaceholder() "
28
+ class ="input "
29
+ [ecFocus] ="focusEvent "
30
+ />
13
31
14
32
< div class ="ec-input_color " *ngSwitchCase ="'color' ">
15
33
< label [style.backgroundColor] ="control.value ">
16
- < input [id] ="field.id " type ="color " [formControl] ="control " [readonly] =" formService.isReadOnly(field, item) " >
34
+ < input [id] ="field.id " type ="color " [formControl] ="control " / >
17
35
</ label >
18
36
</ div >
19
37
20
38
< label *ngSwitchCase ="'boolean' ">
21
- < input [id] ="field.id " type ="checkbox " [formControl] ="control " [attr.disabled] =" formService.isReadOnly(field, item)?'disabled':'false' " >
22
- {{field.placeholder}}
39
+ < input [id] ="field.id " type ="checkbox " [formControl] ="control " / >
40
+ {{ field.placeholder }}
23
41
</ label >
24
42
25
- < input [id] ="field.id " *ngSwitchCase ="'email' " type ="email " [formControl] ="control "
26
- [readonly] ="formService.isReadOnly(field, item) " [placeholder] ="field.getPlaceholder() " class ="input "
27
- [ecFocus] ="focusEvent ">
43
+ < input
44
+ [id] ="field.id "
45
+ *ngSwitchCase ="'email' "
46
+ type ="email "
47
+ [formControl] ="control "
48
+ [placeholder] ="field.getPlaceholder() "
49
+ class ="input "
50
+ [ecFocus] ="focusEvent "
51
+ />
28
52
29
- < input [id] ="field.id " *ngSwitchCase ="'url' " type ="url " [formControl] ="control " [placeholder] ="field.getPlaceholder() "
30
- class ="input " [ecFocus] ="focusEvent " [readonly] ="formService.isReadOnly(field, item) ">
53
+ < input
54
+ [id] ="field.id "
55
+ *ngSwitchCase ="'url' "
56
+ type ="url "
57
+ [formControl] ="control "
58
+ [placeholder] ="field.getPlaceholder() "
59
+ class ="input "
60
+ [ecFocus] ="focusEvent "
61
+ />
31
62
32
63
< ec-toggle [id] ="field.id " *ngSwitchCase ="'toggle' " [formControl] ="control " [placeholder] ="field.getPlaceholder() ">
33
64
</ ec-toggle >
34
65
35
66
< ec-datetime *ngSwitchCase ="'date' " [formControl] ="control " [placeholder] ="field.getPlaceholder() "> </ ec-datetime >
36
67
37
68
< div *ngSwitchCase ="'select' ">
38
- < select [id] ="field.id " [formControl] ="control " [ecFocus] ="focusEvent "
39
- (change) ="control.patchValue($event.target.value) " class ="input " *ngIf ="!formService.isReadOnly(field, item) ">
40
- < option > {{field.getPlaceholder()}}</ option >
41
- < option *ngFor ="let option of field.values " [selected] ="control.value===(option.value?option.value:option) "
42
- [value] ="option.value?option.value:option ">
43
- {{option.label?option.label:option}}
69
+ < select
70
+ [id] ="field.id "
71
+ [formControl] ="control "
72
+ [ecFocus] ="focusEvent "
73
+ (change) ="control.patchValue($event.target.value) "
74
+ class ="input "
75
+ *ngIf ="!formService.isReadOnly(field, item) "
76
+ >
77
+ < option > {{ field.getPlaceholder() }}</ option >
78
+ < option
79
+ *ngFor ="let option of field.values "
80
+ [selected] ="control.value === (option.value ? option.value : option) "
81
+ [value] ="option.value ? option.value : option "
82
+ >
83
+ {{ option.label ? option.label : option }}
44
84
</ option >
45
85
</ select >
46
- < input type ="text " [formControl] ="control " [id] ="field.id " class ="input " readonly
47
- *ngIf ="formService.isReadOnly(field, item) ">
86
+ < input
87
+ type ="text "
88
+ [formControl] ="control "
89
+ [id] ="field.id "
90
+ class ="input "
91
+ />
48
92
</ div >
49
93
< div *ngSwitchCase ="'copy' ">
50
- < div *ngIf ="!!item?.display(field.property) " class ="tag " style ="cursor: pointer "
51
- (click) ="keycommands.copyToClipBoard(item?.transform('copy', field.property),field.getLabel()) "
52
- [attr.data-tooltip-bottom] ="'click to copy '+field.getLabel() ">
53
- {{item?.display(field.property)}}
94
+ < div
95
+ *ngIf ="!!item?.display(field.property) "
96
+ class ="tag "
97
+ style ="cursor: pointer "
98
+ (click) ="keycommands.copyToClipBoard(item?.transform('copy', field.property), field.getLabel()) "
99
+ [attr.data-tooltip-bottom] ="'click to copy ' + field.getLabel() "
100
+ >
101
+ {{ item?.display(field.property) }}
54
102
</ div >
55
103
</ div >
56
104
57
105
< div *ngSwitchDefault >
58
106
< ec-output [field] ="field " [item] ="item "> </ ec-output >
59
107
</ div >
60
108
< ec-input-errors [control] ="group.get(field.property) "> </ ec-input-errors >
61
- </ div >
109
+ </ div >
0 commit comments