@formio/js 5.2.3 → 5.2.4-rc.0

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 (510) hide show
  1. package/dist/formio.builder.css +161 -50
  2. package/dist/formio.builder.min.css +1 -1
  3. package/dist/formio.embed.js +1 -1
  4. package/dist/formio.embed.min.js +1 -1
  5. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  6. package/dist/formio.form.css +158 -49
  7. package/dist/formio.form.js +152 -108
  8. package/dist/formio.form.min.css +1 -1
  9. package/dist/formio.form.min.js +1 -1
  10. package/dist/formio.form.min.js.LICENSE.txt +1 -1
  11. package/dist/formio.full.css +161 -50
  12. package/dist/formio.full.js +401 -227
  13. package/dist/formio.full.min.css +1 -1
  14. package/dist/formio.full.min.js +1 -1
  15. package/dist/formio.full.min.js.LICENSE.txt +1 -1
  16. package/dist/formio.js +51 -18
  17. package/dist/formio.min.js +1 -1
  18. package/dist/formio.min.js.LICENSE.txt +1 -1
  19. package/dist/formio.utils.js +47 -14
  20. package/dist/formio.utils.min.js +1 -1
  21. package/dist/formio.utils.min.js.LICENSE.txt +1 -1
  22. package/lib/cjs/CDN.js +12 -12
  23. package/lib/cjs/Element.d.ts +3 -2
  24. package/lib/cjs/Element.js +27 -21
  25. package/lib/cjs/Embed.js +74 -40
  26. package/lib/cjs/EventEmitter.js +1 -1
  27. package/lib/cjs/Form.d.ts +371 -341
  28. package/lib/cjs/Form.js +153 -39
  29. package/lib/cjs/FormBuilder.d.ts +3 -3
  30. package/lib/cjs/FormBuilder.js +2 -3
  31. package/lib/cjs/Formio.js +26 -23
  32. package/lib/cjs/InlineEmbed.js +23 -17
  33. package/lib/cjs/PDF.d.ts +1 -0
  34. package/lib/cjs/PDF.js +18 -15
  35. package/lib/cjs/PDFBuilder.js +51 -36
  36. package/lib/cjs/Webform.d.ts +8 -366
  37. package/lib/cjs/Webform.js +176 -235
  38. package/lib/cjs/WebformBuilder.js +217 -144
  39. package/lib/cjs/Wizard.js +92 -62
  40. package/lib/cjs/WizardBuilder.js +27 -19
  41. package/lib/cjs/addons/FormioAddon.js +1 -1
  42. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +59 -57
  43. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +24 -16
  44. package/lib/cjs/addons/index.js +3 -3
  45. package/lib/cjs/components/Components.js +0 -4
  46. package/lib/cjs/components/_classes/component/Component.form.js +11 -11
  47. package/lib/cjs/components/_classes/component/Component.js +298 -179
  48. package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.js +2 -4
  49. package/lib/cjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
  50. package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +9 -11
  51. package/lib/cjs/components/_classes/component/editForm/Component.edit.data.d.ts +37 -0
  52. package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +39 -25
  53. package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +47 -29
  54. package/lib/cjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
  55. package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +5 -7
  56. package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +37 -34
  57. package/lib/cjs/components/_classes/component/editForm/utils.js +12 -16
  58. package/lib/cjs/components/_classes/componentModal/ComponentModal.js +6 -6
  59. package/lib/cjs/components/_classes/field/Field.js +7 -1
  60. package/lib/cjs/components/_classes/input/Input.js +30 -26
  61. package/lib/cjs/components/_classes/list/ListComponent.form.js +1 -1
  62. package/lib/cjs/components/_classes/list/ListComponent.js +27 -18
  63. package/lib/cjs/components/_classes/list/editForm/ListComponent.edit.data.js +36 -9
  64. package/lib/cjs/components/_classes/multivalue/Multivalue.js +32 -13
  65. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +3 -3
  66. package/lib/cjs/components/_classes/nested/NestedComponent.js +36 -32
  67. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +19 -14
  68. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +19 -17
  69. package/lib/cjs/components/address/Address.js +52 -45
  70. package/lib/cjs/components/address/editForm/Address.edit.data.js +2 -2
  71. package/lib/cjs/components/address/editForm/Address.edit.display.js +2 -2
  72. package/lib/cjs/components/address/editForm/Address.edit.provider.js +53 -11
  73. package/lib/cjs/components/alert/Alert.js +21 -15
  74. package/lib/cjs/components/button/Button.form.js +1 -1
  75. package/lib/cjs/components/button/Button.js +50 -27
  76. package/lib/cjs/components/button/editForm/Button.edit.display.js +49 -9
  77. package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
  78. package/lib/cjs/components/checkbox/Checkbox.form.js +3 -3
  79. package/lib/cjs/components/checkbox/Checkbox.js +28 -20
  80. package/lib/cjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
  81. package/lib/cjs/components/checkbox/editForm/Checkbox.edit.display.js +13 -3
  82. package/lib/cjs/components/checkbox/editForm/Checkbox.edit.validation.js +2 -2
  83. package/lib/cjs/components/columns/Columns.form.js +1 -1
  84. package/lib/cjs/components/columns/Columns.js +24 -12
  85. package/lib/cjs/components/columns/editForm/Columns.edit.display.js +17 -17
  86. package/lib/cjs/components/container/Container.form.js +2 -2
  87. package/lib/cjs/components/container/Container.js +6 -4
  88. package/lib/cjs/components/container/editForm/Container.edit.data.js +3 -3
  89. package/lib/cjs/components/container/editForm/Container.edit.display.js +4 -4
  90. package/lib/cjs/components/content/Content.form.js +4 -2
  91. package/lib/cjs/components/content/Content.js +10 -8
  92. package/lib/cjs/components/content/editForm/Content.edit.display.js +10 -10
  93. package/lib/cjs/components/currency/Currency.form.js +3 -3
  94. package/lib/cjs/components/currency/Currency.js +19 -10
  95. package/lib/cjs/components/currency/editForm/Currency.edit.data.js +5 -5
  96. package/lib/cjs/components/currency/editForm/Currency.edit.display.js +8 -8
  97. package/lib/cjs/components/datagrid/DataGrid.form.js +3 -3
  98. package/lib/cjs/components/datagrid/DataGrid.js +89 -38
  99. package/lib/cjs/components/datagrid/editForm/DataGrid.edit.data.js +1 -1
  100. package/lib/cjs/components/datagrid/editForm/DataGrid.edit.display.js +14 -14
  101. package/lib/cjs/components/datagrid/editForm/DataGrid.edit.validation.js +3 -3
  102. package/lib/cjs/components/datamap/DataMap.form.js +2 -2
  103. package/lib/cjs/components/datamap/DataMap.js +44 -31
  104. package/lib/cjs/components/datamap/editForm/DataMap.edit.data.js +1 -1
  105. package/lib/cjs/components/datamap/editForm/DataMap.edit.display.js +8 -8
  106. package/lib/cjs/components/datetime/DateTime.form.js +5 -5
  107. package/lib/cjs/components/datetime/DateTime.js +30 -15
  108. package/lib/cjs/components/datetime/editForm/DateTime.edit.data.js +4 -3
  109. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
  110. package/lib/cjs/components/datetime/editForm/DateTime.edit.display.js +22 -17
  111. package/lib/cjs/components/datetime/editForm/DateTime.edit.time.js +5 -5
  112. package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.js +3 -3
  113. package/lib/cjs/components/day/Day.form.js +5 -5
  114. package/lib/cjs/components/day/Day.js +146 -56
  115. package/lib/cjs/components/day/editForm/Day.edit.day.js +13 -9
  116. package/lib/cjs/components/day/editForm/Day.edit.display.js +7 -7
  117. package/lib/cjs/components/day/editForm/Day.edit.month.js +12 -8
  118. package/lib/cjs/components/day/editForm/Day.edit.validation.js +7 -7
  119. package/lib/cjs/components/day/editForm/Day.edit.year.js +8 -8
  120. package/lib/cjs/components/editgrid/EditGrid.form.js +2 -2
  121. package/lib/cjs/components/editgrid/EditGrid.js +137 -89
  122. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
  123. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +7 -2
  124. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +16 -16
  125. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.validation.js +3 -3
  126. package/lib/cjs/components/email/Email.js +4 -4
  127. package/lib/cjs/components/email/editForm/Email.edit.display.js +3 -3
  128. package/lib/cjs/components/email/editForm/Email.edit.validation.js +6 -6
  129. package/lib/cjs/components/fieldset/Fieldset.form.js +1 -1
  130. package/lib/cjs/components/fieldset/Fieldset.js +2 -2
  131. package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -8
  132. package/lib/cjs/components/file/File.form.js +4 -4
  133. package/lib/cjs/components/file/File.js +126 -80
  134. package/lib/cjs/components/file/editForm/File.edit.display.js +9 -5
  135. package/lib/cjs/components/file/editForm/File.edit.file.d.ts +37 -16
  136. package/lib/cjs/components/file/editForm/File.edit.file.js +169 -72
  137. package/lib/cjs/components/file/editForm/File.edit.validation.js +2 -2
  138. package/lib/cjs/components/form/Form.form.js +3 -3
  139. package/lib/cjs/components/form/Form.js +67 -51
  140. package/lib/cjs/components/form/editForm/Form.edit.data.js +1 -3
  141. package/lib/cjs/components/form/editForm/Form.edit.display.js +6 -7
  142. package/lib/cjs/components/form/editForm/Form.edit.form.js +11 -9
  143. package/lib/cjs/components/hidden/Hidden.form.js +4 -4
  144. package/lib/cjs/components/hidden/Hidden.js +2 -2
  145. package/lib/cjs/components/hidden/editForm/Hidden.edit.data.js +3 -3
  146. package/lib/cjs/components/hidden/editForm/Hidden.edit.display.js +10 -10
  147. package/lib/cjs/components/html/HTML.js +23 -17
  148. package/lib/cjs/components/html/editForm/HTML.edit.display.js +17 -17
  149. package/lib/cjs/components/html/editForm/HTML.edit.logic.js +2 -2
  150. package/lib/cjs/components/number/Number.form.js +3 -3
  151. package/lib/cjs/components/number/Number.js +27 -11
  152. package/lib/cjs/components/number/editForm/Number.edit.data.js +3 -3
  153. package/lib/cjs/components/number/editForm/Number.edit.display.js +4 -4
  154. package/lib/cjs/components/number/editForm/Number.edit.validation.js +9 -9
  155. package/lib/cjs/components/panel/Panel.form.js +1 -1
  156. package/lib/cjs/components/panel/Panel.js +2 -2
  157. package/lib/cjs/components/panel/editForm/Panel.edit.conditional.js +5 -7
  158. package/lib/cjs/components/panel/editForm/Panel.edit.display.js +55 -29
  159. package/lib/cjs/components/password/Password.form.js +3 -3
  160. package/lib/cjs/components/password/Password.js +5 -2
  161. package/lib/cjs/components/password/editForm/Password.edit.data.js +11 -11
  162. package/lib/cjs/components/password/editForm/Password.edit.display.js +3 -3
  163. package/lib/cjs/components/password/editForm/Password.edit.validation.js +3 -3
  164. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +8 -8
  165. package/lib/cjs/components/phonenumber/PhoneNumber.js +3 -3
  166. package/lib/cjs/components/phonenumber/editForm/PhoneNumber.edit.validation.js +6 -6
  167. package/lib/cjs/components/radio/Radio.form.js +3 -3
  168. package/lib/cjs/components/radio/Radio.js +55 -26
  169. package/lib/cjs/components/radio/editForm/Radio.edit.data.js +23 -9
  170. package/lib/cjs/components/radio/editForm/Radio.edit.display.js +6 -6
  171. package/lib/cjs/components/radio/editForm/Radio.edit.validation.js +2 -2
  172. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +5 -5
  173. package/lib/cjs/components/recaptcha/ReCaptcha.js +7 -5
  174. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +24 -24
  175. package/lib/cjs/components/select/Select.form.js +3 -3
  176. package/lib/cjs/components/select/Select.js +235 -129
  177. package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +1 -1
  178. package/lib/cjs/components/select/editForm/Select.edit.data.js +191 -57
  179. package/lib/cjs/components/select/editForm/Select.edit.display.js +2 -2
  180. package/lib/cjs/components/select/editForm/Select.edit.validation.js +4 -4
  181. package/lib/cjs/components/selectboxes/SelectBoxes.form.js +3 -3
  182. package/lib/cjs/components/selectboxes/SelectBoxes.js +31 -15
  183. package/lib/cjs/components/selectboxes/editForm/SelectBoxes.edit.validation.js +5 -5
  184. package/lib/cjs/components/signature/Signature.form.js +3 -3
  185. package/lib/cjs/components/signature/Signature.js +25 -15
  186. package/lib/cjs/components/signature/editForm/Signature.edit.display.js +19 -10
  187. package/lib/cjs/components/survey/Survey.form.js +3 -3
  188. package/lib/cjs/components/survey/Survey.js +30 -17
  189. package/lib/cjs/components/survey/editForm/Survey.edit.data.js +23 -11
  190. package/lib/cjs/components/survey/editForm/Survey.edit.display.js +1 -1
  191. package/lib/cjs/components/survey/editForm/Survey.edit.validation.js +1 -1
  192. package/lib/cjs/components/table/Table.form.js +1 -1
  193. package/lib/cjs/components/table/Table.js +7 -5
  194. package/lib/cjs/components/table/editForm/Table.edit.display.js +22 -22
  195. package/lib/cjs/components/tabs/Tabs.form.js +1 -1
  196. package/lib/cjs/components/tabs/Tabs.js +26 -8
  197. package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +21 -17
  198. package/lib/cjs/components/tags/Tags.form.js +1 -1
  199. package/lib/cjs/components/tags/Tags.js +28 -12
  200. package/lib/cjs/components/tags/editForm/Tags.edit.data.js +7 -7
  201. package/lib/cjs/components/textarea/TextArea.form.js +2 -2
  202. package/lib/cjs/components/textarea/TextArea.js +63 -45
  203. package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +96 -72
  204. package/lib/cjs/components/textarea/editForm/TextArea.edit.validation.js +3 -3
  205. package/lib/cjs/components/textfield/TextField.form.js +3 -3
  206. package/lib/cjs/components/textfield/TextField.js +32 -21
  207. package/lib/cjs/components/textfield/editForm/TextField.edit.data.js +15 -13
  208. package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +31 -21
  209. package/lib/cjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
  210. package/lib/cjs/components/time/Time.js +17 -10
  211. package/lib/cjs/components/time/editForm/Time.edit.display.js +2 -2
  212. package/lib/cjs/components/unknown/Unknown.form.js +5 -5
  213. package/lib/cjs/components/unknown/Unknown.js +2 -2
  214. package/lib/cjs/components/unknown/editForm/Unknown.edit.display.js +3 -3
  215. package/lib/cjs/components/url/Url.form.js +3 -3
  216. package/lib/cjs/components/url/Url.js +2 -2
  217. package/lib/cjs/components/url/editForm/Url.edit.display.js +3 -3
  218. package/lib/cjs/components/url/editForm/Url.edit.validation.js +1 -1
  219. package/lib/cjs/components/well/Well.form.js +1 -1
  220. package/lib/cjs/components/well/Well.js +2 -2
  221. package/lib/cjs/components/well/editForm/Well.edit.display.js +10 -10
  222. package/lib/cjs/formio.form.d.ts +2 -1
  223. package/lib/cjs/formio.form.js +38 -12
  224. package/lib/cjs/i18n.d.ts +4 -0
  225. package/lib/cjs/i18n.js +7 -3
  226. package/lib/cjs/package.json +1 -1
  227. package/lib/cjs/providers/address/AddressProvider.js +8 -5
  228. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +3 -3
  229. package/lib/cjs/providers/address/GoogleAddressProvider.js +24 -13
  230. package/lib/cjs/providers/processor/fileProcessor.js +3 -1
  231. package/lib/cjs/providers/storage/azure.js +5 -2
  232. package/lib/cjs/providers/storage/dropbox.js +4 -5
  233. package/lib/cjs/providers/storage/googleDrive.js +3 -4
  234. package/lib/cjs/providers/storage/index.js +1 -1
  235. package/lib/cjs/providers/storage/indexeddb.js +16 -6
  236. package/lib/cjs/providers/storage/s3.js +17 -6
  237. package/lib/cjs/providers/storage/uploadAdapter.js +17 -11
  238. package/lib/cjs/providers/storage/url.js +13 -11
  239. package/lib/cjs/providers/storage/xhr.js +17 -9
  240. package/lib/cjs/templates/index.js +1 -1
  241. package/lib/cjs/translations/de.d.ts +80 -0
  242. package/lib/cjs/translations/de.js +81 -0
  243. package/lib/cjs/translations/en.d.ts +0 -2
  244. package/lib/cjs/translations/en.js +7 -9
  245. package/lib/cjs/utils/ChoicesWrapper.js +2 -2
  246. package/lib/cjs/utils/builder.js +31 -7
  247. package/lib/cjs/utils/calendarUtils.js +7 -5
  248. package/lib/cjs/utils/conditionOperators/ConditionOperator.js +1 -1
  249. package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +12 -4
  250. package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +3 -1
  251. package/lib/cjs/utils/conditionOperators/IsEqualTo.js +10 -6
  252. package/lib/cjs/utils/conditionOperators/index.js +1 -1
  253. package/lib/cjs/utils/formUtils.js +1 -1
  254. package/lib/cjs/utils/i18n.js +7 -1
  255. package/lib/cjs/utils/index.d.ts +2 -1
  256. package/lib/cjs/utils/index.js +2 -2
  257. package/lib/cjs/utils/utils.d.ts +10 -1
  258. package/lib/cjs/utils/utils.js +175 -92
  259. package/lib/cjs/widgets/CalendarWidget.js +66 -49
  260. package/lib/cjs/widgets/InputWidget.js +6 -4
  261. package/lib/cjs/widgets/index.js +1 -1
  262. package/lib/mjs/CDN.js +12 -12
  263. package/lib/mjs/Element.d.ts +3 -2
  264. package/lib/mjs/Element.js +27 -21
  265. package/lib/mjs/Embed.js +76 -42
  266. package/lib/mjs/EventEmitter.js +1 -1
  267. package/lib/mjs/Form.d.ts +371 -341
  268. package/lib/mjs/Form.js +142 -126
  269. package/lib/mjs/FormBuilder.d.ts +3 -3
  270. package/lib/mjs/FormBuilder.js +2 -3
  271. package/lib/mjs/Formio.js +26 -23
  272. package/lib/mjs/InlineEmbed.js +23 -17
  273. package/lib/mjs/PDF.d.ts +1 -0
  274. package/lib/mjs/PDF.js +18 -15
  275. package/lib/mjs/PDFBuilder.js +51 -36
  276. package/lib/mjs/Webform.d.ts +8 -366
  277. package/lib/mjs/Webform.js +183 -250
  278. package/lib/mjs/WebformBuilder.js +220 -147
  279. package/lib/mjs/Wizard.js +93 -63
  280. package/lib/mjs/WizardBuilder.js +27 -19
  281. package/lib/mjs/addons/FormioAddon.js +1 -1
  282. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +59 -57
  283. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +24 -16
  284. package/lib/mjs/addons/index.js +3 -3
  285. package/lib/mjs/components/Components.js +0 -4
  286. package/lib/mjs/components/_classes/component/Component.form.js +11 -11
  287. package/lib/mjs/components/_classes/component/Component.js +303 -184
  288. package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.js +2 -4
  289. package/lib/mjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
  290. package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +9 -11
  291. package/lib/mjs/components/_classes/component/editForm/Component.edit.data.d.ts +37 -0
  292. package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +39 -25
  293. package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +47 -29
  294. package/lib/mjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
  295. package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +5 -7
  296. package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +37 -34
  297. package/lib/mjs/components/_classes/component/editForm/utils.js +12 -16
  298. package/lib/mjs/components/_classes/componentModal/ComponentModal.js +2 -2
  299. package/lib/mjs/components/_classes/field/Field.js +8 -2
  300. package/lib/mjs/components/_classes/input/Input.js +27 -23
  301. package/lib/mjs/components/_classes/list/ListComponent.form.js +1 -1
  302. package/lib/mjs/components/_classes/list/ListComponent.js +27 -18
  303. package/lib/mjs/components/_classes/list/editForm/ListComponent.edit.data.js +36 -9
  304. package/lib/mjs/components/_classes/multivalue/Multivalue.js +32 -13
  305. package/lib/mjs/components/_classes/nested/NestedComponent.form.js +3 -3
  306. package/lib/mjs/components/_classes/nested/NestedComponent.js +32 -28
  307. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +20 -15
  308. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +19 -17
  309. package/lib/mjs/components/address/Address.js +57 -46
  310. package/lib/mjs/components/address/editForm/Address.edit.data.js +2 -2
  311. package/lib/mjs/components/address/editForm/Address.edit.display.js +2 -2
  312. package/lib/mjs/components/address/editForm/Address.edit.provider.js +53 -11
  313. package/lib/mjs/components/alert/Alert.js +22 -16
  314. package/lib/mjs/components/button/Button.form.js +1 -1
  315. package/lib/mjs/components/button/Button.js +51 -28
  316. package/lib/mjs/components/button/editForm/Button.edit.display.js +49 -9
  317. package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
  318. package/lib/mjs/components/checkbox/Checkbox.form.js +3 -3
  319. package/lib/mjs/components/checkbox/Checkbox.js +29 -21
  320. package/lib/mjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
  321. package/lib/mjs/components/checkbox/editForm/Checkbox.edit.display.js +13 -3
  322. package/lib/mjs/components/checkbox/editForm/Checkbox.edit.validation.js +2 -2
  323. package/lib/mjs/components/columns/Columns.form.js +1 -1
  324. package/lib/mjs/components/columns/Columns.js +24 -12
  325. package/lib/mjs/components/columns/editForm/Columns.edit.display.js +17 -17
  326. package/lib/mjs/components/container/Container.form.js +2 -2
  327. package/lib/mjs/components/container/Container.js +6 -4
  328. package/lib/mjs/components/container/editForm/Container.edit.data.js +3 -3
  329. package/lib/mjs/components/container/editForm/Container.edit.display.js +4 -4
  330. package/lib/mjs/components/content/Content.form.js +4 -2
  331. package/lib/mjs/components/content/Content.js +10 -8
  332. package/lib/mjs/components/content/editForm/Content.edit.display.js +10 -10
  333. package/lib/mjs/components/currency/Currency.form.js +3 -3
  334. package/lib/mjs/components/currency/Currency.js +19 -10
  335. package/lib/mjs/components/currency/editForm/Currency.edit.data.js +5 -5
  336. package/lib/mjs/components/currency/editForm/Currency.edit.display.js +8 -8
  337. package/lib/mjs/components/datagrid/DataGrid.form.js +3 -3
  338. package/lib/mjs/components/datagrid/DataGrid.js +90 -39
  339. package/lib/mjs/components/datagrid/editForm/DataGrid.edit.data.js +1 -1
  340. package/lib/mjs/components/datagrid/editForm/DataGrid.edit.display.js +14 -14
  341. package/lib/mjs/components/datagrid/editForm/DataGrid.edit.validation.js +3 -3
  342. package/lib/mjs/components/datamap/DataMap.form.js +2 -2
  343. package/lib/mjs/components/datamap/DataMap.js +44 -31
  344. package/lib/mjs/components/datamap/editForm/DataMap.edit.data.js +1 -1
  345. package/lib/mjs/components/datamap/editForm/DataMap.edit.display.js +8 -8
  346. package/lib/mjs/components/datetime/DateTime.form.js +5 -5
  347. package/lib/mjs/components/datetime/DateTime.js +31 -16
  348. package/lib/mjs/components/datetime/editForm/DateTime.edit.data.js +4 -3
  349. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
  350. package/lib/mjs/components/datetime/editForm/DateTime.edit.display.js +22 -17
  351. package/lib/mjs/components/datetime/editForm/DateTime.edit.time.js +5 -5
  352. package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.js +3 -3
  353. package/lib/mjs/components/day/Day.form.js +5 -5
  354. package/lib/mjs/components/day/Day.js +147 -57
  355. package/lib/mjs/components/day/editForm/Day.edit.day.js +13 -9
  356. package/lib/mjs/components/day/editForm/Day.edit.display.js +7 -7
  357. package/lib/mjs/components/day/editForm/Day.edit.month.js +12 -8
  358. package/lib/mjs/components/day/editForm/Day.edit.validation.js +7 -7
  359. package/lib/mjs/components/day/editForm/Day.edit.year.js +8 -8
  360. package/lib/mjs/components/editgrid/EditGrid.form.js +2 -2
  361. package/lib/mjs/components/editgrid/EditGrid.js +138 -90
  362. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
  363. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +7 -2
  364. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +16 -16
  365. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.validation.js +3 -3
  366. package/lib/mjs/components/email/Email.js +4 -4
  367. package/lib/mjs/components/email/editForm/Email.edit.display.js +3 -3
  368. package/lib/mjs/components/email/editForm/Email.edit.validation.js +6 -6
  369. package/lib/mjs/components/fieldset/Fieldset.form.js +1 -1
  370. package/lib/mjs/components/fieldset/Fieldset.js +2 -2
  371. package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -8
  372. package/lib/mjs/components/file/File.form.js +4 -4
  373. package/lib/mjs/components/file/File.js +131 -84
  374. package/lib/mjs/components/file/editForm/File.edit.display.js +9 -5
  375. package/lib/mjs/components/file/editForm/File.edit.file.d.ts +37 -16
  376. package/lib/mjs/components/file/editForm/File.edit.file.js +169 -72
  377. package/lib/mjs/components/file/editForm/File.edit.validation.js +2 -2
  378. package/lib/mjs/components/form/Form.form.js +3 -3
  379. package/lib/mjs/components/form/Form.js +67 -51
  380. package/lib/mjs/components/form/editForm/Form.edit.data.js +1 -3
  381. package/lib/mjs/components/form/editForm/Form.edit.display.js +6 -7
  382. package/lib/mjs/components/form/editForm/Form.edit.form.js +10 -8
  383. package/lib/mjs/components/hidden/Hidden.form.js +4 -4
  384. package/lib/mjs/components/hidden/Hidden.js +2 -2
  385. package/lib/mjs/components/hidden/editForm/Hidden.edit.data.js +3 -3
  386. package/lib/mjs/components/hidden/editForm/Hidden.edit.display.js +10 -10
  387. package/lib/mjs/components/html/HTML.js +23 -17
  388. package/lib/mjs/components/html/editForm/HTML.edit.display.js +17 -17
  389. package/lib/mjs/components/html/editForm/HTML.edit.logic.js +2 -2
  390. package/lib/mjs/components/number/Number.form.js +3 -3
  391. package/lib/mjs/components/number/Number.js +28 -12
  392. package/lib/mjs/components/number/editForm/Number.edit.data.js +3 -3
  393. package/lib/mjs/components/number/editForm/Number.edit.display.js +4 -4
  394. package/lib/mjs/components/number/editForm/Number.edit.validation.js +9 -9
  395. package/lib/mjs/components/panel/Panel.form.js +1 -1
  396. package/lib/mjs/components/panel/Panel.js +2 -2
  397. package/lib/mjs/components/panel/editForm/Panel.edit.conditional.js +6 -8
  398. package/lib/mjs/components/panel/editForm/Panel.edit.display.js +55 -29
  399. package/lib/mjs/components/password/Password.form.js +3 -3
  400. package/lib/mjs/components/password/Password.js +5 -2
  401. package/lib/mjs/components/password/editForm/Password.edit.data.js +11 -11
  402. package/lib/mjs/components/password/editForm/Password.edit.display.js +3 -3
  403. package/lib/mjs/components/password/editForm/Password.edit.validation.js +3 -3
  404. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +8 -8
  405. package/lib/mjs/components/phonenumber/PhoneNumber.js +3 -3
  406. package/lib/mjs/components/phonenumber/editForm/PhoneNumber.edit.validation.js +6 -6
  407. package/lib/mjs/components/radio/Radio.form.js +3 -3
  408. package/lib/mjs/components/radio/Radio.js +56 -27
  409. package/lib/mjs/components/radio/editForm/Radio.edit.data.js +23 -9
  410. package/lib/mjs/components/radio/editForm/Radio.edit.display.js +6 -6
  411. package/lib/mjs/components/radio/editForm/Radio.edit.validation.js +2 -2
  412. package/lib/mjs/components/recaptcha/ReCaptcha.form.js +5 -5
  413. package/lib/mjs/components/recaptcha/ReCaptcha.js +7 -5
  414. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +24 -24
  415. package/lib/mjs/components/select/Select.form.js +3 -3
  416. package/lib/mjs/components/select/Select.js +240 -134
  417. package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +1 -1
  418. package/lib/mjs/components/select/editForm/Select.edit.data.js +191 -57
  419. package/lib/mjs/components/select/editForm/Select.edit.display.js +2 -2
  420. package/lib/mjs/components/select/editForm/Select.edit.validation.js +4 -4
  421. package/lib/mjs/components/selectboxes/SelectBoxes.form.js +3 -3
  422. package/lib/mjs/components/selectboxes/SelectBoxes.js +32 -16
  423. package/lib/mjs/components/selectboxes/editForm/SelectBoxes.edit.validation.js +5 -5
  424. package/lib/mjs/components/signature/Signature.form.js +3 -3
  425. package/lib/mjs/components/signature/Signature.js +25 -15
  426. package/lib/mjs/components/signature/editForm/Signature.edit.display.js +19 -10
  427. package/lib/mjs/components/survey/Survey.form.js +3 -3
  428. package/lib/mjs/components/survey/Survey.js +30 -17
  429. package/lib/mjs/components/survey/editForm/Survey.edit.data.js +23 -11
  430. package/lib/mjs/components/survey/editForm/Survey.edit.display.js +1 -1
  431. package/lib/mjs/components/survey/editForm/Survey.edit.validation.js +1 -1
  432. package/lib/mjs/components/table/Table.form.js +1 -1
  433. package/lib/mjs/components/table/Table.js +7 -5
  434. package/lib/mjs/components/table/editForm/Table.edit.display.js +22 -22
  435. package/lib/mjs/components/tabs/Tabs.form.js +1 -1
  436. package/lib/mjs/components/tabs/Tabs.js +26 -8
  437. package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +21 -17
  438. package/lib/mjs/components/tags/Tags.form.js +1 -1
  439. package/lib/mjs/components/tags/Tags.js +28 -12
  440. package/lib/mjs/components/tags/editForm/Tags.edit.data.js +7 -7
  441. package/lib/mjs/components/textarea/TextArea.form.js +2 -2
  442. package/lib/mjs/components/textarea/TextArea.js +75 -51
  443. package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +96 -72
  444. package/lib/mjs/components/textarea/editForm/TextArea.edit.validation.js +3 -3
  445. package/lib/mjs/components/textfield/TextField.form.js +3 -3
  446. package/lib/mjs/components/textfield/TextField.js +34 -23
  447. package/lib/mjs/components/textfield/editForm/TextField.edit.data.js +15 -13
  448. package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +31 -21
  449. package/lib/mjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
  450. package/lib/mjs/components/time/Time.js +17 -10
  451. package/lib/mjs/components/time/editForm/Time.edit.display.js +2 -2
  452. package/lib/mjs/components/unknown/Unknown.form.js +5 -5
  453. package/lib/mjs/components/unknown/Unknown.js +2 -2
  454. package/lib/mjs/components/unknown/editForm/Unknown.edit.display.js +3 -3
  455. package/lib/mjs/components/url/Url.form.js +3 -3
  456. package/lib/mjs/components/url/Url.js +2 -2
  457. package/lib/mjs/components/url/editForm/Url.edit.display.js +3 -3
  458. package/lib/mjs/components/url/editForm/Url.edit.validation.js +1 -1
  459. package/lib/mjs/components/well/Well.form.js +1 -1
  460. package/lib/mjs/components/well/Well.js +2 -2
  461. package/lib/mjs/components/well/editForm/Well.edit.display.js +10 -10
  462. package/lib/mjs/formio.form.d.ts +2 -1
  463. package/lib/mjs/formio.form.js +10 -8
  464. package/lib/mjs/i18n.d.ts +4 -0
  465. package/lib/mjs/i18n.js +7 -3
  466. package/lib/mjs/package.json +1 -1
  467. package/lib/mjs/providers/address/AddressProvider.js +8 -5
  468. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +3 -3
  469. package/lib/mjs/providers/address/GoogleAddressProvider.js +24 -13
  470. package/lib/mjs/providers/processor/fileProcessor.js +3 -1
  471. package/lib/mjs/providers/storage/azure.js +5 -2
  472. package/lib/mjs/providers/storage/dropbox.js +4 -5
  473. package/lib/mjs/providers/storage/googleDrive.js +3 -4
  474. package/lib/mjs/providers/storage/index.js +1 -1
  475. package/lib/mjs/providers/storage/indexeddb.js +16 -6
  476. package/lib/mjs/providers/storage/s3.js +19 -8
  477. package/lib/mjs/providers/storage/uploadAdapter.js +17 -11
  478. package/lib/mjs/providers/storage/url.js +13 -11
  479. package/lib/mjs/providers/storage/xhr.js +17 -9
  480. package/lib/mjs/templates/index.js +1 -1
  481. package/lib/mjs/translations/de.d.ts +80 -0
  482. package/lib/mjs/translations/de.js +79 -0
  483. package/lib/mjs/translations/en.d.ts +0 -2
  484. package/lib/mjs/translations/en.js +7 -9
  485. package/lib/mjs/utils/ChoicesWrapper.js +2 -2
  486. package/lib/mjs/utils/builder.js +31 -7
  487. package/lib/mjs/utils/calendarUtils.js +7 -5
  488. package/lib/mjs/utils/conditionOperators/ConditionOperator.js +1 -1
  489. package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +16 -5
  490. package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +3 -1
  491. package/lib/mjs/utils/conditionOperators/IsEqualTo.js +10 -6
  492. package/lib/mjs/utils/conditionOperators/index.js +1 -1
  493. package/lib/mjs/utils/formUtils.js +2 -2
  494. package/lib/mjs/utils/i18n.js +7 -1
  495. package/lib/mjs/utils/index.d.ts +2 -1
  496. package/lib/mjs/utils/index.js +3 -3
  497. package/lib/mjs/utils/utils.d.ts +10 -1
  498. package/lib/mjs/utils/utils.js +178 -91
  499. package/lib/mjs/widgets/CalendarWidget.js +67 -50
  500. package/lib/mjs/widgets/InputWidget.js +6 -4
  501. package/lib/mjs/widgets/index.js +1 -1
  502. package/package.json +3 -3
  503. package/lib/cjs/pdf.image.d.ts +0 -2
  504. package/lib/cjs/pdf.image.js +0 -94
  505. package/lib/cjs/utils/jsonlogic/operators.d.ts +0 -1
  506. package/lib/cjs/utils/jsonlogic/operators.js +0 -265
  507. package/lib/mjs/pdf.image.d.ts +0 -2
  508. package/lib/mjs/pdf.image.js +0 -94
  509. package/lib/mjs/utils/jsonlogic/operators.d.ts +0 -1
  510. package/lib/mjs/utils/jsonlogic/operators.js +0 -262
