@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
@@ -15,10 +15,10 @@ export default [
15
15
  custom() {
16
16
  return _.map(Formio.Providers.getProviders('storage'), (storage, key) => ({
17
17
  label: storage.title,
18
- value: key,
18
+ value: key
19
19
  }));
20
- },
21
- },
20
+ }
21
+ }
22
22
  },
23
23
  {
24
24
  type: 'checkbox',
@@ -27,12 +27,7 @@ export default [
27
27
  label: 'Use the S3 Multipart Upload API',
28
28
  tooltip: "The <a href='https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html'>S3 Multipart Upload API</a> is designed to improve the upload experience for larger objects (> 5GB).",
29
29
  conditional: {
30
- json: {
31
- '===': [
32
- { var: 'data.storage' },
33
- 's3',
34
- ],
35
- },
30
+ json: { '===': [{ var: 'data.storage' }, 's3'] }
36
31
  },
37
32
  },
38
33
  {
@@ -62,12 +57,7 @@ export default [
62
57
  },
63
58
  ],
64
59
  conditional: {
65
- json: {
66
- '===': [
67
- { var: 'data.useMultipartUpload' },
68
- true,
69
- ],
70
- },
60
+ json: { '===': [{ var: 'data.useMultipartUpload' }, true] }
71
61
  },
72
62
  },
73
63
  {
@@ -79,13 +69,8 @@ export default [
79
69
  placeholder: 'Enter the url to post the files to.',
80
70
  tooltip: "See <a href='https://github.com/danialfarid/ng-file-upload#server-side' target='_blank'>https://github.com/danialfarid/ng-file-upload#server-side</a> for how to set up the server.",
81
71
  conditional: {
82
- json: {
83
- '===': [
84
- { var: 'data.storage' },
85
- 'url',
86
- ],
87
- },
88
- },
72
+ json: { '===': [{ var: 'data.storage' }, 'url'] }
73
+ }
89
74
  },
90
75
  {
91
76
  type: 'textfield',
@@ -98,14 +83,12 @@ export default [
98
83
  json: {
99
84
  in: [
100
85
  {
101
- var: 'data.storage',
86
+ var: 'data.storage'
102
87
  },
103
- [
104
- 'indexeddb',
105
- ],
88
+ ['indexeddb']
106
89
  ],
107
- },
108
- },
90
+ }
91
+ }
109
92
  },
110
93
  {
111
94
  type: 'textfield',
@@ -118,14 +101,12 @@ export default [
118
101
  json: {
119
102
  in: [
120
103
  {
121
- var: 'data.storage',
104
+ var: 'data.storage'
122
105
  },
123
- [
124
- 'indexeddb',
125
- ],
106
+ ['indexeddb']
126
107
  ],
127
- },
128
- },
108
+ }
109
+ }
129
110
  },
