@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
package/lib/cjs/Wizard.js CHANGED
@@ -181,7 +181,10 @@ class Wizard extends Webform_1.default {
181
181
  return this.renderTemplate('wizardNav', ctx);
182
182
  }
183
183
  prepareHeaderSettings(ctx, headerType) {
184
- if (this.currentPanel && this.currentPanel.breadcrumb === 'none' || ctx.isSubForm) {
184
+ var _a;
185
+ const shouldHideBreadcrumbs = ((_a = this.currentPanel) === null || _a === void 0 ? void 0 : _a.breadcrumb) === 'none' ||
186
+ lodash_1.default.get(this.form, 'settings.wizardBreadcrumbsType', '') === 'none';
187
+ if (shouldHideBreadcrumbs || ctx.isSubForm) {
185
188
  return null;
186
189
  }
187
190
  return this.renderTemplate(headerType, ctx);
@@ -577,6 +580,7 @@ class Wizard extends Webform_1.default {
577
580
  }
578
581
  this.redraw().then(() => {
579
582
  this.checkData(this.submission.data);
583
+ this.validateCurrentPage();
580
584
  });
581
585
  return Promise.resolve();
582
586
  }
@@ -674,7 +678,8 @@ class Wizard extends Webform_1.default {
674
678
  });
675
679
  }
676
680
  // Validate the form, before go to the next page