@@ -1,4 +1,3 @@
1
- /* global jQuery */
2
1
  import _ from 'lodash';
3
2
  import moment from 'moment-timezone/moment-timezone';
4
3
  import jtz from 'jstimezonedetect';
@@ -48,7 +47,7 @@ export function getElementRect(element) {
48
47
  x: getPropertyValue(style, 'left'),
49
48
  y: getPropertyValue(style, 'top'),
50
49
  width: getPropertyValue(style, 'width'),
51
- height: getPropertyValue(style, 'height')
50
+ height: getPropertyValue(style, 'height'),
52
51
  };
53
52
  }
54
53
  /**
@@ -58,8 +57,13 @@ export function getElementRect(element) {
58
57
  */
59
58
  export function getScriptPlugin(property) {
60
59
  const obj = window[property];
61
- if (typeof HTMLElement === 'object' ? obj instanceof HTMLElement : //DOM2
62
- obj && typeof obj === 'object' && true && obj.nodeType === 1 && typeof obj.nodeName === 'string') {
60
+ if (typeof HTMLElement === 'object'
61
+ ? obj instanceof HTMLElement //DOM2
62
+ : obj &&
63
+ typeof obj === 'object' &&
64
+ true &&
65
+ obj.nodeType === 1 &&
66
+ typeof obj.nodeName === 'string') {
63
67
  return undefined;
64
68
  }
65
69
  return obj;
@@ -74,7 +78,7 @@ export function boolValue(value) {
74
78
  return value;
75
79
  }
76
80
  else if (_.isString(value)) {
77
- return (value.toLowerCase() === 'true');
81
+ return value.toLowerCase() === 'true';
78
82
  }
79
83
  else {
80
84
  return !!value;
@@ -102,7 +106,7 @@ export function checkCalculated(component, submission, rowData) {
102
106
  data: submission ? submission.data : rowData,
103
107
  row: rowData,
104
108
  util: this,
105
- component
109
+ component,
106
110
  }, 'value'));
107
111
  }
