@formio/js 5.0.0-dev.5633.8d2b30d → 5.0.0-dev.5633.fde3bc9

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 (493) hide show
  1. package/Changelog.md +47 -2
  2. package/dist/formio.builder.css +8 -8
  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 +8 -8
  8. package/dist/formio.form.js +615 -1196
  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 +8 -8
  13. package/dist/formio.full.js +659 -920
  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 +183 -143
  40. package/lib/cjs/Webform.js +310 -298
  41. package/lib/cjs/WebformBuilder.d.ts +16 -14
  42. package/lib/cjs/WebformBuilder.js +11 -10
  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 +507 -276
  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 +438 -196
  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/component/fixtures/comp6.d.ts +77 -0
  58. package/lib/cjs/components/_classes/component/fixtures/comp6.js +59 -0
  59. package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
  60. package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
  61. package/lib/cjs/components/_classes/field/Field.d.ts +11 -2
  62. package/lib/cjs/components/_classes/field/Field.js +13 -1
  63. package/lib/cjs/components/_classes/input/Input.d.ts +4 -3
  64. package/lib/cjs/components/_classes/input/Input.js +8 -6
  65. package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
  66. package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +6 -3
  67. package/lib/cjs/components/_classes/list/ListComponent.form.js +5 -0
  68. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +43 -12
  69. package/lib/cjs/components/_classes/multivalue/Multivalue.js +37 -3
  70. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +163 -67
  71. package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +6 -3
  72. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +5 -0
  73. package/lib/cjs/components/_classes/nested/NestedComponent.js +175 -54
  74. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
  75. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  76. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +7 -1
  77. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +2 -3
  78. package/lib/cjs/components/address/Address.d.ts +4 -2
  79. package/lib/cjs/components/address/Address.form.d.ts +6 -3
  80. package/lib/cjs/components/address/Address.form.js +5 -0
  81. package/lib/cjs/components/button/Button.d.ts +3 -12
  82. package/lib/cjs/components/button/Button.form.d.ts +6 -3
  83. package/lib/cjs/components/button/Button.form.js +5 -0
  84. package/lib/cjs/components/button/Button.js +5 -0
  85. package/lib/cjs/components/checkbox/Checkbox.d.ts +4 -27
  86. package/lib/cjs/components/checkbox/Checkbox.form.d.ts +6 -3
  87. package/lib/cjs/components/checkbox/Checkbox.form.js +5 -0
  88. package/lib/cjs/components/columns/Columns.d.ts +3 -2
  89. package/lib/cjs/components/columns/Columns.form.d.ts +6 -3
  90. package/lib/cjs/components/columns/Columns.form.js +5 -0
  91. package/lib/cjs/components/columns/Columns.js +1 -1
  92. package/lib/cjs/components/container/Container.form.d.ts +6 -3
  93. package/lib/cjs/components/container/Container.form.js +5 -0
  94. package/lib/cjs/components/content/Content.d.ts +2 -1
  95. package/lib/cjs/components/content/Content.form.d.ts +6 -3
  96. package/lib/cjs/components/content/Content.form.js +5 -0
  97. package/lib/cjs/components/currency/Currency.form.d.ts +6 -3
  98. package/lib/cjs/components/currency/Currency.form.js +5 -0
  99. package/lib/cjs/components/currency/Currency.js +1 -2
  100. package/lib/cjs/components/datagrid/DataGrid.d.ts +8 -7
  101. package/lib/cjs/components/datagrid/DataGrid.form.d.ts +6 -3
  102. package/lib/cjs/components/datagrid/DataGrid.form.js +5 -0
  103. package/lib/cjs/components/datagrid/DataGrid.js +5 -5
  104. package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
  105. package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.js +36 -0
  106. package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
  107. package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
  108. package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
  109. package/lib/cjs/components/datamap/DataMap.form.d.ts +6 -3
  110. package/lib/cjs/components/datamap/DataMap.form.js +5 -0
  111. package/lib/cjs/components/datetime/DateTime.d.ts +0 -14
  112. package/lib/cjs/components/datetime/DateTime.form.d.ts +6 -3
  113. package/lib/cjs/components/datetime/DateTime.form.js +5 -0
  114. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
  115. package/lib/cjs/components/day/Day.d.ts +23 -49
  116. package/lib/cjs/components/day/Day.form.d.ts +6 -3
  117. package/lib/cjs/components/day/Day.form.js +5 -0
  118. package/lib/cjs/components/day/Day.js +16 -21
  119. package/lib/cjs/components/day/fixtures/comp7.d.ts +109 -0
  120. package/lib/cjs/components/day/fixtures/comp7.js +109 -0
  121. package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
  122. package/lib/cjs/components/day/fixtures/index.js +3 -1
  123. package/lib/cjs/components/editgrid/EditGrid.d.ts +7 -3
  124. package/lib/cjs/components/editgrid/EditGrid.form.d.ts +6 -3
  125. package/lib/cjs/components/editgrid/EditGrid.form.js +5 -0
  126. package/lib/cjs/components/editgrid/EditGrid.js +3 -3
  127. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +2 -5
  128. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +6 -9
  129. package/lib/cjs/components/email/Email.form.d.ts +6 -3
  130. package/lib/cjs/components/email/Email.form.js +5 -0
  131. package/lib/cjs/components/fieldset/Fieldset.form.d.ts +6 -3
  132. package/lib/cjs/components/fieldset/Fieldset.form.js +5 -0
  133. package/lib/cjs/components/file/File.d.ts +9 -22
  134. package/lib/cjs/components/file/File.form.d.ts +6 -3
  135. package/lib/cjs/components/file/File.form.js +5 -0
  136. package/lib/cjs/components/file/File.js +1 -2
  137. package/lib/cjs/components/form/Form.d.ts +34 -24
  138. package/lib/cjs/components/form/Form.form.d.ts +6 -3
  139. package/lib/cjs/components/form/Form.form.js +5 -0
  140. package/lib/cjs/components/form/Form.js +15 -13
  141. package/lib/cjs/components/hidden/Hidden.d.ts +1 -11
  142. package/lib/cjs/components/hidden/Hidden.form.d.ts +6 -3
  143. package/lib/cjs/components/hidden/Hidden.form.js +5 -0
  144. package/lib/cjs/components/hidden/Hidden.js +1 -2
  145. package/lib/cjs/components/html/HTML.d.ts +2 -1
  146. package/lib/cjs/components/html/HTML.form.d.ts +6 -3
  147. package/lib/cjs/components/html/HTML.form.js +5 -0
  148. package/lib/cjs/components/number/Number.d.ts +3 -17
  149. package/lib/cjs/components/number/Number.form.d.ts +6 -3
  150. package/lib/cjs/components/number/Number.form.js +5 -0
  151. package/lib/cjs/components/number/Number.js +1 -2
  152. package/lib/cjs/components/panel/Panel.form.d.ts +6 -3
  153. package/lib/cjs/components/panel/Panel.form.js +5 -0
  154. package/lib/cjs/components/panel/Panel.js +0 -1
  155. package/lib/cjs/components/password/Password.form.d.ts +6 -3
  156. package/lib/cjs/components/password/Password.form.js +5 -0
  157. package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +6 -3
  158. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +5 -0
  159. package/lib/cjs/components/radio/Radio.d.ts +3 -26
  160. package/lib/cjs/components/radio/Radio.form.d.ts +6 -3
  161. package/lib/cjs/components/radio/Radio.form.js +5 -0
  162. package/lib/cjs/components/radio/Radio.js +6 -6
  163. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  164. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
  165. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +5 -0
  166. package/lib/cjs/components/select/Select.d.ts +16 -39
  167. package/lib/cjs/components/select/Select.form.d.ts +6 -3
  168. package/lib/cjs/components/select/Select.form.js +5 -0
  169. package/lib/cjs/components/select/Select.js +13 -16
  170. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +2 -17
  171. package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +6 -3
  172. package/lib/cjs/components/selectboxes/SelectBoxes.form.js +5 -0
  173. package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -9
  174. package/lib/cjs/components/signature/Signature.d.ts +0 -14
  175. package/lib/cjs/components/signature/Signature.form.d.ts +6 -3
  176. package/lib/cjs/components/signature/Signature.form.js +5 -0
  177. package/lib/cjs/components/survey/Survey.d.ts +3 -15
  178. package/lib/cjs/components/survey/Survey.form.d.ts +6 -3
  179. package/lib/cjs/components/survey/Survey.form.js +5 -0
  180. package/lib/cjs/components/table/Table.d.ts +2 -1
  181. package/lib/cjs/components/table/Table.form.d.ts +6 -3
  182. package/lib/cjs/components/table/Table.form.js +5 -0
  183. package/lib/cjs/components/tabs/Tabs.d.ts +4 -4
  184. package/lib/cjs/components/tabs/Tabs.form.d.ts +6 -3
  185. package/lib/cjs/components/tabs/Tabs.form.js +5 -0
  186. package/lib/cjs/components/tabs/Tabs.js +1 -2
  187. package/lib/cjs/components/tags/Tags.d.ts +0 -14
  188. package/lib/cjs/components/tags/Tags.form.d.ts +6 -3
  189. package/lib/cjs/components/tags/Tags.form.js +5 -0
  190. package/lib/cjs/components/textarea/TextArea.d.ts +4 -9
  191. package/lib/cjs/components/textarea/TextArea.form.d.ts +6 -3
  192. package/lib/cjs/components/textarea/TextArea.form.js +5 -0
  193. package/lib/cjs/components/textarea/TextArea.js +2 -2
  194. package/lib/cjs/components/textfield/TextField.d.ts +14 -30
  195. package/lib/cjs/components/textfield/TextField.form.d.ts +6 -3
  196. package/lib/cjs/components/textfield/TextField.form.js +5 -0
  197. package/lib/cjs/components/textfield/TextField.js +16 -17
  198. package/lib/cjs/components/time/Time.form.d.ts +6 -3
  199. package/lib/cjs/components/time/Time.form.js +5 -0
  200. package/lib/cjs/components/unknown/Unknown.form.d.ts +5 -34
  201. package/lib/cjs/components/unknown/Unknown.form.js +4 -0
  202. package/lib/cjs/components/url/Url.form.d.ts +6 -3
  203. package/lib/cjs/components/url/Url.form.js +5 -0
  204. package/lib/cjs/components/well/Well.form.d.ts +6 -3
  205. package/lib/cjs/components/well/Well.form.js +5 -0
  206. package/lib/cjs/formio.embed.d.ts +1 -2
  207. package/lib/cjs/formio.embed.js +2 -100
  208. package/lib/cjs/formio.form.d.ts +11 -4
  209. package/lib/cjs/formio.form.js +13 -5
  210. package/lib/cjs/providers/Providers.d.ts +36 -5
  211. package/lib/cjs/providers/Providers.js +29 -0
  212. package/lib/cjs/providers/address/AddressProvider.d.ts +131 -12
  213. package/lib/cjs/providers/address/AddressProvider.js +88 -2
  214. package/lib/cjs/providers/address/AzureAddressProvider.d.ts +48 -1
  215. package/lib/cjs/providers/address/AzureAddressProvider.js +37 -0
  216. package/lib/cjs/providers/address/CustomAddressProvider.d.ts +27 -4
  217. package/lib/cjs/providers/address/CustomAddressProvider.js +34 -0
  218. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +130 -6
  219. package/lib/cjs/providers/address/GoogleAddressProvider.js +73 -1
  220. package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +32 -7
  221. package/lib/cjs/providers/address/NominatimAddressProvider.js +33 -0
  222. package/lib/cjs/providers/address/index.d.ts +3 -1
  223. package/lib/cjs/providers/processor/fileProcessor.d.ts +7 -1
  224. package/lib/cjs/providers/processor/fileProcessor.js +6 -0
  225. package/lib/cjs/providers/storage/azure.d.ts +6 -13
  226. package/lib/cjs/providers/storage/azure.js +5 -0
  227. package/lib/cjs/providers/storage/base64.d.ts +5 -6
  228. package/lib/cjs/providers/storage/base64.js +4 -0
  229. package/lib/cjs/providers/storage/dropbox.d.ts +6 -4
  230. package/lib/cjs/providers/storage/dropbox.js +5 -0
  231. package/lib/cjs/providers/storage/googleDrive.d.ts +7 -5
  232. package/lib/cjs/providers/storage/googleDrive.js +6 -0
  233. package/lib/cjs/providers/storage/indexeddb.d.ts +5 -7
  234. package/lib/cjs/providers/storage/indexeddb.js +4 -0
  235. package/lib/cjs/providers/storage/s3.d.ts +6 -20
  236. package/lib/cjs/providers/storage/s3.js +5 -0
  237. package/lib/cjs/providers/storage/url.d.ts +6 -7
  238. package/lib/cjs/providers/storage/url.js +10 -0
  239. package/lib/cjs/providers/storage/util.d.ts +24 -1
  240. package/lib/cjs/providers/storage/util.js +18 -0
  241. package/lib/cjs/templates/Templates.d.ts +1 -0
  242. package/lib/cjs/translations/en.d.ts +2 -0
  243. package/lib/cjs/translations/en.js +3 -1
  244. package/lib/cjs/utils/ChoicesWrapper.d.ts +1 -1
  245. package/lib/cjs/utils/ChoicesWrapper.js +13 -2
  246. package/lib/cjs/utils/Evaluator.d.ts +6 -3
  247. package/lib/cjs/utils/Evaluator.js +11 -20
  248. package/lib/cjs/utils/builder.d.ts +9 -7
  249. package/lib/cjs/utils/builder.js +10 -5
  250. package/lib/cjs/utils/calendarUtils.d.ts +7 -13
  251. package/lib/cjs/utils/calendarUtils.js +10 -17
  252. package/lib/cjs/utils/formUtils.d.ts +43 -171
  253. package/lib/cjs/utils/formUtils.js +38 -569
  254. package/lib/cjs/utils/utils.d.ts +367 -221
  255. package/lib/cjs/utils/utils.js +335 -228
  256. package/lib/cjs/widgets/CalendarWidget.d.ts +9 -10
  257. package/lib/cjs/widgets/CalendarWidget.js +9 -11
  258. package/lib/mjs/CDN.d.ts +1 -0
  259. package/lib/mjs/CDN.js +6 -3
  260. package/lib/mjs/Element.d.ts +86 -96
  261. package/lib/mjs/Element.js +68 -78
  262. package/lib/mjs/Embed.d.ts +1 -1
  263. package/lib/mjs/Embed.js +52 -12
  264. package/lib/mjs/Form.d.ts +365 -36
  265. package/lib/mjs/Form.js +140 -57
  266. package/lib/mjs/FormBuilder.d.ts +187 -2
  267. package/lib/mjs/FormBuilder.js +32 -8
  268. package/lib/mjs/InlineEmbed.d.ts +7 -0
  269. package/lib/mjs/InlineEmbed.js +112 -0
  270. package/lib/mjs/PDF.d.ts +11 -13
  271. package/lib/mjs/PDF.js +6 -8
  272. package/lib/mjs/Webform.d.ts +183 -143
  273. package/lib/mjs/Webform.js +322 -310
  274. package/lib/mjs/WebformBuilder.d.ts +16 -14
  275. package/lib/mjs/WebformBuilder.js +11 -10
  276. package/lib/mjs/Wizard.d.ts +31 -21
  277. package/lib/mjs/Wizard.js +42 -19
  278. package/lib/mjs/WizardBuilder.d.ts +1 -1
  279. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -5
  280. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -3
  281. package/lib/mjs/components/Components.d.ts +4 -4
  282. package/lib/mjs/components/Components.js +3 -3
  283. package/lib/mjs/components/_classes/component/Component.d.ts +507 -276
  284. package/lib/mjs/components/_classes/component/Component.form.d.ts +6 -3
  285. package/lib/mjs/components/_classes/component/Component.form.js +5 -0
  286. package/lib/mjs/components/_classes/component/Component.js +438 -196
  287. package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +0 -8
  288. package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -1
  289. package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
  290. package/lib/mjs/components/_classes/component/fixtures/comp6.d.ts +77 -0
  291. package/lib/mjs/components/_classes/component/fixtures/comp6.js +57 -0
  292. package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
  293. package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
  294. package/lib/mjs/components/_classes/field/Field.d.ts +11 -2
  295. package/lib/mjs/components/_classes/field/Field.js +13 -1
  296. package/lib/mjs/components/_classes/input/Input.d.ts +4 -3
  297. package/lib/mjs/components/_classes/input/Input.js +8 -6
  298. package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
  299. package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +6 -3
  300. package/lib/mjs/components/_classes/list/ListComponent.form.js +5 -0
  301. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +43 -12
  302. package/lib/mjs/components/_classes/multivalue/Multivalue.js +37 -3
  303. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +163 -67
  304. package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +6 -3
  305. package/lib/mjs/components/_classes/nested/NestedComponent.form.js +5 -0
  306. package/lib/mjs/components/_classes/nested/NestedComponent.js +175 -54
  307. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
  308. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  309. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +7 -1
  310. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +2 -3
  311. package/lib/mjs/components/address/Address.d.ts +4 -2
  312. package/lib/mjs/components/address/Address.form.d.ts +6 -3
  313. package/lib/mjs/components/address/Address.form.js +5 -0
  314. package/lib/mjs/components/button/Button.d.ts +3 -12
  315. package/lib/mjs/components/button/Button.form.d.ts +6 -3
  316. package/lib/mjs/components/button/Button.form.js +5 -0
  317. package/lib/mjs/components/button/Button.js +5 -0
  318. package/lib/mjs/components/checkbox/Checkbox.d.ts +4 -27
  319. package/lib/mjs/components/checkbox/Checkbox.form.d.ts +6 -3
  320. package/lib/mjs/components/checkbox/Checkbox.form.js +5 -0
  321. package/lib/mjs/components/columns/Columns.d.ts +3 -2
  322. package/lib/mjs/components/columns/Columns.form.d.ts +6 -3
  323. package/lib/mjs/components/columns/Columns.form.js +5 -0
  324. package/lib/mjs/components/columns/Columns.js +1 -1
  325. package/lib/mjs/components/container/Container.form.d.ts +6 -3
  326. package/lib/mjs/components/container/Container.form.js +5 -0
  327. package/lib/mjs/components/content/Content.d.ts +2 -1
  328. package/lib/mjs/components/content/Content.form.d.ts +6 -3
  329. package/lib/mjs/components/content/Content.form.js +5 -0
  330. package/lib/mjs/components/currency/Currency.form.d.ts +6 -3
  331. package/lib/mjs/components/currency/Currency.form.js +5 -0
  332. package/lib/mjs/components/currency/Currency.js +1 -2
  333. package/lib/mjs/components/datagrid/DataGrid.d.ts +8 -7
  334. package/lib/mjs/components/datagrid/DataGrid.form.d.ts +6 -3
  335. package/lib/mjs/components/datagrid/DataGrid.form.js +5 -0
  336. package/lib/mjs/components/datagrid/DataGrid.js +5 -5
  337. package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
  338. package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.js +34 -0
  339. package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
  340. package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
  341. package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
  342. package/lib/mjs/components/datamap/DataMap.form.d.ts +6 -3
  343. package/lib/mjs/components/datamap/DataMap.form.js +5 -0
  344. package/lib/mjs/components/datetime/DateTime.d.ts +0 -14
  345. package/lib/mjs/components/datetime/DateTime.form.d.ts +6 -3
  346. package/lib/mjs/components/datetime/DateTime.form.js +5 -0
  347. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
  348. package/lib/mjs/components/day/Day.d.ts +23 -49
  349. package/lib/mjs/components/day/Day.form.d.ts +6 -3
  350. package/lib/mjs/components/day/Day.form.js +5 -0
  351. package/lib/mjs/components/day/Day.js +16 -21
  352. package/lib/mjs/components/day/fixtures/comp7.d.ts +109 -0
  353. package/lib/mjs/components/day/fixtures/comp7.js +107 -0
  354. package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
  355. package/lib/mjs/components/day/fixtures/index.js +2 -1
  356. package/lib/mjs/components/editgrid/EditGrid.d.ts +7 -3
  357. package/lib/mjs/components/editgrid/EditGrid.form.d.ts +6 -3
  358. package/lib/mjs/components/editgrid/EditGrid.form.js +5 -0
  359. package/lib/mjs/components/editgrid/EditGrid.js +3 -3
  360. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  361. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +1 -1
  362. package/lib/mjs/components/email/Email.form.d.ts +6 -3
  363. package/lib/mjs/components/email/Email.form.js +5 -0
  364. package/lib/mjs/components/fieldset/Fieldset.form.d.ts +6 -3
  365. package/lib/mjs/components/fieldset/Fieldset.form.js +5 -0
  366. package/lib/mjs/components/file/File.d.ts +9 -22
  367. package/lib/mjs/components/file/File.form.d.ts +6 -3
  368. package/lib/mjs/components/file/File.form.js +5 -0
  369. package/lib/mjs/components/file/File.js +1 -2
  370. package/lib/mjs/components/form/Form.d.ts +34 -24
  371. package/lib/mjs/components/form/Form.form.d.ts +6 -3
  372. package/lib/mjs/components/form/Form.form.js +5 -0
  373. package/lib/mjs/components/form/Form.js +15 -13
  374. package/lib/mjs/components/hidden/Hidden.d.ts +1 -11
  375. package/lib/mjs/components/hidden/Hidden.form.d.ts +6 -3
  376. package/lib/mjs/components/hidden/Hidden.form.js +5 -0
  377. package/lib/mjs/components/hidden/Hidden.js +1 -2
  378. package/lib/mjs/components/html/HTML.d.ts +2 -1
  379. package/lib/mjs/components/html/HTML.form.d.ts +6 -3
  380. package/lib/mjs/components/html/HTML.form.js +5 -0
  381. package/lib/mjs/components/number/Number.d.ts +3 -17
  382. package/lib/mjs/components/number/Number.form.d.ts +6 -3
  383. package/lib/mjs/components/number/Number.form.js +5 -0
  384. package/lib/mjs/components/number/Number.js +1 -2
  385. package/lib/mjs/components/panel/Panel.form.d.ts +6 -3
  386. package/lib/mjs/components/panel/Panel.form.js +5 -0
  387. package/lib/mjs/components/panel/Panel.js +0 -1
  388. package/lib/mjs/components/password/Password.form.d.ts +6 -3
  389. package/lib/mjs/components/password/Password.form.js +5 -0
  390. package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +6 -3
  391. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +5 -0
  392. package/lib/mjs/components/radio/Radio.d.ts +3 -26
  393. package/lib/mjs/components/radio/Radio.form.d.ts +6 -3
  394. package/lib/mjs/components/radio/Radio.form.js +5 -0
  395. package/lib/mjs/components/radio/Radio.js +6 -6
  396. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  397. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
  398. package/lib/mjs/components/recaptcha/ReCaptcha.form.js +5 -0
  399. package/lib/mjs/components/select/Select.d.ts +16 -39
  400. package/lib/mjs/components/select/Select.form.d.ts +6 -3
  401. package/lib/mjs/components/select/Select.form.js +5 -0
  402. package/lib/mjs/components/select/Select.js +14 -17
  403. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +2 -17
  404. package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +6 -3
  405. package/lib/mjs/components/selectboxes/SelectBoxes.form.js +5 -0
  406. package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -9
  407. package/lib/mjs/components/signature/Signature.d.ts +0 -14
  408. package/lib/mjs/components/signature/Signature.form.d.ts +6 -3
  409. package/lib/mjs/components/signature/Signature.form.js +5 -0
  410. package/lib/mjs/components/survey/Survey.d.ts +3 -15
  411. package/lib/mjs/components/survey/Survey.form.d.ts +6 -3
  412. package/lib/mjs/components/survey/Survey.form.js +5 -0
  413. package/lib/mjs/components/table/Table.d.ts +2 -1
  414. package/lib/mjs/components/table/Table.form.d.ts +6 -3
  415. package/lib/mjs/components/table/Table.form.js +5 -0
  416. package/lib/mjs/components/tabs/Tabs.d.ts +4 -4
  417. package/lib/mjs/components/tabs/Tabs.form.d.ts +6 -3
  418. package/lib/mjs/components/tabs/Tabs.form.js +5 -0
  419. package/lib/mjs/components/tabs/Tabs.js +1 -2
  420. package/lib/mjs/components/tags/Tags.d.ts +0 -14
  421. package/lib/mjs/components/tags/Tags.form.d.ts +6 -3
  422. package/lib/mjs/components/tags/Tags.form.js +5 -0
  423. package/lib/mjs/components/textarea/TextArea.d.ts +4 -9
  424. package/lib/mjs/components/textarea/TextArea.form.d.ts +6 -3
  425. package/lib/mjs/components/textarea/TextArea.form.js +5 -0
  426. package/lib/mjs/components/textarea/TextArea.js +2 -2
  427. package/lib/mjs/components/textfield/TextField.d.ts +14 -30
  428. package/lib/mjs/components/textfield/TextField.form.d.ts +6 -3
  429. package/lib/mjs/components/textfield/TextField.form.js +5 -0
  430. package/lib/mjs/components/textfield/TextField.js +16 -17
  431. package/lib/mjs/components/time/Time.form.d.ts +6 -3
  432. package/lib/mjs/components/time/Time.form.js +5 -0
  433. package/lib/mjs/components/unknown/Unknown.form.d.ts +5 -34
  434. package/lib/mjs/components/unknown/Unknown.form.js +4 -0
  435. package/lib/mjs/components/url/Url.form.d.ts +6 -3
  436. package/lib/mjs/components/url/Url.form.js +5 -0
  437. package/lib/mjs/components/well/Well.form.d.ts +6 -3
  438. package/lib/mjs/components/well/Well.form.js +5 -0
  439. package/lib/mjs/formio.embed.d.ts +1 -2
  440. package/lib/mjs/formio.embed.js +2 -99
  441. package/lib/mjs/formio.form.d.ts +11 -4
  442. package/lib/mjs/formio.form.js +10 -3
  443. package/lib/mjs/providers/Providers.d.ts +36 -5
  444. package/lib/mjs/providers/Providers.js +29 -0
  445. package/lib/mjs/providers/address/AddressProvider.d.ts +131 -12
  446. package/lib/mjs/providers/address/AddressProvider.js +88 -2
  447. package/lib/mjs/providers/address/AzureAddressProvider.d.ts +48 -1
  448. package/lib/mjs/providers/address/AzureAddressProvider.js +37 -0
  449. package/lib/mjs/providers/address/CustomAddressProvider.d.ts +27 -4
  450. package/lib/mjs/providers/address/CustomAddressProvider.js +34 -0
  451. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +130 -6
  452. package/lib/mjs/providers/address/GoogleAddressProvider.js +73 -1
  453. package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +32 -7
  454. package/lib/mjs/providers/address/NominatimAddressProvider.js +33 -0
  455. package/lib/mjs/providers/address/index.d.ts +3 -1
  456. package/lib/mjs/providers/processor/fileProcessor.d.ts +7 -1
  457. package/lib/mjs/providers/processor/fileProcessor.js +6 -0
  458. package/lib/mjs/providers/storage/azure.d.ts +6 -13
  459. package/lib/mjs/providers/storage/azure.js +5 -0
  460. package/lib/mjs/providers/storage/base64.d.ts +5 -6
  461. package/lib/mjs/providers/storage/base64.js +4 -0
  462. package/lib/mjs/providers/storage/dropbox.d.ts +6 -4
  463. package/lib/mjs/providers/storage/dropbox.js +5 -0
  464. package/lib/mjs/providers/storage/googleDrive.d.ts +7 -5
  465. package/lib/mjs/providers/storage/googleDrive.js +6 -0
  466. package/lib/mjs/providers/storage/indexeddb.d.ts +5 -7
  467. package/lib/mjs/providers/storage/indexeddb.js +4 -0
  468. package/lib/mjs/providers/storage/s3.d.ts +6 -20
  469. package/lib/mjs/providers/storage/s3.js +5 -0
  470. package/lib/mjs/providers/storage/url.d.ts +6 -7
  471. package/lib/mjs/providers/storage/url.js +10 -0
  472. package/lib/mjs/providers/storage/util.d.ts +24 -1
  473. package/lib/mjs/providers/storage/util.js +18 -0
  474. package/lib/mjs/templates/Templates.d.ts +1 -0
  475. package/lib/mjs/translations/en.d.ts +2 -0
  476. package/lib/mjs/translations/en.js +3 -1
  477. package/lib/mjs/utils/ChoicesWrapper.d.ts +1 -1
  478. package/lib/mjs/utils/ChoicesWrapper.js +13 -2
  479. package/lib/mjs/utils/Evaluator.d.ts +6 -3
  480. package/lib/mjs/utils/Evaluator.js +9 -20
  481. package/lib/mjs/utils/builder.d.ts +9 -7
  482. package/lib/mjs/utils/builder.js +10 -5
  483. package/lib/mjs/utils/calendarUtils.d.ts +7 -13
  484. package/lib/mjs/utils/calendarUtils.js +10 -17
  485. package/lib/mjs/utils/formUtils.d.ts +43 -171
  486. package/lib/mjs/utils/formUtils.js +6 -554
  487. package/lib/mjs/utils/utils.d.ts +367 -221
  488. package/lib/mjs/utils/utils.js +329 -222
  489. package/lib/mjs/widgets/CalendarWidget.d.ts +9 -10
  490. package/lib/mjs/widgets/CalendarWidget.js +9 -11
  491. package/package.json +22 -22
  492. package/sdk.d.ts +1 -0
  493. package/utils.d.ts +1 -0