677
- if (this.checkValidity(this.localData, true, this.localData, true)) {
681
+ const errors = this.validateCurrentPage({ dirty: true });
682
+ if (errors.length === 0) {
678
683
  this.checkData(this.submission.data);
679
684
  return this.beforePage(true).then(() => {
680
685
  return this.setPage(this.getNextPage()).then(() => {
@@ -689,9 +694,14 @@ class Wizard extends Webform_1.default {
689
694
  else {
690
695
  this.currentPage.components.forEach((comp) => comp.setPristine(false));
691
696
  this.scrollIntoView(this.element);
692
- return Promise.reject(this.showErrors([], true));
697
+ return Promise.reject(this.showErrors(errors, true));
693
698
  }
694
699
  }
700
+ validateCurrentPage(flags = {}) {
701
+ var _a;
702
+ // Accessing the parent ensures the right instance (whether it's the parent Wizard or a nested Wizard) performs its validation
703
+ return (_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.parent.validateComponents(this.currentPage.component.components, this.currentPage.parent.data, flags);
704
+ }
695
705
  emitPrevPage() {
696
706
  this.emit('prevPage', { page: this.page, submission: this.submission });
697
707
  }
@@ -768,7 +778,7 @@ class Wizard extends Webform_1.default {
768
778
  return super.setForm(form, flags);
769
779
  }
770
780
  onSetForm(clonedForm, initialForm) {
771
- this.component.components = (this._parentPath ? initialForm.components : clonedForm.components) || [];
781
+ this.component.components = (this.parent ? initialForm.components : clonedForm.components) || [];
772
782
  this.setComponentSchema();
773
783
  }
774
784
  setEditMode(submission) {
@@ -781,7 +791,9 @@ class Wizard extends Webform_1.default {
781
791
  const changed = this.getPages({ all: true }).reduce((changed, page) => {
782
792
  return this.setNestedValue(page, submission.data, flags, changed) || changed;
783
793
  }, false);
784
- if (!flags.sanitize) {
794
+ if (!flags.sanitize ||
795
+ (flags && flags.fromSubmission && (this.prefixComps.length || this.suffixComps.length) && submission._id) ||
796
+ (this.options.server && (this.prefixComps.length || this.suffixComps.length))) {
785
797
  this.mergeData(this.data, submission.data);
786
798
  }
787
799
  if (changed) {
@@ -833,9 +845,9 @@ class Wizard extends Webform_1.default {
833
845
  onChange(flags, changed, modified, changes) {
834
846
  var _a, _b;
835
847
  super.onChange(flags, changed, modified, changes);
836
- if (this.alert && !this.submitted) {
837
- this.checkValidity(this.localData, false, this.localData, true);
838
- this.showErrors([], true, true);
848
+ const errors = this.validate(this.localData, { dirty: false });
849
+ if (this.alert) {
850
+ this.showErrors(errors, true, true);
839
851
  }
840
852
  // If the pages change, need to redraw the header.
841
853
  let currentPanels;
@@ -872,7 +884,7 @@ class Wizard extends Webform_1.default {
872
884
  }
873
885
  return super.redraw();
874
886
  }
875
- checkValidity(data, dirty, row, currentPageOnly) {
887
+ checkValidity(data, dirty, row, currentPageOnly, childErrors = []) {
876
888
  if (!this.checkCondition(row, data)) {
877
889
  this.setCustomValidity('');
878
890
  return true;
@@ -880,7 +892,7 @@ class Wizard extends Webform_1.default {
880
892
  const components = !currentPageOnly || this.isLastPage()
881
893
  ? this.getComponents()
882
894
  : this.currentPage.components;
883
- return components.reduce((check, comp) => comp.checkValidity(data, dirty, row) && check, true);
895
+ return components.reduce((check, comp) => comp.checkValidity(data, dirty, row, childErrors) && check, true);
884
896
  }
885
897
  get errors() {
886
898
  if (!this.isLastPage()) {
@@ -889,23 +901,22 @@ class Wizard extends Webform_1.default {
889
901
  return super.errors;
890
902
  }
891
903
  focusOnComponent(key) {
892
- let pageIndex = 0;
893
- const [page] = this.pages.filter((page, index) => {
894
- let hasComponent = false;
895
- page.getComponent(key, (comp) => {
896
- if (comp.path === key) {
897
- pageIndex = index;
898
- hasComponent = true;
904
+ const component = this.getComponent(key);
905
+ if (component) {
906
+ let topPanel = component.parent;
907
+ while (!(topPanel.parent instanceof Wizard)) {
908
+ topPanel = topPanel.parent;
909
+ }
910
+ const pageIndex = this.pages.findIndex(page => page === topPanel);
911
+ if (pageIndex >= 0) {
912
+ const page = this.pages[pageIndex];
913
+ if (page && page !== this.currentPage) {
914
+ return this.setPage(pageIndex).then(() => {
915
+ this.showErrors(this.validate(this.localData, { dirty: true }));
916
+ super.focusOnComponent(key);
917
+ });
899
918
  }
900
- });
901
- return hasComponent;
902
- });
903
- if (page && page !== this.currentPage) {
904
- return this.setPage(pageIndex).then(() => {
905
- this.checkValidity(this.submission.data, true, this.submission.data);
906
- this.showErrors();
907
- super.focusOnComponent(key);
908
- });
919
+ }
909
920
  }
910
921
  return super.focusOnComponent(key);
911
922
  }
@@ -9,6 +9,7 @@ export default class WizardBuilder extends WebformBuilder {
9
9
  }[];
10
10
  };
11
11
  page: number;
12
+ removeComponent(component: any, parent: any, original: any): boolean | undefined;
12
13
  allowDrop(element: any): boolean;
13
14
  get pages(): any;
14
15
  get currentPage(): any;
@@ -698,8 +698,7 @@ export default class PasswordStrengthAddon extends FormioAddon {
698
698
  * @param {string} value - Suggested password
699
699
  */
700
700
  checkValidity(value: string): boolean;
701
- errors: any[] | undefined;
702
- handleBlackListCheckResult(result: any): void;
701
+ handleBlackListCheckResult(result: any, errors: any): void;
703
702
  levels: any[];
704
703
  maxEntropy: any;
705
704
  attach(element: any): void;
@@ -268,30 +268,29 @@ class PasswordStrengthAddon extends FormioAddon_1.default {
268
268
  var _a;
269
269
  const passwordLength = value.length;
270
270
  const { charactersPoolSize, errors } = this.performChecks(value);
271
- this.errors = errors;
272
271
  const entropy = this.calculatePasswordEntropy(passwordLength, charactersPoolSize);
273
272
  const blackListCheck = ((_a = this.settings.blackList) === null || _a === void 0 ? void 0 : _a.length) || this.settings.customBlacklistedWords ?
274
273
  this.checkBlackList(value)
275
274
  : null;
275
+ const isValid = this.isValid();
276
+ if (!isValid) {
277
+ errors.push({
278
+ message: 'Password is not strong enough',
279
+ level: this.settings.required ? 'error' : 'warning'
280
+ });
281
+ }
276
282
  // If there were found some words from the black list
277
283
  if (blackListCheck && blackListCheck !== true) {
278
- this.handleBlackListCheckResult(blackListCheck);
284
+ this.handleBlackListCheckResult(blackListCheck, errors);
279
285
  // Select the mininal entropy based on the dictionary check or symbolic check
280
286
  this.entropy = Math.min(entropy, blackListCheck.entropy);
281
287
  }
282
288
  else {
283
289
  this.entropy = entropy;
284
290
  }
285
- const isValid = this.isValid();
286
- if (!isValid) {
287
- this.errors.push({
288
- message: 'Password is not strong enough',
289
- level: this.settings.required ? 'error' : 'warning'
290
- });
291
- }
292
- return !this.errors.length;
291
+ return !errors.length;
293
292
  }
294
- handleBlackListCheckResult(result) {
293
+ handleBlackListCheckResult(result, errors) {
295
294
  const blacklistedWords = result.blacklistedWords;
296
295
  const isRequired = this.settings.disableBlacklistedWords;
297
296
  const message = `Password ${isRequired ? 'must' : 'should'} not include common words: ${blacklistedWords.join(', ')}`;
@@ -299,7 +298,7 @@ class PasswordStrengthAddon extends FormioAddon_1.default {
299
298
  name: 'blacklist',
300
299
  required: isRequired,
301
300
  };
302
- this.handleRuleCheckResult(false, validation, message, this.errors);
301
+ this.handleRuleCheckResult(false, validation, message, errors);
303
302
  }
304
303
  constructor(settings, componentInstance) {
305
304
  super(settings, componentInstance);
@@ -592,6 +592,7 @@ export const editForms: {
592
592
  multiple?: undefined;
593
593
  hideLabel?: undefined;
594
594
  })[];
595
+ tableView: boolean;
595
596
  defaultValue: {
596
597
  data: {
597
598
  rulesSettings: {
@@ -12,7 +12,11 @@ exports.editForms = [
12
12
  key: 'settings',
13
13
  display: 'form',
14
14
  input: true,
15
- components,
15
+ components: components.map((comp) => {
16
+ comp.tableView = false;
17
+ return comp;
18
+ }),
19
+ tableView: false,
16
20
  defaultValue: {
17
21
  data: defaultSettings
18
22
  },
@@ -253,6 +253,13 @@ export default class Components {
253
253
  static setComponents(comps: any): void;
254
254
  static addComponent(name: any, comp: any): void;
255
255
  static setComponent(name: any, comp: any): void;
256
+ /**
257
+ * Return a path of component's value.
258
+ *
259
+ * @param {Object} component - The component instance.
260
+ * @return {string} - The component's value path.
261
+ */
262
+ static getComponentPath(component: Object): string;
256
263
  static create(component: any, options: any, data: any): any;
257
264
  }
258
265
  import BaseEditForm from './_classes/component/Component.form';
@@ -48,6 +48,31 @@ class Components {
48
48
  static setComponent(name, comp) {
49
49
  Components.components[name] = comp;
50
50
  }
51
+ /**
52
+ * Return a path of component's value.
53
+ *
54
+ * @param {Object} component - The component instance.
55
+ * @return {string} - The component's value path.
56
+ */
57
+ static getComponentPath(component) {
58
+ var _a;
59
+ let path = '';
60
+ if (component.component.key) {
61
+ let thisPath = ((_a = component.options) === null || _a === void 0 ? void 0 : _a.parent) || component;
62
+ while (thisPath && !thisPath.allowData && thisPath.parent) {
63
+ thisPath = thisPath.parent;
64
+ }
65
+ // TODO: any component that is nested in e.g. a Data Grid or an Edit Grid is going to receive a row prop; the problem
66
+ // is that options.row is passed to each further nested component, which results in erroneous paths like
67
+ // `editGrid[0].container[0].textField` rather than `editGrid[0].container.textField`. This should be adapted for other
68
+ // components with a tree-like data model
69
+ const rowIndex = component.row;
70
+ const rowIndexPath = rowIndex && !['container'].includes(thisPath.component.type) ? `[${Number.parseInt(rowIndex)}]` : '';
71
+ path = `${thisPath.path}${rowIndexPath}.`;
72
+ path += component.component.key;
73
+ return lodash_1.default.trim(path, '.');
74
+ }
75
+ }
51
76
  static create(component, options, data) {
52
77
  let comp = null;
53
78
  if (component.type && Components.components.hasOwnProperty(component.type)) {
@@ -72,6 +97,11 @@ class Components {
72
97
  else {
73
98
  comp = new Component_1.default(component, options, data);
74
99
  }
100
+ const path = Components.getComponentPath(comp);
101
+ if (path) {
102
+ comp.path = path;
103
+ comp.componentsMap[comp.path] = comp;
104
+ }
75
105
  return comp;
76
106
  }
77
107
  }
@@ -47,16 +47,21 @@ declare class Component extends Element {
47
47
  * References to dom elements
48
48
  */
49
49
  refs: {};
50
- /**
51
- * Set the validator instance.
52
- */
53
- validator: import("../../../validator/Validator").ValidationChecker;
54
50
  /**
55
51
  * The data path to this specific component instance.
56
52
  *
57
53
  * @type {string}
58
54
  */
59
55
  path: string;
56
+ /**
57
+ * An array of all the children components errors.
58
+ */
59
+ childErrors: any[];
60
+ /**
61
+ * Last validation errors that have occured.
62
+ */
63
+ _errors: any[];
64
+ _visibleErrors: any[];
60
65
  /**
61
66
  * The Form.io component JSON schema.
62
67
  * @type {*}
@@ -76,11 +81,6 @@ declare class Component extends Element {
76
81
  * @type {*}
77
82
  */
78
83
  _data: any;
79
- /**
80
- * The existing error that this component has.
81
- * @type {string}
82
- */
83
- error: string;
84
84
  /**
85
85
  * Tool tip text after processing
86
86
  * @type {string}
@@ -91,6 +91,12 @@ declare class Component extends Element {
91
91
  * @type {number}
92
92
  */
93
93
  row: number;
94
+ /**
95
+ * Points to a flat map of child components (if applicable).
96
+ *
97
+ * @type {Object}
98
+ */
99
+ childComponentsMap: Object;
94
100
  /**
95
101
  * Determines if this component is disabled, or not.
96
102
  *
@@ -116,13 +122,7 @@ declare class Component extends Element {
116
122
  * @type {Component}
117
123
  */
118
124
  parent: Component;
119
- /**
120
- * The validators that are assigned to this component.
121
- * @type {[string]}
122
- */
123
- validators: [string];
124
125
  _path: string;
125
- _parentPath: any;
126
126
  /**
127
127
  * Determines if this component is visible, or not.
128
128
  */
@@ -164,6 +164,7 @@ declare class Component extends Element {
164
164
  * @type {*}
165
165
  */
166
166
  info: any;
167
+ get componentsMap(): any;
167
168
  set data(arg: any);
168
169
  get data(): any;
169
170
  mergeSchema(component?: {}): any;
@@ -405,6 +406,8 @@ declare class Component extends Element {
405
406
  * @returns {string} - The name of the component.
406
407
  */
407
408
  get name(): string;
409
+ get visibleErrors(): any[];
410
+ get errors(): any[];
408
411
  /**
409
412
  * Returns the error label for this component.
410
413
  * @return {*}
@@ -699,7 +702,30 @@ declare class Component extends Element {
699
702
  * @return {boolean}
700
703
  */
701
704
  isValid(data: any, dirty: any): boolean;
702
- setComponentValidity(messages: any, dirty: any, silentCheck: any): boolean;
705
+ setComponentValidity(errors: any, dirty: any, silentCheck: any): any;
706
+ /**
707
+ * Interpolate errors from the validation methods.
708
+ * @param {*} errors
709
+ * @returns
710
+ */
711
+ interpolateErrors(errors: any): any[];
712
+ /**
713
+ * Show component validation errors.
714
+ * @param {*} errors - An array of errors that have occured.
715
+ * @param {*} data - The root submission data.
716
+ * @param {*} row - The contextual row data.
717
+ * @param {*} flags - The flags to perform validation.
718
+ * @returns
719
+ */
720
+ showValidationErrors(errors: any, data: any, row: any, flags: any): any;
721
+ /**
722
+ * Perform a component validation.
723
+ * @param {*} data - The root data you wish to use for this component.
724
+ * @param {*} row - The contextual row data you wish to use for this component.
725
+ * @param {*} flags - The flags to control the behavior of the validation.
726
+ * @returns
727
+ */
728
+ validateComponent(data: any, row: any, flags?: any): any[] | Promise<any[]>;
703
729
  /**
704
730
  * Checks the validity of this component and sets the error message if it is invalid.
705
731
  *
@@ -708,9 +734,17 @@ declare class Component extends Element {
708
734
  * @param row
709
735
  * @return {boolean}
710
736
  */
711
- checkComponentValidity(data: any, dirty: any, row: any, options?: {}): boolean;
712
- checkValidity(data: any, dirty: any, row: any, silentCheck: any): boolean;
713
- checkAsyncValidity(data: any, dirty: any, row: any, silentCheck: any): Promise<boolean>;
737
+ checkComponentValidity(data: any, dirty: any, row: any, flags?: {}, allErrors?: any[]): boolean;
738
+ /**
739
+ * Checks the validity of the component.
740
+ * @param {*} data
741
+ * @param {*} dirty
742
+ * @param {*} row
743
+ * @param {*} silentCheck
744
+ * @returns
745
+ */
746
+ checkValidity(data: any, dirty: any, row: any, silentCheck: any, errors?: any[]): boolean;
747
+ checkAsyncValidity(data: any, dirty: any, row: any, silentCheck: any, errors?: any[]): boolean;
714
748
  /**
715
749
  * Check the conditions, calculations, and validity of a single component and triggers an update if
716
750
  * something changed.
@@ -720,8 +754,8 @@ declare class Component extends Element {
720
754
  *
721
755
  * @return boolean - If component is valid or not.
722
756
  */
723
- checkData(data: any, flags: any, row: any): boolean;
724
- checkModal(isValid?: boolean, dirty?: boolean): void;
757
+ checkData(data: any, flags: any, row: any): true | undefined;
758
+ checkModal(errors?: any[], dirty?: boolean): void;
725
759
  get validationValue(): any;
726
760
  isEmpty(value?: any): any;
727
761
  isEqual(valueA: any, valueB?: any): any;
@@ -731,11 +765,10 @@ declare class Component extends Element {
731
765
  * @return {boolean}
732
766
  */
733
767
  validateMultiple(): boolean;
734
- get errors(): string[];
735
768
  clearErrorClasses(element?: any): void;
736
769
  setInputWidgetErrorClasses(inputRefs: any, hasErrors: any): void;
737
770
  addFocusBlurEvents(element: any): void;
738
- setCustomValidity(messages: any, dirty: any, external: any): void;
771
+ setCustomValidity(messages: any, dirty: any, external: any): any;
739
772
  /**
740
773
  * Determines if the value of this component is hidden from the user as if it is coming from the server, but is
741
774
  * protected.
@@ -743,7 +776,7 @@ declare class Component extends Element {
743
776
  * @return {boolean|*}
744
777
  */
745
778
  isValueHidden(): boolean | any;
746
- shouldSkipValidation(data: any, dirty: any, row: any): boolean;
779
+ shouldSkipValidation(data: any, row: any, flags?: {}): boolean;
747
780
  whenReady(): Promise<void>;
748
781
  get dataReady(): Promise<void>;
749
782
  /**
@@ -786,9 +819,6 @@ declare class Component extends Element {
786
819
  get previewMode(): boolean;
787
820
  }
788
821
  declare namespace Component {
789
- class Validator {
790
- private constructor();
791
- }
792
822
  const externalLibraries: {};
793
823
  function requireLibrary(name: any, property: any, src: any, polling: any): any;
794
824
  function libraryReady(name: any): any;