@formio/js 5.0.0-dev.5673.3d062b9 → 5.0.0-dev.5673.ae99c16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/Changelog.md +63 -1
  2. package/dist/formio.builder.css +0 -1
  3. package/dist/formio.builder.min.css +1 -1
  4. package/dist/formio.embed.js +1 -1
  5. package/dist/formio.embed.min.js +1 -1
  6. package/dist/formio.form.css +0 -1
  7. package/dist/formio.form.js +646 -594
  8. package/dist/formio.form.min.css +1 -1
  9. package/dist/formio.form.min.js +1 -1
  10. package/dist/formio.form.min.js.LICENSE.txt +1 -9
  11. package/dist/formio.full.css +0 -1
  12. package/dist/formio.full.js +633 -601
  13. package/dist/formio.full.min.css +1 -1
  14. package/dist/formio.full.min.js +1 -1
  15. package/dist/formio.full.min.js.LICENSE.txt +1 -9
  16. package/dist/formio.js +4 -4
  17. package/dist/formio.min.js +1 -1
  18. package/dist/formio.utils.js +100 -38
  19. package/dist/formio.utils.min.js +1 -1
  20. package/dist/formio.utils.min.js.LICENSE.txt +5 -3
  21. package/lib/cjs/CDN.d.ts +1 -0
  22. package/lib/cjs/CDN.js +2 -2
  23. package/lib/cjs/Form.d.ts +2 -2
  24. package/lib/cjs/Form.js +11 -5
  25. package/lib/cjs/Formio.js +1 -0
  26. package/lib/cjs/PDF.js +1 -1
  27. package/lib/cjs/PDFBuilder.js +2 -1
  28. package/lib/cjs/Webform.d.ts +1 -1
  29. package/lib/cjs/Webform.js +11 -6
  30. package/lib/cjs/WebformBuilder.js +13 -3
  31. package/lib/cjs/Wizard.js +1 -1
  32. package/lib/cjs/components/_classes/component/Component.d.ts +4 -3
  33. package/lib/cjs/components/_classes/component/Component.js +31 -8
  34. package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
  35. package/lib/cjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
  36. package/lib/cjs/components/_classes/component/fixtures/comp7.js +86 -0
  37. package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
  38. package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
  39. package/lib/cjs/components/_classes/input/Input.js +23 -1
  40. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +9 -2
  41. package/lib/cjs/components/_classes/multivalue/Multivalue.js +53 -26
  42. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
  43. package/lib/cjs/components/_classes/nested/NestedComponent.js +5 -1
  44. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
  45. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +56 -29
  46. package/lib/cjs/components/address/Address.d.ts +6 -0
  47. package/lib/cjs/components/address/Address.js +11 -1
  48. package/lib/cjs/components/address/editForm/Address.edit.provider.js +1 -1
  49. package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
  50. package/lib/cjs/components/checkbox/Checkbox.js +1 -1
  51. package/lib/cjs/components/checkbox/fixtures/comp6.d.ts +32 -0
  52. package/lib/cjs/components/checkbox/fixtures/comp6.js +30 -0
  53. package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
  54. package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
  55. package/lib/cjs/components/currency/Currency.d.ts +2 -0
  56. package/lib/cjs/components/datagrid/DataGrid.d.ts +11 -1
  57. package/lib/cjs/components/datagrid/DataGrid.js +59 -36
  58. package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
  59. package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.js +139 -0
  60. package/lib/cjs/components/datagrid/fixtures/comp10.d.ts +81 -0
  61. package/lib/cjs/components/datagrid/fixtures/comp10.js +87 -0
  62. package/lib/cjs/components/datagrid/fixtures/comp11.d.ts +50 -0
  63. package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -0
  64. package/lib/cjs/components/datagrid/fixtures/comp9.d.ts +41 -0
  65. package/lib/cjs/components/datagrid/fixtures/comp9.js +44 -0
  66. package/lib/cjs/components/datagrid/fixtures/index.d.ts +5 -1
  67. package/lib/cjs/components/datagrid/fixtures/index.js +9 -1
  68. package/lib/cjs/components/datamap/DataMap.js +2 -2
  69. package/lib/cjs/components/datetime/fixtures/comp14.d.ts +35 -0
  70. package/lib/cjs/components/datetime/fixtures/comp14.js +38 -0
  71. package/lib/cjs/components/datetime/fixtures/index.d.ts +6 -5
  72. package/lib/cjs/components/datetime/fixtures/index.js +3 -1
  73. package/lib/cjs/components/day/Day.d.ts +3 -4
  74. package/lib/cjs/components/day/Day.js +31 -10
  75. package/lib/cjs/components/day/fixtures/comp8.d.ts +41 -0
  76. package/lib/cjs/components/day/fixtures/comp8.js +40 -0
  77. package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
  78. package/lib/cjs/components/day/fixtures/index.js +3 -1
  79. package/lib/cjs/components/editgrid/EditGrid.js +16 -8
  80. package/lib/cjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
  81. package/lib/cjs/components/editgrid/fixtures/comp-test-events.js +54 -0
  82. package/lib/cjs/components/editgrid/fixtures/comp16.d.ts +52 -0
  83. package/lib/cjs/components/editgrid/fixtures/comp16.js +71 -0
  84. package/lib/cjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  85. package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
  86. package/lib/cjs/components/editgrid/fixtures/index.d.ts +10 -7
  87. package/lib/cjs/components/editgrid/fixtures/index.js +7 -1
  88. package/lib/cjs/components/file/File.d.ts +2 -2
  89. package/lib/cjs/components/file/File.js +13 -2
  90. package/lib/cjs/components/file/editForm/File.edit.display.js +1 -1
  91. package/lib/cjs/components/form/Form.d.ts +1 -1
  92. package/lib/cjs/components/form/Form.js +1 -1
  93. package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
  94. package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
  95. package/lib/cjs/components/form/fixtures/index.js +3 -1
  96. package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
  97. package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
  98. package/lib/cjs/components/html/HTML.js +1 -1
  99. package/lib/cjs/components/number/Number.d.ts +17 -2
  100. package/lib/cjs/components/number/Number.js +27 -7
  101. package/lib/cjs/components/number/fixtures/comp10.d.ts +18 -0
  102. package/lib/cjs/components/number/fixtures/comp10.js +21 -0
  103. package/lib/cjs/components/number/fixtures/comp8.d.ts +32 -0
  104. package/lib/cjs/components/number/fixtures/comp8.js +28 -0
  105. package/lib/cjs/components/number/fixtures/comp9.d.ts +18 -0
  106. package/lib/cjs/components/number/fixtures/comp9.js +21 -0
  107. package/lib/cjs/components/number/fixtures/index.d.ts +4 -1
  108. package/lib/cjs/components/number/fixtures/index.js +7 -1
  109. package/lib/cjs/components/panel/Panel.d.ts +1 -0
  110. package/lib/cjs/components/panel/Panel.js +1 -0
  111. package/lib/cjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
  112. package/lib/cjs/components/phonenumber/fixtures/comp2.js +25 -0
  113. package/lib/cjs/components/phonenumber/fixtures/index.d.ts +2 -1
  114. package/lib/cjs/components/phonenumber/fixtures/index.js +3 -1
  115. package/lib/cjs/components/radio/Radio.d.ts +2 -18
  116. package/lib/cjs/components/radio/Radio.js +29 -27
  117. package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
  118. package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
  119. package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
  120. package/lib/cjs/components/radio/fixtures/index.js +3 -1
  121. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  122. package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
  123. package/lib/cjs/components/select/Select.d.ts +38 -0
  124. package/lib/cjs/components/select/Select.js +14 -5
  125. package/lib/cjs/components/select/fixtures/comp25.d.ts +59 -0
  126. package/lib/cjs/components/select/fixtures/comp25.js +66 -0
  127. package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
  128. package/lib/cjs/components/select/fixtures/comp26.js +59 -0
  129. package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
  130. package/lib/cjs/components/select/fixtures/index.js +5 -1
  131. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  132. package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
  133. package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
  134. package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
  135. package/lib/cjs/components/tags/Tags.js +3 -3
  136. package/lib/cjs/components/time/Time.d.ts +2 -2
  137. package/lib/cjs/components/time/Time.form.js +2 -2
  138. package/lib/cjs/components/time/Time.js +3 -7
  139. package/lib/cjs/components/time/fixtures/comp4.d.ts +166 -0
  140. package/lib/cjs/components/time/fixtures/comp4.js +171 -0
  141. package/lib/cjs/components/time/fixtures/index.d.ts +2 -1
  142. package/lib/cjs/components/time/fixtures/index.js +3 -1
  143. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +5 -0
  144. package/lib/cjs/providers/address/GoogleAddressProvider.js +23 -1
  145. package/lib/cjs/templates/Templates.js +1 -1
  146. package/lib/cjs/translations/en.d.ts +4 -0
  147. package/lib/cjs/translations/en.js +5 -1
  148. package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +2 -2
  149. package/lib/cjs/utils/utils.d.ts +2 -11
  150. package/lib/cjs/utils/utils.js +60 -24
  151. package/lib/cjs/widgets/CalendarWidget.js +24 -10
  152. package/lib/mjs/CDN.d.ts +1 -0
  153. package/lib/mjs/CDN.js +2 -2
  154. package/lib/mjs/Form.d.ts +2 -2
  155. package/lib/mjs/Form.js +11 -5
  156. package/lib/mjs/Formio.js +1 -0
  157. package/lib/mjs/PDF.js +1 -1
  158. package/lib/mjs/PDFBuilder.js +1 -1
  159. package/lib/mjs/Webform.d.ts +1 -1
  160. package/lib/mjs/Webform.js +15 -6
  161. package/lib/mjs/WebformBuilder.js +12 -3
  162. package/lib/mjs/Wizard.js +1 -1
  163. package/lib/mjs/components/_classes/component/Component.d.ts +4 -3
  164. package/lib/mjs/components/_classes/component/Component.js +17 -5
  165. package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
  166. package/lib/mjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
  167. package/lib/mjs/components/_classes/component/fixtures/comp7.js +84 -0
  168. package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
  169. package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
  170. package/lib/mjs/components/_classes/input/Input.js +22 -1
  171. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +9 -2
  172. package/lib/mjs/components/_classes/multivalue/Multivalue.js +53 -26
  173. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
  174. package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -1
  175. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
  176. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +57 -29
  177. package/lib/mjs/components/address/Address.d.ts +6 -0
  178. package/lib/mjs/components/address/Address.js +14 -1
  179. package/lib/mjs/components/address/editForm/Address.edit.provider.js +1 -1
  180. package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
  181. package/lib/mjs/components/checkbox/Checkbox.js +1 -1
  182. package/lib/mjs/components/checkbox/fixtures/comp6.d.ts +32 -0
  183. package/lib/mjs/components/checkbox/fixtures/comp6.js +28 -0
  184. package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
  185. package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
  186. package/lib/mjs/components/currency/Currency.d.ts +2 -0
  187. package/lib/mjs/components/datagrid/DataGrid.d.ts +11 -1
  188. package/lib/mjs/components/datagrid/DataGrid.js +58 -35
  189. package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
  190. package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.js +137 -0
  191. package/lib/mjs/components/datagrid/fixtures/comp10.d.ts +81 -0
  192. package/lib/mjs/components/datagrid/fixtures/comp10.js +85 -0
  193. package/lib/mjs/components/datagrid/fixtures/comp11.d.ts +50 -0
  194. package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -0
  195. package/lib/mjs/components/datagrid/fixtures/comp9.d.ts +41 -0
  196. package/lib/mjs/components/datagrid/fixtures/comp9.js +42 -0
  197. package/lib/mjs/components/datagrid/fixtures/index.d.ts +5 -1
  198. package/lib/mjs/components/datagrid/fixtures/index.js +5 -1
  199. package/lib/mjs/components/datamap/DataMap.js +2 -2
  200. package/lib/mjs/components/datetime/fixtures/comp14.d.ts +35 -0
  201. package/lib/mjs/components/datetime/fixtures/comp14.js +36 -0
  202. package/lib/mjs/components/datetime/fixtures/index.d.ts +6 -5
  203. package/lib/mjs/components/datetime/fixtures/index.js +2 -1
  204. package/lib/mjs/components/day/Day.d.ts +3 -4
  205. package/lib/mjs/components/day/Day.js +30 -10
  206. package/lib/mjs/components/day/fixtures/comp8.d.ts +41 -0
  207. package/lib/mjs/components/day/fixtures/comp8.js +38 -0
  208. package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
  209. package/lib/mjs/components/day/fixtures/index.js +2 -1
  210. package/lib/mjs/components/editgrid/EditGrid.js +16 -8
  211. package/lib/mjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
  212. package/lib/mjs/components/editgrid/fixtures/comp-test-events.js +52 -0
  213. package/lib/mjs/components/editgrid/fixtures/comp16.d.ts +52 -0
  214. package/lib/mjs/components/editgrid/fixtures/comp16.js +69 -0
  215. package/lib/mjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  216. package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
  217. package/lib/mjs/components/editgrid/fixtures/index.d.ts +10 -7
  218. package/lib/mjs/components/editgrid/fixtures/index.js +4 -1
  219. package/lib/mjs/components/file/File.d.ts +2 -2
  220. package/lib/mjs/components/file/File.js +13 -2
  221. package/lib/mjs/components/file/editForm/File.edit.display.js +1 -1
  222. package/lib/mjs/components/form/Form.d.ts +1 -1
  223. package/lib/mjs/components/form/Form.js +1 -1
  224. package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
  225. package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
  226. package/lib/mjs/components/form/fixtures/index.js +2 -1
  227. package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
  228. package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
  229. package/lib/mjs/components/html/HTML.js +1 -1
  230. package/lib/mjs/components/number/Number.d.ts +17 -2
  231. package/lib/mjs/components/number/Number.js +26 -6
  232. package/lib/mjs/components/number/fixtures/comp10.d.ts +18 -0
  233. package/lib/mjs/components/number/fixtures/comp10.js +19 -0
  234. package/lib/mjs/components/number/fixtures/comp8.d.ts +32 -0
  235. package/lib/mjs/components/number/fixtures/comp8.js +26 -0
  236. package/lib/mjs/components/number/fixtures/comp9.d.ts +18 -0
  237. package/lib/mjs/components/number/fixtures/comp9.js +19 -0
  238. package/lib/mjs/components/number/fixtures/index.d.ts +4 -1
  239. package/lib/mjs/components/number/fixtures/index.js +4 -1
  240. package/lib/mjs/components/panel/Panel.d.ts +1 -0
  241. package/lib/mjs/components/panel/Panel.js +1 -0
  242. package/lib/mjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
  243. package/lib/mjs/components/phonenumber/fixtures/comp2.js +23 -0
  244. package/lib/mjs/components/phonenumber/fixtures/index.d.ts +2 -1
  245. package/lib/mjs/components/phonenumber/fixtures/index.js +2 -1
  246. package/lib/mjs/components/radio/Radio.d.ts +2 -18
  247. package/lib/mjs/components/radio/Radio.js +32 -30
  248. package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
  249. package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
  250. package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
  251. package/lib/mjs/components/radio/fixtures/index.js +2 -1
  252. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  253. package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
  254. package/lib/mjs/components/select/Select.d.ts +38 -0
  255. package/lib/mjs/components/select/Select.js +17 -6
  256. package/lib/mjs/components/select/fixtures/comp25.d.ts +59 -0
  257. package/lib/mjs/components/select/fixtures/comp25.js +64 -0
  258. package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
  259. package/lib/mjs/components/select/fixtures/comp26.js +57 -0
  260. package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
  261. package/lib/mjs/components/select/fixtures/index.js +3 -1
  262. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  263. package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
  264. package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
  265. package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
  266. package/lib/mjs/components/tags/Tags.js +3 -3
  267. package/lib/mjs/components/time/Time.d.ts +2 -2
  268. package/lib/mjs/components/time/Time.form.js +2 -2
  269. package/lib/mjs/components/time/Time.js +3 -13
  270. package/lib/mjs/components/time/fixtures/comp4.d.ts +166 -0
  271. package/lib/mjs/components/time/fixtures/comp4.js +169 -0
  272. package/lib/mjs/components/time/fixtures/index.d.ts +2 -1
  273. package/lib/mjs/components/time/fixtures/index.js +2 -1
  274. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +5 -0
  275. package/lib/mjs/providers/address/GoogleAddressProvider.js +22 -1
  276. package/lib/mjs/templates/Templates.js +1 -1
  277. package/lib/mjs/translations/en.d.ts +4 -0
  278. package/lib/mjs/translations/en.js +5 -1
  279. package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +2 -2
  280. package/lib/mjs/utils/utils.d.ts +2 -11
  281. package/lib/mjs/utils/utils.js +59 -13
  282. package/lib/mjs/widgets/CalendarWidget.js +24 -10
  283. package/package.json +5 -6