@@ -41,21 +41,18 @@ export default class Element {
41
41
  this.options.i18next = this.i18next = this.options.i18next || I18n.init(this.options.i18n);
42
42
  /**
43
43
  * An instance of the EventEmitter class to handle the emitting and registration of events.
44
- *
45
44
  * @type {EventEmitter}
46
45
  */
47
46
  this.events = (options && options.events) ? options.events : new EventEmitter();
48
47
  this.defaultMask = null;
49
48
  /**
50
49
  * Conditional to show or hide helplinks in editForm
51
- *
52
50
  * @type {*|boolean}
53
51
  */
54
52
  this.helplinks = (this.options.helplinks === 'false') ? false : (this.options.helplinks || 'https://help.form.io');
55
53
  }
56
54
  /**
57
55
  * Register for a new event within this component.
58
- *
59
56
  * @example
60
57
  * let component = new BaseComponent({
61
58
  * type: 'textfield',
@@ -65,12 +62,11 @@ export default class Element {
65
62
  * component.on('componentChange', (changed) => {
66
63
  * console.log('this element is changed.');
67
64
  * });
68
- *
69
- *
70
65
  * @param {string} event - The event you wish to register the handler for.
71
- * @param {function} cb - The callback handler to handle this event.
66
+ * @param {Function} cb - The callback handler to handle this event.
72
67
  * @param {boolean} [internal] - This is an internal event handler.
73
68
  * @param {boolean} [once] - This event should only fire once.
69
+ * @returns {EventEmitter | void} - The event emitter instance.
74
70
  */
