@formio/js 5.0.0-dev.5641.d9ab3df → 5.0.0-dev.5642.afd813e

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 (455) hide show
  1. package/Changelog.md +0 -37
  2. package/dist/formio.embed.js +1 -1
  3. package/dist/formio.embed.min.js +1 -1
  4. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  5. package/dist/formio.form.js +1189 -608
  6. package/dist/formio.form.min.js +1 -1
  7. package/dist/formio.form.min.js.LICENSE.txt +5 -3
  8. package/dist/formio.full.js +913 -652
  9. package/dist/formio.full.min.js +1 -1
  10. package/dist/formio.full.min.js.LICENSE.txt +5 -3
  11. package/dist/formio.js +18 -18
  12. package/dist/formio.min.js +1 -1
  13. package/dist/formio.min.js.LICENSE.txt +1 -1
  14. package/dist/formio.utils.js +494 -1831
  15. package/dist/formio.utils.min.js +1 -1
  16. package/dist/formio.utils.min.js.LICENSE.txt +4 -10
  17. package/lib/cjs/CDN.d.ts +0 -1
  18. package/lib/cjs/CDN.js +3 -6
  19. package/lib/cjs/Element.d.ts +96 -86
  20. package/lib/cjs/Element.js +78 -68
  21. package/lib/cjs/Embed.d.ts +1 -1
  22. package/lib/cjs/Embed.js +12 -52
  23. package/lib/cjs/Form.d.ts +36 -365
  24. package/lib/cjs/Form.js +64 -50
  25. package/lib/cjs/FormBuilder.d.ts +2 -187
  26. package/lib/cjs/FormBuilder.js +8 -30
  27. package/lib/cjs/PDF.d.ts +13 -11
  28. package/lib/cjs/PDF.js +8 -6
  29. package/lib/cjs/Webform.d.ts +139 -180
  30. package/lib/cjs/Webform.js +296 -309
  31. package/lib/cjs/WebformBuilder.d.ts +14 -16
  32. package/lib/cjs/WebformBuilder.js +10 -11
  33. package/lib/cjs/Wizard.d.ts +21 -31
  34. package/lib/cjs/Wizard.js +20 -43
  35. package/lib/cjs/WizardBuilder.d.ts +1 -1
  36. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +5 -8
  37. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -6
  38. package/lib/cjs/components/Components.d.ts +4 -4
  39. package/lib/cjs/components/Components.js +3 -3
  40. package/lib/cjs/components/_classes/component/Component.d.ts +269 -502
  41. package/lib/cjs/components/_classes/component/Component.form.d.ts +3 -6
  42. package/lib/cjs/components/_classes/component/Component.form.js +0 -5
  43. package/lib/cjs/components/_classes/component/Component.js +189 -433
  44. package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
  45. package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +2 -2
  46. package/lib/cjs/components/_classes/component/editForm/utils.js +2 -2
  47. package/lib/cjs/components/_classes/field/Field.d.ts +2 -11
  48. package/lib/cjs/components/_classes/field/Field.js +1 -13
  49. package/lib/cjs/components/_classes/input/Input.d.ts +3 -4
  50. package/lib/cjs/components/_classes/input/Input.js +2 -2
  51. package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
  52. package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +3 -6
  53. package/lib/cjs/components/_classes/list/ListComponent.form.js +0 -5
  54. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +12 -43
  55. package/lib/cjs/components/_classes/multivalue/Multivalue.js +3 -37
  56. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +67 -163
  57. package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +3 -6
  58. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +0 -5
  59. package/lib/cjs/components/_classes/nested/NestedComponent.js +54 -175
  60. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
  61. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  62. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -7
  63. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +3 -2
  64. package/lib/cjs/components/address/Address.d.ts +2 -4
  65. package/lib/cjs/components/address/Address.form.d.ts +3 -6
  66. package/lib/cjs/components/address/Address.form.js +0 -5
  67. package/lib/cjs/components/button/Button.d.ts +12 -3
  68. package/lib/cjs/components/button/Button.form.d.ts +3 -6
  69. package/lib/cjs/components/button/Button.form.js +0 -5
  70. package/lib/cjs/components/button/Button.js +0 -5
  71. package/lib/cjs/components/checkbox/Checkbox.d.ts +27 -4
  72. package/lib/cjs/components/checkbox/Checkbox.form.d.ts +3 -6
  73. package/lib/cjs/components/checkbox/Checkbox.form.js +0 -5
  74. package/lib/cjs/components/columns/Columns.d.ts +2 -3
  75. package/lib/cjs/components/columns/Columns.form.d.ts +3 -6
  76. package/lib/cjs/components/columns/Columns.form.js +0 -5
  77. package/lib/cjs/components/columns/Columns.js +1 -1
  78. package/lib/cjs/components/container/Container.form.d.ts +3 -6
  79. package/lib/cjs/components/container/Container.form.js +0 -5
  80. package/lib/cjs/components/content/Content.d.ts +1 -2
  81. package/lib/cjs/components/content/Content.form.d.ts +3 -6
  82. package/lib/cjs/components/content/Content.form.js +0 -5
  83. package/lib/cjs/components/currency/Currency.form.d.ts +3 -6
  84. package/lib/cjs/components/currency/Currency.form.js +0 -5
  85. package/lib/cjs/components/currency/Currency.js +2 -1
  86. package/lib/cjs/components/datagrid/DataGrid.d.ts +7 -8
  87. package/lib/cjs/components/datagrid/DataGrid.form.d.ts +3 -6
  88. package/lib/cjs/components/datagrid/DataGrid.form.js +0 -5
  89. package/lib/cjs/components/datagrid/DataGrid.js +5 -5
  90. package/lib/cjs/components/datamap/DataMap.d.ts +0 -1
  91. package/lib/cjs/components/datamap/DataMap.form.d.ts +3 -6
  92. package/lib/cjs/components/datamap/DataMap.form.js +0 -5
  93. package/lib/cjs/components/datetime/DateTime.d.ts +14 -0
  94. package/lib/cjs/components/datetime/DateTime.form.d.ts +3 -6
  95. package/lib/cjs/components/datetime/DateTime.form.js +0 -5
  96. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
  97. package/lib/cjs/components/day/Day.d.ts +48 -22
  98. package/lib/cjs/components/day/Day.form.d.ts +3 -6
  99. package/lib/cjs/components/day/Day.form.js +0 -5
  100. package/lib/cjs/components/day/Day.js +20 -15
  101. package/lib/cjs/components/editgrid/EditGrid.d.ts +3 -7
  102. package/lib/cjs/components/editgrid/EditGrid.form.d.ts +3 -6
  103. package/lib/cjs/components/editgrid/EditGrid.form.js +0 -5
  104. package/lib/cjs/components/editgrid/EditGrid.js +3 -3
  105. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +5 -2
  106. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +9 -6
  107. package/lib/cjs/components/email/Email.form.d.ts +3 -6
  108. package/lib/cjs/components/email/Email.form.js +0 -5
  109. package/lib/cjs/components/fieldset/Fieldset.form.d.ts +3 -6
  110. package/lib/cjs/components/fieldset/Fieldset.form.js +0 -5
  111. package/lib/cjs/components/file/File.d.ts +22 -9
  112. package/lib/cjs/components/file/File.form.d.ts +3 -6
  113. package/lib/cjs/components/file/File.form.js +0 -5
  114. package/lib/cjs/components/file/File.js +1 -2
  115. package/lib/cjs/components/form/Form.d.ts +20 -31
  116. package/lib/cjs/components/form/Form.form.d.ts +3 -6
  117. package/lib/cjs/components/form/Form.form.js +0 -5
  118. package/lib/cjs/components/form/Form.js +14 -17
  119. package/lib/cjs/components/hidden/Hidden.d.ts +11 -1
  120. package/lib/cjs/components/hidden/Hidden.form.d.ts +3 -6
  121. package/lib/cjs/components/hidden/Hidden.form.js +0 -5
  122. package/lib/cjs/components/hidden/Hidden.js +2 -1
  123. package/lib/cjs/components/html/HTML.d.ts +1 -2
  124. package/lib/cjs/components/html/HTML.form.d.ts +3 -6
  125. package/lib/cjs/components/html/HTML.form.js +0 -5
  126. package/lib/cjs/components/number/Number.d.ts +17 -3
  127. package/lib/cjs/components/number/Number.form.d.ts +3 -6
  128. package/lib/cjs/components/number/Number.form.js +0 -5
  129. package/lib/cjs/components/number/Number.js +2 -1
  130. package/lib/cjs/components/panel/Panel.form.d.ts +3 -6
  131. package/lib/cjs/components/panel/Panel.form.js +0 -5
  132. package/lib/cjs/components/panel/Panel.js +1 -0
  133. package/lib/cjs/components/password/Password.form.d.ts +3 -6
  134. package/lib/cjs/components/password/Password.form.js +0 -5
  135. package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +3 -6
  136. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +0 -5
  137. package/lib/cjs/components/radio/Radio.d.ts +26 -3
  138. package/lib/cjs/components/radio/Radio.form.d.ts +3 -6
  139. package/lib/cjs/components/radio/Radio.form.js +0 -5
  140. package/lib/cjs/components/radio/Radio.js +4 -3
  141. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  142. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +3 -6
  143. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +0 -5
  144. package/lib/cjs/components/select/Select.d.ts +39 -16
  145. package/lib/cjs/components/select/Select.form.d.ts +3 -6
  146. package/lib/cjs/components/select/Select.form.js +0 -5
  147. package/lib/cjs/components/select/Select.js +16 -13
  148. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +17 -2
  149. package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +3 -6
  150. package/lib/cjs/components/selectboxes/SelectBoxes.form.js +0 -5
  151. package/lib/cjs/components/selectboxes/SelectBoxes.js +9 -7
  152. package/lib/cjs/components/signature/Signature.d.ts +14 -1
  153. package/lib/cjs/components/signature/Signature.form.d.ts +3 -6
  154. package/lib/cjs/components/signature/Signature.form.js +0 -5
  155. package/lib/cjs/components/survey/Survey.d.ts +15 -3
  156. package/lib/cjs/components/survey/Survey.form.d.ts +3 -6
  157. package/lib/cjs/components/survey/Survey.form.js +0 -5
  158. package/lib/cjs/components/table/Table.d.ts +1 -2
  159. package/lib/cjs/components/table/Table.form.d.ts +3 -6
  160. package/lib/cjs/components/table/Table.form.js +0 -5
  161. package/lib/cjs/components/tabs/Tabs.d.ts +4 -4
  162. package/lib/cjs/components/tabs/Tabs.form.d.ts +3 -6
  163. package/lib/cjs/components/tabs/Tabs.form.js +0 -5
  164. package/lib/cjs/components/tabs/Tabs.js +2 -1
  165. package/lib/cjs/components/tags/Tags.d.ts +14 -0
  166. package/lib/cjs/components/tags/Tags.form.d.ts +3 -6
  167. package/lib/cjs/components/tags/Tags.form.js +0 -5
  168. package/lib/cjs/components/textarea/TextArea.d.ts +9 -4
  169. package/lib/cjs/components/textarea/TextArea.form.d.ts +3 -6
  170. package/lib/cjs/components/textarea/TextArea.form.js +0 -5
  171. package/lib/cjs/components/textarea/TextArea.js +2 -2
  172. package/lib/cjs/components/textfield/TextField.d.ts +30 -14
  173. package/lib/cjs/components/textfield/TextField.form.d.ts +3 -6
  174. package/lib/cjs/components/textfield/TextField.form.js +0 -5
  175. package/lib/cjs/components/textfield/TextField.js +17 -16
  176. package/lib/cjs/components/time/Time.form.d.ts +3 -6
  177. package/lib/cjs/components/time/Time.form.js +0 -5
  178. package/lib/cjs/components/unknown/Unknown.form.d.ts +34 -5
  179. package/lib/cjs/components/unknown/Unknown.form.js +0 -4
  180. package/lib/cjs/components/url/Url.form.d.ts +3 -6
  181. package/lib/cjs/components/url/Url.form.js +0 -5
  182. package/lib/cjs/components/well/Well.form.d.ts +3 -6
  183. package/lib/cjs/components/well/Well.form.js +0 -5
  184. package/lib/cjs/formio.embed.d.ts +2 -1
  185. package/lib/cjs/formio.embed.js +100 -2
  186. package/lib/cjs/formio.form.d.ts +4 -11
  187. package/lib/cjs/formio.form.js +5 -13
  188. package/lib/cjs/providers/Providers.d.ts +5 -36
  189. package/lib/cjs/providers/Providers.js +0 -29
  190. package/lib/cjs/providers/address/AddressProvider.d.ts +12 -131
  191. package/lib/cjs/providers/address/AddressProvider.js +2 -88
  192. package/lib/cjs/providers/address/AzureAddressProvider.d.ts +1 -48
  193. package/lib/cjs/providers/address/AzureAddressProvider.js +0 -37
  194. package/lib/cjs/providers/address/CustomAddressProvider.d.ts +4 -27
  195. package/lib/cjs/providers/address/CustomAddressProvider.js +0 -34
  196. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +6 -130
  197. package/lib/cjs/providers/address/GoogleAddressProvider.js +0 -72
  198. package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +7 -32
  199. package/lib/cjs/providers/address/NominatimAddressProvider.js +0 -33
  200. package/lib/cjs/providers/address/index.d.ts +1 -3
  201. package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -7
  202. package/lib/cjs/providers/processor/fileProcessor.js +0 -6
  203. package/lib/cjs/providers/storage/azure.d.ts +13 -6
  204. package/lib/cjs/providers/storage/azure.js +0 -5
  205. package/lib/cjs/providers/storage/base64.d.ts +6 -5
  206. package/lib/cjs/providers/storage/base64.js +0 -4
  207. package/lib/cjs/providers/storage/dropbox.d.ts +4 -6
  208. package/lib/cjs/providers/storage/dropbox.js +0 -5
  209. package/lib/cjs/providers/storage/googleDrive.d.ts +5 -7
  210. package/lib/cjs/providers/storage/googleDrive.js +0 -6
  211. package/lib/cjs/providers/storage/indexeddb.d.ts +7 -5
  212. package/lib/cjs/providers/storage/indexeddb.js +0 -4
  213. package/lib/cjs/providers/storage/s3.d.ts +20 -6
  214. package/lib/cjs/providers/storage/s3.js +0 -5
  215. package/lib/cjs/providers/storage/url.d.ts +7 -6
  216. package/lib/cjs/providers/storage/url.js +0 -10
  217. package/lib/cjs/providers/storage/util.d.ts +1 -24
  218. package/lib/cjs/providers/storage/util.js +0 -18
  219. package/lib/cjs/templates/Templates.d.ts +0 -1
  220. package/lib/cjs/utils/Evaluator.d.ts +3 -6
  221. package/lib/cjs/utils/Evaluator.js +20 -11
  222. package/lib/cjs/utils/builder.d.ts +7 -9
  223. package/lib/cjs/utils/builder.js +5 -10
  224. package/lib/cjs/utils/calendarUtils.d.ts +13 -7
  225. package/lib/cjs/utils/calendarUtils.js +17 -10
  226. package/lib/cjs/utils/formUtils.d.ts +171 -43
  227. package/lib/cjs/utils/formUtils.js +569 -38
  228. package/lib/cjs/utils/utils.d.ts +221 -367
  229. package/lib/cjs/utils/utils.js +228 -335
  230. package/lib/cjs/widgets/CalendarWidget.d.ts +10 -9
  231. package/lib/cjs/widgets/CalendarWidget.js +11 -9
  232. package/lib/mjs/CDN.d.ts +0 -1
  233. package/lib/mjs/CDN.js +3 -6
  234. package/lib/mjs/Element.d.ts +96 -86
  235. package/lib/mjs/Element.js +78 -68
  236. package/lib/mjs/Embed.d.ts +1 -1
  237. package/lib/mjs/Embed.js +12 -52
  238. package/lib/mjs/Form.d.ts +36 -365
  239. package/lib/mjs/Form.js +57 -140
  240. package/lib/mjs/FormBuilder.d.ts +2 -187
  241. package/lib/mjs/FormBuilder.js +8 -32
  242. package/lib/mjs/PDF.d.ts +13 -11
  243. package/lib/mjs/PDF.js +8 -6
  244. package/lib/mjs/Webform.d.ts +139 -180
  245. package/lib/mjs/Webform.js +308 -321
  246. package/lib/mjs/WebformBuilder.d.ts +14 -16
  247. package/lib/mjs/WebformBuilder.js +10 -11
  248. package/lib/mjs/Wizard.d.ts +21 -31
  249. package/lib/mjs/Wizard.js +19 -42
  250. package/lib/mjs/WizardBuilder.d.ts +1 -1
  251. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +5 -8
  252. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -6
  253. package/lib/mjs/components/Components.d.ts +4 -4
  254. package/lib/mjs/components/Components.js +3 -3
  255. package/lib/mjs/components/_classes/component/Component.d.ts +269 -502
  256. package/lib/mjs/components/_classes/component/Component.form.d.ts +3 -6
  257. package/lib/mjs/components/_classes/component/Component.form.js +0 -5
  258. package/lib/mjs/components/_classes/component/Component.js +189 -433
  259. package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
  260. package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -1
  261. package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
  262. package/lib/mjs/components/_classes/field/Field.d.ts +2 -11
  263. package/lib/mjs/components/_classes/field/Field.js +1 -13
  264. package/lib/mjs/components/_classes/input/Input.d.ts +3 -4
  265. package/lib/mjs/components/_classes/input/Input.js +2 -2
  266. package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
  267. package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +3 -6
  268. package/lib/mjs/components/_classes/list/ListComponent.form.js +0 -5
  269. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +12 -43
  270. package/lib/mjs/components/_classes/multivalue/Multivalue.js +3 -37
  271. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +67 -163
  272. package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +3 -6
  273. package/lib/mjs/components/_classes/nested/NestedComponent.form.js +0 -5
  274. package/lib/mjs/components/_classes/nested/NestedComponent.js +54 -175
  275. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
  276. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  277. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -7
  278. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +3 -2
  279. package/lib/mjs/components/address/Address.d.ts +2 -4
  280. package/lib/mjs/components/address/Address.form.d.ts +3 -6
  281. package/lib/mjs/components/address/Address.form.js +0 -5
  282. package/lib/mjs/components/button/Button.d.ts +12 -3
  283. package/lib/mjs/components/button/Button.form.d.ts +3 -6
  284. package/lib/mjs/components/button/Button.form.js +0 -5
  285. package/lib/mjs/components/button/Button.js +0 -5
  286. package/lib/mjs/components/checkbox/Checkbox.d.ts +27 -4
  287. package/lib/mjs/components/checkbox/Checkbox.form.d.ts +3 -6
  288. package/lib/mjs/components/checkbox/Checkbox.form.js +0 -5
  289. package/lib/mjs/components/columns/Columns.d.ts +2 -3
  290. package/lib/mjs/components/columns/Columns.form.d.ts +3 -6
  291. package/lib/mjs/components/columns/Columns.form.js +0 -5
  292. package/lib/mjs/components/columns/Columns.js +1 -1
  293. package/lib/mjs/components/container/Container.form.d.ts +3 -6
  294. package/lib/mjs/components/container/Container.form.js +0 -5
  295. package/lib/mjs/components/content/Content.d.ts +1 -2
  296. package/lib/mjs/components/content/Content.form.d.ts +3 -6
  297. package/lib/mjs/components/content/Content.form.js +0 -5
  298. package/lib/mjs/components/currency/Currency.form.d.ts +3 -6
  299. package/lib/mjs/components/currency/Currency.form.js +0 -5
  300. package/lib/mjs/components/currency/Currency.js +2 -1
  301. package/lib/mjs/components/datagrid/DataGrid.d.ts +7 -8
  302. package/lib/mjs/components/datagrid/DataGrid.form.d.ts +3 -6
  303. package/lib/mjs/components/datagrid/DataGrid.form.js +0 -5
  304. package/lib/mjs/components/datagrid/DataGrid.js +5 -5
  305. package/lib/mjs/components/datamap/DataMap.d.ts +0 -1
  306. package/lib/mjs/components/datamap/DataMap.form.d.ts +3 -6
  307. package/lib/mjs/components/datamap/DataMap.form.js +0 -5
  308. package/lib/mjs/components/datetime/DateTime.d.ts +14 -0
  309. package/lib/mjs/components/datetime/DateTime.form.d.ts +3 -6
  310. package/lib/mjs/components/datetime/DateTime.form.js +0 -5
  311. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
  312. package/lib/mjs/components/day/Day.d.ts +48 -22
  313. package/lib/mjs/components/day/Day.form.d.ts +3 -6
  314. package/lib/mjs/components/day/Day.form.js +0 -5
  315. package/lib/mjs/components/day/Day.js +20 -15
  316. package/lib/mjs/components/editgrid/EditGrid.d.ts +3 -7
  317. package/lib/mjs/components/editgrid/EditGrid.form.d.ts +3 -6
  318. package/lib/mjs/components/editgrid/EditGrid.form.js +0 -5
  319. package/lib/mjs/components/editgrid/EditGrid.js +3 -3
  320. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  321. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +1 -1
  322. package/lib/mjs/components/email/Email.form.d.ts +3 -6
  323. package/lib/mjs/components/email/Email.form.js +0 -5
  324. package/lib/mjs/components/fieldset/Fieldset.form.d.ts +3 -6
  325. package/lib/mjs/components/fieldset/Fieldset.form.js +0 -5
  326. package/lib/mjs/components/file/File.d.ts +22 -9
  327. package/lib/mjs/components/file/File.form.d.ts +3 -6
  328. package/lib/mjs/components/file/File.form.js +0 -5
  329. package/lib/mjs/components/file/File.js +1 -2
  330. package/lib/mjs/components/form/Form.d.ts +20 -31
  331. package/lib/mjs/components/form/Form.form.d.ts +3 -6
  332. package/lib/mjs/components/form/Form.form.js +0 -5
  333. package/lib/mjs/components/form/Form.js +12 -15
  334. package/lib/mjs/components/hidden/Hidden.d.ts +11 -1
  335. package/lib/mjs/components/hidden/Hidden.form.d.ts +3 -6
  336. package/lib/mjs/components/hidden/Hidden.form.js +0 -5
  337. package/lib/mjs/components/hidden/Hidden.js +2 -1
  338. package/lib/mjs/components/html/HTML.d.ts +1 -2
  339. package/lib/mjs/components/html/HTML.form.d.ts +3 -6
  340. package/lib/mjs/components/html/HTML.form.js +0 -5
  341. package/lib/mjs/components/number/Number.d.ts +17 -3
  342. package/lib/mjs/components/number/Number.form.d.ts +3 -6
  343. package/lib/mjs/components/number/Number.form.js +0 -5
  344. package/lib/mjs/components/number/Number.js +2 -1
  345. package/lib/mjs/components/panel/Panel.form.d.ts +3 -6
  346. package/lib/mjs/components/panel/Panel.form.js +0 -5
  347. package/lib/mjs/components/panel/Panel.js +1 -0
  348. package/lib/mjs/components/password/Password.form.d.ts +3 -6
  349. package/lib/mjs/components/password/Password.form.js +0 -5
  350. package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +3 -6
  351. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +0 -5
  352. package/lib/mjs/components/radio/Radio.d.ts +26 -3
  353. package/lib/mjs/components/radio/Radio.form.d.ts +3 -6
  354. package/lib/mjs/components/radio/Radio.form.js +0 -5
  355. package/lib/mjs/components/radio/Radio.js +4 -3
  356. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  357. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +3 -6
  358. package/lib/mjs/components/recaptcha/ReCaptcha.form.js +0 -5
  359. package/lib/mjs/components/select/Select.d.ts +39 -16
  360. package/lib/mjs/components/select/Select.form.d.ts +3 -6
  361. package/lib/mjs/components/select/Select.form.js +0 -5
  362. package/lib/mjs/components/select/Select.js +17 -14
  363. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +17 -2
  364. package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +3 -6
  365. package/lib/mjs/components/selectboxes/SelectBoxes.form.js +0 -5
  366. package/lib/mjs/components/selectboxes/SelectBoxes.js +9 -7
  367. package/lib/mjs/components/signature/Signature.d.ts +14 -1
  368. package/lib/mjs/components/signature/Signature.form.d.ts +3 -6
  369. package/lib/mjs/components/signature/Signature.form.js +0 -5
  370. package/lib/mjs/components/survey/Survey.d.ts +15 -3
  371. package/lib/mjs/components/survey/Survey.form.d.ts +3 -6
  372. package/lib/mjs/components/survey/Survey.form.js +0 -5
  373. package/lib/mjs/components/table/Table.d.ts +1 -2
  374. package/lib/mjs/components/table/Table.form.d.ts +3 -6
  375. package/lib/mjs/components/table/Table.form.js +0 -5
  376. package/lib/mjs/components/tabs/Tabs.d.ts +4 -4
  377. package/lib/mjs/components/tabs/Tabs.form.d.ts +3 -6
  378. package/lib/mjs/components/tabs/Tabs.form.js +0 -5
  379. package/lib/mjs/components/tabs/Tabs.js +2 -1
  380. package/lib/mjs/components/tags/Tags.d.ts +14 -0
  381. package/lib/mjs/components/tags/Tags.form.d.ts +3 -6
  382. package/lib/mjs/components/tags/Tags.form.js +0 -5
  383. package/lib/mjs/components/textarea/TextArea.d.ts +9 -4
  384. package/lib/mjs/components/textarea/TextArea.form.d.ts +3 -6
  385. package/lib/mjs/components/textarea/TextArea.form.js +0 -5
  386. package/lib/mjs/components/textarea/TextArea.js +2 -2
  387. package/lib/mjs/components/textfield/TextField.d.ts +30 -14
  388. package/lib/mjs/components/textfield/TextField.form.d.ts +3 -6
  389. package/lib/mjs/components/textfield/TextField.form.js +0 -5
  390. package/lib/mjs/components/textfield/TextField.js +17 -16
  391. package/lib/mjs/components/time/Time.form.d.ts +3 -6
  392. package/lib/mjs/components/time/Time.form.js +0 -5
  393. package/lib/mjs/components/unknown/Unknown.form.d.ts +34 -5
  394. package/lib/mjs/components/unknown/Unknown.form.js +0 -4
  395. package/lib/mjs/components/url/Url.form.d.ts +3 -6
  396. package/lib/mjs/components/url/Url.form.js +0 -5
  397. package/lib/mjs/components/well/Well.form.d.ts +3 -6
  398. package/lib/mjs/components/well/Well.form.js +0 -5
  399. package/lib/mjs/formio.embed.d.ts +2 -1
  400. package/lib/mjs/formio.embed.js +99 -2
  401. package/lib/mjs/formio.form.d.ts +4 -11
  402. package/lib/mjs/formio.form.js +3 -10
  403. package/lib/mjs/providers/Providers.d.ts +5 -36
  404. package/lib/mjs/providers/Providers.js +0 -29
  405. package/lib/mjs/providers/address/AddressProvider.d.ts +12 -131
  406. package/lib/mjs/providers/address/AddressProvider.js +2 -88
  407. package/lib/mjs/providers/address/AzureAddressProvider.d.ts +1 -48
  408. package/lib/mjs/providers/address/AzureAddressProvider.js +0 -37
  409. package/lib/mjs/providers/address/CustomAddressProvider.d.ts +4 -27
  410. package/lib/mjs/providers/address/CustomAddressProvider.js +0 -34
  411. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +6 -130
  412. package/lib/mjs/providers/address/GoogleAddressProvider.js +0 -72
  413. package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +7 -32
  414. package/lib/mjs/providers/address/NominatimAddressProvider.js +0 -33
  415. package/lib/mjs/providers/address/index.d.ts +1 -3
  416. package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -7
  417. package/lib/mjs/providers/processor/fileProcessor.js +0 -6
  418. package/lib/mjs/providers/storage/azure.d.ts +13 -6
  419. package/lib/mjs/providers/storage/azure.js +0 -5
  420. package/lib/mjs/providers/storage/base64.d.ts +6 -5
  421. package/lib/mjs/providers/storage/base64.js +0 -4
  422. package/lib/mjs/providers/storage/dropbox.d.ts +4 -6
  423. package/lib/mjs/providers/storage/dropbox.js +0 -5
  424. package/lib/mjs/providers/storage/googleDrive.d.ts +5 -7
  425. package/lib/mjs/providers/storage/googleDrive.js +0 -6
  426. package/lib/mjs/providers/storage/indexeddb.d.ts +7 -5
  427. package/lib/mjs/providers/storage/indexeddb.js +0 -4
  428. package/lib/mjs/providers/storage/s3.d.ts +20 -6
  429. package/lib/mjs/providers/storage/s3.js +0 -5
  430. package/lib/mjs/providers/storage/url.d.ts +7 -6
  431. package/lib/mjs/providers/storage/url.js +0 -10
  432. package/lib/mjs/providers/storage/util.d.ts +1 -24
  433. package/lib/mjs/providers/storage/util.js +0 -18
  434. package/lib/mjs/templates/Templates.d.ts +0 -1
  435. package/lib/mjs/utils/Evaluator.d.ts +3 -6
  436. package/lib/mjs/utils/Evaluator.js +20 -9
  437. package/lib/mjs/utils/builder.d.ts +7 -9
  438. package/lib/mjs/utils/builder.js +5 -10
  439. package/lib/mjs/utils/calendarUtils.d.ts +13 -7
  440. package/lib/mjs/utils/calendarUtils.js +17 -10
  441. package/lib/mjs/utils/formUtils.d.ts +171 -43
  442. package/lib/mjs/utils/formUtils.js +554 -6
  443. package/lib/mjs/utils/utils.d.ts +221 -367
  444. package/lib/mjs/utils/utils.js +222 -329
  445. package/lib/mjs/widgets/CalendarWidget.d.ts +10 -9
  446. package/lib/mjs/widgets/CalendarWidget.js +11 -9
  447. package/package.json +22 -22
  448. package/embed.d.ts +0 -1
  449. package/form.d.ts +0 -1
  450. package/lib/cjs/InlineEmbed.d.ts +0 -7
  451. package/lib/cjs/InlineEmbed.js +0 -116
  452. package/lib/mjs/InlineEmbed.d.ts +0 -7
  453. package/lib/mjs/InlineEmbed.js +0 -112
  454. package/sdk.d.ts +0 -1
  455. package/utils.d.ts +0 -1
