@formio/js 5.0.0-dev.5639.43f7313 → 5.0.0-dev.5641.d9ab3df

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 (459) hide show
  1. package/Changelog.md +45 -0
  2. package/dist/formio.builder.css +0 -4
  3. package/dist/formio.builder.min.css +1 -1
  4. package/dist/formio.embed.js +1 -1
  5. package/dist/formio.embed.min.js +1 -1
  6. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  7. package/dist/formio.form.css +0 -4
  8. package/dist/formio.form.js +607 -1188
  9. package/dist/formio.form.min.css +1 -1
  10. package/dist/formio.form.min.js +1 -1
  11. package/dist/formio.form.min.js.LICENSE.txt +3 -5
  12. package/dist/formio.full.css +0 -4
  13. package/dist/formio.full.js +651 -912
  14. package/dist/formio.full.min.css +1 -1
  15. package/dist/formio.full.min.js +1 -1
  16. package/dist/formio.full.min.js.LICENSE.txt +3 -5
  17. package/dist/formio.js +18 -18
  18. package/dist/formio.min.js +1 -1
  19. package/dist/formio.min.js.LICENSE.txt +1 -1
  20. package/dist/formio.utils.js +1829 -492
  21. package/dist/formio.utils.min.js +1 -1
  22. package/dist/formio.utils.min.js.LICENSE.txt +10 -4
  23. package/embed.d.ts +1 -0
  24. package/form.d.ts +1 -0
  25. package/lib/cjs/CDN.d.ts +1 -0
  26. package/lib/cjs/CDN.js +6 -3
  27. package/lib/cjs/Element.d.ts +86 -96
  28. package/lib/cjs/Element.js +68 -78
  29. package/lib/cjs/Embed.d.ts +1 -1
  30. package/lib/cjs/Embed.js +52 -12
  31. package/lib/cjs/Form.d.ts +365 -36
  32. package/lib/cjs/Form.js +50 -64
  33. package/lib/cjs/FormBuilder.d.ts +187 -2
  34. package/lib/cjs/FormBuilder.js +30 -8
  35. package/lib/cjs/InlineEmbed.d.ts +7 -0
  36. package/lib/cjs/InlineEmbed.js +116 -0
  37. package/lib/cjs/PDF.d.ts +11 -13
  38. package/lib/cjs/PDF.js +6 -8
  39. package/lib/cjs/Webform.d.ts +180 -139
  40. package/lib/cjs/Webform.js +309 -296
  41. package/lib/cjs/WebformBuilder.d.ts +16 -14
  42. package/lib/cjs/WebformBuilder.js +19 -12
  43. package/lib/cjs/Wizard.d.ts +31 -21
  44. package/lib/cjs/Wizard.js +43 -20
  45. package/lib/cjs/WizardBuilder.d.ts +1 -1
  46. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -5
  47. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -3
  48. package/lib/cjs/components/Components.d.ts +4 -4
  49. package/lib/cjs/components/Components.js +3 -3
  50. package/lib/cjs/components/_classes/component/Component.d.ts +502 -269
  51. package/lib/cjs/components/_classes/component/Component.form.d.ts +6 -3
  52. package/lib/cjs/components/_classes/component/Component.form.js +5 -0
  53. package/lib/cjs/components/_classes/component/Component.js +434 -193
  54. package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +0 -8
  55. package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +2 -2
  56. package/lib/cjs/components/_classes/component/editForm/utils.js +2 -2
  57. package/lib/cjs/components/_classes/field/Field.d.ts +11 -2
  58. package/lib/cjs/components/_classes/field/Field.js +13 -1
  59. package/lib/cjs/components/_classes/input/Input.d.ts +4 -3
  60. package/lib/cjs/components/_classes/input/Input.js +2 -2
  61. package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
  62. package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +6 -3
  63. package/lib/cjs/components/_classes/list/ListComponent.form.js +5 -0
  64. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +43 -12
  65. package/lib/cjs/components/_classes/multivalue/Multivalue.js +37 -3
  66. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +163 -67
  67. package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +6 -3
  68. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +5 -0
  69. package/lib/cjs/components/_classes/nested/NestedComponent.js +175 -54
  70. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
  71. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  72. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +7 -1
  73. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +2 -3
  74. package/lib/cjs/components/address/Address.d.ts +4 -2
  75. package/lib/cjs/components/address/Address.form.d.ts +6 -3
  76. package/lib/cjs/components/address/Address.form.js +5 -0
  77. package/lib/cjs/components/button/Button.d.ts +3 -12
  78. package/lib/cjs/components/button/Button.form.d.ts +6 -3
  79. package/lib/cjs/components/button/Button.form.js +5 -0
  80. package/lib/cjs/components/button/Button.js +5 -0
  81. package/lib/cjs/components/checkbox/Checkbox.d.ts +4 -27
  82. package/lib/cjs/components/checkbox/Checkbox.form.d.ts +6 -3
  83. package/lib/cjs/components/checkbox/Checkbox.form.js +5 -0
  84. package/lib/cjs/components/columns/Columns.d.ts +3 -2
  85. package/lib/cjs/components/columns/Columns.form.d.ts +6 -3
  86. package/lib/cjs/components/columns/Columns.form.js +5 -0
  87. package/lib/cjs/components/columns/Columns.js +1 -1
  88. package/lib/cjs/components/container/Container.form.d.ts +6 -3
  89. package/lib/cjs/components/container/Container.form.js +5 -0
  90. package/lib/cjs/components/content/Content.d.ts +2 -1
  91. package/lib/cjs/components/content/Content.form.d.ts +6 -3
  92. package/lib/cjs/components/content/Content.form.js +5 -0
  93. package/lib/cjs/components/currency/Currency.form.d.ts +6 -3
  94. package/lib/cjs/components/currency/Currency.form.js +5 -0
  95. package/lib/cjs/components/currency/Currency.js +1 -2
  96. package/lib/cjs/components/datagrid/DataGrid.d.ts +8 -7
  97. package/lib/cjs/components/datagrid/DataGrid.form.d.ts +6 -3
  98. package/lib/cjs/components/datagrid/DataGrid.form.js +5 -0
  99. package/lib/cjs/components/datagrid/DataGrid.js +5 -5
  100. package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
  101. package/lib/cjs/components/datamap/DataMap.form.d.ts +6 -3
  102. package/lib/cjs/components/datamap/DataMap.form.js +5 -0
  103. package/lib/cjs/components/datetime/DateTime.d.ts +0 -14
  104. package/lib/cjs/components/datetime/DateTime.form.d.ts +6 -3
  105. package/lib/cjs/components/datetime/DateTime.form.js +5 -0
  106. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
  107. package/lib/cjs/components/day/Day.d.ts +22 -48
  108. package/lib/cjs/components/day/Day.form.d.ts +6 -3
  109. package/lib/cjs/components/day/Day.form.js +5 -0
  110. package/lib/cjs/components/day/Day.js +15 -20
  111. package/lib/cjs/components/editgrid/EditGrid.d.ts +7 -3
  112. package/lib/cjs/components/editgrid/EditGrid.form.d.ts +6 -3
  113. package/lib/cjs/components/editgrid/EditGrid.form.js +5 -0
  114. package/lib/cjs/components/editgrid/EditGrid.js +3 -3
  115. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +2 -5
  116. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +6 -9
  117. package/lib/cjs/components/email/Email.form.d.ts +6 -3
  118. package/lib/cjs/components/email/Email.form.js +5 -0
  119. package/lib/cjs/components/fieldset/Fieldset.form.d.ts +6 -3
  120. package/lib/cjs/components/fieldset/Fieldset.form.js +5 -0
  121. package/lib/cjs/components/file/File.d.ts +9 -22
  122. package/lib/cjs/components/file/File.form.d.ts +6 -3
  123. package/lib/cjs/components/file/File.form.js +5 -0
  124. package/lib/cjs/components/form/Form.d.ts +31 -20
  125. package/lib/cjs/components/form/Form.form.d.ts +6 -3
  126. package/lib/cjs/components/form/Form.form.js +5 -0
  127. package/lib/cjs/components/form/Form.js +13 -10
  128. package/lib/cjs/components/hidden/Hidden.d.ts +1 -11
  129. package/lib/cjs/components/hidden/Hidden.form.d.ts +6 -3
  130. package/lib/cjs/components/hidden/Hidden.form.js +5 -0
  131. package/lib/cjs/components/hidden/Hidden.js +1 -2
  132. package/lib/cjs/components/html/HTML.d.ts +2 -1
  133. package/lib/cjs/components/html/HTML.form.d.ts +6 -3
  134. package/lib/cjs/components/html/HTML.form.js +5 -0
  135. package/lib/cjs/components/number/Number.d.ts +3 -17
  136. package/lib/cjs/components/number/Number.form.d.ts +6 -3
  137. package/lib/cjs/components/number/Number.form.js +5 -0
  138. package/lib/cjs/components/number/Number.js +1 -2
  139. package/lib/cjs/components/panel/Panel.form.d.ts +6 -3
  140. package/lib/cjs/components/panel/Panel.form.js +5 -0
  141. package/lib/cjs/components/panel/Panel.js +0 -1
  142. package/lib/cjs/components/password/Password.form.d.ts +6 -3
  143. package/lib/cjs/components/password/Password.form.js +5 -0
  144. package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +6 -3
  145. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +5 -0
  146. package/lib/cjs/components/radio/Radio.d.ts +3 -26
  147. package/lib/cjs/components/radio/Radio.form.d.ts +6 -3
  148. package/lib/cjs/components/radio/Radio.form.js +5 -0
  149. package/lib/cjs/components/radio/Radio.js +3 -4
  150. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  151. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
  152. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +5 -0
  153. package/lib/cjs/components/select/Select.d.ts +16 -39
  154. package/lib/cjs/components/select/Select.form.d.ts +6 -3
  155. package/lib/cjs/components/select/Select.form.js +5 -0
  156. package/lib/cjs/components/select/Select.js +14 -17
  157. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +2 -17
  158. package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +6 -3
  159. package/lib/cjs/components/selectboxes/SelectBoxes.form.js +5 -0
  160. package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -9
  161. package/lib/cjs/components/signature/Signature.d.ts +1 -14
  162. package/lib/cjs/components/signature/Signature.form.d.ts +6 -3
  163. package/lib/cjs/components/signature/Signature.form.js +5 -0
  164. package/lib/cjs/components/survey/Survey.d.ts +3 -15
  165. package/lib/cjs/components/survey/Survey.form.d.ts +6 -3
  166. package/lib/cjs/components/survey/Survey.form.js +5 -0
  167. package/lib/cjs/components/table/Table.d.ts +2 -1
  168. package/lib/cjs/components/table/Table.form.d.ts +6 -3
  169. package/lib/cjs/components/table/Table.form.js +5 -0
  170. package/lib/cjs/components/tabs/Tabs.d.ts +4 -4
  171. package/lib/cjs/components/tabs/Tabs.form.d.ts +6 -3
  172. package/lib/cjs/components/tabs/Tabs.form.js +5 -0
  173. package/lib/cjs/components/tabs/Tabs.js +1 -2
  174. package/lib/cjs/components/tags/Tags.d.ts +0 -14
  175. package/lib/cjs/components/tags/Tags.form.d.ts +6 -3
  176. package/lib/cjs/components/tags/Tags.form.js +5 -0
  177. package/lib/cjs/components/textarea/TextArea.d.ts +4 -9
  178. package/lib/cjs/components/textarea/TextArea.form.d.ts +6 -3
  179. package/lib/cjs/components/textarea/TextArea.form.js +5 -0
  180. package/lib/cjs/components/textarea/TextArea.js +2 -2
  181. package/lib/cjs/components/textfield/TextField.d.ts +14 -30
  182. package/lib/cjs/components/textfield/TextField.form.d.ts +6 -3
  183. package/lib/cjs/components/textfield/TextField.form.js +5 -0
  184. package/lib/cjs/components/textfield/TextField.js +16 -17
  185. package/lib/cjs/components/time/Time.form.d.ts +6 -3
  186. package/lib/cjs/components/time/Time.form.js +5 -0
  187. package/lib/cjs/components/unknown/Unknown.form.d.ts +5 -34
  188. package/lib/cjs/components/unknown/Unknown.form.js +4 -0
  189. package/lib/cjs/components/url/Url.form.d.ts +6 -3
  190. package/lib/cjs/components/url/Url.form.js +5 -0
  191. package/lib/cjs/components/well/Well.form.d.ts +6 -3
  192. package/lib/cjs/components/well/Well.form.js +5 -0
  193. package/lib/cjs/formio.embed.d.ts +1 -2
  194. package/lib/cjs/formio.embed.js +2 -100
  195. package/lib/cjs/formio.form.d.ts +11 -4
  196. package/lib/cjs/formio.form.js +13 -5
  197. package/lib/cjs/providers/Providers.d.ts +36 -5
  198. package/lib/cjs/providers/Providers.js +29 -0
  199. package/lib/cjs/providers/address/AddressProvider.d.ts +131 -12
  200. package/lib/cjs/providers/address/AddressProvider.js +88 -2
  201. package/lib/cjs/providers/address/AzureAddressProvider.d.ts +48 -1
  202. package/lib/cjs/providers/address/AzureAddressProvider.js +37 -0
  203. package/lib/cjs/providers/address/CustomAddressProvider.d.ts +27 -4
  204. package/lib/cjs/providers/address/CustomAddressProvider.js +34 -0
  205. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +130 -6
  206. package/lib/cjs/providers/address/GoogleAddressProvider.js +72 -0
  207. package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +32 -7
  208. package/lib/cjs/providers/address/NominatimAddressProvider.js +33 -0
  209. package/lib/cjs/providers/address/index.d.ts +3 -1
  210. package/lib/cjs/providers/processor/fileProcessor.d.ts +7 -1
  211. package/lib/cjs/providers/processor/fileProcessor.js +6 -0
  212. package/lib/cjs/providers/storage/azure.d.ts +6 -13
  213. package/lib/cjs/providers/storage/azure.js +5 -0
  214. package/lib/cjs/providers/storage/base64.d.ts +5 -6
  215. package/lib/cjs/providers/storage/base64.js +4 -0
  216. package/lib/cjs/providers/storage/dropbox.d.ts +6 -4
  217. package/lib/cjs/providers/storage/dropbox.js +5 -0
  218. package/lib/cjs/providers/storage/googleDrive.d.ts +7 -5
  219. package/lib/cjs/providers/storage/googleDrive.js +6 -0
  220. package/lib/cjs/providers/storage/indexeddb.d.ts +5 -7
  221. package/lib/cjs/providers/storage/indexeddb.js +4 -0
  222. package/lib/cjs/providers/storage/s3.d.ts +6 -20
  223. package/lib/cjs/providers/storage/s3.js +5 -0
  224. package/lib/cjs/providers/storage/url.d.ts +6 -7
  225. package/lib/cjs/providers/storage/url.js +10 -0
  226. package/lib/cjs/providers/storage/util.d.ts +24 -1
  227. package/lib/cjs/providers/storage/util.js +18 -0
  228. package/lib/cjs/templates/Templates.d.ts +1 -0
  229. package/lib/cjs/utils/Evaluator.d.ts +6 -3
  230. package/lib/cjs/utils/Evaluator.js +11 -20
  231. package/lib/cjs/utils/builder.d.ts +9 -7
  232. package/lib/cjs/utils/builder.js +10 -5
  233. package/lib/cjs/utils/calendarUtils.d.ts +7 -13
  234. package/lib/cjs/utils/calendarUtils.js +10 -17
  235. package/lib/cjs/utils/formUtils.d.ts +43 -171
  236. package/lib/cjs/utils/formUtils.js +38 -569
  237. package/lib/cjs/utils/utils.d.ts +370 -218
  238. package/lib/cjs/utils/utils.js +348 -230
  239. package/lib/cjs/widgets/CalendarWidget.d.ts +9 -10
  240. package/lib/cjs/widgets/CalendarWidget.js +9 -11
  241. package/lib/mjs/CDN.d.ts +1 -0
  242. package/lib/mjs/CDN.js +6 -3
  243. package/lib/mjs/Element.d.ts +86 -96
  244. package/lib/mjs/Element.js +68 -78
  245. package/lib/mjs/Embed.d.ts +1 -1
  246. package/lib/mjs/Embed.js +52 -12
  247. package/lib/mjs/Form.d.ts +365 -36
  248. package/lib/mjs/Form.js +140 -57
  249. package/lib/mjs/FormBuilder.d.ts +187 -2
  250. package/lib/mjs/FormBuilder.js +32 -8
  251. package/lib/mjs/InlineEmbed.d.ts +7 -0
  252. package/lib/mjs/InlineEmbed.js +112 -0
  253. package/lib/mjs/PDF.d.ts +11 -13
  254. package/lib/mjs/PDF.js +6 -8
  255. package/lib/mjs/Webform.d.ts +180 -139
  256. package/lib/mjs/Webform.js +321 -308
  257. package/lib/mjs/WebformBuilder.d.ts +16 -14
  258. package/lib/mjs/WebformBuilder.js +19 -12
  259. package/lib/mjs/Wizard.d.ts +31 -21
  260. package/lib/mjs/Wizard.js +42 -19
  261. package/lib/mjs/WizardBuilder.d.ts +1 -1
  262. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -5
  263. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -3
  264. package/lib/mjs/components/Components.d.ts +4 -4
  265. package/lib/mjs/components/Components.js +3 -3
  266. package/lib/mjs/components/_classes/component/Component.d.ts +502 -269
  267. package/lib/mjs/components/_classes/component/Component.form.d.ts +6 -3
  268. package/lib/mjs/components/_classes/component/Component.form.js +5 -0
  269. package/lib/mjs/components/_classes/component/Component.js +434 -193
  270. package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +0 -8
  271. package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -1
  272. package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
  273. package/lib/mjs/components/_classes/field/Field.d.ts +11 -2
  274. package/lib/mjs/components/_classes/field/Field.js +13 -1
  275. package/lib/mjs/components/_classes/input/Input.d.ts +4 -3
  276. package/lib/mjs/components/_classes/input/Input.js +2 -2
  277. package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
  278. package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +6 -3
  279. package/lib/mjs/components/_classes/list/ListComponent.form.js +5 -0
  280. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +43 -12
  281. package/lib/mjs/components/_classes/multivalue/Multivalue.js +37 -3
  282. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +163 -67
  283. package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +6 -3
  284. package/lib/mjs/components/_classes/nested/NestedComponent.form.js +5 -0
  285. package/lib/mjs/components/_classes/nested/NestedComponent.js +175 -54
  286. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
  287. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  288. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +7 -1
  289. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +2 -3
  290. package/lib/mjs/components/address/Address.d.ts +4 -2
  291. package/lib/mjs/components/address/Address.form.d.ts +6 -3
  292. package/lib/mjs/components/address/Address.form.js +5 -0
  293. package/lib/mjs/components/button/Button.d.ts +3 -12
  294. package/lib/mjs/components/button/Button.form.d.ts +6 -3
  295. package/lib/mjs/components/button/Button.form.js +5 -0
  296. package/lib/mjs/components/button/Button.js +5 -0
  297. package/lib/mjs/components/checkbox/Checkbox.d.ts +4 -27
  298. package/lib/mjs/components/checkbox/Checkbox.form.d.ts +6 -3
  299. package/lib/mjs/components/checkbox/Checkbox.form.js +5 -0
  300. package/lib/mjs/components/columns/Columns.d.ts +3 -2
  301. package/lib/mjs/components/columns/Columns.form.d.ts +6 -3
  302. package/lib/mjs/components/columns/Columns.form.js +5 -0
  303. package/lib/mjs/components/columns/Columns.js +1 -1
  304. package/lib/mjs/components/container/Container.form.d.ts +6 -3
  305. package/lib/mjs/components/container/Container.form.js +5 -0
  306. package/lib/mjs/components/content/Content.d.ts +2 -1
  307. package/lib/mjs/components/content/Content.form.d.ts +6 -3
  308. package/lib/mjs/components/content/Content.form.js +5 -0
  309. package/lib/mjs/components/currency/Currency.form.d.ts +6 -3
  310. package/lib/mjs/components/currency/Currency.form.js +5 -0
  311. package/lib/mjs/components/currency/Currency.js +1 -2
  312. package/lib/mjs/components/datagrid/DataGrid.d.ts +8 -7
  313. package/lib/mjs/components/datagrid/DataGrid.form.d.ts +6 -3
  314. package/lib/mjs/components/datagrid/DataGrid.form.js +5 -0
  315. package/lib/mjs/components/datagrid/DataGrid.js +5 -5
  316. package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
  317. package/lib/mjs/components/datamap/DataMap.form.d.ts +6 -3
  318. package/lib/mjs/components/datamap/DataMap.form.js +5 -0
  319. package/lib/mjs/components/datetime/DateTime.d.ts +0 -14
  320. package/lib/mjs/components/datetime/DateTime.form.d.ts +6 -3
  321. package/lib/mjs/components/datetime/DateTime.form.js +5 -0
  322. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
  323. package/lib/mjs/components/day/Day.d.ts +22 -48
  324. package/lib/mjs/components/day/Day.form.d.ts +6 -3
  325. package/lib/mjs/components/day/Day.form.js +5 -0
  326. package/lib/mjs/components/day/Day.js +15 -20
  327. package/lib/mjs/components/editgrid/EditGrid.d.ts +7 -3
  328. package/lib/mjs/components/editgrid/EditGrid.form.d.ts +6 -3
  329. package/lib/mjs/components/editgrid/EditGrid.form.js +5 -0
  330. package/lib/mjs/components/editgrid/EditGrid.js +3 -3
  331. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  332. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +1 -1
  333. package/lib/mjs/components/email/Email.form.d.ts +6 -3
  334. package/lib/mjs/components/email/Email.form.js +5 -0
  335. package/lib/mjs/components/fieldset/Fieldset.form.d.ts +6 -3
  336. package/lib/mjs/components/fieldset/Fieldset.form.js +5 -0
  337. package/lib/mjs/components/file/File.d.ts +9 -22
  338. package/lib/mjs/components/file/File.form.d.ts +6 -3
  339. package/lib/mjs/components/file/File.form.js +5 -0
  340. package/lib/mjs/components/form/Form.d.ts +31 -20
  341. package/lib/mjs/components/form/Form.form.d.ts +6 -3
  342. package/lib/mjs/components/form/Form.form.js +5 -0
  343. package/lib/mjs/components/form/Form.js +13 -10
  344. package/lib/mjs/components/hidden/Hidden.d.ts +1 -11
  345. package/lib/mjs/components/hidden/Hidden.form.d.ts +6 -3
  346. package/lib/mjs/components/hidden/Hidden.form.js +5 -0
  347. package/lib/mjs/components/hidden/Hidden.js +1 -2
  348. package/lib/mjs/components/html/HTML.d.ts +2 -1
  349. package/lib/mjs/components/html/HTML.form.d.ts +6 -3
  350. package/lib/mjs/components/html/HTML.form.js +5 -0
  351. package/lib/mjs/components/number/Number.d.ts +3 -17
  352. package/lib/mjs/components/number/Number.form.d.ts +6 -3
  353. package/lib/mjs/components/number/Number.form.js +5 -0
  354. package/lib/mjs/components/number/Number.js +1 -2
  355. package/lib/mjs/components/panel/Panel.form.d.ts +6 -3
  356. package/lib/mjs/components/panel/Panel.form.js +5 -0
  357. package/lib/mjs/components/panel/Panel.js +0 -1
  358. package/lib/mjs/components/password/Password.form.d.ts +6 -3
  359. package/lib/mjs/components/password/Password.form.js +5 -0
  360. package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +6 -3
  361. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +5 -0
  362. package/lib/mjs/components/radio/Radio.d.ts +3 -26
  363. package/lib/mjs/components/radio/Radio.form.d.ts +6 -3
  364. package/lib/mjs/components/radio/Radio.form.js +5 -0
  365. package/lib/mjs/components/radio/Radio.js +3 -4
  366. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  367. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
  368. package/lib/mjs/components/recaptcha/ReCaptcha.form.js +5 -0
  369. package/lib/mjs/components/select/Select.d.ts +16 -39
  370. package/lib/mjs/components/select/Select.form.d.ts +6 -3
  371. package/lib/mjs/components/select/Select.form.js +5 -0
  372. package/lib/mjs/components/select/Select.js +15 -18
  373. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +2 -17
  374. package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +6 -3
  375. package/lib/mjs/components/selectboxes/SelectBoxes.form.js +5 -0
  376. package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -9
  377. package/lib/mjs/components/signature/Signature.d.ts +1 -14
  378. package/lib/mjs/components/signature/Signature.form.d.ts +6 -3
  379. package/lib/mjs/components/signature/Signature.form.js +5 -0
  380. package/lib/mjs/components/survey/Survey.d.ts +3 -15
  381. package/lib/mjs/components/survey/Survey.form.d.ts +6 -3
  382. package/lib/mjs/components/survey/Survey.form.js +5 -0
  383. package/lib/mjs/components/table/Table.d.ts +2 -1
  384. package/lib/mjs/components/table/Table.form.d.ts +6 -3
  385. package/lib/mjs/components/table/Table.form.js +5 -0
  386. package/lib/mjs/components/tabs/Tabs.d.ts +4 -4
  387. package/lib/mjs/components/tabs/Tabs.form.d.ts +6 -3
  388. package/lib/mjs/components/tabs/Tabs.form.js +5 -0
  389. package/lib/mjs/components/tabs/Tabs.js +1 -2
  390. package/lib/mjs/components/tags/Tags.d.ts +0 -14
  391. package/lib/mjs/components/tags/Tags.form.d.ts +6 -3
  392. package/lib/mjs/components/tags/Tags.form.js +5 -0
  393. package/lib/mjs/components/textarea/TextArea.d.ts +4 -9
  394. package/lib/mjs/components/textarea/TextArea.form.d.ts +6 -3
  395. package/lib/mjs/components/textarea/TextArea.form.js +5 -0
  396. package/lib/mjs/components/textarea/TextArea.js +2 -2
  397. package/lib/mjs/components/textfield/TextField.d.ts +14 -30
  398. package/lib/mjs/components/textfield/TextField.form.d.ts +6 -3
  399. package/lib/mjs/components/textfield/TextField.form.js +5 -0
  400. package/lib/mjs/components/textfield/TextField.js +16 -17
  401. package/lib/mjs/components/time/Time.form.d.ts +6 -3
  402. package/lib/mjs/components/time/Time.form.js +5 -0
  403. package/lib/mjs/components/unknown/Unknown.form.d.ts +5 -34
  404. package/lib/mjs/components/unknown/Unknown.form.js +4 -0
  405. package/lib/mjs/components/url/Url.form.d.ts +6 -3
  406. package/lib/mjs/components/url/Url.form.js +5 -0
  407. package/lib/mjs/components/well/Well.form.d.ts +6 -3
  408. package/lib/mjs/components/well/Well.form.js +5 -0
  409. package/lib/mjs/formio.embed.d.ts +1 -2
  410. package/lib/mjs/formio.embed.js +2 -99
  411. package/lib/mjs/formio.form.d.ts +11 -4
  412. package/lib/mjs/formio.form.js +10 -3
  413. package/lib/mjs/providers/Providers.d.ts +36 -5
  414. package/lib/mjs/providers/Providers.js +29 -0
  415. package/lib/mjs/providers/address/AddressProvider.d.ts +131 -12
  416. package/lib/mjs/providers/address/AddressProvider.js +88 -2
  417. package/lib/mjs/providers/address/AzureAddressProvider.d.ts +48 -1
  418. package/lib/mjs/providers/address/AzureAddressProvider.js +37 -0
  419. package/lib/mjs/providers/address/CustomAddressProvider.d.ts +27 -4
  420. package/lib/mjs/providers/address/CustomAddressProvider.js +34 -0
  421. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +130 -6
  422. package/lib/mjs/providers/address/GoogleAddressProvider.js +72 -0
  423. package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +32 -7
  424. package/lib/mjs/providers/address/NominatimAddressProvider.js +33 -0
  425. package/lib/mjs/providers/address/index.d.ts +3 -1
  426. package/lib/mjs/providers/processor/fileProcessor.d.ts +7 -1
  427. package/lib/mjs/providers/processor/fileProcessor.js +6 -0
  428. package/lib/mjs/providers/storage/azure.d.ts +6 -13
  429. package/lib/mjs/providers/storage/azure.js +5 -0
  430. package/lib/mjs/providers/storage/base64.d.ts +5 -6
  431. package/lib/mjs/providers/storage/base64.js +4 -0
  432. package/lib/mjs/providers/storage/dropbox.d.ts +6 -4
  433. package/lib/mjs/providers/storage/dropbox.js +5 -0
  434. package/lib/mjs/providers/storage/googleDrive.d.ts +7 -5
  435. package/lib/mjs/providers/storage/googleDrive.js +6 -0
  436. package/lib/mjs/providers/storage/indexeddb.d.ts +5 -7
  437. package/lib/mjs/providers/storage/indexeddb.js +4 -0
  438. package/lib/mjs/providers/storage/s3.d.ts +6 -20
  439. package/lib/mjs/providers/storage/s3.js +5 -0
  440. package/lib/mjs/providers/storage/url.d.ts +6 -7
  441. package/lib/mjs/providers/storage/url.js +10 -0
  442. package/lib/mjs/providers/storage/util.d.ts +24 -1
  443. package/lib/mjs/providers/storage/util.js +18 -0
  444. package/lib/mjs/templates/Templates.d.ts +1 -0
  445. package/lib/mjs/utils/Evaluator.d.ts +6 -3
  446. package/lib/mjs/utils/Evaluator.js +9 -20
  447. package/lib/mjs/utils/builder.d.ts +9 -7
  448. package/lib/mjs/utils/builder.js +10 -5
  449. package/lib/mjs/utils/calendarUtils.d.ts +7 -13
  450. package/lib/mjs/utils/calendarUtils.js +10 -17
  451. package/lib/mjs/utils/formUtils.d.ts +43 -171
  452. package/lib/mjs/utils/formUtils.js +6 -554
  453. package/lib/mjs/utils/utils.d.ts +370 -218
  454. package/lib/mjs/utils/utils.js +339 -222
  455. package/lib/mjs/widgets/CalendarWidget.d.ts +9 -10
  456. package/lib/mjs/widgets/CalendarWidget.js +9 -11
  457. package/package.json +22 -22
  458. package/sdk.d.ts +1 -0
  459. package/utils.d.ts +1 -0