@@ -0,0 +1,169 @@
1
+ export default {
2
+ "type": "form",
3
+ "display": "wizard",
4
+ "components": [
5
+ {
6
+ "title": "Page 1",
7
+ "breadcrumbClickable": true,
8
+ "buttonSettings": {
9
+ "previous": true,
10
+ "cancel": true,
11
+ "next": true
12
+ },
13
+ "navigateOnEnter": false,
14
+ "saveOnEnter": false,
15
+ "scrollToTop": false,
16
+ "collapsible": false,
17
+ "key": "page1",
18
+ "type": "panel",
19
+ "label": "Page 1",
20
+ "components": [
21
+ {
22
+ "label": "Time",
23
+ "disabled": true,
24
+ "alwaysEnabled": false,
25
+ "tableView": true,
26
+ "defaultValue": "03:03 PM",
27
+ "key": "time1",
28
+ "type": "time",
29
+ "input": true,
30
+ "inputMask": "99:99",
31
+ "hideOnChildrenHidden": false,
32
+ "id": "efw9yyq",
33
+ "placeholder": "",
34
+ "prefix": "",
35
+ "customClass": "",
36
+ "suffix": "",
37
+ "multiple": false,
38
+ "protected": false,
39
+ "unique": false,
40
+ "persistent": true,
41
+ "hidden": false,
42
+ "clearOnHide": true,
43
+ "refreshOn": "",
44
+ "redrawOn": "",
45
+ "modalEdit": false,
46
+ "dataGridLabel": false,
47
+ "labelPosition": "top",
48
+ "description": "",
49
+ "errorLabel": "",
50
+ "tooltip": "",
51
+ "hideLabel": false,
52
+ "tabindex": "",
53
+ "autofocus": false,
54
+ "dbIndex": false,
55
+ "customDefaultValue": "",
56
+ "calculateValue": "",
57
+ "calculateServer": false,
58
+ "widget": {
59
+ "type": "input"
60
+ },
61
+ "attributes": {},
62
+ "validateOn": "change",
63
+ "validate": {
64
+ "required": false,
65
+ "custom": "",
66
+ "customPrivate": false,
67
+ "strictDateValidation": false,
68
+ "multiple": false,
69
+ "unique": false,
70
+ "minLength": "",
71
+ "maxLength": "",
72
+ "pattern": ""
73
+ },
74
+ "conditional": {
75
+ "show": null,
76
+ "when": null,
77
+ "eq": ""
78
+ },
79
+ "overlay": {
80
+ "style": "",
81
+ "left": "",
82
+ "top": "",
83
+ "width": "",
84
+ "height": ""
85
+ },
86
+ "allowCalculateOverride": false,
87
+ "encrypted": false,
88
+ "showCharCount": false,
89
+ "showWordCount": false,
90
+ "properties": {},
91
+ "allowMultipleMasks": false,
92
+ "addons": [],
93
+ "mask": false,
94
+ "inputType": "time",
95
+ "inputFormat": "plain",
96
+ "displayMask": "",
97
+ "spellcheck": true,
98
+ "truncateMultipleSpaces": false,
99
+ "format": "HH:mm",
100
+ "dataFormat": "HH:mm:ss"
101
+ }
102
+ ],
103
+ "input": false,
104
+ "tableView": false,
105
+ "id": "e7vej1d",
106
+ "placeholder": "",
107
+ "prefix": "",
108
+ "customClass": "",
109
+ "suffix": "",
110
+ "multiple": false,
111
+ "defaultValue": null,
112
+ "protected": false,
113
+ "unique": false,
114
+ "persistent": false,
115
+ "hidden": false,
116
+ "clearOnHide": false,
117
+ "refreshOn": "",
118
+ "redrawOn": "",
119
+ "modalEdit": false,
120
+ "dataGridLabel": false,
121
+ "labelPosition": "top",
122
+ "description": "",
123
+ "errorLabel": "",
124
+ "tooltip": "",
125
+ "hideLabel": false,
126
+ "tabindex": "",
127
+ "disabled": false,
128
+ "autofocus": false,
129
+ "dbIndex": false,
130
+ "customDefaultValue": "",
131
+ "calculateValue": "",
132
+ "calculateServer": false,
133
+ "widget": null,
134
+ "attributes": {},
135
+ "validateOn": "change",
136
+ "validate": {
137
+ "required": false,
138
+ "custom": "",
139
+ "customPrivate": false,
140
+ "strictDateValidation": false,
141
+ "multiple": false,
142
+ "unique": false
143
+ },
144
+ "conditional": {
145
+ "show": null,
146
+ "when": null,
147
+ "eq": ""
148
+ },
149
+ "overlay": {
150
+ "style": "",
151
+ "left": "",
152
+ "top": "",
153
+ "width": "",
154
+ "height": ""
155
+ },
156
+ "allowCalculateOverride": false,
157
+ "encrypted": false,
158
+ "showCharCount": false,
159
+ "showWordCount": false,
160
+ "properties": {},
161
+ "allowMultipleMasks": false,
162
+ "addons": [],
163
+ "tree": false,
164
+ "lazyLoad": false,
165
+ "theme": "default",
166
+ "breadcrumb": "default"
167
+ }
168
+ ],
169
+ };
@@ -1,6 +1,7 @@
1
1
  import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
