-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathdialogField.html
205 lines (182 loc) · 7.99 KB
/
dialogField.html
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<div ng-show="vm.dialogField.visible"
class="form-group"
ng-class="{'has-error': vm.validation.isValid === false}">
<label class="col-sm-3 control-label">
{{ ::vm.dialogField.label }}
<i class="fa fa-info-circle primary help-icon"
ng-if="vm.dialogField.description"
tooltip-append-to-body="true"
uib-tooltip="{{ vm.dialogField.description }}"
tooltip-placement="auto top">
</i>
</label>
<div ng-switch on="vm.dialogField.type">
<div class="col-sm-4" ng-switch-when="DialogFieldTextBox">
<input ng-model="vm.dialogField.default_value"
ng-disabled="vm.isFieldDisabled()"
ng-change="vm.changesHappened()"
ng-model-options="{debounce: {'default': 500}}"
class="form-control"
type="{{ vm.dialogField.options.protected ? 'password' : 'text' }}"
uib-tooltip="{{ ::inputTitle }}"
value="{{ vm.dialogField.values }}"
id="{{ vm.dialogField.name }}">
<div ng-if="vm.validation.isValid === false">{{ vm.validation.message }}</div>
</div>
<div class="col-sm-8" ng-switch-when="DialogFieldTextAreaBox">
<textarea ng-model="vm.dialogField.default_value"
ng-disabled="vm.isFieldDisabled()"
ng-change="vm.changesHappened()"
ng-model-options="{debounce: {'default': 500}}"
class="form-control"
style="resize: vertical"
uib-tooltip="{{ ::inputTitle }}"
rows="4"
id="{{ vm.dialogField.name }}">{{ vm.dialogField.default_value }}
</textarea>
<div ng-if="vm.validation.isValid === false">{{ vm.validation.message }}</div>
</div>
<div class="col-sm-1" ng-switch-when="DialogFieldCheckBox">
<input ng-model="vm.dialogField.default_value"
ng-true-value="'t'"
ng-false-value="'f'"
ng-disabled="vm.isFieldDisabled()"
ng-change="vm.changesHappened()"
type="checkbox"
uib-tooltip="{{ ::inputTitle }}"
id="{{ vm.dialogField.name }}">
<div ng-if="vm.validation.isValid === false">{{ vm.validation.message }}</div>
</div>
<div class="col-sm-4" ng-switch-when="DialogFieldDropDownList">
<select miq-select
data-live-search="true"
ng-if="!vm.dialogField.options.force_multi_value"
ng-model="vm.dialogField.default_value"
watch-model="vm.dialogField.values"
ng-change="vm.changesHappened()"
ng-disabled="vm.isFieldDisabled()"
class="form-control"
data-container="body"
id="{{ vm.dialogField.name }}"
ng-options="value[0] as value[1] for value in vm.dialogField.values"
miq-options="{ 'data-tokens': value[0] + ' ' + value[1] }"
></select>
<select miq-select multiple
data-live-search="true"
data-container="body"
ng-if="vm.dialogField.options.force_multi_value"
ng-model="vm.dialogField.default_value"
watch-model="vm.dialogField.values"
ng-change="vm.changesHappened()"
ng-disabled="vm.isFieldDisabled()"
input-id="{{ vm.dialogField.name }}"
ng-options="value[0] as value[1] for value in vm.dialogField.values"
miq-options="{ 'data-tokens': value[0] + ' ' + value[1] }"
></select>
<div ng-if="vm.validation.isValid === false">{{ vm.validation.message }}</div>
</div>
<div class="col-sm-6" ng-switch-when="DialogFieldTagControl">
<select miq-select
ng-if="vm.dialogField.options.force_single_value"
ng-model="vm.dialogField.default_value"
watch-model="vm.dialogField.values"
ng-change="vm.changesHappened()"
ng-disabled="vm.isFieldDisabled()"
class="form-control"
data-container="body"
id="{{ vm.dialogField.name }}"
ng-options="fieldValue.id as fieldValue.description for fieldValue in vm.dialogField.values"
></select>
<select miq-select multiple
data-container="body"
ng-if="!vm.dialogField.options.force_single_value"
ng-model="vm.dialogField.default_value"
watch-model="vm.dialogField.values"
ng-change="vm.changesHappened()"
ng-disabled="vm.isFieldDisabled()"
class="form-control"
id="{{ vm.dialogField.name }}"
ng-options="fieldValue.id as fieldValue.description for fieldValue in vm.dialogField.values"
></select>
<div ng-if="vm.validation.isValid === false">{{ vm.validation.message }}</div>
</div>
<div class="col-sm-6" ng-switch-when="DialogFieldRadioButton">
<span ng-if="vm.dialogField.read_only || vm.inputDisabled">
<label class="radio-inline">{{ vm.parsedOptions[vm.dialogField.name] }}</label>
</span>
<span ng-if="vm.dialogField.read_only === false || vm.inputDisabled === false">
<label class="radio-inline"
ng-repeat="fieldValue in vm.dialogField.values">
<input type="radio"
ng-model="vm.dialogField.default_value"
ng-change="vm.changesHappened()"
ng-disabled="vm.isFieldDisabled()"
name="{{ vm.dialogField.name }}"
value="{{ ::fieldValue[0] }}"
id="{{ vm.dialogField.name }}"/>
{{ ::fieldValue[1] }}
</label>
</span>
<div ng-if="vm.validation.isValid === false">{{ vm.validation.message }}</div>
</div>
<div class="col-sm-4" ng-switch-when="DialogFieldDateControl">
<p class="input-group">
<input uib-datepicker-popup="MM/dd/yyyy"
type="text"
class="form-control"
ng-model="vm.dialogField.default_value"
ng-change="vm.changesHappened()"
is-open="open"
min-date="vm.minDate"
datepicker-options="vm.dateOptions"
close-text="{{'Close'|translate}}"/>
<span class="input-group-btn">
<button type="button"
class="btn btn-default"
ng-click="open = !open">
<i class="fa fa-calendar"></i>
</button>
</span>
</p>
<div ng-if="vm.validation.isValid === false">{{ vm.validation.message }}</div>
</div>
<div class="col-sm-4" ng-switch-when="DialogFieldDateTimeControl">
<div class="dateTimePadding">
<p class="input-group">
<input uib-datepicker-popup="MM/dd/yyyy"
type="text"
class="form-control"
ng-model="vm.dialogField.dateField"
ng-change="vm.dateTimeFieldChanged()"
is-open="open"
min-date="vm.minDate"
datepicker-options="vm.dateOptions"
close-text="{{'Close'|translate}}"
id="{{ vm.dialogField.name }}"/>
<span class="input-group-btn">
<button type="button"
class="btn btn-default"
ng-click="open = !open">
<i class="fa fa-calendar"></i></button>
</span>
</p>
</div>
<div uib-timepicker
ng-model="vm.dialogField.timeField"
ng-change="vm.dateTimeFieldChanged()">
</div>
<div ng-if="vm.validation.isValid === false">{{ vm.validation.message }}</div>
</div>
</div>
<div class="col-sm-1"
ng-if="vm.dialogField.dynamic && vm.dialogField.show_refresh_button && vm.inputDisabled===false">
<button type="button"
class="btn btn-default"
ng-click="vm.refreshSingleField()">
<i class="fa fa-refresh" uib-Tooltip="{{'Refresh field'|translate}}"></i>
</button>
</div>
<div class="col-sm-1" ng-show="vm.dialogField.fieldBeingRefreshed">
<div class="spinner spinner-xs spinner-inline"></div>
</div>
</div>