@@ -193,9 +193,7 @@ class Component extends Element_1.default {
193
193
  }
194
194
  /**
195
195
  * Return the simple condition settings as part of the component.
196
- *
197
- * @return {Object}
198
- *
196
+ * @returns {object} - The simple conditional settings.
199
197
  */
200
198
  static get conditionOperatorsSettings() {
201
199
  return {
@@ -212,10 +210,8 @@ class Component extends Element_1.default {
212
210
  }
213
211
  /**
214
212
  * Return the array of possible types of component value absed on its schema.
215
- *
216
213
  * @param schema
217
- * @return {Array}
218
- *
214
+ * @returns {Array}
219
215
  */
220
216
  static savedValueTypes(schema) {
221
217
  schema = schema || {};
@@ -224,7 +220,6 @@ class Component extends Element_1.default {
224
220
  /**
225
221
  * Provides a table view for this component. Override if you wish to do something different than using getView
226
222
  * method of your instance.
227
- *
228
223
  * @param value
229
224
  * @param options
230
225
  */
@@ -233,10 +228,9 @@ class Component extends Element_1.default {
233
228
  /* eslint-enable no-unused-vars */
234
229
  /**
235
230
  * Initialize a new Component.
236
- *
237
- * @param {Object} component - The component JSON you wish to initialize.
238
- * @param {Object} options - The options for this component.
239
- * @param {Object} data - The global data submission object this component will belong.
231
+ * @param {object} component - The component JSON you wish to initialize.
232
+ * @param {object} options - The options for this component.
233
+ * @param {object} data - The global data submission object this component will belong.
240
234
  */
241
235
  /* eslint-disable max-statements */
242
236
  constructor(component, options, data) {
@@ -267,7 +261,6 @@ class Component extends Element_1.default {
267
261
  }
268
262
  /**
269
263
  * The data path to this specific component instance.
270
- *
271
264
  * @type {string}
272
265
  */
273
266
  this.path = (component === null || component === void 0 ? void 0 : component.key) || '';
@@ -315,32 +308,27 @@ class Component extends Element_1.default {
315
308
  this.row = this.options.row;
316
309
  /**
317
310
  * Points to a flat map of child components (if applicable).
318
- *
319
- * @type {Object}
311
+ * @type {object}
320
312
  */
321
313
  this.childComponentsMap = {};
322
314
  /**
323
315
  * Determines if this component is disabled, or not.
324
- *
325
316
  * @type {boolean}
326
317
  */
327
318
  this._disabled = (0, utils_1.boolValue)(this.component.disabled) ? this.component.disabled : false;
328
319
  /**
329
320
  * Points to the root component, usually the FormComponent.
330
- *
331
321
  * @type {Component}
332
322
  */
333
323
  this.root = this.options.root || this;
334
324
  this.localRoot = this.options.localRoot || this;
335
325
  /**
336
326
  * If this input has been input and provided value.
337
- *
338
327
  * @type {boolean}
339
328
  */
340
329
  this.pristine = true;
341
330
  /**
342
331
  * Points to the parent component.
343
- *
344
332
  * @type {Component}
345
333
  */
346
334
  this.parent = this.options.parent;
@@ -360,7 +348,7 @@ class Component extends Element_1.default {
360
348
  this._referenceAttributeName = 'ref';
361
349
  /**
362
350
  * Used to trigger a new change in this component.
363
- * @type {function} - Call to trigger a change in this component.
351
+ * @type {Function} - Call to trigger a change in this component.
364
352
  */
365
353
  let changes = [];
366
354
  let lastChanged = null;
@@ -401,7 +389,6 @@ class Component extends Element_1.default {
401
389
  };
402
390
  /**
403
391
  * Used to trigger a redraw event within this component.
404
- *
405
392
  * @type {Function}
406
393
  */
407
394
  this.triggerRedraw = lodash_1.default.debounce(this.redraw.bind(this), 100);
@@ -603,8 +590,8 @@ class Component extends Element_1.default {
603
590
  return this.shouldForceVisibility(component, 'show');
604
591
  }
605
592
  /**
606
- *
607
- * @param value {boolean}
593
+ * Sets the component visibility.
594
+ * @param {boolean} value - Whether the component should be visible or not.
608
595
  */
609
596
  set visible(value) {
610
597
  if (this._visible !== value) {
@@ -622,8 +609,8 @@ class Component extends Element_1.default {
622
609
  }
623
610
  }
624
611
  /**
625
- *
626
- * @returns {boolean}
612
+ * Returns the component visibility
613
+ * @returns {boolean} - Whether the component is visible or not.
627
614
  */
628
615
  get visible() {
629
616
  // Show only if visibility changes or if we are in builder mode or if hidden fields should be shown.
@@ -713,9 +700,10 @@ class Component extends Element_1.default {
713
700
  }
714
701
  /**
715
702
  * Returns only the schema that is different from the default.
716
- *
717
- * @param schema
718
- * @param defaultSchema
703
+ * @param {object} schema - The "full" json schema for the component.
704
+ * @param {object} defaultSchema - The "default" json schema for the component.
705
+ * @param {boolean} recursion - If we are currently in a recursive loop.
706
+ * @returns {object} - The minified json schema for this component.
719
707
  */
720
708
  getModifiedSchema(schema, defaultSchema, recursion) {
721
709
  const modified = {};
@@ -749,21 +737,24 @@ class Component extends Element_1.default {
749
737
  }
750
738
  /**
751
739
  * Returns the JSON schema for this component.
740
+ * @returns {object} - The JSON schema for this component.
752
741
  */
753
742
  get schema() {
754
743
  return (0, utils_1.fastCloneDeep)(this.getModifiedSchema(lodash_1.default.omit(this.component, 'id'), this.defaultSchema));
755
744
  }
756
745
  /**
757
746
  * Returns true if component is inside DataGrid
747
+ * @returns {boolean} - True if component is inside DataGrid
758
748
  */
759
749
  get isInDataGrid() {
760
750
  return this.inDataGrid;
761
751
  }
762
752
  /**
763
753
  * Translate a text using the i18n system.
764
- *
765
754
  * @param {string} text - The i18n identifier.
766
- * @param {Object} params - The i18n parameters to use for translation.
755
+ * @param {object} params - The i18n parameters to use for translation.
756
+ * @param {...any} args - Additional arguments to pass to the translation library.
757
+ * @returns {string} - The translated text.
767
758
  */
768
759
  t(text, params = {}, ...args) {
769
760
  if (!text) {
@@ -853,7 +844,7 @@ class Component extends Element_1.default {
853
844
  isHtmlRenderMode() {
854
845
  return this.options.renderMode === 'html';
855
846
  }
856
- renderTemplate(name, data = {}, modeOption) {
847
+ renderTemplate(name, data = {}, modeOption = '') {
857
848
  // Need to make this fall back to form if renderMode is not found similar to how we search templates.
858
849
  const mode = modeOption || this.options.renderMode || 'form';
859
850
  data.component = this.component;
@@ -893,11 +884,12 @@ class Component extends Element_1.default {
893
884
  }
894
885
  /**
895
886
  * Sanitize an html string.
896
- *
897
- * @param string
898
- * @returns {*}
887
+ * @param {string} dirty - The dirty html string to sanitize.
888
+ * @param {boolean} forceSanitize - If we should force the sanitize to occur.
889
+ * @param {object} options - The options for the sanitize.
890
+ * @returns {*} - The sanitized html string.
899
891
  */
900
- sanitize(dirty, forceSanitize, options) {
892
+ sanitize(dirty, forceSanitize = false, options = {}) {
901
893
  var _a;
902
894
  if (!this.shouldSanitizeValue && !forceSanitize) {
903
895
  return dirty;
@@ -908,12 +900,9 @@ class Component extends Element_1.default {
908
900
  }
909
901
  /**
910
902
  * Render a template string into html.
911
- *
912
- * @param template
913
- * @param data
914
- * @param actions
915
- *
916
- * @return {HTMLElement|String} - The created element or an empty string if template is not specified.
903
+ * @param {string} template - The template to render.
904
+ * @param {object} data - The data to provide to the template.
905
+ * @returns {HTMLElement | string} - The created element or an empty string if template is not specified.
917
906
  */
918
907
  renderString(template, data) {
919
908
  if (!template) {
@@ -922,9 +911,18 @@ class Component extends Element_1.default {
922
911
  // Interpolate the template and populate
923
912
  return this.interpolate(template, data);
924
913
  }
914
+ /**
915
+ * Allows for modification of the component value prior to submission.
916
+ * @param {*} input - The input to be modified.
917
+ * @returns {*} - The modified input mapping for the extended component.
918
+ */
925
919
  performInputMapping(input) {
926
920
  return input;
927
921
  }
922
+ /**
923
+ * Returns the component "widget" if one is available.
924
+ * @returns {Widget|null} - The widget instance. null if not available.
925
+ */
928
926
  get widget() {
929
927
  var _a;
930
928
  const settings = this.component.widget;
@@ -934,6 +932,10 @@ class Component extends Element_1.default {
934
932
  const widget = settings && widgets_1.default[settings.type] ? new widgets_1.default[settings.type](settings, this.component, this) : null;
935
933
  return widget;
936
934
  }
935
+ /**
936
+ * Returns the native supported browser language.
937
+ * @returns {string|null} - The native browser language that is supported.
938
+ */
937
939
  getBrowserLanguage() {
938
940
  const nav = window.navigator;
939
941
  const browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'];
@@ -957,38 +959,46 @@ class Component extends Element_1.default {
957
959
  return null;
958
960
  }
959
961
  /**
960
- * Called before a next and previous page is triggered allowing the components
961
- * to perform special functions.
962
- *
963
- * @return {*}
962
+ * Called before a next and previous page is triggered allowing the components to perform special functions.
963
+ * @returns {Promise<boolean>} - A promise to resolve when the component is no longer blocking the next/previous page navigation.
964
964
  */
965
965
  beforePage() {
966
966
  return Promise.resolve(true);
967
967
  }
968
+ /**
969
+ * Called before the next page is triggered allowing the components to hook into the page navigation and perform tasks.
970
+ * @returns {Promise<boolean>} - A promise to resolve when the component is no longer blocking the next page navigation.
971
+ */
968
972
  beforeNext() {
969
973
  return this.beforePage(true);
970
974
  }
971
975
  /**
972
- * Called before a submission is triggered allowing the components
973
- * to perform special async functions.
974
- *
975
- * @return {*}
976
+ * Called before a submission is triggered allowing the components to perform special async functions.
977
+ * @returns {Promise<boolean>} - A promise to resolve when the component is no longer blocking the submission.
976
978
  */
977
979
  beforeSubmit() {
978
980
  return Promise.resolve(true);
979
981
  }
980
982
  /**
981
983
  * Return the submission timezone.
982
- *
983
- * @return {*}
984
+ * @returns {string} - The submission timezone.
984
985
  */
985
986
  get submissionTimezone() {
986
987
  this.options.submissionTimezone = this.options.submissionTimezone || lodash_1.default.get(this.root, 'options.submissionTimezone');
987
988
  return this.options.submissionTimezone;
988
989
  }
990
+ /**
991
+ * Return the current timezone.
992
+ * @returns {string} - The current timezone.
993
+ */
989
994
  get timezone() {
990
995
  return this.getTimezone(this.component);
991
996
  }
997
+ /**
998
+ * Return the current timezone.
999
+ * @param {object} settings - Settings to control how the timezone should be returned.
1000
+ * @returns {string} - The current timezone.
1001
+ */
992
1002
  getTimezone(settings) {
993
1003
  if (settings.timezone) {
994
1004
  return settings.timezone;
@@ -1012,6 +1022,9 @@ class Component extends Element_1.default {
1012
1022
  * @param {string} [referenceAttributeName] - The attribute name to use for the reference.
1013
1023
  */
1014
1024
  loadRefs(element, refs, referenceAttributeName) {
1025
+ if (!element) {
1026
+ return;
1027
+ }
1015
1028
  for (const ref in refs) {
1016
1029
  const refType = refs[ref];
1017
1030
  const isString = typeof refType === 'string';
@@ -1026,9 +1039,17 @@ class Component extends Element_1.default {
1026
1039
  }
1027
1040
  }
1028
1041
  }
1029
- setOpenModalElement(template) {
1042
+ /**
1043
+ * Opens the modal element.
1044
+ * @param {string} template - The template to use for the modal dialog.
1045
+ */
1046
+ setOpenModalElement(template = null) {
1030
1047
  this.componentModal.setOpenModalElement(template || this.getModalPreviewTemplate());
1031
1048
  }
1049
+ /**
1050
+ * Returns the modal preview template.
1051
+ * @returns {string} - The modal preview template.
1052
+ */
1032
1053
  getModalPreviewTemplate() {
1033
1054
  var _a;
1034
1055
  const dataValue = this.component.type === 'password' ? this.dataValue.replace(/./g, '•') : this.dataValue;
@@ -1042,6 +1063,11 @@ class Component extends Element_1.default {
1042
1063
  labelInfo: modalLabel,
1043
1064
  });
1044
1065
  }
1066
+ /**
1067
+ * Performs a complete build of a component, which empties, renders, sets the content in the DOM, and then finally attaches events.
1068
+ * @param {HTMLElement} element - The element to attach this component to.
1069
+ * @returns {Promise<void>} - A promise that resolves when the component has been built.
1070
+ */
1045
1071
  build(element) {
1046
1072
  element = element || this.element;
1047
1073
  this.empty(element);
@@ -1051,6 +1077,12 @@ class Component extends Element_1.default {
1051
1077
  get hasModalSaveButton() {
1052
1078
  return true;
1053
1079
  }
1080
+ /**
1081
+ * Renders a component as an HTML string.
1082
+ * @param {string} children - The contents of all the children HTML as a string.
1083
+ * @param {boolean} topLevel - If this is the topmost component that is being rendered.
1084
+ * @returns {string} - The rendered HTML string of a component.
1085
+ */
1054
1086
  render(children = `Unknown component: ${this.component.type}`, topLevel = false) {
1055
1087
  const isVisible = this.visible;
1056
1088
  this.rendered = true;
@@ -1074,6 +1106,11 @@ class Component extends Element_1.default {
1074
1106
  }, topLevel);
1075
1107
  }
1076
1108
  }
1109
+ /**
1110
+ * Attaches all the tooltips provided the refs object.
1111
+ * @param {object} toolTipsRefs - The refs for the tooltips within your template.
1112
+ * @returns {void}
1113
+ */
1077
1114
  attachTooltips(toolTipsRefs) {
1078
1115
  toolTipsRefs === null || toolTipsRefs === void 0 ? void 0 : toolTipsRefs.forEach((tooltip, index) => {
1079
1116
  if (tooltip) {
@@ -1092,9 +1129,21 @@ class Component extends Element_1.default {
1092
1129
  }
1093
1130
  });
1094
1131
  }
1132
+ /**
1133
+ * Create a new component modal for this component.
1134
+ * @param {HTMLElement} element - The element to attach the modal to.
1135
+ * @param {boolean} modalShouldBeOpened - TRUE if the modal should open immediately.
1136
+ * @param {any} currentValue - The current value of the component.
1137
+ * @returns {ComponentModal} - The created component modal.
1138
+ */
1095
1139
  createComponentModal(element, modalShouldBeOpened, currentValue) {
1096
1140
  return new ComponentModal_1.default(this, element, modalShouldBeOpened, currentValue, this._referenceAttributeName);
1097
1141
  }
1142
+ /**
1143
+ * Attaches all event listensers for this component to the DOM elements that were rendered.
1144
+ * @param {HTMLElement} element - The element to attach the listeners to.
1145
+ * @returns {Promise<void>} - Resolves when the component is done attaching to the DOM.
1146
+ */
1098
1147
  attach(element) {
1099
1148
  if (!this.builderMode && !this.previewMode && this.component.modalEdit) {
1100
1149
  const modalShouldBeOpened = this.componentModal ? this.componentModal.isOpened : false;
@@ -1132,6 +1181,9 @@ class Component extends Element_1.default {
1132
1181
  this.addons.forEach((addon) => addon.attach(element));
1133
1182
  return Promise.resolve();
1134
1183
  }
1184
+ /**
1185
+ * Restors the "focus" on a component after a redraw event has occured.
1186
+ */
1135
1187
  restoreFocus() {
1136
1188
  var _a, _b, _c;
1137
1189
  const isFocused = ((_b = (_a = this.root) === null || _a === void 0 ? void 0 : _a.focusedComponent) === null || _b === void 0 ? void 0 : _b.path) === this.path;
@@ -1141,6 +1193,12 @@ class Component extends Element_1.default {
1141
1193
  this.restoreCaretPosition();
1142
1194
  }
1143
1195
  }
1196
+ /**
1197
+ * Adds a keyboard shortcut to this component.
1198
+ * @param {HTMLElement} element - The element to attach the keyboard shortcut to.
1199
+ * @param {string} shortcut - The keyboard shortcut to add.
1200
+ * @returns {void}
1201
+ */
1144
1202
  addShortcut(element, shortcut) {
1145
1203
  // Avoid infinite recursion.
1146
1204
  if (!element || !this.root || (this.root === this)) {
@@ -1151,6 +1209,12 @@ class Component extends Element_1.default {
1151
1209
  }
1152
1210
  this.root.addShortcut(element, shortcut);
1153
1211
  }
1212
+ /**
1213
+ * Removes a keyboard shortcut from this component.
1214
+ * @param {HTMLElement} element - The element to remove the keyboard shortcut from.
1215
+ * @param {string} shortcut - The keyboard shortcut to remove.
1216
+ * @returns {void}
1217
+ */
1154
1218
  removeShortcut(element, shortcut) {
1155
1219
  // Avoid infinite recursion.
1156
1220
  if (!element || (this.root === this)) {
@@ -1183,6 +1247,13 @@ class Component extends Element_1.default {
1183
1247
  this.tooltip.destroy();
1184
1248
  }
1185
1249
  }
1250
+ /**
1251
+ * Determines if the component should be refreshed based on the path of another component that changed.
1252
+ * @param {string} refreshData - The path of the data that needs to trigger a refresh.
1253
+ * @param {boolean} changed - Flag that is true if the data has been changed.
1254
+ * @param {any} flags - The flags for the checkData procedure.
1255
+ * @returns {void}
1256
+ */
1186
1257
  checkRefresh(refreshData, changed, flags) {
1187
1258
  const changePath = lodash_1.default.get(changed, 'instance.path', false);
1188
1259
  // Don't let components change themselves.
@@ -1199,6 +1270,12 @@ class Component extends Element_1.default {
1199
1270
  this.refresh(changed.value, changed, flags);
1200
1271
  }
1201
1272
  }
1273
+ /**
1274
+ * Iterates over a list of changes, and determines if the component should be refreshed if it is configured to refresh on any of those components.
1275
+ * @param {Array<any>} changes - The list of components that have changed.
1276
+ * @param {any} flags - The checkData flags.
1277
+ * @returns {void}
1278
+ */
1202
1279
  checkRefreshOn(changes, flags = {}) {
1203
1280
  changes = changes || [];
1204
1281
  if (flags.noRefresh) {
@@ -1220,8 +1297,8 @@ class Component extends Element_1.default {
1220
1297
  }
1221
1298
  /**
1222
1299
  * Refreshes the component with a new value.
1223
- *
1224
- * @param value
1300
+ * @param {any} value - The latest value of the component to check if it needs to be refreshed.
1301
+ * @returns {void}
1225
1302
  */
1226
1303
  refresh(value) {
1227
1304
  if (this.hasOwnProperty('refreshOnValue')) {
@@ -1244,8 +1321,8 @@ class Component extends Element_1.default {
1244
1321
  * with the components data and returns true if they are in the same context.
1245
1322
  *
1246
1323
  * Different rows of the same EditGrid, for example, are in different contexts.
1247
- *
1248
- * @param component
1324
+ * @param {any} component - The component to check if it is in the same context as this component.
1325
+ * @returns {boolean} - TRUE if the component is in the same context as this component.
1249
1326
  */
1250
1327
  inContext(component) {
1251
1328
  if (component.data === this.data) {
@@ -1260,9 +1337,18 @@ class Component extends Element_1.default {
1260
1337
  }
1261
1338
  return false;
1262
1339
  }
1340
+ /**
1341
+ * Determines if we are in "view" only mode.
1342
+ * @returns {boolean} - TRUE if we are in "view" only mode.
1343
+ */
1263
1344
  get viewOnly() {
1264
1345
  return this.options.readOnly && this.options.viewAsHtml;
1265
1346
  }
1347
+ /**
1348
+ * Sets the HTMLElement for this component.
1349
+ * @param {HTMLElement} element - The element that is attached to this component.
1350
+ * @returns {void}
1351
+ */
1266
1352
  setElement(element) {
1267
1353
  if (this.element) {
1268
1354
  delete this.element.component;
@@ -1270,6 +1356,10 @@ class Component extends Element_1.default {
1270
1356
  }
1271
1357
  this.element = element;
1272
1358
  }
1359
+ /**
1360
+ * Creates an element to hold the "view only" version of this component.
1361
+ * @returns {HTMLElement} - The element for this component.
1362
+ */
1273
1363
  createViewOnlyElement() {
1274
1364
  this.setElement(this.ce('dl', {
1275
1365
  id: this.id
@@ -1280,14 +1370,18 @@ class Component extends Element_1.default {
1280
1370
  }
1281
1371
  return this.element;
1282
1372
  }
1373
+ /**
1374
+ * The default value for the "view only" mode of a component if the value is not provided.
1375
+ * @returns {string} - The default value for this component.
1376
+ */
1283
1377
  get defaultViewOnlyValue() {
1284
1378
  return '-';
1285
1379
  }
1286
1380
  /**
1287
1381
  * Uses the widget to determine the output string.
1288
- *
1289
- * @param value
1290
- * @return {*}
1382
+ * @param {any} value - The current value of the component.
1383
+ * @param {any} options - The options for getValueAsString.
1384
+ * @returns {any|Array<any>} - The value as a string.
1291
1385
  */
1292
1386
  getWidgetValueAsString(value, options) {
1293
1387
  const noInputWidget = !this.refs.input || !this.refs.input[0] || !this.refs.input[0].widget;
@@ -1312,6 +1406,12 @@ class Component extends Element_1.default {
1312
1406
  const widget = this.refs.input[0].widget;
1313
1407
  return widget.getValueAsString(value, options);
1314
1408
  }
1409
+ /**
1410
+ * Returns the value of the component as a string.
1411
+ * @param {any} value - The value for this component.
1412
+ * @param {any} options - The options for this component.
1413
+ * @returns {string} - The string representation of the value of this component.
1414
+ */
1315
1415
  getValueAsString(value, options) {
1316
1416
  if (!value) {
1317
1417
  return '';
@@ -1329,20 +1429,32 @@ class Component extends Element_1.default {
1329
1429
  const stringValue = value.toString();
1330
1430
  return this.sanitize(stringValue);
1331
1431
  }
1432
+ /**
1433
+ * Returns the string representation "view" of the component value.
1434
+ * @param {any} value - The value of the component.
1435
+ * @param {any} options - The options for this component.
1436
+ * @returns {string} - The string representation of the value of this component.
1437
+ */
1332
1438
  getView(value, options) {
1333
1439
  if (this.component.protected) {
1334
1440
  return '--- PROTECTED ---';
1335
1441
  }
1336
1442
  return this.getValueAsString(value, options);
1337
1443
  }
1444
+ /**
1445
+ * Updates the items list for this component. Useful for Select and other List component types.
1446
+ * @param {...any} args - The arguments to pass to the onChange event.
1447
+ * @returns {void}
1448
+ */
1338
1449
  updateItems(...args) {
1339
1450
  this.restoreValue();
1340
1451
  this.onChange(...args);
1341
1452
  }
1342
1453
  /**
1343
- * @param {*} data
1344
- * @param {boolean} [forceUseValue=false] - if true, return 'value' property of the data
1345
- * @return {*}
1454
+ * Returns the value for a specific item in a List type component.
1455
+ * @param {any} data - The data for this component.
1456
+ * @param {boolean} [forceUseValue] - if true, return 'value' property of the data
1457
+ * @returns {any} - The value of the item.
1346
1458
  */
1347
1459
  itemValue(data, forceUseValue = false) {
1348
1460
  if (lodash_1.default.isObject(data) && !lodash_1.default.isArray(data)) {
@@ -1355,6 +1467,11 @@ class Component extends Element_1.default {
1355
1467
  }
1356
1468
  return data;
1357
1469
  }
1470
+ /**
1471
+ * Returns the item value for html mode.
1472
+ * @param {any} value - The value for this component.
1473
+ * @returns {any} - The value of the item for html mode.
1474
+ */
1358
1475
  itemValueForHTMLMode(value) {
1359
1476
  if (Array.isArray(value)) {
1360
1477
  const values = value.map(item => Array.isArray(item) ? this.itemValueForHTMLMode(item) : this.itemValue(item));
@@ -1362,6 +1479,13 @@ class Component extends Element_1.default {
1362
1479
  }
1363
1480
  return this.itemValue(value);
1364
1481
  }
1482
+ /**
1483
+ * Creates a modal to input the value of this component.
1484
+ * @param {HTMLElement} element - The element to attach the modal to.
1485
+ * @param {any} attr - A list of attributes to add to the modal.
1486
+ * @param {boolean} confirm - If we should add a confirmation to the modal that keeps it from closing unless confirmed.
1487
+ * @returns {HTMLElement} - The created modal element.
1488
+ */
1365
1489
  createModal(element, attr, confirm) {
1366
1490
  const dialog = this.ce('div', attr || {});
1367
1491
  this.setContent(dialog, this.renderTemplate('dialog'));
@@ -1397,6 +1521,10 @@ class Component extends Element_1.default {
1397
1521
  this.addEventListener(dialog.refs.dialogClose, 'click', handleCloseClick);
1398
1522
  return dialog;
1399
1523
  }
1524
+ /**
1525
+ * Uses CSS classes to show or hide an element.
1526
+ * @returns {boolean} - TRUE if the element has been css removed.
1527
+ */
1400
1528
  get optimizeRedraw() {
1401
1529
  if (this.options.optimizeRedraw && this.element && !this.visible) {
1402
1530
  this.addClass(this.element, 'formio-removed');
@@ -1434,7 +1562,7 @@ class Component extends Element_1.default {
1434
1562
  }
1435
1563
  /**
1436
1564
  * Build the custom style from the layout values
1437
- * @return {string} - The custom style
1565
+ * @returns {string} - The custom style
1438
1566
  */
1439
1567
  get customStyle() {
1440
1568
  let customCSS = '';
@@ -1445,24 +1573,31 @@ class Component extends Element_1.default {
1445
1573
  });
1446
1574
  return customCSS;
1447
1575
  }
1576
+ /**
1577
+ * Returns the component condition operator settings if available.
1578
+ * @returns {object} - The component condition operator settings.
1579
+ */
1448
1580
  static get serverConditionSettings() {
1449
1581
  return Component.conditionOperatorsSettings;
1450
1582
  }
1583
+ /**
1584
+ * Returns if the application is on a mobile device.
1585
+ * @returns {boolean} - TRUE if the application is on a mobile device.
1586
+ */
1451
1587
  get isMobile() {
1452
1588
  return (0, ismobilejs_1.default)();
1453
1589
  }
1454
1590
  /**
1455
1591
  * Returns the outside wrapping element of this component.
1456
- * @returns {HTMLElement}
1592
+ * @returns {HTMLElement} - The wrapping element of this component.
1457
1593
  */
1458
1594
  getElement() {
1459
1595
  return this.element;
1460
1596
  }
1461
1597
  /**
1462
1598
  * Create an evaluation context for all script executions and interpolations.
1463
- *
1464
- * @param additional
1465
- * @return {*}
1599
+ * @param {any} additional - Additional context to provide.
1600
+ * @returns {any} - The evaluation context.
1466
1601
  */
1467
1602
  evalContext(additional) {
1468
1603
  return super.evalContext(Object.assign({
@@ -1484,18 +1619,29 @@ class Component extends Element_1.default {
1484
1619
  }
1485
1620
  /**
1486
1621
  * Sets the pristine flag for this component.
1487
- *
1488
- * @param pristine {boolean} - TRUE to make pristine, FALSE not pristine.
1622
+ * @param {boolean} pristine - TRUE to make pristine, FALSE not pristine.
1489
1623
  */
1490
1624
  setPristine(pristine) {
1491
1625
  this.pristine = pristine;
1492
1626
  }
1627
+ /**
1628
+ * Returns if the component is pristine.
1629
+ * @returns {boolean} - TRUE if the component is pristine.
1630
+ */
1493
1631
  get isPristine() {
1494
1632
  return this.pristine;
1495
1633
  }
1634
+ /**
1635
+ * Sets the dirty flag for this component.
1636
+ * @param {boolean} dirty - TRUE to make dirty, FALSE not dirty.
1637
+ */
1496
1638
  setDirty(dirty) {
1497
1639
  this.dirty = dirty;
1498
1640
  }
1641
+ /**
1642
+ * Returns if the component is dirty.
1643
+ * @returns {boolean} - TRUE if the component is dirty.
1644
+ */
1499
1645
  get isDirty() {
1500
1646
  return this.dirty;
1501
1647
  }
@@ -1509,12 +1655,23 @@ class Component extends Element_1.default {
1509
1655
  this.restoreValue();
1510
1656
  this.triggerRootChange();
1511
1657
  }
1658
+ /**
1659
+ * Returns the icon class for a given icon name.
1660
+ * @param {string} name - The name of the icon you wish to fetch provided the icon class. This is the "font awesome" version of the name of the icon.
1661
+ * @param {boolean} spinning - If the component should be spinning.
1662
+ * @returns {string} - The icon class for the equivalent icon in the iconset we are using.
1663
+ */
1512
1664
  iconClass(name, spinning) {
1513
1665
  const iconset = this.options.iconset || Templates_1.default.current.defaultIconset || 'fa';
1514
1666
  return Templates_1.default.current.hasOwnProperty('iconClass')
1515
1667
  ? Templates_1.default.current.iconClass(iconset, name, spinning)
1516
1668
  : this.options.iconset === 'fa' ? Templates_1.default.defaultTemplates.iconClass(iconset, name, spinning) : name;
1517
1669
  }
1670
+ /**
1671
+ * Returns the size css class names for our current template.
1672
+ * @param {string} size - The size class name for the default iconset.
1673
+ * @returns {string} - The size class for our component.
1674
+ */
1518
1675
  size(size) {
1519
1676
  return Templates_1.default.current.hasOwnProperty('size')
1520
1677
  ? Templates_1.default.current.size(size)
@@ -1527,15 +1684,23 @@ class Component extends Element_1.default {
1527
1684
  get name() {
1528
1685
  return this.t(this.component.label || this.component.placeholder || this.key, { _userInput: true });
1529
1686
  }
1687
+ /**
1688
+ * Returns the visible errors for this component.
1689
+ * @returns {Array<object>} - The visible errors for this component.
1690
+ */
1530
1691
  get visibleErrors() {
1531
1692
  return this._visibleErrors;
1532
1693
  }
1694
+ /**
1695
+ * Returns all the errors for this component, visible or not.
1696
+ * @returns {Array<object>} - All the errors for this component.
1697
+ */
1533
1698
  get errors() {
1534
1699
  return this._errors;
1535
1700
  }
1536
1701
  /**
1537
1702
  * Returns the error label for this component.
1538
- * @return {*}
1703
+ * @returns {string} - The error label for this component.
1539
1704
  */
1540
1705
  get errorLabel() {
1541
1706
  return this.t(this.component.errorLabel
@@ -1545,12 +1710,20 @@ class Component extends Element_1.default {
1545
1710
  }
1546
1711
  /**
1547
1712
  * Get the error message provided a certain type of error.
1548
- * @param type
1549
- * @return {*}
1713
+ * @param {string} type - The type of error to fetch the message for.
1714
+ * @returns {string} - The error message configured for this component.
1550
1715
  */
1551
1716
  errorMessage(type) {
1552
1717
  return (this.component.errors && this.component.errors[type]) ? this.component.errors[type] : type;
1553
1718
  }
1719
+ /**
1720
+ * Sets the content, innerHTML, of an element to the sanitized content.
1721
+ * @param {HTMLElement} element - The element to set the innerHTML to.
1722
+ * @param {string} content - The HTML string content that we wish to set.
1723
+ * @param {boolean} forceSanitize - If we should force the content to be sanitized.
1724
+ * @param {any} sanitizeOptions - The options for the sanitize function.
1725
+ * @returns {boolean} - TRUE if the content was sanitized and set.
1726
+ */
1554
1727
  setContent(element, content, forceSanitize, sanitizeOptions) {
1555
1728
  if (element instanceof HTMLElement) {
1556
1729
  element.innerHTML = this.sanitize(content, forceSanitize, sanitizeOptions);
@@ -1558,6 +1731,9 @@ class Component extends Element_1.default {
1558
1731
  }
1559
1732
  return false;
1560
1733
  }
1734
+ /**
1735
+ * Restores the caret position in the input element after a refresh occurs.
1736
+ */
1561
1737
  restoreCaretPosition() {
1562
1738
  var _a, _b, _c;
1563
1739
  if ((_a = this.root) === null || _a === void 0 ? void 0 : _a.currentSelection) {
@@ -1580,6 +1756,10 @@ class Component extends Element_1.default {
1580
1756
  }
1581
1757
  }
1582
1758
  }
1759
+ /**
1760
+ * Redraw the component.
1761
+ * @returns {Promise<void>} - A promise that resolves when the component is done redrawing.
1762
+ */
1583
1763
  redraw() {
1584
1764
  // Don't bother if we have not built yet.
1585
1765
  if (!this.element || !this.element.parentNode || this.optimizeRedraw) {
@@ -1595,29 +1775,54 @@ class Component extends Element_1.default {
1595
1775
  this.setElement(parent.children[index]);
1596
1776
  return this.attach(this.element);
1597
1777
  }
1778
+ /**
1779
+ * Rebuild and redraw a component.
1780
+ * @returns {Promise<void>} - A promise that resolves when the component is done rebuilding and redrawing.
1781
+ */
1598
1782
  rebuild() {
1599
1783
  this.destroy();
1600
1784
  this.init();
1601
1785
  this.visible = this.conditionallyVisible(null, null);
1602
1786
  return this.redraw();
1603
1787
  }
1788
+ /**
1789
+ * Removes all event listeners attached to this component.
1790
+ */
1604
1791
  removeEventListeners() {
1605
1792
  super.removeEventListeners();
1606
1793
  this.tooltips.forEach(tooltip => tooltip.destroy());
1607
1794
  this.tooltips = [];
1608
1795
  }
1796
+ /**
1797
+ * Returns if the dom node has the classes provided.
1798
+ * @param {HTMLElement} element - The element to check for the class.
1799
+ * @param {string} className - The name of the class to check.
1800
+ * @returns {boolean|void} - TRUE if the element has the class.
1801
+ */
1609
1802
  hasClass(element, className) {
1610
1803
  if (!element) {
1611
1804
  return;
1612
1805
  }
1613
1806
  return super.hasClass(element, this.transform('class', className));
1614
1807
  }
1808
+ /**
1809
+ * Adds a class to an HTML element.
1810
+ * @param {HTMLElement} element - The dom element to add the class to.
1811
+ * @param {string} className - The class name you wish to add.
1812
+ * @returns {this|void} - The component instance.
1813
+ */
1615
1814
  addClass(element, className) {
1616
1815
  if (!element) {
1617
1816
  return;
1618
1817
  }
1619
1818
  return super.addClass(element, this.transform('class', className));
1620
1819
  }
1820
+ /**
1821
+ * Removes a class from an element.
1822
+ * @param {HTMLElement} element - The element to remove the class from.
1823
+ * @param {string} className - The class name to remove.
1824
+ * @returns {this|void} - The component instance.
1825
+ */
1621
1826
  removeClass(element, className) {
1622
1827
  if (!element) {
1623
1828
  return;
@@ -1626,8 +1831,7 @@ class Component extends Element_1.default {
1626
1831
  }
1627
1832
  /**
1628
1833
  * Determines if this component has a condition defined.
1629
- *
1630
- * @return {null}
1834
+ * @returns {boolean} - TRUE if the component has a condition defined.
1631
1835
  */
1632
1836
  hasCondition() {
1633
1837
  if (this._hasCondition !== null) {
@@ -1638,9 +1842,9 @@ class Component extends Element_1.default {
1638
1842
  }
1639
1843
  /**
1640
1844
  * Check if this component is conditionally visible.
1641
- *
1642
- * @param data
1643
- * @return {boolean}
1845
+ * @param {any} data - The data to check against.
1846
+ * @param {any} row - The row data to check against.
1847
+ * @returns {boolean} - TRUE if the component is conditionally visible.
1644
1848
  */
1645
1849
  conditionallyVisible(data, row) {
1646
1850
  data = data || this.rootValue;
@@ -1655,16 +1859,19 @@ class Component extends Element_1.default {
1655
1859
  * Checks the condition of this component.
1656
1860
  *
1657
1861
  * TODO: Switch row and data parameters to be consistent with other methods.
1658
- *
1659
- * @param row - The row contextual data.
1660
- * @param data - The global data object.
1661
- * @return {boolean} - True if the condition applies to this component.
1862
+ * @param {any} row - The row contextual data.
1863
+ * @param {any} data - The global data object.
1864
+ * @returns {boolean} - True if the condition applies to this component.
1662
1865
  */
1663
1866
  checkCondition(row, data) {
1664
1867
  return FormioUtils.checkCondition(this.component, row || this.data, data || this.rootValue, this.root ? this.root._form : {}, this);
1665
1868
  }
1666
1869
  /**
1667
1870
  * Check for conditionals and hide/show the element based on those conditions.
1871
+ * @param {any} data - The data to check against.
1872
+ * @param {any} flags - The flags passed to checkData function.
1873
+ * @param {any} row - The row data to check against.
1874
+ * @returns {boolean} - TRUE if the component is visible.
1668
1875
  */
1669
1876
  checkComponentConditions(data, flags, row) {
1670
1877
  data = data || this.rootValue;
@@ -1682,8 +1889,10 @@ class Component extends Element_1.default {
1682
1889
  }
1683
1890
  /**
1684
1891
  * Checks conditions for this component and any sub components.
1685
- * @param args
1686
- * @return {boolean}
1892
+ * @param {any} data - The data to check against.
1893
+ * @param {any} flags - The flags passed to checkData function.
1894
+ * @param {any} row - The row data to check against.
1895
+ * @returns {boolean} - TRUE if the component is visible.
1687
1896
  */
1688
1897
  checkConditions(data, flags, row) {
1689
1898
  data = data || this.rootValue;
@@ -1691,17 +1900,20 @@ class Component extends Element_1.default {
1691
1900
  row = row || this.data;
1692
1901
  return this.checkComponentConditions(data, flags, row);
1693
1902
  }
1903
+ /**
1904
+ * Returns the component logic if applicable.
1905
+ * @returns {Array<object>} - The component logic.
1906
+ */
1694
1907
  get logic() {
1695
1908
  return this.component.logic || [];
1696
1909
  }
1697
1910
  /**
1698
1911
  * Check all triggers and apply necessary actions.
1699
- *
1700
- * @param data
1912
+ * @param {any} data - The data to check against.
1913
+ * @param {any} row - The row data to check against.
1914
+ * @returns {boolean|void} - TRUE if the component was altered.
1701
1915
  */
1702
- fieldLogic(data, row) {
1703
- data = data || this.rootValue;
1704
- row = row || this.data;
1916
+ fieldLogic(data = this.rootValue, row = this.data) {
1705
1917
  const logics = this.logic;
1706
1918
  // If there aren't logic, don't go further.
1707
1919
  if (logics.length === 0) {
@@ -1724,6 +1936,10 @@ class Component extends Element_1.default {
1724
1936
  }
1725
1937
  return changed;
1726
1938
  }
1939
+ /**
1940
+ * Retuns if the browser is Internet Explorer.
1941
+ * @returns {boolean} - TRUE if the browser is IE.
1942
+ */
1727
1943
  isIE() {
1728
1944
  if (typeof window === 'undefined') {
1729
1945
  return false;
@@ -1748,9 +1964,24 @@ class Component extends Element_1.default {
1748
1964
  // other browser
1749
1965
  return false;
1750
1966
  }
1967
+ /**
1968
+ * Defines the logic action value through evaluation.
1969
+ * @param {object} action - The action within the Logic system to perform.
1970
+ * @param {object} argsObject - The arguments to pass to the evaluation.
1971
+ * @returns {any} - The result of the evaluation.
1972
+ */
1751
1973
  defineActionValue(action, argsObject) {
1752
1974
  return this.evaluate(action.value, argsObject, 'value');
1753
1975
  }
1976
+ /**
1977
+ * Apply the actions of Logic for a component once the conditions have been met.
1978
+ * @param {object} newComponent - The new component to apply the actions to.
1979
+ * @param {Array<object>} actions - An array of actions
1980
+ * @param {any} result - The result of the conditional check in order to evaluate the actions.
1981
+ * @param {any} row - The contextual row data for this component.
1982
+ * @param {any} data - The global data object for the submission.
1983
+ * @returns {boolean} - TRUE if the component was altered.
1984
+ */
1754
1985
  applyActions(newComponent, actions, result, row, data) {
1755
1986
  data = data || this.rootValue;
1756
1987
  row = row || this.data;
@@ -1830,8 +2061,8 @@ class Component extends Element_1.default {
1830
2061
  }
1831
2062
  /**
1832
2063
  * Add a new input error to this element.
1833
- *
1834
- * @param {{level: string, message: string}[]} messages
2064
+ * @param {Array<object>|string} messages - An array of messages to add to the element.
2065
+ * @returns {void}
1835
2066
  */
1836
2067
  addMessages(messages) {
1837
2068
  if (!messages) {
@@ -1850,13 +2081,19 @@ class Component extends Element_1.default {
1850
2081
  messages = lodash_1.default.uniqBy(messages, message => message.message);
1851
2082
  if (this.refs.messageContainer) {
1852
2083
  this.setContent(this.refs.messageContainer, messages.map((message) => {
1853
- if (message.message && typeof message.message === 'string') {
1854
- message.message = message.message.replaceAll('<', '&lt;').replaceAll('>', '&gt;');
1855
- }
1856
2084
  return this.renderTemplate('message', Object.assign({}, message));
1857
2085
  }).join(''));
1858
2086
  }
1859
2087
  }
2088
+ /**
2089
+ * Sets the form input widget error classes.
2090
+ * @param {Array<HTMLElement>} elements - An array of DOM elements to set the error classes on.
2091
+ * @param {boolean} dirty - If the input is dirty.
2092
+ * @param {boolean} hasErrors - If the input has errors.
2093
+ * @param {boolean} hasMessages - If the input has messages.
2094
+ * @param {HTMLElement} element - The wrapper element for all the other elements passed in first argument.
2095
+ * @returns {void}
2096
+ */
1860
2097
  setErrorClasses(elements, dirty, hasErrors, hasMessages, element = this.element) {
1861
2098
  this.clearErrorClasses();
1862
2099
  elements.forEach((element) => {
@@ -1883,6 +2120,12 @@ class Component extends Element_1.default {
1883
2120
  this.addClass(element, 'has-message');
1884
2121
  }
1885
2122
  }
2123
+ /**
2124
+ * Adds the classes necessary to mark an element as invalid.
2125
+ * @param {HTMLElement} element - The element you wish to add the invalid classes to.
2126
+ * @param {boolean} invalid - TRUE if the component is invalid, FALSE otherwise.
2127
+ * @returns {void}
2128
+ */
1886
2129
  setElementInvalid(element, invalid) {
1887
2130
  if (!element)
1888
2131
  return;
@@ -1894,6 +2137,9 @@ class Component extends Element_1.default {
1894
2137
  }
1895
2138
  element.setAttribute('aria-invalid', invalid ? 'true' : 'false');
1896
2139
  }
2140
+ /**
2141
+ * Clears the components data if it is conditionally hidden AND clearOnHide is set to true for this component.
2142
+ */
1897
2143
  clearOnHide() {
1898
2144
  // clearOnHide defaults to true for old forms (without the value set) so only trigger if the value is false.
1899
2145
  if (
@@ -1913,6 +2159,10 @@ class Component extends Element_1.default {
1913
2159
  }
1914
2160
  }
1915
2161
  }
2162
+ /**
2163
+ * Triggers a debounced onChange event for the root component (usually Webform).
2164
+ * @param {...any} args - The arguments to pass to the onChange event.
2165
+ */
1916
2166
  triggerRootChange(...args) {
1917
2167
  if (this.options.onChange) {
1918
2168
  this.options.onChange(...args);
@@ -1921,6 +2171,13 @@ class Component extends Element_1.default {
1921
2171
  this.root.triggerChange(...args);
1922
2172
  }
1923
2173
  }
2174
+ /**
2175
+ * Called when the component value has been changed. This will then trigger the root level onChange handler which
2176
+ * propagates the checkData methods for the full component tree.
2177
+ * @param {any} flags - The flags for the change event propagation.
2178
+ * @param {boolean} fromRoot - If the change event is from the root component.
2179
+ * @returns {boolean} - TRUE if the component has changed.
2180
+ */
1924
2181
  onChange(flags, fromRoot) {
1925
2182
  flags = flags || {};
1926
2183
  if (flags.modified) {
@@ -2050,7 +2307,7 @@ class Component extends Element_1.default {
2050
2307
  return Promise.reject();
2051
2308
  }
2052
2309
  this.quill = new Quill(element, isIEBrowser ? Object.assign(Object.assign({}, settings), { modules: {} }) : settings);
2053
- /** This block of code adds the [source] capabilities. See https://codepen.io/anon/pen/ZyEjrQ **/
2310
+ /** This block of code adds the [source] capabilities. See https://codepen.io/anon/pen/ZyEjrQ */
2054
2311
  const txtArea = document.createElement('textarea');
2055
2312
  txtArea.setAttribute('class', 'quill-source-code');
2056
2313
  this.quill.addContainer('ql-custom').appendChild(txtArea);
@@ -2064,7 +2321,7 @@ class Component extends Element_1.default {
2064
2321
  txtArea.style.display = (txtArea.style.display === 'none') ? 'inherit' : 'none';
2065
2322
  });
2066
2323
  }
2067
- /** END CODEBLOCK **/
2324
+ /** END CODEBLOCK */
2068
2325
  // Make sure to select cursor when they click on the element.
2069
2326
  this.addEventListener(element, 'click', () => this.quill.focus());
2070
2327
  // Allows users to skip toolbar items when tabbing though form
@@ -2112,23 +2369,22 @@ class Component extends Element_1.default {
2112
2369
  }
2113
2370
  /**
2114
2371
  * The empty value for this component.
2115
- *
2116
- * @return {null}
2372
+ * @returns {null} - The empty value for this component.
2117
2373
  */
2118
2374
  get emptyValue() {
2119
2375
  return null;
2120
2376
  }
2121
2377
  /**
2122
2378
  * Returns if this component has a value set.
2123
- *
2379
+ * @param {any} data - The global data object.
2380
+ * @returns {boolean} - TRUE if a value is set.
2124
2381
  */
2125
2382
  hasValue(data) {
2126
2383
  return !lodash_1.default.isUndefined(lodash_1.default.get(data || this.data, this.key));
2127
2384
  }
2128
2385
  /**
2129
2386
  * Get the data value at the root level.
2130
- *
2131
- * @return {*}
2387
+ * @returns {*} - The root value for the component, typically the Webform data object.
2132
2388
  */
2133
2389
  get rootValue() {
2134
2390
  return this.root ? this.root.data : this.data;
@@ -2138,7 +2394,7 @@ class Component extends Element_1.default {
2138
2394
  }
2139
2395
  /**
2140
2396
  * Get the static value of this component.
2141
- * @return {*}
2397
+ * @returns {*} - The value for this component.
2142
2398
  */
2143
2399
  get dataValue() {
2144
2400
  if (!this.key ||
@@ -2156,8 +2412,7 @@ class Component extends Element_1.default {
2156
2412
  }
2157
2413
  /**
2158
2414
  * Sets the static value of this component.
2159
- *
2160
- * @param value
2415
+ * @param {*} value - The value to set for this component.
2161
2416
  */
2162
2417
  set dataValue(value) {
2163
2418
  if (!this.allowData ||
@@ -2177,8 +2432,8 @@ class Component extends Element_1.default {
2177
2432
  }
2178
2433
  /**
2179
2434
  * Splice a value from the dataValue.
2180
- *
2181
- * @param index
2435
+ * @param {number} index - The index to splice for an array component values.
2436
+ * @param {*} flags - The flags to use when splicing the value.
2182
2437
  */
2183
2438
  splice(index, flags = {}) {
2184
2439
  if (this.hasValue()) {
@@ -2246,8 +2501,7 @@ class Component extends Element_1.default {
2246
2501
  }
2247
2502
  /**
2248
2503
  * Get the input value of this component.
2249
- *
2250
- * @return {*}
2504
+ * @returns {*} - The value for the component.
2251
2505
  */
2252
2506
  getValue() {
2253
2507
  if (!this.hasInput || this.viewOnly || !this.refs.input || !this.refs.input.length) {
@@ -2269,9 +2523,8 @@ class Component extends Element_1.default {
2269
2523
  }
2270
2524
  /**
2271
2525
  * Get the value at a specific index.
2272
- *
2273
- * @param index
2274
- * @returns {*}
2526
+ * @param {number} index - For an array component or multiple values, this returns the value at a specific index.
2527
+ * @returns {*} - The value at the specified index.
2275
2528
  */
2276
2529
  getValueAt(index) {
2277
2530
  const input = this.performInputMapping(this.refs.input[index]);
@@ -2279,11 +2532,9 @@ class Component extends Element_1.default {
2279
2532
  }
2280
2533
  /**
2281
2534
  * Set the value of this component.
2282
- *
2283
- * @param value
2284
- * @param flags
2285
- *
2286
- * @return {boolean} - If the value changed.
2535
+ * @param {*} value - The value to set for this component.
2536
+ * @param {*} flags - The flags to use when setting the value.
2537
+ * @returns {boolean} - If the value changed.
2287
2538
  */
2288
2539
  setValue(value, flags = {}) {
2289
2540
  const changed = this.updateValue(value, flags);
@@ -2314,9 +2565,9 @@ class Component extends Element_1.default {
2314
2565
  }
2315
2566
  /**
2316
2567
  * Set the value at a specific index.
2317
- *
2318
- * @param index
2319
- * @param value
2568
+ * @param {number} index - The index to set the value at.
2569
+ * @param {*} value - The value to set at the specified index.
2570
+ * @param {*} flags - The flags to use when setting the value.
2320
2571
  */
2321
2572
  setValueAt(index, value, flags = {}) {
2322
2573
  if (!flags.noDefault && (value === null || value === undefined) && !this.component.multiple) {
@@ -2363,9 +2614,8 @@ class Component extends Element_1.default {
2363
2614
  }
2364
2615
  /**
2365
2616
  * Normalize values coming into updateValue.
2366
- *
2367
- * @param value
2368
- * @return {*}
2617
+ * @param {*} value - The value to normalize before setting.
2618
+ * @returns {*} - The normalized value.
2369
2619
  */
2370
2620
  normalizeValue(value) {
2371
2621
  if (this.component.multiple && !Array.isArray(value)) {
@@ -2375,8 +2625,9 @@ class Component extends Element_1.default {
2375
2625
  }
2376
2626
  /**
2377
2627
  * Update a value of this component.
2378
- *
2379
- * @param flags
2628
+ * @param {*} value - The value to update.
2629
+ * @param {*} flags - The flags to use when updating the value.
2630
+ * @returns {boolean} - If the value changed.
2380
2631
  */
2381
2632
  updateComponentValue(value, flags = {}) {
2382
2633
  let newValue = (!flags.resetValue && (value === undefined || value === null)) ? this.getValue() : value;
@@ -2395,9 +2646,8 @@ class Component extends Element_1.default {
2395
2646
  }
2396
2647
  /**
2397
2648
  * Updates the value of this component plus all sub-components.
2398
- *
2399
- * @param args
2400
- * @return {boolean}
2649
+ * @param {...any} args - The arguments to pass to updateValue.
2650
+ * @returns {boolean} - If the value changed.
2401
2651
  */
2402
2652
  updateValue(...args) {
2403
2653
  return this.updateComponentValue(...args);
@@ -2423,10 +2673,9 @@ class Component extends Element_1.default {
2423
2673
  }
2424
2674
  /**
2425
2675
  * Determine if the value of this component has changed.
2426
- *
2427
- * @param newValue
2428
- * @param oldValue
2429
- * @return {boolean}
2676
+ * @param {*} newValue - The new value to check.
2677
+ * @param {*} oldValue - The existing value of the component.
2678
+ * @returns {boolean} - TRUE if the value has changed.
2430
2679
  */
2431
2680
  hasChanged(newValue, oldValue) {
2432
2681
  if (((newValue === undefined) || (newValue === null)) &&
@@ -2444,8 +2693,9 @@ class Component extends Element_1.default {
2444
2693
  }
2445
2694
  /**
2446
2695
  * Update the value on change.
2447
- *
2448
- * @param flags
2696
+ * @param {*} flags - The flags to use when triggering the on change event.
2697
+ * @param {boolean} changed - If the value has changed.
2698
+ * @returns {boolean} - If the value changed.
2449
2699
  */
2450
2700
  updateOnChange(flags = {}, changed = false) {
2451
2701
  if (!flags.noUpdateEvent && changed) {
@@ -2458,13 +2708,6 @@ class Component extends Element_1.default {
2458
2708
  }
2459
2709
  return false;
2460
2710
  }
2461
- /**
2462
- * Perform a calculated value operation.
2463
- *
2464
- * @param data - The global data object.
2465
- *
2466
- * @return {boolean} - If the value changed during calculation.
2467
- */
2468
2711
  convertNumberOrBoolToString(value) {
2469
2712
  if (typeof value === 'number' || typeof value === 'boolean') {
2470
2713
  return value.toString();
@@ -2562,7 +2805,7 @@ class Component extends Element_1.default {
2562
2805
  }
2563
2806
  this.calculatedValue = (0, utils_1.fastCloneDeep)(calculatedValue);
2564
2807
  if (changed) {
2565
- if (!flags.noPristineChangeOnModified) {
2808
+ if (!flags.noPristineChangeOnModified && this.root.initialized) {
2566
2809
  this.pristine = false;
2567
2810
  }
2568
2811
  flags.triggeredComponentId = this.id;
@@ -2573,9 +2816,10 @@ class Component extends Element_1.default {
2573
2816
  /* eslint-enable max-statements */
2574
2817
  /**
2575
2818
  * Performs calculations in this component plus any child components.
2576
- *
2577
- * @param args
2578
- * @return {boolean}
2819
+ * @param {*} data - The data to perform the calculation with.
2820
+ * @param {*} flags - The flags to use when calculating the value.
2821
+ * @param {*} row - The contextual row data to use when performing the calculation.
2822
+ * @returns {boolean} - TRUE if the value changed.
2579
2823
  */
2580
2824
  calculateValue(data, flags, row) {
2581
2825
  data = data || this.rootValue;
@@ -2585,15 +2829,14 @@ class Component extends Element_1.default {
2585
2829
  }
2586
2830
  /**
2587
2831
  * Get this component's label text.
2588
- *
2832
+ * @returns {string} - The label text for this component.
2589
2833
  */
2590
2834
  get label() {
2591
2835
  return this.component.label;
2592
2836
  }
2593
2837
  /**
2594
2838
  * Set this component's label text and render it.
2595
- *
2596
- * @param value - The new label text.
2839
+ * @param {string} value - The new label text.
2597
2840
  */
2598
2841
  set label(value) {
2599
2842
  this.component.label = value;
@@ -2603,17 +2846,18 @@ class Component extends Element_1.default {
2603
2846
  }
2604
2847
  /**
2605
2848
  * Get FormioForm element at the root of this component tree.
2606
- *
2849
+ * @returns {*} root - The root component to search from.
2607
2850
  */
2608
2851
  getRoot() {
2609
2852
  return this.root;
2610
2853
  }
2611
2854
  /**
2612
2855
  * Returns the invalid message, or empty string if the component is valid.
2613
- *
2614
- * @param data
2615
- * @param dirty
2616
- * @return {*}
2856
+ * @param {*} data - The data to check if the component is valid.
2857
+ * @param {boolean} dirty - If the component is dirty.
2858
+ * @param {boolean} ignoreCondition - If conditions for the component should be ignored when checking validity.
2859
+ * @param {*} row - Contextual row data for this component.
2860
+ * @returns {string} - The message to show when the component is invalid.
2617
2861
  */
2618
2862
  invalidMessage(data, dirty, ignoreCondition, row) {
2619
2863
  if (!ignoreCondition && !this.checkCondition(row, data)) {
@@ -2645,10 +2889,9 @@ class Component extends Element_1.default {
2645
2889
  }
2646
2890
  /**
2647
2891
  * Returns if the component is valid or not.
2648
- *
2649
- * @param data
2650
- * @param dirty
2651
- * @return {boolean}
2892
+ * @param {*} data - The data to check if the component is valid.
2893
+ * @param {boolean} dirty - If the component is dirty.
2894
+ * @returns {boolean} - TRUE if the component is valid.
2652
2895
  */
2653
2896
  isValid(data, dirty) {
2654
2897
  return !this.invalidMessage(data, dirty);
@@ -2667,8 +2910,8 @@ class Component extends Element_1.default {
2667
2910
  }
2668
2911
  /**
2669
2912
  * Interpolate errors from the validation methods.
2670
- * @param {*} errors
2671
- * @returns
2913
+ * @param {Array<any>} errors - An array of errors to interpolate.
2914
+ * @returns {Array<any>} - The interpolated errors.
2672
2915
  */
2673
2916
  interpolateErrors(errors) {
2674
2917
  var _a;
@@ -2681,7 +2924,7 @@ class Component extends Element_1.default {
2681
2924
  * @param {*} data - The root submission data.
2682
2925
  * @param {*} row - The contextual row data.
2683
2926
  * @param {*} flags - The flags to perform validation.
2684
- * @returns
2927
+ * @returns {boolean} - TRUE if the component is valid.
2685
2928
  */
2686
2929
  showValidationErrors(errors, data, row, flags) {
2687
2930
  if (flags.silentCheck) {
@@ -2701,9 +2944,9 @@ class Component extends Element_1.default {
2701
2944
  * @param {*} data - The root data you wish to use for this component.
2702
2945
  * @param {*} row - The contextual row data you wish to use for this component.
2703
2946
  * @param {*} flags - The flags to control the behavior of the validation.
2704
- * @returns
2947
+ * @returns {Array<any>} - An array of errors if the component is invalid.
2705
2948
  */
2706
- validateComponent(data, row, flags = {}) {
2949
+ validateComponent(data = null, row = null, flags = {}) {
2707
2950
  data = data || this.rootValue;
2708
2951
  row = row || this.data;
2709
2952
  const { async = false } = flags;
@@ -2734,13 +2977,14 @@ class Component extends Element_1.default {
2734
2977
  }
2735
2978
  /**
2736
2979
  * Checks the validity of this component and sets the error message if it is invalid.
2737
- *
2738
- * @param data
2739
- * @param dirty
2740
- * @param row
2741
- * @return {boolean}
2742
- */
2743
- checkComponentValidity(data, dirty, row, flags = {}, allErrors = []) {
2980
+ * @param {*} data - The data to check if the component is valid.
2981
+ * @param {boolean} dirty - If the component is dirty.
2982
+ * @param {*} row - The contextual row data for this component.
2983
+ * @param {*} flags - The flags to use when checking the validity.
2984
+ * @param {Array<any>} allErrors - An array of all errors that have occured so that it can be appended when another one occurs here.
2985
+ * @returns {boolean} - TRUE if the component is valid.
2986
+ */
2987
+ checkComponentValidity(data = null, dirty = false, row = null, flags = {}, allErrors = []) {
2744
2988
  data = data || this.rootValue;
2745
2989
  row = row || this.data;
2746
2990
  flags.dirty = dirty || false;
@@ -2776,32 +3020,30 @@ class Component extends Element_1.default {
2776
3020
  }
2777
3021
  /**
2778
3022
  * Checks the validity of the component.
2779
- * @param {*} data
2780
- * @param {*} dirty
2781
- * @param {*} row
2782
- * @param {*} silentCheck
2783
- * @returns
2784
- */
2785
- checkValidity(data, dirty, row, silentCheck, errors = []) {
3023
+ * @param {*} data - The data to check if the component is valid.
3024
+ * @param {boolean} dirty - If the component is dirty.
3025
+ * @param {*} row - The contextual row data for this component.
3026
+ * @param {boolean} silentCheck - If the check should be silent and not set the error messages.
3027
+ * @param {Array<any>} errors - An array of all errors that have occured so that it can be appended when another one occurs here.
3028
+ * @returns {boolean} - TRUE if the component is valid.
3029
+ */
3030
+ checkValidity(data = null, dirty = false, row = null, silentCheck = false, errors = []) {
2786
3031
  data = data || this.rootValue;
2787
3032
  row = row || this.data;
2788
- console.log('Deprecation warning: Component.checkValidity() will be deprecated in 6.x version of renderer. Use Component.validateComponent instead.');
2789
3033
  return this.checkComponentValidity(data, dirty, row, { silentCheck }, errors);
2790
3034
  }
2791
- checkAsyncValidity(data, dirty, row, silentCheck, errors = []) {
2792
- console.log('Deprecation warning: Component.checkAsyncValidity() will be deprecated in 6.x version of renderer. Use Component.validateComponent instead.');
3035
+ checkAsyncValidity(data = null, dirty = false, row = null, silentCheck = false, errors = []) {
2793
3036
  return this.checkComponentValidity(data, dirty, row, { async: true, silentCheck }, errors);
2794
3037
  }
2795
3038
  /**
2796
3039
  * Check the conditions, calculations, and validity of a single component and triggers an update if
2797
3040
  * something changed.
2798
- *
2799
- * @param data - The root data of the change event.
2800
- * @param flags - The flags from this change event.
2801
- *
2802
- * @return boolean - If component is valid or not.
3041
+ * @param {*} data - The root data of the change event.
3042
+ * @param {*} flags - The flags from this change event.
3043
+ * @param {*} row - The contextual row data for this component.
3044
+ * @returns {void|boolean} - TRUE if no check should be performed on the component.
2803
3045
  */
2804
- checkData(data, flags, row) {
3046
+ checkData(data = null, flags = null, row = null) {
2805
3047
  data = data || this.rootValue;
2806
3048
  flags = flags || {};
2807
3049
  row = row || this.data;
@@ -2844,8 +3086,7 @@ class Component extends Element_1.default {
2844
3086
  }
2845
3087
  /**
2846
3088
  * Check if a component is eligible for multiple validation
2847
- *
2848
- * @return {boolean}
3089
+ * @returns {boolean} - TRUE if the component is eligible for multiple validation.
2849
3090
  */
2850
3091
  validateMultiple() {
2851
3092
  return true;
@@ -2965,8 +3206,7 @@ class Component extends Element_1.default {
2965
3206
  /**
2966
3207
  * Determines if the value of this component is hidden from the user as if it is coming from the server, but is
2967
3208
  * protected.
2968
- *
2969
- * @return {boolean|*}
3209
+ * @returns {boolean|*} - TRUE if the value is hidden.
2970
3210
  */
2971
3211
  isValueHidden() {
2972
3212
  if (this.component.protected && this.root.editing) {
@@ -3011,6 +3251,8 @@ class Component extends Element_1.default {
3011
3251
  }
3012
3252
  /**
3013
3253
  * Prints out the value of this component as a string value.
3254
+ * @param {*} value - The value to print out.
3255
+ * @returns {string} - The string representation of the value.
3014
3256
  */
3015
3257
  asString(value) {
3016
3258
  value = value || this.getValue();
@@ -3018,15 +3260,14 @@ class Component extends Element_1.default {
3018
3260
  }
3019
3261
  /**
3020
3262
  * Return if the component is disabled.
3021
- * @return {boolean}
3263
+ * @returns {boolean} - TRUE if the component is disabled.
3022
3264
  */
3023
3265
  get disabled() {
3024
3266
  return this._disabled || this.parentDisabled;
3025
3267
  }
3026
3268
  /**
3027
3269
  * Disable this component.
3028
- *
3029
- * @param {boolean} disabled
3270
+ * @param {boolean} disabled - TRUE to disable the component.
3030
3271
  */
3031
3272
  set disabled(disabled) {
3032
3273
  this._disabled = disabled;
@@ -3151,6 +3392,7 @@ class Component extends Element_1.default {
3151
3392
  }
3152
3393
  /**
3153
3394
  * Get the element information.
3395
+ * @returns {*} - The components "input" DOM element information.
3154
3396
  */
3155
3397
  elementInfo() {
3156
3398
  const attributes = {
@@ -3189,15 +3431,13 @@ class Component extends Element_1.default {
3189
3431
  const { left, top } = element.getBoundingClientRect();
3190
3432
  window.scrollTo(left + window.scrollX, top + window.scrollY);
3191
3433
  }
3192
- focus(index) {
3434
+ focus(index = (this.refs.input.length - 1)) {
3193
3435
  var _a, _b;
3194
3436
  if ('beforeFocus' in this.parent) {
3195
3437
  this.parent.beforeFocus(this);
3196
3438
  }
3197
3439
  if ((_a = this.refs.input) === null || _a === void 0 ? void 0 : _a.length) {
3198
- const focusingInput = typeof index === 'number' && this.refs.input[index]
3199
- ? this.refs.input[index]
3200
- : this.refs.input[this.refs.input.length - 1];
3440
+ const focusingInput = this.refs.input[index];
3201
3441
  if (((_b = this.component.widget) === null || _b === void 0 ? void 0 : _b.type) === 'calendar') {
3202
3442
  const sibling = focusingInput.nextSibling;
3203
3443
  if (sibling) {
@@ -3217,6 +3457,7 @@ class Component extends Element_1.default {
3217
3457
  }
3218
3458
  /**
3219
3459
  * Get `Formio` instance for working with files
3460
+ * @returns {import('@formio/core').Formio} - The Formio instance file service.
3220
3461
  */
3221
3462
  get fileService() {
3222
3463
  if (this.options.fileService) {