+ import comp4 from './comp4';
4
5
  import timeForm from './timeForm';
5
6
  import timeForm2 from './timeForm2';
6
- export { comp1, comp2, comp3, timeForm, timeForm2 };
7
+ export { comp1, comp2, comp3, comp4, timeForm, timeForm2 };
@@ -1,6 +1,7 @@
1
1
  import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
+ import comp4 from './comp4';
4
5
  import timeForm from './timeForm';
5
6
  import timeForm2 from './timeForm2';
6
- export { comp1, comp2, comp3, timeForm, timeForm2 };
7
+ export { comp1, comp2, comp3, comp4, timeForm, timeForm2 };
@@ -82,6 +82,11 @@ export class GoogleAddressProvider extends AddressProvider {
82
82
  search(): Promise<void>;
83
83
  makeRequest(): Promise<void>;
84
84
  getDisplayValue(address: any): any;
85
+ /**
86
+ * Tries to remove the library if api key for loaded script is different.
87
+ * @param {ProviderOptions} options - The options for the provider.
88
+ */
89
+ tryRemoveLibrary(options?: ProviderOptions): void;
85
90
  }
86
91
  export type AutocompleteOptions = {
87
92
  /**
@@ -2,6 +2,9 @@
2
2
  import { Formio } from '../../Formio';
3
3
  import _ from 'lodash';
4
4
  import { AddressProvider } from './AddressProvider';
5
+ const GOOGLE_MAPS_BASE_URL = 'https://maps.googleapis.com';
6
+ const GOOGLE_MAPS_JS_URL = `${GOOGLE_MAPS_BASE_URL}/maps/api/js`;
7
+ const GOOGLE_MAPS_JS_WITH_PARAMS_URL = `${GOOGLE_MAPS_JS_URL}?v=quarterly&libraries=places&loading=async&callback=googleMapsCallback`;
5
8
  /**
6
9
  * @typedef {object} AutocompleteOptions
7
10
  * @property {string[]} fields - The fields to include in the autocomplete response.
@@ -48,10 +51,11 @@ export class GoogleAddressProvider extends AddressProvider {
48
51
  constructor(options = {}) {
49
52
  super(options);
50
53
  this.setAutocompleteOptions();
51
- let src = 'https://maps.googleapis.com/maps/api/js?v=quarterly&libraries=places&loading=async&callback=googleMapsCallback';
54
+ let src = GOOGLE_MAPS_JS_WITH_PARAMS_URL;
52
55
  if (options.params?.key) {
53
56
  src += `&key=${options.params.key}`;
54
57
  }
58
+ this.tryRemoveLibrary(options);
55
59
  Formio.requireLibrary(this.getLibraryName(), 'google.maps.places', src);
56
60
  }
57
61
  /**
@@ -178,4 +182,21 @@ export class GoogleAddressProvider extends AddressProvider {
178
182
  : this.alternativeDisplayValueProperty;
179
183
  return _.get(address, displayedProperty, '');
180
184
  }
185
+ /**
186
+ * Tries to remove the library if api key for loaded script is different.
187
+ * @param {ProviderOptions} options - The options for the provider.
188
+ */
189
+ tryRemoveLibrary(options = {}) {
190
+ if (!Formio.libraries[this.getLibraryName()]) {
191
+ return;
192
+ }
193
+ const existingScript = document.querySelector(`script[src^="${GOOGLE_MAPS_JS_URL}"]`);
194
+ if (existingScript && options.params?.key && !existingScript.attributes.src.value.endsWith(options.params.key)) {
195
+ const googleMapsScripts = document.querySelectorAll(`script[src^="${GOOGLE_MAPS_BASE_URL}"]`) ?? [];
196
+ googleMapsScripts.forEach(script => script.parentNode.removeChild(script));
197
+ delete Formio.libraries[this.getLibraryName()];
198
+ delete global?.google?.maps;
199
+ delete global[`${this.getLibraryName()}Callback`];
200
+ }
201
+ }
181
202
  }
