@formio/js 5.0.0-dev.5610.c46fab6 → 5.0.0-dev.5613.3476921

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 (448) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +1199 -651
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +11 -3
  7. package/dist/formio.full.js +919 -691
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +11 -3
  10. package/dist/formio.js +16 -16
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +1 -1
  13. package/dist/formio.utils.js +493 -1861
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +2 -12
  16. package/lib/cjs/Element.d.ts +96 -86
  17. package/lib/cjs/Element.js +78 -68
  18. package/lib/cjs/Form.d.ts +36 -365
  19. package/lib/cjs/Form.js +64 -50
  20. package/lib/cjs/FormBuilder.d.ts +2 -187
  21. package/lib/cjs/FormBuilder.js +8 -30
  22. package/lib/cjs/PDF.d.ts +13 -11
  23. package/lib/cjs/PDF.js +8 -6
  24. package/lib/cjs/Webform.d.ts +139 -180
  25. package/lib/cjs/Webform.js +298 -313
  26. package/lib/cjs/WebformBuilder.d.ts +14 -16
  27. package/lib/cjs/WebformBuilder.js +11 -17
  28. package/lib/cjs/Wizard.d.ts +21 -31
  29. package/lib/cjs/Wizard.js +19 -42
  30. package/lib/cjs/WizardBuilder.d.ts +1 -1
  31. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +5 -8
  32. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -6
  33. package/lib/cjs/components/Components.d.ts +4 -4
  34. package/lib/cjs/components/Components.js +3 -3
  35. package/lib/cjs/components/_classes/component/Component.d.ts +269 -502
  36. package/lib/cjs/components/_classes/component/Component.form.d.ts +3 -6
  37. package/lib/cjs/components/_classes/component/Component.form.js +0 -5
  38. package/lib/cjs/components/_classes/component/Component.js +189 -433
  39. package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
  40. package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +2 -2
  41. package/lib/cjs/components/_classes/component/editForm/utils.js +2 -2
  42. package/lib/cjs/components/_classes/field/Field.d.ts +2 -11
  43. package/lib/cjs/components/_classes/field/Field.js +1 -13
  44. package/lib/cjs/components/_classes/input/Input.d.ts +3 -4
  45. package/lib/cjs/components/_classes/input/Input.js +2 -2
  46. package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
  47. package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +3 -6
  48. package/lib/cjs/components/_classes/list/ListComponent.form.js +0 -5
  49. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +12 -43
  50. package/lib/cjs/components/_classes/multivalue/Multivalue.js +3 -37
  51. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +67 -163
  52. package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +3 -6
  53. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +0 -5
  54. package/lib/cjs/components/_classes/nested/NestedComponent.js +54 -175
  55. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
  56. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  57. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -7
  58. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +3 -2
  59. package/lib/cjs/components/address/Address.d.ts +2 -4
  60. package/lib/cjs/components/address/Address.form.d.ts +3 -6
  61. package/lib/cjs/components/address/Address.form.js +0 -5
  62. package/lib/cjs/components/button/Button.d.ts +12 -3
  63. package/lib/cjs/components/button/Button.form.d.ts +3 -6
  64. package/lib/cjs/components/button/Button.form.js +0 -5
  65. package/lib/cjs/components/button/Button.js +0 -5
  66. package/lib/cjs/components/checkbox/Checkbox.d.ts +27 -4
  67. package/lib/cjs/components/checkbox/Checkbox.form.d.ts +3 -6
  68. package/lib/cjs/components/checkbox/Checkbox.form.js +0 -5
  69. package/lib/cjs/components/columns/Columns.d.ts +2 -3
  70. package/lib/cjs/components/columns/Columns.form.d.ts +3 -6
  71. package/lib/cjs/components/columns/Columns.form.js +0 -5
  72. package/lib/cjs/components/columns/Columns.js +1 -1
  73. package/lib/cjs/components/container/Container.form.d.ts +3 -6
  74. package/lib/cjs/components/container/Container.form.js +0 -5
  75. package/lib/cjs/components/content/Content.d.ts +1 -2
  76. package/lib/cjs/components/content/Content.form.d.ts +3 -6
  77. package/lib/cjs/components/content/Content.form.js +0 -5
  78. package/lib/cjs/components/currency/Currency.form.d.ts +3 -6
  79. package/lib/cjs/components/currency/Currency.form.js +0 -5
  80. package/lib/cjs/components/currency/Currency.js +2 -1
  81. package/lib/cjs/components/datagrid/DataGrid.d.ts +7 -8
  82. package/lib/cjs/components/datagrid/DataGrid.form.d.ts +3 -6
  83. package/lib/cjs/components/datagrid/DataGrid.form.js +0 -5
  84. package/lib/cjs/components/datagrid/DataGrid.js +5 -5
  85. package/lib/cjs/components/datamap/DataMap.d.ts +0 -1
  86. package/lib/cjs/components/datamap/DataMap.form.d.ts +3 -6
  87. package/lib/cjs/components/datamap/DataMap.form.js +0 -5
  88. package/lib/cjs/components/datetime/DateTime.d.ts +14 -0
  89. package/lib/cjs/components/datetime/DateTime.form.d.ts +3 -6
  90. package/lib/cjs/components/datetime/DateTime.form.js +0 -5
  91. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
  92. package/lib/cjs/components/day/Day.d.ts +48 -22
  93. package/lib/cjs/components/day/Day.form.d.ts +3 -6
  94. package/lib/cjs/components/day/Day.form.js +0 -5
  95. package/lib/cjs/components/day/Day.js +20 -15
  96. package/lib/cjs/components/editgrid/EditGrid.d.ts +3 -7
  97. package/lib/cjs/components/editgrid/EditGrid.form.d.ts +3 -6
  98. package/lib/cjs/components/editgrid/EditGrid.form.js +0 -5
  99. package/lib/cjs/components/editgrid/EditGrid.js +3 -3
  100. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +5 -2
  101. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +9 -6
  102. package/lib/cjs/components/email/Email.form.d.ts +3 -6
  103. package/lib/cjs/components/email/Email.form.js +0 -5
  104. package/lib/cjs/components/fieldset/Fieldset.form.d.ts +3 -6
  105. package/lib/cjs/components/fieldset/Fieldset.form.js +0 -5
  106. package/lib/cjs/components/file/File.d.ts +22 -9
  107. package/lib/cjs/components/file/File.form.d.ts +3 -6
  108. package/lib/cjs/components/file/File.form.js +0 -5
  109. package/lib/cjs/components/form/Form.d.ts +20 -31
  110. package/lib/cjs/components/form/Form.form.d.ts +3 -6
  111. package/lib/cjs/components/form/Form.form.js +0 -5
  112. package/lib/cjs/components/form/Form.js +10 -13
  113. package/lib/cjs/components/hidden/Hidden.d.ts +11 -1
  114. package/lib/cjs/components/hidden/Hidden.form.d.ts +3 -6
  115. package/lib/cjs/components/hidden/Hidden.form.js +0 -5
  116. package/lib/cjs/components/hidden/Hidden.js +2 -1
  117. package/lib/cjs/components/html/HTML.d.ts +1 -2
  118. package/lib/cjs/components/html/HTML.form.d.ts +3 -6
  119. package/lib/cjs/components/html/HTML.form.js +0 -5
  120. package/lib/cjs/components/number/Number.d.ts +17 -3
  121. package/lib/cjs/components/number/Number.form.d.ts +3 -6
  122. package/lib/cjs/components/number/Number.form.js +0 -5
  123. package/lib/cjs/components/number/Number.js +2 -1
  124. package/lib/cjs/components/panel/Panel.form.d.ts +3 -6
  125. package/lib/cjs/components/panel/Panel.form.js +0 -5
  126. package/lib/cjs/components/panel/Panel.js +1 -0
  127. package/lib/cjs/components/password/Password.form.d.ts +3 -6
  128. package/lib/cjs/components/password/Password.form.js +0 -5
  129. package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +3 -6
  130. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +0 -5
  131. package/lib/cjs/components/radio/Radio.d.ts +26 -3
  132. package/lib/cjs/components/radio/Radio.form.d.ts +3 -6
  133. package/lib/cjs/components/radio/Radio.form.js +0 -5
  134. package/lib/cjs/components/radio/Radio.js +4 -3
  135. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  136. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +3 -5
  137. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +0 -4
  138. package/lib/cjs/components/select/Select.d.ts +39 -16
  139. package/lib/cjs/components/select/Select.form.d.ts +3 -6
  140. package/lib/cjs/components/select/Select.form.js +0 -5
  141. package/lib/cjs/components/select/Select.js +16 -13
  142. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +17 -2
  143. package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +3 -6
  144. package/lib/cjs/components/selectboxes/SelectBoxes.form.js +0 -5
  145. package/lib/cjs/components/selectboxes/SelectBoxes.js +9 -7
  146. package/lib/cjs/components/signature/Signature.d.ts +14 -1
  147. package/lib/cjs/components/signature/Signature.form.d.ts +3 -6
  148. package/lib/cjs/components/signature/Signature.form.js +0 -5
  149. package/lib/cjs/components/survey/Survey.d.ts +15 -3
  150. package/lib/cjs/components/survey/Survey.form.d.ts +3 -6
  151. package/lib/cjs/components/survey/Survey.form.js +0 -5
  152. package/lib/cjs/components/table/Table.d.ts +1 -2
  153. package/lib/cjs/components/table/Table.form.d.ts +3 -6
  154. package/lib/cjs/components/table/Table.form.js +0 -5
  155. package/lib/cjs/components/tabs/Tabs.d.ts +4 -4
  156. package/lib/cjs/components/tabs/Tabs.form.d.ts +3 -6
  157. package/lib/cjs/components/tabs/Tabs.form.js +0 -5
  158. package/lib/cjs/components/tabs/Tabs.js +2 -1
  159. package/lib/cjs/components/tags/Tags.d.ts +14 -0
  160. package/lib/cjs/components/tags/Tags.form.d.ts +3 -6
  161. package/lib/cjs/components/tags/Tags.form.js +0 -5
  162. package/lib/cjs/components/textarea/TextArea.d.ts +9 -4
  163. package/lib/cjs/components/textarea/TextArea.form.d.ts +3 -6
  164. package/lib/cjs/components/textarea/TextArea.form.js +0 -5
  165. package/lib/cjs/components/textarea/TextArea.js +2 -2
  166. package/lib/cjs/components/textfield/TextField.d.ts +30 -14
  167. package/lib/cjs/components/textfield/TextField.form.d.ts +3 -6
  168. package/lib/cjs/components/textfield/TextField.form.js +0 -5
  169. package/lib/cjs/components/textfield/TextField.js +16 -13
  170. package/lib/cjs/components/time/Time.form.d.ts +3 -6
  171. package/lib/cjs/components/time/Time.form.js +0 -5
  172. package/lib/cjs/components/unknown/Unknown.form.d.ts +34 -5
  173. package/lib/cjs/components/unknown/Unknown.form.js +0 -4
  174. package/lib/cjs/components/url/Url.form.d.ts +3 -6
  175. package/lib/cjs/components/url/Url.form.js +0 -5
  176. package/lib/cjs/components/well/Well.form.d.ts +3 -6
  177. package/lib/cjs/components/well/Well.form.js +0 -5
  178. package/lib/cjs/formio.embed.d.ts +2 -1
  179. package/lib/cjs/formio.embed.js +100 -2
  180. package/lib/cjs/formio.form.d.ts +4 -11
  181. package/lib/cjs/formio.form.js +5 -13
  182. package/lib/cjs/providers/Providers.d.ts +5 -36
  183. package/lib/cjs/providers/Providers.js +0 -29
  184. package/lib/cjs/providers/address/AddressProvider.d.ts +12 -131
  185. package/lib/cjs/providers/address/AddressProvider.js +2 -88
  186. package/lib/cjs/providers/address/AzureAddressProvider.d.ts +1 -48
  187. package/lib/cjs/providers/address/AzureAddressProvider.js +0 -37
  188. package/lib/cjs/providers/address/CustomAddressProvider.d.ts +4 -27
  189. package/lib/cjs/providers/address/CustomAddressProvider.js +0 -34
  190. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +6 -130
  191. package/lib/cjs/providers/address/GoogleAddressProvider.js +0 -72
  192. package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +7 -32
  193. package/lib/cjs/providers/address/NominatimAddressProvider.js +0 -33
  194. package/lib/cjs/providers/address/index.d.ts +1 -3
  195. package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -7
  196. package/lib/cjs/providers/processor/fileProcessor.js +0 -6
  197. package/lib/cjs/providers/storage/azure.d.ts +13 -6
  198. package/lib/cjs/providers/storage/azure.js +0 -5
  199. package/lib/cjs/providers/storage/base64.d.ts +6 -5
  200. package/lib/cjs/providers/storage/base64.js +0 -4
  201. package/lib/cjs/providers/storage/dropbox.d.ts +4 -6
  202. package/lib/cjs/providers/storage/dropbox.js +0 -5
  203. package/lib/cjs/providers/storage/googleDrive.d.ts +5 -7
  204. package/lib/cjs/providers/storage/googleDrive.js +0 -6
  205. package/lib/cjs/providers/storage/indexeddb.d.ts +7 -5
  206. package/lib/cjs/providers/storage/indexeddb.js +0 -4
  207. package/lib/cjs/providers/storage/s3.d.ts +20 -6
  208. package/lib/cjs/providers/storage/s3.js +0 -5
  209. package/lib/cjs/providers/storage/url.d.ts +7 -6
  210. package/lib/cjs/providers/storage/url.js +0 -10
  211. package/lib/cjs/providers/storage/util.d.ts +1 -24
  212. package/lib/cjs/providers/storage/util.js +0 -18
  213. package/lib/cjs/templates/Templates.d.ts +0 -1
  214. package/lib/cjs/translations/en.d.ts +1 -0
  215. package/lib/cjs/translations/en.js +1 -0
  216. package/lib/cjs/utils/Evaluator.d.ts +3 -6
  217. package/lib/cjs/utils/Evaluator.js +20 -11
  218. package/lib/cjs/utils/builder.d.ts +7 -9
  219. package/lib/cjs/utils/builder.js +5 -10
  220. package/lib/cjs/utils/calendarUtils.d.ts +13 -7
  221. package/lib/cjs/utils/calendarUtils.js +17 -10
  222. package/lib/cjs/utils/formUtils.d.ts +171 -43
  223. package/lib/cjs/utils/formUtils.js +569 -38
  224. package/lib/cjs/utils/utils.d.ts +216 -362
  225. package/lib/cjs/utils/utils.js +224 -331
  226. package/lib/cjs/widgets/CalendarWidget.d.ts +10 -9
  227. package/lib/cjs/widgets/CalendarWidget.js +11 -9
  228. package/lib/mjs/Element.d.ts +96 -86
  229. package/lib/mjs/Element.js +78 -68
  230. package/lib/mjs/Form.d.ts +36 -365
  231. package/lib/mjs/Form.js +57 -140
  232. package/lib/mjs/FormBuilder.d.ts +2 -187
  233. package/lib/mjs/FormBuilder.js +8 -32
  234. package/lib/mjs/PDF.d.ts +13 -11
  235. package/lib/mjs/PDF.js +8 -6
  236. package/lib/mjs/Webform.d.ts +139 -180
  237. package/lib/mjs/Webform.js +310 -325
  238. package/lib/mjs/WebformBuilder.d.ts +14 -16
  239. package/lib/mjs/WebformBuilder.js +11 -16
  240. package/lib/mjs/Wizard.d.ts +21 -31
  241. package/lib/mjs/Wizard.js +18 -41
  242. package/lib/mjs/WizardBuilder.d.ts +1 -1
  243. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +5 -8
  244. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -6
  245. package/lib/mjs/components/Components.d.ts +4 -4
  246. package/lib/mjs/components/Components.js +3 -3
  247. package/lib/mjs/components/_classes/component/Component.d.ts +269 -502
  248. package/lib/mjs/components/_classes/component/Component.form.d.ts +3 -6
  249. package/lib/mjs/components/_classes/component/Component.form.js +0 -5
  250. package/lib/mjs/components/_classes/component/Component.js +189 -433
  251. package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
  252. package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -1
  253. package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
  254. package/lib/mjs/components/_classes/field/Field.d.ts +2 -11
  255. package/lib/mjs/components/_classes/field/Field.js +1 -13
  256. package/lib/mjs/components/_classes/input/Input.d.ts +3 -4
  257. package/lib/mjs/components/_classes/input/Input.js +2 -2
  258. package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
  259. package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +3 -6
  260. package/lib/mjs/components/_classes/list/ListComponent.form.js +0 -5
  261. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +12 -43
  262. package/lib/mjs/components/_classes/multivalue/Multivalue.js +3 -37
  263. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +67 -163
  264. package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +3 -6
  265. package/lib/mjs/components/_classes/nested/NestedComponent.form.js +0 -5
  266. package/lib/mjs/components/_classes/nested/NestedComponent.js +54 -175
  267. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
  268. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  269. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -7
  270. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +3 -2
  271. package/lib/mjs/components/address/Address.d.ts +2 -4
  272. package/lib/mjs/components/address/Address.form.d.ts +3 -6
  273. package/lib/mjs/components/address/Address.form.js +0 -5
  274. package/lib/mjs/components/button/Button.d.ts +12 -3
  275. package/lib/mjs/components/button/Button.form.d.ts +3 -6
  276. package/lib/mjs/components/button/Button.form.js +0 -5
  277. package/lib/mjs/components/button/Button.js +0 -5
  278. package/lib/mjs/components/checkbox/Checkbox.d.ts +27 -4
  279. package/lib/mjs/components/checkbox/Checkbox.form.d.ts +3 -6
  280. package/lib/mjs/components/checkbox/Checkbox.form.js +0 -5
  281. package/lib/mjs/components/columns/Columns.d.ts +2 -3
  282. package/lib/mjs/components/columns/Columns.form.d.ts +3 -6
  283. package/lib/mjs/components/columns/Columns.form.js +0 -5
  284. package/lib/mjs/components/columns/Columns.js +1 -1
  285. package/lib/mjs/components/container/Container.form.d.ts +3 -6
  286. package/lib/mjs/components/container/Container.form.js +0 -5
  287. package/lib/mjs/components/content/Content.d.ts +1 -2
  288. package/lib/mjs/components/content/Content.form.d.ts +3 -6
  289. package/lib/mjs/components/content/Content.form.js +0 -5
  290. package/lib/mjs/components/currency/Currency.form.d.ts +3 -6
  291. package/lib/mjs/components/currency/Currency.form.js +0 -5
  292. package/lib/mjs/components/currency/Currency.js +2 -1
  293. package/lib/mjs/components/datagrid/DataGrid.d.ts +7 -8
  294. package/lib/mjs/components/datagrid/DataGrid.form.d.ts +3 -6
  295. package/lib/mjs/components/datagrid/DataGrid.form.js +0 -5
  296. package/lib/mjs/components/datagrid/DataGrid.js +5 -5
  297. package/lib/mjs/components/datamap/DataMap.d.ts +0 -1
  298. package/lib/mjs/components/datamap/DataMap.form.d.ts +3 -6
  299. package/lib/mjs/components/datamap/DataMap.form.js +0 -5
  300. package/lib/mjs/components/datetime/DateTime.d.ts +14 -0
  301. package/lib/mjs/components/datetime/DateTime.form.d.ts +3 -6
  302. package/lib/mjs/components/datetime/DateTime.form.js +0 -5
  303. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
  304. package/lib/mjs/components/day/Day.d.ts +48 -22
  305. package/lib/mjs/components/day/Day.form.d.ts +3 -6
  306. package/lib/mjs/components/day/Day.form.js +0 -5
  307. package/lib/mjs/components/day/Day.js +20 -15
  308. package/lib/mjs/components/editgrid/EditGrid.d.ts +3 -7
  309. package/lib/mjs/components/editgrid/EditGrid.form.d.ts +3 -6
  310. package/lib/mjs/components/editgrid/EditGrid.form.js +0 -5
  311. package/lib/mjs/components/editgrid/EditGrid.js +3 -3
  312. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  313. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +1 -1
  314. package/lib/mjs/components/email/Email.form.d.ts +3 -6
  315. package/lib/mjs/components/email/Email.form.js +0 -5
  316. package/lib/mjs/components/fieldset/Fieldset.form.d.ts +3 -6
  317. package/lib/mjs/components/fieldset/Fieldset.form.js +0 -5
  318. package/lib/mjs/components/file/File.d.ts +22 -9
  319. package/lib/mjs/components/file/File.form.d.ts +3 -6
  320. package/lib/mjs/components/file/File.form.js +0 -5
  321. package/lib/mjs/components/form/Form.d.ts +20 -31
  322. package/lib/mjs/components/form/Form.form.d.ts +3 -6
  323. package/lib/mjs/components/form/Form.form.js +0 -5
  324. package/lib/mjs/components/form/Form.js +10 -13
  325. package/lib/mjs/components/hidden/Hidden.d.ts +11 -1
  326. package/lib/mjs/components/hidden/Hidden.form.d.ts +3 -6
  327. package/lib/mjs/components/hidden/Hidden.form.js +0 -5
  328. package/lib/mjs/components/hidden/Hidden.js +2 -1
  329. package/lib/mjs/components/html/HTML.d.ts +1 -2
  330. package/lib/mjs/components/html/HTML.form.d.ts +3 -6
  331. package/lib/mjs/components/html/HTML.form.js +0 -5
  332. package/lib/mjs/components/number/Number.d.ts +17 -3
  333. package/lib/mjs/components/number/Number.form.d.ts +3 -6
  334. package/lib/mjs/components/number/Number.form.js +0 -5
  335. package/lib/mjs/components/number/Number.js +2 -1
  336. package/lib/mjs/components/panel/Panel.form.d.ts +3 -6
  337. package/lib/mjs/components/panel/Panel.form.js +0 -5
  338. package/lib/mjs/components/panel/Panel.js +1 -0
  339. package/lib/mjs/components/password/Password.form.d.ts +3 -6
  340. package/lib/mjs/components/password/Password.form.js +0 -5
  341. package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +3 -6
  342. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +0 -5
  343. package/lib/mjs/components/radio/Radio.d.ts +26 -3
  344. package/lib/mjs/components/radio/Radio.form.d.ts +3 -6
  345. package/lib/mjs/components/radio/Radio.form.js +0 -5
  346. package/lib/mjs/components/radio/Radio.js +4 -3
  347. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  348. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +3 -5
  349. package/lib/mjs/components/recaptcha/ReCaptcha.form.js +0 -4
  350. package/lib/mjs/components/select/Select.d.ts +39 -16
  351. package/lib/mjs/components/select/Select.form.d.ts +3 -6
  352. package/lib/mjs/components/select/Select.form.js +0 -5
  353. package/lib/mjs/components/select/Select.js +16 -13
  354. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +17 -2
  355. package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +3 -6
  356. package/lib/mjs/components/selectboxes/SelectBoxes.form.js +0 -5
  357. package/lib/mjs/components/selectboxes/SelectBoxes.js +9 -7
  358. package/lib/mjs/components/signature/Signature.d.ts +14 -1
  359. package/lib/mjs/components/signature/Signature.form.d.ts +3 -6
  360. package/lib/mjs/components/signature/Signature.form.js +0 -5
  361. package/lib/mjs/components/survey/Survey.d.ts +15 -3
  362. package/lib/mjs/components/survey/Survey.form.d.ts +3 -6
  363. package/lib/mjs/components/survey/Survey.form.js +0 -5
  364. package/lib/mjs/components/table/Table.d.ts +1 -2
  365. package/lib/mjs/components/table/Table.form.d.ts +3 -6
  366. package/lib/mjs/components/table/Table.form.js +0 -5
  367. package/lib/mjs/components/tabs/Tabs.d.ts +4 -4
  368. package/lib/mjs/components/tabs/Tabs.form.d.ts +3 -6
  369. package/lib/mjs/components/tabs/Tabs.form.js +0 -5
  370. package/lib/mjs/components/tabs/Tabs.js +2 -1
  371. package/lib/mjs/components/tags/Tags.d.ts +14 -0
  372. package/lib/mjs/components/tags/Tags.form.d.ts +3 -6
  373. package/lib/mjs/components/tags/Tags.form.js +0 -5
  374. package/lib/mjs/components/textarea/TextArea.d.ts +9 -4
  375. package/lib/mjs/components/textarea/TextArea.form.d.ts +3 -6
  376. package/lib/mjs/components/textarea/TextArea.form.js +0 -5
  377. package/lib/mjs/components/textarea/TextArea.js +2 -2
  378. package/lib/mjs/components/textfield/TextField.d.ts +30 -14
  379. package/lib/mjs/components/textfield/TextField.form.d.ts +3 -6
  380. package/lib/mjs/components/textfield/TextField.form.js +0 -5
  381. package/lib/mjs/components/textfield/TextField.js +16 -13
  382. package/lib/mjs/components/time/Time.form.d.ts +3 -6
  383. package/lib/mjs/components/time/Time.form.js +0 -5
  384. package/lib/mjs/components/unknown/Unknown.form.d.ts +34 -5
  385. package/lib/mjs/components/unknown/Unknown.form.js +0 -4
  386. package/lib/mjs/components/url/Url.form.d.ts +3 -6
  387. package/lib/mjs/components/url/Url.form.js +0 -5
  388. package/lib/mjs/components/well/Well.form.d.ts +3 -6
  389. package/lib/mjs/components/well/Well.form.js +0 -5
  390. package/lib/mjs/formio.embed.d.ts +2 -1
  391. package/lib/mjs/formio.embed.js +99 -2
  392. package/lib/mjs/formio.form.d.ts +4 -11
  393. package/lib/mjs/formio.form.js +3 -10
  394. package/lib/mjs/providers/Providers.d.ts +5 -36
  395. package/lib/mjs/providers/Providers.js +0 -29
  396. package/lib/mjs/providers/address/AddressProvider.d.ts +12 -131
  397. package/lib/mjs/providers/address/AddressProvider.js +2 -88
  398. package/lib/mjs/providers/address/AzureAddressProvider.d.ts +1 -48
  399. package/lib/mjs/providers/address/AzureAddressProvider.js +0 -37
  400. package/lib/mjs/providers/address/CustomAddressProvider.d.ts +4 -27
  401. package/lib/mjs/providers/address/CustomAddressProvider.js +0 -34
  402. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +6 -130
  403. package/lib/mjs/providers/address/GoogleAddressProvider.js +0 -72
  404. package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +7 -32
  405. package/lib/mjs/providers/address/NominatimAddressProvider.js +0 -33
  406. package/lib/mjs/providers/address/index.d.ts +1 -3
  407. package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -7
  408. package/lib/mjs/providers/processor/fileProcessor.js +0 -6
  409. package/lib/mjs/providers/storage/azure.d.ts +13 -6
  410. package/lib/mjs/providers/storage/azure.js +0 -5
  411. package/lib/mjs/providers/storage/base64.d.ts +6 -5
  412. package/lib/mjs/providers/storage/base64.js +0 -4
  413. package/lib/mjs/providers/storage/dropbox.d.ts +4 -6
  414. package/lib/mjs/providers/storage/dropbox.js +0 -5
  415. package/lib/mjs/providers/storage/googleDrive.d.ts +5 -7
  416. package/lib/mjs/providers/storage/googleDrive.js +0 -6
  417. package/lib/mjs/providers/storage/indexeddb.d.ts +7 -5
  418. package/lib/mjs/providers/storage/indexeddb.js +0 -4
  419. package/lib/mjs/providers/storage/s3.d.ts +20 -6
  420. package/lib/mjs/providers/storage/s3.js +0 -5
  421. package/lib/mjs/providers/storage/url.d.ts +7 -6
  422. package/lib/mjs/providers/storage/url.js +0 -10
  423. package/lib/mjs/providers/storage/util.d.ts +1 -24
  424. package/lib/mjs/providers/storage/util.js +0 -18
  425. package/lib/mjs/templates/Templates.d.ts +0 -1
  426. package/lib/mjs/translations/en.d.ts +1 -0
  427. package/lib/mjs/translations/en.js +1 -0
  428. package/lib/mjs/utils/Evaluator.d.ts +3 -6
  429. package/lib/mjs/utils/Evaluator.js +20 -9
  430. package/lib/mjs/utils/builder.d.ts +7 -9
  431. package/lib/mjs/utils/builder.js +5 -10
  432. package/lib/mjs/utils/calendarUtils.d.ts +13 -7
  433. package/lib/mjs/utils/calendarUtils.js +17 -10
  434. package/lib/mjs/utils/formUtils.d.ts +171 -43
  435. package/lib/mjs/utils/formUtils.js +554 -6
  436. package/lib/mjs/utils/utils.d.ts +216 -362
  437. package/lib/mjs/utils/utils.js +218 -325
  438. package/lib/mjs/widgets/CalendarWidget.d.ts +10 -9
  439. package/lib/mjs/widgets/CalendarWidget.js +11 -9
  440. package/package.json +22 -22
  441. package/embed.d.ts +0 -1
  442. package/form.d.ts +0 -1
  443. package/lib/cjs/InlineEmbed.d.ts +0 -7
  444. package/lib/cjs/InlineEmbed.js +0 -109
  445. package/lib/mjs/InlineEmbed.d.ts +0 -7
  446. package/lib/mjs/InlineEmbed.js +0 -105
  447. package/sdk.d.ts +0 -1
  448. 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,9 @@ export function getElementRect(element) {
87
133
  }
