@formio/js 5.0.0-rc.26 → 5.0.0-rc.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (360) hide show
  1. package/dist/fonts/bootstrap-icons.woff +0 -0
  2. package/dist/fonts/bootstrap-icons.woff2 +0 -0
  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.js +710 -689
  7. package/dist/formio.form.min.js +1 -1
  8. package/dist/formio.form.min.js.LICENSE.txt +2 -2
  9. package/dist/formio.full.css +100 -3
  10. package/dist/formio.full.js +715 -727
  11. package/dist/formio.full.min.css +2 -2
  12. package/dist/formio.full.min.js +1 -1
  13. package/dist/formio.full.min.js.LICENSE.txt +2 -2
  14. package/dist/formio.js +659 -264
  15. package/dist/formio.min.js +1 -1
  16. package/dist/formio.min.js.LICENSE.txt +2 -2
  17. package/dist/formio.utils.js +29 -8
  18. package/dist/formio.utils.min.js +1 -1
  19. package/dist/formio.utils.min.js.LICENSE.txt +2 -2
  20. package/lib/cjs/Embed.d.ts +2 -1
  21. package/lib/cjs/Embed.js +20 -7
  22. package/lib/cjs/PDF.js +2 -2
  23. package/lib/cjs/Webform.d.ts +3 -5
  24. package/lib/cjs/Webform.js +59 -81
  25. package/lib/cjs/WebformBuilder.d.ts +1 -1
  26. package/lib/cjs/WebformBuilder.js +27 -10
  27. package/lib/cjs/Wizard.d.ts +2 -0
  28. package/lib/cjs/Wizard.js +37 -26
  29. package/lib/cjs/WizardBuilder.d.ts +1 -0
  30. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +1 -2
  31. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +11 -12
  32. package/lib/cjs/addons/index.d.ts +1 -0
  33. package/lib/cjs/addons/index.js +5 -1
  34. package/lib/cjs/components/Components.d.ts +7 -0
  35. package/lib/cjs/components/Components.js +30 -0
  36. package/lib/cjs/components/_classes/component/Component.d.ts +57 -27
  37. package/lib/cjs/components/_classes/component/Component.js +193 -119
  38. package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.d.ts +8 -0
  39. package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.js +31 -1
  40. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +28 -11
  41. package/lib/cjs/components/_classes/nested/NestedComponent.js +88 -57
  42. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +4 -3
  43. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +17 -4
  44. package/lib/cjs/components/builder.js +0 -2
  45. package/lib/cjs/components/button/Button.js +2 -1
  46. package/lib/cjs/components/columns/Columns.d.ts +1 -0
  47. package/lib/cjs/components/columns/Columns.js +2 -3
  48. package/lib/cjs/components/columns/editForm/Columns.edit.display.d.ts +30 -1
  49. package/lib/cjs/components/columns/editForm/Columns.edit.display.js +23 -1
  50. package/lib/cjs/components/container/Container.d.ts +1 -0
  51. package/lib/cjs/components/container/Container.js +2 -6
  52. package/lib/cjs/components/content/Content.d.ts +1 -0
  53. package/lib/cjs/components/content/Content.js +1 -0
  54. package/lib/cjs/components/datagrid/DataGrid.d.ts +0 -8
  55. package/lib/cjs/components/datagrid/DataGrid.js +9 -26
  56. package/lib/cjs/components/datamap/DataMap.js +2 -1
  57. package/lib/cjs/components/datetime/DateTime.js +0 -2
  58. package/lib/cjs/components/day/Day.js +2 -3
  59. package/lib/cjs/components/editgrid/EditGrid.d.ts +8 -4
  60. package/lib/cjs/components/editgrid/EditGrid.js +96 -73
  61. package/lib/cjs/components/email/Email.js +0 -1
  62. package/lib/cjs/components/file/File.js +1 -1
  63. package/lib/cjs/components/file/fixtures/comp3.d.ts +29 -0
  64. package/lib/cjs/components/file/fixtures/comp3.js +31 -0
  65. package/lib/cjs/components/form/Form.d.ts +2 -6
  66. package/lib/cjs/components/form/Form.js +43 -14
  67. package/lib/cjs/components/index.d.ts +0 -2
  68. package/lib/cjs/components/index.js +0 -2
  69. package/lib/cjs/components/number/Number.d.ts +1 -2
  70. package/lib/cjs/components/number/Number.js +5 -6
  71. package/lib/cjs/components/panel/Panel.d.ts +0 -1
  72. package/lib/cjs/components/panel/Panel.js +2 -9
  73. package/lib/cjs/components/panel/editForm/Panel.edit.display.d.ts +6 -38
  74. package/lib/cjs/components/panel/editForm/Panel.edit.display.js +3 -16
  75. package/lib/cjs/components/phonenumber/PhoneNumber.js +17 -0
  76. package/lib/cjs/components/radio/Radio.js +0 -2
  77. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  78. package/lib/cjs/components/recaptcha/ReCaptcha.js +2 -2
  79. package/lib/cjs/components/select/Select.js +3 -2
  80. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +1 -2
  81. package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -6
  82. package/lib/cjs/components/table/editForm/Table.edit.display.d.ts +31 -2
  83. package/lib/cjs/components/table/editForm/Table.edit.display.js +22 -0
  84. package/lib/cjs/components/tabs/editForm/Tabs.edit.display.d.ts +30 -2
  85. package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +22 -0
  86. package/lib/cjs/components/textfield/TextField.js +20 -6
  87. package/lib/cjs/components/time/Time.js +0 -6
  88. package/lib/cjs/components/url/Url.js +0 -1
  89. package/lib/cjs/components/well/editForm/Well.edit.display.d.ts +25 -2
  90. package/lib/cjs/components/well/editForm/Well.edit.display.js +18 -0
  91. package/lib/cjs/formio.embed.js +5 -3
  92. package/lib/cjs/formio.form.d.ts +1 -7
  93. package/lib/cjs/formio.form.js +2 -38
  94. package/lib/cjs/index.d.ts +2 -1
  95. package/lib/cjs/index.js +2 -1
  96. package/lib/cjs/providers/Providers.d.ts +0 -4
  97. package/lib/cjs/providers/storage/azure.d.ts +0 -2
  98. package/lib/cjs/providers/storage/azure.js +1 -6
  99. package/lib/cjs/providers/storage/googleDrive.d.ts +0 -1
  100. package/lib/cjs/providers/storage/googleDrive.js +0 -4
  101. package/lib/cjs/providers/storage/s3.d.ts +0 -1
  102. package/lib/cjs/providers/storage/s3.js +0 -4
  103. package/lib/cjs/translations/en.d.ts +5 -0
  104. package/lib/cjs/translations/en.js +5 -0
  105. package/lib/cjs/utils/formUtils.js +1 -0
  106. package/lib/cjs/utils/utils.d.ts +2 -1
  107. package/lib/cjs/utils/utils.js +27 -9
  108. package/lib/mjs/Embed.d.ts +2 -1
  109. package/lib/mjs/Embed.js +20 -7
  110. package/lib/mjs/PDF.js +2 -2
  111. package/lib/mjs/Webform.d.ts +3 -5
  112. package/lib/mjs/Webform.js +58 -82
  113. package/lib/mjs/WebformBuilder.d.ts +1 -1
  114. package/lib/mjs/WebformBuilder.js +28 -7
  115. package/lib/mjs/Wizard.d.ts +2 -0
  116. package/lib/mjs/Wizard.js +36 -27
  117. package/lib/mjs/WizardBuilder.d.ts +1 -0
  118. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +1 -2
  119. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +11 -12
  120. package/lib/mjs/addons/index.d.ts +1 -0
  121. package/lib/mjs/addons/index.js +5 -1
  122. package/lib/mjs/components/Components.d.ts +7 -0
  123. package/lib/mjs/components/Components.js +29 -0
  124. package/lib/mjs/components/_classes/component/Component.d.ts +57 -27
  125. package/lib/mjs/components/_classes/component/Component.js +191 -118
  126. package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.d.ts +8 -0
  127. package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.js +31 -1
  128. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +28 -11
  129. package/lib/mjs/components/_classes/nested/NestedComponent.js +88 -57
  130. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +4 -3
  131. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +18 -5
  132. package/lib/mjs/components/builder.js +0 -2
  133. package/lib/mjs/components/button/Button.js +2 -1
  134. package/lib/mjs/components/columns/Columns.d.ts +1 -0
  135. package/lib/mjs/components/columns/Columns.js +2 -3
  136. package/lib/mjs/components/columns/editForm/Columns.edit.display.d.ts +30 -1
  137. package/lib/mjs/components/columns/editForm/Columns.edit.display.js +23 -1
  138. package/lib/mjs/components/container/Container.d.ts +1 -0
  139. package/lib/mjs/components/container/Container.js +2 -6
  140. package/lib/mjs/components/content/Content.d.ts +1 -0
  141. package/lib/mjs/components/content/Content.js +1 -0
  142. package/lib/mjs/components/datagrid/DataGrid.d.ts +0 -8
  143. package/lib/mjs/components/datagrid/DataGrid.js +9 -26
  144. package/lib/mjs/components/datamap/DataMap.js +2 -1
  145. package/lib/mjs/components/datetime/DateTime.js +0 -2
  146. package/lib/mjs/components/day/Day.js +2 -3
  147. package/lib/mjs/components/editgrid/EditGrid.d.ts +8 -4
  148. package/lib/mjs/components/editgrid/EditGrid.js +97 -76
  149. package/lib/mjs/components/email/Email.js +0 -1
  150. package/lib/mjs/components/file/File.js +1 -1
  151. package/lib/mjs/components/file/fixtures/comp3.d.ts +29 -0
  152. package/lib/mjs/components/file/fixtures/comp3.js +29 -0
  153. package/lib/mjs/components/form/Form.d.ts +2 -6
  154. package/lib/mjs/components/form/Form.js +45 -14
  155. package/lib/mjs/components/index.d.ts +0 -2
  156. package/lib/mjs/components/index.js +0 -2
  157. package/lib/mjs/components/number/Number.d.ts +1 -2
  158. package/lib/mjs/components/number/Number.js +4 -5
  159. package/lib/mjs/components/panel/Panel.d.ts +0 -1
  160. package/lib/mjs/components/panel/Panel.js +3 -9
  161. package/lib/mjs/components/panel/editForm/Panel.edit.display.d.ts +6 -38
  162. package/lib/mjs/components/panel/editForm/Panel.edit.display.js +3 -16
  163. package/lib/mjs/components/phonenumber/PhoneNumber.js +17 -0
  164. package/lib/mjs/components/radio/Radio.js +0 -2
  165. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
  166. package/lib/mjs/components/recaptcha/ReCaptcha.js +2 -2
  167. package/lib/mjs/components/select/Select.js +3 -2
  168. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +1 -2
  169. package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -6
  170. package/lib/mjs/components/table/editForm/Table.edit.display.d.ts +31 -2
  171. package/lib/mjs/components/table/editForm/Table.edit.display.js +22 -0
  172. package/lib/mjs/components/tabs/editForm/Tabs.edit.display.d.ts +30 -2
  173. package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +22 -0
  174. package/lib/mjs/components/textfield/TextField.js +20 -6
  175. package/lib/mjs/components/time/Time.js +0 -6
  176. package/lib/mjs/components/url/Url.js +0 -1
  177. package/lib/mjs/components/well/editForm/Well.edit.display.d.ts +25 -2
  178. package/lib/mjs/components/well/editForm/Well.edit.display.js +18 -0
  179. package/lib/mjs/formio.embed.js +5 -3
  180. package/lib/mjs/formio.form.d.ts +1 -7
  181. package/lib/mjs/formio.form.js +2 -32
  182. package/lib/mjs/index.d.ts +2 -1
  183. package/lib/mjs/index.js +1 -1
  184. package/lib/mjs/providers/Providers.d.ts +0 -4
  185. package/lib/mjs/providers/storage/azure.d.ts +0 -2
  186. package/lib/mjs/providers/storage/azure.js +1 -6
  187. package/lib/mjs/providers/storage/googleDrive.d.ts +0 -1
  188. package/lib/mjs/providers/storage/googleDrive.js +0 -4
  189. package/lib/mjs/providers/storage/s3.d.ts +0 -1
  190. package/lib/mjs/providers/storage/s3.js +0 -4
  191. package/lib/mjs/translations/en.d.ts +5 -0
  192. package/lib/mjs/translations/en.js +5 -0
  193. package/lib/mjs/utils/formUtils.js +1 -0
  194. package/lib/mjs/utils/utils.d.ts +2 -1
  195. package/lib/mjs/utils/utils.js +24 -7
  196. package/package.json +6 -6
  197. package/lib/cjs/components/tree/Node.d.ts +0 -55
  198. package/lib/cjs/components/tree/Node.js +0 -185
  199. package/lib/cjs/components/tree/Tree.d.ts +0 -48
  200. package/lib/cjs/components/tree/Tree.form.d.ts +0 -3
  201. package/lib/cjs/components/tree/Tree.form.js +0 -21
  202. package/lib/cjs/components/tree/Tree.js +0 -383
  203. package/lib/cjs/components/tree/editForm/Tree.edit.data.d.ts +0 -5
  204. package/lib/cjs/components/tree/editForm/Tree.edit.data.js +0 -9
  205. package/lib/cjs/components/tree/editForm/Tree.edit.display.d.ts +0 -9
  206. package/lib/cjs/components/tree/editForm/Tree.edit.display.js +0 -12
  207. package/lib/cjs/components/tree/fixtures/comp1.d.ts +0 -23
  208. package/lib/cjs/components/tree/fixtures/comp1.js +0 -24
  209. package/lib/cjs/components/tree/fixtures/comp2.d.ts +0 -116
  210. package/lib/cjs/components/tree/fixtures/comp2.js +0 -82
  211. package/lib/cjs/components/tree/fixtures/comp3.d.ts +0 -24
  212. package/lib/cjs/components/tree/fixtures/comp3.js +0 -25
  213. package/lib/cjs/components/tree/fixtures/comp4.d.ts +0 -42
  214. package/lib/cjs/components/tree/fixtures/comp4.js +0 -47
  215. package/lib/cjs/components/tree/fixtures/index.d.ts +0 -5
  216. package/lib/cjs/components/tree/fixtures/index.js +0 -14
  217. package/lib/cjs/validator/Rules.d.ts +0 -53
  218. package/lib/cjs/validator/Rules.js +0 -22
  219. package/lib/cjs/validator/Validator.d.ts +0 -228
  220. package/lib/cjs/validator/Validator.js +0 -1113
  221. package/lib/cjs/validator/conjunctions/index.d.ts +0 -7
  222. package/lib/cjs/validator/conjunctions/index.js +0 -18
  223. package/lib/cjs/validator/operators/index.d.ts +0 -7
  224. package/lib/cjs/validator/operators/index.js +0 -18
  225. package/lib/cjs/validator/quickRules/index.d.ts +0 -7
  226. package/lib/cjs/validator/quickRules/index.js +0 -18
  227. package/lib/cjs/validator/rules/Custom.d.ts +0 -5
  228. package/lib/cjs/validator/rules/Custom.js +0 -30
  229. package/lib/cjs/validator/rules/Date.d.ts +0 -5
  230. package/lib/cjs/validator/rules/Date.js +0 -25
  231. package/lib/cjs/validator/rules/Day.d.ts +0 -5
  232. package/lib/cjs/validator/rules/Day.js +0 -58
  233. package/lib/cjs/validator/rules/Email.d.ts +0 -5
  234. package/lib/cjs/validator/rules/Email.js +0 -24
  235. package/lib/cjs/validator/rules/JSON.d.ts +0 -5
  236. package/lib/cjs/validator/rules/JSON.js +0 -29
  237. package/lib/cjs/validator/rules/Mask.d.ts +0 -5
  238. package/lib/cjs/validator/rules/Mask.js +0 -32
  239. package/lib/cjs/validator/rules/Max.d.ts +0 -5
  240. package/lib/cjs/validator/rules/Max.js +0 -21
  241. package/lib/cjs/validator/rules/MaxDate.d.ts +0 -5
  242. package/lib/cjs/validator/rules/MaxDate.js +0 -34
  243. package/lib/cjs/validator/rules/MaxLength.d.ts +0 -5
  244. package/lib/cjs/validator/rules/MaxLength.js +0 -20
  245. package/lib/cjs/validator/rules/MaxWords.d.ts +0 -5
  246. package/lib/cjs/validator/rules/MaxWords.js +0 -20
  247. package/lib/cjs/validator/rules/MaxYear.d.ts +0 -5
  248. package/lib/cjs/validator/rules/MaxYear.js +0 -22
  249. package/lib/cjs/validator/rules/Min.d.ts +0 -5
  250. package/lib/cjs/validator/rules/Min.js +0 -21
  251. package/lib/cjs/validator/rules/MinDate.d.ts +0 -5
  252. package/lib/cjs/validator/rules/MinDate.js +0 -30
  253. package/lib/cjs/validator/rules/MinLength.d.ts +0 -5
  254. package/lib/cjs/validator/rules/MinLength.js +0 -20
  255. package/lib/cjs/validator/rules/MinWords.d.ts +0 -5
  256. package/lib/cjs/validator/rules/MinWords.js +0 -20
  257. package/lib/cjs/validator/rules/MinYear.d.ts +0 -5
  258. package/lib/cjs/validator/rules/MinYear.js +0 -22
  259. package/lib/cjs/validator/rules/Pattern.d.ts +0 -5
  260. package/lib/cjs/validator/rules/Pattern.js +0 -20
  261. package/lib/cjs/validator/rules/Required.d.ts +0 -5
  262. package/lib/cjs/validator/rules/Required.js +0 -17
  263. package/lib/cjs/validator/rules/Rule.d.ts +0 -7
  264. package/lib/cjs/validator/rules/Rule.js +0 -12
  265. package/lib/cjs/validator/rules/Select.d.ts +0 -5
  266. package/lib/cjs/validator/rules/Select.js +0 -95
  267. package/lib/cjs/validator/rules/Time.d.ts +0 -5
  268. package/lib/cjs/validator/rules/Time.js +0 -19
  269. package/lib/cjs/validator/rules/Unique.d.ts +0 -5
  270. package/lib/cjs/validator/rules/Unique.js +0 -69
  271. package/lib/cjs/validator/rules/Url.d.ts +0 -5
  272. package/lib/cjs/validator/rules/Url.js +0 -23
  273. package/lib/cjs/validator/rules/index.d.ts +0 -47
  274. package/lib/cjs/validator/rules/index.js +0 -51
  275. package/lib/cjs/validator/transformers/index.d.ts +0 -7
  276. package/lib/cjs/validator/transformers/index.js +0 -18
  277. package/lib/cjs/validator/valueSources/index.d.ts +0 -7
  278. package/lib/cjs/validator/valueSources/index.js +0 -18
  279. package/lib/mjs/components/tree/Node.d.ts +0 -55
  280. package/lib/mjs/components/tree/Node.js +0 -179
  281. package/lib/mjs/components/tree/Tree.d.ts +0 -48
  282. package/lib/mjs/components/tree/Tree.form.d.ts +0 -3
  283. package/lib/mjs/components/tree/Tree.form.js +0 -15
  284. package/lib/mjs/components/tree/Tree.js +0 -384
  285. package/lib/mjs/components/tree/editForm/Tree.edit.data.d.ts +0 -5
  286. package/lib/mjs/components/tree/editForm/Tree.edit.data.js +0 -7
  287. package/lib/mjs/components/tree/editForm/Tree.edit.display.d.ts +0 -9
  288. package/lib/mjs/components/tree/editForm/Tree.edit.display.js +0 -10
  289. package/lib/mjs/components/tree/fixtures/comp1.d.ts +0 -23
  290. package/lib/mjs/components/tree/fixtures/comp1.js +0 -22
  291. package/lib/mjs/components/tree/fixtures/comp2.d.ts +0 -116
  292. package/lib/mjs/components/tree/fixtures/comp2.js +0 -80
  293. package/lib/mjs/components/tree/fixtures/comp3.d.ts +0 -24
  294. package/lib/mjs/components/tree/fixtures/comp3.js +0 -23
  295. package/lib/mjs/components/tree/fixtures/comp4.d.ts +0 -42
  296. package/lib/mjs/components/tree/fixtures/comp4.js +0 -45
  297. package/lib/mjs/components/tree/fixtures/index.d.ts +0 -5
  298. package/lib/mjs/components/tree/fixtures/index.js +0 -5
  299. package/lib/mjs/validator/Rules.d.ts +0 -53
  300. package/lib/mjs/validator/Rules.js +0 -17
  301. package/lib/mjs/validator/Validator.d.ts +0 -228
  302. package/lib/mjs/validator/Validator.js +0 -1103
  303. package/lib/mjs/validator/conjunctions/index.d.ts +0 -7
  304. package/lib/mjs/validator/conjunctions/index.js +0 -16
  305. package/lib/mjs/validator/operators/index.d.ts +0 -7
  306. package/lib/mjs/validator/operators/index.js +0 -16
  307. package/lib/mjs/validator/quickRules/index.d.ts +0 -7
  308. package/lib/mjs/validator/quickRules/index.js +0 -16
  309. package/lib/mjs/validator/rules/Custom.d.ts +0 -5
  310. package/lib/mjs/validator/rules/Custom.js +0 -21
  311. package/lib/mjs/validator/rules/Date.d.ts +0 -5
  312. package/lib/mjs/validator/rules/Date.js +0 -16
  313. package/lib/mjs/validator/rules/Day.d.ts +0 -5
  314. package/lib/mjs/validator/rules/Day.js +0 -49
  315. package/lib/mjs/validator/rules/Email.d.ts +0 -5
  316. package/lib/mjs/validator/rules/Email.js +0 -15
  317. package/lib/mjs/validator/rules/JSON.d.ts +0 -5
  318. package/lib/mjs/validator/rules/JSON.js +0 -20
  319. package/lib/mjs/validator/rules/Mask.d.ts +0 -5
  320. package/lib/mjs/validator/rules/Mask.js +0 -23
  321. package/lib/mjs/validator/rules/Max.d.ts +0 -5
  322. package/lib/mjs/validator/rules/Max.js +0 -12
  323. package/lib/mjs/validator/rules/MaxDate.d.ts +0 -5
  324. package/lib/mjs/validator/rules/MaxDate.js +0 -25
  325. package/lib/mjs/validator/rules/MaxLength.d.ts +0 -5
  326. package/lib/mjs/validator/rules/MaxLength.js +0 -11
  327. package/lib/mjs/validator/rules/MaxWords.d.ts +0 -5
  328. package/lib/mjs/validator/rules/MaxWords.js +0 -11
  329. package/lib/mjs/validator/rules/MaxYear.d.ts +0 -5
  330. package/lib/mjs/validator/rules/MaxYear.js +0 -13
  331. package/lib/mjs/validator/rules/Min.d.ts +0 -5
  332. package/lib/mjs/validator/rules/Min.js +0 -12
  333. package/lib/mjs/validator/rules/MinDate.d.ts +0 -5
  334. package/lib/mjs/validator/rules/MinDate.js +0 -21
  335. package/lib/mjs/validator/rules/MinLength.d.ts +0 -5
  336. package/lib/mjs/validator/rules/MinLength.js +0 -11
  337. package/lib/mjs/validator/rules/MinWords.d.ts +0 -5
  338. package/lib/mjs/validator/rules/MinWords.js +0 -11
  339. package/lib/mjs/validator/rules/MinYear.d.ts +0 -5
  340. package/lib/mjs/validator/rules/MinYear.js +0 -13
  341. package/lib/mjs/validator/rules/Pattern.d.ts +0 -5
  342. package/lib/mjs/validator/rules/Pattern.js +0 -11
  343. package/lib/mjs/validator/rules/Required.d.ts +0 -5
  344. package/lib/mjs/validator/rules/Required.js +0 -8
  345. package/lib/mjs/validator/rules/Rule.d.ts +0 -7
  346. package/lib/mjs/validator/rules/Rule.js +0 -9
  347. package/lib/mjs/validator/rules/Select.d.ts +0 -5
  348. package/lib/mjs/validator/rules/Select.js +0 -86
  349. package/lib/mjs/validator/rules/Time.d.ts +0 -5
  350. package/lib/mjs/validator/rules/Time.js +0 -10
  351. package/lib/mjs/validator/rules/Unique.d.ts +0 -5
  352. package/lib/mjs/validator/rules/Unique.js +0 -60
  353. package/lib/mjs/validator/rules/Url.d.ts +0 -5
  354. package/lib/mjs/validator/rules/Url.js +0 -14
  355. package/lib/mjs/validator/rules/index.d.ts +0 -47
  356. package/lib/mjs/validator/rules/index.js +0 -46
  357. package/lib/mjs/validator/transformers/index.d.ts +0 -7
  358. package/lib/mjs/validator/transformers/index.js +0 -16
  359. package/lib/mjs/validator/valueSources/index.d.ts +0 -7
  360. package/lib/mjs/validator/valueSources/index.js +0 -16