@@ -7,7 +7,7 @@ import jtz from 'jstimezonedetect';
7
7
  import { lodashOperators } from './jsonlogic/operators';
8
8
  import dompurify from 'dompurify';
9
9
  import { getValue } from './formUtils';
10
- import { Evaluator } from './Evaluator';
10
+ import Evaluator from './Evaluator';
11
11
  import ConditionOperators from './conditionOperators';
12
12
  const interpolate = Evaluator.interpolate;
13
13
  const { fetch } = fetchPonyfill({
@@ -30,10 +30,6 @@ jsonLogic.add_operation('relativeMaxDate', (relativeMaxDate) => {
30
30
  });
31
31
  export { jsonLogic, ConditionOperators };
32
32
  export * as moment from 'moment-timezone/moment-timezone';
33
- /**
34
- * Sets the path to the component and parent schema.
35
- * @param {import('@formio/core').Component} component - The component to set the path for.
36
- */
37
33
  function setPathToComponentAndPerentSchema(component) {
38
34
  component.path = getComponentPath(component);
39
35
  const dataParent = getDataParentComponent(component);
@@ -43,28 +39,77 @@ function setPathToComponentAndPerentSchema(component) {
43
39
  }
44
40
  /**
45
41
  * Evaluate a method.
46
- * @param {Function|string|object} func - The function to evaluate.
47
- * @param {*} args - A map of arguments to pass to the function.
48
- * @param {string} ret - The name of the "return" variable in the script.
49
- * @param {boolean} interpolate - True if the script should be interpolated before being executed.
50
- * @param {import('@formio/core').EvaluatorOptions} options - The evaluator options.
51
- * @returns {*} - The result of the evaluation.
52
- */
53
- export function evaluate(func, args, ret, interpolate, options = {}) {
54
- return Evaluator.evaluate(func, args, ret, interpolate, undefined, options);
42
+ *
43
+ * @param func
44
+ * @param args
45
+ * @return {*}
46
+ */
47
+ export function evaluate(func, args, ret, tokenize) {
48
+ let returnVal = null;
49
+ const component = args.component ? args.component : { key: 'unknown' };
50
+ if (!args.form && args.instance) {
51
+ args.form = _.get(args.instance, 'root._form', {});
52
+ }
53
+ const componentKey = component.key;
54
+ if (typeof func === 'string') {
55
+ if (ret) {
56
+ func += `;return ${ret}`;
57
+ }
58
+ if (tokenize) {
59
+ // Replace all {{ }} references with actual data.
60
+ func = func.replace(/({{\s+(.*)\s+}})/, (match, $1, $2) => {
61
+ if ($2.indexOf('data.') === 0) {
62
+ return _.get(args.data, $2.replace('data.', ''));
63
+ }
64
+ else if ($2.indexOf('row.') === 0) {
65
+ return _.get(args.row, $2.replace('row.', ''));
66
+ }
67
+ // Support legacy...
68
+ return _.get(args.data, $2);
69
+ });
70
+ }
71
+ try {
72
+ func = Evaluator.evaluator(func, args);
73
+ args = _.values(args);
74
+ }
75
+ catch (err) {
76
+ console.warn(`An error occured within the custom function for ${componentKey}`, err);
77
+ returnVal = null;
78
+ func = false;
79
+ }
80
+ }
81
+ if (typeof func === 'function') {
82
+ try {
83
+ returnVal = Evaluator.evaluate(func, args);
84
+ }
85
+ catch (err) {
86
+ returnVal = null;
87
+ console.warn(`An error occured within custom function for ${componentKey}`, err);
88
+ }
89
+ }
90
+ else if (typeof func === 'object') {
91
+ try {
92
+ returnVal = jsonLogic.apply(func, args);
93
+ }
94
+ catch (err) {
95
+ returnVal = null;
96
+ console.warn(`An error occured within custom function for ${componentKey}`, err);
97
+ }
98
+ }
99
+ else if (func) {
100
+ console.warn(`Unknown function type for ${componentKey}`);
101
+ }
102
+ return returnVal;
55
103
  }
56
- /**
57
- * Returns a random compoennt ID.
58
- * @returns {string} - A random component ID.
59
- */
60
104
  export function getRandomComponentId() {
61
105
  return `e${Math.random().toString(36).substring(7)}`;
62
106
  }
63
107
  /**
64
108
  * Get a property value of an element.
65
- * @param {CSSStyleDeclaration} style - The style element to get the property value from.
66
- * @param {string} prop - The property to get the value for.
67
- * @returns {number} - The value of the property.
109
+ *
110
+ * @param style
111
+ * @param prop
112
+ * @return {number}
68
113
  */
69
114
  export function getPropertyValue(style, prop) {
70
115
  let value = style.getPropertyValue(prop);
@@ -73,8 +118,9 @@ export function getPropertyValue(style, prop) {
73
118
  }
74
119
  /**
75
120
  * Get an elements bounding rectagle.
76
- * @param {HTMLElement} element - A DOM element to get the bounding rectangle for.
77
- * @returns {{x: number, y: number, width: number, height: number}} - The bounding rectangle.
121
+ *
122
+ * @param element
123
+ * @return {{x: string, y: string, width: string, height: string}}
78
124
  */
79
125
  export function getElementRect(element) {
80
126
  const style = window.getComputedStyle(element, null);
@@ -87,8 +133,8 @@ export function getElementRect(element) {
87
133
  }
88
134
  /**
89
135
  * Get non HTMLElement property in the window object
90
- * @param {string} property - The window property to fetch the script plugin from.
91
- * @returns {any | undefined} - The HTML Element property on the window object.
136
+ * @param {String} property
137
+ * @return {any || undefined}
92
138
  */
93
139
  export function getScriptPlugin(property) {
94
140
  const obj = window[property];
@@ -100,8 +146,9 @@ export function getScriptPlugin(property) {
100
146
  }
101
147
  /**
102
148
  * Determines the boolean value of a setting.
103
- * @param {string|boolean} value - A string or boolean value to convert to boolean.
104
- * @returns {boolean} - The boolean value of the setting.
149
+ *
150
+ * @param value
151
+ * @return {boolean}
105
152
  */
106
153
  export function boolValue(value) {
107
154
  if (_.isBoolean(value)) {
@@ -116,17 +163,21 @@ export function boolValue(value) {
116
163
  }
117
164
  /**
118
165
  * Check to see if an ID is a mongoID.
119
- * @param {string} text - The text to check if it is a mongoID.
120
- * @returns {boolean} - TRUE if the text is a mongoID; FALSE otherwise.
166
+ * @param text
167
+ * @return {Array|{index: number, input: string}|Boolean|*}
121
168
  */
122
169
  export function isMongoId(text) {
123
- return !!text.toString().match(/^[0-9a-fA-F]{24}$/);
170
+ return text.toString().match(/^[0-9a-fA-F]{24}$/);
124
171
  }
125
172
  /**
126
173
  * Checks the calculated value for a provided component and data.
127
- * @param {import('@formio/core').Component} component - The component to check for the calculated value.
128
- * @param {import('@formio/core').Submission} submission - A submission object.
129
- * @param {*} rowData - The contextual row data for the component.
174
+ *
175
+ * @param {Object} component
176
+ * The component to check for the calculated value.
177
+ * @param {Object} submission
178
+ * A submission object.
179
+ * @param data
180
+ * The full submission data.
130
181
  */
131
182
  export function checkCalculated(component, submission, rowData) {
132
183
  // Process calculated value stuff if present.
@@ -142,12 +193,13 @@ export function checkCalculated(component, submission, rowData) {
142
193
  }
143
194
  /**
144
195
  * Check if a simple conditional evaluates to true.
145
- * @param {import('@formio/core').Component} component - The component to check for the conditional.
146
- * @param {import('@formio/core').SimpleConditional} condition - The condition to check.
147
- * @param {*} row - The row data for the component.
148
- * @param {*} data - The full submission data.
149
- * @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
150
- * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
196
+ *
197
+ * @param condition
198
+ * @param condition
199
+ * @param row
200
+ * @param data
201
+ * @param instance
202
+ * @returns {boolean}
151
203
  */
152
204
  export function checkSimpleConditional(component, condition, row, data, instance) {
153
205
  if (condition.when) {
@@ -191,13 +243,6 @@ export function checkSimpleConditional(component, condition, row, data, instance
191
243
  return show ? result : !result;
192
244
  }
193
245
  }
194
- /**
195
- * Returns a components normalized value.
196
- * @param {string} compPath - The full path to the component.
197
- * @param {*} data - The data object to get the value from.
198
- * @param {*} row - The contextual row data for the component.
199
- * @returns {*} - The normalized value of the component.
200
- */
201
246
  export function getComponentActualValue(compPath, data, row) {
202
247
  let value = null;
203
248
  if (row) {
@@ -214,15 +259,12 @@ export function getComponentActualValue(compPath, data, row) {
214
259
  }
215
260
  /**
216
261
  * Check custom javascript conditional.
217
- * @param {import('@formio/core').Component} component - The component to check for the conditional.
218
- * @param {string} custom - The custom conditional string to evaluate.
219
- * @param {*} row - The row data for the component.
220
- * @param {*} data - The full submission data.
221
- * @param {import('@formio/core').Form} form - The form object.
222
- * @param {string} variable - The variable name for the result of the custom conditional.
223
- * @param {*} onError - A custom return if there is an error or the value is null from the evaluation.
224
- * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.
225
- * @returns {*} - The result of the evaulation.
262
+ *
263
+ * @param component
264
+ * @param custom
265
+ * @param row
266
+ * @param data
267
+ * @returns {*}
226
268
  */
227
269
  export function checkCustomConditional(component, custom, row, data, form, variable, onError, instance) {
228
270
  if (typeof custom === 'string') {
@@ -236,16 +278,6 @@ export function checkCustomConditional(component, custom, row, data, form, varia
236
278
  }
237
279
  return value;
238
280
  }
239
- /**
240
- * Check a component for JSON conditionals.
241
- * @param {import('@formio/core').Component} component - The component
242
- * @param {import('@formio/core').JSONConditional} json - The json conditional to check.
243
- * @param {*} row - The contextual row data for the component.
244
- * @param {*} data - The full submission data.
245
- * @param {import('@formio/core').Form} form - The Form JSON of the form.
246
- * @param {*} onError - Custom return value if there is an error.
247
- * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
248
- */
249
281
  export function checkJsonConditional(component, json, row, data, form, onError) {
250
282
  try {
251
283
  return jsonLogic.apply(json, {
@@ -260,14 +292,6 @@ export function checkJsonConditional(component, json, row, data, form, onError)
260
292
  return onError;
261
293
  }
262
294
  }
263
- /**
264
- * Returns the contextual row data for a component.
265
- * @param {import('@formio/core').Component} component - The component to get the row data for.
266
- * @param {*} row - The row data for the component.
267
- * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.
268
- * @param {*} conditional - The component conditional.
269
- * @returns {*} - The contextual row data for the component.
270
- */
271
295
  function getRow(component, row, instance, conditional) {
272
296
  const condition = conditional || component.conditional;
273
297
  // If no component's instance passed (happens only in 6.x server), calculate its path based on the schema
@@ -289,12 +313,15 @@ function getRow(component, row, instance, conditional) {
289
313
  }
290
314
  /**
291
315
  * Checks the conditions for a provided component and data.
292
- * @param {import('@formio/core').Component} component - The component to check for the condition.
293
- * @param {*} row - The data within a row
294
- * @param {*} data - The full submission data.
295
- * @param {import('@formio/core').Form} form - The form object.
296
- * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.
297
- * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
316
+ *
317
+ * @param component
318
+ * The component to check for the condition.
319
+ * @param row
320
+ * The data within a row
321
+ * @param data
322
+ * The full submission data.
323
+ *
324
+ * @returns {boolean}
298
325
  */
299
326
  export function checkCondition(component, row, data, form, instance) {
300
327
  const { customConditional, conditional } = component;
@@ -313,13 +340,12 @@ export function checkCondition(component, row, data, form, instance) {
313
340
  }
314
341
  /**
315
342
  * Test a trigger on a component.
316
- * @param {import('@formio/core').Component} component - The component to test the trigger against.
317
- * @param {import('@formio/core').LogicTrigger} trigger - The trigger configuration.
318
- * @param {import('@formio/core').DataObject} row - The contextual row data.
319
- * @param {import('@formio/core').DataObject} data - The root data object.
320
- * @param {import('@formio/core').Form} form - The form object.
321
- * @param {any} instance - The component that is performing the trigger.
322
- * @returns {boolean} - TRUE if the trigger should fire; FALSE otherwise.
343
+ *
344
+ * @param component
345
+ * @param action
346
+ * @param data
347
+ * @param row
348
+ * @returns {mixed}
323
349
  */
324
350
  export function checkTrigger(component, trigger, row, data, form, instance) {
325
351
  // If trigger is empty, don't fire it
@@ -338,16 +364,6 @@ export function checkTrigger(component, trigger, row, data, form, instance) {
338
364
  // If none of the types matched, don't fire the trigger.
339
365
  return false;
340
366
  }
341
- /**
342
- * Sets a property on a component via an executed Logic action.
343
- * @param {import('@formio/core').Component} component - The component to set the property on.
344
- * @param {import('@formio/core').LogicAction} action - The action to perform on the component.
345
- * @param {string} result - The name of the variable in the evaulation to use as the result.
346
- * @param {import('@formio/core').DataObject} row - The contextual row data.
347
- * @param {import('@formio/core').DataObject} data - The full submission data.
348
- * @param {any} instance - The component instance.
349
- * @returns {import('@formio/core').Component} - The modified component.
350
- */
351
367
  export function setActionProperty(component, action, result, row, data, instance) {
352
368
  const property = action.property.value;
353
369
  switch (action.property.type) {
@@ -381,8 +397,8 @@ export function setActionProperty(component, action, result, row, data, instance
381
397
  }
382
398
  /**
383
399
  * Removes HTML tags from string e.g. <div>Hello World</div> => Hello World
384
- * @param {string} str - The string to remove HTML tags from.
385
- * @returns {string} - The string without HTML tags.
400
+ * @param {string} str
401
+ * @returns {string}
386
402
  */
387
403
  export function removeHTML(str) {
388
404
  const doc = new window.DOMParser().parseFromString(str, 'text/html');
@@ -390,8 +406,8 @@ export function removeHTML(str) {
390
406
  }
391
407
  /**
392
408
  * Unescape HTML characters like &lt, &gt, &amp and etc.
393
- * @param {string} str - The string to unescape.
394
- * @returns {string} - The unescaped string.
409
+ * @param str
410
+ * @returns {string}
395
411
  */
396
412
  export function unescapeHTML(str) {
397
413
  if (typeof window === 'undefined' || !('DOMParser' in window)) {
@@ -403,9 +419,9 @@ export function unescapeHTML(str) {
403
419
  }
404
420
  /**
405
421
  * Make HTML element from string
406
- * @param {string} str - The string to convert to an HTML element.
407
- * @param {string} selector - The selector to use to get the element once it is created.
408
- * @returns {HTMLElement} - The HTML element that was created.
422
+ * @param str
423
+ * @param selector
424
+ * @returns {HTMLElement}
409
425
  */
410
426
  export function convertStringToHTMLElement(str, selector) {
411
427
  const doc = new window.DOMParser().parseFromString(str, 'text/html');
@@ -413,10 +429,10 @@ export function convertStringToHTMLElement(str, selector) {
413
429
  }
414
430
  /**
415
431
  * Make a filename guaranteed to be unique.
416
- * @param {string} name - The original name of the file.
417
- * @param {string} template - The template to use for the unique name.
418
- * @param {object} evalContext - The context to use for the evaluation.
419
- * @returns {string} - A unique filename.
432
+ * @param name
433
+ * @param template
434
+ * @param evalContext
435
+ * @returns {string}
420
436
  */
421
437
  export function uniqueName(name, template, evalContext) {
422
438
  template = template || '{{fileName}}-{{guid}}';
@@ -439,10 +455,6 @@ export function uniqueName(name, template, evalContext) {
439
455
  const uniqueName = `${Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\-_ ]/g, '-');
440
456
  return uniqueName;
441
457
  }
442
- /**
443
- * Returns a GUID
444
- * @returns {string} - A GUID.
445
- */
446
458
  export function guid() {
447
459
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
448
460
  const r = Math.random() * 16 | 0;
@@ -454,8 +466,9 @@ export function guid() {
454
466
  }
455
467
  /**
456
468
  * Return a translated date setting.
457
- * @param {string|Date} date - The date to translate.
458
- * @returns {(null|Date)} - The translated date.
469
+ *
470
+ * @param date
471
+ * @return {(null|Date)}
459
472
  */
460
473
  export function getDateSetting(date) {
461
474
  if (_.isNil(date) || _.isNaN(date) || date === '') {
@@ -496,17 +509,13 @@ export function getDateSetting(date) {
496
509
  }
497
510
  return dateSetting.toDate();
498
511
  }
499
- /**
500
- * Returns true if the date is a valid date. False otherwise.
501
- * @param {Date|string} date - The date to check for validity.
502
- * @returns {boolean} - TRUE if the date is valid; FALSE otherwise.
503
- */
504
512
  export function isValidDate(date) {
505
513
  return _.isDate(date) && !_.isNaN(date.getDate());
506
514
  }
507
515
  /**
508
516
  * Get the current timezone string.
509
- * @returns {string} - The current timezone.
517
+ *
518
+ * @return {string}
510
519
  */
511
520
  export function currentTimezone() {
512
521
  if (moment.currentTimezone) {
@@ -517,9 +526,10 @@ export function currentTimezone() {
517
526
  }
518
527
  /**
519
528
  * Get an offset date provided a date object and timezone object.
520
- * @param {Date} date - The date to offset.
521
- * @param {string} timezone - The timezone to offset the date to.
522
- * @returns {Date} - The offset date.
529
+ *
530
+ * @param date
531
+ * @param timezone
532
+ * @return {Date}
523
533
  */
524
534
  export function offsetDate(date, timezone) {
525
535
  if (timezone === 'UTC') {
@@ -536,15 +546,17 @@ export function offsetDate(date, timezone) {
536
546
  }
537
547
  /**
538
548
  * Returns if the zones are loaded.
539
- * @returns {boolean} - TRUE if the zones are loaded; FALSE otherwise.
549
+ *
550
+ * @return {boolean}
540
551
  */
541
552
  export function zonesLoaded() {
542
553
  return moment.zonesLoaded;
543
554
  }
544
555
  /**
545
556
  * Returns if we should load the zones.
546
- * @param {string} timezone - The timezone to check if we should load the zones.
547
- * @returns {boolean} - TRUE if we should load the zones; FALSE otherwise.
557
+ *
558
+ * @param timezone
559
+ * @return {boolean}
548
560
  */
549
561
  export function shouldLoadZones(timezone) {
550
562
  if (timezone === currentTimezone() || timezone === 'UTC') {
@@ -554,9 +566,8 @@ export function shouldLoadZones(timezone) {
554
566
  }
555
567
  /**
556
568
  * Externally load the timezone data.
557
- * @param {string} url - The URL to load the timezone data from.
558
- * @param {string} timezone - The timezone to load.
559
- * @returns {Promise<any> | *} - Resolves when the zones for this timezone are loaded.
569
+ *
570
+ * @return {Promise<any> | *}
560
571
  */
561
572
  export function loadZones(url, timezone) {
562
573
  if (timezone && !shouldLoadZones(timezone)) {
@@ -580,10 +591,11 @@ export function loadZones(url, timezone) {
580
591
  }
581
592
  /**
582
593
  * Get the moment date object for translating dates with timezones.
583
- * @param {string|Date} value - The value to convert into a moment date.
584
- * @param {string} format - The format to convert the date to.
585
- * @param {string} timezone - The timezone to convert the date to.
586
- * @returns {Date} - The moment date object.
594
+ *
595
+ * @param value
596
+ * @param format
597
+ * @param timezone
598
+ * @return {*}
587
599
  */
588
600
  export function momentDate(value, format, timezone) {
589
601
  const momentDate = moment(value);
@@ -600,12 +612,11 @@ export function momentDate(value, format, timezone) {
600
612
  }
601
613
  /**
602
614
  * Format a date provided a value, format, and timezone object.
603
- * @param {string} timezonesUrl - The URL to load the timezone data from.
604
- * @param {string|Date} value - The value to format.
605
- * @param {string} format - The format to format the date to.
606
- * @param {string} timezone - The timezone to format the date to.
607
- * @param {string} flatPickrInputFormat - The format to use for flatpickr input.
608
- * @returns {string} - The formatted date.
615
+ *
616
+ * @param value
617
+ * @param format
618
+ * @param timezone
619
+ * @return {string}
609
620
  */
610
621
  export function formatDate(timezonesUrl, value, format, timezone, flatPickrInputFormat) {
611
622
  const momentDate = moment(value, flatPickrInputFormat || undefined);
@@ -638,12 +649,12 @@ export function formatDate(timezonesUrl, value, format, timezone, flatPickrInput
638
649
  }
639
650
  /**
640
651
  * Pass a format function to format within a timezone.
641
- * @param {string} timezonesUrl - The URL to load the timezone data from.
642
- * @param {Function} formatFn - The format function to use.
643
- * @param {Date|string} date - The date to format.
644
- * @param {string} format - The format to format the date to.
645
- * @param {string} timezone - The timezone to format the date to.
646
- * @returns {string} - The formatted date.
652
+ *
653
+ * @param formatFn
654
+ * @param date
655
+ * @param format
656
+ * @param timezone
657
+ * @return {string}
647
658
  */
648
659
  export function formatOffset(timezonesUrl, formatFn, date, format, timezone) {
649
660
  if (timezone === currentTimezone()) {
@@ -662,11 +673,6 @@ export function formatOffset(timezonesUrl, formatFn, date, format, timezone) {
662
673
  return formatFn(date, format);
663
674
  }
664
675
  }
665
- /**
666
- * Returns the local date format information.
667
- * @param {Intl.LocalesArgument} locale - The locale to get the date format for.
668
- * @returns {object} - The local date format information.
669
- */
670
676
  export function getLocaleDateFormatInfo(locale) {
671
677
  const formatInfo = {};
672
678
  const day = 21;
@@ -677,8 +683,8 @@ export function getLocaleDateFormatInfo(locale) {
677
683
  }
678
684
  /**
679
685
  * Convert the format from the angular-datepicker module to flatpickr format.
680
- * @param {string} format - The format to convert.
681
- * @returns {string} - The converted format.
686
+ * @param format
687
+ * @return {string}
682
688
  */
683
689
  export function convertFormatToFlatpickr(format) {
684
690
  return format
@@ -708,8 +714,8 @@ export function convertFormatToFlatpickr(format) {
708
714
  }
709
715
  /**
710
716
  * Convert the format from the angular-datepicker module to moment format.
711
- * @param {string} format - The format to convert.
712
- * @returns {string} - The converted format.
717
+ * @param format
718
+ * @return {string}
713
719
  */
714
720
  export function convertFormatToMoment(format) {
715
721
  return format
@@ -724,11 +730,6 @@ export function convertFormatToMoment(format) {
724
730
  // Unix Timestamp
725
731
  .replace(/U/g, 'X');
726
732
  }
727
- /**
728
- * Convert the format from the angular-datepicker module to mask format.
729
- * @param {string} format - The format to convert.
730
- * @returns {string} - The converted format.
731
- */
732
733
  export function convertFormatToMask(format) {
733
734
  return format
734
735
  // Long month replacement.
@@ -786,13 +787,6 @@ export function getInputMask(mask, placeholderChar) {
786
787
  }
787
788
  return maskArray;
788
789
  }
789
- /**
790
- * Unmasks a value using the provided mask and placeholder characters.
791
- * @param {string} value - The value to unmask.
792
- * @param {string} mask - The mask to use for unmasking.
793
- * @param {string} placeholderChar - The placeholder character to use for unmasking.
794
- * @returns {string} - The unmasked value.
795
- */
796
790
  export function unmaskValue(value, mask, placeholderChar) {
797
791
  if (!mask || !value || value.length > mask.length) {
798
792
  return value;
@@ -808,12 +802,6 @@ export function unmaskValue(value, mask, placeholderChar) {
808
802
  unmaskedValue = unmaskedValue.join('').replace(placeholderChar, '');
809
803
  return unmaskedValue;
810
804
  }
811
- /**
812
- * Returns true if the value matches the input mask format.
813
- * @param {string} value - The value to check.
814
- * @param {string} inputMask - The input mask to check against.
815
- * @returns {boolean} - TRUE if the value matches the input mask; FALSE otherwise.
816
- */
817
805
  export function matchInputMask(value, inputMask) {
818
806
  if (!inputMask) {
819
807
  return true;
@@ -831,11 +819,6 @@ export function matchInputMask(value, inputMask) {
831
819
  }
832
820
  return true;
833
821
  }
834
- /**
835
- * Returns the number separators (i.e. 1,000) for the provided language.
836
- * @param {string} lang - The language code to get the number separators for.
837
- * @returns {{delimiter: string, decimalSeparator: string}} - The number separators.
838
- */
839
822
  export function getNumberSeparators(lang = 'en') {
840
823
  const formattedNumberString = (12345.6789).toLocaleString(lang);
841
824
  const delimeters = formattedNumberString.match(/..(.)...(.)../);
@@ -850,12 +833,6 @@ export function getNumberSeparators(lang = 'en') {
850
833
  decimalSeparator: (delimeters.length > 2) ? delimeters[2] : '.',
851
834
  };
852
835
  }
853
- /**
854
- * Returns the number for the maximum amount of decimal places for a number.
855
- * @param {import('@formio/core').Component} component - The component to check for decimal limits.
856
- * @param {number} defaultLimit - The default limit to use if none is provided in the component.
857
- * @returns {number} - The number of decimal places allowed.
858
- */
859
836
  export function getNumberDecimalLimit(component, defaultLimit) {
860
837
  if (_.has(component, 'decimalLimit')) {
861
838
  return _.get(component, 'decimalLimit');
@@ -871,15 +848,6 @@ export function getNumberDecimalLimit(component, defaultLimit) {
871
848
  }
872
849
  return decimalLimit;
873
850
  }
874
- /**
875
- * Returns the currency affixes for a specific language.
876
- * @param {object} arg0 - The arguments object.
877
- * @param {string} arg0.currency - The currency code to get the affixes for.
878
- * @param {number} arg0.decimalLimit - The number of decimal places to use.
879
- * @param {string} arg0.decimalSeparator - The decimal separator to use.
880
- * @param {string} arg0.lang - The language code to use.
881
- * @returns {{prefix: string, suffix: string}} - The currency affixes.
882
- */
883
851
  export function getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, lang, }) {
884
852
  // Get the prefix and suffix from the localized string.
885
853
  let regex = `(.*)?${(100).toLocaleString(lang)}`;
@@ -901,9 +869,10 @@ export function getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, l
901
869
  }
902
870
  /**
903
871
  * Fetch the field data provided a component.
904
- * @param {import('@formio/core').DataObject} data - The data object to fetch the field data from.
905
- * @param {import('@formio/core').Component} component - The component to fetch the field data for.
906
- * @returns {*} - The field data.
872
+ *
873
+ * @param data
874
+ * @param component
875
+ * @return {*}
907
876
  */
908
877
  export function fieldData(data, component) {
909
878
  if (!data) {
@@ -949,23 +918,16 @@ export function fieldData(data, component) {
949
918
  }
950
919
  /**
951
920
  * Delays function execution with possibility to execute function synchronously or cancel it.
952
- * @param {Function} fn - Function to delay
953
- * @param {number} delay - Delay time
954
- * @param {...any} args - Arguments to pass to the function
955
- * @returns {*} - Function to cancel the delay
921
+ *
922
+ * @param fn Function to delay
923
+ * @param delay Delay time
924
+ * @return {*}
956
925
  */
957
926
  export function delay(fn, delay = 0, ...args) {
958
927
  const timer = setTimeout(fn, delay, ...args);
959
- /**
960
- *
961
- */
962
928
  function cancel() {
963
929
  clearTimeout(timer);
964
930
  }
965
- /**
966
- * Execute the function early.
967
- * @returns {*} - The result of the function.
968
- */
969
931
  function earlyCall() {
970
932
  cancel();
971
933
  return fn(...args);
@@ -976,9 +938,11 @@ export function delay(fn, delay = 0, ...args) {
976
938
  }
977
939
  /**
978
940
  * Iterate the given key to make it unique.
979
- * @param {string} key
941
+ *
942
+ * @param {String} key
980
943
  * Modify the component key to be unique.
981
- * @returns {string}
944
+ *
945
+ * @returns {String}
982
946
  * The new component key.
983
947
  */
984
948
  export function iterateKey(key) {
@@ -991,9 +955,10 @@ export function iterateKey(key) {
991
955
  }
992
956
  /**
993
957
  * Determines a unique key within a map provided the base key.
994
- * @param {Record<string, string>} map - The map to check for uniqueness.
995
- * @param {string} base - The base path of the key.
996
- * @returns {string} - The unique key.
958
+ *
959
+ * @param map
960
+ * @param base
961
+ * @return {*}
997
962
  */
998
963
  export function uniqueKey(map, base) {
999
964
  let newKey = base;
@@ -1004,9 +969,8 @@ export function uniqueKey(map, base) {
1004
969
  }
1005
970
  /**
1006
971
  * Determines the major version number of bootstrap.
1007
- * @param {object} options - The options to check for bootstrap version.
1008
- * @param {string} options.bootstrap - The bootstrap version to use.
1009
- * @returns {number} - The bootstrap version.
972
+ *
973
+ * @return {number}
1010
974
  */
1011
975
  export function bootstrapVersion(options) {
1012
976
  if (options.bootstrap) {
@@ -1023,8 +987,9 @@ export function bootstrapVersion(options) {
1023
987
  /**
1024
988
  * Retrun provided argument.
1025
989
  * If argument is a function, returns the result of a function call.
1026
- * @param {Function|any} e - The argument to check if a function and call if so.
1027
- * @returns {any} - Either the result of the function call (e) or e if it is not a function.
990
+ * @param {*} e;
991
+ *
992
+ * @return {*}
1028
993
  */
1029
994
  export function unfold(e) {
1030
995
  if (typeof e === 'function') {
@@ -1034,32 +999,27 @@ export function unfold(e) {
1034
999
  }
1035
1000
  /**
1036
1001
  * Map values through unfold and return first non-nil value.
1037
- * @param {Array<T>} collection - The collection to map through unfold.;
1038
- * @returns {T} - The first non-nil value.
1002
+ * @param {Array<T>} collection;
1003
+ *
1004
+ * @return {T}
1039
1005
  */
1040
1006
  export const firstNonNil = _.flow([
1041
1007
  _.partialRight(_.map, unfold),
1042
1008
  _.partialRight(_.find, v => !_.isUndefined(v))
1043
1009
  ]);
1044
- /**
1045
- * Create enclosed state. Returns functions to getting and cycling between states.
1010
+ /*
1011
+ * Create enclosed state.
1012
+ * Returns functions to getting and cycling between states.
1046
1013
  * @param {*} a - initial state.
1047
1014
  * @param {*} b - next state.
1048
- * @returns {Functions[]} -- [get, toggle];
1015
+ * @return {Functions[]} -- [get, toggle];
1049
1016
  */
1050
1017
  export function withSwitch(a, b) {
1051
1018
  let state = a;
1052
1019
  let next = b;
1053
- /**
1054
- * Returns the state of the switch.
1055
- * @returns {*} - The current state.
1056
- */
1057
1020
  function get() {
1058
1021
  return state;
1059
1022
  }
1060
- /**
1061
- * Toggles the state of the switch.
1062
- */
1063
1023
  function toggle() {
1064
1024
  const prev = state;
1065
1025
  state = next;
@@ -1067,14 +1027,6 @@ export function withSwitch(a, b) {
1067
1027
  }
1068
1028
  return [get, toggle];
1069
1029
  }
1070
- /**
1071
- * Create a function that will call the provided function only the provided limit.
1072
- * @param {Function} callback - The callback to call.
1073
- * @param {object} options - The options to use.
1074
- * @param {number} options.limit - The limit to call the callback.
1075
- * @param {number} options.delay - The delay to wait before resetting the call count.
1076
- * @returns {Function} - The function that will call the callback only the provided limit.
1077
- */
1078
1030
  export function observeOverload(callback, options = {}) {
1079
1031
  const { limit = 50, delay = 500 } = options;
1080
1032
  let callCount = 0;
@@ -1094,13 +1046,6 @@ export function observeOverload(callback, options = {}) {
1094
1046
  }
1095
1047
  };
1096
1048
  }
1097
- /**
1098
- * Returns the components that are provided within an evaluation context.
1099
- * @param {any} context - The evaluation context to get the components from.
1100
- * @param {boolean} excludeNested - Exclude nested components.
1101
- * @param {Array<string>} excludedTypes - The types of components to exclude.
1102
- * @returns {Array} - The components within the evaluation context.
1103
- */
1104
1049
  export function getContextComponents(context, excludeNested, excludedTypes = []) {
1105
1050
  const values = [];
1106
1051
  context.utils.eachComponent(context.instance.options.editForm.components, (component, path) => {
@@ -1114,11 +1059,6 @@ export function getContextComponents(context, excludeNested, excludedTypes = [])
1114
1059
  });
1115
1060
  return values;
1116
1061
  }
1117
- /**
1118
- * Returns the button components that are within an evaluation context.
1119
- * @param {any} context - The evaluation context to get the components from.
1120
- * @returns {Array} - The button components within the evaluation context.
1121
- */
1122
1062
  export function getContextButtons(context) {
1123
1063
  const values = [];
1124
1064
  context.utils.eachComponent(context.instance.options.editForm.components, (component) => {
@@ -1135,9 +1075,12 @@ export function getContextButtons(context) {
1135
1075
  const inTextTags = ['#text', 'A', 'B', 'EM', 'I', 'SMALL', 'STRONG', 'SUB', 'SUP', 'INS', 'DEL', 'MARK', 'CODE'];
1136
1076
  /**
1137
1077
  * Helper function for 'translateHTMLTemplate'. Translates text value of the passed html element.
1138
- * @param {HTMLElement} elem - The element to translate.
1139
- * @param {Function} translate - The translation function.
1140
- * @returns {string} - Translated element template.
1078
+ *
1079
+ * @param {HTMLElement} elem
1080
+ * @param {Function} translate
1081
+ *
1082
+ * @returns {String}
1083
+ * Translated element template.
1141
1084
  */
1142
1085
  function translateElemValue(elem, translate) {
1143
1086
  if (!elem.innerText) {
@@ -1168,8 +1111,10 @@ function translateElemValue(elem, translate) {
1168
1111
  }
1169
1112
  /**
1170
1113
  * Helper function for 'translateHTMLTemplate'. Goes deep through html tag children and calls function to translate their text values.
1171
- * @param {HTMLElement} tag - The tag to translate.
1172
- * @param {Function} translate - The translation function.
1114
+ *
1115
+ * @param {HTMLElement} tag
1116
+ * @param {Function} translate
1117
+ *
1173
1118
  * @returns {void}
1174
1119
  */
1175
1120
  function translateDeepTag(tag, translate) {
@@ -1185,9 +1130,12 @@ function translateDeepTag(tag, translate) {
1185
1130
  }
1186
1131
  /**
1187
1132
  * Translates text values in html template.
1188
- * @param {string} template - The template to translate.
1189
- * @param {Function} translate - The translation function.
1190
- * @returns {string} - Html template with translated values.
1133
+ *
1134
+ * @param {String} template
1135
+ * @param {Function} translate
1136
+ *
1137
+ * @returns {String}
1138
+ * Html template with translated values.
1191
1139
  */
1192
1140
  export function translateHTMLTemplate(template, translate) {
1193
1141
  const isHTML = /<[^>]*>/.test(template);
@@ -1204,9 +1152,9 @@ export function translateHTMLTemplate(template, translate) {
1204
1152
  }
1205
1153
  /**
1206
1154
  * Sanitize an html string.
1207
- * @param {string} string - The string to sanitize.
1208
- * @param {any} options - The options to use for sanitization.
1209
- * @returns {string} - The sanitized html string.
1155
+ *
1156
+ * @param string
1157
+ * @returns {*}
1210
1158
  */
1211
1159
  export function sanitize(string, options) {
1212
1160
  if (typeof dompurify.sanitize !== 'function') {
@@ -1254,18 +1202,11 @@ export function sanitize(string, options) {
1254
1202
  }
1255
1203
  /**
1256
1204
  * Fast cloneDeep for JSON objects only.
1257
- * @param {any} obj - The object to perform a fast clone deep against.
1258
- * @returns {any} - The cloned object.
1259
1205
  */
1260
1206
  export function fastCloneDeep(obj) {
1261
1207
  return obj ? JSON.parse(JSON.stringify(obj)) : obj;
1262
1208
  }
1263
1209
  export { Evaluator, interpolate };
1264
- /**
1265
- * Returns if the component is an input component.
1266
- * @param {import('@formio/core').Component} componentJson - The JSON of a component.
1267
- * @returns {bool} - TRUE if the component is an input component; FALSE otherwise.
1268
- */
1269
1210
  export function isInputComponent(componentJson) {
1270
1211
  if (componentJson.input === false || componentJson.input === true) {
1271
1212
  return componentJson.input;
@@ -1285,11 +1226,6 @@ export function isInputComponent(componentJson) {
1285
1226
  return true;
1286
1227
  }
1287
1228
  }
1288
- /**
1289
- * Takes a component path, and returns a component path array.
1290
- * @param {string} pathStr - The path string to convert to an array.
1291
- * @returns {Arryay<number>} - The array of paths.
1292
- */
1293
1229
  export function getArrayFromComponentPath(pathStr) {
1294
1230
  if (!pathStr || !_.isString(pathStr)) {
1295
1231
  if (!_.isArray(pathStr)) {
@@ -1303,12 +1239,6 @@ export function getArrayFromComponentPath(pathStr) {
1303
1239
  .split('.')
1304
1240
  .map(part => _.defaultTo(_.toNumber(part), part));
1305
1241
  }
1306
- /**
1307
- * Returns true if the component is a child of the parent.
1308
- * @param {any} child - The child component to check.
1309
- * @param {any} parent - The parent component to check.
1310
- * @returns {boolean} - TRUE if the child is a child of the parent; FALSE otherwise.
1311
- */
1312
1242
  export function isChildOf(child, parent) {
1313
1243
  while (child && child.parent) {
1314
1244
  if (child.parent === parent) {
@@ -1318,11 +1248,6 @@ export function isChildOf(child, parent) {
1318
1248
  }
1319
1249
  return false;
1320
1250
  }
1321
- /**
1322
- * Takes an array of component path indexes, and returns a string version of that array.
1323
- * @param {Array<number>} path - The path array to convert to a string.
1324
- * @returns {string} - The string version of the path.
1325
- */
1326
1251
  export function getStringFromComponentPath(path) {
1327
1252
  if (!_.isArray(path)) {
1328
1253
  return path;
@@ -1338,21 +1263,16 @@ export function getStringFromComponentPath(path) {
1338
1263
  });
1339
1264
  return strPath;
1340
1265
  }
1341
- /**
1342
- * Takes a number and rounds it to the provided precision amount.
1343
- * @param {number} number - The number to round.
1344
- * @param {number} precision - The precision to round the number to.
1345
- * @returns {string} - The rounded number.
1346
- */
1347
1266
  export function round(number, precision) {
1348
1267
  if (_.isNumber(number)) {
1349
1268
  return number.toFixed(precision);
1350
1269
  }
1351
- return number.toString();
1270
+ return number;
1352
1271
  }
1353
1272
  /**
1354
1273
  * Check for Internet Explorer browser version
1355
- * @returns {(number|null)} - The IE browser version or null if not IE
1274
+ *
1275
+ * @return {(number|null)}
1356
1276
  */
1357
1277
  export function getIEBrowserVersion() {
1358
1278
  const { ie, version } = getBrowserInfo();
@@ -1360,7 +1280,8 @@ export function getIEBrowserVersion() {
1360
1280
  }
1361
1281
  /**
1362
1282
  * Get browser name and version (modified from 'jquery-browser-plugin')
1363
- * @returns {object} -- {{browser name, version, isWebkit?}}
1283
+ *
1284
+ * @return {Object} -- {{browser name, version, isWebkit?}}
1364
1285
  * Possible browser names: chrome, safari, ie, edge, opera, mozilla, yabrowser
1365
1286
  */
1366
1287
  export function getBrowserInfo() {
@@ -1408,19 +1329,12 @@ export function getBrowserInfo() {
1408
1329
  }
1409
1330
  return browser;
1410
1331
  }
1411
- /**
1412
- * Takes a component path, which may include array indicies (i.e. [0][1]), and returns the compoennt path without the indicies.
1413
- * @param {string} path - The path to remove the indicies from.
1414
- * @returns {string} - The path without the indicies.
1415
- */
1416
1332
  export function getComponentPathWithoutIndicies(path = '') {
1417
1333
  return path.replace(/\[\d+\]/, '');
1418
1334
  }
1419
1335
  /**
1420
1336
  * Returns a path to the component which based on its schema
1421
- * @param {import('@formio/core').Component} component - Component containing link to its parent's schema in the 'parent' property
1422
- * @param {string} path - Path to the component
1423
- * @returns {string} - Path to the component
1337
+ * @param {*} component is a component's schema containing link to its parent's schema in the 'parent' property
1424
1338
  */
1425
1339
  export function getComponentPath(component, path = '') {
1426
1340
  if (!component || !component.key || component?._form?.display === 'wizard') { // unlike the Webform, the Wizard has the key and it is a duplicate of the panel key
@@ -1431,8 +1345,8 @@ export function getComponentPath(component, path = '') {
1431
1345
  }
1432
1346
  /**
1433
1347
  * Returns a parent component of the passed component instance skipping all the Layout components
1434
- * @param {Component} componentInstance - The component to check for the parent.
1435
- * @returns {Component|undefined} - The parent data component.
1348
+ * @param {*} componentInstance
1349
+ * @return {(Component|undefined)}
1436
1350
  */
1437
1351
  export function getDataParentComponent(componentInstance) {
1438
1352
  if (!componentInstance) {
@@ -1448,8 +1362,8 @@ export function getDataParentComponent(componentInstance) {
1448
1362
  }
1449
1363
  /**
1450
1364
  * Returns whether the value is a promise
1451
- * @param {any} value - The value to check
1452
- * @returns {boolean} - TRUE if the value is a promise; FALSE otherwise
1365
+ * @param value
1366
+ * @return {boolean}
1453
1367
  */
1454
1368
  export function isPromise(value) {
1455
1369
  return value
@@ -1460,9 +1374,9 @@ export function isPromise(value) {
1460
1374
  /**
1461
1375
  * Determines if the component has a scoping parent in tree (a component which scopes its children and manages its
1462
1376
  * changes by itself, e.g. EditGrid)
1463
- * @param {Component} componentInstance - The component to check for the scoping parent.
1464
- * @param {boolean} firstPass - Whether it is the first pass of the function
1465
- * @returns {boolean|*} - TRUE if the component has a scoping parent; FALSE otherwise
1377
+ * @param componentInstance
1378
+ * @param firstPass
1379
+ * @returns {boolean|boolean|*}
1466
1380
  */
1467
1381
  export function isInsideScopingComponent(componentInstance, firstPass = true) {
1468
1382
  if (!firstPass && componentInstance?.hasScopedChildren) {
@@ -1477,11 +1391,6 @@ export function isInsideScopingComponent(componentInstance, firstPass = true) {
1477
1391
  }
1478
1392
  return false;
1479
1393
  }
1480
- /**
1481
- * Returns all the focusable elements within the provided dom element.
1482
- * @param {HTMLElement} element - The element to get the focusable elements from.
1483
- * @returns {NodeList<HTMLElement>} - The focusable elements within the provided element.
1484
- */
1485
1394
  export function getFocusableElements(element) {
1486
1395
  const focusableSelector = `button:not([disabled]), input:not([disabled]), select:not([disabled]),
1487
1396
  textarea:not([disabled]), button:not([disabled]), [href]`;
@@ -1498,11 +1407,6 @@ export const componentValueTypes = {
1498
1407
  date: 'date',
1499
1408
  any: 'any',
1500
1409
  };
1501
- /**
1502
- * Returns the saved types for the component
1503
- * @param {import('@formio/core').Component} fullSchema - The component schema
1504
- * @returns {Array<string>|null} - The saved types for the component
1505
- */
1506
1410
  export function getComponentSavedTypes(fullSchema) {
1507
1411
  const schema = fullSchema || {};
1508
1412
  if (schema.persistent !== true) {
@@ -1515,10 +1419,9 @@ export function getComponentSavedTypes(fullSchema) {
1515
1419
  }
1516
1420
  /**
1517
1421
  * Interpolates @formio/core errors so that they are compatible with the renderer
1518
- * @param {Component} component - The component to interpolate the errors for
1519
- * @param {FieldError[]} errors - The errors to interpolate
1520
- * @param {Function} interpolateFn - The interpolation function
1521
- * @returns {[]} - The interpolated errors
1422
+ * @param {FieldError[]} errors
1423
+ * @param firstPass
1424
+ * @returns {[]}
1522
1425
  */
1523
1426
  export const interpolateErrors = (component, errors, interpolateFn) => {
1524
1427
  return errors.map((error) => {
@@ -1528,11 +1431,6 @@ export const interpolateErrors = (component, errors, interpolateFn) => {
1528
1431
  return { ...error, message: unescapeHTML(interpolateFn(toInterpolate, context)), context: { ...context } };
1529
1432
  });
1530
1433
  };
1531
- /**
1532
- * Returns the template keys inside the template code.
1533
- * @param {string} template - The template to get the keys from.
1534
- * @returns {Array<string>} - The keys inside the template.
1535
- */
1536
1434
  export function getItemTemplateKeys(template) {
1537
1435
  const templateKeys = [];
1538
1436
  if (!template) {
@@ -1549,11 +1447,6 @@ export function getItemTemplateKeys(template) {
1549
1447
  }
1550
1448
  return templateKeys;
1551
1449
  }
1552
- /**
1553
- * Returns if the component is a select resource with an object for its value.
1554
- * @param {import('@formio/core').Component} comp - The component to check.
1555
- * @returns {boolean} - TRUE if the component is a select resource with an object for its value; FALSE otherwise.
1556
- */
1557
1450
  export function isSelectResourceWithObjectValue(comp = {}) {
1558
1451
  const { reference, dataSrc, valueProperty } = comp;
1559
1452
  return reference || (dataSrc === 'resource' && (!valueProperty || valueProperty === 'data'));