@@ -1,5 +1,5 @@
1
1
  import templates from './index';
2
2
  import { Template } from '@formio/core/experimental';
3
3
  Template.addTemplates(templates);
4
- Template.defaultTemplates = templates.bootstrap;
4
+ Template.defaultTemplates = Template.templates.bootstrap;
5
5
  export default Template;
@@ -74,5 +74,9 @@ declare namespace _default {
74
74
  let apiKey: string;
75
75
  let typeRemaining: string;
76
76
  let typeCount: string;
77
+ let requiredDayField: string;
78
+ let requiredDayEmpty: string;
79
+ let requiredMonthField: string;
80
+ let requiredYearField: string;
77
81
  }
78
82
  export default _default;
@@ -73,5 +73,9 @@ export default {
73
73
  reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
74
74
  apiKey: 'API Key is not unique: {{key}}',
75
75
  typeRemaining: '{{ remaining }} {{ type }} remaining.',
76
- typeCount: '{{ count }} {{ type }}'
76
+ typeCount: '{{ count }} {{ type }}',
77
+ requiredDayField: '{{ field }} is required',
78
+ requiredDayEmpty: '{{ field }} is required',
79
+ requiredMonthField: '{{ field }} is required',
80
+ requiredYearField: '{{ field }} is required'
77
81
  };