108
112
  }
@@ -128,10 +132,10 @@ function getConditionalPathsRecursive(conditionPaths, data) {
128
132
  const currentLocalIndex = localIndex;
129
133
  const currentData = _.get(data, currentPath);
130
134
  if (Array.isArray(currentData) && currentData.filter(Boolean).length > 0) {
131
- if (currentData.some(element => typeof element !== 'object')) {
135
+ if (currentData.some((element) => typeof element !== 'object')) {
132
136
  return;
133
137
  }
134
- const hasInnerDataArray = currentData.find(x => Array.isArray(x[conditionPaths[currentLocalIndex]]));
138
+ const hasInnerDataArray = currentData.find((x) => Array.isArray(x[conditionPaths[currentLocalIndex]]));
135
139
  if (hasInnerDataArray) {
136
140
  currentData.forEach((_, indexOutside) => {
137
141
  const innerCompDataPath = `${currentPath}[${indexOutside}].${conditionPaths[currentLocalIndex]}`;
@@ -192,7 +196,16 @@ export function checkSimpleConditional(component, condition, row, data, instance
192
196
  return true;
193
197
  }
194
198
  const splittedConditionPath = conditionComponentPath.split('.');
195
- const conditionalPaths = instance?.parent?.type === 'datagrid' || instance?.parent?.type === 'editgrid' ? [] : getConditionalPathsRecursive(splittedConditionPath, data);
199
+ const checkParentTypeInTree = (instance, componentType) => {
200
+ if (!instance?.parent) {
201
+ return false;
202
+ }
203
+ return (instance?.parent.type === componentType ||
204
+ checkParentTypeInTree(instance.parent, componentType));
205
+ };
206
+ const conditionalPaths = checkParentTypeInTree(instance, 'datagrid') || checkParentTypeInTree(instance, 'editgrid')
207
+ ? []
208
+ : getConditionalPathsRecursive(splittedConditionPath, data);
196
209
  if (conditionalPaths.length > 0) {
197
210
  return conditionalPaths.map((path) => {
198
211
  const value = getComponentActualValue(path, data, row);
@@ -206,17 +219,23 @@ export function checkSimpleConditional(component, condition, row, data, instance
206
219
  const value = getComponentActualValue(conditionComponentPath, data, row);
207
220
  const СonditionOperator = ConditionOperators[operator];
208
221
  return СonditionOperator
209
- ? new СonditionOperator().getResult({ value, comparedValue, instance, component, path: conditionComponentPath })
222
+ ? new СonditionOperator().getResult({
223
+ value,
224
+ comparedValue,
225
+ instance,
226
+ component,
227
+ path: conditionComponentPath,
228
+ })
210
229
  : true;
211
230
  }
212
231
  });
213
232
  let result = false;
214
233
  switch (conjunction) {
215
234
  case 'any':
216
- result = _.some(conditionsResult.flat(), res => !!res);
235
+ result = _.some(conditionsResult.flat(), (res) => !!res);
217
236
  break;
218
237
  default:
219
- result = _.every(conditionsResult.flat(), res => !!res);
238
+ result = _.every(conditionsResult.flat(), (res) => !!res);
220
239
  }
221
240
  return convertShowToBoolean(show) ? result : !result;
222
241
  }
@@ -258,9 +277,9 @@ export function checkCustomConditional(component, custom, row, data, form, varia
258
277
  if (typeof custom === 'string') {
259
278
  custom = `var ${variable} = true; ${custom}; return ${variable};`;
260
279
  }
261
- const value = (instance && instance.evaluate) ?
262
- instance.evaluate(custom, { row, data, form }) :
263
- evaluate(custom, { row, data, form });
280
+ const value = instance && instance.evaluate
281
+ ? instance.evaluate(custom, { row, data, form })
282
+ : evaluate(custom, { row, data, form });
264
283
  if (value === null) {
265
284
  return onError;
266
285
  }
@@ -306,10 +325,10 @@ function getRow(component, row, instance, conditional) {
306
325
  }
307
326
  const dataParent = getDataParentComponent(instance);
308
327
  if (dataParent) {
309
- const parentPath = dataParent.paths?.localDataPath;
328
+ const parentPath = dataParent.paths?.localPath;
310
329
  const isTriggerCondtionComponentPath = condition.when || !condition.conditions
311
330
  ? condition.when?.startsWith(dataParent.paths?.localPath)
312
- : _.some(condition.conditions, cond => cond.component.startsWith(dataParent.paths?.localPath));
331
+ : _.some(condition.conditions, (cond) => cond.component.startsWith(dataParent.paths?.localPath));
313
332
  if (isTriggerCondtionComponentPath) {
314
333
  const newRow = {};
315
334
  _.set(newRow, parentPath, row);
@@ -332,7 +351,9 @@ export function checkCondition(component, row, data, form, instance) {
332
351
  if (customConditional) {
333
352
  return checkCustomConditional(component, customConditional, row, data, form, 'show', true, instance);
334
353
  }
335
- else if (conditional && (conditional.when || _.some(conditional.conditions || [], condition => condition.component && condition.operator))) {
354
+ else if (conditional &&
355
+ (conditional.when ||
356
+ _.some(conditional.conditions || [], (condition) => condition.component && condition.operator))) {
336
357
  row = getRow(component, row, instance);
337
358
  return checkSimpleConditional(component, conditional, row, data, instance);
338
359
  }
@@ -399,7 +420,7 @@ export function setActionProperty(component, action, result, row, data, instance
399
420
  };
400
421
  const textValue = action.property.component ? action[action.property.component] : action.text;
401
422
  const currentValue = _.get(component, property, '');
402
- const newValue = (instance && instance.interpolate)
423
+ const newValue = instance && instance.interpolate
403
424
  ? instance.interpolate(textValue, evalData)
404
425
  : Evaluator.interpolate(textValue, evalData);
405
426
  if (newValue !== currentValue) {
@@ -457,14 +478,12 @@ export function uniqueName(name, template, evalContext) {
457
478
  }
458
479
  const parts = name.split('.');
459
480
  let fileName = parts.slice(0, parts.length - 1).join('.');
460
- const extension = parts.length > 1
461
- ? `.${_.last(parts)}`
462
- : '';
481
+ const extension = parts.length > 1 ? `.${_.last(parts)}` : '';
463
482
  //allow only 100 characters from original name to avoid issues with filename length restrictions
464
483
  fileName = fileName.substr(0, 100);
465
484
  evalContext = Object.assign(evalContext || {}, {
466
485
  fileName,
467
- guid: guid()
486
+ guid: guid(),
468
487
  });
469
488
  //only letters, numbers, dots, dashes, underscores and spaces are allowed. Anything else will be replaced with dash
470
489
  const uniqueName = `${Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\-_ ]/g, '-');
@@ -476,10 +495,8 @@ export function uniqueName(name, template, evalContext) {
476
495
  */
477
496
  export function guid() {
478
497
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
479
- const r = Math.random() * 16 | 0;
480
- const v = c === 'x'
481
- ? r
482
- : (r & 0x3 | 0x8);
498
+ const r = (Math.random() * 16) | 0;
499
+ const v = c === 'x' ? r : (r & 0x3) | 0x8;
483
500
  return v.toString(16);
484
501
  });
485
502
  }
@@ -498,13 +515,13 @@ export function getDateSetting(date) {
498
515
  else if (typeof date.toDate === 'function') {
499
516
  return date.isValid() ? date.toDate() : null;
500
517
  }
501
- let dateSetting = ((typeof date !== 'string') || (date.indexOf('moment(') === -1)) ? moment(date) : null;
518
+ let dateSetting = typeof date !== 'string' || date.indexOf('moment(') === -1 ? moment(date) : null;
502
519
  if (dateSetting && dateSetting.isValid()) {
503
520
  return dateSetting.toDate();
504
521
  }
505
522
  dateSetting = null;
506
523
  try {
507
- const value = Evaluator.evaluator(`return ${date};`, 'moment')(moment);
524
+ const value = evaluate(`value=${date};`, { moment }, 'value');
508
525
  if (typeof value === 'string') {
509
526
  dateSetting = moment(value);
510
527
  }
@@ -515,7 +532,7 @@ export function getDateSetting(date) {
515
532
  dateSetting = moment(value);
516
533
  }
517
534
  }
518
- catch (e) {
535
+ catch (ignoreErr) {
519
536
  return null;
520
537
  }
521
538
  if (!dateSetting) {
@@ -555,14 +572,14 @@ export function currentTimezone() {
555
572
  export function offsetDate(date, timezone) {
556
573
  if (timezone === 'UTC') {
557
574
  return {
558
- date: new Date(date.getTime() + (date.getTimezoneOffset() * 60000)),
559
- abbr: 'UTC'
575
+ date: new Date(date.getTime() + date.getTimezoneOffset() * 60000),
576
+ abbr: 'UTC',
560
577
  };
561
578
  }
562
579
  const dateMoment = moment(date).tz(timezone);
563
580
  return {
564
- date: new Date(date.getTime() + ((dateMoment.utcOffset() + date.getTimezoneOffset()) * 60000)),
565
- abbr: dateMoment.format('z')
581
+ date: new Date(date.getTime() + (dateMoment.utcOffset() + date.getTimezoneOffset()) * 60000),
582
+ abbr: dateMoment.format('z'),
566
583
  };
567
584
  }
568
585
  /**
@@ -597,8 +614,7 @@ export function loadZones(url, timezone) {
597
614
  if (moment.zonesPromise) {
598
615
  return moment.zonesPromise;
599
616
  }
600
- return moment.zonesPromise = fetch(url)
601
- .then(resp => resp.json().then(zones => {
617
+ return (moment.zonesPromise = fetch(url).then((resp) => resp.json().then((zones) => {
602
618
  moment.tz.load(zones);
603
619
  moment.zonesLoaded = true;
604
620
  // Trigger a global event that the timezones have finished loading.
@@ -607,7 +623,7 @@ export function loadZones(url, timezone) {
607
623
  event.initEvent('zonesLoaded', true, true);
608
624
  document.body.dispatchEvent(event);
609
625
  }
610
- }));
626
+ })));
611
627
  }
612
628
  /**
613
629
  * Get the moment date object for translating dates with timezones.
@@ -625,7 +641,8 @@ export function momentDate(value, format, timezone, options) {
625
641
  if (timezone === 'UTC') {
626
642
  timezone = 'Etc/UTC';
627
643
  }
628
- if ((timezone !== currentTimezone() || (format && format.match(/\s(z$|z\s)/))) && (moment.zonesLoaded || options?.email)) {
644
+ if ((timezone !== currentTimezone() || (format && format.match(/\s(z$|z\s)/))) &&
645
+ (moment.zonesLoaded || options?.email)) {
629
646
  return momentDate.tz(timezone);
630
647
  }
631
648
  return momentDate;
@@ -713,7 +730,7 @@ export function getLocaleDateFormatInfo(locale) {
713
730
  * @returns {string} - The converted format.
714
731
  */
715
732
  export function convertFormatToFlatpickr(format) {
716
- return format
733
+ return (format
717
734
  // Remove the Z timezone offset, not supported by flatpickr.
718
735
  .replace(/Z/g, '')
719
736
  // Year conversion.
@@ -736,7 +753,7 @@ export function convertFormatToFlatpickr(format) {
736
753
  .replace('hh', 'G')
737
754
  .replace('mm', 'i')
738
755
  .replace('ss', 'S')
739
- .replace(/a/g, 'K');
756
+ .replace(/a/g, 'K'));
740
757
  }
741
758
  /**
742
759
  * Convert the format from the angular-datepicker module to moment format.
@@ -744,7 +761,7 @@ export function convertFormatToFlatpickr(format) {
744
761
  * @returns {string} - The converted format.
745
762
  */
746
763
  export function convertFormatToMoment(format) {
747
- return format
764
+ return (format
748
765
  // Year conversion.
749
766
  .replace(/y/g, 'Y')
750
767
  // Day in month.
@@ -754,7 +771,7 @@ export function convertFormatToMoment(format) {
754
771
  // AM/PM marker
755
772
  .replace(/a/g, 'A')
756
773
  // Unix Timestamp
757
- .replace(/U/g, 'X');
774
+ .replace(/U/g, 'X'));
758
775
  }
759
776
  /**
760
777
  * Convert the format from the angular-datepicker module to mask format.
@@ -762,7 +779,7 @@ export function convertFormatToMoment(format) {
762
779
  * @returns {string} - The converted format.
763
780
  */
764
781
  export function convertFormatToMask(format) {
765
- return format
782
+ return (format
766
783
  // Long month replacement.
767
784
  .replace(/M{4}/g, 'MM')
768
785
  // Initial short month conversion.
@@ -774,7 +791,7 @@ export function convertFormatToMask(format) {
774
791
  // Year conversion.
775
792
  .replace(/[ydhmswHMG]/g, '9')
776
793
  // AM/PM conversion.
777
- .replace(/a/g, 'AA');
794
+ .replace(/a/g, 'AA'));
778
795
  }
779
796
  /**
780
797
  * Returns an input mask that is compatible with the input mask library.
@@ -857,7 +874,7 @@ export function matchInputMask(value, inputMask) {
857
874
  for (let i = 0; i < inputMask.length; i++) {
858
875
  const char = value[i] || '';
859
876
  const charPart = inputMask[i];
860
- if (!(_.isRegExp(charPart) && charPart.test(char) || charPart === char)) {
877
+ if (!((_.isRegExp(charPart) && charPart.test(char)) || charPart === char)) {
861
878
  return false;
862
879
  }
863
880
  }
@@ -874,12 +891,12 @@ export function getNumberSeparators(lang = 'en') {
874
891
  if (!delimeters) {
875
892
  return {
876
893
  delimiter: ',',
877
- decimalSeparator: '.'
894
+ decimalSeparator: '.',
878
895
  };
879
896
  }
880
897
  return {
881
- delimiter: (delimeters.length > 1) ? delimeters[1] : ',',
882
- decimalSeparator: (delimeters.length > 2) ? delimeters[2] : '.',
898
+ delimiter: delimeters.length > 1 ? delimeters[1] : ',',
899
+ decimalSeparator: delimeters.length > 2 ? delimeters[2] : '.',
883
900
  };
884
901
  }
885
902
  /**
@@ -912,23 +929,26 @@ export function getNumberDecimalLimit(component, defaultLimit) {
912
929
  * @param {string} arg0.lang - The language code to use.
913
930
  * @returns {{prefix: string, suffix: string}} - The currency affixes.
914
931
  */
915
- export function getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, lang, }) {
932
+ export function getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, lang }) {
916
933
  // Get the prefix and suffix from the localized string.
917
934
  let regex = `(.*)?${(100).toLocaleString(lang)}`;
918
935
  if (decimalLimit) {
919
936
  regex += `${decimalSeparator === '.' ? '\\.' : decimalSeparator}${(0).toLocaleString(lang)}{${decimalLimit}}`;
920
937
  }
921
938
  regex += '(.*)?';
922
- const parts = (100).toLocaleString(lang, {
939
+ const parts = (100)
940
+ .toLocaleString(lang, {
923
941
  style: 'currency',
924
942
  currency: currency ? currency : 'USD',
925
943
  useGrouping: true,
926
944
  maximumFractionDigits: decimalLimit || 0,
927
- minimumFractionDigits: decimalLimit || 0
928
- }).replace('.', decimalSeparator).match(new RegExp(regex));
945
+ minimumFractionDigits: decimalLimit || 0,
946
+ })
947
+ .replace('.', decimalSeparator)
948
+ .match(new RegExp(regex));
929
949
  return {
930
950
  prefix: parts?.[1] || '',
931
- suffix: parts?.[2] || ''
951
+ suffix: parts?.[2] || '',
932
952
  };
933
953
  }
934
954
  /**
@@ -960,7 +980,9 @@ export function fieldData(data, component) {
960
980
  }
961
981
  // Convert old single field data in submissions to multiple
962
982
  if (key === parts[parts.length - 1] && component.multiple && !Array.isArray(value[key])) {
963
- value[key] = [value[key]];
983
+ value[key] = [
984
+ value[key],
985
+ ];
964
986
  }
965
987
  // Set the value of this key.
966
988
  value = value[key];
@@ -970,7 +992,9 @@ export function fieldData(data, component) {
970
992
  else {
971
993
  // Convert old single field data in submissions to multiple
972
994
  if (component.multiple && !Array.isArray(data[component.key])) {
973
- data[component.key] = [data[component.key]];
995
+ data[component.key] = [
996
+ data[component.key],
997
+ ];
974
998
  }
975
999
  // Fix for checkbox type radio submission values in tableView
976
1000
  if (component.type === 'checkbox' && component.inputType === 'radio') {
@@ -1044,9 +1068,6 @@ export function bootstrapVersion(options) {
1044
1068
  if (options.bootstrap) {
1045
1069
  return options.bootstrap;
1046
1070
  }
1047
- if ((typeof jQuery === 'function') && (typeof jQuery().collapse === 'function')) {
1048
- return parseInt(jQuery.fn.collapse.Constructor.VERSION.split('.')[0], 10);
1049
- }
1050
1071
  if (window.bootstrap && window.bootstrap.Collapse) {
1051
1072
  return parseInt(window.bootstrap.Collapse.VERSION.split('.')[0], 10);
1052
1073
  }
@@ -1071,7 +1092,7 @@ export function unfold(e) {
1071
1092
  */
1072
1093
  export const firstNonNil = _.flow([
1073
1094
  _.partialRight(_.map, unfold),
1074
- _.partialRight(_.find, v => !_.isUndefined(v))
1095
+ _.partialRight(_.find, (v) => !_.isUndefined(v)),
1075
1096
  ]);
1076
1097
  /**
1077
1098
  * Create enclosed state. Returns functions to getting and cycling between states.
@@ -1097,7 +1118,10 @@ export function withSwitch(a, b) {
1097
1118
  state = next;
1098
1119
  next = prev;
1099
1120
  }
1100
- return [get, toggle];
1121
+ return [
1122
+ get,
1123
+ toggle,
1124
+ ];
1101
1125
  }
1102
1126
  /**
1103
1127
  * Create a function that will call the provided function only the provided limit.
@@ -1111,7 +1135,7 @@ export function observeOverload(callback, options = {}) {
1111
1135
  const { limit = 50, delay = 500 } = options;
1112
1136
  let callCount = 0;
1113
1137
  let timeoutID = 0;
1114
- const reset = () => callCount = 0;
1138
+ const reset = () => (callCount = 0);
1115
1139
  return () => {
1116
1140
  if (timeoutID !== 0) {
1117
1141
  clearTimeout(timeoutID);
@@ -1137,7 +1161,9 @@ export function getContextComponents(context, excludeNested, excludedTypes = [])
1137
1161
  const values = [];
1138
1162
  context.utils.eachComponent(context.instance.options.editForm.components, (component, path) => {
1139
1163
  const addToContextComponents = excludeNested ? !component.tree : true;
1140
- if (component.key !== context.data.key && addToContextComponents && !_.includes(excludedTypes, component.type)) {
1164
+ if (component.key !== context.data.key &&
1165
+ addToContextComponents &&
1166
+ !_.includes(excludedTypes, component.type)) {
1141
1167
  values.push({
1142
1168
  label: `${component.label || component.key} (${path})`,
1143
1169
  value: path,
@@ -1164,7 +1190,21 @@ export function getContextButtons(context) {
1164
1190
  return values;
1165
1191
  }
1166
1192
  // Tags that could be in text, that should be ommited or handled in a special way
1167
- const inTextTags = ['#text', 'A', 'B', 'EM', 'I', 'SMALL', 'STRONG', 'SUB', 'SUP', 'INS', 'DEL', 'MARK', 'CODE'];
1193
+ const inTextTags = [
1194
+ '#text',
1195
+ 'A',
1196
+ 'B',
1197
+ 'EM',
1198
+ 'I',
1199
+ 'SMALL',
1200
+ 'STRONG',
1201
+ 'SUB',
1202
+ 'SUP',
1203
+ 'INS',
1204
+ 'DEL',
1205
+ 'MARK',
1206
+ 'CODE',
1207
+ ];
1168
1208
  /**
1169
1209
  * Helper function for 'translateHTMLTemplate'. Translates text value of the passed html element.
1170
1210
  * @param {HTMLElement} elem - The element to translate.
@@ -1175,7 +1215,10 @@ function translateElemValue(elem, translate) {
1175
1215
  if (!elem.innerText) {
1176
1216
  return elem.innerHTML;
1177
1217
  }
1178
- const elemValue = elem.innerText.replace(Evaluator.templateSettings.interpolate, '').replace(/\s\s+/g, ' ').trim();
1218
+ const elemValue = elem.innerText
1219
+ .replace(Evaluator.templateSettings.interpolate, '')
1220
+ .replace(/\s\s+/g, ' ')
1221
+ .trim();
1179
1222
  const translatedValue = translate(elemValue);
1180
1223
  if (elemValue !== translatedValue) {
1181
1224
  const links = elem.innerHTML.match(/<a[^>]*>(.*?)<\/a>/g);
@@ -1183,7 +1226,7 @@ function translateElemValue(elem, translate) {
1183
1226
  if (links.length === 1 && links[0].length === elem.innerHTML.length) {
1184
1227
  return elem.innerHTML.replace(elemValue, translatedValue);
1185
1228
  }
1186
- const translatedLinks = links.map(link => {
1229
+ const translatedLinks = links.map((link) => {
1187
1230
  const linkElem = document.createElement('a');
1188
1231
  linkElem.innerHTML = link;
1189
1232
  return translateElemValue(linkElem, translate);
@@ -1205,14 +1248,16 @@ function translateElemValue(elem, translate) {
1205
1248
  * @returns {void}
1206
1249
  */
1207
1250
  function translateDeepTag(tag, translate) {
1208
- const children = tag.children.length && [...tag.children];
1209
- const shouldTranslateEntireContent = children && children.every(child => child.children.length === 0
1210
- && inTextTags.some(tag => child.nodeName === tag));
1251
+ const children = tag.children.length && [
1252
+ ...tag.children,
1253
+ ];
1254
+ const shouldTranslateEntireContent = children &&
1255
+ children.every((child) => child.children.length === 0 && inTextTags.some((tag) => child.nodeName === tag));
1211
1256
  if (!children || shouldTranslateEntireContent) {
1212
1257
  tag.innerHTML = translateElemValue(tag, translate);
1213
1258
  }
1214
1259
  else {
1215
- children.forEach(child => translateDeepTag(child, translate));
1260
+ children.forEach((child) => translateDeepTag(child, translate));
1216
1261
  }
1217
1262
  }
1218
1263
  /**
@@ -1246,40 +1291,55 @@ export function sanitize(string, options) {
1246
1291
  }
1247
1292
  // Dompurify configuration
1248
1293
  const sanitizeOptions = {
1249
- ADD_ATTR: ['ref', 'target'],
1250
- USE_PROFILES: { html: true }
1294
+ ADD_ATTR: [
1295
+ 'ref',
1296
+ 'target',
1297
+ ],
1298
+ USE_PROFILES: { html: true },
1251
1299
  };
1252
1300
  // Use profiles
1253
1301
  if (options.sanitizeConfig && options.sanitizeConfig.useProfiles) {
1254
- Object.keys(options.sanitizeConfig.useProfiles).forEach(key => {
1302
+ Object.keys(options.sanitizeConfig.useProfiles).forEach((key) => {
1255
1303
  sanitizeOptions.USE_PROFILES[key] = options.sanitizeConfig.useProfiles[key];
1256
1304
  });
1257
1305
  }
1258
1306
  // Add attrs
1259
- if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addAttr) && options.sanitizeConfig.addAttr.length > 0) {
1307
+ if (options.sanitizeConfig &&
1308
+ Array.isArray(options.sanitizeConfig.addAttr) &&
1309
+ options.sanitizeConfig.addAttr.length > 0) {
1260
1310
  options.sanitizeConfig.addAttr.forEach((attr) => {
1261
1311
  sanitizeOptions.ADD_ATTR.push(attr);
1262
1312
  });
1263
1313
  }
1264
1314
  // Add tags
1265
- if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addTags) && options.sanitizeConfig.addTags.length > 0) {
1315
+ if (options.sanitizeConfig &&
1316
+ Array.isArray(options.sanitizeConfig.addTags) &&
1317
+ options.sanitizeConfig.addTags.length > 0) {
1266
1318
  sanitizeOptions.ADD_TAGS = options.sanitizeConfig.addTags;
1267
1319
  }
1268
1320
  // Allow tags
1269
- if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedTags) && options.sanitizeConfig.allowedTags.length > 0) {
1321
+ if (options.sanitizeConfig &&
1322
+ Array.isArray(options.sanitizeConfig.allowedTags) &&
1323
+ options.sanitizeConfig.allowedTags.length > 0) {
1270
1324
  sanitizeOptions.ALLOWED_TAGS = options.sanitizeConfig.allowedTags;
1271
1325
  }
1272
1326
  // Allow attributes
1273
- if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedAttrs) && options.sanitizeConfig.allowedAttrs.length > 0) {
1327
+ if (options.sanitizeConfig &&
1328
+ Array.isArray(options.sanitizeConfig.allowedAttrs) &&
1329
+ options.sanitizeConfig.allowedAttrs.length > 0) {
1274
1330
  sanitizeOptions.ALLOWED_ATTR = options.sanitizeConfig.allowedAttrs;
1275
1331
  }
1276
1332
  // Allowd URI Regex
1277
1333
  if (options.sanitizeConfig && options.sanitizeConfig.allowedUriRegex) {
1278
1334
  const allowedUriRegex = options.sanitizeConfig.allowedUriRegex;
1279
- sanitizeOptions.ALLOWED_URI_REGEXP = _.isString(allowedUriRegex) ? new RegExp(allowedUriRegex) : allowedUriRegex;
1335
+ sanitizeOptions.ALLOWED_URI_REGEXP = _.isString(allowedUriRegex)
1336
+ ? new RegExp(allowedUriRegex)
1337
+ : allowedUriRegex;
1280
1338
  }
1281
1339
  // Allow to extend the existing array of elements that are safe for URI-like values
1282
- if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addUriSafeAttr) && options.sanitizeConfig.addUriSafeAttr.length > 0) {
1340
+ if (options.sanitizeConfig &&
1341
+ Array.isArray(options.sanitizeConfig.addUriSafeAttr) &&
1342
+ options.sanitizeConfig.addUriSafeAttr.length > 0) {
1283
1343
  sanitizeOptions.ADD_URI_SAFE_ATTR = options.sanitizeConfig.addUriSafeAttr;
1284
1344
  }
1285
1345
  return dompurify.sanitize(string, sanitizeOptions);
@@ -1324,15 +1384,18 @@ export function isInputComponent(componentJson) {
1324
1384
  export function getArrayFromComponentPath(pathStr) {
1325
1385
  if (!pathStr || !_.isString(pathStr)) {
1326
1386
  if (!_.isArray(pathStr)) {
1327
- return [pathStr];
1387
+ return [
1388
+ pathStr,
1389
+ ];
1328
1390
  }
1329
1391
  return pathStr;
1330
1392
  }
1331
- return pathStr.replace(/[[\]]/g, '.')
1393
+ return pathStr
1394
+ .replace(/[[\]]/g, '.')
1332
1395
  .replace(/\.\./g, '.')
1333
1396
  .replace(/(^\.)|(\.$)/g, '')
1334
1397
  .split('.')
1335
- .map(part => _.defaultTo(_.toNumber(part), part));
1398
+ .map((part) => _.defaultTo(_.toNumber(part), part));
1336
1399
  }
1337
1400
  /**
1338
1401
  * Returns true if the component is a child of the parent.
@@ -1410,12 +1473,12 @@ export function getBrowserInfo() {
1410
1473
  /(webkit)[ /]([\w.]+)/.exec(ua) ||
1411
1474
  /(opera)(?:.*version|)[ /]([\w.]+)/.exec(ua) ||
1412
1475
  /(msie) ([\w.]+)/.exec(ua) ||
1413
- ua.indexOf('trident') >= 0 && /(rv)(?::| )([\w.]+)/.exec(ua) ||
1414
- ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
1476
+ (ua.indexOf('trident') >= 0 && /(rv)(?::| )([\w.]+)/.exec(ua)) ||
1477
+ (ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)) ||
1415
1478
  [];
1416
1479
  const matched = {
1417
1480
  browser: match[5] || match[3] || match[1] || '',
1418
- version: match[4] || match[2] || '0'
1481
+ version: match[4] || match[2] || '0',
1419
1482
  };
1420
1483
  if (matched.browser) {
1421
1484
  browser[matched.browser] = true;
@@ -1478,10 +1541,10 @@ export function getDataParentComponent(componentInstance) {
1478
1541
  * @returns {boolean} - TRUE if the value is a promise; FALSE otherwise
1479
1542
  */
1480
1543
  export function isPromise(value) {
1481
- return value
1482
- && value.then
1483
- && typeof value.then === 'function'
1484
- && Object.prototype.toString.call(value) === '[object Promise]';
1544
+ return (value &&
1545
+ value.then &&
1546
+ typeof value.then === 'function' &&
1547
+ Object.prototype.toString.call(value) === '[object Promise]');
1485
1548
  }
1486
1549
  /**
1487
1550
  * Returns all the focusable elements within the provided dom element.
@@ -1513,7 +1576,9 @@ export function getComponentSavedTypes(fullSchema) {
1513
1576
  return [];
1514
1577
  }
1515
1578
  if (schema.multiple) {
1516
- return [componentValueTypes.array];
1579
+ return [
1580
+ componentValueTypes.array,
1581
+ ];
1517
1582
  }
1518
1583
  return null;
1519
1584
  }
@@ -1528,7 +1593,29 @@ export const interpolateErrors = (component, errors, interpolateFn) => {
1528
1593
  return errors.map((error) => {
1529
1594
  error.component = component;
1530
1595
  const { errorKeyOrMessage, context } = error;
1531
- const toInterpolate = component.errors && component.errors[errorKeyOrMessage] ? component.errors[errorKeyOrMessage] : errorKeyOrMessage;
1532
- return { ...error, message: unescapeHTML(interpolateFn(toInterpolate, context)), context: { ...context } };
1596
+ const toInterpolate = component.errors && component.errors[errorKeyOrMessage]
1597
+ ? component.errors[errorKeyOrMessage]
1598
+ : errorKeyOrMessage;
1599
+ return {
1600
+ ...error,
1601
+ message: unescapeHTML(interpolateFn(toInterpolate, context)),
1602
+ context: { ...context },
1603
+ };
1533
1604
  });
1534
1605
  };
1606
+ /**
1607
+ * Checks if a string has timezone information encoded in it
1608
+ * Example: 2024-01-01T00:00:00Z -> true
1609
+ * Example: 2024-01-01T00:00:00+03:00 -> true
1610
+ * Example: 2011-05-03T00:00:00 -> false
1611
+ * @param {string} value the string value to check
1612
+ * @returns {boolean} if value has encoded timezone
1613
+ */
1614
+ export function hasEncodedTimezone(value) {
1615
+ if (typeof value !== 'string') {
1616
+ return false;
1617
+ }
1618
+ return (value.substring(value.length - 1) === 'z' ||
1619
+ value.substring(value.length - 1) === 'Z' ||
1620
+ value.match(/[+|-][0-9]{2}:[0-9]{2}$/));
1621
+ }