@formio/js 5.0.0-rc.27 → 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 +1 -1
  21. package/lib/cjs/Embed.js +14 -6
  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 +1 -1
  109. package/lib/mjs/Embed.js +14 -6
  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 +5 -5
  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
@@ -1,179 +0,0 @@
1
- import _ from 'lodash';
2
- export default class Node {
3
- constructor(parent, { data = {}, children = [], } = {}, { checkNode, createComponents, isNew = true, removeComponents, parentPath = '' } = {}) {
4
- this.parent = parent;
5
- this.previousData = {};
6
- this.persistentData = _.cloneDeep(data);
7
- this.new = isNew;
8
- this.createComponents = createComponents;
9
- this.checkNode = checkNode;
10
- this.removeComponents = removeComponents;
11
- this.revertAvailable = false;
12
- this.editing = false;
13
- this.collapsed = false;
14
- this.components = [];
15
- this.children = [];
16
- this.parentPath = parentPath;
17
- this.resetData();
18
- this.children = children.map((child, index) => new Node(this, child, {
19
- checkNode,
20
- createComponents,
21
- isNew: false,
22
- removeComponents,
23
- parentPath: this.getChildrenPath(index),
24
- }));
25
- }
26
- get value() {
27
- return this.new
28
- ? null // Check the special case for empty root node.
29
- : {
30
- data: _.cloneDeep(this.persistentData),
31
- children: this.children.filter((child) => !child.new).map((child) => child.value),
32
- };
33
- }
34
- get isRoot() {
35
- return this.parent === null;
36
- }
37
- get changing() {
38
- return this.new || this.editing;
39
- }
40
- get hasChangingChildren() {
41
- return this.changin || this.children.some((child) => child.hasChangingChildren);
42
- }
43
- get hasData() {
44
- return !_.isEmpty(this.persistentData);
45
- }
46
- get hasChildren() {
47
- return Array.isArray(this.children) && this.children.length > 0;
48
- }
49
- getChildrenPath(index) {
50
- return this.parentPath ? `${this.parentPath}.children[${index}]` : '';
51
- }
52
- eachChild(iteratee) {
53
- iteratee(this);
54
- this.children.forEach((child) => child.eachChild(iteratee));
55
- return this;
56
- }
57
- getComponents() {
58
- return this.children.reduce((components, child) => components.concat(child.getComponents()), this.components);
59
- }
60
- validateNode() {
61
- let valid = true;
62
- this.getComponents().forEach(comp => {
63
- comp.setPristine(false);
64
- valid &= comp.checkValidity(null, false, this.persistentData);
65
- });
66
- return valid;
67
- }
68
- addChild() {
69
- if (this.new) {
70
- return null;
71
- }
72
- const child = new Node(this, {}, {
73
- checkNode: this.checkNode,
74
- createComponents: this.createComponents,
75
- isNew: true,
76
- removeComponents: this.removeComponents,
77
- parentPath: this.getChildrenPath(this.children.length),
78
- });
79
- this.children = this.children.concat(child);
80
- return child;
81
- }
82
- removeChild(childToRemove) {
83
- if (!this.new) {
84
- this.children = this.children.filter((child) => child !== childToRemove);
85
- }
86
- return this;
87
- }
88
- edit() {
89
- if (this.new) {
90
- return this;
91
- }
92
- this.editing = true;
93
- return this.resetData();
94
- }
95
- save() {
96
- const isValid = this.validateNode();
97
- if (this.changing && isValid) {
98
- if (this.new) {
99
- this.new = false;
100
- }
101
- else {
102
- this.editing = false;
103
- this.revertAvailable = true;
104
- }
105
- this.commitData();
106
- }
107
- return isValid;
108
- }
109
- cancel() {
110
- if (this.new) {
111
- this.remove();
112
- }
113
- else if (this.editing) {
114
- this.editing = false;
115
- this.resetData();
116
- }
117
- return this;
118
- }
119
- remove() {
120
- this.parent.removeChild(this);
121
- this.parent = null;
122
- this.clearComponents();
123
- return this;
124
- }
125
- revert() {
126
- if (!this.revertAvailable) {
127
- return this;
128
- }
129
- this.data = this.previousData;
130
- return this.commitData();
131
- }
132
- commitData() {
133
- this.previousData = this.persistentData;
134
- this.persistentData = _.cloneDeep(this.data);
135
- this.clearComponents();
136
- return this;
137
- }
138
- resetData() {
139
- this.data = _.cloneDeep(this.persistentData);
140
- this.updateComponentsContext();
141
- return this;
142
- }
143
- updateComponentsContext() {
144
- if (this.changing) {
145
- this.instantiateComponents();
146
- }
147
- else {
148
- this.clearComponents();
149
- }
150
- return this;
151
- }
152
- instantiateComponents() {
153
- this.components = this.createComponents(this.data, this);
154
- this.components.forEach((component) => {
155
- if (this.parentPath) {
156
- const path = this.calculateComponentPath(component);
157
- component.path = path;
158
- }
159
- });
160
- this.checkNode(this);
161
- }
162
- clearComponents() {
163
- this.removeComponents(this.components);
164
- this.components = [];
165
- }
166
- /**
167
- * Return a path of component's value.
168
- *
169
- * @param {Object} component - The component instance.
170
- * @return {string} - The component's value path.
171
- */
172
- calculateComponentPath(component) {
173
- let path = '';
174
- if (component.component.key) {
175
- path = `${this.parentPath}.data.${component.component.key}`;
176
- }
177
- return path;
178
- }
179
- }
@@ -1,48 +0,0 @@
1
- export default class TreeComponent extends NestedDataComponent {
2
- static get builderInfo(): {
3
- title: string;
4
- icon: string;
5
- weight: number;
6
- documentation: string;
7
- showPreview: boolean;
8
- schema: any;
9
- };
10
- constructor(...args: any[]);
11
- get viewComponents(): any;
12
- viewComponentsInstantiated: boolean | undefined;
13
- _viewComponents: any;
14
- componentOptions: {
15
- parent: TreeComponent;
16
- root: Component;
17
- } | undefined;
18
- get isDefaultValueComponent(): boolean;
19
- createComponents(data: any, node: any): any;
20
- removeComponents(components: any, all?: boolean): any;
21
- render(): any;
22
- renderTree(node?: {}, odd?: boolean): any;
23
- renderChildNodes(nodes: any[] | undefined, odd: any): any;
24
- renderEdit(node?: {}): any;
25
- renderView(node?: {}): any;
26
- attach(element: any): Promise<[void, void]> | Promise<[[void, void], void | [void, void]]>;
27
- attachNode(element: any, node: any): Promise<void> | Promise<[void, void]>;
28
- attachActions(node: any): void;
29
- attachComponents(node: any, ...args: any[]): Promise<any>;
30
- attachChildren(node: any): Promise<any>;
31
- addChild(parent: any): void;
32
- cancelNode(node: any): void;
33
- editNode(node: any): void;
34
- removeNode(node: any): void;
35
- revertNode(node: any): void;
36
- saveNode(node: any): void;
37
- toggleNode(node: any): void;
38
- removeRoot(): void;
39
- setRoot(): void;
40
- treeRoot: Node | undefined;
41
- updateTree(): void;
42
- checkData(data: any, flags: any, row: any): any;
43
- checkNode(data: any, node: any, flags: any, row: any): any;
44
- hasChanged: (newValue: any, oldValue: any) => boolean;
45
- }
46
- import NestedDataComponent from '../_classes/nesteddata/NestedDataComponent';
47
- import Component from '../_classes/component/Component';
48
- import Node from './Node';
@@ -1,3 +0,0 @@
1
- export default function _default(...extend: any[]): {
2
- components: any;
3
- };
@@ -1,15 +0,0 @@
1
- import componentEditForm from '../_classes/component/Component.form';
2
- import TreeEditData from './editForm/Tree.edit.data';
3
- import TreeDisplayData from './editForm/Tree.edit.display';
4
- export default function (...extend) {
5
- return componentEditForm([
6
- {
7
- key: 'display',
8
- components: TreeDisplayData,
9
- },
10
- {
11
- key: 'data',
12
- components: TreeEditData,
13
- },
14
- ], ...extend);
15
- }
@@ -1,384 +0,0 @@
1
- import _ from 'lodash';
2
- import Component from '../_classes/component/Component';
3
- import Components from '../Components';
4
- import NestedDataComponent from '../_classes/nesteddata/NestedDataComponent';
5
- import Node from './Node';
6
- export default class TreeComponent extends NestedDataComponent {
7
- static schema(...extend) {
8
- return NestedDataComponent.schema({
9
- label: 'Tree',
10
- key: 'tree',
11
- type: 'tree',
12
- clearOnHide: true,
13
- input: true,
14
- tree: true,
15
- components: [],
16
- multiple: false,
17
- }, ...extend);
18
- }
19
- static get builderInfo() {
20
- return {
21
- title: 'Tree',
22
- icon: 'indent',
23
- weight: 40,
24
- documentation: '/userguide/form-building/data-components#tree',
25
- showPreview: false,
26
- schema: TreeComponent.schema(),
27
- };
28
- }
29
- constructor(...args) {
30
- super(...args);
31
- this.type = 'tree';
32
- }
33
- get emptyValue() {
34
- return {};
35
- }
36
- get viewComponents() {
37
- if (!this.viewComponentsInstantiated) {
38
- this.viewComponentsInstantiated = true;
39
- this._viewComponents = this.createComponents({});
40
- }
41
- return this._viewComponents;
42
- }
43
- init() {
44
- if (this.builderMode) {
45
- return super.init();
46
- }
47
- this.components = [];
48
- this.componentOptions = {
49
- ...this.options,
50
- parent: this,
51
- root: this.root || this,
52
- };
53
- this.disabled = this.shouldDisabled;
54
- this.setRoot();
55
- this.viewComponentsInstantiated = false;
56
- this._viewComponents = [];
57
- }
58
- get disabled() {
59
- return super.disabled;
60
- }
61
- set disabled(disabled) {
62
- super.disabled = disabled;
63
- this.viewComponents.forEach((component) => component.parentDisabled = disabled);
64
- }
65
- get isDefaultValueComponent() {
66
- return !!this.options.editComponent && !!this.options.editForm && this.component.key === 'defaultValue';
67
- }
68
- destroy(all = false) {
69
- if (!this.builderMode) {
70
- this.removeComponents(this._viewComponents, all);
71
- }
72
- super.destroy(all);
73
- }
74
- createComponents(data, node) {
75
- const components = this.componentComponents.map((component) => {
76
- const componentInstance = Components.create(component, this.componentOptions, data);
77
- componentInstance.init();
78
- componentInstance.parentDisabled = this.disabled;
79
- return componentInstance;
80
- });
81
- if (node) {
82
- this.checkNode(this.data, node);
83
- }
84
- return components;
85
- }
86
- removeComponents(components, all = false) {
87
- return components.map((component) => component.destroy(all));
88
- }
89
- render() {
90
- if (this.builderMode) {
91
- return super.render();
92
- }
93
- return super.render(this.renderTree(this.treeRoot));
94
- }
95
- renderTree(node = {}, odd = true) {
96
- const childNodes = (node.hasChildren && !node.collapsed)
97
- ? this.renderChildNodes(node.children, !odd)
98
- : [];
99
- const content = node.changing
100
- ? this.renderEdit(node)
101
- : this.renderView(node);
102
- return this.renderTemplate('tree', {
103
- odd,
104
- childNodes,
105
- content,
106
- node,
107
- });
108
- }
109
- renderChildNodes(nodes = [], odd) {
110
- return nodes.map((node) => this.renderTree(node, odd));
111
- }
112
- renderEdit(node = {}) {
113
- return this.renderTemplate('treeEdit', {
114
- children: this.renderComponents(node.components),
115
- node,
116
- });
117
- }
118
- renderView(node = {}) {
119
- return this.renderTemplate('treeView', {
120
- values: this.viewComponents.map((component) => {
121
- component.data = node.data;
122
- component.checkComponentConditions(node.data);
123
- return component.getView(component.dataValue);
124
- }),
125
- nodeData: node.data,
126
- node,
127
- });
128
- }
129
- attach(element) {
130
- if (this.builderMode) {
131
- return super.attach(element);
132
- }
133
- this.loadRefs(element, {
134
- root: 'single',
135
- });
136
- return Promise.all([
137
- super.attach(element),
138
- this.attachNode(this.refs.root, this.treeRoot),
139
- ]);
140
- }
141
- attachNode(element, node) {
142
- if (!element) {
143
- return Promise.resolve();
144
- }
145
- let componentsPromise = Promise.resolve();
146
- let childrenPromise = Promise.resolve();
147
- node.refs = _.reduce(element.children, (refs, child) => (child.hasAttribute('ref')
148
- ? {
149
- ...refs,
150
- [child.getAttribute('ref')]: child,
151
- }
152
- : refs), {});
153
- if (node.refs.content) {
154
- this.attachActions(node);
155
- componentsPromise = this.attachComponents(node);
156
- }
157
- if (node.refs.childNodes) {
158
- childrenPromise = this.attachChildren(node);
159
- }
160
- return Promise.all([
161
- componentsPromise,
162
- childrenPromise,
163
- ]);
164
- }
165
- attachActions(node) {
166
- if (!node.editing) {
167
- this.loadRefs.call(node, node.refs.content, {
168
- addChild: 'single',
169
- editNode: 'single',
170
- removeNode: 'single',
171
- revertNode: 'single',
172
- toggleNode: 'single',
173
- });
174
- }
175
- //load refs correctly (if there is nested tree)
176
- this.loadRefs.call(node, node.refs.content.children[0]?.children[1] || node.refs.content, {
177
- cancelNode: 'single',
178
- saveNode: 'single',
179
- });
180
- if (node.refs.addChild) {
181
- this.addEventListener(node.refs.addChild, 'click', () => {
182
- this.addChild(node);
183
- });
184
- }
185
- if (node.refs.cancelNode) {
186
- this.addEventListener(node.refs.cancelNode, 'click', () => {
187
- this.cancelNode(node);
188
- });
189
- }
190
- if (node.refs.editNode) {
191
- this.addEventListener(node.refs.editNode, 'click', () => {
192
- this.editNode(node);
193
- });
194
- }
195
- if (node.refs.removeNode) {
196
- this.addEventListener(node.refs.removeNode, 'click', () => {
197
- this.removeNode(node);
198
- });
199
- }
200
- if (node.refs.revertNode) {
201
- this.addEventListener(node.refs.revertNode, 'click', () => {
202
- this.revertNode(node);
203
- });
204
- }
205
- if (node.refs.saveNode) {
206
- this.addEventListener(node.refs.saveNode, 'click', () => {
207
- this.saveNode(node);
208
- });
209
- }
210
- if (node.refs.toggleNode) {
211
- this.addEventListener(node.refs.toggleNode, 'click', () => {
212
- this.toggleNode(node);
213
- });
214
- }
215
- }
216
- attachComponents(node, ...args) {
217
- if (this.builderMode) {
218
- return super.attachComponents.call(this, node, ...args);
219
- }
220
- this.loadRefs.call(node, node.refs.content, {
221
- nodeEdit: 'single',
222
- });
223
- return node.refs.nodeEdit
224
- ? super.attachComponents(node.refs.nodeEdit, node.components)
225
- : Promise.resolve();
226
- }
227
- attachChildren(node) {
228
- const childElements = node.refs.childNodes.children;
229
- return Promise.all(_.map(childElements, (childElement, index) => this.attachNode(childElement, node.children[index])));
230
- }
231
- setValue(value, flags = {}) {
232
- const changed = this.updateValue(value, flags);
233
- this.setRoot();
234
- return changed;
235
- }
236
- addChild(parent) {
237
- if (this.options.readOnly || parent.new) {
238
- return;
239
- }
240
- this.hook('tree.addChild', {
241
- parent,
242
- component: this,
243
- }, () => {
244
- const child = parent.addChild();
245
- this.redraw();
246
- return child;
247
- });
248
- }
249
- cancelNode(node) {
250
- if (this.options.readOnly) {
251
- return;
252
- }
253
- this.hook('tree.cancelNode', {
254
- node,
255
- component: this,
256
- }, () => {
257
- if (node.isRoot) {
258
- if (node.persistentData && !_.isEmpty(node.persistentData)) {
259
- node.cancel();
260
- this.redraw();
261
- }
262
- else {
263
- this.removeRoot();
264
- }
265
- }
266
- else {
267
- node.cancel();
268
- this.redraw();
269
- }
270
- return node;
271
- });
272
- }
273
- editNode(node) {
274
- if (this.options.readOnly || node.new) {
275
- return;
276
- }
277
- this.hook('tree.editNode', {
278
- node,
279
- component: this,
280
- }, () => {
281
- node.edit();
282
- this.redraw();
283
- return node;
284
- });
285
- }
286
- removeNode(node) {
287
- if (this.options.readOnly || node.new) {
288
- return;
289
- }
290
- this.hook('tree.removeNode', {
291
- node,
292
- component: this,
293
- }, () => {
294
- if (node.isRoot) {
295
- this.removeRoot();
296
- }
297
- else {
298
- node.remove();
299
- this.updateTree();
300
- }
301
- return node;
302
- });
303
- }
304
- revertNode(node) {
305
- if (this.options.readOnly || !node.revertAvailable) {
306
- return;
307
- }
308
- this.hook('tree.revertNode', {
309
- node,
310
- component: this,
311
- }, () => {
312
- node.revert();
313
- this.updateTree();
314
- return node;
315
- });
316
- }
317
- saveNode(node) {
318
- if (this.options.readOnly) {
319
- return;
320
- }
321
- this.hook('tree.saveNode', {
322
- node,
323
- component: this,
324
- }, () => {
325
- const isSaved = node.save();
326
- if (isSaved) {
327
- this.updateTree();
328
- }
329
- return node;
330
- });
331
- }
332
- toggleNode(node) {
333
- this.hook('tree.toggleNode', {
334
- node,
335
- component: this,
336
- }, () => {
337
- node.collapsed = !node.collapsed;
338
- this.redraw();
339
- return node;
340
- });
341
- }
342
- removeRoot() {
343
- if (this.options.readOnly) {
344
- return;
345
- }
346
- this.dataValue = this.defaultValue;
347
- this.setRoot();
348
- this.redraw();
349
- }
350
- setRoot() {
351
- const value = this.getValue();
352
- this.treeRoot = new Node(null, value, {
353
- isNew: this.builderMode ? true : !value.data,
354
- createComponents: this.createComponents.bind(this),
355
- checkNode: this.checkNode.bind(this, this.data),
356
- removeComponents: this.removeComponents,
357
- parentPath: this.isDefaultValueComponent ? (this.path || this.component.key) : null,
358
- });
359
- this.hook('tree.setRoot', {
360
- root: this.treeRoot,
361
- component: this,
362
- });
363
- this.redraw();
364
- }
365
- getValue() {
366
- return this.dataValue || {};
367
- }
368
- updateTree() {
369
- this.updateValue(this.treeRoot.value);
370
- this.redraw();
371
- }
372
- checkData(data, flags, row) {
373
- return this.checkNode(data, this.treeRoot, flags, row);
374
- }
375
- checkNode(data, node, flags, row) {
376
- return node.children.reduce((result, child) => this.checkNode(data, child, flags, row) && result, super.checkData(data, flags, node.data, node.components) && !node.editing && !node.new);
377
- }
378
- getComponents() {
379
- return this.treeRoot && (this.isDefaultValueComponent || (!this.isDefaultValueComponent && !this.builderMode))
380
- ? this.treeRoot.getComponents()
381
- : super.getComponents();
382
- }
383
- }
384
- TreeComponent.prototype.hasChanged = Component.prototype.hasChanged;
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- key: string;
3
- ignore: boolean;
4
- }[];
5
- export default _default;
@@ -1,7 +0,0 @@
1
- export default [
2
- {
3
- key: 'multiple',
4
- ignore: true
5
- },
6
- ];
7
- /* eslint-enable max-len */
@@ -1,9 +0,0 @@
1
- declare const _default: {
2
- key: string;
3
- weight: number;
4
- type: string;
5
- tag: string;
6
- className: string;
7
- content: string;
8
- }[];
9
- export default _default;
@@ -1,10 +0,0 @@
1
- export default [
2
- {
3
- key: 'treeInfo',
4
- weight: -10,
5
- type: 'htmlelement',
6
- tag: 'div',
7
- className: 'alert alert-danger',
8
- content: 'This component has been deprecated and will be removed in a future version of Formio.js.',
9
- }
10
- ];
@@ -1,23 +0,0 @@
1
- declare namespace _default {
2
- const label: string;
3
- const tableView: boolean;
4
- const calculateServer: boolean;
5
- const key: string;
6
- const type: string;
7
- const input: boolean;
8
- const tree: boolean;
9
- const components: {
10
- label: string;
11
- mask: boolean;
12
- spellcheck: boolean;
13
- tableView: boolean;
14
- delimiter: boolean;
15
- requireDecimal: boolean;
16
- inputFormat: string;
17
- calculateServer: boolean;
18
- key: string;
19
- type: string;
20
- input: boolean;
21
- }[];
22
- }
23
- export default _default;