@@ -11,10 +11,10 @@ export default class IsEmptyValue extends ConditionOperator {
11
11
  return false;
12
12
  }
13
13
  execute({ value, instance, conditionComponentPath }) {
14
- const isEmptyValue = _.isEmpty(value);
14
+ const isEmptyValue = _.isEmpty(_.isNumber(value) ? String(value) : value);
15
15
  if (instance?.root?.getComponent) {
16
16
  const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
17
- return conditionTriggerComponent ? conditionTriggerComponent.isEmpty() : isEmptyValue;
17
+ return conditionTriggerComponent?.isEmpty ? conditionTriggerComponent.isEmpty() : isEmptyValue;
18
18
  }
19
19
  return isEmptyValue;
20
20
  }
@@ -56,16 +56,7 @@ export function isMongoId(text: string): boolean;
56
56
  * @param {*} rowData - The contextual row data for the component.
57
57
  */
58
58
  export function checkCalculated(component: import('@formio/core').Component, submission: import('@formio/core').Submission, rowData: any): void;
59
- /**
60
- * Check if a simple conditional evaluates to true.
61
- * @param {import('@formio/core').Component} component - The component to check for the conditional.
62
- * @param {import('@formio/core').SimpleConditional} condition - The condition to check.
63
- * @param {*} row - The row data for the component.
64
- * @param {*} data - The full submission data.
65
- * @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
66
- * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
67
- */
68
- export function checkSimpleConditional(component: import('@formio/core').Component, condition: import('@formio/core').SimpleConditional, row: any, data: any, instance: any): boolean;
59
+ export function checkSimpleConditional(component: any, condition: any, row: any, data: any, instance: any): boolean;
69
60
  /**
70
61
  * Returns a components normalized value.
71
62
  * @param {string} compPath - The full path to the component.
@@ -532,4 +523,4 @@ import jsonLogic from 'json-logic-js';
532
523
  import ConditionOperators from './conditionOperators';
533
524
  import { Evaluator } from './Evaluator';
534
525
  export const interpolate: typeof Evaluator.interpolate;
535
- export { jsonLogic, ConditionOperators, Evaluator, _ };
526
+ export { jsonLogic, ConditionOperators, moment, Evaluator, _ };
@@ -1,6 +1,5 @@
1
1
  /* global jQuery */