130
111
  {
131
112
  type: 'textarea',
@@ -145,14 +126,11 @@ export default [
145
126
  }`,
146
127
  conditional: {
147
128
  json: {
148
- '===': [
149
- {
150
- var: 'data.storage',
151
- },
152
- 'url',
153
- ],
154
- },
155
- },
129
+ '===': [{
130
+ var: 'data.storage'
131
+ }, 'url']
132
+ }
133
+ }
156
134
  },
157
135
  {
158
136
  type: 'textfield',
@@ -164,16 +142,12 @@ export default [
164
142
  tooltip: 'Key name that you would like to modify for the file while calling API request.',
165
143
  conditional: {
166
144
  json: {
167
- '===': [
168
- {
169
- var: 'data.storage',
170
- },
171
- 'url',
172
- ],
173
- },
174
- },
175
- },
176
- {
145
+ '===': [{
146
+ var: 'data.storage'
147
+ }, 'url']
148
+ }
149
+ }
150
+ }, {
177
151
  type: 'textfield',
178
152
  input: true,
179
153
  key: 'dir',
@@ -208,8 +182,7 @@ export default [
208
182
  type: 'string',
209
183
  },
210
184
  text: '(optional) Enter an ID of the folder for the files',
211
- },
212
- {
185
+ }, {
213
186
  name: 'Change label',
214
187
  type: 'property',
215
188
  property: {
@@ -220,8 +193,7 @@ export default [
220
193
  text: 'Folder ID',
221
194
  },
222
195
  ],
223
- },
224
- {
196
+ }, {
225
197
  name: 'Change to Directory',
226
198
  trigger: {
227
199
  type: 'simple',
@@ -247,8 +219,7 @@ export default [
247
219
  type: 'string',
248
220
  },
249
221
  text: '(optional) Enter a directory for the files',
250
- },
251
- {
222
+ }, {
252
223
  name: 'Change label',
253
224
  type: 'property',
254
225
  property: {
@@ -269,7 +240,7 @@ export default [
269
240
  label: 'File Name Template',
270
241
  placeholder: '(optional) { {name} }-{ {guid} }',
271
242
  tooltip: 'Specify template for name of uploaded file(s). Regular template variables are available (`data`, `component`, `user`, `value`, `moment` etc.), also `fileName`, `guid` variables are available. `guid` part must be present, if not found in template, will be added at the end.',
272
- weight: 25,
243
+ weight: 25
273
244
  },
274
245
  {
275
246
  type: 'checkbox',
@@ -277,7 +248,7 @@ export default [
277
248
  key: 'image',
278
249
  label: 'Display as image(s)',
279
250
  tooltip: 'Instead of a list of linked files, images will be rendered in the view.',
280
- weight: 30,
251
+ weight: 30
281
252
  },
282
253
  {
283
254
  type: 'checkbox',
@@ -295,13 +266,8 @@ export default [
295
266
  tooltip: 'When this is checked, the file download will send a POST request to the download URL with the x-jwt-token header. This will allow your endpoint to create a Private download system.',
296
267
  weight: 31,
297
268
  conditional: {
298
- json: {
299
- '===': [
300
- { var: 'data.storage' },
301
- 'url',
302
- ],
303
- },
304
- },
269
+ json: { '===': [{ var: 'data.storage' }, 'url'] }
270
+ }
305
271
  },
306
272
  {
307
273
  type: 'textfield',
@@ -312,13 +278,8 @@ export default [
312
278
  tooltip: 'The image size for previewing images.',
313
279
  weight: 40,
314
280
  conditional: {
315
- json: {
316
- '==': [
317
- { var: 'data.image' },
318
- true,
319
- ],
320
- },
321
- },
281
+ json: { '==': [{ var: 'data.image' }, true] }
282
+ }
322
283
  },
323
284
  {
324
285
  type: 'checkbox',
@@ -326,7 +287,7 @@ export default [
326
287
  key: 'webcam',
327
288
  label: 'Enable web camera',
328
289
  tooltip: 'This will allow using an attached camera to directly take a picture instead of uploading an existing file.',
329
- weight: 32,
290
+ weight: 32
330
291
  },
331
292
  {
332
293
  type: 'textfield',
@@ -337,13 +298,8 @@ export default [
337
298
  tooltip: 'The webcam size for taking pictures.',
338
299
  weight: 38,
339
300
  conditional: {
340
- json: {
341
- '==': [
342
- { var: 'data.webcam' },
343
- true,
344
- ],
345
- },
346
- },
301
+ json: { '==': [{ var: 'data.webcam' }, true] }
302
+ }
347
303
  },
348
304
  {
349
305
  type: 'radio',
@@ -357,17 +313,17 @@ export default [
357
313
  values: [
358
314
  {
359
315
  label: 'Disabled',
360
- value: 'false',
316
+ value: 'false'
361
317
  },
362
318
  {
363
319
  label: 'Environment (rear camera)',
364
- value: 'environment',
320
+ value: 'environment'
365
321
  },
366
322
  {
367
323
  label: 'User (front camera)',
368
- value: 'user',
369
- },
370
- ],
324
+ value: 'user'
325
+ }
326
+ ]
371
327
  },
372
328
  {
373
329
  type: 'datagrid',
@@ -381,15 +337,15 @@ export default [
381
337
  label: 'Label',
382
338
  key: 'label',
383
339
  input: true,
384
- type: 'textfield',
340
+ type: 'textfield'
385
341
  },
386
342
  {
387
343
  label: 'Value',
388
344
  key: 'value',
389
345
  input: true,
390
- type: 'textfield',
391
- },
392
- ],
346
+ type: 'textfield'
347
+ }
348
+ ]
393
349
  },
394
350
  {
395
351
  type: 'textfield',
@@ -397,8 +353,8 @@ export default [
397
353
  key: 'filePattern',
398
354
  label: 'File Pattern',
399
355
  placeholder: '.jpg,video/*,application/pdf',
400
- tooltip: "See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file patterns.",
401
- weight: 50,
356
+ tooltip: 'See <a href=\'https://github.com/danialfarid/ng-file-upload#full-reference\' target=\'_blank\'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file patterns.',
357
+ weight: 50
402
358
  },
403
359
  {
404
360
  type: 'textfield',
@@ -406,8 +362,8 @@ export default [
406
362
  key: 'fileMinSize',
407
363
  label: 'File Minimum Size',
408
364
  placeholder: '1MB',
409
- tooltip: "See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.",
410
- weight: 60,
365
+ tooltip: 'See <a href=\'https://github.com/danialfarid/ng-file-upload#full-reference\' target=\'_blank\'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.',
366
+ weight: 60
411
367
  },
412
368
  {
413
369
  type: 'textfield',
@@ -415,7 +371,7 @@ export default [
415
371
  key: 'fileMaxSize',
416
372
  label: 'File Maximum Size',
417
373
  placeholder: '10MB',
418
- tooltip: "See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.",
419
- weight: 70,
374
+ tooltip: 'See <a href=\'https://github.com/danialfarid/ng-file-upload#full-reference\' target=\'_blank\'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.',
375
+ weight: 70
420
376
  },
421
377
  ];
@@ -1,10 +1,10 @@
1
1
  export default [
2
2
  {
3
3
  key: 'unique',
4
- ignore: true,
4
+ ignore: true
5
5
  },
6
6
  {
7
7
  key: 'validateOn',
8
- ignore: true,
8
+ ignore: true
9
9
  },
10
10
  ];
@@ -11,19 +11,19 @@ export default function (...extend) {
11
11
  return nestedComponentForm([
12
12
  {
13
13
  key: 'display',
14
- components: FormEditDisplay,
14
+ components: FormEditDisplay
15
15
  },
16
16
  {
17
17
  label: 'Form',
18
18
  key: 'form',
19
19
  weight: 10,
20
- components: FormEditForm,
20
+ components: FormEditForm
21
21
  },
22
22
  {
23
23
  label: 'Data',
24
24
  key: 'data',
25
25
  weight: 10,
26
- components: FormEditData,
26
+ components: FormEditData
27
27
  },
28
28
  ], ...extend);
29
29
  }
@@ -1,3 +1,4 @@
1
+ /* eslint-disable max-statements */
1
2
  import _ from 'lodash';
2
3
  import Component from '../_classes/component/Component';
3
4
  import ComponentModal from '../_classes/componentModal/ComponentModal';
@@ -25,20 +26,18 @@ export default class FormComponent extends Component {
25
26
  group: 'premium',
26
27
  documentation: '/userguide/form-building/premium-components#nested-form',
27
28
  weight: 110,
28
- schema: FormComponent.schema(),
29
+ schema: FormComponent.schema()
29
30
  };
30
31
  }
31
32
  static savedValueTypes() {
32
- return [
33
- componentValueTypes.object,
34
- ];
33
+ return [componentValueTypes.object];
35
34
  }
36
35
  init() {
37
36
  super.init();
38
37
  this.formObj = {
39
38
  display: this.component.display,
40
39
  settings: this.component.settings,
41
- components: this.component.components,
40
+ components: this.component.components
42
41
  };
43
42
  this.valueChanged = false;
44
43
  this.subForm = null;
@@ -90,11 +89,9 @@ export default class FormComponent extends Component {
90
89
  delete this.component.formRevision;
91
90
  }
92
91
  // Add revision version if set.
93
- if (this.component.revision ||
94
- this.component.revision === 0 ||
95
- this.component.formRevision ||
96
- this.component.formRevision === 0 ||
97
- this.component.revisionId) {
92
+ if (this.component.revision || this.component.revision === 0 ||
93
+ this.component.formRevision || this.component.formRevision === 0
94
+ || this.component.revisionId) {
98
95
  this.setFormRevision(this.component.revisionId || this.component.revision || this.component.formRevision);
99
96
  }
100
97
  return this.createSubForm();
@@ -143,6 +140,7 @@ export default class FormComponent extends Component {
143
140
  }
144
141
  return this.subForm.getComponent(path);
145
142
  }
143
+ /* eslint-disable max-statements */
146
144
  getSubOptions(options = {}) {
147
145
  options.events = this.createEmitter();
148
146
  // Make sure to not show the submit button in wizards in the nested forms.
@@ -213,6 +211,7 @@ export default class FormComponent extends Component {
213
211
  options.parent = this;
214
212
  return options;
215
213
  }
214
+ /* eslint-enable max-statements */
216
215
  render() {
217
216
  if (this.builderMode) {
218
217
  return super.render(this.component.label || 'Nested form');
@@ -237,27 +236,27 @@ export default class FormComponent extends Component {
237
236
  return 'No data provided';
238
237
  }
239
238
  if (options?.email) {
240
- let result = `
239
+ let result = (`
241
240
  <table border="1" style="width:100%">
242
241
  <tbody>
243
- `;
242
+ `);
244
243
  this.everyComponent((component) => {
245
244
  if (component.isInputComponent && component.visible && !component.skipInEmail) {
246
- result += `
245
+ result += (`
247
246
  <tr>
248
247
  <th style="padding: 5px 10px;">${component.label}</th>
249
248
  <td style="width:100%;padding:5px 10px;">${component.getView(component.dataValue, options)}</td>
250
249
  </tr>
251
- `;
250
+ `);
252
251
  }
253
252
  }, {
254
253
  ...options,
255
254
  fromRoot: true,
256
255
  });
257
- result += `
256
+ result += (`
258
257
  </tbody>
259
258
  </table>
260
- `;
259
+ `);
261
260
  return result;
262
261
  }
263
262
  if (_.isEmpty(value)) {
@@ -270,7 +269,8 @@ export default class FormComponent extends Component {
270
269
  if (this.builderMode) {
271
270
  return super.attach(element);
272
271
  }
273
- return super.attach(element).then(() => {
272
+ return super.attach(element)
273
+ .then(() => {
274
274
  if (this.isSubFormLazyLoad() && !this.hasLoadedForm && !this.subFormLoading) {
275
275
  this.createSubForm(true);
276
276
  }
@@ -281,7 +281,7 @@ export default class FormComponent extends Component {
281
281
  this.empty(element);
282
282
  if (this.options.builder) {
283
283
  this.setContent(element, this.ce('div', {
284
- class: 'text-muted text-center p-2',
284
+ class: 'text-muted text-center p-2'
285
285
  }, this.text(this.formObj.title)));
286
286
  return;
287
287
  }
@@ -289,19 +289,16 @@ export default class FormComponent extends Component {
289
289
  const postAttach = () => {
290
290
  if (!this.builderMode && this.component.modalEdit) {
291
291
  const modalShouldBeOpened = this.componentModal ? this.componentModal.isOpened : false;
292
- const currentValue = modalShouldBeOpened
293
- ? this.componentModal.currentValue
294
- : this.dataValue;
292
+ const currentValue = modalShouldBeOpened ? this.componentModal.currentValue : this.dataValue;
295
293
  this.componentModal = new ComponentModal(this, element, modalShouldBeOpened, currentValue, this._referenceAttributeName);
296
- this.subForm.element =
297
- this.componentModal.refs.componentContent || this.subForm.element;
294
+ this.subForm.element = this.componentModal.refs.componentContent || this.subForm.element;
298
295
  this.setOpenModalElement();
299
296
  }
300
297
  this.calculateValue();
301
298
  };
302
299
  if (this.subForm) {
303
300
  if (this.isNestedWizard) {
304
- element = this.root.element;
301
+ element = this.root?.element;
305
302
  }
306
303
  return this.subForm.attach(element).then(() => {
307
304
  this.valueChanged = this.hasSetValue;
@@ -331,24 +328,24 @@ export default class FormComponent extends Component {
331
328
  return this._currentForm;
332
329
  }
333
330
  get hasLoadedForm() {
334
- return (this.formObj &&
335
- this.formObj.components &&
336
- Array.isArray(this.formObj.components) &&
337
- this.formObj.components.length);
331
+ return this.formObj
332
+ && this.formObj.components
333
+ && Array.isArray(this.formObj.components)
334
+ && this.formObj.components.length;
338
335
  }
339
336
  set currentForm(instance) {
340
337
  this._currentForm = instance;
341
338
  if (!this.subForm) {
342
339
  return;
343
340
  }
344
- this.subForm.getComponents().forEach((component) => {
341
+ this.subForm.getComponents().forEach(component => {
345
342
  component.currentForm = this;
346
343
  });
347
344
  }
348
345
  get isRevisionChanged() {
349
- return (_.isNumber(this.subFormRevision) &&
350
- _.isNumber(this.formObj._vid) &&
351
- this.formObj._vid !== this.subFormRevision);
346
+ return _.isNumber(this.subFormRevision)
347
+ && _.isNumber(this.formObj._vid)
348
+ && this.formObj._vid !== this.subFormRevision;
352
349
  }
353
350
  get subFormData() {
354
351
  return this.dataValue?.data || {};
@@ -383,7 +380,7 @@ export default class FormComponent extends Component {
383
380
  }
384
381
  updateSubWizards(subForm) {
385
382
  if (this.isNestedWizard && this.root?.subWizards && subForm?._form?.display === 'wizard') {
386
- const existedForm = this.root.subWizards.findIndex((form) => form.component.form === this.component.form);
383
+ const existedForm = this.root.subWizards.findIndex(form => form.component.form === this.component.form);
387
384
  if (existedForm !== -1) {
388
385
  this.root.subWizards[existedForm] = this;
389
386
  }
@@ -408,8 +405,7 @@ export default class FormComponent extends Component {
408
405
  * @returns {*} - The subform instance.
409
406
  */
410
407
  createSubForm(fromAttach, beforeSubmit) {
411
- this.subFormReady = this.loadSubForm(fromAttach, beforeSubmit)
412
- .then((form) => {
408
+ this.subFormReady = this.loadSubForm(fromAttach, beforeSubmit).then((form) => {
413
409
  if (!form) {
414
410
  return;
415
411
  }
@@ -422,8 +418,7 @@ export default class FormComponent extends Component {
422
418
  this.subForm.destroy();
423
419
  }
424
420
  // Render the form.
425
- return new Form(form, this.getSubOptions()).ready
426
- .then((instance) => {
421
+ return (new Form(form, this.getSubOptions())).ready.then((instance) => {
427
422
  this.subForm = instance;
428
423
  this.subForm.currentForm = this;
429
424
  this.subForm.parentVisible = this.visible;
@@ -433,8 +428,8 @@ export default class FormComponent extends Component {
433
428
  this.subForm.on('change', () => {
434
429
  if (this.subForm && !this.shouldConditionallyClear()) {
435
430
  this.dataValue = this.subForm.getValue();
436
- this.triggerChange({
437
- noEmit: true,
431
+ this.triggerChange?.({
432
+ noEmit: true
438
433
  });
439
434
  }
440
435
  });
@@ -446,12 +441,10 @@ export default class FormComponent extends Component {
446
441
  this.valueChanged = this.hasSetValue;
447
442
  this.onChange();
448
443
  return this.subForm;
449
- })
450
- .catch((err) => {
444
+ }).catch((err) => {
451
445
  console.log(err);
452
446
  });
453
- })
454
- .then((subForm) => {
447
+ }).then((subForm) => {
455
448
  this.updateSubWizards(subForm);
456
449
  return subForm;
457
450
  });
@@ -473,17 +466,11 @@ export default class FormComponent extends Component {
473
466
  */
474
467
  loadSubForm(fromAttach, beforeSubmit) {
475
468
  const loadHiddenForm = beforeSubmit && !this.component.clearOnHide;
476
- if (this.builderMode ||
477
- (this.conditionallyHidden() && !loadHiddenForm) ||
478
- (this.isSubFormLazyLoad() && !fromAttach)) {
469
+ if (this.builderMode || (this.conditionallyHidden() && !loadHiddenForm) || (this.isSubFormLazyLoad() && !fromAttach)) {
479
470
  return Promise.resolve();
480
471
  }
481
- if (this.hasLoadedForm &&
482
- !this.isRevisionChanged &&
483
- !(this.options.pdf &&
484
- this.component?.useOriginalRevision &&
485
- _.isNull(this.subForm) &&
486
- !this.subFormLoading)) {
472
+ if (this.hasLoadedForm && !this.isRevisionChanged &&
473
+ !(this.options.pdf && this.component?.useOriginalRevision && _.isNull(this.subForm) && !this.subFormLoading)) {
487
474
  // Pass config down to sub forms.
488
475
  if (this.root && this.root.form && this.root.form.config && !this.formObj.config) {
489
476
  this.formObj.config = this.root.form.config;
@@ -498,8 +485,7 @@ export default class FormComponent extends Component {
498
485
  project: this.root.formio.projectUrl,
499
486
  }
500
487
  : {};
501
- return new Formio(this.formSrc, options)
502
- .loadForm({ params: { live: 1 } })
488
+ return (new Formio(this.formSrc, options)).loadForm({ params: { live: 1 } })
503
489
  .then((formObj) => {
504
490
  this.formObj = formObj;
505
491
  if (this.options.pdf && this.component.useOriginalRevision) {
@@ -554,7 +540,8 @@ export default class FormComponent extends Component {
554
540
  get shouldSubmit() {
555
541
  return (this.subFormReady &&
556
542
  (!this.component.hasOwnProperty('reference') || this.component.reference) &&
557
- !this.shouldConditionallyClear());
543
+ !this.shouldConditionallyClear() &&
544
+ !(this.component.hidden && this.component.clearOnHide));
558
545
  }
559
546
  /**
560
547
  * Returns the data for the subform.
@@ -581,15 +568,12 @@ export default class FormComponent extends Component {
581
568
  }
582
569
  this.subForm.nosubmit = false;
583
570
  this.subForm.submitted = true;
584
- return this.subForm
585
- .submitForm({}, true)
586
- .then((result) => {
571
+ return this.subForm.submitForm({}, true).then(result => {
587
572
  this.subForm.loading = false;
588
573
  this.subForm.showAllErrors = false;
589
574
  this.dataValue = result.submission;
590
575
  return this.dataValue;
591
- })
592
- .catch((err) => {
576
+ }).catch(err => {
593
577
  this.subForm.showAllErrors = true;
594
578
  this.subForm.onSubmissionError(err);
595
579
  return Promise.reject(err);
@@ -655,10 +639,10 @@ export default class FormComponent extends Component {
655
639
  this.valueChanged = true;
656
640
  if (this.subForm) {
657
641
  const revisionPath = submission._frid ? '_frid' : '_vid';
658
- const shouldLoadOriginalRevision = this.useOriginalRevision &&
659
- (_.isNumber(submission[revisionPath]) || _.isNumber(submission._fvid)) &&
660
- _.isNumber(this.subForm.form?.[revisionPath]) &&
661
- submission._fvid !== this.subForm.form[revisionPath];
642
+ const shouldLoadOriginalRevision = this.useOriginalRevision
643
+ && (_.isNumber(submission[revisionPath]) || _.isNumber(submission._fvid))
644
+ && _.isNumber(this.subForm.form?.[revisionPath])
645
+ && submission._fvid !== this.subForm.form[revisionPath];
662
646
  if (shouldLoadOriginalRevision) {
663
647
  this.setFormRevision(submission._frid || submission._fvid);
664
648
  this.createSubForm().then(() => {
@@ -672,7 +656,10 @@ export default class FormComponent extends Component {
672
656
  return changed;
673
657
  }
674
658
  setSubFormValue(submission, flags) {
675
- const shouldLoadSubmissionById = submission && submission._id && this.subForm.formio && _.isEmpty(submission.data);
659
+ const shouldLoadSubmissionById = submission
660
+ && submission._id
661
+ && this.subForm.formio
662
+ && _.isEmpty(submission.data);
676
663
  const shouldLoadDraftById = this.options.saveDraft && _.isEmpty(submission.data) && _.get(this.subForm, 'submission._id');
677
664
  if (shouldLoadSubmissionById || shouldLoadDraftById) {
678
665
  const formId = submission.form || this.formObj.form || this.component.form;
@@ -738,7 +725,7 @@ export default class FormComponent extends Component {
738
725
  * @returns {boolean} - TRUE if this form is a Nested Wizard, FALSE otherwise
739
726
  */
740
727
  get isNestedWizard() {
741
- return (this.subForm?._form?.display === 'wizard' && this.parent?.parent?._form?.display === 'wizard');
728
+ return this.subForm?._form?.display === 'wizard' && this.parent?.parent?._form?.display === 'wizard';
742
729
  }
743
730
  get visible() {
744
731
  return super.visible;
@@ -762,7 +749,7 @@ export default class FormComponent extends Component {
762
749
  isNestedWizard ? this.rebuild() : this.redraw();
763
750
  }
764
751
  if (!value && isNestedWizard) {
765
- this.root.redraw();
752
+ this.root?.redraw();
766
753
  }
767
754
  }
768
755
  get parentVisible() {
@@ -833,7 +820,7 @@ export default class FormComponent extends Component {
833
820
  deleteValue() {
834
821
  super.setValue(null, {
835
822
  noUpdateEvent: true,
836
- noDefault: true,
823
+ noDefault: true
837
824
  });
838
825
  this.unset();
839
826
  }