This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
/
js_form-model.js.html
1739 lines (1541 loc) · 132 KB
/
js_form-model.js.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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>js/form-model.js - Enketo Core</title>
<meta name="description" content="Extensible Enketo form engine" />
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<script src="scripts/nav.js" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav class="wrap">
<input type="text" id="nav-search" placeholder="Search" />
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/enketo/enketo-core" target="_blank" class="menu-item" id="repository" >Github repo</a></h2><h2><a href="https://github.com/enketo/enketo-core/blob/master/CHANGELOG.md" target="_blank" class="menu-item" id="change-log" >Change log</a></h2><h3>Tutorials</h3><ul><li><a href="tutorial-00-getting-started.html">Getting started</a></li><li><a href="tutorial-10-configuration.html">Configuration</a></li><li><a href="tutorial-20-development.html">Development</a></li><li><a href="tutorial-30-events.html">Available events</a></li><li><a href="tutorial-40-widgets.html">Creating/extending widgets</a></li><li><a href="tutorial-90-ie11.html">IE11</a></li></ul><h3>Classes</h3><ul><li><a href="AnalogScaleWidget.html">AnalogScaleWidget</a><ul class='members'><li data-type='member'><a href="AnalogScaleWidget.html#.selector">selector</a></li><li data-type='member'><a href="AnalogScaleWidget.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="AnalogScaleWidget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="AnalogScaleWidget.html#props">props</a></li><li data-type='member'><a href="AnalogScaleWidget.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="AnalogScaleWidget.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="AnalogScaleWidget.html#_getHtmlStr">_getHtmlStr</a></li><li data-type='method'><a href="AnalogScaleWidget.html#_getProps">_getProps</a></li><li data-type='method'><a href="AnalogScaleWidget.html#_init">_init</a></li><li data-type='method'><a href="AnalogScaleWidget.html#_renderLabels">_renderLabels</a></li><li data-type='method'><a href="AnalogScaleWidget.html#_reset">_reset</a></li><li data-type='method'><a href="AnalogScaleWidget.html#_setResizeListener">_setResizeListener</a></li><li data-type='method'><a href="AnalogScaleWidget.html#_stepsBetweenHtmlStr">_stepsBetweenHtmlStr</a></li><li data-type='method'><a href="AnalogScaleWidget.html#_stretchHeight">_stretchHeight</a></li><li data-type='method'><a href="AnalogScaleWidget.html#_updateLabels">_updateLabels</a></li><li data-type='method'><a href="AnalogScaleWidget.html#_updateMercury">_updateMercury</a></li><li data-type='method'><a href="AnalogScaleWidget.html#disable">disable</a></li><li data-type='method'><a href="AnalogScaleWidget.html#enable">enable</a></li><li data-type='method'><a href="AnalogScaleWidget.html#update">update</a></li></ul></li><li><a href="AutocompleteSelectpicker.html">AutocompleteSelectpicker</a><ul class='members'><li data-type='member'><a href="AutocompleteSelectpicker.html#.list">list</a></li><li data-type='member'><a href="AutocompleteSelectpicker.html#.selector">selector</a></li><li data-type='member'><a href="AutocompleteSelectpicker.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="AutocompleteSelectpicker.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="AutocompleteSelectpicker.html#props">props</a></li><li data-type='member'><a href="AutocompleteSelectpicker.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="AutocompleteSelectpicker.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="AutocompleteSelectpicker.html#_findLabel">_findLabel</a></li><li data-type='method'><a href="AutocompleteSelectpicker.html#_findValue">_findValue</a></li><li data-type='method'><a href="AutocompleteSelectpicker.html#_getProps">_getProps</a></li><li data-type='method'><a href="AutocompleteSelectpicker.html#_init">_init</a></li><li data-type='method'><a href="AutocompleteSelectpicker.html#_setFakeInputListener">_setFakeInputListener</a></li><li data-type='method'><a href="AutocompleteSelectpicker.html#_setFocusListener">_setFocusListener</a></li><li data-type='method'><a href="AutocompleteSelectpicker.html#_showCurrentLabel">_showCurrentLabel</a></li><li data-type='method'><a href="AutocompleteSelectpicker.html#disable">disable</a></li><li data-type='method'><a href="AutocompleteSelectpicker.html#enable">enable</a></li><li data-type='method'><a href="AutocompleteSelectpicker.html#update">update</a></li></ul></li><li><a href="Columns.html">Columns</a><ul class='members'><li data-type='member'><a href="Columns.html#.selector">selector</a></li><li data-type='member'><a href="Columns.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="Columns.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="Columns.html#props">props</a></li><li data-type='member'><a href="Columns.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="Columns.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="Columns.html#_getProps">_getProps</a></li><li data-type='method'><a href="Columns.html#_init">_init</a></li><li data-type='method'><a href="Columns.html#disable">disable</a></li><li data-type='method'><a href="Columns.html#enable">enable</a></li><li data-type='method'><a href="Columns.html#update">update</a></li></ul></li><li><a href="Comment.html">Comment</a><ul class='members'><li data-type='member'><a href="Comment.html#.helpersRequired">helpersRequired</a></li><li data-type='member'><a href="Comment.html#.selector">selector</a></li><li data-type='member'><a href="Comment.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="Comment.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="Comment.html#props">props</a></li><li data-type='member'><a href="Comment.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="Comment.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="Comment.html#_commentHasError">_commentHasError</a></li><li data-type='method'><a href="Comment.html#_getLinkedQuestion">_getLinkedQuestion</a></li><li data-type='method'><a href="Comment.html#_getProps">_getProps</a></li><li data-type='method'><a href="Comment.html#_hideCommentModal">_hideCommentModal</a></li><li data-type='method'><a href="Comment.html#_init">_init</a></li><li data-type='method'><a href="Comment.html#_isCommentModalShown">_isCommentModalShown</a></li><li data-type='method'><a href="Comment.html#_setCommentButtonHandler">_setCommentButtonHandler</a></li><li data-type='method'><a href="Comment.html#_setCommentButtonState">_setCommentButtonState</a></li><li data-type='method'><a href="Comment.html#_setFocusHandler">_setFocusHandler</a></li><li data-type='method'><a href="Comment.html#_setValidationHandler">_setValidationHandler</a></li><li data-type='method'><a href="Comment.html#_showCommentModal">_showCommentModal</a></li><li data-type='method'><a href="Comment.html#disable">disable</a></li><li data-type='method'><a href="Comment.html#enable">enable</a></li><li data-type='method'><a href="Comment.html#update">update</a></li></ul></li><li><a href="DatepickerExtended.html">DatepickerExtended</a><ul class='members'><li data-type='member'><a href="DatepickerExtended.html#.selector">selector</a></li><li data-type='member'><a href="DatepickerExtended.html#displayedValue">displayedValue</a></li><li data-type='member'><a href="DatepickerExtended.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="DatepickerExtended.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="DatepickerExtended.html#props">props</a></li><li data-type='member'><a href="DatepickerExtended.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="DatepickerExtended.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="DatepickerExtended.html#.condition">condition</a></li><li data-type='method'><a href="DatepickerExtended.html#_createFakeDateInput">_createFakeDateInput</a></li><li data-type='method'><a href="DatepickerExtended.html#_getProps">_getProps</a></li><li data-type='method'><a href="DatepickerExtended.html#_init">_init</a></li><li data-type='method'><a href="DatepickerExtended.html#_setChangeHandler">_setChangeHandler</a></li><li data-type='method'><a href="DatepickerExtended.html#_setFocusHandler">_setFocusHandler</a></li><li data-type='method'><a href="DatepickerExtended.html#_setResetHandler">_setResetHandler</a></li><li data-type='method'><a href="DatepickerExtended.html#_toActualDate">_toActualDate</a></li><li data-type='method'><a href="DatepickerExtended.html#_toDisplayDate">_toDisplayDate</a></li><li data-type='method'><a href="DatepickerExtended.html#disable">disable</a></li><li data-type='method'><a href="DatepickerExtended.html#enable">enable</a></li><li data-type='method'><a href="DatepickerExtended.html#update">update</a></li></ul></li><li><a href="DatepickerMobile.html">DatepickerMobile</a><ul class='members'><li data-type='member'><a href="DatepickerMobile.html#.selector">selector</a></li><li data-type='member'><a href="DatepickerMobile.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="DatepickerMobile.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="DatepickerMobile.html#props">props</a></li><li data-type='member'><a href="DatepickerMobile.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="DatepickerMobile.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="DatepickerMobile.html#.condition">condition</a></li><li data-type='method'><a href="DatepickerMobile.html#_getProps">_getProps</a></li><li data-type='method'><a href="DatepickerMobile.html#_init">_init</a></li><li data-type='method'><a href="DatepickerMobile.html#disable">disable</a></li><li data-type='method'><a href="DatepickerMobile.html#enable">enable</a></li><li data-type='method'><a href="DatepickerMobile.html#update">update</a></li></ul></li><li><a href="DatepickerNative.html">DatepickerNative</a><ul class='members'><li data-type='member'><a href="DatepickerNative.html#.selector">selector</a></li><li data-type='member'><a href="DatepickerNative.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="DatepickerNative.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="DatepickerNative.html#props">props</a></li><li data-type='member'><a href="DatepickerNative.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="DatepickerNative.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="DatepickerNative.html#.condition">condition</a></li><li data-type='method'><a href="DatepickerNative.html#_getProps">_getProps</a></li><li data-type='method'><a href="DatepickerNative.html#_init">_init</a></li><li data-type='method'><a href="DatepickerNative.html#disable">disable</a></li><li data-type='method'><a href="DatepickerNative.html#enable">enable</a></li><li data-type='method'><a href="DatepickerNative.html#update">update</a></li></ul></li><li><a href="DatepickerNativeIos.html">DatepickerNativeIos</a><ul class='members'><li data-type='member'><a href="DatepickerNativeIos.html#.selector">selector</a></li><li data-type='member'><a href="DatepickerNativeIos.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="DatepickerNativeIos.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="DatepickerNativeIos.html#props">props</a></li><li data-type='member'><a href="DatepickerNativeIos.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="DatepickerNativeIos.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="DatepickerNativeIos.html#.condition">condition</a></li><li data-type='method'><a href="DatepickerNativeIos.html#_getProps">_getProps</a></li><li data-type='method'><a href="DatepickerNativeIos.html#_init">_init</a></li><li data-type='method'><a href="DatepickerNativeIos.html#disable">disable</a></li><li data-type='method'><a href="DatepickerNativeIos.html#enable">enable</a></li><li data-type='method'><a href="DatepickerNativeIos.html#update">update</a></li></ul></li><li><a href="DatetimepickerExtended.html">DatetimepickerExtended</a><ul class='members'><li data-type='member'><a href="DatetimepickerExtended.html#.selector">selector</a></li><li data-type='member'><a href="DatetimepickerExtended.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="DatetimepickerExtended.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="DatetimepickerExtended.html#props">props</a></li><li data-type='member'><a href="DatetimepickerExtended.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="DatetimepickerExtended.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="DatetimepickerExtended.html#.condition">condition</a></li><li data-type='method'><a href="DatetimepickerExtended.html#_createFakeDateInput">_createFakeDateInput</a></li><li data-type='method'><a href="DatetimepickerExtended.html#_createFakeTimeInput">_createFakeTimeInput</a></li><li data-type='method'><a href="DatetimepickerExtended.html#_getProps">_getProps</a></li><li data-type='method'><a href="DatetimepickerExtended.html#_init">_init</a></li><li data-type='method'><a href="DatetimepickerExtended.html#_setFocusHandler">_setFocusHandler</a></li><li data-type='method'><a href="DatetimepickerExtended.html#disable">disable</a></li><li data-type='method'><a href="DatetimepickerExtended.html#enable">enable</a></li><li data-type='method'><a href="DatetimepickerExtended.html#update">update</a></li></ul></li><li><a href="DesktopSelectpicker.html">DesktopSelectpicker</a><ul class='members'><li data-type='member'><a href="DesktopSelectpicker.html#.list">list</a></li><li data-type='member'><a href="DesktopSelectpicker.html#.selector">selector</a></li><li data-type='member'><a href="DesktopSelectpicker.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="DesktopSelectpicker.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="DesktopSelectpicker.html#props">props</a></li><li data-type='member'><a href="DesktopSelectpicker.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="DesktopSelectpicker.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="DesktopSelectpicker.html#.condition">condition</a></li><li data-type='method'><a href="DesktopSelectpicker.html#_clickListener">_clickListener</a></li><li data-type='method'><a href="DesktopSelectpicker.html#_focusListener">_focusListener</a></li><li data-type='method'><a href="DesktopSelectpicker.html#_getLisHtml">_getLisHtml</a></li><li data-type='method'><a href="DesktopSelectpicker.html#_getProps">_getProps</a></li><li data-type='method'><a href="DesktopSelectpicker.html#_getTemplate">_getTemplate</a></li><li data-type='method'><a href="DesktopSelectpicker.html#_init">_init</a></li><li data-type='method'><a href="DesktopSelectpicker.html#_showSelected">_showSelected</a></li><li data-type='method'><a href="DesktopSelectpicker.html#disable">disable</a></li><li data-type='method'><a href="DesktopSelectpicker.html#enable">enable</a></li><li data-type='method'><a href="DesktopSelectpicker.html#update">update</a></li></ul></li><li><a href="DrawWidget.html">DrawWidget</a><ul class='members'><li data-type='member'><a href="DrawWidget.html#.selector">selector</a></li><li data-type='member'><a href="DrawWidget.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="DrawWidget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="DrawWidget.html#props">props</a></li><li data-type='member'><a href="DrawWidget.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="DrawWidget.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="DrawWidget.html#_getMarkup">_getMarkup</a></li><li data-type='method'><a href="DrawWidget.html#_getProps">_getProps</a></li><li data-type='method'><a href="DrawWidget.html#_handleFiles">_handleFiles</a></li><li data-type='method'><a href="DrawWidget.html#_handleResize">_handleResize</a></li><li data-type='method'><a href="DrawWidget.html#_init">_init</a></li><li data-type='method'><a href="DrawWidget.html#_loadFileIntoPad">_loadFileIntoPad</a></li><li data-type='method'><a href="DrawWidget.html#_reset">_reset</a></li><li data-type='method'><a href="DrawWidget.html#_resizeCanvas">_resizeCanvas</a></li><li data-type='method'><a href="DrawWidget.html#_showFeedback">_showFeedback</a></li><li data-type='method'><a href="DrawWidget.html#_showFileName">_showFileName</a></li><li data-type='method'><a href="DrawWidget.html#_updateDownloadLink">_updateDownloadLink</a></li><li data-type='method'><a href="DrawWidget.html#_updatePlaceholder">_updatePlaceholder</a></li><li data-type='method'><a href="DrawWidget.html#_updateValue">_updateValue</a></li><li data-type='method'><a href="DrawWidget.html#disable">disable</a></li><li data-type='method'><a href="DrawWidget.html#enable">enable</a></li><li data-type='method'><a href="DrawWidget.html#update">update</a></li></ul></li><li><a href="Filepicker.html">Filepicker</a><ul class='members'><li data-type='member'><a href="Filepicker.html#.selector">selector</a></li><li data-type='member'><a href="Filepicker.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="Filepicker.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="Filepicker.html#props">props</a></li><li data-type='member'><a href="Filepicker.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="Filepicker.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="Filepicker.html#_getProps">_getProps</a></li><li data-type='method'><a href="Filepicker.html#_init">_init</a></li><li data-type='method'><a href="Filepicker.html#_resizeFile">_resizeFile</a></li><li data-type='method'><a href="Filepicker.html#_setChangeListener">_setChangeListener</a></li><li data-type='method'><a href="Filepicker.html#_setFocusListener">_setFocusListener</a></li><li data-type='method'><a href="Filepicker.html#_setResetButtonListener">_setResetButtonListener</a></li><li data-type='method'><a href="Filepicker.html#_showFeedback">_showFeedback</a></li><li data-type='method'><a href="Filepicker.html#_showFileName">_showFileName</a></li><li data-type='method'><a href="Filepicker.html#_showPreview">_showPreview</a></li><li data-type='method'><a href="Filepicker.html#_updateDownloadLink">_updateDownloadLink</a></li><li data-type='method'><a href="Filepicker.html#_updatePlaceholder">_updatePlaceholder</a></li><li data-type='method'><a href="Filepicker.html#disable">disable</a></li><li data-type='method'><a href="Filepicker.html#enable">enable</a></li><li data-type='method'><a href="Filepicker.html#update">update</a></li></ul></li><li><a href="Form.html">Form</a><ul class='members'><li data-type='member'><a href="Form.html#.requiredTransformerVersion">requiredTransformerVersion</a></li><li data-type='member'><a href="Form.html#action">action</a></li><li data-type='member'><a href="Form.html#constraintAttributes">constraintAttributes</a></li><li data-type='member'><a href="Form.html#constraintClassesInvalid">constraintClassesInvalid</a></li><li data-type='member'><a href="Form.html#currentLanguage">currentLanguage</a></li><li data-type='member'><a href="Form.html#deprecatedID">deprecatedID</a></li><li data-type='member'><a href="Form.html#editStatus">editStatus</a></li><li data-type='member'><a href="Form.html#encryptionKey">encryptionKey</a></li><li data-type='member'><a href="Form.html#evaluationCascade">evaluationCascade</a></li><li data-type='member'><a href="Form.html#evaluationCascadeAdditions">evaluationCascadeAdditions</a></li><li data-type='member'><a href="Form.html#id">id</a></li><li data-type='member'><a href="Form.html#instanceID">instanceID</a></li><li data-type='member'><a href="Form.html#instanceName">instanceName</a></li><li data-type='member'><a href="Form.html#languages">languages</a></li><li data-type='member'><a href="Form.html#method">method</a></li><li data-type='member'><a href="Form.html#nodePathToRepeatPath">nodePathToRepeatPath</a></li><li data-type='member'><a href="Form.html#recordName">recordName</a></li><li data-type='member'><a href="Form.html#repeatPathPrefixes">repeatPathPrefixes</a></li><li data-type='member'><a href="Form.html#surveyName">surveyName</a></li><li data-type='member'><a href="Form.html#version">version</a></li></ul><ul class='methods'><li data-type='method'><a href="Form.html#addModule">addModule</a></li><li data-type='method'><a href="Form.html#blockPageNavigation">blockPageNavigation</a></li><li data-type='method'><a href="Form.html#clearNonRelevant">clearNonRelevant</a></li><li data-type='method'><a href="Form.html#filterRadioCheckSiblings">filterRadioCheckSiblings</a></li><li data-type='method'><a href="Form.html#getDataStr">getDataStr</a></li><li data-type='method'><a href="Form.html#getDataStrWithoutIrrelevantNodes">getDataStrWithoutIrrelevantNodes</a></li><li data-type='method'><a href="Form.html#getGoToTarget">getGoToTarget</a></li><li data-type='method'><a href="Form.html#getModelValue">getModelValue</a></li><li data-type='method'><a href="Form.html#getQuerySelectorsForLogic">getQuerySelectorsForLogic</a></li><li data-type='method'><a href="Form.html#getRelatedNodes">getRelatedNodes</a></li><li data-type='method'><a href="Form.html#goTo">goTo</a></li><li data-type='method'><a href="Form.html#goToTarget">goToTarget</a></li><li data-type='method'><a href="Form.html#grosslyViolateStandardComplianceByIgnoringCertainCalcs">grosslyViolateStandardComplianceByIgnoringCertainCalcs</a></li><li data-type='method'><a href="Form.html#init">init</a></li><li data-type='method'><a href="Form.html#isValid">isValid</a></li><li data-type='method'><a href="Form.html#pathToAbsolute">pathToAbsolute</a></li><li data-type='method'><a href="Form.html#replaceChoiceNameFn">replaceChoiceNameFn</a></li><li data-type='method'><a href="Form.html#resetView">resetView</a></li><li data-type='method'><a href="Form.html#setAllVals">setAllVals</a></li><li data-type='method'><a href="Form.html#setEventHandlers">setEventHandlers</a></li><li data-type='method'><a href="Form.html#setInvalid">setInvalid</a></li><li data-type='method'><a href="Form.html#setValid">setValid</a></li><li data-type='method'><a href="Form.html#updateValidityInUi">updateValidityInUi</a></li><li data-type='method'><a href="Form.html#validate">validate</a></li><li data-type='method'><a href="Form.html#validateAll">validateAll</a></li><li data-type='method'><a href="Form.html#validateContent">validateContent</a></li><li data-type='method'><a href="Form.html#validateInput">validateInput</a></li><li data-type='method'><a href="Form.html#validationUpdate">validationUpdate</a></li></ul></li><li><a href="FormLogicError.html">FormLogicError</a></li><li><a href="FormModel.html">FormModel</a><ul class='methods'><li data-type='method'><a href="FormModel.html#addOrdinalAttribute">addOrdinalAttribute</a></li><li data-type='method'><a href="FormModel.html#addRepeat">addRepeat</a></li><li data-type='method'><a href="FormModel.html#addRepeatComments">addRepeatComments</a></li><li data-type='method'><a href="FormModel.html#addTemplate">addTemplate</a></li><li data-type='method'><a href="FormModel.html#convertPullDataFn">convertPullDataFn</a></li><li data-type='method'><a href="FormModel.html#createSession">createSession</a></li><li data-type='method'><a href="FormModel.html#determineIndex">determineIndex</a></li><li data-type='method'><a href="FormModel.html#evaluate">evaluate</a></li><li data-type='method'><a href="FormModel.html#extractFakeTemplates">extractFakeTemplates</a></li><li data-type='method'><a href="FormModel.html#extractTemplates">extractTemplates</a></li><li data-type='method'><a href="FormModel.html#getMetaNode">getMetaNode</a></li><li data-type='method'><a href="FormModel.html#getNamespacePrefix">getNamespacePrefix</a></li><li data-type='method'><a href="FormModel.html#getNsResolver">getNsResolver</a></li><li data-type='method'><a href="FormModel.html#getRemovalEventData">getRemovalEventData</a></li><li data-type='method'><a href="FormModel.html#getRepeatCommentEl">getRepeatCommentEl</a></li><li data-type='method'><a href="FormModel.html#getRepeatCommentSelector">getRepeatCommentSelector</a></li><li data-type='method'><a href="FormModel.html#getRepeatCommentText">getRepeatCommentText</a></li><li data-type='method'><a href="FormModel.html#getRepeatSeries">getRepeatSeries</a></li><li data-type='method'><a href="FormModel.html#getSecondaryInstance">getSecondaryInstance</a></li><li data-type='method'><a href="FormModel.html#getStr">getStr</a></li><li data-type='method'><a href="FormModel.html#getTemplateNodes">getTemplateNodes</a></li><li data-type='method'><a href="FormModel.html#getUpdateEventData">getUpdateEventData</a></li><li data-type='method'><a href="FormModel.html#importNode">importNode</a></li><li data-type='method'><a href="FormModel.html#init">init</a></li><li data-type='method'><a href="FormModel.html#makeBugCompliant">makeBugCompliant</a></li><li data-type='method'><a href="FormModel.html#mergeXml">mergeXml</a></li><li data-type='method'><a href="FormModel.html#node">node</a></li><li data-type='method'><a href="FormModel.html#removeDuplicateEnketoNsDeclarations">removeDuplicateEnketoNsDeclarations</a></li><li data-type='method'><a href="FormModel.html#removeOrdinalAttributes">removeOrdinalAttributes</a></li><li data-type='method'><a href="FormModel.html#replaceCurrentFn">replaceCurrentFn</a></li><li data-type='method'><a href="FormModel.html#replaceIndexedRepeatFn">replaceIndexedRepeatFn</a></li><li data-type='method'><a href="FormModel.html#replaceInstanceFn">replaceInstanceFn</a></li><li data-type='method'><a href="FormModel.html#replacePullDataFn">replacePullDataFn</a></li><li data-type='method'><a href="FormModel.html#replaceVersionFn">replaceVersionFn</a></li><li data-type='method'><a href="FormModel.html#setInstanceIdAndDeprecatedId">setInstanceIdAndDeprecatedId</a></li><li data-type='method'><a href="FormModel.html#setNamespaces">setNamespaces</a></li><li data-type='method'><a href="FormModel.html#shiftRoot">shiftRoot</a></li><li data-type='method'><a href="FormModel.html#throwParserErrors">throwParserErrors</a></li><li data-type='method'><a href="FormModel.html#trimValues">trimValues</a></li></ul></li><li><a href="Geopicker.html">Geopicker</a><ul class='members'><li data-type='member'><a href="Geopicker.html#.selector">selector</a></li><li data-type='member'><a href="Geopicker.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="Geopicker.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="Geopicker.html#props">props</a></li><li data-type='member'><a href="Geopicker.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="Geopicker.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="Geopicker.html#.condition">condition</a></li><li data-type='method'><a href="Geopicker.html#_addDomElements">_addDomElements</a></li><li data-type='method'><a href="Geopicker.html#_addDynamicMap">_addDynamicMap</a></li><li data-type='method'><a href="Geopicker.html#_addPoint">_addPoint</a></li><li data-type='method'><a href="Geopicker.html#_addPointBtn">_addPointBtn</a></li><li data-type='method'><a href="Geopicker.html#_cleanLatLng">_cleanLatLng</a></li><li data-type='method'><a href="Geopicker.html#_closePolygon">_closePolygon</a></li><li data-type='method'><a href="Geopicker.html#_convertKmlCoordinatesToLeafletCoordinates">_convertKmlCoordinatesToLeafletCoordinates</a></li><li data-type='method'><a href="Geopicker.html#_dynamicMapAvailable">_dynamicMapAvailable</a></li><li data-type='method'><a href="Geopicker.html#_editPoint">_editPoint</a></li><li data-type='method'><a href="Geopicker.html#_enableDetection">_enableDetection</a></li><li data-type='method'><a href="Geopicker.html#_enableSearch">_enableSearch</a></li><li data-type='method'><a href="Geopicker.html#_getBaseLayers">_getBaseLayers</a></li><li data-type='method'><a href="Geopicker.html#_getDefaultLayer">_getDefaultLayer</a></li><li data-type='method'><a href="Geopicker.html#_getGoogleTileLayer">_getGoogleTileLayer</a></li><li data-type='method'><a href="Geopicker.html#_getLayers">_getLayers</a></li><li data-type='method'><a href="Geopicker.html#_getLeafletTileLayer">_getLeafletTileLayer</a></li><li data-type='method'><a href="Geopicker.html#_getProps">_getProps</a></li><li data-type='method'><a href="Geopicker.html#_getTileOptions">_getTileOptions</a></li><li data-type='method'><a href="Geopicker.html#_inFullScreenMode">_inFullScreenMode</a></li><li data-type='method'><a href="Geopicker.html#_init">_init</a></li><li data-type='method'><a href="Geopicker.html#_isValidGeopoint">_isValidGeopoint</a></li><li data-type='method'><a href="Geopicker.html#_isValidLatLng">_isValidLatLng</a></li><li data-type='method'><a href="Geopicker.html#_isValidLatLngList">_isValidLatLngList</a></li><li data-type='method'><a href="Geopicker.html#_loadGoogleMapsScript">_loadGoogleMapsScript</a></li><li data-type='method'><a href="Geopicker.html#_markAsInvalid">_markAsInvalid</a></li><li data-type='method'><a href="Geopicker.html#_markAsValid">_markAsValid</a></li><li data-type='method'><a href="Geopicker.html#_removePoint">_removePoint</a></li><li data-type='method'><a href="Geopicker.html#_setCurrent">_setCurrent</a></li><li data-type='method'><a href="Geopicker.html#_showIntersectError">_showIntersectError</a></li><li data-type='method'><a href="Geopicker.html#_switchInputType">_switchInputType</a></li><li data-type='method'><a href="Geopicker.html#_updateArea">_updateArea</a></li><li data-type='method'><a href="Geopicker.html#_updateDynamicMapView">_updateDynamicMapView</a></li><li data-type='method'><a href="Geopicker.html#_updateInputs">_updateInputs</a></li><li data-type='method'><a href="Geopicker.html#_updateMap">_updateMap</a></li><li data-type='method'><a href="Geopicker.html#_updateMarkers">_updateMarkers</a></li><li data-type='method'><a href="Geopicker.html#_updatePolygon">_updatePolygon</a></li><li data-type='method'><a href="Geopicker.html#_updatePolyline">_updatePolyline</a></li><li data-type='method'><a href="Geopicker.html#_updateValue">_updateValue</a></li><li data-type='method'><a href="Geopicker.html#containsEmptyPoints">containsEmptyPoints</a></li><li data-type='method'><a href="Geopicker.html#disable">disable</a></li><li data-type='method'><a href="Geopicker.html#enable">enable</a></li><li data-type='method'><a href="Geopicker.html#update">update</a></li><li data-type='method'><a href="Geopicker.html#updatedPolylineWouldIntersect">updatedPolylineWouldIntersect</a></li></ul></li><li><a href="ImageMap.html">ImageMap</a><ul class='members'><li data-type='member'><a href="ImageMap.html#.selector">selector</a></li><li data-type='member'><a href="ImageMap.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="ImageMap.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="ImageMap.html#props">props</a></li><li data-type='member'><a href="ImageMap.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="ImageMap.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="ImageMap.html#_addFunctionality">_addFunctionality</a></li><li data-type='method'><a href="ImageMap.html#_addMarkup">_addMarkup</a></li><li data-type='method'><a href="ImageMap.html#_getInput">_getInput</a></li><li data-type='method'><a href="ImageMap.html#_getProps">_getProps</a></li><li data-type='method'><a href="ImageMap.html#_init">_init</a></li><li data-type='method'><a href="ImageMap.html#_isSvgDoc">_isSvgDoc</a></li><li data-type='method'><a href="ImageMap.html#_removeUnmatchedIds">_removeUnmatchedIds</a></li><li data-type='method'><a href="ImageMap.html#_setChangeHandler">_setChangeHandler</a></li><li data-type='method'><a href="ImageMap.html#_setHoverHandler">_setHoverHandler</a></li><li data-type='method'><a href="ImageMap.html#_setPageHandler">_setPageHandler</a></li><li data-type='method'><a href="ImageMap.html#_setSvgClickHandler">_setSvgClickHandler</a></li><li data-type='method'><a href="ImageMap.html#_showSvgNotFoundError">_showSvgNotFoundError</a></li><li data-type='method'><a href="ImageMap.html#_updateImage">_updateImage</a></li><li data-type='method'><a href="ImageMap.html#disable">disable</a></li><li data-type='method'><a href="ImageMap.html#enable">enable</a></li><li data-type='method'><a href="ImageMap.html#update">update</a></li></ul></li><li><a href="ImageViewer.html">ImageViewer</a><ul class='members'><li data-type='member'><a href="ImageViewer.html#.selector">selector</a></li><li data-type='member'><a href="ImageViewer.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="ImageViewer.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="ImageViewer.html#props">props</a></li><li data-type='member'><a href="ImageViewer.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="ImageViewer.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="ImageViewer.html#_getProps">_getProps</a></li><li data-type='method'><a href="ImageViewer.html#_init">_init</a></li><li data-type='method'><a href="ImageViewer.html#disable">disable</a></li><li data-type='method'><a href="ImageViewer.html#enable">enable</a></li><li data-type='method'><a href="ImageViewer.html#update">update</a></li></ul></li><li><a href="LikertItem.html">LikertItem</a></li><li><a href="MediaPicker.html">MediaPicker</a><ul class='members'><li data-type='member'><a href="MediaPicker.html#.selector">selector</a></li><li data-type='member'><a href="MediaPicker.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="MediaPicker.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="MediaPicker.html#props">props</a></li><li data-type='member'><a href="MediaPicker.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="MediaPicker.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="MediaPicker.html#_getProps">_getProps</a></li><li data-type='method'><a href="MediaPicker.html#_init">_init</a></li><li data-type='method'><a href="MediaPicker.html#disable">disable</a></li><li data-type='method'><a href="MediaPicker.html#enable">enable</a></li><li data-type='method'><a href="MediaPicker.html#update">update</a></li></ul></li><li><a href="MobileSelectPicker.html">MobileSelectPicker</a><ul class='members'><li data-type='member'><a href="MobileSelectPicker.html#.selector">selector</a></li><li data-type='member'><a href="MobileSelectPicker.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="MobileSelectPicker.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="MobileSelectPicker.html#props">props</a></li><li data-type='member'><a href="MobileSelectPicker.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="MobileSelectPicker.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="MobileSelectPicker.html#.condition">condition</a></li><li data-type='method'><a href="MobileSelectPicker.html#_getProps">_getProps</a></li><li data-type='method'><a href="MobileSelectPicker.html#_init">_init</a></li><li data-type='method'><a href="MobileSelectPicker.html#_showSelectedValues">_showSelectedValues</a></li><li data-type='method'><a href="MobileSelectPicker.html#disable">disable</a></li><li data-type='method'><a href="MobileSelectPicker.html#enable">enable</a></li><li data-type='method'><a href="MobileSelectPicker.html#update">update</a></li></ul></li><li><a href="module-widgets-controller-Collection.html">widgets-controller~Collection</a><ul class='methods'><li data-type='method'><a href="module-widgets-controller-Collection.html#_instantiateSingleWidget">_instantiateSingleWidget</a></li><li data-type='method'><a href="module-widgets-controller-Collection.html#_methodCall">_methodCall</a></li><li data-type='method'><a href="module-widgets-controller-Collection.html#disable">disable</a></li><li data-type='method'><a href="module-widgets-controller-Collection.html#enable">enable</a></li><li data-type='method'><a href="module-widgets-controller-Collection.html#instantiate">instantiate</a></li><li data-type='method'><a href="module-widgets-controller-Collection.html#update">update</a></li></ul></li><li><a href="MyWidget.html">MyWidget</a><ul class='members'><li data-type='member'><a href="MyWidget.html#.selector">selector</a></li><li data-type='member'><a href="MyWidget.html#value">value</a></li><li data-type='member'><a href="MyWidget.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="MyWidget.html#_init">_init</a></li><li data-type='method'><a href="MyWidget.html#disable">disable</a></li><li data-type='method'><a href="MyWidget.html#enable">enable</a></li><li data-type='method'><a href="MyWidget.html#update">update</a></li></ul></li><li><a href="Nodeset.html">Nodeset</a><ul class='methods'><li data-type='method'><a href="Nodeset.html#convert">convert</a></li><li data-type='method'><a href="Nodeset.html#getClosestRepeat">getClosestRepeat</a></li><li data-type='method'><a href="Nodeset.html#getElement">getElement</a></li><li data-type='method'><a href="Nodeset.html#getElements">getElements</a></li><li data-type='method'><a href="Nodeset.html#getVal">getVal</a></li><li data-type='method'><a href="Nodeset.html#isRequired">isRequired</a></li><li data-type='method'><a href="Nodeset.html#remove">remove</a></li><li data-type='method'><a href="Nodeset.html#setIndex">setIndex</a></li><li data-type='method'><a href="Nodeset.html#setVal">setVal</a></li><li data-type='method'><a href="Nodeset.html#validate">validate</a></li><li data-type='method'><a href="Nodeset.html#validateConstraintAndType">validateConstraintAndType</a></li><li data-type='method'><a href="Nodeset.html#validateRequired">validateRequired</a></li></ul></li><li><a href="NoteWidget.html">NoteWidget</a></li><li><a href="Radiopicker.html">Radiopicker</a><ul class='members'><li data-type='member'><a href="Radiopicker.html#.selector">selector</a></li><li data-type='member'><a href="Radiopicker.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="Radiopicker.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="Radiopicker.html#props">props</a></li><li data-type='member'><a href="Radiopicker.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="Radiopicker.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="Radiopicker.html#_getProps">_getProps</a></li><li data-type='method'><a href="Radiopicker.html#_init">_init</a></li><li data-type='method'><a href="Radiopicker.html#_updateDataChecked">_updateDataChecked</a></li><li data-type='method'><a href="Radiopicker.html#disable">disable</a></li><li data-type='method'><a href="Radiopicker.html#enable">enable</a></li><li data-type='method'><a href="Radiopicker.html#update">update</a></li></ul></li><li><a href="RangeWidget.html">RangeWidget</a><ul class='members'><li data-type='member'><a href="RangeWidget.html#.selector">selector</a></li><li data-type='member'><a href="RangeWidget.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="RangeWidget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="RangeWidget.html#props">props</a></li><li data-type='member'><a href="RangeWidget.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="RangeWidget.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="RangeWidget.html#_getHtmlStr">_getHtmlStr</a></li><li data-type='method'><a href="RangeWidget.html#_getProps">_getProps</a></li><li data-type='method'><a href="RangeWidget.html#_init">_init</a></li><li data-type='method'><a href="RangeWidget.html#_reset">_reset</a></li><li data-type='method'><a href="RangeWidget.html#_stepsBetweenHtmlStr">_stepsBetweenHtmlStr</a></li><li data-type='method'><a href="RangeWidget.html#_updateMercury">_updateMercury</a></li><li data-type='method'><a href="RangeWidget.html#disable">disable</a></li><li data-type='method'><a href="RangeWidget.html#enable">enable</a></li><li data-type='method'><a href="RangeWidget.html#update">update</a></li></ul></li><li><a href="RankWidget.html">RankWidget</a><ul class='members'><li data-type='member'><a href="RankWidget.html#.list">list</a></li><li data-type='member'><a href="RankWidget.html#.selector">selector</a></li><li data-type='member'><a href="RankWidget.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="RankWidget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="RankWidget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="RankWidget.html#props">props</a></li><li data-type='member'><a href="RankWidget.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="RankWidget.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="RankWidget.html#_getProps">_getProps</a></li><li data-type='method'><a href="RankWidget.html#_init">_init</a></li><li data-type='method'><a href="RankWidget.html#_reset">_reset</a></li><li data-type='method'><a href="RankWidget.html#disable">disable</a></li><li data-type='method'><a href="RankWidget.html#enable">enable</a></li><li data-type='method'><a href="RankWidget.html#update">update</a></li></ul></li><li><a href="RatingWidget.html">RatingWidget</a><ul class='members'><li data-type='member'><a href="RatingWidget.html#.selector">selector</a></li><li data-type='member'><a href="RatingWidget.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="RatingWidget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="RatingWidget.html#props">props</a></li><li data-type='member'><a href="RatingWidget.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="RatingWidget.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="RatingWidget.html#_getHtmlStr">_getHtmlStr</a></li><li data-type='method'><a href="RatingWidget.html#_getProps">_getProps</a></li><li data-type='method'><a href="RatingWidget.html#_init">_init</a></li><li data-type='method'><a href="RatingWidget.html#_reset">_reset</a></li><li data-type='method'><a href="RatingWidget.html#_stepsBetweenHtmlStr">_stepsBetweenHtmlStr</a></li><li data-type='method'><a href="RatingWidget.html#_updateMercury">_updateMercury</a></li><li data-type='method'><a href="RatingWidget.html#disable">disable</a></li><li data-type='method'><a href="RatingWidget.html#enable">enable</a></li><li data-type='method'><a href="RatingWidget.html#update">update</a></li></ul></li><li><a href="TableWidget.html">TableWidget</a></li><li><a href="TextareaWidget.html">TextareaWidget</a><ul class='members'><li data-type='member'><a href="TextareaWidget.html#.selector">selector</a></li><li data-type='member'><a href="TextareaWidget.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="TextareaWidget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="TextareaWidget.html#props">props</a></li><li data-type='member'><a href="TextareaWidget.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="TextareaWidget.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="TextareaWidget.html#_getProps">_getProps</a></li><li data-type='method'><a href="TextareaWidget.html#_init">_init</a></li><li data-type='method'><a href="TextareaWidget.html#disable">disable</a></li><li data-type='method'><a href="TextareaWidget.html#enable">enable</a></li><li data-type='method'><a href="TextareaWidget.html#update">update</a></li></ul></li><li><a href="TextMaxWidget.html">TextMaxWidget</a><ul class='members'><li data-type='member'><a href="TextMaxWidget.html#.selector">selector</a></li></ul></li><li><a href="TextPrintWidget.html">TextPrintWidget</a><ul class='members'><li data-type='member'><a href="TextPrintWidget.html#.selector">selector</a></li></ul></li><li><a href="ThousandsSeparatorWidget.html">ThousandsSeparatorWidget</a><ul class='methods'><li data-type='method'><a href="ThousandsSeparatorWidget.html#_init">_init</a></li><li data-type='method'><a href="ThousandsSeparatorWidget.html#update">update</a></li></ul></li><li><a href="TimepickerExtended.html">TimepickerExtended</a><ul class='members'><li data-type='member'><a href="TimepickerExtended.html#.selector">selector</a></li><li data-type='member'><a href="TimepickerExtended.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="TimepickerExtended.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="TimepickerExtended.html#props">props</a></li><li data-type='member'><a href="TimepickerExtended.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="TimepickerExtended.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="TimepickerExtended.html#.condition">condition</a></li><li data-type='method'><a href="TimepickerExtended.html#_getProps">_getProps</a></li><li data-type='method'><a href="TimepickerExtended.html#_init">_init</a></li><li data-type='method'><a href="TimepickerExtended.html#_reset">_reset</a></li><li data-type='method'><a href="TimepickerExtended.html#disable">disable</a></li><li data-type='method'><a href="TimepickerExtended.html#enable">enable</a></li><li data-type='method'><a href="TimepickerExtended.html#update">update</a></li></ul></li><li><a href="TranslatedError.html">TranslatedError</a></li><li><a href="UrlWidget.html">UrlWidget</a><ul class='members'><li data-type='member'><a href="UrlWidget.html#.selector">selector</a></li><li data-type='member'><a href="UrlWidget.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="UrlWidget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="UrlWidget.html#props">props</a></li><li data-type='member'><a href="UrlWidget.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="UrlWidget.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="UrlWidget.html#_getProps">_getProps</a></li><li data-type='method'><a href="UrlWidget.html#_init">_init</a></li><li data-type='method'><a href="UrlWidget.html#disable">disable</a></li><li data-type='method'><a href="UrlWidget.html#enable">enable</a></li><li data-type='method'><a href="UrlWidget.html#update">update</a></li></ul></li><li><a href="Widget.html">Widget</a><ul class='members'><li data-type='member'><a href="Widget.html#.list">list</a></li><li data-type='member'><a href="Widget.html#.name">name</a></li><li data-type='member'><a href="Widget.html#downloadButtonHtml">downloadButtonHtml</a></li><li data-type='member'><a href="Widget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="Widget.html#originalInputValue">originalInputValue</a></li><li data-type='member'><a href="Widget.html#props">props</a></li><li data-type='member'><a href="Widget.html#resetButtonHtml">resetButtonHtml</a></li><li data-type='member'><a href="Widget.html#value">value</a></li><li data-type='member'><a href="Widget.html#value">value</a></li></ul><ul class='methods'><li data-type='method'><a href="Widget.html#.condition">condition</a></li><li data-type='method'><a href="Widget.html#_getProps">_getProps</a></li><li data-type='method'><a href="Widget.html#_init">_init</a></li><li data-type='method'><a href="Widget.html#disable">disable</a></li><li data-type='method'><a href="Widget.html#enable">enable</a></li><li data-type='method'><a href="Widget.html#update">update</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-calculate.html">calculate</a><ul class='methods'><li data-type='method'><a href="module-calculate.html#._getNodesForAction">_getNodesForAction</a></li><li data-type='method'><a href="module-calculate.html#._isRelevant">_isRelevant</a></li><li data-type='method'><a href="module-calculate.html#._updateCalc">_updateCalc</a></li><li data-type='method'><a href="module-calculate.html#._updateValue">_updateValue</a></li><li data-type='method'><a href="module-calculate.html#.performAction">performAction</a></li><li data-type='method'><a href="module-calculate.html#.update">update</a></li></ul></li><li><a href="module-dialog.html">dialog</a><ul class='methods'><li data-type='method'><a href="module-dialog.html#.alert">alert</a></li><li data-type='method'><a href="module-dialog.html#.confirm">confirm</a></li><li data-type='method'><a href="module-dialog.html#.prompt">prompt</a></li></ul></li><li><a href="module-dom-utils.html">dom-utils</a><ul class='members'><li data-type='member'><a href="module-dom-utils.html#.elementDataStore">elementDataStore</a></li></ul><ul class='methods'><li data-type='method'><a href="module-dom-utils.html#.closestAncestorUntil">closestAncestorUntil</a></li><li data-type='method'><a href="module-dom-utils.html#.empty">empty</a></li><li data-type='method'><a href="module-dom-utils.html#.getAncestors">getAncestors</a></li><li data-type='method'><a href="module-dom-utils.html#.getSiblingElements">getSiblingElements</a></li><li data-type='method'><a href="module-dom-utils.html#.getSiblingElementsAndSelf">getSiblingElementsAndSelf</a></li><li data-type='method'><a href="module-dom-utils.html#~_getSiblingElements">_getSiblingElements</a></li><li data-type='method'><a href="module-dom-utils.html#~getChild">getChild</a></li><li data-type='method'><a href="module-dom-utils.html#~getChildren">getChildren</a></li><li data-type='method'><a href="module-dom-utils.html#~getRepeatIndex">getRepeatIndex</a></li><li data-type='method'><a href="module-dom-utils.html#~getSiblingElement">getSiblingElement</a></li><li data-type='method'><a href="module-dom-utils.html#~getXPath">getXPath</a></li><li data-type='method'><a href="module-dom-utils.html#~hasNextSiblingElementSameName">hasNextSiblingElementSameName</a></li><li data-type='method'><a href="module-dom-utils.html#~hasPreviousCommentSiblingWithContent">hasPreviousCommentSiblingWithContent</a></li><li data-type='method'><a href="module-dom-utils.html#~hasPreviousSiblingElementSameName">hasPreviousSiblingElementSameName</a></li><li data-type='method'><a href="module-dom-utils.html#~hasSiblingElementSameName">hasSiblingElementSameName</a></li></ul></li><li><a href="module-event.html">event</a><ul class='methods'><li data-type='method'><a href="module-event.html#.DataUpdate">DataUpdate</a></li><li data-type='method'><a href="module-event.html#~AddRepeat">AddRepeat</a></li><li data-type='method'><a href="module-event.html#~ApplyFocus">ApplyFocus</a></li><li data-type='method'><a href="module-event.html#~BeforeSave">BeforeSave</a></li><li data-type='method'><a href="module-event.html#~Change">Change</a></li><li data-type='method'><a href="module-event.html#~ChangeLanguage">ChangeLanguage</a></li><li data-type='method'><a href="module-event.html#~DePrintify">DePrintify</a></li><li data-type='method'><a href="module-event.html#~Edited">Edited</a></li><li data-type='method'><a href="module-event.html#~FakeFocus">FakeFocus</a></li><li data-type='method'><a href="module-event.html#~GoToInvisible">GoToInvisible</a></li><li data-type='method'><a href="module-event.html#~GoToIrrelevant">GoToIrrelevant</a></li><li data-type='method'><a href="module-event.html#~Input">Input</a></li><li data-type='method'><a href="module-event.html#~InputUpdate">InputUpdate</a></li><li data-type='method'><a href="module-event.html#~InstanceFirstLoad">InstanceFirstLoad</a></li><li data-type='method'><a href="module-event.html#~Invalidated">Invalidated</a></li><li data-type='method'><a href="module-event.html#~NewRepeat">NewRepeat</a></li><li data-type='method'><a href="module-event.html#~PageFlip">PageFlip</a></li><li data-type='method'><a href="module-event.html#~Printify">Printify</a></li><li data-type='method'><a href="module-event.html#~ProgressUpdate">ProgressUpdate</a></li><li data-type='method'><a href="module-event.html#~Removed">Removed</a></li><li data-type='method'><a href="module-event.html#~RemoveRepeat">RemoveRepeat</a></li><li data-type='method'><a href="module-event.html#~ValidationComplete">ValidationComplete</a></li><li data-type='method'><a href="module-event.html#~XFormsValueChanged">XFormsValueChanged</a></li></ul></li><li><a href="module-fake-translator.html">fake-translator</a><ul class='methods'><li data-type='method'><a href="module-fake-translator.html#.t">t</a></li></ul></li><li><a href="module-fileManager.html">fileManager</a><ul class='methods'><li data-type='method'><a href="module-fileManager.html#.getCurrentFiles">getCurrentFiles</a></li><li data-type='method'><a href="module-fileManager.html#.getFileUrl">getFileUrl</a></li><li data-type='method'><a href="module-fileManager.html#.getMaxSizeReadable">getMaxSizeReadable</a></li><li data-type='method'><a href="module-fileManager.html#.getObjectUrl">getObjectUrl</a></li><li data-type='method'><a href="module-fileManager.html#.init">init</a></li><li data-type='method'><a href="module-fileManager.html#.isTooLarge">isTooLarge</a></li><li data-type='method'><a href="module-fileManager.html#.isWaitingForPermissions">isWaitingForPermissions</a></li><li data-type='method'><a href="module-fileManager.html#.urlToBlob">urlToBlob</a></li></ul></li><li><a href="module-format.html">format</a><ul class='methods'><li data-type='method'><a href="module-format.html#~_cleanSpecialChars">_cleanSpecialChars</a></li><li data-type='method'><a href="module-format.html#~_getCleanLocalTime">_getCleanLocalTime</a></li></ul></li><li><a href="module-input.html">input</a><ul class='methods'><li data-type='method'><a href="module-input.html#.clear">clear</a></li><li data-type='method'><a href="module-input.html#.find">find</a></li><li data-type='method'><a href="module-input.html#.getCalculation">getCalculation</a></li><li data-type='method'><a href="module-input.html#.getConstraint">getConstraint</a></li><li data-type='method'><a href="module-input.html#.getIndex">getIndex</a></li><li data-type='method'><a href="module-input.html#.getInputType">getInputType</a></li><li data-type='method'><a href="module-input.html#.getName">getName</a></li><li data-type='method'><a href="module-input.html#.getProps">getProps</a></li><li data-type='method'><a href="module-input.html#.getReadonly">getReadonly</a></li><li data-type='method'><a href="module-input.html#.getRelevant">getRelevant</a></li><li data-type='method'><a href="module-input.html#.getRequired">getRequired</a></li><li data-type='method'><a href="module-input.html#.getVal">getVal</a></li><li data-type='method'><a href="module-input.html#.getWrapNode">getWrapNode</a></li><li data-type='method'><a href="module-input.html#.getWrapNodes">getWrapNodes</a></li><li data-type='method'><a href="module-input.html#.getXmlType">getXmlType</a></li><li data-type='method'><a href="module-input.html#.isEnabled">isEnabled</a></li><li data-type='method'><a href="module-input.html#.isMultiple">isMultiple</a></li><li data-type='method'><a href="module-input.html#.setVal">setVal</a></li><li data-type='method'><a href="module-input.html#.validate">validate</a></li></ul></li><li><a href="module-itemset.html">itemset</a><ul class='methods'><li data-type='method'><a href="module-itemset.html#.createInput">createInput</a></li><li data-type='method'><a href="module-itemset.html#.createOption">createOption</a></li><li data-type='method'><a href="module-itemset.html#.createOptionTranslation">createOptionTranslation</a></li><li data-type='method'><a href="module-itemset.html#.getNodeFromItem">getNodeFromItem</a></li><li data-type='method'><a href="module-itemset.html#.getNodesFromItem">getNodesFromItem</a></li><li data-type='method'><a href="module-itemset.html#.isStaticItemsetFromSecondaryInstance">isStaticItemsetFromSecondaryInstance</a></li><li data-type='method'><a href="module-itemset.html#.update">update</a></li></ul></li><li><a href="module-language.html">language</a><ul class='members'><li data-type='member'><a href="module-language.html#.currentLangDesc">currentLangDesc</a></li><li data-type='member'><a href="module-language.html#.currentLanguage">currentLanguage</a></li><li data-type='member'><a href="module-language.html#.languagesUsed">languagesUsed</a></li></ul><ul class='methods'><li data-type='method'><a href="module-language.html#.init">init</a></li><li data-type='method'><a href="module-language.html#.setSelect">setSelect</a></li></ul></li><li><a href="module-mask.html">mask</a><ul class='methods'><li data-type='method'><a href="module-mask.html#._isKeyboardCutPaste">_isKeyboardCutPaste</a></li><li data-type='method'><a href="module-mask.html#._isNotPrintableKey">_isNotPrintableKey</a></li><li data-type='method'><a href="module-mask.html#._setNumberMask">_setNumberMask</a></li></ul></li><li><a href="module-output.html">output</a><ul class='methods'><li data-type='method'><a href="module-output.html#.update">update</a></li></ul></li><li><a href="module-pages.html">pages</a><ul class='members'><li data-type='member'><a href="module-pages.html#.active">active</a></li><li data-type='member'><a href="module-pages.html#.activePages">activePages</a></li><li data-type='member'><a href="module-pages.html#.current">current</a></li></ul><ul class='methods'><li data-type='method'><a href="module-pages.html#._flipTo">_flipTo</a></li><li data-type='method'><a href="module-pages.html#._flipToFirst">_flipToFirst</a></li><li data-type='method'><a href="module-pages.html#._flipToLast">_flipToLast</a></li><li data-type='method'><a href="module-pages.html#._focusOnFirstQuestion">_focusOnFirstQuestion</a></li><li data-type='method'><a href="module-pages.html#._getCurrent">_getCurrent</a></li><li data-type='method'><a href="module-pages.html#._getCurrentIndex">_getCurrentIndex</a></li><li data-type='method'><a href="module-pages.html#._getNext">_getNext</a></li><li data-type='method'><a href="module-pages.html#._getPrev">_getPrev</a></li><li data-type='method'><a href="module-pages.html#._next">_next</a></li><li data-type='method'><a href="module-pages.html#._pauseMultimedia">_pauseMultimedia</a></li><li data-type='method'><a href="module-pages.html#._prev">_prev</a></li><li data-type='method'><a href="module-pages.html#._setBranchHandlers">_setBranchHandlers</a></li><li data-type='method'><a href="module-pages.html#._setButtonHandlers">_setButtonHandlers</a></li><li data-type='method'><a href="module-pages.html#._setLangChangeHandlers">_setLangChangeHandlers</a></li><li data-type='method'><a href="module-pages.html#._setRepeatHandlers">_setRepeatHandlers</a></li><li data-type='method'><a href="module-pages.html#._setSwipeHandlers">_setSwipeHandlers</a></li><li data-type='method'><a href="module-pages.html#._setTocHandlers">_setTocHandlers</a></li><li data-type='method'><a href="module-pages.html#._setToCurrent">_setToCurrent</a></li><li data-type='method'><a href="module-pages.html#._toggleButtons">_toggleButtons</a></li><li data-type='method'><a href="module-pages.html#._updateAllActive">_updateAllActive</a></li><li data-type='method'><a href="module-pages.html#._updateToc">_updateToc</a></li><li data-type='method'><a href="module-pages.html#.flipToPageContaining">flipToPageContaining</a></li><li data-type='method'><a href="module-pages.html#.init">init</a></li></ul></li><li><a href="module-preloader.html">preloader</a><ul class='methods'><li data-type='method'><a href="module-preloader.html#.context">context</a></li><li data-type='method'><a href="module-preloader.html#.date">date</a></li><li data-type='method'><a href="module-preloader.html#.init">init</a></li><li data-type='method'><a href="module-preloader.html#.patient">patient</a></li><li data-type='method'><a href="module-preloader.html#.property">property</a></li><li data-type='method'><a href="module-preloader.html#.timestamp">timestamp</a></li><li data-type='method'><a href="module-preloader.html#.uid">uid</a></li><li data-type='method'><a href="module-preloader.html#.user">user</a></li></ul></li><li><a href="module-print.html">print</a><ul class='methods'><li data-type='method'><a href="module-print.html#.closeAllDetails">closeAllDetails</a></li><li data-type='method'><a href="module-print.html#.fixGrid">fixGrid</a></li><li data-type='method'><a href="module-print.html#.isGrid">isGrid</a></li><li data-type='method'><a href="module-print.html#.openAllDetails">openAllDetails</a></li><li data-type='method'><a href="module-print.html#.print">print</a></li><li data-type='method'><a href="module-print.html#.styleReset">styleReset</a></li><li data-type='method'><a href="module-print.html#.styleToAll">styleToAll</a></li><li data-type='method'><a href="module-print.html#~_resizeRowElements">_resizeRowElements</a></li><li data-type='method'><a href="module-print.html#~getPaperPixelWidth">getPaperPixelWidth</a></li><li data-type='method'><a href="module-print.html#~getPrintStyleSheet">getPrintStyleSheet</a></li><li data-type='method'><a href="module-print.html#~getPrintStyleSheetLink">getPrintStyleSheetLink</a></li><li data-type='method'><a href="module-print.html#~setDpi">setDpi</a></li></ul></li><li><a href="module-progress.html">progress</a><ul class='members'><li data-type='member'><a href="module-progress.html#.all">all</a></li><li data-type='member'><a href="module-progress.html#.lastChanged">lastChanged</a></li><li data-type='member'><a href="module-progress.html#.status">status</a></li></ul><ul class='methods'><li data-type='method'><a href="module-progress.html#.get">get</a></li><li data-type='method'><a href="module-progress.html#.update">update</a></li><li data-type='method'><a href="module-progress.html#.updateTotal">updateTotal</a></li></ul></li><li><a href="module-readonly.html">readonly</a><ul class='methods'><li data-type='method'><a href="module-readonly.html#.update">update</a></li></ul></li><li><a href="module-relevant.html">relevant</a><ul class='members'><li data-type='member'><a href="module-relevant.html#.getNonRelevantValue">getNonRelevantValue</a></li><li data-type='member'><a href="module-relevant.html#.isNodeRelevant">isNodeRelevant</a></li><li data-type='member'><a href="module-relevant.html#.setNonRelevantValue">setNonRelevantValue</a></li><li data-type='member'><a href="module-relevant.html#~relevanceState">relevanceState</a></li></ul><ul class='methods'><li data-type='method'><a href="module-relevant.html#.activate">activate</a></li><li data-type='method'><a href="module-relevant.html#.clear">clear</a></li><li data-type='method'><a href="module-relevant.html#.deactivate">deactivate</a></li><li data-type='method'><a href="module-relevant.html#.disable">disable</a></li><li data-type='method'><a href="module-relevant.html#.enable">enable</a></li><li data-type='method'><a href="module-relevant.html#.evaluate">evaluate</a></li><li data-type='method'><a href="module-relevant.html#.process">process</a></li><li data-type='method'><a href="module-relevant.html#.selfRelevant">selfRelevant</a></li><li data-type='method'><a href="module-relevant.html#.setDisabledProperty">setDisabledProperty</a></li><li data-type='method'><a href="module-relevant.html#.toggleNonRelevantModelNodes">toggleNonRelevantModelNodes</a></li><li data-type='method'><a href="module-relevant.html#.update">update</a></li><li data-type='method'><a href="module-relevant.html#.updateNodes">updateNodes</a></li></ul></li><li><a href="module-repeat.html">repeat</a><ul class='methods'><li data-type='method'><a href="module-repeat.html#.add">add</a></li><li data-type='method'><a href="module-repeat.html#.countUpdate">countUpdate</a></li><li data-type='method'><a href="module-repeat.html#.init">init</a></li><li data-type='method'><a href="module-repeat.html#.updateDefaultFirstRepeatInstance">updateDefaultFirstRepeatInstance</a></li><li data-type='method'><a href="module-repeat.html#.updateRepeatInstancesFromCount">updateRepeatInstancesFromCount</a></li><li data-type='method'><a href="module-repeat.html#.updateViewInstancesFromModel">updateViewInstancesFromModel</a></li></ul></li><li><a href="module-required.html">required</a><ul class='methods'><li data-type='method'><a href="module-required.html#.update">update</a></li></ul></li><li><a href="module-sniffer.html">sniffer</a></li><li><a href="module-support.html">support</a><ul class='members'><li data-type='member'><a href="module-support.html#.inputTypes">inputTypes</a></li><li data-type='member'><a href="module-support.html#.touch">touch</a></li></ul></li><li><a href="module-toc.html">toc</a><ul class='members'><li data-type='member'><a href="module-toc.html#._maxTocLevel">_maxTocLevel</a></li><li data-type='member'><a href="module-toc.html#.tocItems">tocItems</a></li></ul><ul class='methods'><li data-type='method'><a href="module-toc.html#._buildTocHtmlList">_buildTocHtmlList</a></li><li data-type='method'><a href="module-toc.html#._getTitle">_getTitle</a></li><li data-type='method'><a href="module-toc.html#.generateTocItems">generateTocItems</a></li><li data-type='method'><a href="module-toc.html#.getHtmlFragment">getHtmlFragment</a></li></ul></li><li><a href="module-types.html">types</a></li><li><a href="module-utils.html">utils</a><ul class='methods'><li data-type='method'><a href="module-utils.html#.dataUriToBlobSync">dataUriToBlobSync</a></li><li data-type='method'><a href="module-utils.html#.getFilename">getFilename</a></li><li data-type='method'><a href="module-utils.html#.getPasteData">getPasteData</a></li><li data-type='method'><a href="module-utils.html#.isNumber">isNumber</a></li><li data-type='method'><a href="module-utils.html#.parseFunctionFromExpression">parseFunctionFromExpression</a></li><li data-type='method'><a href="module-utils.html#.readCookie">readCookie</a></li><li data-type='method'><a href="module-utils.html#.resizeImage">resizeImage</a></li><li data-type='method'><a href="module-utils.html#.stripQuotes">stripQuotes</a></li><li data-type='method'><a href="module-utils.html#~joinPath">joinPath</a></li></ul></li><li><a href="module-widgets.html">widgets</a></li><li><a href="module-widgets-controller.html">widgets-controller</a><ul class='methods'><li data-type='method'><a href="module-widgets-controller.html#.disable">disable</a></li><li data-type='method'><a href="module-widgets-controller.html#.enable">enable</a></li><li data-type='method'><a href="module-widgets-controller.html#.init">init</a></li><li data-type='method'><a href="module-widgets-controller.html#~_getElements">_getElements</a></li><li data-type='method'><a href="module-widgets-controller.html#~_instantiate">_instantiate</a></li><li data-type='method'><a href="module-widgets-controller.html#~_setLangChangeListener">_setLangChangeListener</a></li><li data-type='method'><a href="module-widgets-controller.html#~_setOptionChangeListener">_setOptionChangeListener</a></li><li data-type='method'><a href="module-widgets-controller.html#~_setValChangeListener">_setValChangeListener</a></li></ul></li></ul><h3>Externals</h3><ul><li><a href="external-ConstructorParameters.html">external:ConstructorParameters</a></li><li><a href="external-Exclude.html">external:Exclude</a></li><li><a href="external-Extract.html">external:Extract</a></li><li><a href="external-InstanceType.html">external:InstanceType</a></li><li><a href="external-jQuery.html">external:jQuery</a><ul class='methods'><li data-type='method'><a href="external-jQuery.html#reverse">reverse</a></li></ul></li><li><a href="external-NonNullable.html">external:NonNullable</a></li><li><a href="external-Omit.html">external:Omit</a></li><li><a href="external-OmitThisParameter.html">external:OmitThisParameter</a></li><li><a href="external-Parameters.html">external:Parameters</a></li><li><a href="external-Partial.html">external:Partial</a></li><li><a href="external-Pick.html">external:Pick</a></li><li><a href="external-Readonly.html">external:Readonly</a></li><li><a href="external-Record.html">external:Record</a></li><li><a href="external-Required.html">external:Required</a></li><li><a href="external-ReturnType.html">external:ReturnType</a></li><li><a href="external-SignaturePad.html">external:SignaturePad</a><ul class='methods'><li data-type='method'><a href="external-SignaturePad.html#fromObjectURL">fromObjectURL</a></li><li data-type='method'><a href="external-SignaturePad.html#updateData">updateData</a></li></ul></li><li><a href="external-ThisParameterType.html">external:ThisParameterType</a></li><li><a href="external-ThisType.html">external:ThisType</a></li></ul><h3>Namespaces</h3><ul><li><a href="module-dom-utils-elementDataStore.html">dom-utils~elementDataStore</a><ul class='members'><li data-type='member'><a href="module-dom-utils-elementDataStore.html#._storage">_storage</a></li></ul><ul class='methods'><li data-type='method'><a href="module-dom-utils-elementDataStore.html#.get">get</a></li><li data-type='method'><a href="module-dom-utils-elementDataStore.html#.has">has</a></li><li data-type='method'><a href="module-dom-utils-elementDataStore.html#.put">put</a></li><li data-type='method'><a href="module-dom-utils-elementDataStore.html#.remove">remove</a></li></ul></li><li><a href="module-format-format.html">format~format</a></li><li><a href="module-format-time.html">format~time</a><ul class='members'><li data-type='member'><a href="module-format-time.html#.amNotation">amNotation</a></li><li data-type='member'><a href="module-format-time.html#.hour12">hour12</a></li><li data-type='member'><a href="module-format-time.html#.pmNotation">pmNotation</a></li></ul><ul class='methods'><li data-type='method'><a href="module-format-time.html#.hasMeridian">hasMeridian</a></li><li data-type='method'><a href="module-format-time.html#.meridianNotation">meridianNotation</a></li></ul></li><li><a href="module-sniffer-browser.html">sniffer~browser</a><ul class='members'><li data-type='member'><a href="module-sniffer-browser.html#.safari">safari</a></li></ul></li><li><a href="module-sniffer-os.html">sniffer~os</a><ul class='members'><li data-type='member'><a href="module-sniffer-os.html#.android">android</a></li><li data-type='member'><a href="module-sniffer-os.html#.ios">ios</a></li><li data-type='member'><a href="module-sniffer-os.html#.macos">macos</a></li></ul></li><li><a href="module-types-types.html">types~types</a></li><li><a href="module-types-types.barcode.html">types~types.barcode</a><ul class='methods'><li data-type='method'><a href="module-types-types.barcode.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.binary.html">types~types.binary</a><ul class='methods'><li data-type='method'><a href="module-types-types.binary.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.date.html">types~types.date</a><ul class='methods'><li data-type='method'><a href="module-types-types.date.html#.convert">convert</a></li><li data-type='method'><a href="module-types-types.date.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.datetime.html">types~types.datetime</a><ul class='methods'><li data-type='method'><a href="module-types-types.datetime.html#.convert">convert</a></li><li data-type='method'><a href="module-types-types.datetime.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.decimal.html">types~types.decimal</a><ul class='methods'><li data-type='method'><a href="module-types-types.decimal.html#.convert">convert</a></li><li data-type='method'><a href="module-types-types.decimal.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.geopoint.html">types~types.geopoint</a><ul class='methods'><li data-type='method'><a href="module-types-types.geopoint.html#.convert">convert</a></li><li data-type='method'><a href="module-types-types.geopoint.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.geoshape.html">types~types.geoshape</a><ul class='methods'><li data-type='method'><a href="module-types-types.geoshape.html#.convert">convert</a></li><li data-type='method'><a href="module-types-types.geoshape.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.geotrace.html">types~types.geotrace</a><ul class='methods'><li data-type='method'><a href="module-types-types.geotrace.html#.convert">convert</a></li><li data-type='method'><a href="module-types-types.geotrace.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.int.html">types~types.int</a><ul class='methods'><li data-type='method'><a href="module-types-types.int.html#.convert">convert</a></li><li data-type='method'><a href="module-types-types.int.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.select.html">types~types.select</a><ul class='methods'><li data-type='method'><a href="module-types-types.select.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.select1.html">types~types.select1</a><ul class='methods'><li data-type='method'><a href="module-types-types.select1.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.string.html">types~types.string</a><ul class='methods'><li data-type='method'><a href="module-types-types.string.html#.convert">convert</a></li><li data-type='method'><a href="module-types-types.string.html#.validate">validate</a></li></ul></li><li><a href="module-types-types.time.html">types~types.time</a><ul class='methods'><li data-type='method'><a href="module-types-types.time.html#.convert">convert</a></li><li data-type='method'><a href="module-types-types.time.html#.convertMeridian">convertMeridian</a></li><li data-type='method'><a href="module-types-types.time.html#.validate">validate</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#callOnIdle">callOnIdle</a></li><li><a href="global.html#ExternalInstance">ExternalInstance</a></li><li><a href="global.html#FormDataObj">FormDataObj</a></li><li><a href="global.html#FormOptions">FormOptions</a></li><li><a href="global.html#GeolocationPosition">GeolocationPosition</a></li><li><a href="global.html#getCurrentPosition">getCurrentPosition</a></li><li><a href="global.html#jQuery">jQuery</a></li><li><a href="global.html#LatLngArray">LatLngArray</a></li><li><a href="global.html#LatLngObj">LatLngObj</a></li><li><a href="global.html#NodesetFilter">NodesetFilter</a></li><li><a href="global.html#OnIdle">OnIdle</a></li><li><a href="global.html#onIdle">onIdle</a></li><li><a href="global.html#UpdatedDataNodes">UpdatedDataNodes</a></li><li><a href="global.html#updateDownloadLink">updateDownloadLink</a></li><li><a href="global.html#ValidateInputResolution">ValidateInputResolution</a></li><li><a href="global.html#xpath-evaluator-binding">xpath-evaluator-binding</a></li></ul>
</nav>
<div id="main">
<h1 class="page-title">js/form-model.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>import MergeXML from 'mergexml/mergexml';
import config from 'enketo/config';
import bindJsEvaluator from 'enketo/xpath-evaluator-binding';
import { readCookie, parseFunctionFromExpression, stripQuotes } from './utils';
import {
getSiblingElementsAndSelf,
getXPath,
getRepeatIndex,
hasPreviousCommentSiblingWithContent,
hasPreviousSiblingElementSameName,
} from './dom-utils';
import FormLogicError from './form-logic-error';
import types from './types';
import event from './event';
import { Nodeset } from './nodeset';
import './extend';
const REPEAT_COMMENT_PREFIX = 'repeat:/';
const INSTANCE = /instance\(\s*(["'])((?:(?!\1)[A-z0-9.\-_]+))\1\s*\)/g;
const OPENROSA =
/(decimal-date-time\(|pow\(|indexed-repeat\(|format-date\(|coalesce\(|join\(|max\(|min\(|random\(|substr\(|int\(|uuid\(|regex\(|now\(|today\(|date\(|if\(|boolean-from-string\(|checklist\(|selected\(|selected-at\(|round\(|area\(|position\([^)])/;
const OPENROSA_XFORMS_NS = 'http://openrosa.org/xforms';
const JAVAROSA_XFORMS_NS = 'http://openrosa.org/javarosa';
const ENKETO_XFORMS_NS = 'http://enketo.org/xforms';
const ODK_XFORMS_NS = 'http://www.opendatakit.org/xforms';
const parser = new DOMParser();
/**
* Class dealing with the XML Model of a form
*
* @class
* @param {FormDataObj} data - data object
* @param {object=} options - FormModel options
* @param {string=} options.full - Whether to initialize the full model or only the primary instance.
*/
const FormModel = function (data, options) {
if (typeof data === 'string') {
data = {
modelStr: data,
};
}
data.external = data.external || [];
data.submitted =
typeof data.submitted !== 'undefined' ? data.submitted : true;
options = options || {};
options.full = typeof options.full !== 'undefined' ? options.full : true;
this.events = document.createElement('div');
this.convertedExpressions = {};
this.templates = {};
this.loadErrors = [];
this.data = data;
this.options = options;
this.namespaces = {};
};
/**
* Getter and setter functions
*/
FormModel.prototype = {
/**
* @type {string}
*/
get version() {
return this.evaluate('/*/@version', 'string', null, null, true);
},
/**
* @type {string}
*/
get instanceID() {
return this.getMetaNode('instanceID').getVal();
},
/**
* @type {string}
*/
get deprecatedID() {
return this.getMetaNode('deprecatedID').getVal() || '';
},
/**
* @type {string}
*/
get instanceName() {
return this.getMetaNode('instanceName').getVal();
},
};
/**
* Initializes FormModel
*
* @return {Array<string>} list of initialization errors
*/
FormModel.prototype.init = function () {
let id;
let i;
let instanceDoc;
let secondaryInstanceChildren;
const that = this;
/**
* Default namespaces (on a primary instance, instance child, model) would create a problem using the **native** XPath evaluator.
* It wouldn't find any regular /path/to/nodes. The solution is to ignore these by renaming these attributes to data-xmlns.
*
* If the regex is later deemed too aggressive, it could target the model, primary instance and primary instance child only, after creating an XML Document.
*/
this.data.modelStr = this.data.modelStr.replace(
/\s(xmlns=("|')[^\s>]+("|'))/g,
' data-$1'
);
if (!this.options.full) {
// Strip all secondary instances from string before parsing
// This regex works because the model never includes itext in Enketo
this.data.modelStr = this.data.modelStr.replace(
/^(<model\s*><instance((?!<instance).)+<\/instance\s*>\s*)(<instance.+<\/instance\s*>)*/,
'$1'
);
}
// Create the model
try {
id = 'model';
// The default model
this.xml = parser.parseFromString(this.data.modelStr, 'text/xml');
this.throwParserErrors(this.xml, this.data.modelStr);
// Add external data to model
this.data.external.forEach((instance) => {
if (instance == null || !instance.xml) {
return;
}
id = instance.id
? `instance "${instance.id}"`
: 'instance "unknown"';
instanceDoc = that.getSecondaryInstance(instance.id);
// remove any existing content that is just an XLSForm hack to pass ODK Validate
secondaryInstanceChildren = instanceDoc.children;
for (i = secondaryInstanceChildren.length - 1; i >= 0; i--) {
instanceDoc.removeChild(secondaryInstanceChildren[i]);
}
let rootEl;
if (instance.xml instanceof XMLDocument) {
if (window.navigator.userAgent.indexOf('Trident/') >= 0) {
// IE does not support importNode
rootEl = that.importNode(
instance.xml.documentElement,
true
);
} else {
// Create a clone of the root node
rootEl = that.xml.importNode(
instance.xml.documentElement,
true
);
}
}
if (rootEl) {
instanceDoc.appendChild(rootEl);
}
});
// TODO: in the future, we should search for jr://instance/session and
// populate that one. This is just moving in that direction to implement preloads.
this.createSession('__session', this.data.session);
} catch (e) {
console.error('parseXML error');
this.loadErrors.push(`Error trying to parse XML ${id}. ${e.message}`);
}
// Initialize/process the model
if (this.xml) {
try {
this.hasInstance = !!this.xml.querySelector('model > instance');
this.rootElement =
this.xml.querySelector('instance > *') ||
this.xml.documentElement;
this.setNamespaces();
// Determine whether it is possible that this form uses incorrect absolute/path/to/repeat/node syntax when
// it actually was supposed to use a relative ../node path (old issue with older pyxform-generated forms).
// In the future, if there are more use cases for odk:xforms-version, we'll probably have to use a semver-parser
// to do a comparison. In this case, the presence of the attribute is sufficient, as we know no older versions
// than odk:xforms-version="1.0.0" exist. Previous versions had no number.
this.noRepeatRefErrorExpected = this.evaluate(
`/model/@${this.getNamespacePrefix(
ODK_XFORMS_NS
)}:xforms-version`,
'boolean',
null,
null,
true
);
// Check if instanceID is present
if (!this.getMetaNode('instanceID').getElement()) {
that.loadErrors.push(
'Invalid primary instance. Missing instanceID node.'
);
}
// Check if all secondary instances with an external source have been populated
Array.prototype.slice
.call(this.xml.querySelectorAll('model > instance[src]:empty'))
.forEach((instance) => {
const src = instance.getAttribute('src');
const errorMessage =
src == null
? `External instance "${instance.id}" is empty.`
: `Can't find ${src.replace(/.*\//, '')}.`;
that.loadErrors.push(errorMessage);
});
this.trimValues();
this.extractTemplates();
} catch (e) {
console.error(e);
this.loadErrors.push(`${e.name}: ${e.message}`);
}
// Merge an existing instance into the model, AFTER templates have been removed
try {
id = 'record';
if (this.data.instanceStr) {
this.mergeXml(this.data.instanceStr);
}
// Set the two most important meta fields before any field 'dataupdate' event fires.
// The first dataupdate event will fire in response to the instance-first-load event.
this.setInstanceIdAndDeprecatedId();
if (!this.data.instanceStr) {
// Only dispatch for newly created records
this.events.dispatchEvent(event.InstanceFirstLoad());
}
} catch (e) {
console.error(e);
this.loadErrors.push(
`Error trying to parse XML ${id}. ${e.message}`
);
}
}
return this.loadErrors;
};
/**
* @param {Document} xmlDoc - XML Document
* @param {string} xmlStr - XML string
*/
FormModel.prototype.throwParserErrors = (xmlDoc, xmlStr) => {
if (!xmlDoc || xmlDoc.querySelector('parsererror')) {
throw new Error(`Invalid XML: ${xmlStr}`);
}
};
/**
* @param {string} id - Instance ID
* @param {object} [sessObj] - session object
*/
FormModel.prototype.createSession = function (id, sessObj) {
let instance;
let session;
const model = this.xml.querySelector('model');
const fixedProps = [
'deviceid',
'username',
'email',
'phonenumber',
'simserial',
'subscriberid',
];
if (!model) {
return;
}
sessObj = typeof sessObj === 'object' ? sessObj : {};
instance = model.querySelector(`instance#${CSS.escape(id)}`);
if (!instance) {
instance = parser.parseFromString(
`<instance id="${id}"/>`,
'text/xml'
).documentElement;
this.xml.adoptNode(instance);
model.appendChild(instance);
}
// fixed: /sesssion/context properties
fixedProps.forEach((prop) => {
sessObj[prop] =
sessObj[prop] ||
readCookie(`__enketo_meta_${prop}`) ||
`${prop} not found`;
});
session = parser.parseFromString(
`<session><context>${fixedProps
.map((prop) => `<${prop}>${sessObj[prop]}</${prop}>`)
.join('')}</context></session>`,
'text/xml'
).documentElement;
// TODO: custom properties could be added to /session/user/data or to /session/data
this.xml.adoptNode(session);
instance.appendChild(session);
};
/**
* For some unknown reason we cannot use doc.getElementById(id) or doc.querySelector('#'+id)
* in IE11. This function is a replacement for this specifically to find a secondary instance.
*
* @param {string} id - DOM element id.
* @return {Element|undefined} secondary instance XML element
*/
FormModel.prototype.getSecondaryInstance = function (id) {
let instanceEl;
[...this.xml.querySelectorAll('model > instance')].some((el) => {
const idAttr = el.getAttribute('id');
if (idAttr === id) {
instanceEl = el;
return true;
}
return false;
});
return instanceEl;
};
/**
* Returns a new Nodeset instance
*
* @param {string|null} [selector] - simple path to node
* @param {string|number|null} [index] - index of node
* @param {NodesetFilter|null} [filter] - filter to apply
* @return {Nodeset} Nodeset instance
*/
FormModel.prototype.node = function (selector, index, filter) {
return new Nodeset(selector, index, filter, this);
};
/**
* Alternative adoptNode on IE11 (http://stackoverflow.com/questions/1811116/ie-support-for-dom-importnode)
* TODO: remove to be replaced by separate IE11-only polyfill file/service
*
* @param {Element} node - Node to be imported
* @param {Array<Node>} allChildren - All children of imported Node
*/
FormModel.prototype.importNode = function (node, allChildren) {
let i;
let il;
switch (node.nodeType) {
case document.ELEMENT_NODE: {
const newNode = document.createElementNS(
node.namespaceURI,
node.nodeName
);
if (node.attributes && node.attributes.length > 0) {
for (i = 0, il = node.attributes.length; i < il; i++) {
const attr = node.attributes[i];
if (attr.namespaceURI) {
newNode.setAttributeNS(
attr.namespaceURI,
attr.nodeName,
node.getAttributeNS(
attr.namespaceURI,
attr.localName
)
);
} else {
newNode.setAttribute(
attr.nodeName,
node.getAttribute(attr.nodeName)
);
}
}
}
if (allChildren && node.children.length) {
for (i = 0, il = node.children.length; i < il; i++) {
newNode.appendChild(
this.importNode(node.children[i], allChildren)
);
}
}
if (!node.children.length && node.textContent) {
newNode.textContent = node.textContent;
}
return newNode;
}
case document.TEXT_NODE:
case document.CDATA_SECTION_NODE:
case document.COMMENT_NODE:
return document.createTextNode(node.nodeValue);
}
};
/**
* Merges an XML instance string into the XML Model
*
* @param {string} recordStr - The XML record as string
*/
FormModel.prototype.mergeXml = function (recordStr) {
let modelInstanceChildStr;
let merger;
let modelInstanceEl;
let modelInstanceChildEl;
let mergeResultDoc;
const that = this;
let templateEls;
let record;
if (!recordStr) {
return;
}
modelInstanceEl = this.xml.querySelector('instance');
modelInstanceChildEl = this.xml.querySelector('instance > *'); // do not use firstChild as it may find a #textNode
if (!modelInstanceChildEl) {
throw new Error(
'Model is corrupt. It does not contain a childnode of instance'
);
}
/**
* A Namespace merge problem occurs when ODK decides to invent a new namespace for a submission
* that is different from the XForm model namespace... So we just remove this nonsense.
*/
recordStr = recordStr.replace(/\s(xmlns=("|')[^\s>]+("|'))/g, '');
/**
* Comments aren't merging in document order (which would be impossible also).
* This may mess up repeat functionality, so until we actually need
* comments, we simply remove them (multiline comments are probably not removed, but we don't care about them).
*/
recordStr = recordStr.replace(/<!--[^>]*-->/g, '');
record = parser.parseFromString(recordStr, 'text/xml');
/**
* Normally records will not contain the special "jr:template" attribute. However, we should still be able to deal with
* this if they do, including the old hacked non-namespaced "template" attribute.
* https://github.com/enketo/enketo-core/issues/376
*
* The solution if these are found is to delete the node.
*
* Since the record is not a FormModel instance we revert to a very aggressive querySelectorAll that selects all
* nodes with a template attribute name IN ANY NAMESPACE.
*/
templateEls = record.querySelectorAll('[*|template]');
for (let i = 0; i < templateEls.length; i++) {
templateEls[i].remove();
}
/**
* To comply with quirky behaviour of repeats in XForms, we manually create the correct number of repeat instances
* before merging. This resolves these two issues:
* a) Multiple repeat instances in record are added out of order when merged into a record that contains fewer
* repeat instances, see https://github.com/kobotoolbox/enketo-express/issues/223
* b) If a repeat node is missing from a repeat instance (e.g. the 2nd) in a record, and that repeat instance is not
* in the model, that node will be missing in the result.
*/
// TODO: ES6 for (var node of record.querySelectorAll('*')){}
Array.prototype.slice.call(record.querySelectorAll('*')).forEach((node) => {
let path;
let repeatIndex = 0;
let positionedPath;
let repeatParts;
try {
path = getXPath(node, 'instance', false);
// If this is a templated repeat (check templates)
// or a repeat without templates
if (
typeof that.templates[path] !== 'undefined' ||
getRepeatIndex(node) > 0
) {
positionedPath = getXPath(node, 'instance', true);
if (!that.evaluate(positionedPath, 'node', null, null, true)) {
repeatParts = positionedPath.match(/([^[]+)\[(\d+)\]\//g);
// If the positionedPath has a non-0 repeat index followed by (at least) 1 node, avoid cloning out of order.
if (repeatParts && repeatParts.length > 0) {
// TODO: Does this work for triple-nested repeats. I don't really care though.
// repeatIndex of immediate parent repeat of deepest nested repeat in positionedPath
repeatIndex =
repeatParts[repeatParts.length - 1].match(
/\[(\d+)\]/
)[1] - 1;
}
that.addRepeat(path, repeatIndex, true);
}
}
} catch (e) {
console.warn('Ignored error:', e);
}
});
/**
* Any default values in the model, may have been emptied in the record.
* MergeXML will keep those default values, which would be bad, so we manually clear defaults before merging.
*/
// first find all empty leaf nodes in record
Array.prototype.slice
.call(record.querySelectorAll('*'))
.filter((recordNode) => {
const val = recordNode.textContent;
return recordNode.children.length === 0 && val.trim().length === 0;
})
.forEach((leafNode) => {
const path = getXPath(leafNode, 'instance', true);
const instanceNode = that.node(path, 0).getElement();
if (instanceNode) {
// TODO: after dropping support for IE11, we can also use instanceNode.children.length
if (
that.evaluate('./*', 'nodes-ordered', path, 0, true)
.length === 0
) {
// Select all text nodes (excluding repeat COMMENT nodes!)
that.evaluate(
'./text()',
'nodes-ordered',
path,
0,
true
).forEach((node) => {
node.textContent = '';
});
} else {
// If the node in the default instance is a group (empty in record, so appears to be a leaf node
// but isn't), empty all true leaf node descendants.
that.evaluate(
'.//*[not(*)]',
'nodes-ordered',
path,
0,
true
).forEach((node) => {
node.textContent = '';
});
}
}
});
merger = new MergeXML({
join: false,
});
modelInstanceChildStr = new XMLSerializer().serializeToString(
modelInstanceChildEl
);
recordStr = new XMLSerializer().serializeToString(record);
// first the model, to preserve DOM order of that of the default instance
merger.AddSource(modelInstanceChildStr);
// then merge the record into the model
merger.AddSource(recordStr);
if (merger.error.code) {
throw new Error(merger.error.text);
}
/**
* Beware: merge.Get(0) returns an ActiveXObject in IE11. We turn this
* into a proper XML document by parsing the XML string instead.
*/
mergeResultDoc = parser.parseFromString(merger.Get(1), 'text/xml');
/**
* To properly show 0 repeats, if the form definition contains multiple default instances
* and the record contains none, we have to iterate trough the templates object, and
* 1. check for each template path, whether the record contained more than 0 of these nodes
* 2. remove all nodes on that path if the answer was no.
*
* Since this requires complex handcoded XForms it is unlikely to ever be needed, so I left this
* functionality out.
*/
// Remove the primary instance childnode from the original model
this.xml.querySelector('instance').removeChild(modelInstanceChildEl);
// checking if IE
if (window.navigator.userAgent.indexOf('Trident/') >= 0) {
// IE does not support adoptNode
modelInstanceChildEl = this.importNode(
mergeResultDoc.documentElement,
true
);
} else {
// adopt the merged instance childnode
modelInstanceChildEl = this.xml.adoptNode(
mergeResultDoc.documentElement,
true
);
}
// append the adopted node to the primary instance
modelInstanceEl.appendChild(modelInstanceChildEl);
// reset the rootElement
this.rootElement = modelInstanceChildEl;
};
/**
* Trims values of all Form elements
*/
FormModel.prototype.trimValues = function () {
this.node(null, null, {
noEmpty: true,
})
.getElements()
.forEach((element) => {
element.textContent = element.textContent.trim();
});
};
/**
* Sets instance ID and deprecated ID
*/
FormModel.prototype.setInstanceIdAndDeprecatedId = function () {
let instanceIdObj;
let instanceIdEl;
let deprecatedIdEl;
let metaEl;
let instanceIdExistingVal;
instanceIdObj = this.getMetaNode('instanceID');
instanceIdEl = instanceIdObj.getElement();
instanceIdExistingVal = instanceIdObj.getVal();
if (!instanceIdEl) {
console.warn('Model has no instanceID element');
return;
}
if (this.data.instanceStr && this.data.submitted) {
deprecatedIdEl = this.getMetaNode('deprecatedID').getElement();
// set the instanceID value to empty
instanceIdEl.textContent = '';
const namespace = instanceIdEl.namespaceURI;
// add deprecatedID node if necessary
if (!deprecatedIdEl) {
const nsPrefix = namespace
? this.getNamespacePrefix(namespace)
: '';
const nsDeclaration = namespace
? `xmlns:${nsPrefix}="${namespace}"`
: '';
deprecatedIdEl = parser.parseFromString(
`<${
nsPrefix ? `${nsPrefix}:` : ''
}deprecatedID ${nsDeclaration}/>`,
'text/xml'
).documentElement;
this.xml.adoptNode(deprecatedIdEl);
metaEl = this.xml.querySelector('instance > * > meta');
metaEl.appendChild(deprecatedIdEl);
}
}
if (!instanceIdObj.getVal()) {
instanceIdObj.setVal(
this.evaluate('concat("uuid:", uuid())', 'string')
);
}
// after setting instanceID, give deprecatedID element the old value of the instanceId
// ensure dataupdate event fires by using setVal
if (deprecatedIdEl) {
this.getMetaNode('deprecatedID').setVal(instanceIdExistingVal);
}
};
/**
* Creates a custom XPath Evaluator to be used for XPath Expresssions that contain custom
* OpenRosa functions or for browsers that do not have a native evaluator.
*
* @type {Function}
*/
FormModel.prototype.bindJsEvaluator = bindJsEvaluator;
/**
* @param {string} localName - node name without namespace
* @return {Element} node
*/
FormModel.prototype.getMetaNode = function (localName) {
const orPrefix = this.getNamespacePrefix(OPENROSA_XFORMS_NS);
let n = this.node(`/*/${orPrefix}:meta/${orPrefix}:${localName}`);
if (!n.getElement()) {
n = this.node(`/*/meta/${localName}`);
}
return n;
};
/**
* @param {string} path - path to repeat
* @return {string} repeat comment text
*/
FormModel.prototype.getRepeatCommentText = (path) => {
path = path.trim();
return REPEAT_COMMENT_PREFIX + path;
};
/**
* @param {string} repeatPath - path to repeat
* @return {string} selector
*/
FormModel.prototype.getRepeatCommentSelector = function (repeatPath) {
return `//comment()[self::comment()="${this.getRepeatCommentText(
repeatPath
)}"]`;
};
/**
* @param {string} repeatPath - path to repeat
* @param {number} repeatSeriesIndex - index of repeat series
* @return {Element} node
*/
FormModel.prototype.getRepeatCommentEl = function (
repeatPath,
repeatSeriesIndex
) {
return this.evaluate(
this.getRepeatCommentSelector(repeatPath),
'nodes-ordered',
null,
null,
true
)[repeatSeriesIndex];
};
/**
* Adds a <repeat>able instance node in a particular series of a repeat.
*
* @param {string} repeatPath - absolute path of a repeat
* @param {number} repeatSeriesIndex - index of the repeat series that gets a new repeat (this is always 0 for non-nested repeats)
* @param {boolean} merge - whether this operation is part of a merge operation (won't send dataupdate event, clears all values and
* will not add ordinal attributes as these should be provided in the record)
*/
FormModel.prototype.addRepeat = function (
repeatPath,
repeatSeriesIndex,
merge
) {
let templateClone;
const that = this;
if (!this.templates[repeatPath]) {
// This allows the model itself without requiring the controller to cal call .extractFakeTemplates()
// to extract non-jr:templates by assuming that addRepeat would only called for a repeat.
this.extractFakeTemplates([repeatPath]);
}
const template = this.templates[repeatPath];
const repeatSeries = this.getRepeatSeries(repeatPath, repeatSeriesIndex);
const insertAfterNode = repeatSeries.length
? repeatSeries[repeatSeries.length - 1]
: this.getRepeatCommentEl(repeatPath, repeatSeriesIndex);
// if not exists and not a merge operation
if (!merge) {
repeatSeries.forEach((el) => {
that.addOrdinalAttribute(el, repeatSeries[0]);
});
}
/**
* If templatenodes and insertAfterNode(s) have been identified
*/
if (template && insertAfterNode) {
templateClone = template.cloneNode(true);
insertAfterNode.after(templateClone);
this.removeOrdinalAttributes(templateClone);
// We should not automatically add ordinal attributes for an existing record as the ordinal values cannot be determined.
// They should be provided in the instanceStr (record).
if (!merge) {
this.addOrdinalAttribute(templateClone, repeatSeries[0]);
}
// If part of a merge operation (during form load) where the values will be populated from the record, defaults are not desired.
if (merge) {
Array.prototype.slice
.call(templateClone.querySelectorAll('*'))
.filter((node) => node.children.length === 0)
.forEach((node) => {
node.textContent = '';
});
}
// Note: the addrepeat eventhandler in Form.js takes care of initializing branches etc, so no need to fire an event here.
} else {
console.error(
'Could not find template node and/or node to insert the clone after'
);
}
};
/**
* @param {Element} repeat - Set ordinal attribue to this node
* @param {Element} firstRepeatInSeries - Used to know what the next ordinal attribute value should be. Defaults to `repeat` node.
*/
FormModel.prototype.addOrdinalAttribute = function (
repeat,
firstRepeatInSeries
) {
let lastUsedOrdinal;
let newOrdinal;
const enkNs = this.getNamespacePrefix(ENKETO_XFORMS_NS);
firstRepeatInSeries = firstRepeatInSeries || repeat;
if (
config.repeatOrdinals === true &&
!repeat.getAttributeNS(ENKETO_XFORMS_NS, 'ordinal')
) {
// getAttributeNs and setAttributeNs results in duplicate namespace declarations on each repeat node in IE11 when serializing the model.
// However, the regular getAttribute and setAttribute do not work properly in IE11.
lastUsedOrdinal =
firstRepeatInSeries.getAttributeNS(
ENKETO_XFORMS_NS,
'last-used-ordinal'
) || 0;
newOrdinal = Number(lastUsedOrdinal) + 1;
firstRepeatInSeries.setAttributeNS(
ENKETO_XFORMS_NS,
`${enkNs}:last-used-ordinal`,
newOrdinal
);
repeat.setAttributeNS(ENKETO_XFORMS_NS, `${enkNs}:ordinal`, newOrdinal);
}
};
/**
* Removes all ordinal attriubetes from all applicable nodes
*
* @param {Element} el - Target node
*/
FormModel.prototype.removeOrdinalAttributes = (el) => {
if (config.repeatOrdinals === true) {
// Find all nested repeats first (this is only used for repeats that have no template).
// The querySelector is actually too unspecific as it matches all ordinal attributes in ANY namespace.
// However the proper [enk\\:ordinal] doesn't work if setAttributeNS was used to add the attribute.
const repeats = Array.prototype.slice.call(
el.querySelectorAll('[*|ordinal]')
);
repeats.push(el);
for (let i = 0; i < repeats.length; i++) {
repeats[i].removeAttributeNS(ENKETO_XFORMS_NS, 'last-used-ordinal');
repeats[i].removeAttributeNS(ENKETO_XFORMS_NS, 'ordinal');
}
}
};
/**
* Obtains a single series of repeat element;
*
* @param {string} repeatPath - The absolute path of the repeat.
* @param {number} repeatSeriesIndex - The index of the series of that repeat.
* @return {Array<Element>} Array of all repeat elements in a series.
*/
FormModel.prototype.getRepeatSeries = function (repeatPath, repeatSeriesIndex) {
let pathSegments;
let nodeName;
let checkEl;
const repeatCommentEl = this.getRepeatCommentEl(
repeatPath,
repeatSeriesIndex
);
const result = [];
// RepeatCommentEl is null if the requested repeatseries is a nested repeat and its ancestor repeat
// has 0 instances.
if (repeatCommentEl) {
pathSegments = repeatCommentEl.textContent
.substr(REPEAT_COMMENT_PREFIX.length)
.split('/');
nodeName = pathSegments[pathSegments.length - 1];
checkEl = repeatCommentEl.nextSibling;
// then add all subsequent repeats
while (checkEl) {
// Ignore any sibling text and comment nodes (e.g. whitespace with a newline character)
// also deal with repeats that have non-repeat siblings in between them, event though that would be a bug.
if (checkEl.nodeName && checkEl.nodeName === nodeName) {
result.push(checkEl);
}
checkEl = checkEl.nextSibling;
}
}
return result;
};
/**
* Determines the index of a repeated node amongst all nodes with the same XPath selector
*
* @param {Element} element - Target node
* @return {number} Determined index
*/
FormModel.prototype.determineIndex = function (element) {
if (element) {
const { nodeName } = element;
const path = getXPath(element, 'instance');
const family = Array.prototype.slice
.call(this.xml.querySelectorAll(nodeName.replace(/\./g, '\\.')))
.filter((node) => path === getXPath(node, 'instance'));
return family.length === 1 ? null : family.indexOf(element);
}
console.error(
'no node, or multiple nodes, provided to determineIndex function'
);
return -1;
};
/**
* Extracts all templates from the model and stores them in a Javascript object.
*/
FormModel.prototype.extractTemplates = function () {
const that = this;
// in reverse document order to properly deal with nested repeat templates
this.getTemplateNodes()
.reverse()
.forEach((templateEl) => {
const xPath = getXPath(templateEl, 'instance');
that.addTemplate(xPath, templateEl);
/*
* Nested repeats that have a template attribute are correctly added to the templates object.
* The template of the repeat ancestor of the nested repeat contains the correct comment.
* However, since the ancestor repeat (template)
*/
templateEl.remove();
});
};
/**
* @param {Array<string>} repeatPaths - repeat paths
*/
FormModel.prototype.extractFakeTemplates = function (repeatPaths) {