75
71
  on(event, cb, internal, once = false) {
76
72
  if (!this.events) {
@@ -86,18 +82,18 @@ export default class Element {
86
82
  }
87
83
  /**
88
84
  * Register for a new single-fire event within this component.
89
- *
90
85
  * @param {string} event - The event you wish to register the handler for.
91
- * @param {function} cb - The callback handler to handle this event.
86
+ * @param {Function} cb - The callback handler to handle this event.
87
+ * @param {boolean} internal - This is an internal event handler.
88
+ * @returns {EventEmitter} - The event emitter instance.
92
89
  */
93
90
  once(event, cb, internal) {
94
91
  return this.on(event, cb, internal, true);
95
92
  }
96
93
  /**
97
94
  * Allow catching any event.
98
- *
99
- * @param cb
100
- * @returns {this}
95
+ * @param {Function} cb - The callback handler to handle this event.
96
+ * @returns {EventEmitter | void} - The event emitter instance.
101
97
  */
102
98
  onAny(cb) {
103
99
  if (!this.events) {
@@ -107,9 +103,8 @@ export default class Element {
107
103
  }
108
104
  /**
109
105
  * Removes the listener that will be fired when any event is emitted.
110
- *
111
- * @param cb
112
- * @returns {this}
106
+ * @param {Function} cb - The callback handler to handle this event.
107
+ * @returns {EventEmitter | void} - The event emitter instance.
113
108
  */
114
109
  offAny(cb) {
115
110
  if (!this.events) {
@@ -119,9 +114,8 @@ export default class Element {
119
114
  }
120
115
  /**
121
116
  * Removes a listener for a certain event. Not passing the 2nd arg will remove all listeners for that event.
122
- *
123
117
  * @param {string} event - The event you wish to register the handler for.
124
- * @param {function|undefined} cb - The callback handler to handle this event.
118
+ * @param {Function | undefined} cb - The callback handler to handle this event.
125
119
  */
126
120
  off(event, cb) {
127
121
  if (!this.events) {
@@ -142,9 +136,8 @@ export default class Element {
142
136
  }
143
137
  /**
144
138
  * Emit a new event.
145
- *
146
139
  * @param {string} event - The event to emit.
147
- * @param {Object} data - The data to emit with the handler.
140
+ * @param {object} data - The data to emit with the handler.
148
141
  */
149
142
  emit(event, ...data) {
150
143
  if (this.events) {
@@ -153,9 +146,8 @@ export default class Element {
153
146
  }
154
147
  /**
155
148
  * Check if the component has an event handler set up for the event.
156
- *
157
149
  * @param {string} event - The event name.
158
- * @returns {boolean}
150
+ * @returns {boolean} - TRUE if the event is registered, FALSE otherwise.
159
151
  */
160
152
  hasEventHandler(event) {
161
153
  if (!this.events) {
@@ -171,15 +163,12 @@ export default class Element {
171
163
  }
172
164
  /**
173
165
  * Wrapper method to add an event listener to an HTML element.
174
- *
175
- * @param obj
176
- * The DOM element to add the event to.
177
- * @param type
178
- * The event name to add.
179
- * @param func
180
- * The callback function to be executed when the listener is triggered.
181
- * @param persistent
182
- * If this listener should persist beyond "destroy" commands.
166
+ * @param {HtmlElement} obj - The DOM element to add the event to.
167
+ * @param {string} type - The event name to add.
168
+ * @param {Function} func - The callback function to be executed when the listener is triggered.
169
+ * @param {boolean} persistent - If this listener should persist beyond "destroy" commands.
170
+ * @param {boolean} capture - If this listener should be executed in the capture phase.
171
+ * @returns {void | this} - The instance of the element.
183
172
  */
184
173
  addEventListener(obj, type, func, persistent, capture) {
185
174
  if (!obj) {
@@ -198,9 +187,10 @@ export default class Element {
198
187
  }
199
188
  /**
200
189
  * Remove an event listener from the object.
201
- *
202
- * @param obj
203
- * @param type
190
+ * @param {HTMLElement} obj - The DOM element to remove the event from.
191
+ * @param {string} type - The event name to remove.
192
+ * @param {Function} func - The callback function to remove.
193
+ * @returns {this | void} - The instance of the element.
204
194
  */
205
195
  removeEventListener(obj, type, func = null) {
206
196
  const indexes = [];
@@ -246,6 +236,7 @@ export default class Element {
246
236
  }
247
237
  /**
248
238
  * Removes all event listeners attached to this component.
239
+ * @param {boolean} all - If all events should be removed, including external events.
249
240
  */
250
241
  destroy(all = false) {
251
242
  this.removeEventListeners();
@@ -256,9 +247,9 @@ export default class Element {
256
247
  }
257
248
  /**
258
249
  * Append an HTML DOM element to a container.
259
- *
260
- * @param element
261
- * @param container
250
+ * @param {HTMLElement} element - The DOM element to append.
251
+ * @param {HTMLElement} container - The DOM element that is the container of the element getting appended.
252
+ * @returns {this} - The instance of the element.
262
253
  */
263
254
  appendTo(element, container) {
264
255
  container?.appendChild(element);
@@ -266,9 +257,9 @@ export default class Element {
266
257
  }
267
258
  /**
268
259
  * Prepend an HTML DOM element to a container.
269
- *
270
260
  * @param {HTMLElement} element - The DOM element to prepend.
271
261
  * @param {HTMLElement} container - The DOM element that is the container of the element getting prepended.
262
+ * @returns {this} - The instance of the element.
272
263
  */
273
264
  prependTo(element, container) {
274
265
  if (container) {
@@ -289,9 +280,9 @@ export default class Element {
289
280
  }
290
281
  /**
291
282
  * Removes an HTML DOM element from its bounding container.
292
- *
293
283
  * @param {HTMLElement} element - The element to remove.
294
284
  * @param {HTMLElement} container - The DOM element that is the container of the element to remove.
285
+ * @returns {this} - The instance of the element.
295
286
  */
296
287
  removeChildFrom(element, container) {
297
288
  if (container && container.contains(element)) {
@@ -306,12 +297,10 @@ export default class Element {
306
297
  }
307
298
  /**
308
299
  * Alias for document.createElement.
309
- *
310
300
  * @param {string} type - The type of element to create
311
- * @param {Object} attr - The element attributes to add to the created element.
301
+ * @param {object} attr - The element attributes to add to the created element.
312
302
  * @param {Various} children - Child elements. Can be a DOM Element, string or array of both.
313
- *
314
- * @return {HTMLElement} - The created element.
303
+ * @returns {HTMLElement} - The created element.
315
304
  */
316
305
  ce(type, attr, children = null) {
317
306
  // console.warn('Call to deprecated this.ce(). Dom elements should be created with templates, not manually with ce.');
@@ -327,8 +316,9 @@ export default class Element {
327
316
  }
328
317
  /**
329
318
  * Append different types of children.
330
- *
331
- * @param child
319
+ * @param {HTMLElement} element - The element to append to.
320
+ * @param {HTMLElement} child - The child element to append.
321
+ * @returns {this} - The instance of the element.
332
322
  */
333
323
  appendChild(element, child) {
334
324
  if (Array.isArray(child)) {
@@ -350,15 +340,18 @@ export default class Element {
350
340
  maskPlaceholder(mask) {
351
341
  return mask.map((char) => (char instanceof RegExp) ? this.placeholderChar : char).join('');
352
342
  }
343
+ /**
344
+ * Get the placeholder character for the input mask.
345
+ * @returns {string} - The placeholder character.
346
+ */
353
347
  get placeholderChar() {
354
348
  return this.component?.inputMaskPlaceholderChar || '_';
355
349
  }
356
350
  /**
357
351
  * Sets the input mask for an input.
358
- *
359
352
  * @param {HTMLElement} input - The html input to apply the mask to.
360
- * @param {String} inputMask - The input mask to add to this input.
361
- * @param {Boolean} usePlaceholder - Set the mask placeholder on the input.
353
+ * @param {string} inputMask - The input mask to add to this input.
354
+ * @param {boolean} usePlaceholder - Set the mask placeholder on the input.
362
355
  */
363
356
  setInputMask(input, inputMask, usePlaceholder) {
364
357
  if (input && inputMask) {
@@ -391,17 +384,17 @@ export default class Element {
391
384
  }
392
385
  /**
393
386
  * Translate a text using the i18n system.
394
- *
395
387
  * @param {string|Array<string>} text - The i18n identifier.
396
- * @param {Object} params - The i18n parameters to use for translation.
388
+ * @param {...any} args - The arguments to pass to the i18n translation.
389
+ * @returns {string} - The translated text.
397
390
  */
398
391
  t(text, ...args) {
399
392
  return this.i18next ? this.i18next.t(text, ...args) : text;
400
393
  }
401
394
  /**
402
395
  * Alias to create a text node.
403
- * @param text
404
- * @returns {Text}
396
+ * @param {string} text - The text to create.
397
+ * @returns {HtmlElement} - The created text node.
405
398
  */
406
399
  text(text) {
407
400
  return document.createTextNode(this.t(text));
@@ -409,7 +402,7 @@ export default class Element {
409
402
  /**
410
403
  * Adds an object of attributes onto an element.
411
404
  * @param {HtmlElement} element - The element to add the attributes to.
412
- * @param {Object} attr - The attributes to add to the input element.
405
+ * @param {object} attr - The attributes to add to the input element.
413
406
  */
414
407
  attr(element, attr) {
415
408
  if (!element) {
@@ -432,6 +425,9 @@ export default class Element {
432
425
  * Determines if an element has a class.
433
426
  *
434
427
  * Taken from jQuery https://j11y.io/jquery/#v=1.5.0&fn=jQuery.fn.hasClass
428
+ * @param {HTMLElement} element - The element to check for the class.
429
+ * @param {string} className - The class to check for.
430
+ * @returns {boolean} - TRUE if the element has the class, FALSE otherwise.
435
431
  */
436
432
  hasClass(element, className) {
437
433
  if (!element) {
@@ -443,11 +439,9 @@ export default class Element {
443
439
  }
444
440
  /**
445
441
  * Adds a class to a DOM element.
446
- *
447
- * @param element
448
- * The element to add a class to.
449
- * @param className
450
- * The name of the class to add.
442
+ * @param {HTMLElement} element - The element to add a class to.
443
+ * @param {string} className - The name of the class to add.
444
+ * @returns {this} - The instance of the element.
451
445
  */
452
446
  addClass(element, className) {
453
447
  if (!element || !(element instanceof HTMLElement)) {
@@ -462,11 +456,9 @@ export default class Element {
462
456
  }
463
457
  /**
464
458
  * Remove a class from a DOM element.
465
- *
466
- * @param element
467
- * The DOM element to remove the class from.
468
- * @param className
469
- * The name of the class that is to be removed.
459
+ * @param {HTMLElement} element - The DOM element to remove the class from.
460
+ * @param {string} className - The name of the class that is to be removed.
461
+ * @returns {this} - The instance of the element.
470
462
  */
471
463
  removeClass(element, className) {
472
464
  if (!element || !className || !(element instanceof HTMLElement)) {
@@ -482,7 +474,6 @@ export default class Element {
482
474
  }
483
475
  /**
484
476
  * Empty's an HTML DOM element.
485
- *
486
477
  * @param {HTMLElement} element - The element you wish to empty.
487
478
  */
488
479
  empty(element) {
@@ -494,9 +485,8 @@ export default class Element {
494
485
  }
495
486
  /**
496
487
  * Create an evaluation context for all script executions and interpolations.
497
- *
498
- * @param additional
499
- * @return {*}
488
+ * @param {object} additional - Additional context to apply to the evaluation context.
489
+ * @returns {*} - The evaluation context.
500
490
  */
501
491
  evalContext(additional) {
502
492
  return Object.assign({
@@ -520,10 +510,10 @@ export default class Element {
520
510
  }
521
511
  /**
522
512
  * Performs an interpolation using the evaluation context of this component.
523
- *
524
- * @param string
525
- * @param data
526
- * @return {XML|string|*|void}
513
+ * @param {string} string - The string to interpolate.
514
+ * @param {object} data - The data to use in the interpolation.
515
+ * @param {object} options - The options to pass to the interpolation.
516
+ * @returns {XML|string|*|void} - The interpolated string.
527
517
  */
528
518
  interpolate(string, data, options = {}) {
529
519
  if (typeof string !== 'function' && (this.component.content || this.component.html)
@@ -539,19 +529,19 @@ export default class Element {
539
529
  }
540
530
  /**
541
531
  * Performs an evaluation using the evaluation context of this component.
542
- *
543
- * @param func
544
- * @param args
545
- * @param ret
546
- * @param tokenize
547
- * @return {*}
532
+ * @param {string|Function|object} func - The function or string to evaluate.
533
+ * @param {object} args - The arguments to pass to the evaluation.
534
+ * @param {string} ret - The name of the variable within the evaluation context to return.
535
+ * @param {boolean} interpolate - Determines if it should replace all {{ }} token references with actual data.
536
+ * @param {import('@formio/core').EvaluatorOptions} options - The options to pass to the evaluation.
537
+ * @returns {*} - The result of the evaluation.
548
538
  */
549
- evaluate(func, args, ret, tokenize) {
550
- return FormioUtils.evaluate(func, this.evalContext(args), ret, tokenize);
539
+ evaluate(func, args, ret, interpolate, options = {}) {
540
+ return FormioUtils.evaluate(func, this.evalContext(args), ret, interpolate, options);
551
541
  }
552
542
  /**
553
543
  * Allow for options to hook into the functionality of this renderer.
554
- * @return {*}
544
+ * @returns {*} - The result of the hook function.
555
545
  */
556
546
  hook() {
557
547
  const name = arguments[0];
@@ -26,7 +26,7 @@ export class Formio {
26
26
  static addStyles(wrapper: any, href: any): Promise<void>;
27
27
  static submitDone(instance: any, submission: any): Promise<void>;
28
28
  static formioScript(script: any, builder: any): any;
29
- static addLibrary(wrapper: any, lib: any, name: any): Promise<void>;
29
+ static addLibrary(libWrapper: any, lib: any, name: any): Promise<void>;
30
30
  static addLoader(wrapper: any): Promise<void>;
31
31
  static init(element: any, options?: {}, builder?: boolean): Promise<any>;
32
32
  static afterCreate(instance: any, wrapper: any, readyEvent: any): Promise<any>;
package/lib/mjs/Embed.js CHANGED
@@ -79,6 +79,9 @@ export class Formio {
79
79
  }
80
80
  static createElement(type, attrs, children) {
81
81
  const element = document.createElement(type);
82
+ if (!attrs) {
83
+ return element;
84
+ }
82
85
  Object.keys(attrs).forEach(key => {
83
86
  element.setAttribute(key, attrs[key]);
84
87
  });
@@ -138,6 +141,9 @@ export class Formio {
138
141
  }
139
142
  static async submitDone(instance, submission) {
140
143
  Formio.debug('Submision Complete', submission);
144
+ if (Formio.config.submitDone) {
145
+ Formio.config.submitDone(submission, instance);
146
+ }
141
147
  const successMessage = (Formio.config.success || '').toString();
142
148
  if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {
143
149
  instance.element.innerHTML = `<div class="alert-success" role="alert">${successMessage}</div>`;
@@ -177,20 +183,21 @@ export class Formio {
177
183
  }
178
184
  return script;
179
185
  }
180
- static async addLibrary(wrapper, lib, name) {
186
+ static async addLibrary(libWrapper, lib, name) {
181
187
  if (!lib) {
182
188
  return;
183
189
  }
184
190
  if (lib.dependencies) {
185
191
  for (let i = 0; i < lib.dependencies.length; i++) {
186
- await Formio.addLibrary(wrapper, Formio.cdn.libs[lib.dependencies[i]]);
192
+ const libName = lib.dependencies[i];
193
+ await Formio.addLibrary(libWrapper, Formio.config.libs[libName], libName);
187
194
  }
188
195
  }
189
196
  if (lib.css) {
190
- await Formio.addStyles(wrapper, lib.css);
197
+ await Formio.addStyles((lib.global ? document.body : libWrapper), lib.css);
191
198
  }
192
199
  if (lib.js) {
193
- const module = await Formio.addScript(wrapper, lib.js, lib.use ? name : false);
200
+ const module = await Formio.addScript((lib.global ? document.body : libWrapper), lib.js, lib.use ? name : false);
194
201
  if (lib.use) {
195
202
  Formio.debug(`Using ${name}`);
196
203
  const options = lib.options || {};
@@ -200,6 +207,12 @@ export class Formio {
200
207
  Formio.use((typeof lib.use === 'function' ? lib.use(module) : module), options);
201
208
  }
202
209
  }
210
+ if (lib.globalStyle) {
211
+ const style = Formio.createElement('style');
212
+ style.type = 'text/css';
213
+ style.innerHTML = lib.globalStyle;
214
+ document.body.appendChild(style);
215
+ }
203
216
  }
204
217
  static async addLoader(wrapper) {
205
218
  wrapper.appendChild(Formio.createElement('div', {
@@ -228,7 +241,16 @@ export class Formio {
228
241
  use: true
229
242
  },
230
243
  fontawesome: {
231
- css: `${Formio.cdn['font-awesome']}/css/font-awesome.min.css`
244
+ // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need
245
+ // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.
246
+ css: `https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css`,
247
+ globalStyle: `@font-face {
248
+ font-family: 'FontAwesome';
249
+ src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');
250
+ src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
251
+ font-weight: normal;
252
+ font-style: normal;
253
+ }`
232
254
  },
233
255
  bootstrap4: {
234
256
  dependencies: ['fontawesome'],
@@ -239,9 +261,24 @@ export class Formio {
239
261
  css: `${Formio.cdn.bootstrap}/css/bootstrap.min.css`
240
262
  },
241
263
  'bootstrap-icons': {
242
- css: `${Formio.cdn['bootstrap-icons']}/css/bootstrap-icons.css`
264
+ // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need
265
+ // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.
266
+ css: 'https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css',
267
+ globalStyle: `@font-face {
268
+ font-display: block;
269
+ font-family: "bootstrap-icons";
270
+ src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6") format("woff2"),
271
+ url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6") format("woff");
272
+ }`
243
273
  }
244
274
  };
275
+ // Add all bootswatch templates.
276
+ ['cerulean', 'cosmo', 'cyborg', 'darkly', 'flatly', 'journal', 'litera', 'lumen', 'lux', 'materia', 'minty', 'pulse', 'sandstone', 'simplex', 'sketchy', 'slate', 'solar', 'spacelab', 'superhero', 'united', 'yeti'].forEach((template) => {
277
+ Formio.config.libs[template] = {
278
+ dependencies: ['bootstrap-icons'],
279
+ css: `${Formio.cdn.bootswatch}/dist/${template}/bootstrap.min.css`
280
+ };
281
+ });
245
282
  const id = Formio.config.id || `formio-${Math.random().toString(36).substring(7)}`;
246
283
  // Create a new wrapper and add the element inside of a new wrapper.
247
284
  let wrapper = Formio.createElement('div', {
@@ -249,7 +286,7 @@ export class Formio {
249
286
  });
250
287
  element.parentNode.insertBefore(wrapper, element);
251
288
  // If we include the libraries, then we will attempt to run this in shadow dom.
252
- const useShadowDom = Formio.config.includeLibs && (typeof wrapper.attachShadow === 'function');
289
+ const useShadowDom = Formio.config.includeLibs && !Formio.config.noshadow && (typeof wrapper.attachShadow === 'function');
253
290
  if (useShadowDom) {
254
291
  wrapper = wrapper.attachShadow({
255
292
  mode: 'open'
@@ -285,14 +322,17 @@ export class Formio {
285
322
  if (Formio.config.template && Formio.config.includeLibs) {
286
323
  await Formio.addLibrary(libWrapper, Formio.config.libs[Formio.config.template], Formio.config.template);
287
324
  }
288
- // Add the premium modules.
325
+ if (!Formio.config.libraries) {
326
+ Formio.config.libraries = Formio.config.modules || {};
327
+ }
328
+ // Adding premium if it is provided via the config.
289
329
  if (Formio.config.premium) {
290
- Formio.config.modules.premium = Formio.config.premium;
330
+ Formio.config.libraries.premium = Formio.config.premium;
291
331
  }
292
332
  // Allow adding dynamic modules.
293
- if (Formio.config.modules) {
294
- for (const name in Formio.config.modules) {
295
- const lib = Formio.config.modules[name];
333
+ if (Formio.config.libraries) {
334
+ for (const name in Formio.config.libraries) {
335
+ const lib = Formio.config.libraries[name];
296
336
  lib.use = lib.use || true;
297
337
  await Formio.addLibrary(libWrapper, lib, name);
298
338
  }