@formio/js 5.0.0-rc.54 → 5.0.0-rc.56

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +563 -563
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +3 -3
  7. package/dist/formio.full.js +606 -606
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +3 -3
  10. package/dist/formio.js +3 -3
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +1 -1
  13. package/dist/formio.utils.js +16 -16
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +3 -3
  16. package/lib/cjs/Element.d.ts +3 -2
  17. package/lib/cjs/Element.js +4 -3
  18. package/lib/cjs/Embed.js +8 -5
  19. package/lib/cjs/Form.d.ts +99 -36
  20. package/lib/cjs/Form.js +23 -18
  21. package/lib/cjs/PDF.d.ts +8 -7
  22. package/lib/cjs/PDF.js +6 -5
  23. package/lib/cjs/Webform.d.ts +1 -4
  24. package/lib/cjs/Webform.js +19 -16
  25. package/lib/cjs/WebformBuilder.d.ts +15 -14
  26. package/lib/cjs/WebformBuilder.js +11 -10
  27. package/lib/cjs/Wizard.d.ts +1 -12
  28. package/lib/cjs/Wizard.js +17 -15
  29. package/lib/cjs/WizardBuilder.d.ts +1 -1
  30. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +2 -2
  31. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.d.ts +2 -2
  32. package/lib/cjs/addons/index.d.ts +2 -2
  33. package/lib/cjs/components/Components.d.ts +6 -5
  34. package/lib/cjs/components/Components.js +2 -1
  35. package/lib/cjs/components/_classes/component/Component.form.d.ts +4 -5
  36. package/lib/cjs/components/_classes/component/Component.form.js +3 -2
  37. package/lib/cjs/components/_classes/component/Component.js +3 -2
  38. package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.d.ts +2 -2
  39. package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.d.ts +1 -1
  40. package/lib/cjs/components/_classes/component/editForm/Component.edit.data.d.ts +1 -1
  41. package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.d.ts +1 -1
  42. package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +2 -2
  43. package/lib/cjs/components/_classes/component/editForm/utils.d.ts +1 -1
  44. package/lib/cjs/components/_classes/component/editForm/utils.js +2 -2
  45. package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
  46. package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +4 -4
  47. package/lib/cjs/components/_classes/list/ListComponent.form.js +3 -3
  48. package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +4 -5
  49. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +3 -2
  50. package/lib/cjs/components/_classes/nested/NestedComponent.js +0 -2
  51. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -1
  52. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
  53. package/lib/cjs/components/address/Address.form.d.ts +4 -5
  54. package/lib/cjs/components/address/Address.form.js +3 -2
  55. package/lib/cjs/components/button/Button.form.d.ts +4 -5
  56. package/lib/cjs/components/button/Button.form.js +3 -2
  57. package/lib/cjs/components/button/Button.js +3 -2
  58. package/lib/cjs/components/checkbox/Checkbox.form.d.ts +4 -5
  59. package/lib/cjs/components/checkbox/Checkbox.form.js +3 -2
  60. package/lib/cjs/components/checkbox/Checkbox.js +2 -9
  61. package/lib/cjs/components/checkbox/fixtures/comp5.d.ts +34 -0
  62. package/lib/cjs/components/checkbox/fixtures/comp5.js +55 -0
  63. package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
  64. package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
  65. package/lib/cjs/components/columns/Columns.d.ts +1 -1
  66. package/lib/cjs/components/columns/Columns.form.d.ts +4 -5
  67. package/lib/cjs/components/columns/Columns.form.js +3 -2
  68. package/lib/cjs/components/columns/Columns.js +1 -1
  69. package/lib/cjs/components/container/Container.form.d.ts +4 -5
  70. package/lib/cjs/components/container/Container.form.js +3 -2
  71. package/lib/cjs/components/content/Content.form.d.ts +4 -5
  72. package/lib/cjs/components/content/Content.form.js +3 -2
  73. package/lib/cjs/components/currency/Currency.form.d.ts +4 -5
  74. package/lib/cjs/components/currency/Currency.form.js +3 -2
  75. package/lib/cjs/components/currency/Currency.js +1 -1
  76. package/lib/cjs/components/datagrid/DataGrid.d.ts +4 -4
  77. package/lib/cjs/components/datagrid/DataGrid.form.d.ts +4 -5
  78. package/lib/cjs/components/datagrid/DataGrid.form.js +3 -2
  79. package/lib/cjs/components/datagrid/DataGrid.js +4 -4
  80. package/lib/cjs/components/datamap/DataMap.form.d.ts +4 -5
  81. package/lib/cjs/components/datamap/DataMap.form.js +3 -2
  82. package/lib/cjs/components/datetime/DateTime.form.d.ts +4 -5
  83. package/lib/cjs/components/datetime/DateTime.form.js +3 -2
  84. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.d.ts +1 -1
  85. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
  86. package/lib/cjs/components/day/Day.d.ts +18 -23
  87. package/lib/cjs/components/day/Day.form.d.ts +4 -5
  88. package/lib/cjs/components/day/Day.form.js +3 -2
  89. package/lib/cjs/components/day/Day.js +15 -14
  90. package/lib/cjs/components/editgrid/EditGrid.d.ts +4 -3
  91. package/lib/cjs/components/editgrid/EditGrid.form.d.ts +4 -5
  92. package/lib/cjs/components/editgrid/EditGrid.form.js +3 -2
  93. package/lib/cjs/components/editgrid/EditGrid.js +3 -3
  94. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +2 -5
  95. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.d.ts +1 -1
  96. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +6 -9
  97. package/lib/cjs/components/email/Email.form.d.ts +4 -5
  98. package/lib/cjs/components/email/Email.form.js +3 -2
  99. package/lib/cjs/components/fieldset/Fieldset.form.d.ts +4 -5
  100. package/lib/cjs/components/fieldset/Fieldset.form.js +3 -2
  101. package/lib/cjs/components/file/File.form.d.ts +4 -5
  102. package/lib/cjs/components/file/File.form.js +3 -2
  103. package/lib/cjs/components/form/Form.d.ts +23 -20
  104. package/lib/cjs/components/form/Form.form.d.ts +4 -5
  105. package/lib/cjs/components/form/Form.form.js +3 -2
  106. package/lib/cjs/components/form/Form.js +18 -11
  107. package/lib/cjs/components/form/editForm/Form.edit.data.d.ts +1 -1
  108. package/lib/cjs/components/form/fixtures/comp7.d.ts +36 -0
  109. package/lib/cjs/components/form/fixtures/comp7.js +37 -0
  110. package/lib/cjs/components/form/fixtures/comp8.d.ts +26 -0
  111. package/lib/cjs/components/form/fixtures/comp8.js +29 -0
  112. package/lib/cjs/components/form/fixtures/index.d.ts +3 -1
  113. package/lib/cjs/components/form/fixtures/index.js +5 -1
  114. package/lib/cjs/components/hidden/Hidden.form.d.ts +4 -5
  115. package/lib/cjs/components/hidden/Hidden.form.js +3 -2
  116. package/lib/cjs/components/hidden/Hidden.js +1 -1
  117. package/lib/cjs/components/html/HTML.form.d.ts +4 -5
  118. package/lib/cjs/components/html/HTML.form.js +3 -2
  119. package/lib/cjs/components/number/Number.d.ts +1 -1
  120. package/lib/cjs/components/number/Number.form.d.ts +4 -5
  121. package/lib/cjs/components/number/Number.form.js +3 -2
  122. package/lib/cjs/components/number/Number.js +1 -1
  123. package/lib/cjs/components/panel/Panel.form.d.ts +4 -5
  124. package/lib/cjs/components/panel/Panel.form.js +3 -2
  125. package/lib/cjs/components/panel/editForm/Panel.edit.conditional.d.ts +1 -1
  126. package/lib/cjs/components/password/Password.form.d.ts +4 -5
  127. package/lib/cjs/components/password/Password.form.js +3 -2
  128. package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +4 -5
  129. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +3 -2
  130. package/lib/cjs/components/radio/Radio.form.d.ts +4 -3
  131. package/lib/cjs/components/radio/Radio.form.js +3 -2
  132. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +3 -4
  133. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +2 -1
  134. package/lib/cjs/components/select/Select.d.ts +2 -2
  135. package/lib/cjs/components/select/Select.form.d.ts +4 -3
  136. package/lib/cjs/components/select/Select.form.js +3 -2
  137. package/lib/cjs/components/select/Select.js +1 -1
  138. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +2 -8
  139. package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +4 -3
  140. package/lib/cjs/components/selectboxes/SelectBoxes.form.js +3 -2
  141. package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -6
  142. package/lib/cjs/components/signature/Signature.form.d.ts +4 -5
  143. package/lib/cjs/components/signature/Signature.form.js +3 -2
  144. package/lib/cjs/components/survey/Survey.form.d.ts +4 -5
  145. package/lib/cjs/components/survey/Survey.form.js +3 -2
  146. package/lib/cjs/components/table/Table.form.d.ts +4 -5
  147. package/lib/cjs/components/table/Table.form.js +3 -2
  148. package/lib/cjs/components/tabs/Tabs.d.ts +2 -2
  149. package/lib/cjs/components/tabs/Tabs.form.d.ts +4 -5
  150. package/lib/cjs/components/tabs/Tabs.form.js +3 -2
  151. package/lib/cjs/components/tabs/Tabs.js +1 -1
  152. package/lib/cjs/components/tags/Tags.form.d.ts +4 -5
  153. package/lib/cjs/components/tags/Tags.form.js +3 -2
  154. package/lib/cjs/components/textarea/TextArea.d.ts +3 -3
  155. package/lib/cjs/components/textarea/TextArea.form.d.ts +4 -5
  156. package/lib/cjs/components/textarea/TextArea.form.js +3 -2
  157. package/lib/cjs/components/textarea/TextArea.js +2 -2
  158. package/lib/cjs/components/textfield/TextField.d.ts +12 -19
  159. package/lib/cjs/components/textfield/TextField.form.d.ts +4 -5
  160. package/lib/cjs/components/textfield/TextField.form.js +3 -2
  161. package/lib/cjs/components/textfield/TextField.js +13 -12
  162. package/lib/cjs/components/time/Time.form.d.ts +4 -5
  163. package/lib/cjs/components/time/Time.form.js +3 -2
  164. package/lib/cjs/components/unknown/Unknown.form.d.ts +3 -35
  165. package/lib/cjs/components/unknown/Unknown.form.js +2 -1
  166. package/lib/cjs/components/url/Url.form.d.ts +4 -5
  167. package/lib/cjs/components/url/Url.form.js +3 -2
  168. package/lib/cjs/components/well/Well.form.d.ts +4 -5
  169. package/lib/cjs/components/well/Well.form.js +3 -2
  170. package/lib/cjs/formio.form.js +2 -2
  171. package/lib/cjs/utils/Evaluator.d.ts +0 -1
  172. package/lib/cjs/utils/Evaluator.js +2 -5
  173. package/lib/cjs/utils/formUtils.d.ts +1 -1
  174. package/lib/cjs/utils/utils.d.ts +106 -83
  175. package/lib/cjs/utils/utils.js +96 -140
  176. package/lib/cjs/widgets/CalendarWidget.d.ts +8 -7
  177. package/lib/cjs/widgets/CalendarWidget.js +8 -7
  178. package/lib/mjs/Element.d.ts +3 -2
  179. package/lib/mjs/Element.js +4 -3
  180. package/lib/mjs/Embed.js +8 -5
  181. package/lib/mjs/Form.d.ts +99 -36
  182. package/lib/mjs/Form.js +43 -38
  183. package/lib/mjs/PDF.d.ts +8 -7
  184. package/lib/mjs/PDF.js +6 -5
  185. package/lib/mjs/Webform.d.ts +1 -4
  186. package/lib/mjs/Webform.js +19 -16
  187. package/lib/mjs/WebformBuilder.d.ts +15 -14
  188. package/lib/mjs/WebformBuilder.js +11 -10
  189. package/lib/mjs/Wizard.d.ts +1 -12
  190. package/lib/mjs/Wizard.js +15 -13
  191. package/lib/mjs/WizardBuilder.d.ts +1 -1
  192. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +2 -2
  193. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.d.ts +2 -2
  194. package/lib/mjs/addons/index.d.ts +2 -2
  195. package/lib/mjs/components/Components.d.ts +6 -5
  196. package/lib/mjs/components/Components.js +2 -1
  197. package/lib/mjs/components/_classes/component/Component.form.d.ts +4 -5
  198. package/lib/mjs/components/_classes/component/Component.form.js +3 -2
  199. package/lib/mjs/components/_classes/component/Component.js +3 -2
  200. package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.d.ts +2 -2
  201. package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.d.ts +1 -1
  202. package/lib/mjs/components/_classes/component/editForm/Component.edit.data.d.ts +1 -1
  203. package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.d.ts +1 -1
  204. package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -1
  205. package/lib/mjs/components/_classes/component/editForm/utils.d.ts +1 -1
  206. package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
  207. package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
  208. package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +4 -4
  209. package/lib/mjs/components/_classes/list/ListComponent.form.js +3 -3
  210. package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +4 -5
  211. package/lib/mjs/components/_classes/nested/NestedComponent.form.js +3 -2
  212. package/lib/mjs/components/_classes/nested/NestedComponent.js +0 -2
  213. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -1
  214. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
  215. package/lib/mjs/components/address/Address.form.d.ts +4 -5
  216. package/lib/mjs/components/address/Address.form.js +3 -2
  217. package/lib/mjs/components/button/Button.form.d.ts +4 -5
  218. package/lib/mjs/components/button/Button.form.js +3 -2
  219. package/lib/mjs/components/button/Button.js +3 -2
  220. package/lib/mjs/components/checkbox/Checkbox.form.d.ts +4 -5
  221. package/lib/mjs/components/checkbox/Checkbox.form.js +3 -2
  222. package/lib/mjs/components/checkbox/Checkbox.js +2 -9
  223. package/lib/mjs/components/checkbox/fixtures/comp5.d.ts +34 -0
  224. package/lib/mjs/components/checkbox/fixtures/comp5.js +53 -0
  225. package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
  226. package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
  227. package/lib/mjs/components/columns/Columns.d.ts +1 -1
  228. package/lib/mjs/components/columns/Columns.form.d.ts +4 -5
  229. package/lib/mjs/components/columns/Columns.form.js +3 -2
  230. package/lib/mjs/components/columns/Columns.js +1 -1
  231. package/lib/mjs/components/container/Container.form.d.ts +4 -5
  232. package/lib/mjs/components/container/Container.form.js +3 -2
  233. package/lib/mjs/components/content/Content.form.d.ts +4 -5
  234. package/lib/mjs/components/content/Content.form.js +3 -2
  235. package/lib/mjs/components/currency/Currency.form.d.ts +4 -5
  236. package/lib/mjs/components/currency/Currency.form.js +3 -2
  237. package/lib/mjs/components/currency/Currency.js +1 -1
  238. package/lib/mjs/components/datagrid/DataGrid.d.ts +4 -4
  239. package/lib/mjs/components/datagrid/DataGrid.form.d.ts +4 -5
  240. package/lib/mjs/components/datagrid/DataGrid.form.js +3 -2
  241. package/lib/mjs/components/datagrid/DataGrid.js +4 -4
  242. package/lib/mjs/components/datamap/DataMap.form.d.ts +4 -5
  243. package/lib/mjs/components/datamap/DataMap.form.js +3 -2
  244. package/lib/mjs/components/datetime/DateTime.form.d.ts +4 -5
  245. package/lib/mjs/components/datetime/DateTime.form.js +3 -2
  246. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.d.ts +1 -1
  247. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
  248. package/lib/mjs/components/day/Day.d.ts +18 -23
  249. package/lib/mjs/components/day/Day.form.d.ts +4 -5
  250. package/lib/mjs/components/day/Day.form.js +3 -2
  251. package/lib/mjs/components/day/Day.js +15 -14
  252. package/lib/mjs/components/editgrid/EditGrid.d.ts +4 -3
  253. package/lib/mjs/components/editgrid/EditGrid.form.d.ts +4 -5
  254. package/lib/mjs/components/editgrid/EditGrid.form.js +3 -2
  255. package/lib/mjs/components/editgrid/EditGrid.js +3 -3
  256. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  257. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.d.ts +1 -1
  258. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +1 -1
  259. package/lib/mjs/components/email/Email.form.d.ts +4 -5
  260. package/lib/mjs/components/email/Email.form.js +3 -2
  261. package/lib/mjs/components/fieldset/Fieldset.form.d.ts +4 -5
  262. package/lib/mjs/components/fieldset/Fieldset.form.js +3 -2
  263. package/lib/mjs/components/file/File.form.d.ts +4 -5
  264. package/lib/mjs/components/file/File.form.js +3 -2
  265. package/lib/mjs/components/form/Form.d.ts +23 -20
  266. package/lib/mjs/components/form/Form.form.d.ts +4 -5
  267. package/lib/mjs/components/form/Form.form.js +3 -2
  268. package/lib/mjs/components/form/Form.js +18 -11
  269. package/lib/mjs/components/form/editForm/Form.edit.data.d.ts +1 -1
  270. package/lib/mjs/components/form/fixtures/comp7.d.ts +36 -0
  271. package/lib/mjs/components/form/fixtures/comp7.js +35 -0
  272. package/lib/mjs/components/form/fixtures/comp8.d.ts +26 -0
  273. package/lib/mjs/components/form/fixtures/comp8.js +27 -0
  274. package/lib/mjs/components/form/fixtures/index.d.ts +3 -1
  275. package/lib/mjs/components/form/fixtures/index.js +3 -1
  276. package/lib/mjs/components/hidden/Hidden.form.d.ts +4 -5
  277. package/lib/mjs/components/hidden/Hidden.form.js +3 -2
  278. package/lib/mjs/components/hidden/Hidden.js +1 -1
  279. package/lib/mjs/components/html/HTML.form.d.ts +4 -5
  280. package/lib/mjs/components/html/HTML.form.js +3 -2
  281. package/lib/mjs/components/number/Number.d.ts +1 -1
  282. package/lib/mjs/components/number/Number.form.d.ts +4 -5
  283. package/lib/mjs/components/number/Number.form.js +3 -2
  284. package/lib/mjs/components/number/Number.js +1 -1
  285. package/lib/mjs/components/panel/Panel.form.d.ts +4 -5
  286. package/lib/mjs/components/panel/Panel.form.js +3 -2
  287. package/lib/mjs/components/panel/editForm/Panel.edit.conditional.d.ts +1 -1
  288. package/lib/mjs/components/password/Password.form.d.ts +4 -5
  289. package/lib/mjs/components/password/Password.form.js +3 -2
  290. package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +4 -5
  291. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +3 -2
  292. package/lib/mjs/components/radio/Radio.form.d.ts +4 -3
  293. package/lib/mjs/components/radio/Radio.form.js +3 -2
  294. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +3 -4
  295. package/lib/mjs/components/recaptcha/ReCaptcha.form.js +2 -1
  296. package/lib/mjs/components/select/Select.d.ts +2 -2
  297. package/lib/mjs/components/select/Select.form.d.ts +4 -3
  298. package/lib/mjs/components/select/Select.form.js +3 -2
  299. package/lib/mjs/components/select/Select.js +1 -1
  300. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +2 -8
  301. package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +4 -3
  302. package/lib/mjs/components/selectboxes/SelectBoxes.form.js +3 -2
  303. package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -6
  304. package/lib/mjs/components/signature/Signature.form.d.ts +4 -5
  305. package/lib/mjs/components/signature/Signature.form.js +3 -2
  306. package/lib/mjs/components/survey/Survey.form.d.ts +4 -5
  307. package/lib/mjs/components/survey/Survey.form.js +3 -2
  308. package/lib/mjs/components/table/Table.form.d.ts +4 -5
  309. package/lib/mjs/components/table/Table.form.js +3 -2
  310. package/lib/mjs/components/tabs/Tabs.d.ts +2 -2
  311. package/lib/mjs/components/tabs/Tabs.form.d.ts +4 -5
  312. package/lib/mjs/components/tabs/Tabs.form.js +3 -2
  313. package/lib/mjs/components/tabs/Tabs.js +1 -1
  314. package/lib/mjs/components/tags/Tags.form.d.ts +4 -5
  315. package/lib/mjs/components/tags/Tags.form.js +3 -2
  316. package/lib/mjs/components/textarea/TextArea.d.ts +3 -3
  317. package/lib/mjs/components/textarea/TextArea.form.d.ts +4 -5
  318. package/lib/mjs/components/textarea/TextArea.form.js +3 -2
  319. package/lib/mjs/components/textarea/TextArea.js +2 -2
  320. package/lib/mjs/components/textfield/TextField.d.ts +12 -19
  321. package/lib/mjs/components/textfield/TextField.form.d.ts +4 -5
  322. package/lib/mjs/components/textfield/TextField.form.js +3 -2
  323. package/lib/mjs/components/textfield/TextField.js +13 -12
  324. package/lib/mjs/components/time/Time.form.d.ts +4 -5
  325. package/lib/mjs/components/time/Time.form.js +3 -2
  326. package/lib/mjs/components/unknown/Unknown.form.d.ts +3 -35
  327. package/lib/mjs/components/unknown/Unknown.form.js +2 -1
  328. package/lib/mjs/components/url/Url.form.d.ts +4 -5
  329. package/lib/mjs/components/url/Url.form.js +3 -2
  330. package/lib/mjs/components/well/Well.form.d.ts +4 -5
  331. package/lib/mjs/components/well/Well.form.js +3 -2
  332. package/lib/mjs/formio.form.js +1 -1
  333. package/lib/mjs/utils/Evaluator.d.ts +0 -1
  334. package/lib/mjs/utils/Evaluator.js +1 -4
  335. package/lib/mjs/utils/formUtils.d.ts +1 -1
  336. package/lib/mjs/utils/utils.d.ts +106 -83
  337. package/lib/mjs/utils/utils.js +96 -140
  338. package/lib/mjs/widgets/CalendarWidget.d.ts +8 -7
  339. package/lib/mjs/widgets/CalendarWidget.js +8 -7
  340. package/package.json +5 -8
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see formio.embed.min.js.LICENSE.txt */
2
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.Formio=o():e.Formio=o()}(self,(function(){return function(){"use strict";var e={56036:function(e,o){Object.defineProperty(o,"__esModule",{value:!0});class t{constructor(e,o={}){this.baseUrl=e||t.defaultCDN,this.overrides=o,this.libs={js:"",ace:"1.4.12",bootstrap:"5.3.2",bootstrap4:"4.6.2",bootstrap5:"5.3.2","bootstrap-icons":"1.11.1",ckeditor:"19.0.0",flatpickr:"4.6.8","flatpickr-formio":"4.6.13-formio.3","font-awesome":"4.7.0",grid:"latest","moment-timezone":"latest",quill:"2.0.0-dev.3","shortcut-buttons-flatpickr":"0.4.0",uswds:"2.4.8",core:""},this.updateUrls()}getVersion(e){return this.libs[e]}setVersion(e,o){this.libs[e]=o,this.updateUrls()}setBaseUrl(e){this.baseUrl=e,this.updateUrls()}setOverrideUrl(e,o){this.overrides[e]=o,this.updateUrls()}removeOverride(e){delete this.overrides[e],this.updateUrls()}removeOverrides(){this.overrides={},this.updateUrls()}buildUrl(e,o,t){let i=e;return o&&(i+=`/${o}`),t&&"latest"!==t&&(i+=`/${t}`),i}updateUrls(){for(const e in this.libs)if(e in this.overrides)if("string"==typeof this.overrides[e])this[e]=this.buildUrl(this.overrides[e],e,this.libs[e]);else{const o=this.overrides[e];this[e]=this.buildUrl(o.cdn,o.lib||"",o.version||"")}else this[e]=this.buildUrl(this.baseUrl,e,this.libs[e])}}t.defaultCDN="https://cdn.form.io",o.default=t},96517:function(e,o,t){Object.defineProperty(o,"__esModule",{value:!0}),o.Formio=o.embed=void 0;const i=t(95413);Object.defineProperty(o,"Formio",{enumerable:!0,get:function(){return i.Formio}}),o.embed=function(e={}){const o=document.getElementsByTagName("script");e=Object.assign({},window.FormioConfig||{},e);let t=null,s=o.length;const r=e.scriptName||"formio.embed.";for(;s--;)if(o[s].src&&-1!==o[s].src.indexOf(r)){t=o[s];break}if(t){const o={};t.src.replace(/^[^?]+\??/,"").replace(/\?/g,"&").split("&").forEach((e=>{o[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}));let s=t.src.replace(/^([^?]+).*/,"$1").split("/");s.pop(),e.formioPath&&e.formioPath(s),s=s.join("/");const r="true"===o.debug||"1"===o.debug,n=r?"formio.form":"formio.form.min";i.Formio.config=Object.assign({script:o.script||`${e.updatePath?e.updatePath():s}/${n}.js`,style:o.styles||`${e.updatePath?e.updatePath():s}/${n}.css`,cdn:o.cdn,class:o.class||"formio-form-wrapper",src:o.src,form:null,submission:null,project:o.project,base:o.base||"https://api.form.io",submit:o.submit,includeLibs:"true"===o.libs||"1"===o.libs,template:o.template,debug:r,config:{},redirect:o.return||o.redirect,embedCSS:`${e.updatePath?e.updatePath():s}/formio.embed.css`,success:o.success||"Thank you for your submission!",before:null,after:null},e);const c=i.Formio.config.form||i.Formio.config.src;if(c){i.Formio.debug("Embedding Configuration",e),i.Formio.config.addPremiumLib&&i.Formio.config.addPremiumLib(i.Formio.config,s),i.Formio.config.id=`formio-${Math.random().toString(36).substring(7)}`,i.Formio.debug("Creating form element");const o=i.Formio.createElement("div",{id:i.Formio.config.id,class:i.Formio.config.class});t.parentNode.insertBefore(o,t.parentNode.firstElementChild.nextSibling),i.Formio.createForm(o,c,i.Formio.config.config).then((e=>{i.Formio.config.submit&&(e.nosubmit=!0),e.on("submit",(o=>{if(i.Formio.debug("on('submit')",o),i.Formio.config.submit){i.Formio.debug(`Sending submission to ${i.Formio.config.submit}`);const t={"content-type":"application/json"},s=i.Formio.FormioClass.getToken();s&&(t["x-jwt-token"]=s),i.Formio.FormioClass.fetch(i.Formio.config.submit,{body:JSON.stringify(o),headers:t,method:"POST",mode:"cors"}).then((e=>e.json())).then((o=>i.Formio.submitDone(e,o)))}else i.Formio.submitDone(e,o)}))}))}}else document.write("<span>Could not locate the Embedded form.</span>")}},95413:function(e,o,t){var i,s=this&&this.__awaiter||function(e,o,t,i){return new(t||(t=Promise))((function(s,r){function n(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){var o;e.done?s(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(n,c)}a((i=i.apply(e,o||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.FormBuilder=o.Form=o.Formio=void 0;const n=r(t(56036));class c{static setLicense(e,o=!1){i.license=e,!o&&i.FormioClass&&i.FormioClass.setLicense(e)}static setBaseUrl(e,o=!1){i.baseUrl=e,!o&&i.FormioClass&&i.FormioClass.setBaseUrl(e)}static setApiUrl(e,o=!1){i.baseUrl=e,!o&&i.FormioClass&&i.FormioClass.setApiUrl(e)}static setProjectUrl(e,o=!1){i.projectUrl=e,!o&&i.FormioClass&&i.FormioClass.setProjectUrl(e)}static setAppUrl(e,o=!1){i.projectUrl=e,!o&&i.FormioClass&&i.FormioClass.setAppUrl(e)}static setPathType(e,o=!1){i.pathType=e,!o&&i.FormioClass&&i.FormioClass.setPathType(e)}static debug(...e){i.config.debug&&console.log(...e)}static clearCache(){i.FormioClass&&i.FormioClass.clearCache()}static global(e,o=""){const t=window[e];return o&&t&&!t[o]?null:(i.debug(`Getting global ${e}`,t),t)}static use(e){i.FormioClass&&i.FormioClass.isRenderer?i.FormioClass.use(e):i.modules.push(e)}static createElement(e,o,t){const s=document.createElement(e);return Object.keys(o).forEach((e=>{s.setAttribute(e,o[e])})),(t||[]).forEach((e=>{s.appendChild(i.createElement(e.tag,e.attrs,e.children))})),s}static addScript(e,o,t,r=""){return s(this,void 0,void 0,(function*(){if(!o)return Promise.resolve();if("string"!=typeof o&&o.length)return Promise.all(o.map((o=>i.addScript(e,o))));if(t&&i.global(t,r))return i.debug(`${t} already loaded.`),Promise.resolve(i.global(t));i.debug("Adding Script",o);try{e.appendChild(i.createElement("script",{src:o}))}catch(e){return i.debug(e),Promise.resolve()}return t?new Promise((e=>{i.debug(`Waiting to load ${t}`);const o=setInterval((()=>{i.global(t,r)&&(clearInterval(o),i.debug(`${t} loaded.`),e(i.global(t)))}),100)})):Promise.resolve()}))}static addStyles(e,o){return s(this,void 0,void 0,(function*(){o&&("string"!=typeof o&&o.length?o.forEach((o=>i.addStyles(e,o))):(i.debug("Adding Styles",o),e.appendChild(i.createElement("link",{rel:"stylesheet",href:o}))))}))}static submitDone(e,o){return s(this,void 0,void 0,(function*(){i.debug("Submision Complete",o);const t=(i.config.success||"").toString();t&&"false"!==t.toLowerCase()&&e.element&&(e.element.innerHTML=`<div class="alert-success" role="alert">${t}</div>`);let s=i.config.redirect;if(!s&&e._form&&e._form.settings&&(e._form.settings.returnUrl||e._form.settings.redirect)&&(i.debug("Return url found in form configuration"),s=e._form.settings.returnUrl||e._form.settings.redirect),s){const t=e.formio?e.formio.formUrl:"",r=!!s.match(/\?/),n=0===s.indexOf(location.origin);s+=r?"&":"?",s+=`sub=${o._id}`,!n&&t&&(s+=`&form=${encodeURIComponent(t)}`),i.debug("Return URL",s),window.location.href=s,n&&window.location.reload()}}))}static formioScript(e,o){return o=o||i.config.includeBuilder,i.fullAdded||o?(i.fullAdded=!0,e.replace("formio.form","formio.full")):e}static addLibrary(e,o,t){return s(this,void 0,void 0,(function*(){if(o){if(o.dependencies)for(let t=0;t<o.dependencies.length;t++)yield i.addLibrary(e,i.cdn.libs[o.dependencies[t]]);if(o.css&&(yield i.addStyles(e,o.css)),o.js){const s=yield i.addScript(e,o.js,!!o.use&&t);if(o.use){i.debug(`Using ${t}`);const e=o.options||{};!e.license&&i.license&&(e.license=i.license),i.use("function"==typeof o.use?o.use(s):s,e)}}}}))}static addLoader(e){return s(this,void 0,void 0,(function*(){e.appendChild(i.createElement("div",{class:"formio-loader"},[{tag:"div",attrs:{class:"loader-wrapper"},children:[{tag:"div",attrs:{class:"loader text-center"}}]}]))}))}static init(e,o={},t=!1){return s(this,void 0,void 0,(function*(){i.cdn=new n.default(i.config.cdn,i.config.cdnUrls||{}),i.config.libs=i.config.libs||{uswds:{dependencies:["fontawesome"],js:`${i.cdn.uswds}/uswds.min.js`,css:`${i.cdn.uswds}/uswds.min.css`,use:!0},fontawesome:{css:`${i.cdn["font-awesome"]}/css/font-awesome.min.css`},bootstrap4:{dependencies:["fontawesome"],css:`${i.cdn.bootstrap4}/css/bootstrap.min.css`},bootstrap:{dependencies:["bootstrap-icons"],css:`${i.cdn.bootstrap}/css/bootstrap.min.css`},"bootstrap-icons":{css:`${i.cdn["bootstrap-icons"]}/css/bootstrap-icons.css`}};const s=i.config.id||`formio-${Math.random().toString(36).substring(7)}`;let r=i.createElement("div",{id:`${s}-wrapper`});e.parentNode.insertBefore(r,e);const c=i.config.includeLibs&&"function"==typeof r.attachShadow;c&&(r=r.attachShadow({mode:"open"}),o.shadowRoot=r),e.parentNode.removeChild(e),r.appendChild(e);const a=c?r:document.body;yield i.addStyles(a,i.config.embedCSS||`${i.cdn.js}/formio.embed.css`),i.addLoader(r);const d=i.config.full?"formio.full":"formio.form",l=i.config.debug?d:`${d}.min`;if(i.FormioClass=yield i.addScript(a,i.formioScript(i.config.script||`${i.cdn.js}/${l}.js`,t),"Formio",t?"isBuilder":"isRenderer"),i.FormioClass.cdn=i.cdn,i.FormioClass.setBaseUrl(o.baseUrl||i.baseUrl||i.config.base),i.FormioClass.setProjectUrl(o.projectUrl||i.projectUrl||i.config.project),i.FormioClass.language=i.language,i.setLicense(i.license||i.config.license||!1),i.modules.forEach((e=>{i.FormioClass.use(e)})),i.icons&&(i.FormioClass.icons=i.icons),i.pathType&&i.FormioClass.setPathType(i.pathType),i.config.template&&i.config.includeLibs&&(yield i.addLibrary(a,i.config.libs[i.config.template],i.config.template)),i.config.premium&&(i.config.modules.premium=i.config.premium),i.config.modules)for(const e in i.config.modules){const o=i.config.modules[e];o.use=o.use||!0,yield i.addLibrary(a,o,e)}return yield i.addStyles(a,i.formioScript(i.config.style||`${i.cdn.js}/${l}.css`,t)),i.config.before&&(yield i.config.before(i.FormioClass,e,i.config)),i.FormioClass.license=!0,i._formioReady(i.FormioClass),r}))}static afterCreate(e,o,t){return s(this,void 0,void 0,(function*(){const s=o.querySelector(".formio-loader");return s&&o.removeChild(s),i.FormioClass.events.emit(t,e),i.config.after&&(i.debug("Calling ready callback"),i.config.after(e,i.config)),e}))}static createForm(e,o,t={}){return s(this,void 0,void 0,(function*(){if(i.FormioClass)return i.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0}));const s=yield i.init(e,t);return i.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0})).then((e=>(i.config.submission&&(i.debug("Setting submission",i.config.submission),e.submission=i.config.submission),i.afterCreate(e,s,"formEmbedded"),e)))}))}static builder(e,o,t={}){var r;return s(this,void 0,void 0,(function*(){if(null===(r=i.FormioClass)||void 0===r?void 0:r.builder)return i.FormioClass.builder(e,o,t);const s=yield i.init(e,t,!0);return i.FormioClass.builder(e,o,t).then((e=>(i.afterCreate(e,s,"builderEmbedded"),e)))}))}}o.Formio=c,i=c,c.FormioClass=null,c.config={},c.modules=[],c.icons="",c.license="",c.formioReady=new Promise(((e,o)=>{i._formioReady=e,i._formioReadyReject=o})),c.version="5.0.0-rc.54",c.Report={create:(e,o,t={})=>s(void 0,void 0,void 0,(function*(){var s;if(null===(s=i.FormioClass)||void 0===s?void 0:s.Report)return i.FormioClass.Report.create(e,o,t);const r=yield i.init(e,t,!0);return i.FormioClass.Report.create(e,o,t).then((e=>(i.afterCreate(e,r,"reportEmbedded"),e)))}))},n.default.defaultCDN=c.version.includes("rc")?"https://cdn.test-form.io":"https://cdn.form.io";class a{constructor(e,o,t){this.form=o,this.element=e,this.options=t||{},this.init(),this.instance={proxy:!0,ready:this.ready,destroy:()=>{}}}init(){this.instance&&!this.instance.proxy&&this.instance.destroy(),this.element.innerHTML="",this.ready=this.create().then((e=>(this.instance=e,this.form=e.form,e)))}create(){return c.createForm(this.element,this.form,this.options)}setForm(e){this.form=e,this.instance&&this.instance.setForm(e)}setDisplay(e){return this.instance.proxy||(this.form.display=e,this.instance.destroy(),this.ready=this.create().then((e=>{this.instance=e,this.setForm(this.form)}))),this.ready}}o.Form=a;class d extends a{create(){return c.builder(this.element,this.form,this.options)}}o.FormBuilder=d,c.Form=a,c.FormBuilder=d}},o={};var t={};return(0,function t(i){var s=o[i];if(void 0!==s)return s.exports;var r=o[i]={exports:{}};return e[i].call(r.exports,r,r.exports,t),r.exports}(96517).embed)(),t.Formio}()}));
2
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.Formio=o():e.Formio=o()}(self,(function(){return function(){"use strict";var e={56036:function(e,o){Object.defineProperty(o,"__esModule",{value:!0});class i{constructor(e,o={}){this.baseUrl=e||i.defaultCDN,this.overrides=o,this.libs={js:"",ace:"1.4.12",bootstrap:"5.3.2",bootstrap4:"4.6.2",bootstrap5:"5.3.2","bootstrap-icons":"1.11.1",ckeditor:"19.0.0",flatpickr:"4.6.8","flatpickr-formio":"4.6.13-formio.3","font-awesome":"4.7.0",grid:"latest","moment-timezone":"latest",quill:"2.0.0-dev.3","shortcut-buttons-flatpickr":"0.4.0",uswds:"2.4.8",core:""},this.updateUrls()}getVersion(e){return this.libs[e]}setVersion(e,o){this.libs[e]=o,this.updateUrls()}setBaseUrl(e){this.baseUrl=e,this.updateUrls()}setOverrideUrl(e,o){this.overrides[e]=o,this.updateUrls()}removeOverride(e){delete this.overrides[e],this.updateUrls()}removeOverrides(){this.overrides={},this.updateUrls()}buildUrl(e,o,i){let t=e;return o&&(t+=`/${o}`),i&&"latest"!==i&&(t+=`/${i}`),t}updateUrls(){for(const e in this.libs)if(e in this.overrides)if("string"==typeof this.overrides[e])this[e]=this.buildUrl(this.overrides[e],e,this.libs[e]);else{const o=this.overrides[e];this[e]=this.buildUrl(o.cdn,o.lib||"",o.version||"")}else this[e]=this.buildUrl(this.baseUrl,e,this.libs[e])}}i.defaultCDN="https://cdn.form.io",o.default=i},96517:function(e,o,i){Object.defineProperty(o,"__esModule",{value:!0}),o.Formio=o.embed=void 0;const t=i(95413);Object.defineProperty(o,"Formio",{enumerable:!0,get:function(){return t.Formio}}),o.embed=function(e={}){const o=document.getElementsByTagName("script");e=Object.assign({},window.FormioConfig||{},e);let i=null,s=o.length;const r=e.scriptName||"formio.embed.";for(;s--;)if(o[s].src&&-1!==o[s].src.indexOf(r)){i=o[s];break}if(i){const o={};i.src.replace(/^[^?]+\??/,"").replace(/\?/g,"&").split("&").forEach((e=>{o[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}));let s=i.src.replace(/^([^?]+).*/,"$1").split("/");s.pop(),e.formioPath&&e.formioPath(s),s=s.join("/");const r="true"===o.debug||"1"===o.debug,n=r?"formio.form":"formio.form.min";t.Formio.config=Object.assign({script:o.script||`${e.updatePath?e.updatePath():s}/${n}.js`,style:o.styles||`${e.updatePath?e.updatePath():s}/${n}.css`,cdn:o.cdn,class:o.class||"formio-form-wrapper",src:o.src,form:null,submission:null,project:o.project,base:o.base||"https://api.form.io",submit:o.submit,includeLibs:"true"===o.libs||"1"===o.libs,template:o.template,debug:r,config:{},redirect:o.return||o.redirect,embedCSS:`${e.updatePath?e.updatePath():s}/formio.embed.css`,success:o.success||"Thank you for your submission!",before:null,after:null},e);const c=t.Formio.config.form||t.Formio.config.src;if(c){t.Formio.debug("Embedding Configuration",e),t.Formio.config.addPremiumLib&&t.Formio.config.addPremiumLib(t.Formio.config,s),t.Formio.config.id=`formio-${Math.random().toString(36).substring(7)}`,t.Formio.debug("Creating form element");const o=t.Formio.createElement("div",{id:t.Formio.config.id,class:t.Formio.config.class});i.parentNode.insertBefore(o,i.parentNode.firstElementChild.nextSibling),t.Formio.createForm(o,c,t.Formio.config.config).then((e=>{t.Formio.config.submit&&(e.nosubmit=!0),e.on("submit",(o=>{if(t.Formio.debug("on('submit')",o),t.Formio.config.submit){t.Formio.debug(`Sending submission to ${t.Formio.config.submit}`);const i={"content-type":"application/json"},s=t.Formio.FormioClass.getToken();s&&(i["x-jwt-token"]=s),t.Formio.FormioClass.fetch(t.Formio.config.submit,{body:JSON.stringify(o),headers:i,method:"POST",mode:"cors"}).then((e=>e.json())).then((o=>t.Formio.submitDone(e,o)))}else t.Formio.submitDone(e,o)}))}))}}else document.write("<span>Could not locate the Embedded form.</span>")}},95413:function(e,o,i){var t,s=this&&this.__awaiter||function(e,o,i,t){return new(i||(i=Promise))((function(s,r){function n(e){try{a(t.next(e))}catch(e){r(e)}}function c(e){try{a(t.throw(e))}catch(e){r(e)}}function a(e){var o;e.done?s(e.value):(o=e.value,o instanceof i?o:new i((function(e){e(o)}))).then(n,c)}a((t=t.apply(e,o||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.FormBuilder=o.Form=o.Formio=void 0;const n=r(i(56036));class c{static setLicense(e,o=!1){t.license=e,!o&&t.FormioClass&&t.FormioClass.setLicense(e)}static setBaseUrl(e,o=!1){t.baseUrl=e,!o&&t.FormioClass&&t.FormioClass.setBaseUrl(e)}static setApiUrl(e,o=!1){t.baseUrl=e,!o&&t.FormioClass&&t.FormioClass.setApiUrl(e)}static setProjectUrl(e,o=!1){t.projectUrl=e,!o&&t.FormioClass&&t.FormioClass.setProjectUrl(e)}static setAppUrl(e,o=!1){t.projectUrl=e,!o&&t.FormioClass&&t.FormioClass.setAppUrl(e)}static setPathType(e,o=!1){t.pathType=e,!o&&t.FormioClass&&t.FormioClass.setPathType(e)}static debug(...e){t.config.debug&&console.log(...e)}static clearCache(){t.FormioClass&&t.FormioClass.clearCache()}static global(e,o=""){const i=window[e];return o&&i&&!i[o]?null:(t.debug(`Getting global ${e}`,i),i)}static use(e){t.FormioClass&&t.FormioClass.isRenderer?t.FormioClass.use(e):t.modules.push(e)}static createElement(e,o,i){const s=document.createElement(e);return Object.keys(o).forEach((e=>{s.setAttribute(e,o[e])})),(i||[]).forEach((e=>{s.appendChild(t.createElement(e.tag,e.attrs,e.children))})),s}static addScript(e,o,i,r=""){return s(this,void 0,void 0,(function*(){if(!o)return Promise.resolve();if("string"!=typeof o&&o.length)return Promise.all(o.map((o=>t.addScript(e,o))));if(i&&t.global(i,r))return t.debug(`${i} already loaded.`),Promise.resolve(t.global(i));t.debug("Adding Script",o);try{e.appendChild(t.createElement("script",{src:o}))}catch(e){return t.debug(e),Promise.resolve()}return i?new Promise((e=>{t.debug(`Waiting to load ${i}`);const o=setInterval((()=>{t.global(i,r)&&(clearInterval(o),t.debug(`${i} loaded.`),e(t.global(i)))}),100)})):Promise.resolve()}))}static addStyles(e,o){return s(this,void 0,void 0,(function*(){o&&("string"!=typeof o&&o.length?o.forEach((o=>t.addStyles(e,o))):(t.debug("Adding Styles",o),e.appendChild(t.createElement("link",{rel:"stylesheet",href:o}))))}))}static submitDone(e,o){return s(this,void 0,void 0,(function*(){t.debug("Submision Complete",o);const i=(t.config.success||"").toString();i&&"false"!==i.toLowerCase()&&e.element&&(e.element.innerHTML=`<div class="alert-success" role="alert">${i}</div>`);let s=t.config.redirect;if(!s&&e._form&&e._form.settings&&(e._form.settings.returnUrl||e._form.settings.redirect)&&(t.debug("Return url found in form configuration"),s=e._form.settings.returnUrl||e._form.settings.redirect),s){const i=e.formio?e.formio.formUrl:"",r=!!s.match(/\?/),n=0===s.indexOf(location.origin);s+=r?"&":"?",s+=`sub=${o._id}`,!n&&i&&(s+=`&form=${encodeURIComponent(i)}`),t.debug("Return URL",s),window.location.href=s,n&&window.location.reload()}}))}static formioScript(e,o){return o=o||t.config.includeBuilder,t.fullAdded||o?(t.fullAdded=!0,e.replace("formio.form","formio.full")):e}static addLibrary(e,o,i){return s(this,void 0,void 0,(function*(){if(o){if(o.dependencies)for(let i=0;i<o.dependencies.length;i++)yield t.addLibrary(e,t.cdn.libs[o.dependencies[i]]);if(o.css&&(yield t.addStyles(e,o.css)),o.js){const s=yield t.addScript(e,o.js,!!o.use&&i);if(o.use){t.debug(`Using ${i}`);const e=o.options||{};!e.license&&t.license&&(e.license=t.license),t.use("function"==typeof o.use?o.use(s):s,e)}}}}))}static addLoader(e){return s(this,void 0,void 0,(function*(){e.appendChild(t.createElement("div",{class:"formio-loader"},[{tag:"div",attrs:{class:"loader-wrapper"},children:[{tag:"div",attrs:{class:"loader text-center"}}]}]))}))}static init(e,o={},i=!1){return s(this,void 0,void 0,(function*(){t.cdn=new n.default(t.config.cdn,t.config.cdnUrls||{}),t.config.libs=t.config.libs||{uswds:{dependencies:["fontawesome"],js:`${t.cdn.uswds}/uswds.min.js`,css:`${t.cdn.uswds}/uswds.min.css`,use:!0},fontawesome:{css:`${t.cdn["font-awesome"]}/css/font-awesome.min.css`},bootstrap4:{dependencies:["fontawesome"],css:`${t.cdn.bootstrap4}/css/bootstrap.min.css`},bootstrap:{dependencies:["bootstrap-icons"],css:`${t.cdn.bootstrap}/css/bootstrap.min.css`},"bootstrap-icons":{css:`${t.cdn["bootstrap-icons"]}/css/bootstrap-icons.css`}};const s=t.config.id||`formio-${Math.random().toString(36).substring(7)}`;let r=t.createElement("div",{id:`${s}-wrapper`});e.parentNode.insertBefore(r,e);const c=t.config.includeLibs&&"function"==typeof r.attachShadow;c&&(r=r.attachShadow({mode:"open"}),o.shadowRoot=r),e.parentNode.removeChild(e),r.appendChild(e);const a=c?r:document.body;yield t.addStyles(a,t.config.embedCSS||`${t.cdn.js}/formio.embed.css`),t.addLoader(r);const l=t.config.full?"formio.full":"formio.form",d=t.config.debug?l:`${l}.min`;if(t.FormioClass=yield t.addScript(a,t.formioScript(t.config.script||`${t.cdn.js}/${d}.js`,i),"Formio",i?"isBuilder":"isRenderer"),t.FormioClass.cdn=t.cdn,t.FormioClass.setBaseUrl(o.baseUrl||t.baseUrl||t.config.base),t.FormioClass.setProjectUrl(o.projectUrl||t.projectUrl||t.config.project),t.FormioClass.language=t.language,t.setLicense(t.license||t.config.license||!1),t.modules.forEach((e=>{t.FormioClass.use(e)})),t.icons&&(t.FormioClass.icons=t.icons),t.pathType&&t.FormioClass.setPathType(t.pathType),t.config.template&&t.config.includeLibs&&(yield t.addLibrary(a,t.config.libs[t.config.template],t.config.template)),t.config.libraries||(t.config.libraries=t.config.modules||{}),t.config.premium&&(t.config.libraries.premium=t.config.premium),t.config.libraries)for(const e in t.config.libraries){const o=t.config.libraries[e];o.use=o.use||!0,yield t.addLibrary(a,o,e)}return yield t.addStyles(a,t.formioScript(t.config.style||`${t.cdn.js}/${d}.css`,i)),t.config.before&&(yield t.config.before(t.FormioClass,e,t.config)),t.FormioClass.license=!0,t._formioReady(t.FormioClass),r}))}static afterCreate(e,o,i){return s(this,void 0,void 0,(function*(){const s=o.querySelector(".formio-loader");return s&&o.removeChild(s),t.FormioClass.events.emit(i,e),t.config.after&&(t.debug("Calling ready callback"),t.config.after(e,t.config)),e}))}static createForm(e,o,i={}){return s(this,void 0,void 0,(function*(){if(t.FormioClass)return t.FormioClass.createForm(e,o,Object.assign(Object.assign({},i),{noLoader:!0}));const s=yield t.init(e,i);return t.FormioClass.createForm(e,o,Object.assign(Object.assign({},i),{noLoader:!0})).then((e=>(t.config.submission&&(t.debug("Setting submission",t.config.submission),e.submission=t.config.submission),t.afterCreate(e,s,"formEmbedded"),e)))}))}static builder(e,o,i={}){var r;return s(this,void 0,void 0,(function*(){if(null===(r=t.FormioClass)||void 0===r?void 0:r.builder)return t.FormioClass.builder(e,o,i);const s=yield t.init(e,i,!0);return t.FormioClass.builder(e,o,i).then((e=>(t.afterCreate(e,s,"builderEmbedded"),e)))}))}}o.Formio=c,t=c,c.FormioClass=null,c.config={},c.modules=[],c.icons="",c.license="",c.formioReady=new Promise(((e,o)=>{t._formioReady=e,t._formioReadyReject=o})),c.version="5.0.0-rc.56",c.Report={create:(e,o,i={})=>s(void 0,void 0,void 0,(function*(){var s;if(null===(s=t.FormioClass)||void 0===s?void 0:s.Report)return t.FormioClass.Report.create(e,o,i);const r=yield t.init(e,i,!0);return t.FormioClass.Report.create(e,o,i).then((e=>(t.afterCreate(e,r,"reportEmbedded"),e)))}))},n.default.defaultCDN=c.version.includes("rc")?"https://cdn.test-form.io":"https://cdn.form.io";class a{constructor(e,o,i){this.form=o,this.element=e,this.options=i||{},this.init(),this.instance={proxy:!0,ready:this.ready,destroy:()=>{}}}init(){this.instance&&!this.instance.proxy&&this.instance.destroy(),this.element.innerHTML="",this.ready=this.create().then((e=>(this.instance=e,this.form=e.form,e)))}create(){return c.createForm(this.element,this.form,this.options)}setForm(e){this.form=e,this.instance&&this.instance.setForm(e)}setDisplay(e){return this.instance.proxy||(this.form.display=e,this.instance.destroy(),this.ready=this.create().then((e=>{this.instance=e,this.setForm(this.form)}))),this.ready}}o.Form=a;class l extends a{create(){return c.builder(this.element,this.form,this.options)}}o.FormBuilder=l,c.Form=a,c.FormBuilder=l}},o={};var i={};return(0,function i(t){var s=o[t];if(void 0!==s)return s.exports;var r=o[t]={exports:{}};return e[t].call(r.exports,r,r.exports,i),r.exports}(96517).embed)(),i.Formio}()}));
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see formio.embed.min.js.LICENSE.txt */
2
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.Formio=o():e.Formio=o()}(self,(function(){return function(){"use strict";var e={56036:function(e,o){Object.defineProperty(o,"__esModule",{value:!0});class t{constructor(e,o={}){this.baseUrl=e||t.defaultCDN,this.overrides=o,this.libs={js:"",ace:"1.4.12",bootstrap:"5.3.2",bootstrap4:"4.6.2",bootstrap5:"5.3.2","bootstrap-icons":"1.11.1",ckeditor:"19.0.0",flatpickr:"4.6.8","flatpickr-formio":"4.6.13-formio.3","font-awesome":"4.7.0",grid:"latest","moment-timezone":"latest",quill:"2.0.0-dev.3","shortcut-buttons-flatpickr":"0.4.0",uswds:"2.4.8",core:""},this.updateUrls()}getVersion(e){return this.libs[e]}setVersion(e,o){this.libs[e]=o,this.updateUrls()}setBaseUrl(e){this.baseUrl=e,this.updateUrls()}setOverrideUrl(e,o){this.overrides[e]=o,this.updateUrls()}removeOverride(e){delete this.overrides[e],this.updateUrls()}removeOverrides(){this.overrides={},this.updateUrls()}buildUrl(e,o,t){let i=e;return o&&(i+=`/${o}`),t&&"latest"!==t&&(i+=`/${t}`),i}updateUrls(){for(const e in this.libs)if(e in this.overrides)if("string"==typeof this.overrides[e])this[e]=this.buildUrl(this.overrides[e],e,this.libs[e]);else{const o=this.overrides[e];this[e]=this.buildUrl(o.cdn,o.lib||"",o.version||"")}else this[e]=this.buildUrl(this.baseUrl,e,this.libs[e])}}t.defaultCDN="https://cdn.form.io",o.default=t},96517:function(e,o,t){Object.defineProperty(o,"__esModule",{value:!0}),o.Formio=o.embed=void 0;const i=t(95413);Object.defineProperty(o,"Formio",{enumerable:!0,get:function(){return i.Formio}}),o.embed=function(e={}){const o=document.getElementsByTagName("script");e=Object.assign({},window.FormioConfig||{},e);let t=null,s=o.length;const r=e.scriptName||"formio.embed.";for(;s--;)if(o[s].src&&-1!==o[s].src.indexOf(r)){t=o[s];break}if(t){const o={};t.src.replace(/^[^?]+\??/,"").replace(/\?/g,"&").split("&").forEach((e=>{o[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}));let s=t.src.replace(/^([^?]+).*/,"$1").split("/");s.pop(),e.formioPath&&e.formioPath(s),s=s.join("/");const r="true"===o.debug||"1"===o.debug,n=r?"formio.form":"formio.form.min";i.Formio.config=Object.assign({script:o.script||`${e.updatePath?e.updatePath():s}/${n}.js`,style:o.styles||`${e.updatePath?e.updatePath():s}/${n}.css`,cdn:o.cdn,class:o.class||"formio-form-wrapper",src:o.src,form:null,submission:null,project:o.project,base:o.base||"https://api.form.io",submit:o.submit,includeLibs:"true"===o.libs||"1"===o.libs,template:o.template,debug:r,config:{},redirect:o.return||o.redirect,embedCSS:`${e.updatePath?e.updatePath():s}/formio.embed.css`,success:o.success||"Thank you for your submission!",before:null,after:null},e);const c=i.Formio.config.form||i.Formio.config.src;if(c){i.Formio.debug("Embedding Configuration",e),i.Formio.config.addPremiumLib&&i.Formio.config.addPremiumLib(i.Formio.config,s),i.Formio.config.id=`formio-${Math.random().toString(36).substring(7)}`,i.Formio.debug("Creating form element");const o=i.Formio.createElement("div",{id:i.Formio.config.id,class:i.Formio.config.class});t.parentNode.insertBefore(o,t.parentNode.firstElementChild.nextSibling),i.Formio.createForm(o,c,i.Formio.config.config).then((e=>{i.Formio.config.submit&&(e.nosubmit=!0),e.on("submit",(o=>{if(i.Formio.debug("on('submit')",o),i.Formio.config.submit){i.Formio.debug(`Sending submission to ${i.Formio.config.submit}`);const t={"content-type":"application/json"},s=i.Formio.FormioClass.getToken();s&&(t["x-jwt-token"]=s),i.Formio.FormioClass.fetch(i.Formio.config.submit,{body:JSON.stringify(o),headers:t,method:"POST",mode:"cors"}).then((e=>e.json())).then((o=>i.Formio.submitDone(e,o)))}else i.Formio.submitDone(e,o)}))}))}}else document.write("<span>Could not locate the Embedded form.</span>")}},95413:function(e,o,t){var i,s=this&&this.__awaiter||function(e,o,t,i){return new(t||(t=Promise))((function(s,r){function n(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){var o;e.done?s(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(n,c)}a((i=i.apply(e,o||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.FormBuilder=o.Form=o.Formio=void 0;const n=r(t(56036));class c{static setLicense(e,o=!1){i.license=e,!o&&i.FormioClass&&i.FormioClass.setLicense(e)}static setBaseUrl(e,o=!1){i.baseUrl=e,!o&&i.FormioClass&&i.FormioClass.setBaseUrl(e)}static setApiUrl(e,o=!1){i.baseUrl=e,!o&&i.FormioClass&&i.FormioClass.setApiUrl(e)}static setProjectUrl(e,o=!1){i.projectUrl=e,!o&&i.FormioClass&&i.FormioClass.setProjectUrl(e)}static setAppUrl(e,o=!1){i.projectUrl=e,!o&&i.FormioClass&&i.FormioClass.setAppUrl(e)}static setPathType(e,o=!1){i.pathType=e,!o&&i.FormioClass&&i.FormioClass.setPathType(e)}static debug(...e){i.config.debug&&console.log(...e)}static clearCache(){i.FormioClass&&i.FormioClass.clearCache()}static global(e,o=""){const t=window[e];return o&&t&&!t[o]?null:(i.debug(`Getting global ${e}`,t),t)}static use(e){i.FormioClass&&i.FormioClass.isRenderer?i.FormioClass.use(e):i.modules.push(e)}static createElement(e,o,t){const s=document.createElement(e);return Object.keys(o).forEach((e=>{s.setAttribute(e,o[e])})),(t||[]).forEach((e=>{s.appendChild(i.createElement(e.tag,e.attrs,e.children))})),s}static addScript(e,o,t,r=""){return s(this,void 0,void 0,(function*(){if(!o)return Promise.resolve();if("string"!=typeof o&&o.length)return Promise.all(o.map((o=>i.addScript(e,o))));if(t&&i.global(t,r))return i.debug(`${t} already loaded.`),Promise.resolve(i.global(t));i.debug("Adding Script",o);try{e.appendChild(i.createElement("script",{src:o}))}catch(e){return i.debug(e),Promise.resolve()}return t?new Promise((e=>{i.debug(`Waiting to load ${t}`);const o=setInterval((()=>{i.global(t,r)&&(clearInterval(o),i.debug(`${t} loaded.`),e(i.global(t)))}),100)})):Promise.resolve()}))}static addStyles(e,o){return s(this,void 0,void 0,(function*(){o&&("string"!=typeof o&&o.length?o.forEach((o=>i.addStyles(e,o))):(i.debug("Adding Styles",o),e.appendChild(i.createElement("link",{rel:"stylesheet",href:o}))))}))}static submitDone(e,o){return s(this,void 0,void 0,(function*(){i.debug("Submision Complete",o);const t=(i.config.success||"").toString();t&&"false"!==t.toLowerCase()&&e.element&&(e.element.innerHTML=`<div class="alert-success" role="alert">${t}</div>`);let s=i.config.redirect;if(!s&&e._form&&e._form.settings&&(e._form.settings.returnUrl||e._form.settings.redirect)&&(i.debug("Return url found in form configuration"),s=e._form.settings.returnUrl||e._form.settings.redirect),s){const t=e.formio?e.formio.formUrl:"",r=!!s.match(/\?/),n=0===s.indexOf(location.origin);s+=r?"&":"?",s+=`sub=${o._id}`,!n&&t&&(s+=`&form=${encodeURIComponent(t)}`),i.debug("Return URL",s),window.location.href=s,n&&window.location.reload()}}))}static formioScript(e,o){return o=o||i.config.includeBuilder,i.fullAdded||o?(i.fullAdded=!0,e.replace("formio.form","formio.full")):e}static addLibrary(e,o,t){return s(this,void 0,void 0,(function*(){if(o){if(o.dependencies)for(let t=0;t<o.dependencies.length;t++)yield i.addLibrary(e,i.cdn.libs[o.dependencies[t]]);if(o.css&&(yield i.addStyles(e,o.css)),o.js){const s=yield i.addScript(e,o.js,!!o.use&&t);if(o.use){i.debug(`Using ${t}`);const e=o.options||{};!e.license&&i.license&&(e.license=i.license),i.use("function"==typeof o.use?o.use(s):s,e)}}}}))}static addLoader(e){return s(this,void 0,void 0,(function*(){e.appendChild(i.createElement("div",{class:"formio-loader"},[{tag:"div",attrs:{class:"loader-wrapper"},children:[{tag:"div",attrs:{class:"loader text-center"}}]}]))}))}static init(e,o={},t=!1){return s(this,void 0,void 0,(function*(){i.cdn=new n.default(i.config.cdn,i.config.cdnUrls||{}),i.config.libs=i.config.libs||{uswds:{dependencies:["fontawesome"],js:`${i.cdn.uswds}/uswds.min.js`,css:`${i.cdn.uswds}/uswds.min.css`,use:!0},fontawesome:{css:`${i.cdn["font-awesome"]}/css/font-awesome.min.css`},bootstrap4:{dependencies:["fontawesome"],css:`${i.cdn.bootstrap4}/css/bootstrap.min.css`},bootstrap:{dependencies:["bootstrap-icons"],css:`${i.cdn.bootstrap}/css/bootstrap.min.css`},"bootstrap-icons":{css:`${i.cdn["bootstrap-icons"]}/css/bootstrap-icons.css`}};const s=i.config.id||`formio-${Math.random().toString(36).substring(7)}`;let r=i.createElement("div",{id:`${s}-wrapper`});e.parentNode.insertBefore(r,e);const c=i.config.includeLibs&&"function"==typeof r.attachShadow;c&&(r=r.attachShadow({mode:"open"}),o.shadowRoot=r),e.parentNode.removeChild(e),r.appendChild(e);const a=c?r:document.body;yield i.addStyles(a,i.config.embedCSS||`${i.cdn.js}/formio.embed.css`),i.addLoader(r);const d=i.config.full?"formio.full":"formio.form",l=i.config.debug?d:`${d}.min`;if(i.FormioClass=yield i.addScript(a,i.formioScript(i.config.script||`${i.cdn.js}/${l}.js`,t),"Formio",t?"isBuilder":"isRenderer"),i.FormioClass.cdn=i.cdn,i.FormioClass.setBaseUrl(o.baseUrl||i.baseUrl||i.config.base),i.FormioClass.setProjectUrl(o.projectUrl||i.projectUrl||i.config.project),i.FormioClass.language=i.language,i.setLicense(i.license||i.config.license||!1),i.modules.forEach((e=>{i.FormioClass.use(e)})),i.icons&&(i.FormioClass.icons=i.icons),i.pathType&&i.FormioClass.setPathType(i.pathType),i.config.template&&i.config.includeLibs&&(yield i.addLibrary(a,i.config.libs[i.config.template],i.config.template)),i.config.premium&&(i.config.modules.premium=i.config.premium),i.config.modules)for(const e in i.config.modules){const o=i.config.modules[e];o.use=o.use||!0,yield i.addLibrary(a,o,e)}return yield i.addStyles(a,i.formioScript(i.config.style||`${i.cdn.js}/${l}.css`,t)),i.config.before&&(yield i.config.before(i.FormioClass,e,i.config)),i.FormioClass.license=!0,i._formioReady(i.FormioClass),r}))}static afterCreate(e,o,t){return s(this,void 0,void 0,(function*(){const s=o.querySelector(".formio-loader");return s&&o.removeChild(s),i.FormioClass.events.emit(t,e),i.config.after&&(i.debug("Calling ready callback"),i.config.after(e,i.config)),e}))}static createForm(e,o,t={}){return s(this,void 0,void 0,(function*(){if(i.FormioClass)return i.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0}));const s=yield i.init(e,t);return i.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0})).then((e=>(i.config.submission&&(i.debug("Setting submission",i.config.submission),e.submission=i.config.submission),i.afterCreate(e,s,"formEmbedded"),e)))}))}static builder(e,o,t={}){var r;return s(this,void 0,void 0,(function*(){if(null===(r=i.FormioClass)||void 0===r?void 0:r.builder)return i.FormioClass.builder(e,o,t);const s=yield i.init(e,t,!0);return i.FormioClass.builder(e,o,t).then((e=>(i.afterCreate(e,s,"builderEmbedded"),e)))}))}}o.Formio=c,i=c,c.FormioClass=null,c.config={},c.modules=[],c.icons="",c.license="",c.formioReady=new Promise(((e,o)=>{i._formioReady=e,i._formioReadyReject=o})),c.version="5.0.0-rc.54",c.Report={create:(e,o,t={})=>s(void 0,void 0,void 0,(function*(){var s;if(null===(s=i.FormioClass)||void 0===s?void 0:s.Report)return i.FormioClass.Report.create(e,o,t);const r=yield i.init(e,t,!0);return i.FormioClass.Report.create(e,o,t).then((e=>(i.afterCreate(e,r,"reportEmbedded"),e)))}))},n.default.defaultCDN=c.version.includes("rc")?"https://cdn.test-form.io":"https://cdn.form.io";class a{constructor(e,o,t){this.form=o,this.element=e,this.options=t||{},this.init(),this.instance={proxy:!0,ready:this.ready,destroy:()=>{}}}init(){this.instance&&!this.instance.proxy&&this.instance.destroy(),this.element.innerHTML="",this.ready=this.create().then((e=>(this.instance=e,this.form=e.form,e)))}create(){return c.createForm(this.element,this.form,this.options)}setForm(e){this.form=e,this.instance&&this.instance.setForm(e)}setDisplay(e){return this.instance.proxy||(this.form.display=e,this.instance.destroy(),this.ready=this.create().then((e=>{this.instance=e,this.setForm(this.form)}))),this.ready}}o.Form=a;class d extends a{create(){return c.builder(this.element,this.form,this.options)}}o.FormBuilder=d,c.Form=a,c.FormBuilder=d}},o={};var t={};return(0,function t(i){var s=o[i];if(void 0!==s)return s.exports;var r=o[i]={exports:{}};return e[i].call(r.exports,r,r.exports,t),r.exports}(96517).embed)(),t.Formio}()}));
2
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.Formio=o():e.Formio=o()}(self,(function(){return function(){"use strict";var e={56036:function(e,o){Object.defineProperty(o,"__esModule",{value:!0});class i{constructor(e,o={}){this.baseUrl=e||i.defaultCDN,this.overrides=o,this.libs={js:"",ace:"1.4.12",bootstrap:"5.3.2",bootstrap4:"4.6.2",bootstrap5:"5.3.2","bootstrap-icons":"1.11.1",ckeditor:"19.0.0",flatpickr:"4.6.8","flatpickr-formio":"4.6.13-formio.3","font-awesome":"4.7.0",grid:"latest","moment-timezone":"latest",quill:"2.0.0-dev.3","shortcut-buttons-flatpickr":"0.4.0",uswds:"2.4.8",core:""},this.updateUrls()}getVersion(e){return this.libs[e]}setVersion(e,o){this.libs[e]=o,this.updateUrls()}setBaseUrl(e){this.baseUrl=e,this.updateUrls()}setOverrideUrl(e,o){this.overrides[e]=o,this.updateUrls()}removeOverride(e){delete this.overrides[e],this.updateUrls()}removeOverrides(){this.overrides={},this.updateUrls()}buildUrl(e,o,i){let t=e;return o&&(t+=`/${o}`),i&&"latest"!==i&&(t+=`/${i}`),t}updateUrls(){for(const e in this.libs)if(e in this.overrides)if("string"==typeof this.overrides[e])this[e]=this.buildUrl(this.overrides[e],e,this.libs[e]);else{const o=this.overrides[e];this[e]=this.buildUrl(o.cdn,o.lib||"",o.version||"")}else this[e]=this.buildUrl(this.baseUrl,e,this.libs[e])}}i.defaultCDN="https://cdn.form.io",o.default=i},96517:function(e,o,i){Object.defineProperty(o,"__esModule",{value:!0}),o.Formio=o.embed=void 0;const t=i(95413);Object.defineProperty(o,"Formio",{enumerable:!0,get:function(){return t.Formio}}),o.embed=function(e={}){const o=document.getElementsByTagName("script");e=Object.assign({},window.FormioConfig||{},e);let i=null,s=o.length;const r=e.scriptName||"formio.embed.";for(;s--;)if(o[s].src&&-1!==o[s].src.indexOf(r)){i=o[s];break}if(i){const o={};i.src.replace(/^[^?]+\??/,"").replace(/\?/g,"&").split("&").forEach((e=>{o[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}));let s=i.src.replace(/^([^?]+).*/,"$1").split("/");s.pop(),e.formioPath&&e.formioPath(s),s=s.join("/");const r="true"===o.debug||"1"===o.debug,n=r?"formio.form":"formio.form.min";t.Formio.config=Object.assign({script:o.script||`${e.updatePath?e.updatePath():s}/${n}.js`,style:o.styles||`${e.updatePath?e.updatePath():s}/${n}.css`,cdn:o.cdn,class:o.class||"formio-form-wrapper",src:o.src,form:null,submission:null,project:o.project,base:o.base||"https://api.form.io",submit:o.submit,includeLibs:"true"===o.libs||"1"===o.libs,template:o.template,debug:r,config:{},redirect:o.return||o.redirect,embedCSS:`${e.updatePath?e.updatePath():s}/formio.embed.css`,success:o.success||"Thank you for your submission!",before:null,after:null},e);const c=t.Formio.config.form||t.Formio.config.src;if(c){t.Formio.debug("Embedding Configuration",e),t.Formio.config.addPremiumLib&&t.Formio.config.addPremiumLib(t.Formio.config,s),t.Formio.config.id=`formio-${Math.random().toString(36).substring(7)}`,t.Formio.debug("Creating form element");const o=t.Formio.createElement("div",{id:t.Formio.config.id,class:t.Formio.config.class});i.parentNode.insertBefore(o,i.parentNode.firstElementChild.nextSibling),t.Formio.createForm(o,c,t.Formio.config.config).then((e=>{t.Formio.config.submit&&(e.nosubmit=!0),e.on("submit",(o=>{if(t.Formio.debug("on('submit')",o),t.Formio.config.submit){t.Formio.debug(`Sending submission to ${t.Formio.config.submit}`);const i={"content-type":"application/json"},s=t.Formio.FormioClass.getToken();s&&(i["x-jwt-token"]=s),t.Formio.FormioClass.fetch(t.Formio.config.submit,{body:JSON.stringify(o),headers:i,method:"POST",mode:"cors"}).then((e=>e.json())).then((o=>t.Formio.submitDone(e,o)))}else t.Formio.submitDone(e,o)}))}))}}else document.write("<span>Could not locate the Embedded form.</span>")}},95413:function(e,o,i){var t,s=this&&this.__awaiter||function(e,o,i,t){return new(i||(i=Promise))((function(s,r){function n(e){try{a(t.next(e))}catch(e){r(e)}}function c(e){try{a(t.throw(e))}catch(e){r(e)}}function a(e){var o;e.done?s(e.value):(o=e.value,o instanceof i?o:new i((function(e){e(o)}))).then(n,c)}a((t=t.apply(e,o||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.FormBuilder=o.Form=o.Formio=void 0;const n=r(i(56036));class c{static setLicense(e,o=!1){t.license=e,!o&&t.FormioClass&&t.FormioClass.setLicense(e)}static setBaseUrl(e,o=!1){t.baseUrl=e,!o&&t.FormioClass&&t.FormioClass.setBaseUrl(e)}static setApiUrl(e,o=!1){t.baseUrl=e,!o&&t.FormioClass&&t.FormioClass.setApiUrl(e)}static setProjectUrl(e,o=!1){t.projectUrl=e,!o&&t.FormioClass&&t.FormioClass.setProjectUrl(e)}static setAppUrl(e,o=!1){t.projectUrl=e,!o&&t.FormioClass&&t.FormioClass.setAppUrl(e)}static setPathType(e,o=!1){t.pathType=e,!o&&t.FormioClass&&t.FormioClass.setPathType(e)}static debug(...e){t.config.debug&&console.log(...e)}static clearCache(){t.FormioClass&&t.FormioClass.clearCache()}static global(e,o=""){const i=window[e];return o&&i&&!i[o]?null:(t.debug(`Getting global ${e}`,i),i)}static use(e){t.FormioClass&&t.FormioClass.isRenderer?t.FormioClass.use(e):t.modules.push(e)}static createElement(e,o,i){const s=document.createElement(e);return Object.keys(o).forEach((e=>{s.setAttribute(e,o[e])})),(i||[]).forEach((e=>{s.appendChild(t.createElement(e.tag,e.attrs,e.children))})),s}static addScript(e,o,i,r=""){return s(this,void 0,void 0,(function*(){if(!o)return Promise.resolve();if("string"!=typeof o&&o.length)return Promise.all(o.map((o=>t.addScript(e,o))));if(i&&t.global(i,r))return t.debug(`${i} already loaded.`),Promise.resolve(t.global(i));t.debug("Adding Script",o);try{e.appendChild(t.createElement("script",{src:o}))}catch(e){return t.debug(e),Promise.resolve()}return i?new Promise((e=>{t.debug(`Waiting to load ${i}`);const o=setInterval((()=>{t.global(i,r)&&(clearInterval(o),t.debug(`${i} loaded.`),e(t.global(i)))}),100)})):Promise.resolve()}))}static addStyles(e,o){return s(this,void 0,void 0,(function*(){o&&("string"!=typeof o&&o.length?o.forEach((o=>t.addStyles(e,o))):(t.debug("Adding Styles",o),e.appendChild(t.createElement("link",{rel:"stylesheet",href:o}))))}))}static submitDone(e,o){return s(this,void 0,void 0,(function*(){t.debug("Submision Complete",o);const i=(t.config.success||"").toString();i&&"false"!==i.toLowerCase()&&e.element&&(e.element.innerHTML=`<div class="alert-success" role="alert">${i}</div>`);let s=t.config.redirect;if(!s&&e._form&&e._form.settings&&(e._form.settings.returnUrl||e._form.settings.redirect)&&(t.debug("Return url found in form configuration"),s=e._form.settings.returnUrl||e._form.settings.redirect),s){const i=e.formio?e.formio.formUrl:"",r=!!s.match(/\?/),n=0===s.indexOf(location.origin);s+=r?"&":"?",s+=`sub=${o._id}`,!n&&i&&(s+=`&form=${encodeURIComponent(i)}`),t.debug("Return URL",s),window.location.href=s,n&&window.location.reload()}}))}static formioScript(e,o){return o=o||t.config.includeBuilder,t.fullAdded||o?(t.fullAdded=!0,e.replace("formio.form","formio.full")):e}static addLibrary(e,o,i){return s(this,void 0,void 0,(function*(){if(o){if(o.dependencies)for(let i=0;i<o.dependencies.length;i++)yield t.addLibrary(e,t.cdn.libs[o.dependencies[i]]);if(o.css&&(yield t.addStyles(e,o.css)),o.js){const s=yield t.addScript(e,o.js,!!o.use&&i);if(o.use){t.debug(`Using ${i}`);const e=o.options||{};!e.license&&t.license&&(e.license=t.license),t.use("function"==typeof o.use?o.use(s):s,e)}}}}))}static addLoader(e){return s(this,void 0,void 0,(function*(){e.appendChild(t.createElement("div",{class:"formio-loader"},[{tag:"div",attrs:{class:"loader-wrapper"},children:[{tag:"div",attrs:{class:"loader text-center"}}]}]))}))}static init(e,o={},i=!1){return s(this,void 0,void 0,(function*(){t.cdn=new n.default(t.config.cdn,t.config.cdnUrls||{}),t.config.libs=t.config.libs||{uswds:{dependencies:["fontawesome"],js:`${t.cdn.uswds}/uswds.min.js`,css:`${t.cdn.uswds}/uswds.min.css`,use:!0},fontawesome:{css:`${t.cdn["font-awesome"]}/css/font-awesome.min.css`},bootstrap4:{dependencies:["fontawesome"],css:`${t.cdn.bootstrap4}/css/bootstrap.min.css`},bootstrap:{dependencies:["bootstrap-icons"],css:`${t.cdn.bootstrap}/css/bootstrap.min.css`},"bootstrap-icons":{css:`${t.cdn["bootstrap-icons"]}/css/bootstrap-icons.css`}};const s=t.config.id||`formio-${Math.random().toString(36).substring(7)}`;let r=t.createElement("div",{id:`${s}-wrapper`});e.parentNode.insertBefore(r,e);const c=t.config.includeLibs&&"function"==typeof r.attachShadow;c&&(r=r.attachShadow({mode:"open"}),o.shadowRoot=r),e.parentNode.removeChild(e),r.appendChild(e);const a=c?r:document.body;yield t.addStyles(a,t.config.embedCSS||`${t.cdn.js}/formio.embed.css`),t.addLoader(r);const l=t.config.full?"formio.full":"formio.form",d=t.config.debug?l:`${l}.min`;if(t.FormioClass=yield t.addScript(a,t.formioScript(t.config.script||`${t.cdn.js}/${d}.js`,i),"Formio",i?"isBuilder":"isRenderer"),t.FormioClass.cdn=t.cdn,t.FormioClass.setBaseUrl(o.baseUrl||t.baseUrl||t.config.base),t.FormioClass.setProjectUrl(o.projectUrl||t.projectUrl||t.config.project),t.FormioClass.language=t.language,t.setLicense(t.license||t.config.license||!1),t.modules.forEach((e=>{t.FormioClass.use(e)})),t.icons&&(t.FormioClass.icons=t.icons),t.pathType&&t.FormioClass.setPathType(t.pathType),t.config.template&&t.config.includeLibs&&(yield t.addLibrary(a,t.config.libs[t.config.template],t.config.template)),t.config.libraries||(t.config.libraries=t.config.modules||{}),t.config.premium&&(t.config.libraries.premium=t.config.premium),t.config.libraries)for(const e in t.config.libraries){const o=t.config.libraries[e];o.use=o.use||!0,yield t.addLibrary(a,o,e)}return yield t.addStyles(a,t.formioScript(t.config.style||`${t.cdn.js}/${d}.css`,i)),t.config.before&&(yield t.config.before(t.FormioClass,e,t.config)),t.FormioClass.license=!0,t._formioReady(t.FormioClass),r}))}static afterCreate(e,o,i){return s(this,void 0,void 0,(function*(){const s=o.querySelector(".formio-loader");return s&&o.removeChild(s),t.FormioClass.events.emit(i,e),t.config.after&&(t.debug("Calling ready callback"),t.config.after(e,t.config)),e}))}static createForm(e,o,i={}){return s(this,void 0,void 0,(function*(){if(t.FormioClass)return t.FormioClass.createForm(e,o,Object.assign(Object.assign({},i),{noLoader:!0}));const s=yield t.init(e,i);return t.FormioClass.createForm(e,o,Object.assign(Object.assign({},i),{noLoader:!0})).then((e=>(t.config.submission&&(t.debug("Setting submission",t.config.submission),e.submission=t.config.submission),t.afterCreate(e,s,"formEmbedded"),e)))}))}static builder(e,o,i={}){var r;return s(this,void 0,void 0,(function*(){if(null===(r=t.FormioClass)||void 0===r?void 0:r.builder)return t.FormioClass.builder(e,o,i);const s=yield t.init(e,i,!0);return t.FormioClass.builder(e,o,i).then((e=>(t.afterCreate(e,s,"builderEmbedded"),e)))}))}}o.Formio=c,t=c,c.FormioClass=null,c.config={},c.modules=[],c.icons="",c.license="",c.formioReady=new Promise(((e,o)=>{t._formioReady=e,t._formioReadyReject=o})),c.version="5.0.0-rc.56",c.Report={create:(e,o,i={})=>s(void 0,void 0,void 0,(function*(){var s;if(null===(s=t.FormioClass)||void 0===s?void 0:s.Report)return t.FormioClass.Report.create(e,o,i);const r=yield t.init(e,i,!0);return t.FormioClass.Report.create(e,o,i).then((e=>(t.afterCreate(e,r,"reportEmbedded"),e)))}))},n.default.defaultCDN=c.version.includes("rc")?"https://cdn.test-form.io":"https://cdn.form.io";class a{constructor(e,o,i){this.form=o,this.element=e,this.options=i||{},this.init(),this.instance={proxy:!0,ready:this.ready,destroy:()=>{}}}init(){this.instance&&!this.instance.proxy&&this.instance.destroy(),this.element.innerHTML="",this.ready=this.create().then((e=>(this.instance=e,this.form=e.form,e)))}create(){return c.createForm(this.element,this.form,this.options)}setForm(e){this.form=e,this.instance&&this.instance.setForm(e)}setDisplay(e){return this.instance.proxy||(this.form.display=e,this.instance.destroy(),this.ready=this.create().then((e=>{this.instance=e,this.setForm(this.form)}))),this.ready}}o.Form=a;class l extends a{create(){return c.builder(this.element,this.form,this.options)}}o.FormBuilder=l,c.Form=a,c.FormBuilder=l}},o={};var i={};return(0,function i(t){var s=o[t];if(void 0!==s)return s.exports;var r=o[t]={exports:{}};return e[t].call(r.exports,r,r.exports,i),r.exports}(96517).embed)(),i.Formio}()}));
@@ -1 +1 @@
1
- /*! formiojs v5.0.0-rc.54 | https://unpkg.com/formiojs@5.0.0-rc.54/LICENSE.txt */
1
+ /*! formiojs v5.0.0-rc.56 | https://unpkg.com/formiojs@5.0.0-rc.56/LICENSE.txt */