88
134
  /**
89
135
  * Determines the boolean value of a setting.
90
- * @param {string|boolean} value - A string or boolean value to convert to boolean.
91
- * @returns {boolean} - The boolean value of the setting.
136
+ *
137
+ * @param value
138
+ * @return {boolean}
92
139
  */
93
140
  export function boolValue(value) {
94
141
  if (_.isBoolean(value)) {
@@ -103,17 +150,21 @@ export function boolValue(value) {
103
150
  }
104
151
  /**
105
152
  * Check to see if an ID is a mongoID.
106
- * @param {string} text - The text to check if it is a mongoID.
107
- * @returns {boolean} - TRUE if the text is a mongoID; FALSE otherwise.
153
+ * @param text
154
+ * @return {Array|{index: number, input: string}|Boolean|*}
108
155
  */
109
156
  export function isMongoId(text) {
110
- return !!text.toString().match(/^[0-9a-fA-F]{24}$/);
157
+ return text.toString().match(/^[0-9a-fA-F]{24}$/);
111
158
  }
112
159
  /**
113
160
  * Checks the calculated value for a provided component and data.
114
- * @param {import('@formio/core').Component} component - The component to check for the calculated value.
115
- * @param {import('@formio/core').Submission} submission - A submission object.
116
- * @param {*} rowData - The contextual row data for the component.
161
+ *
162
+ * @param {Object} component
163
+ * The component to check for the calculated value.
164
+ * @param {Object} submission
165
+ * A submission object.
166
+ * @param data
167
+ * The full submission data.
117
168
  */
118
169
  export function checkCalculated(component, submission, rowData) {
119
170
  // Process calculated value stuff if present.
@@ -129,12 +180,13 @@ export function checkCalculated(component, submission, rowData) {
129
180
  }
130
181
  /**
131
182
  * Check if a simple conditional evaluates to true.
132
- * @param {import('@formio/core').Component} component - The component to check for the conditional.
133
- * @param {import('@formio/core').SimpleConditional} condition - The condition to check.
134
- * @param {*} row - The row data for the component.
135
- * @param {*} data - The full submission data.
136
- * @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
137
- * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
183
+ *
184
+ * @param condition
185
+ * @param condition
186
+ * @param row
187
+ * @param data
188
+ * @param instance
189
+ * @returns {boolean}
138
190
  */
139
191
  export function checkSimpleConditional(component, condition, row, data, instance) {
140
192
  if (condition.when) {
@@ -178,13 +230,6 @@ export function checkSimpleConditional(component, condition, row, data, instance
178
230
  return show ? result : !result;
179
231
  }
180
232
  }
181
- /**
182
- * Returns a components normalized value.
183
- * @param {string} compPath - The full path to the component.
184
- * @param {*} data - The data object to get the value from.
185
- * @param {*} row - The contextual row data for the component.
186
- * @returns {*} - The normalized value of the component.
187
- */
188
233
  export function getComponentActualValue(compPath, data, row) {
189
234
  let value = null;
190
235
  if (row) {
@@ -201,15 +246,12 @@ export function getComponentActualValue(compPath, data, row) {
201
246
  }
202
247
  /**
203
248
  * Check custom javascript conditional.
204
- * @param {import('@formio/core').Component} component - The component to check for the conditional.
205
- * @param {string} custom - The custom conditional string to evaluate.
206
- * @param {*} row - The row data for the component.
207
- * @param {*} data - The full submission data.
208
- * @param {import('@formio/core').Form} form - The form object.
209
- * @param {string} variable - The variable name for the result of the custom conditional.
210
- * @param {*} onError - A custom return if there is an error or the value is null from the evaluation.
211
- * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.
212
- * @returns {*} - The result of the evaulation.
249
+ *
250
+ * @param component
251
+ * @param custom
252
+ * @param row
253
+ * @param data
254
+ * @returns {*}
213
255
  */
214
256
  export function checkCustomConditional(component, custom, row, data, form, variable, onError, instance) {
215
257
  if (typeof custom === 'string') {
@@ -223,16 +265,6 @@ export function checkCustomConditional(component, custom, row, data, form, varia
223
265
  }
224
266
  return value;
225
267
  }
226
- /**
227
- * Check a component for JSON conditionals.
228
- * @param {import('@formio/core').Component} component - The component
229
- * @param {import('@formio/core').JSONConditional} json - The json conditional to check.
230
- * @param {*} row - The contextual row data for the component.
231
- * @param {*} data - The full submission data.
232
- * @param {import('@formio/core').Form} form - The Form JSON of the form.
233
- * @param {*} onError - Custom return value if there is an error.
234
- * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
235
- */
236
268
  export function checkJsonConditional(component, json, row, data, form, onError) {
237
269
  try {
238
270
  return jsonLogic.apply(json, {
@@ -247,14 +279,6 @@ export function checkJsonConditional(component, json, row, data, form, onError)
247
279
  return onError;
248
280
  }
249
281
  }
250
- /**
251
- * Returns the contextual row data for a component.
252
- * @param {import('@formio/core').Component} component - The component to get the row data for.
253
- * @param {*} row - The row data for the component.
254
- * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.
255
- * @param {*} conditional - The component conditional.
256
- * @returns {*} - The contextual row data for the component.
257
- */
258
282
  function getRow(component, row, instance, conditional) {
259
283
  const condition = conditional || component.conditional;
260
284
  // If no component's instance passed (happens only in 6.x server), calculate its path based on the schema
@@ -276,12 +300,15 @@ function getRow(component, row, instance, conditional) {
276
300
  }
277
301
  /**
278
302
  * Checks the conditions for a provided component and data.
279
- * @param {import('@formio/core').Component} component - The component to check for the condition.
280
- * @param {*} row - The data within a row
281
- * @param {*} data - The full submission data.
282
- * @param {import('@formio/core').Form} form - The form object.
283
- * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.
284
- * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
303
+ *
304
+ * @param component
305
+ * The component to check for the condition.
306
+ * @param row
307
+ * The data within a row
308
+ * @param data
309
+ * The full submission data.
310
+ *
311
+ * @returns {boolean}
285
312
  */
286
313
  export function checkCondition(component, row, data, form, instance) {
287
314
  const { customConditional, conditional } = component;
@@ -300,13 +327,12 @@ export function checkCondition(component, row, data, form, instance) {
300
327
  }
301
328
  /**
302
329
  * Test a trigger on a component.
303
- * @param {import('@formio/core').Component} component - The component to test the trigger against.
304
- * @param {import('@formio/core').LogicTrigger} trigger - The trigger configuration.
305
- * @param {import('@formio/core').DataObject} row - The contextual row data.
306
- * @param {import('@formio/core').DataObject} data - The root data object.
307
- * @param {import('@formio/core').Form} form - The form object.
308
- * @param {any} instance - The component that is performing the trigger.
309
- * @returns {boolean} - TRUE if the trigger should fire; FALSE otherwise.
330
+ *
331
+ * @param component
332
+ * @param action
333
+ * @param data
334
+ * @param row
335
+ * @returns {mixed}
310
336
  */
311
337
  export function checkTrigger(component, trigger, row, data, form, instance) {
312
338
  // If trigger is empty, don't fire it
@@ -325,16 +351,6 @@ export function checkTrigger(component, trigger, row, data, form, instance) {
325
351
  // If none of the types matched, don't fire the trigger.
326
352
  return false;
327
353
  }
328
- /**
329
- * Sets a property on a component via an executed Logic action.
330
- * @param {import('@formio/core').Component} component - The component to set the property on.
331
- * @param {import('@formio/core').LogicAction} action - The action to perform on the component.
332
- * @param {string} result - The name of the variable in the evaulation to use as the result.
333
- * @param {import('@formio/core').DataObject} row - The contextual row data.
334
- * @param {import('@formio/core').DataObject} data - The full submission data.
335
- * @param {any} instance - The component instance.
336
- * @returns {import('@formio/core').Component} - The modified component.
337
- */
338
354
  export function setActionProperty(component, action, result, row, data, instance) {
339
355
  const property = action.property.value;
340
356
  switch (action.property.type) {
@@ -368,8 +384,8 @@ export function setActionProperty(component, action, result, row, data, instance
368
384
  }
369
385
  /**
370
386
  * Unescape HTML characters like &lt, &gt, &amp and etc.
371
- * @param {string} str - The string to unescape.
372
- * @returns {string} - The unescaped string.
387
+ * @param str
388
+ * @returns {string}
373
389
  */
374
390
  export function unescapeHTML(str) {
375
391
  if (typeof window === 'undefined' || !('DOMParser' in window)) {
@@ -380,9 +396,9 @@ export function unescapeHTML(str) {
380
396
  }
381
397
  /**
382
398
  * Make HTML element from string
383
- * @param {string} str - The string to convert to an HTML element.
384
- * @param {string} selector - The selector to use to get the element once it is created.
385
- * @returns {HTMLElement} - The HTML element that was created.
399
+ * @param str
400
+ * @param selector
401
+ * @returns {HTMLElement}
386
402
  */
387
403
  export function convertStringToHTMLElement(str, selector) {
388
404
  const doc = new window.DOMParser().parseFromString(str, 'text/html');
@@ -390,10 +406,10 @@ export function convertStringToHTMLElement(str, selector) {
390
406
  }
391
407
  /**
392
408
  * Make a filename guaranteed to be unique.
393
- * @param {string} name - The original name of the file.
394
- * @param {string} template - The template to use for the unique name.
395
- * @param {object} evalContext - The context to use for the evaluation.
396
- * @returns {string} - A unique filename.
409
+ * @param name
410
+ * @param template
411
+ * @param evalContext
412
+ * @returns {string}
397
413
  */
398
414
  export function uniqueName(name, template, evalContext) {
399
415
  template = template || '{{fileName}}-{{guid}}';
@@ -416,10 +432,6 @@ export function uniqueName(name, template, evalContext) {
416
432
  const uniqueName = `${Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\-_ ]/g, '-');
417
433
  return uniqueName;
418
434
  }
419
- /**
420
- * Returns a GUID
421
- * @returns {string} - A GUID.
422
- */
423
435
  export function guid() {
424
436
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
425
437
  const r = Math.random() * 16 | 0;
@@ -431,8 +443,9 @@ export function guid() {
431
443
  }
432
444
  /**
433
445
  * Return a translated date setting.
434
- * @param {string|Date} date - The date to translate.
435
- * @returns {(null|Date)} - The translated date.
446
+ *
447
+ * @param date
448
+ * @return {(null|Date)}
436
449
  */
437
450
  export function getDateSetting(date) {
438
451
  if (_.isNil(date) || _.isNaN(date) || date === '') {
@@ -473,17 +486,13 @@ export function getDateSetting(date) {
473
486
  }
474
487
  return dateSetting.toDate();
475
488
  }
476
- /**
477
- * Returns true if the date is a valid date. False otherwise.
478
- * @param {Date|string} date - The date to check for validity.
479
- * @returns {boolean} - TRUE if the date is valid; FALSE otherwise.
480
- */
481
489
  export function isValidDate(date) {
482
490
  return _.isDate(date) && !_.isNaN(date.getDate());
483
491
  }
484
492
  /**
485
493
  * Get the current timezone string.
486
- * @returns {string} - The current timezone.
494
+ *
495
+ * @return {string}
487
496
  */
488
497
  export function currentTimezone() {
489
498
  if (moment.currentTimezone) {
@@ -494,9 +503,10 @@ export function currentTimezone() {
494
503
  }
495
504
  /**
496
505
  * Get an offset date provided a date object and timezone object.
497
- * @param {Date} date - The date to offset.
498
- * @param {string} timezone - The timezone to offset the date to.
499
- * @returns {Date} - The offset date.
506
+ *
507
+ * @param date
508
+ * @param timezone
509
+ * @return {Date}
500
510
  */
501
511
  export function offsetDate(date, timezone) {
502
512
  if (timezone === 'UTC') {
@@ -513,15 +523,17 @@ export function offsetDate(date, timezone) {
513
523
  }
514
524
  /**
515
525
  * Returns if the zones are loaded.
516
- * @returns {boolean} - TRUE if the zones are loaded; FALSE otherwise.
526
+ *
527
+ * @return {boolean}
517
528
  */
518
529
  export function zonesLoaded() {
519
530
  return moment.zonesLoaded;
520
531
  }
521
532
  /**
522
533
  * Returns if we should load the zones.
523
- * @param {string} timezone - The timezone to check if we should load the zones.
524
- * @returns {boolean} - TRUE if we should load the zones; FALSE otherwise.
534
+ *
535
+ * @param timezone
536
+ * @return {boolean}
525
537
  */
526
538
  export function shouldLoadZones(timezone) {
527
539
  if (timezone === currentTimezone() || timezone === 'UTC') {
@@ -531,9 +543,8 @@ export function shouldLoadZones(timezone) {
531
543
  }
532
544
  /**
533
545
  * Externally load the timezone data.
534
- * @param {string} url - The URL to load the timezone data from.
535
- * @param {string} timezone - The timezone to load.
536
- * @returns {Promise<any> | *} - Resolves when the zones for this timezone are loaded.
546
+ *
547
+ * @return {Promise<any> | *}
537
548
  */
538
549
  export function loadZones(url, timezone) {
539
550
  if (timezone && !shouldLoadZones(timezone)) {
@@ -557,10 +568,11 @@ export function loadZones(url, timezone) {
557
568
  }
558
569
  /**
559
570
  * Get the moment date object for translating dates with timezones.
560
- * @param {string|Date} value - The value to convert into a moment date.
561
- * @param {string} format - The format to convert the date to.
562
- * @param {string} timezone - The timezone to convert the date to.
563
- * @returns {Date} - The moment date object.
571
+ *
572
+ * @param value
573
+ * @param format
574
+ * @param timezone
575
+ * @return {*}
564
576
  */
565
577
  export function momentDate(value, format, timezone) {
566
578
  const momentDate = moment(value);
@@ -577,12 +589,11 @@ export function momentDate(value, format, timezone) {
577
589
  }
578
590
  /**
579
591
  * Format a date provided a value, format, and timezone object.
580
- * @param {string} timezonesUrl - The URL to load the timezone data from.
581
- * @param {string|Date} value - The value to format.
582
- * @param {string} format - The format to format the date to.
583
- * @param {string} timezone - The timezone to format the date to.
584
- * @param {string} flatPickrInputFormat - The format to use for flatpickr input.
585
- * @returns {string} - The formatted date.
592
+ *
593
+ * @param value
594
+ * @param format
595
+ * @param timezone
596
+ * @return {string}
586
597
  */
587
598
  export function formatDate(timezonesUrl, value, format, timezone, flatPickrInputFormat) {
588
599
  const momentDate = moment(value, flatPickrInputFormat || undefined);
@@ -615,12 +626,12 @@ export function formatDate(timezonesUrl, value, format, timezone, flatPickrInput
615
626
  }
616
627
  /**
617
628
  * Pass a format function to format within a timezone.
618
- * @param {string} timezonesUrl - The URL to load the timezone data from.
619
- * @param {Function} formatFn - The format function to use.
620
- * @param {Date|string} date - The date to format.
621
- * @param {string} format - The format to format the date to.
622
- * @param {string} timezone - The timezone to format the date to.
623
- * @returns {string} - The formatted date.
629
+ *
630
+ * @param formatFn
631
+ * @param date
632
+ * @param format
633
+ * @param timezone
634
+ * @return {string}
624
635
  */
625
636
  export function formatOffset(timezonesUrl, formatFn, date, format, timezone) {
626
637
  if (timezone === currentTimezone()) {
@@ -639,11 +650,6 @@ export function formatOffset(timezonesUrl, formatFn, date, format, timezone) {
639
650
  return formatFn(date, format);
640
651
  }
641
652
  }
642
- /**
643
- * Returns the local date format information.
644
- * @param {Intl.LocalesArgument} locale - The locale to get the date format for.
645
- * @returns {object} - The local date format information.
646
- */
647
653
  export function getLocaleDateFormatInfo(locale) {
648
654
  const formatInfo = {};
649
655
  const day = 21;
@@ -654,8 +660,8 @@ export function getLocaleDateFormatInfo(locale) {
654
660
  }
655
661
  /**
656
662
  * Convert the format from the angular-datepicker module to flatpickr format.
657
- * @param {string} format - The format to convert.
658
- * @returns {string} - The converted format.
663
+ * @param format
664
+ * @return {string}
659
665
  */
660
666
  export function convertFormatToFlatpickr(format) {
661
667
  return format
@@ -685,8 +691,8 @@ export function convertFormatToFlatpickr(format) {
685
691
  }
686
692
  /**
687
693
  * Convert the format from the angular-datepicker module to moment format.
688
- * @param {string} format - The format to convert.
689
- * @returns {string} - The converted format.
694
+ * @param format
695
+ * @return {string}
690
696
  */
691
697
  export function convertFormatToMoment(format) {
692
698
  return format
@@ -701,11 +707,6 @@ export function convertFormatToMoment(format) {
701
707
  // Unix Timestamp
702
708
  .replace(/U/g, 'X');
703
709
  }
704
- /**
705
- * Convert the format from the angular-datepicker module to mask format.
706
- * @param {string} format - The format to convert.
707
- * @returns {string} - The converted format.
708
- */
709
710
  export function convertFormatToMask(format) {
710
711
  return format
711
712
  // Long month replacement.
@@ -763,13 +764,6 @@ export function getInputMask(mask, placeholderChar) {
763
764
  }
764
765
  return maskArray;
765
766
  }
766
- /**
767
- * Unmasks a value using the provided mask and placeholder characters.
768
- * @param {string} value - The value to unmask.
769
- * @param {string} mask - The mask to use for unmasking.
770
- * @param {string} placeholderChar - The placeholder character to use for unmasking.
771
- * @returns {string} - The unmasked value.
772
- */
773
767
  export function unmaskValue(value, mask, placeholderChar) {
774
768
  if (!mask || !value || value.length > mask.length) {
775
769
  return value;
@@ -785,12 +779,6 @@ export function unmaskValue(value, mask, placeholderChar) {
785
779
  unmaskedValue = unmaskedValue.join('').replace(placeholderChar, '');
786
780
  return unmaskedValue;
787
781
  }
788
- /**
789
- * Returns true if the value matches the input mask format.
790
- * @param {string} value - The value to check.
791
- * @param {string} inputMask - The input mask to check against.
792
- * @returns {boolean} - TRUE if the value matches the input mask; FALSE otherwise.
793
- */
794
782
  export function matchInputMask(value, inputMask) {
795
783
  if (!inputMask) {
796
784
  return true;
@@ -808,11 +796,6 @@ export function matchInputMask(value, inputMask) {
808
796
  }
809
797
  return true;
810
798
  }
811
- /**
812
- * Returns the number separators (i.e. 1,000) for the provided language.
813
- * @param {string} lang - The language code to get the number separators for.
814
- * @returns {{delimiter: string, decimalSeparator: string}} - The number separators.
815
- */
816
799
  export function getNumberSeparators(lang = 'en') {
817
800
  const formattedNumberString = (12345.6789).toLocaleString(lang);
818
801
  const delimeters = formattedNumberString.match(/..(.)...(.)../);
@@ -827,12 +810,6 @@ export function getNumberSeparators(lang = 'en') {
827
810
  decimalSeparator: (delimeters.length > 2) ? delimeters[2] : '.',
828
811
  };
829
812
  }
830
- /**
831
- * Returns the number for the maximum amount of decimal places for a number.
832
- * @param {import('@formio/core').Component} component - The component to check for decimal limits.
833
- * @param {number} defaultLimit - The default limit to use if none is provided in the component.
834
- * @returns {number} - The number of decimal places allowed.
835
- */
836
813
  export function getNumberDecimalLimit(component, defaultLimit) {
837
814
  if (_.has(component, 'decimalLimit')) {
838
815
  return _.get(component, 'decimalLimit');
@@ -848,15 +825,6 @@ export function getNumberDecimalLimit(component, defaultLimit) {
848
825
  }
849
826
  return decimalLimit;
850
827
  }
851
- /**
852
- * Returns the currency affixes for a specific language.
853
- * @param {object} arg0 - The arguments object.
854
- * @param {string} arg0.currency - The currency code to get the affixes for.
855
- * @param {number} arg0.decimalLimit - The number of decimal places to use.
856
- * @param {string} arg0.decimalSeparator - The decimal separator to use.
857
- * @param {string} arg0.lang - The language code to use.
858
- * @returns {{prefix: string, suffix: string}} - The currency affixes.
859
- */
860
828
  export function getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, lang, }) {
861
829
  // Get the prefix and suffix from the localized string.
862
830
  let regex = `(.*)?${(100).toLocaleString(lang)}`;
@@ -878,9 +846,10 @@ export function getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, l
878
846
  }
879
847
  /**
880
848
  * Fetch the field data provided a component.
881
- * @param {import('@formio/core').DataObject} data - The data object to fetch the field data from.
882
- * @param {import('@formio/core').Component} component - The component to fetch the field data for.
883
- * @returns {*} - The field data.
849
+ *
850
+ * @param data
851
+ * @param component
852
+ * @return {*}
884
853
  */
885
854
  export function fieldData(data, component) {
886
855
  if (!data) {
@@ -926,23 +895,16 @@ export function fieldData(data, component) {
926
895
  }
927
896
  /**
928
897
  * Delays function execution with possibility to execute function synchronously or cancel it.
929
- * @param {Function} fn - Function to delay
930
- * @param {number} delay - Delay time
931
- * @param {...any} args - Arguments to pass to the function
932
- * @returns {*} - Function to cancel the delay
898
+ *
899
+ * @param fn Function to delay
900
+ * @param delay Delay time
901
+ * @return {*}
933
902
  */
934
903
  export function delay(fn, delay = 0, ...args) {
935
904
  const timer = setTimeout(fn, delay, ...args);
936
- /**
937
- *
938
- */
939
905
  function cancel() {
940
906
  clearTimeout(timer);
941
907
  }
942
- /**
943
- * Execute the function early.
944
- * @returns {*} - The result of the function.
945
- */
946
908
  function earlyCall() {
947
909
  cancel();
948
910
  return fn(...args);
@@ -953,9 +915,11 @@ export function delay(fn, delay = 0, ...args) {
953
915
  }
954
916
  /**
955
917
  * Iterate the given key to make it unique.
956
- * @param {string} key
918
+ *
919
+ * @param {String} key
957
920
  * Modify the component key to be unique.
958
- * @returns {string}
921
+ *
922
+ * @returns {String}
959
923
  * The new component key.
960
924
  */
961
925
  export function iterateKey(key) {
@@ -968,9 +932,10 @@ export function iterateKey(key) {
968
932
  }
969
933
  /**
970
934
  * Determines a unique key within a map provided the base key.
971
- * @param {Record<string, string>} map - The map to check for uniqueness.
972
- * @param {string} base - The base path of the key.
973
- * @returns {string} - The unique key.
935
+ *
936
+ * @param map
937
+ * @param base
938
+ * @return {*}
974
939
  */
975
940
  export function uniqueKey(map, base) {
976
941
  let newKey = base;
@@ -981,9 +946,8 @@ export function uniqueKey(map, base) {
981
946
  }
982
947
  /**
983
948
  * Determines the major version number of bootstrap.
984
- * @param {object} options - The options to check for bootstrap version.
985
- * @param {string} options.bootstrap - The bootstrap version to use.
986
- * @returns {number} - The bootstrap version.
949
+ *
950
+ * @return {number}
987
951
  */
988
952
  export function bootstrapVersion(options) {
989
953
  if (options.bootstrap) {
@@ -1000,8 +964,9 @@ export function bootstrapVersion(options) {
1000
964
  /**
1001
965
  * Retrun provided argument.
1002
966
  * If argument is a function, returns the result of a function call.
1003
- * @param {Function|any} e - The argument to check if a function and call if so.
1004
- * @returns {any} - Either the result of the function call (e) or e if it is not a function.
967
+ * @param {*} e;
968
+ *
969
+ * @return {*}
1005
970
  */
1006
971
  export function unfold(e) {
1007
972
  if (typeof e === 'function') {
@@ -1011,32 +976,27 @@ export function unfold(e) {
1011
976
  }
1012
977
  /**
1013
978
  * Map values through unfold and return first non-nil value.
1014
- * @param {Array<T>} collection - The collection to map through unfold.;
1015
- * @returns {T} - The first non-nil value.
979
+ * @param {Array<T>} collection;
980
+ *
981
+ * @return {T}
1016
982
  */
1017
983
  export const firstNonNil = _.flow([
1018
984
  _.partialRight(_.map, unfold),
1019
985
  _.partialRight(_.find, v => !_.isUndefined(v))
1020
986
  ]);
1021
- /**
1022
- * Create enclosed state. Returns functions to getting and cycling between states.
987
+ /*
988
+ * Create enclosed state.
989
+ * Returns functions to getting and cycling between states.
1023
990
  * @param {*} a - initial state.
1024
991
  * @param {*} b - next state.
1025
- * @returns {Functions[]} -- [get, toggle];
992
+ * @return {Functions[]} -- [get, toggle];
1026
993
  */
1027
994
  export function withSwitch(a, b) {
1028
995
  let state = a;
1029
996
  let next = b;
1030
- /**
1031
- * Returns the state of the switch.
1032
- * @returns {*} - The current state.
1033
- */
1034
997
  function get() {
1035
998
  return state;
1036
999
  }
1037
- /**
1038
- * Toggles the state of the switch.
1039
- */
1040
1000
  function toggle() {
1041
1001
  const prev = state;
1042
1002
  state = next;
@@ -1044,14 +1004,6 @@ export function withSwitch(a, b) {
1044
1004
  }
1045
1005
  return [get, toggle];
1046
1006
  }
1047
- /**
1048
- * Create a function that will call the provided function only the provided limit.
1049
- * @param {Function} callback - The callback to call.
1050
- * @param {object} options - The options to use.
1051
- * @param {number} options.limit - The limit to call the callback.
1052
- * @param {number} options.delay - The delay to wait before resetting the call count.
1053
- * @returns {Function} - The function that will call the callback only the provided limit.
1054
- */
1055
1007
  export function observeOverload(callback, options = {}) {
1056
1008
  const { limit = 50, delay = 500 } = options;
1057
1009
  let callCount = 0;
@@ -1071,13 +1023,6 @@ export function observeOverload(callback, options = {}) {
1071
1023
  }
1072
1024
  };
1073
1025
  }
1074
- /**
1075
- * Returns the components that are provided within an evaluation context.
1076
- * @param {any} context - The evaluation context to get the components from.
1077
- * @param {boolean} excludeNested - Exclude nested components.
1078
- * @param {Array<string>} excludedTypes - The types of components to exclude.
1079
- * @returns {Array} - The components within the evaluation context.
1080
- */
1081
1026
  export function getContextComponents(context, excludeNested, excludedTypes = []) {
1082
1027
  const values = [];
1083
1028
  context.utils.eachComponent(context.instance.options.editForm.components, (component, path) => {
@@ -1091,11 +1036,6 @@ export function getContextComponents(context, excludeNested, excludedTypes = [])
1091
1036
  });
1092
1037
  return values;
1093
1038
  }
1094
- /**
1095
- * Returns the button components that are within an evaluation context.
1096
- * @param {any} context - The evaluation context to get the components from.
1097
- * @returns {Array} - The button components within the evaluation context.
1098
- */
1099
1039
  export function getContextButtons(context) {
1100
1040
  const values = [];
1101
1041
  context.utils.eachComponent(context.instance.options.editForm.components, (component) => {
@@ -1112,9 +1052,12 @@ export function getContextButtons(context) {
1112
1052
  const inTextTags = ['#text', 'A', 'B', 'EM', 'I', 'SMALL', 'STRONG', 'SUB', 'SUP', 'INS', 'DEL', 'MARK', 'CODE'];
1113
1053
  /**
1114
1054
  * Helper function for 'translateHTMLTemplate'. Translates text value of the passed html element.
1115
- * @param {HTMLElement} elem - The element to translate.
1116
- * @param {Function} translate - The translation function.
1117
- * @returns {string} - Translated element template.
1055
+ *
1056
+ * @param {HTMLElement} elem
1057
+ * @param {Function} translate
1058
+ *
1059
+ * @returns {String}
1060
+ * Translated element template.
1118
1061
  */
1119
1062
  function translateElemValue(elem, translate) {
1120
1063
  if (!elem.innerText) {
@@ -1145,8 +1088,10 @@ function translateElemValue(elem, translate) {
1145
1088
  }
1146
1089
  /**
1147
1090
  * Helper function for 'translateHTMLTemplate'. Goes deep through html tag children and calls function to translate their text values.
1148
- * @param {HTMLElement} tag - The tag to translate.
1149
- * @param {Function} translate - The translation function.
1091
+ *
1092
+ * @param {HTMLElement} tag
1093
+ * @param {Function} translate
1094
+ *
1150
1095
  * @returns {void}
1151
1096
  */
1152
1097
  function translateDeepTag(tag, translate) {
@@ -1162,9 +1107,12 @@ function translateDeepTag(tag, translate) {
1162
1107
  }
1163
1108
  /**
1164
1109
  * Translates text values in html template.
1165
- * @param {string} template - The template to translate.
1166
- * @param {Function} translate - The translation function.
1167
- * @returns {string} - Html template with translated values.
1110
+ *
1111
+ * @param {String} template
1112
+ * @param {Function} translate
1113
+ *
1114
+ * @returns {String}
1115
+ * Html template with translated values.
1168
1116
  */
1169
1117
  export function translateHTMLTemplate(template, translate) {
1170
1118
  const isHTML = /<[^>]*>/.test(template);
@@ -1181,9 +1129,9 @@ export function translateHTMLTemplate(template, translate) {
1181
1129
  }
1182
1130
  /**
1183
1131
  * Sanitize an html string.
1184
- * @param {string} string - The string to sanitize.
1185
- * @param {any} options - The options to use for sanitization.
1186
- * @returns {string} - The sanitized html string.
1132
+ *
1133
+ * @param string
1134
+ * @returns {*}
1187
1135
  */
1188
1136
  export function sanitize(string, options) {
1189
1137
  if (typeof dompurify.sanitize !== 'function') {
@@ -1231,18 +1179,11 @@ export function sanitize(string, options) {
1231
1179
  }
1232
1180
  /**
1233
1181
  * Fast cloneDeep for JSON objects only.
1234
- * @param {any} obj - The object to perform a fast clone deep against.
1235
- * @returns {any} - The cloned object.
1236
1182
  */
1237
1183
  export function fastCloneDeep(obj) {
1238
1184
  return obj ? JSON.parse(JSON.stringify(obj)) : obj;
1239
1185
  }
1240
1186
  export { Evaluator, interpolate };
1241
- /**
1242
- * Returns if the component is an input component.
1243
- * @param {import('@formio/core').Component} componentJson - The JSON of a component.
1244
- * @returns {bool} - TRUE if the component is an input component; FALSE otherwise.
1245
- */
1246
1187
  export function isInputComponent(componentJson) {
1247
1188
  if (componentJson.input === false || componentJson.input === true) {
1248
1189
  return componentJson.input;
@@ -1262,11 +1203,6 @@ export function isInputComponent(componentJson) {
1262
1203
  return true;
1263
1204
  }
1264
1205
  }
1265
- /**
1266
- * Takes a component path, and returns a component path array.
1267
- * @param {string} pathStr - The path string to convert to an array.
1268
- * @returns {Arryay<number>} - The array of paths.
1269
- */
1270
1206
  export function getArrayFromComponentPath(pathStr) {
1271
1207
  if (!pathStr || !_.isString(pathStr)) {
1272
1208
  if (!_.isArray(pathStr)) {
@@ -1280,12 +1216,6 @@ export function getArrayFromComponentPath(pathStr) {
1280
1216
  .split('.')
1281
1217
  .map(part => _.defaultTo(_.toNumber(part), part));
1282
1218
  }
1283
- /**
1284
- * Returns true if the component is a child of the parent.
1285
- * @param {any} child - The child component to check.
1286
- * @param {any} parent - The parent component to check.
1287
- * @returns {boolean} - TRUE if the child is a child of the parent; FALSE otherwise.
1288
- */
1289
1219
  export function isChildOf(child, parent) {
1290
1220
  while (child && child.parent) {
1291
1221
  if (child.parent === parent) {
@@ -1295,11 +1225,6 @@ export function isChildOf(child, parent) {
1295
1225
  }
1296
1226
  return false;
1297
1227
  }
1298
- /**
1299
- * Takes an array of component path indexes, and returns a string version of that array.
1300
- * @param {Array<number>} path - The path array to convert to a string.
1301
- * @returns {string} - The string version of the path.
1302
- */
1303
1228
  export function getStringFromComponentPath(path) {
1304
1229
  if (!_.isArray(path)) {
1305
1230
  return path;
@@ -1315,21 +1240,16 @@ export function getStringFromComponentPath(path) {
1315
1240
  });
1316
1241
  return strPath;
1317
1242
  }
1318
- /**
1319
- * Takes a number and rounds it to the provided precision amount.
1320
- * @param {number} number - The number to round.
1321
- * @param {number} precision - The precision to round the number to.
1322
- * @returns {string} - The rounded number.
1323
- */
1324
1243
  export function round(number, precision) {
1325
1244
  if (_.isNumber(number)) {
1326
1245
  return number.toFixed(precision);
1327
1246
  }
1328
- return number.toString();
1247
+ return number;
1329
1248
  }
1330
1249
  /**
1331
1250
  * Check for Internet Explorer browser version
1332
- * @returns {(number|null)} - The IE browser version or null if not IE
1251
+ *
1252
+ * @return {(number|null)}
1333
1253
  */
1334
1254
  export function getIEBrowserVersion() {
1335
1255
  const { ie, version } = getBrowserInfo();
@@ -1337,7 +1257,8 @@ export function getIEBrowserVersion() {
1337
1257
  }
1338
1258
  /**
1339
1259
  * Get browser name and version (modified from 'jquery-browser-plugin')
1340
- * @returns {object} -- {{browser name, version, isWebkit?}}
1260
+ *
1261
+ * @return {Object} -- {{browser name, version, isWebkit?}}
1341
1262
  * Possible browser names: chrome, safari, ie, edge, opera, mozilla, yabrowser
1342
1263
  */
1343
1264
  export function getBrowserInfo() {
@@ -1385,19 +1306,12 @@ export function getBrowserInfo() {
1385
1306
  }
1386
1307
  return browser;
1387
1308
  }
1388
- /**
1389
- * Takes a component path, which may include array indicies (i.e. [0][1]), and returns the compoennt path without the indicies.
1390
- * @param {string} path - The path to remove the indicies from.
1391
- * @returns {string} - The path without the indicies.
1392
- */
1393
1309
  export function getComponentPathWithoutIndicies(path = '') {
1394
1310
  return path.replace(/\[\d+\]/, '');
1395
1311
  }
1396
1312
  /**
1397
1313
  * Returns a path to the component which based on its schema
1398
- * @param {import('@formio/core').Component} component - Component containing link to its parent's schema in the 'parent' property
1399
- * @param {string} path - Path to the component
1400
- * @returns {string} - Path to the component
1314
+ * @param {*} component is a component's schema containing link to its parent's schema in the 'parent' property
1401
1315
  */
1402
1316
  export function getComponentPath(component, path = '') {
1403
1317
  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
@@ -1408,8 +1322,8 @@ export function getComponentPath(component, path = '') {
1408
1322
  }
1409
1323
  /**
1410
1324
  * Returns a parent component of the passed component instance skipping all the Layout components
1411
- * @param {Component} componentInstance - The component to check for the parent.
1412
- * @returns {Component|undefined} - The parent data component.
1325
+ * @param {*} componentInstance
1326
+ * @return {(Component|undefined)}
1413
1327
  */
1414
1328
  export function getDataParentComponent(componentInstance) {
1415
1329
  if (!componentInstance) {
@@ -1425,8 +1339,8 @@ export function getDataParentComponent(componentInstance) {
1425
1339
  }
1426
1340
  /**
1427
1341
  * Returns whether the value is a promise
1428
- * @param {any} value - The value to check
1429
- * @returns {boolean} - TRUE if the value is a promise; FALSE otherwise
1342
+ * @param value
1343
+ * @return {boolean}
1430
1344
  */
1431
1345
  export function isPromise(value) {
1432
1346
  return value
@@ -1437,9 +1351,9 @@ export function isPromise(value) {
1437
1351
  /**
1438
1352
  * Determines if the component has a scoping parent in tree (a component which scopes its children and manages its
1439
1353
  * changes by itself, e.g. EditGrid)
1440
- * @param {Component} componentInstance - The component to check for the scoping parent.
1441
- * @param {boolean} firstPass - Whether it is the first pass of the function
1442
- * @returns {boolean|*} - TRUE if the component has a scoping parent; FALSE otherwise
1354
+ * @param componentInstance
1355
+ * @param firstPass
1356
+ * @returns {boolean|boolean|*}
1443
1357
  */
1444
1358
  export function isInsideScopingComponent(componentInstance, firstPass = true) {
1445
1359
  if (!firstPass && componentInstance?.hasScopedChildren) {
@@ -1454,11 +1368,6 @@ export function isInsideScopingComponent(componentInstance, firstPass = true) {
1454
1368
  }
1455
1369
  return false;
1456
1370
  }
1457
- /**
1458
- * Returns all the focusable elements within the provided dom element.
1459
- * @param {HTMLElement} element - The element to get the focusable elements from.
1460
- * @returns {NodeList<HTMLElement>} - The focusable elements within the provided element.
1461
- */
1462
1371
  export function getFocusableElements(element) {
1463
1372
  const focusableSelector = `button:not([disabled]), input:not([disabled]), select:not([disabled]),
1464
1373
  textarea:not([disabled]), button:not([disabled]), [href]`;
@@ -1475,11 +1384,6 @@ export const componentValueTypes = {
1475
1384
  date: 'date',
1476
1385
  any: 'any',
1477
1386
  };
1478
- /**
1479
- * Returns the saved types for the component
1480
- * @param {import('@formio/core').Component} fullSchema - The component schema
1481
- * @returns {Array<string>|null} - The saved types for the component
1482
- */
1483
1387
  export function getComponentSavedTypes(fullSchema) {
1484
1388
  const schema = fullSchema || {};
1485
1389
  if (schema.persistent !== true) {
@@ -1492,10 +1396,9 @@ export function getComponentSavedTypes(fullSchema) {
1492
1396
  }
1493
1397
  /**
1494
1398
  * Interpolates @formio/core errors so that they are compatible with the renderer
1495
- * @param {Component} component - The component to interpolate the errors for
1496
- * @param {FieldError[]} errors - The errors to interpolate
1497
- * @param {Function} interpolateFn - The interpolation function
1498
- * @returns {[]} - The interpolated errors
1399
+ * @param {FieldError[]} errors
1400
+ * @param firstPass
1401
+ * @returns {[]}
1499
1402
  */
1500
1403
  export const interpolateErrors = (component, errors, interpolateFn) => {
1501
1404
  return errors.map((error) => {
@@ -1505,11 +1408,6 @@ export const interpolateErrors = (component, errors, interpolateFn) => {
1505
1408
  return { ...error, message: unescapeHTML(interpolateFn(toInterpolate, context)), context: { ...context } };
1506
1409
  });
1507
1410
  };
1508
- /**
1509
- * Returns the template keys inside the template code.
1510
- * @param {string} template - The template to get the keys from.
1511
- * @returns {Array<string>} - The keys inside the template.
1512
- */
1513
1411
  export function getItemTemplateKeys(template) {
1514
1412
  const templateKeys = [];
1515
1413
  if (!template) {
@@ -1526,11 +1424,6 @@ export function getItemTemplateKeys(template) {
1526
1424
  }
1527
1425
  return templateKeys;
1528
1426
  }
1529
- /**
1530
- * Returns if the component is a select resource with an object for its value.
1531
- * @param {import('@formio/core').Component} comp - The component to check.
1532
- * @returns {boolean} - TRUE if the component is a select resource with an object for its value; FALSE otherwise.
1533
- */
1534
1427
  export function isSelectResourceWithObjectValue(comp = {}) {
1535
1428
  const { reference, dataSrc, valueProperty } = comp;
1536
1429
  return reference || (dataSrc === 'resource' && (!valueProperty || valueProperty === 'data'));