@formio/js 5.2.4-rc.0 → 5.2.5

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