@@ -83,12 +83,16 @@ export default class EditGridComponent extends NestedArrayComponent {
83
83
  removeRow(rowIndex: any, modified: any): void;
84
84
  createRowComponents(row: any, rowIndex: any, recreatePartially: any): any;
85
85
  hasOpenRows(): any;
86
+ getAttachedData(data?: null): any;
86
87
  shouldValidateDraft(editRow: any): any;
87
88
  shouldValidateRow(editRow: any, dirty: any): any;
88
- validateRow(editRow: any, dirty: any, forceSilentCheck: any): boolean;
89
- showRowErrorAlerts(editRow: any, valid: any): void;
90
- checkValidity(data: any, dirty: any, row: any, silentCheck: any): boolean;
91
- checkComponentValidity(data: any, dirty: any, row: any, options?: {}): boolean;
89
+ validateRow(editRow: any, dirty: any, forceSilentCheck: any): any;
90
+ showRowErrorAlerts(editRow: any, errors: any): void;
91
+ /**
92
+ * Return that this component processes its own validation.
93
+ */
94
+ get processOwnValidation(): boolean;
95
+ setRowInvalid(ref: any, index: any): void;
92
96
  changeState(changed: any, flags: any): void;
93
97
  openWhenEmpty(): void;
94
98
  restoreRowContext(editRow: any, flags?: {}): void;
@@ -1,9 +1,10 @@
1
1
  import _ from 'lodash';
2
+ import { processSync } from '@formio/core';
3
+ import { editgrid as templates } from '@formio/bootstrap/components';
2
4
  import NestedArrayComponent from '../_classes/nestedarray/NestedArrayComponent';
3
5
  import Component from '../_classes/component/Component';
4
6
  import Alert from '../alert/Alert';
5
- import { fastCloneDeep, Evaluator, getArrayFromComponentPath, eachComponent } from '../../utils/utils';
6
- import { editgrid as templates } from '@formio/bootstrap/components';
7
+ import { fastCloneDeep, Evaluator, getArrayFromComponentPath, eachComponent, getComponentsSchema } from '../../utils/utils';
7
8
  const EditRowState = {
8
9
  New: 'new',
9
10
  Editing: 'editing',
@@ -82,7 +83,7 @@ export default class EditGridComponent extends NestedArrayComponent {
82
83
  {% if (!instance.options.readOnly && !instance.disabled) { %}
83
84
  <div class="col-sm-2">
84
85
  <div class="btn-group pull-right">
85
- <button class="btn btn-default btn-light btn-sm editRow"><i class="{{ iconClass('edit') }}"></i></button>
86
+ <button class="btn btn-default btn-light btn-sm editRow"><i class="{{ iconClass('pen-fill') }}"></i></button>
86
87
  {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}
87
88
  <button class="btn btn-danger btn-sm removeRow"><i class="{{ iconClass('trash') }}"></i></button>
88
89
  {% } %}
@@ -103,7 +104,7 @@ export default class EditGridComponent extends NestedArrayComponent {
103
104
  {% if (!instance.options.readOnly && !instance.disabled) { %}
104
105
  <td class="editgrid-table-column">
105
106
  <div class="btn-group">
106
- <button class="btn btn-default btn-light btn-sm editRow" aria-label="{{ t('Edit row') }}"><i class="{{ iconClass('edit') }}"></i></button>
107
+ <button class="btn btn-default btn-light btn-sm editRow" aria-label="{{ t('Edit row') }}"><i class="{{ iconClass('pen-fill') }}"></i></button>
107
108
  {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}
108
109
  <button class="btn btn-danger btn-sm removeRow" aria-label="{{ t('Remove row') }}"><i class="{{ iconClass('trash') }}"></i></button>
109
110
  {% } %}
@@ -434,11 +435,10 @@ export default class EditGridComponent extends NestedArrayComponent {
434
435
  action: () => {
435
436
  this.editRow(rowIndex).then(() => {
436
437
  if (this.component.rowDrafts) {
437
- this.validateRow(editRow, false);
438
- const hasErrors = editRow.errors && !!editRow.errors.length;
439
- const shouldShowRowErrorsAlert = this.component.modal && hasErrors && this.root?.submitted;
438
+ const errors = this.validateRow(editRow, false);
439
+ const shouldShowRowErrorsAlert = this.component.modal && errors.length && this.root?.submitted;
440
440
  if (shouldShowRowErrorsAlert) {
441
- this.alert.showErrors(editRow.errors, false);
441
+ this.alert.showErrors(errors, false);
442
442
  editRow.alerts = true;
443
443
  }
444
444
  }
@@ -606,7 +606,7 @@ export default class EditGridComponent extends NestedArrayComponent {
606
606
  component: this.component,
607
607
  row: editRow,
608
608
  });
609
- this.checkRow('checkData', null, {}, editRow.data, editRow.components);
609
+ this.processRow('checkData', null, {}, editRow.data, editRow.components);
610
610
  if (this.component.modal) {
611
611
  this.addRowModal(rowIndex);
612
612
  }
@@ -653,13 +653,14 @@ export default class EditGridComponent extends NestedArrayComponent {
653
653
  if (!this.component.rowDrafts) {
654
654
  editRow.components.forEach((comp) => comp.setPristine(false));
655
655
  }
656
- if (this.validateRow(editRow, true) || this.component.rowDrafts) {
656
+ const errors = this.validateRow(editRow, true);
657
+ if (!errors.length || this.component.rowDrafts) {
657
658
  editRow.willBeSaved = true;
658
659
  dialog.close();
659
660
  this.saveRow(rowIndex, true);
660
661
  }
661
662
  else {
662
- this.alert.showErrors(editRow.errors, false);
663
+ this.alert.showErrors(errors, false);
663
664
  editRow.alerts = true;
664
665
  }
665
666
  },
@@ -784,9 +785,9 @@ export default class EditGridComponent extends NestedArrayComponent {
784
785
  if (!this.component.rowDrafts) {
785
786
  editRow.components.forEach((comp) => comp.setPristine(false));
786
787
  }
787
- const isRowValid = this.validateRow(editRow, true);
788
+ const errors = this.validateRow(editRow, true);
788
789
  if (!this.component.rowDrafts) {
789
- if (!isRowValid) {
790
+ if (errors.length) {
790
791
  return false;
791
792
  }
792
793
  }
@@ -812,7 +813,7 @@ export default class EditGridComponent extends NestedArrayComponent {
812
813
  }
813
814
  }
814
815
  }
815
- editRow.state = this.component.rowDrafts && !isRowValid ? EditRowState.Draft : EditRowState.Saved;
816
+ editRow.state = this.component.rowDrafts && errors.length ? EditRowState.Draft : EditRowState.Saved;
816
817
  editRow.backup = null;
817
818
  this.updateValue();
818
819
  this.emit('editGridSaveRow', {
@@ -919,21 +920,12 @@ export default class EditGridComponent extends NestedArrayComponent {
919
920
  return;
920
921
  }
921
922
  const editRow = this.editRows[rowIndex];
922
- if (editRow?.alerts) {
923
- this.checkData(null, {
924
- ...flags,
925
- changed,
926
- rowIndex,
927
- }, this.data);
928
- }
929
- else if (editRow) {
930
- // If drafts allowed, perform validation silently if there was no attempt to submit a form
931
- const silentCheck = this.component.rowDrafts && !this.shouldValidateDraft(editRow);
932
- this.checkRow('checkData', null, {
923
+ if (editRow) {
924
+ this.processRow('checkData', null, {
933
925
  ...flags,
934
926
  changed,
935
- silentCheck
936
- }, editRow.data, editRow.components, silentCheck);
927
+ }, editRow.data, editRow.components);
928
+ this.validateRow(editRow, false);
937
929
  }
938
930
  if (this.variableTypeComponentsIndexes.length) {
939
931
  this.checkRowVariableTypeComponents(editRow, rowIndex);
@@ -949,6 +941,11 @@ export default class EditGridComponent extends NestedArrayComponent {
949
941
  hasOpenRows() {
950
942
  return this.editRows.some(row => this.isOpen(row));
951
943
  }
944
+ getAttachedData(data = null) {
945
+ const ourData = fastCloneDeep(data || this._data || this.rootValue);
946
+ _.set(ourData, this.key, this.editRows.map((row) => row.data));
947
+ return ourData;
948
+ }
952
949
  shouldValidateDraft(editRow) {
953
950
  // Draft rows should be validated only when there was an attempt to submit a form
954
951
  return (editRow.state === EditRowState.Draft &&
@@ -959,46 +956,64 @@ export default class EditGridComponent extends NestedArrayComponent {
959
956
  }
960
957
  shouldValidateRow(editRow, dirty) {
961
958
  return this.shouldValidateDraft(editRow) ||
959
+ editRow.state === EditRowState.New ||
962
960
  editRow.state === EditRowState.Editing ||
963
961
  editRow.alerts ||
964
962
  dirty;
965
963
  }
966
964
  validateRow(editRow, dirty, forceSilentCheck) {
967
- let valid = true;
968
- const errorsSnapshot = [...this.errors];
965
+ editRow.errors = [];
969
966
  if (this.shouldValidateRow(editRow, dirty)) {
970
- editRow.components.forEach(comp => {
971
- const silentCheck = (this.component.rowDrafts && !this.shouldValidateDraft(editRow)) || forceSilentCheck;
972
- valid &= comp.checkValidity(null, dirty, null, silentCheck);
973
- });
967
+ const silentCheck = (this.component.rowDrafts && !this.shouldValidateDraft(editRow)) || forceSilentCheck;
968
+ const rootValue = fastCloneDeep(this.rootValue);
969
+ const editGridValue = _.get(rootValue, this.path, []);
970
+ editGridValue[editRow.rowIndex] = editRow.data;
971
+ _.set(rootValue, this.path, editGridValue);
972
+ editRow.errors = processSync({
973
+ components: fastCloneDeep(this.component.components).map((component) => {
974
+ component.parentPath = `${this.path}[${editRow.rowIndex}]`;
975
+ return component;
976
+ }),
977
+ data: rootValue,
978
+ row: editRow.data,
979
+ process: 'validateRow',
980
+ instances: this.componentsMap,
981
+ scope: { errors: [] },
982
+ processors: [
983
+ (context) => this.validationProcessor(context, { dirty, silentCheck })
984
+ ]
985
+ }).errors;
974
986
  }
987
+ // TODO: this is essentially running its own custom validation and should be moved into a validation rule
975
988
  if (this.component.validate && this.component.validate.row) {
976
- valid = this.evaluate(this.component.validate.row, {
977
- valid,
989
+ const valid = this.evaluate(this.component.validate.row, {
990
+ valid: (editRow.length === 0),
978
991
  row: editRow.data
979
992
  }, 'valid', true);
980
993
  if (valid.toString() !== 'true') {
981
- editRow.error = valid;
982
- valid = false;
983
- }
984
- else {
985
- editRow.error = null;
994
+ editRow.errors.push({
995
+ type: 'error',
996
+ rowError: true,
997
+ message: valid.toString()
998
+ });
986
999
  }
987
1000
  if (valid === null) {
988
- valid = `Invalid row validation for ${this.key}`;
1001
+ editRow.errors.push({
1002
+ type: 'error',
1003
+ message: `Invalid row validation for ${this.key}`
1004
+ });
989
1005
  }
990
1006
  }
991
- editRow.errors = !valid ? this.errors.filter((err) => !errorsSnapshot.includes(err)) : null;
992
1007
  if (!this.component.rowDrafts || this.root?.submitted) {
993
- this.showRowErrorAlerts(editRow, !!valid);
1008
+ this.showRowErrorAlerts(editRow, editRow.errors);
994
1009
  }
995
- return !!valid;
1010
+ return editRow.errors;
996
1011
  }
997
- showRowErrorAlerts(editRow, valid) {
1012
+ showRowErrorAlerts(editRow, errors) {
998
1013
  if (editRow.alerts) {
999
1014
  if (this.alert) {
1000
- if (editRow.errors?.length && !valid) {
1001
- this.alert.showErrors(editRow.errors, false);
1015
+ if (errors.length) {
1016
+ this.alert.showErrors(errors, false);
1002
1017
  editRow.alerts = true;
1003
1018
  }
1004
1019
  else {
@@ -1007,39 +1022,34 @@ export default class EditGridComponent extends NestedArrayComponent {
1007
1022
  }
1008
1023
  }
1009
1024
  }
1010
- checkValidity(data, dirty, row, silentCheck) {
1011
- data = data || this.rootValue;
1012
- row = row || this.data;
1013
- if (!this.checkCondition(row, data)) {
1014
- this.setCustomValidity('');
1015
- return true;
1016
- }
1017
- return this.checkComponentValidity(data, dirty, row, { silentCheck });
1025
+ /**
1026
+ * Return that this component processes its own validation.
1027
+ */
1028
+ get processOwnValidation() {
1029
+ return true;
1018
1030
  }
1019
- checkComponentValidity(data, dirty, row, options = {}) {
1031
+ checkComponentValidity(data, dirty, row, options = {}, errors = []) {
1020
1032
  const { silentCheck } = options;
1021
- const errorsLength = this.errors.length;
1022
- const superValid = super.checkComponentValidity(data, dirty, row, options);
1033
+ const superValid = super.checkComponentValidity(data, dirty, row, options, errors);
1023
1034
  // If super tells us that component invalid and there is no need to update alerts, just return false
1024
1035
  if (!superValid && (!this.alert && !this.hasOpenRows())) {
1025
1036
  return false;
1026
1037
  }
1027
- if (this.shouldSkipValidation(data, dirty, row)) {
1028
- return true;
1029
- }
1030
- let rowsValid = true;
1031
1038
  let rowsEditing = false;
1039
+ const allRowErrors = [];
1032
1040
  this.editRows.forEach((editRow, index) => {
1033
1041
  // Trigger all errors on the row.
1034
- const rowValid = this.validateRow(editRow, dirty, silentCheck);
1035
- rowsValid &= rowValid;
1042
+ const rowErrors = this.validateRow(editRow, dirty, silentCheck);
1043
+ errors.push(...rowErrors);
1044
+ allRowErrors.push(...rowErrors);
1036
1045
  if (this.rowRefs) {
1037
1046
  const rowContainer = this.rowRefs[index];
1038
1047
  if (rowContainer) {
1039
1048
  const errorContainer = rowContainer.querySelector('.editgrid-row-error');
1040
- if (!rowValid && errorContainer && (!this.component.rowDrafts || this.shouldValidateDraft(editRow))) {
1049
+ if (rowErrors.length && errorContainer && (!this.component.rowDrafts || this.shouldValidateDraft(editRow))) {
1050
+ const rowError = rowErrors.find(error => error.rowError);
1041
1051
  this.addClass(errorContainer, 'help-block');
1042
- errorContainer.textContent = this.t(this.errorMessage('invalidRowError'));
1052
+ errorContainer.textContent = this.t(rowError ? rowError.message : this.errorMessage('invalidRowError'));
1043
1053
  }
1044
1054
  else if (errorContainer) {
1045
1055
  errorContainer.textContent = '';
@@ -1049,10 +1059,9 @@ export default class EditGridComponent extends NestedArrayComponent {
1049
1059
  // If this is a dirty check, and any rows are still editing, we need to throw validation error.
1050
1060
  rowsEditing |= (dirty && this.isOpen(editRow));
1051
1061
  });
1052
- if (!rowsValid) {
1053
- if (!silentCheck && (!this.component.rowDrafts || this.root?.submitted)) {
1062
+ if (allRowErrors.length) {
1063
+ if (!silentCheck && (dirty || this.dirty) && (!this.component.rowDrafts || this.root?.submitted)) {
1054
1064
  this.setCustomValidity(this.t(this.errorMessage('invalidRowsError')), dirty);
1055
- // Delete this class, because otherwise all the components inside EditGrid will has red border even if they are valid
1056
1065
  this.removeClass(this.element, 'has-error');
1057
1066
  }
1058
1067
  return false;
@@ -1062,15 +1071,28 @@ export default class EditGridComponent extends NestedArrayComponent {
1062
1071
  return false;
1063
1072
  }
1064
1073
  const message = this.invalid || this.invalidMessage(data, dirty);
1065
- if (this.errors?.length !== errorsLength && this.root?.submitted && !message) {
1066
- this.setCustomValidity(message, dirty);
1067
- this.root.showErrors();
1074
+ if (allRowErrors.length && this.root?.submitted && !message) {
1075
+ this._errors = this.setCustomValidity(message, dirty);
1076
+ errors.push(...this._errors);
1077
+ this.root.showErrors([message]);
1068
1078
  }
1069
1079
  else {
1070
- this.setCustomValidity(message, dirty);
1080
+ this._errors = this.setCustomValidity(message, dirty);
1081
+ errors.push(...this._errors);
1071
1082
  }
1072
1083
  return superValid;
1073
1084
  }
1085
+ setRowInvalid(ref, index) {
1086
+ const editRow = this.editRows[index];
1087
+ const errorContainer = ref.querySelector('.editgrid-row-error');
1088
+ if (errorContainer && (!this.component.rowDrafts || this.shouldValidateDraft(editRow))) {
1089
+ this.addClass(errorContainer, 'help-block');
1090
+ errorContainer.textContent = this.t(this.errorMessage('invalidRowError'));
1091
+ }
1092
+ else if (errorContainer) {
1093
+ errorContainer.textContent = '';
1094
+ }
1095
+ }
1074
1096
  changeState(changed, flags) {
1075
1097
  if (changed || (flags.resetValue && this.component.modalEdit)) {
1076
1098
  this.rebuild();
@@ -1092,7 +1114,6 @@ export default class EditGridComponent extends NestedArrayComponent {
1092
1114
  }
1093
1115
  }
1094
1116
  const changed = this.hasChanged(value, this.dataValue);
1095
- flags.noValidate = !changed;
1096
1117
  if (this.parent) {
1097
1118
  this.parent.checkComponentConditions();
1098
1119
  }
@@ -1105,7 +1126,7 @@ export default class EditGridComponent extends NestedArrayComponent {
1105
1126
  this.restoreRowContext(editRow, flags);
1106
1127
  editRow.state = EditRowState.Saved;
1107
1128
  editRow.backup = null;
1108
- editRow.error = null;
1129
+ editRow.errors = [];
1109
1130
  }
1110
1131
  else {
1111
1132
  this.editRows[rowIndex] = {
@@ -1113,7 +1134,7 @@ export default class EditGridComponent extends NestedArrayComponent {
1113
1134
  data: row,
1114
1135
  state: EditRowState.Saved,
1115
1136
  backup: null,
1116
- error: null,
1137
+ errors: [],
1117
1138
  };
1118
1139
  }
1119
1140
  });
@@ -23,7 +23,6 @@ export default class EmailComponent extends TextFieldComponent {
23
23
  }
24
24
  init() {
25
25
  super.init();
26
- this.validators.push('email');
27
26
  }
28
27
  get defaultSchema() {
29
28
  return EmailComponent.schema();
@@ -282,7 +282,7 @@ export default class FileComponent extends Field {
282
282
  }
283
283
  deleteFile(fileInfo) {
284
284
  const { options = {} } = this.component;
285
- if (fileInfo && (['url', 'indexeddb', 's3', 'googledrive', 'azure'].includes(this.component.storage))) {
285
+ if (fileInfo && (['url', 'indexeddb'].includes(this.component.storage))) {
286
286
  const { fileService } = this;
287
287
  if (fileService && typeof fileService.deleteFile === 'function') {
288
288
  fileService.deleteFile(fileInfo, options);
@@ -0,0 +1,29 @@
1
+ declare namespace _default {
2
+ const type: string;
3
+ const display: string;
4
+ const components: ({
5
+ label: string;
6
+ tableView: boolean;
7
+ storage: string;
8
+ webcam: boolean;
9
+ fileTypes: {
10
+ label: string;
11
+ value: string;
12
+ }[];
13
+ key: string;
14
+ type: string;
15
+ input: boolean;
16
+ disableOnInvalid?: undefined;
17
+ } | {
18
+ type: string;
19
+ label: string;
20
+ key: string;
21
+ disableOnInvalid: boolean;
22
+ input: boolean;
23
+ tableView: boolean;
24
+ storage?: undefined;
25
+ webcam?: undefined;
26
+ fileTypes?: undefined;
27
+ })[];
28
+ }
29
+ export default _default;
@@ -0,0 +1,29 @@
1
+ export default {
2
+ type: 'form',
3
+ display: 'form',
4
+ components: [
5
+ {
6
+ label: 'Upload',
7
+ tableView: false,
8
+ storage: 'base64',
9
+ webcam: false,
10
+ fileTypes: [
11
+ {
12
+ label: '',
13
+ value: ''
14
+ }
15
+ ],
16
+ key: 'file',
17
+ type: 'file',
18
+ input: true
19
+ },
20
+ {
21
+ type: 'button',
22
+ label: 'Submit',
23
+ key: 'submit',
24
+ disableOnInvalid: true,
25
+ input: true,
26
+ tableView: false
27
+ }
28
+ ],
29
+ };
@@ -25,10 +25,6 @@ export default class FormComponent extends Component {
25
25
  getSubOptions(options?: {}): {};
26
26
  render(): any;
27
27
  asString(value: any): any;
28
- /**
29
- * Prints out the value of form components as a datagrid value.
30
- */
31
- getValueAsString(value: any): any;
32
28
  attach(element: any): Promise<any>;
33
29
  get hasLoadedForm(): any;
34
30
  get isRevisionChanged(): any;
@@ -54,7 +50,7 @@ export default class FormComponent extends Component {
54
50
  loadSubForm(fromAttach: any): any;
55
51
  subFormLoading: boolean | undefined;
56
52
  get subFormData(): any;
57
- checkComponentValidity(data: any, dirty: any, row: any, options: any): any;
53
+ checkComponentValidity(data: any, dirty: any, row: any, options: any, errors?: any[]): any;
58
54
  checkComponentConditions(data: any, flags: any, row: any): any;
59
55
  calculateValue(data: any, flags: any, row: any): any;
60
56
  setPristine(pristine: any): void;
@@ -74,7 +70,7 @@ export default class FormComponent extends Component {
74
70
  *
75
71
  * @return {*}
76
72
  */
77
- submitSubForm(rejectOnError: any): any;
73
+ submitSubForm(): any;
78
74
  /**
79
75
  * Submit the form before the next page is triggered.
80
76
  */
@@ -137,7 +137,6 @@ export default class FormComponent extends Component {
137
137
  }
138
138
  }
139
139
  getSubOptions(options = {}) {
140
- options.parentPath = `${this.path}.data.`;
141
140
  options.events = this.createEmitter();
142
141
  // Make sure to not show the submit button in wizards in the nested forms.
143
142
  _.set(options, 'buttonSettings.showSubmit', false);
@@ -186,6 +185,12 @@ export default class FormComponent extends Component {
186
185
  if (this.options.onChange) {
187
186
  options.onChange = this.options.onChange;
188
187
  }
188
+ if (this.options.preview) {
189
+ options.preview = this.options.preview;
190
+ }
191
+ if (this.options.inEditGrid) {
192
+ options.inEditGrid = this.options.inEditGrid;
193
+ }
189
194
  return options;
190
195
  }
191
196
  render() {
@@ -201,7 +206,7 @@ export default class FormComponent extends Component {
201
206
  /**
202
207
  * Prints out the value of form components as a datagrid value.
203
208
  */
204
- getValueAsString(value) {
209
+ getValueAsString(value, options) {
205
210
  if (!value) {
206
211
  return 'No data provided';
207
212
  }
@@ -211,6 +216,33 @@ export default class FormComponent extends Component {
211
216
  if (!value.data || !Object.keys(value.data).length) {
212
217
  return 'No data provided';
213
218
  }
219
+ if (options?.email) {
220
+ let result = (`
221
+ <table border="1" style="width:100%">
222
+ <tbody>
223
+ `);
224
+ this.everyComponent((component) => {
225
+ if (component.isInputComponent && component.visible && !component.skipInEmail) {
226
+ result += (`
227
+ <tr>
228
+ <th style="padding: 5px 10px;">${component.label}</th>
229
+ <td style="width:100%;padding:5px 10px;">${component.getView(component.dataValue, options)}</td>
230
+ </tr>
231
+ `);
232
+ }
233
+ }, {
234
+ ...options,
235
+ fromRoot: true,
236
+ });
237
+ result += (`
238
+ </tbody>
239
+ </table>
240
+ `);
241
+ return result;
242
+ }
243
+ if (_.isEmpty(value)) {
244
+ return '';
245
+ }
214
246
  return '[Complex Data]';
215
247
  }
216
248
  attach(element) {
@@ -386,7 +418,7 @@ export default class FormComponent extends Component {
386
418
  return Promise.resolve();
387
419
  }
388
420
  if (this.hasLoadedForm && !this.isRevisionChanged &&
389
- !(this.options.pdf && this.useOriginalRevision && _.isNull(this.subForm) && !this.subFormLoading)) {
421
+ !(this.options.pdf && this.component?.useOriginalRevision && _.isNull(this.subForm) && !this.subFormLoading)) {
390
422
  // Pass config down to sub forms.
391
423
  if (this.root && this.root.form && this.root.form.config && !this.formObj.config) {
392
424
  this.formObj.config = this.root.form.config;
@@ -398,6 +430,9 @@ export default class FormComponent extends Component {
398
430
  return (new Formio(this.formSrc)).loadForm({ params: { live: 1 } })
399
431
  .then((formObj) => {
400
432
  this.formObj = formObj;
433
+ if (this.options.pdf && this.component.useOriginalRevision) {
434
+ this.formObj.display = 'form';
435
+ }
401
436
  this.subFormLoading = false;
402
437
  return formObj;
403
438
  })
@@ -411,13 +446,13 @@ export default class FormComponent extends Component {
411
446
  get subFormData() {
412
447
  return this.dataValue?.data || {};
413
448
  }
414
- checkComponentValidity(data, dirty, row, options) {
449
+ checkComponentValidity(data, dirty, row, options, errors = []) {
415
450
  options = options || {};
416
451
  const silentCheck = options.silentCheck || false;
417
452
  if (this.subForm) {
418
- return this.subForm.checkValidity(this.subFormData, dirty, null, silentCheck);
453
+ return this.subForm.checkValidity(this.subFormData, dirty, null, silentCheck, errors);
419
454
  }
420
- return super.checkComponentValidity(data, dirty, row, options);
455
+ return super.checkComponentValidity(data, dirty, row, options, errors);
421
456
  }
422
457
  checkComponentConditions(data, flags, row) {
423
458
  const visible = super.checkComponentConditions(data, flags, row);
@@ -476,7 +511,7 @@ export default class FormComponent extends Component {
476
511
  *
477
512
  * @return {*}
478
513
  */
479
- submitSubForm(rejectOnError) {
514
+ submitSubForm() {
480
515
  // If we wish to submit the form on next page, then do that here.
481
516
  if (this.shouldSubmit) {
482
517
  return this.subFormReady.then(() => {
@@ -484,6 +519,7 @@ export default class FormComponent extends Component {
484
519
  return this.dataValue;
485
520
  }
486
521
  this.subForm.nosubmit = false;
522
+ this.subForm.submitted = true;
487
523
  return this.subForm.submitForm().then(result => {
488
524
  this.subForm.loading = false;
489
525
  this.subForm.showAllErrors = false;
@@ -491,13 +527,8 @@ export default class FormComponent extends Component {
491
527
  return this.dataValue;
492
528
  }).catch(err => {
493
529
  this.subForm.showAllErrors = true;
494
- if (rejectOnError) {
495
- this.subForm.onSubmissionError(err);
496
- return Promise.reject(err);
497
- }
498
- else {
499
- return {};
500
- }
530
+ this.subForm.onSubmissionError(err);
531
+ return Promise.reject(err);
501
532
  });
502
533
  });
503
534
  }
@@ -44,7 +44,6 @@ declare namespace _default {
44
44
  export { TextAreaComponent as textarea };
45
45
  export { TextFieldComponent as textfield };
46
46
  export { TimeComponent as time };
47
- export { TreeComponent as tree };
48
47
  export { UnknownComponent as unknown };
49
48
  export { UrlComponent as url };
50
49
  export { WellComponent as well };
@@ -94,7 +93,6 @@ import TagsComponent from './tags/Tags';
94
93
  import TextAreaComponent from './textarea/TextArea';
95
94
  import TextFieldComponent from './textfield/TextField';
96
95
  import TimeComponent from './time/Time';
97
- import TreeComponent from './tree/Tree';
98
96
  import UnknownComponent from './unknown/Unknown';
99
97
  import UrlComponent from './url/Url';
100
98
  import WellComponent from './well/Well';
@@ -42,7 +42,6 @@ import TagsComponent from './tags/Tags';
42
42
  import TextAreaComponent from './textarea/TextArea';
43
43
  import TextFieldComponent from './textfield/TextField';
44
44
  import TimeComponent from './time/Time';
45
- import TreeComponent from './tree/Tree';
46
45
  import UnknownComponent from './unknown/Unknown';
47
46
  import UrlComponent from './url/Url';
48
47
  import WellComponent from './well/Well';
@@ -92,7 +91,6 @@ export default {
92
91
  textarea: TextAreaComponent,
93
92
  textfield: TextFieldComponent,
94
93
  time: TimeComponent,
95
- tree: TreeComponent,
96
94
  unknown: UnknownComponent,
97
95
  url: UrlComponent,
98
96
  well: WellComponent,
@@ -31,10 +31,9 @@ export default class NumberComponent extends Input {
31
31
  };
32
32
  static savedValueTypes(schema: any): string[];
33
33
  constructor(...args: any[]);
34
- validators: string[];
34
+ decimalSeparator: any;
35
35
  delimiter: any;
36
36
  decimalLimit: any;
37
- decimalSeparator: any;
38
37
  numberMask: any;
39
38
  /**
40
39
  * Creates the number mask for normal numbers.