2
2
  import _ from 'lodash';
3
- import fetchPonyfill from 'fetch-ponyfill';
4
3
  import jsonLogic from 'json-logic-js';
5
4
  import moment from 'moment-timezone/moment-timezone';
6
5
  import jtz from 'jstimezonedetect';
@@ -10,9 +9,6 @@ import { getValue } from './formUtils';
10
9
  import { Evaluator } from './Evaluator';
11
10
  import ConditionOperators from './conditionOperators';
12
11
  const interpolate = Evaluator.interpolate;
13
- const { fetch } = fetchPonyfill({
14
- Promise: Promise
15
- });
16
12
  export * from './formUtils';
17
13
  // Configure JsonLogic
18
14
  lodashOperators.forEach((name) => jsonLogic.add_operation(`_${name}`, _[name]));
@@ -28,8 +24,7 @@ jsonLogic.add_operation('relativeMinDate', (relativeMinDate) => {
28
24
  jsonLogic.add_operation('relativeMaxDate', (relativeMaxDate) => {
29
25
  return moment().add(relativeMaxDate, 'days').toISOString();
30
26
  });
31
- export { jsonLogic, ConditionOperators };
32
- export * as moment from 'moment-timezone/moment-timezone';
27
+ export { jsonLogic, ConditionOperators, moment };
33
28
  /**
34
29
  * Sets the path to the component and parent schema.
35
30
  * @param {import('@formio/core').Component} component - The component to set the path for.
@@ -149,6 +144,44 @@ export function checkCalculated(component, submission, rowData) {
149
144
  * @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
150
145
  * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
151
146
  */
147
+ function getConditionalPathsRecursive(conditionPaths, data) {
148
+ let currentGlobalIndex = 0;
149
+ const conditionalPathsArray = [];
150
+ const getConditionalPaths = (data, currentPath = '', localIndex = 0) => {
151
+ currentPath = currentPath.replace(/^\.+|\.+$/g, '');
152
+ const currentLocalIndex = localIndex;
153
+ const currentData = _.get(data, currentPath);
154
+ if (Array.isArray(currentData) && currentData.filter(Boolean).length > 0) {
155
+ if (currentData.some(element => typeof element !== 'object')) {
156
+ return;
157
+ }
158
+ const hasInnerDataArray = currentData.find(x => Array.isArray(x[conditionPaths[currentLocalIndex]]));
159
+ if (hasInnerDataArray) {
160
+ currentData.forEach((_, indexOutside) => {
161
+ const innerCompDataPath = `${currentPath}[${indexOutside}].${conditionPaths[currentLocalIndex]}`;
162
+ getConditionalPaths(data, innerCompDataPath, currentLocalIndex + 1);
163
+ });
164
+ }
165
+ else {
166
+ currentData.forEach((x, index) => {
167
+ if (!_.isNil(x[conditionPaths[currentLocalIndex]])) {
168
+ const compDataPath = `${currentPath}[${index}].${conditionPaths[currentLocalIndex]}`;
169
+ conditionalPathsArray.push(compDataPath);
170
+ }
171
+ });
172
+ }
173
+ }
174
+ else {
175
+ if (!conditionPaths[currentGlobalIndex]) {
176
+ return;
177
+ }
178
+ currentGlobalIndex = currentGlobalIndex + 1;
179
+ getConditionalPaths(data, `${currentPath}.${conditionPaths[currentGlobalIndex - 1]}`, currentGlobalIndex);
180
+ }
181
+ };
182
+ getConditionalPaths(data);
183
+ return conditionalPathsArray;
184
+ }
152
185
  export function checkSimpleConditional(component, condition, row, data, instance) {
153
186
  if (condition.when) {
154
187
  const value = getComponentActualValue(condition.when, data, row);
@@ -174,19 +207,32 @@ export function checkSimpleConditional(component, condition, row, data, instance
174
207
  if (!conditionComponentPath) {
175
208
  return true;
176
209
  }
177
- const value = getComponentActualValue(conditionComponentPath, data, row);
178
- const ConditionOperator = ConditionOperators[operator];
179
- return ConditionOperator
180
- ? new ConditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })
181
- : true;
210
+ const splittedConditionPath = conditionComponentPath.split('.');
211
+ const conditionalPaths = instance?.parent?.type === 'datagrid' || instance?.parent?.type === 'editgrid' ? [] : getConditionalPathsRecursive(splittedConditionPath, data);
212
+ if (conditionalPaths.length > 0) {
213
+ return conditionalPaths.map((path) => {
214
+ const value = getComponentActualValue(path, data, row);
215
+ const ConditionOperator = ConditionOperators[operator];
216
+ return ConditionOperator
217
+ ? new ConditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })
218
+ : true;
219
+ });
220
+ }
221
+ else {
222
+ const value = getComponentActualValue(conditionComponentPath, data, row);
223
+ const СonditionOperator = ConditionOperators[operator];
224
+ return СonditionOperator
225
+ ? new СonditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })
226
+ : true;
227
+ }
182
228
  });
