-
Notifications
You must be signed in to change notification settings - Fork 22
/
ionic.html
339 lines (302 loc) · 10 KB
/
ionic.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<template name="autoForm_ionic">
{{#unless afDestroyUpdateForm}}
<form {{atts}}>
<div class="list">
{{#with innerContext ..}}
{{> UI.contentBlock this}}
{{/with}}
</div>
</form>
{{/unless}}
</template>
<template name="quickForm_ionic">
{{#autoForm this.qfAutoFormContext}}
{{> afQuickFields}}
{{#if qfShouldRenderButton}}
<div class="padding">
<button type="submit" {{submitButtonAtts}}>
{{#with ../atts.buttonContent}}
{{this}}
{{else}}
Submit
{{/with}}
</button>
</div>
{{/if}}
{{/autoForm}}
</template>
<template name="afQuickField_ionic">
{{#if isGroup atts=this}}
{{> afObjectField_ionic}}
{{else}}
{{#if isFieldArray atts=this}}
{{> afArrayField_ionic}}
{{else}}
{{> afFormGroup_ionic groupAtts}}
{{/if}}
{{/if}}
</template>
<template name="afFormGroup_ionic">
{{#if skipLabel}}
{{> afFieldInput this.afFieldInputAtts}}
{{else}}
<label {{ionicFieldLabelAtts}}>
{{#unless ionicFieldLabelAtts.placeholderOnly}}
<span class="input-label">{{#if this.labelText}}{{this.labelText}}{{else}}{{afFieldLabelText name=this.name}}{{/if}}</span>
{{/unless}}
{{> afFieldInput this.afFieldInputAtts}}
</label>
{{/if}}
{{#if afFieldIsInvalid name=this.name}}
<div class="item item-text-wrap assertive"><i class="icon ion-android-alert"></i> {{{afFieldMessage name=this.name}}}</div>
{{/if}}
</template>
<template name="afObjectField_ionic">
{{#with afFieldLabelText name=this.name}}
<div class="item item-divider">
{{this}}
</div>
{{/with}}
{{#if afFieldIsInvalid name=this.name}}
<div class="assertive">{{{afFieldMessage name=this.name}}}</div>
{{/if}}
{{> afQuickFields name=this.name}}
</template>
<template name="afArrayField_ionic">
<div class="item item-divider">
{{afFieldLabelText name=this.atts.name}}
{{#if afArrayFieldHasLessThanMaximum name=this.atts.name minCount=this.atts.minCount maxCount=this.atts.maxCount}}
<button type="button" class="button button-clear button-small pull-right autoform-add-item" data-autoform-field="{{this.atts.name}}" data-autoform-minCount="{{this.atts.minCount}}" data-autoform-maxCount="{{this.atts.maxCount}}">
Add <span class="icon ion-plus"></span>
</button>
{{/if}}
</div>
{{#if afFieldIsInvalid name=this.atts.name}}
<div class="item item-text-wrap">
<span class="assertive">{{{afFieldMessage name=this.atts.name}}}</span>
</div>
{{/if}}
{{#afEachArrayItem name=this.atts.name minCount=this.atts.minCount maxCount=this.atts.maxCount}}
<div class="card autoform-array-item">
{{> afQuickField name=this.name label=false options=afOptionsFromSchema}}
{{#if afArrayFieldHasMoreThanMinimum name=../atts.name minCount=../atts.minCount maxCount=../atts.maxCount}}
<div class="item item-divider">
<button type="button" class="button button-clear button-small pull-right autoform-remove-item">
Remove <span class="icon ion-close"></span>
</button>
</div>
{{/if}}
</div>
{{/afEachArrayItem}}
</template>
<template name="afCheckbox_ionic">
<div class="item item-checkbox item-text-wrap">
<label class="checkbox">
<input type="checkbox" value="{{this.value}}" {{atts}} />
</label>
{{afFieldLabelText name=this.name}}
</div>
</template>
<template name="afCheckboxGroup_ionic">
<div class="af-checkbox-group" {{dsk}}>
<div class="item item-divider">
{{afFieldLabelText name=this.name}}
</div>
{{#each this.items}}
<div class="item item-checkbox item-text-wrap">
<label class="checkbox">
<input type="checkbox" value="{{this.value}}" {{atts}} />
</label>
{{this.label}}
</div>
{{/each}}
</div>
</template>
<template name="afCheckboxGroupInline_ionic">
<div class="af-checkbox-group" {{dsk}}>
{{#each this.items}}
<div class="item item-checkbox item-text-wrap">
<label class="checkbox">
<input type="checkbox" value="{{this.value}}" {{atts}} />
</label>
{{this.label}}
</div>
{{/each}}
</div>
</template>
<template name="afRadio_ionic">
<label class="item item-radio item-text-wrap">
<input type="radio" value="{{this.value}}" {{atts}} />
<div class="item-content disable-pointer-events">
{{afFieldLabelText name=this.name}}
</div>
<i class="radio-icon ion-checkmark disable-pointer-events"></i>
</label>
</template>
<template name="afRadioGroup_ionic">
<div class="af-radio-group" {{dsk}}>
<div class="item item-divider">
{{afFieldLabelText name=this.name}}
</div>
{{#each this.items}}
<label class="item item-radio item-text-wrap">
<input type="radio" value="{{this.value}}" {{atts}} />
<div class="item-content disable-pointer-events">
{{this.label}}
</div>
<i class="radio-icon ion-checkmark disable-pointer-events"></i>
</label>
{{/each}}
</div>
</template>
<template name="afRadioGroupInline_ionic">
<div class="af-radio-group" {{dsk}}>
{{#each this.items}}
<label class="item item-radio item-text-wrap">
<input type="radio" value="{{this.value}}" {{atts}} />
<div class="item-content disable-pointer-events">
{{afFieldLabelText name=this.name}}
</div>
<i class="radio-icon ion-checkmark disable-pointer-events"></i>
</label>
{{/each}}
</div>
</template>
<template name="afBooleanRadioGroup_ionic">
<div {{dsk}}>
<label class="item item-radio item-text-wrap">
<input type="radio" value="false" name="{{this.name}}" {{falseAtts}} />
<div class="item-content disable-pointer-events">
{{#with this.atts.falseLabel}}{{this}}{{else}}False{{/with}}
</div>
<i class="radio-icon ion-checkmark disable-pointer-events"></i>
</label>
<label class="item item-radio item-text-wrap">
<input type="radio" value="true" name="{{this.name}}" {{trueAtts}} />
<div class="item-content disable-pointer-events">
{{#with this.atts.trueLabel}}{{this}}{{else}}True{{/with}}
</div>
<i class="radio-icon ion-checkmark disable-pointer-events"></i>
</label>
</div>
</template>
<template name="afSelect_ionic">
<label class="item item-input item-select item-text-wrap">
<div class="input-label">
{{afFieldLabelText name=this.name}}
</div>
<select {{atts}}>
{{#each this.items}}
{{#if this.optgroup}}
<optgroup label="{{this.optgroup}}">
{{#each this.items}}
<option {{optionAtts}}>{{this.label}}</option>
{{/each}}
</optgroup>
{{else}}
<option {{optionAtts}}>{{this.label}}</option>
{{/if}}
{{/each}}
</select>
</label>
</template>
<template name="afBooleanSelect_ionic">
<label class="item item-input item-select item-text-wrap">
<div class="input-label">
{{afFieldLabelText name=this.name}}
</div>
<select {{atts}}>
{{#each this.items}}
<option {{optionAtts}}>{{this.label}}</option>
{{/each}}
</select>
</label>
</template>
<template name="afSelectMultiple_ionic">
<label class="item item-input item-select item-text-wrap">
<div class="input-label">
{{afFieldLabelText name=this.name}}
</div>
<select {{atts}} multiple>
{{#each this.items}}
{{#if this.optgroup}}
<optgroup label="{{this.optgroup}}">
{{#each this.items}}
<option {{optionAtts}}>{{this.label}}</option>
{{/each}}
</optgroup>
{{else}}
<option {{optionAtts}}>{{this.label}}</option>
{{/if}}
{{/each}}
</select>
</label>
</template>
<template name="afToggle">
<div class="item item-toggle item-text-wrap">
{{afFieldLabelText name=this.name}}
<label class="toggle">
<input type="checkbox" value="true" {{atts}} />
<div class="track">
<div class="handle"></div>
</div>
</label>
</div>
</template>
<template name="afTextarea_ionic">
<textarea {{atts}}>{{this.value}}</textarea>
</template>
<template name="afInputText_ionic">
<input type="text" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputPassword_ionic">
<input type="password" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputButton_ionic">
<input type="button" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputSubmit_ionic">
<input type="submit" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputReset_ionic">
<input type="reset" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputDateTime_ionic">
<input type="datetime" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputDateTimeLocal_ionic">
<input type="datetime-local" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputDate_ionic">
<input type="date" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputMonth_ionic">
<input type="month" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputTime_ionic">
<input type="time" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputWeek_ionic">
<input type="week" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputNumber_ionic">
<input type="number" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputRange_ionic">
<input type="range" value="{{this.value}}" {{this.atts}}/>
</template>
<template name="afInputEmail_ionic">
<input type="email" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputUrl_ionic">
<input type="url" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputSearch_ionic">
<input type="search" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputTel_ionic">
<input type="tel" value="{{this.value}}" {{atts}}/>
</template>
<template name="afInputColor_ionic">
<input type="color" value="{{this.value}}" {{atts}}/>
</template>