183
229
  let result = false;
184
230
  switch (conjunction) {
185
231
  case 'any':
186
- result = _.some(conditionsResult, res => !!res);
232
+ result = _.some(conditionsResult.flat(), res => !!res);
187
233
  break;
188
234
  default:
189
- result = _.every(conditionsResult, res => !!res);
235
+ result = _.every(conditionsResult.flat(), res => !!res);
190
236
  }
191
237
  return show ? result : !result;
192
238
  }
@@ -96,14 +96,8 @@ export default class CalendarWidget extends InputWidget {
96
96
  this.settings.dateFormat = convertFormatToFlatpickr(this.settings.dateFormat);
97
97
  this.settings.position = 'auto center';
98
98
  this.settings.onChange = () => {
99
- if (this.settings.allowInput) {
100
- if (this.settings.isManuallyOverriddenValue && this.settings.enableTime) {
101
- this.calendar._input.value = this.settings.manualInputValue;
102
- }
103
- else {
104
- this.settings.manualInputValue = '';
105
- }
106
- this.settings.isManuallyOverriddenValue = false;
99
+ if (this.settings.allowInput && this.settings.enableTime) {
100
+ this.calendar._input.value = this.settings.isManuallyOverriddenValue ? this.settings.manualInputValue : this.calendar.altInput.value;
107
101
  }
108
102
  this.emit('update');
109
103
  };
@@ -112,8 +106,7 @@ export default class CalendarWidget extends InputWidget {
112
106
  this.hook('onCalendarClose');
113
107
  this.closedOn = Date.now();
114
108
  if (this.settings.allowInput && this.settings.enableTime) {
115
- this.calendar._input.value = this.settings.manualInputValue || this.calendar._input.value;
116
- this.settings.isManuallyOverriddenValue = false;
109
+ this.calendar._input.value = this.settings.isManuallyOverriddenValue ? this.settings.manualInputValue : this.calendar.altInput.value;
117
110
  this.emit('update');
118
111
  }
119
112
  if (this.settings.wasDefaultValueChanged) {
@@ -349,9 +342,14 @@ export default class CalendarWidget extends InputWidget {
349
342
  this.calendar = new Flatpickr(this._input, { ...this.settings, disableMobile: true });
350
343
  this.addEventListener(this.calendar.altInput, 'input', (event) => {
351
344
  if (this.settings.allowInput && this.settings.currentValue !== event.target.value) {
345
+ if (event.target.mask) {
346
+ event.target.mask.textMaskInputElement.update();
347
+ }
352
348
  this.settings.manualInputValue = event.target.value;
349
+ this._input.value = this.settings.manualInputValue;
353
350
  this.settings.isManuallyOverriddenValue = true;
354
351
  this.settings.currentValue = event.target.value;
352
+ this.emit('update');
355
353
  }
356
354
  if (event.target.value === '' && this.calendar.selectedDates.length > 0) {
357
355
  this.settings.wasDefaultValueChanged = true;
@@ -362,6 +360,18 @@ export default class CalendarWidget extends InputWidget {
362
360
  this.settings.wasDefaultValueChanged = false;
363
361
  }
364
362
  });
363
+ if (this.calendar.daysContainer) {
364
+ this.calendar.daysContainer.addEventListener('click', () => {
365
+ this.settings.isManuallyOverriddenValue = false;
366
+ this.calendar.updateValue(false);
367
+ });
368
+ }
369
+ if (this.calendar.timeContainer) {
370
+ this.calendar.timeContainer.addEventListener('click', () => {
371
+ this.settings.isManuallyOverriddenValue = false;
372
+ this.calendar.updateValue(false);
373
+ });
374
+ }
365
375
  const excludedFromMaskFormats = ['MMMM'];
366
376
  if (!this.settings.readOnly && !_.some(excludedFromMaskFormats, format => _.includes(this.settings.format, format))) {
367
377
  // Enforce the input mask of the format.
@@ -387,6 +397,10 @@ export default class CalendarWidget extends InputWidget {
387
397
  }
388
398
  // Make sure we commit the value after a blur event occurs.
389
399
  this.addEventListener(this.calendar._input, 'blur', (event) => {
400
+ // If we have manually overridden the value then we shouldn't call setDate because this will fill the input mask
401
+ if (this.settings.isManuallyOverriddenValue) {
402
+ return;
403
+ }
390
404
  const activeElement = this.settings.shadowRoot ? this.settings.shadowRoot.activeElement : document.activeElement;
391
405
  const relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;
392
406
  if (!(isIEBrowser && !relatedTarget) && !this.isCalendarElement(relatedTarget)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5673.3d062b9",
3
+ "version": "5.0.0-dev.5673.ae99c16",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "@formio/bootstrap": "3.0.0-dev.98.17ba6ea",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "2.1.0-dev.104.42720ba",
84
+ "@formio/core": "2.1.0-dev.145.4491833",
85
85
  "@formio/text-mask-addons": "^3.8.0-formio.2",
86
86
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
87
87
  "abortcontroller-polyfill": "^1.7.5",
@@ -89,21 +89,20 @@
89
89
  "bootstrap": "^5.3.3",
90
90
  "browser-cookies": "^1.2.0",
91
91
  "browser-md5-file": "^1.1.1",
92
- "compare-versions": "^6.0.0-rc.2",
92
+ "compare-versions": "^6.1.1",
93
93
  "core-js": "^3.37.1",
94
94
  "dialog-polyfill": "^0.5.6",
95
95
  "dom-autoscroller": "^2.3.4",
96
- "dompurify": "^3.1.3",
96
+ "dompurify": "^3.1.6",
97
97
  "downloadjs": "^1.4.7",
98
98
  "dragula": "^3.7.3",
99
99
  "eventemitter3": "^5.0.1",
100
100
  "fast-deep-equal": "^3.1.3",
101
101
  "fast-json-patch": "^3.1.1",
102
- "fetch-ponyfill": "^7.1.0",
103
102
  "idb": "^7.1.1",
104
103
  "inputmask": "^5.0.8",
105
104
  "ismobilejs": "^1.1.1",
106
- "json-logic-js": "^2.0.2",
105
+ "json-logic-js": "^2.0.5",
107
106
  "jstimezonedetect": "^1.0.7",
108
107
  "jwt-decode": "^3.1.2",
109
108
  "lodash": "^4.17.21",