@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,7 +0,0 @@
1
- export default class Conjunctions {
2
- static conjunctions: {};
3
- static addConjunction(name: any, conjunction: any): void;
4
- static addConjunctions(conjunctions: any): void;
5
- static getConjunction(name: any): any;
6
- static getConjunctions(): {};
7
- }
@@ -1,16 +0,0 @@
1
- class Conjunctions {
2
- static conjunctions = {};
3
- static addConjunction(name, conjunction) {
4
- Conjunctions.conjunctions[name] = conjunction;
5
- }
6
- static addConjunctions(conjunctions) {
7
- Conjunctions.conjunctions = { ...Conjunctions.conjunctions, ...conjunctions };
8
- }
9
- static getConjunction(name) {
10
- return Conjunctions.conjunctions[name];
11
- }
12
- static getConjunctions() {
13
- return Conjunctions.conjunctions;
14
- }
15
- }
16
- export default Conjunctions;
@@ -1,7 +0,0 @@
1
- export default class Operators {
2
- static operators: {};
3
- static addOperator(name: any, operator: any): void;
4
- static addOperators(operators: any): void;
5
- static getOperator(name: any): any;
6
- static getOperators(): {};
7
- }
@@ -1,16 +0,0 @@
1
- class Operators {
2
- static operators = {};
3
- static addOperator(name, operator) {
4
- Operators.operators[name] = operator;
5
- }
6
- static addOperators(operators) {
7
- Operators.operators = { ...Operators.operators, ...operators };
8
- }
9
- static getOperator(name) {
10
- return Operators.operators[name];
11
- }
12
- static getOperators() {
13
- return Operators.operators;
14
- }
15
- }
16
- export default Operators;
@@ -1,7 +0,0 @@
1
- export default class QuickRules {
2
- static quickRules: {};
3
- static addQuickRule(name: any, quickRule: any): void;
4
- static addQuickRules(quickRules: any): void;
5
- static getQuickRule(name: any): any;
6
- static getQuickRules(): {};
7
- }
@@ -1,16 +0,0 @@
1
- class QuickRules {
2
- static quickRules = {};
3
- static addQuickRule(name, quickRule) {
4
- QuickRules.quickRules[name] = quickRule;
5
- }
6
- static addQuickRules(quickRules) {
7
- QuickRules.quickRules = { ...QuickRules.quickRules, ...quickRules };
8
- }
9
- static getQuickRule(name) {
10
- return QuickRules.quickRules[name];
11
- }
12
- static getQuickRules() {
13
- return QuickRules.quickRules;
14
- }
15
- }
16
- export default QuickRules;
@@ -1,5 +0,0 @@
1
- export default class Custom extends Rule {
2
- defaultMessage: string;
3
- check(value: any, data: any, row: any, index: any): any;
4
- }
5
- import Rule from './Rule';
@@ -1,21 +0,0 @@
1
- import Rule from './Rule';
2
- export default class Custom extends Rule {
3
- defaultMessage = '{{error}}';
4
- check(value, data, row, index) {
5
- const custom = this.settings.custom;
6
- if (!custom) {
7
- return true;
8
- }
9
- const valid = this.component.evaluate(custom, {
10
- valid: true,
11
- data,
12
- row,
13
- rowIndex: index,
14
- input: value,
15
- }, 'valid', true);
16
- if (valid === null) {
17
- return true;
18
- }
19
- return valid;
20
- }
21
- }
@@ -1,5 +0,0 @@
1
- export default class DateRule extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,16 +0,0 @@
1
- import Rule from './Rule';
2
- export default class DateRule extends Rule {
3
- defaultMessage = '{{field}} is not a valid date.';
4
- check(value) {
5
- if (!value) {
6
- return true;
7
- }
8
- if (value === 'Invalid date' || value === 'Invalid Date') {
9
- return false;
10
- }
11
- if (typeof value === 'string') {
12
- value = new Date(value);
13
- }
14
- return value instanceof Date === true && value.toString() !== 'Invalid Date';
15
- }
16
- }
@@ -1,5 +0,0 @@
1
- export default class Day extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,49 +0,0 @@
1
- import Rule from './Rule';
2
- export default class Day extends Rule {
3
- defaultMessage = '{{field}} is not a valid day.';
4
- check(value) {
5
- if (!value) {
6
- return true;
7
- }
8
- if (typeof value !== 'string') {
9
- return false;
10
- }
11
- const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
12
- const values = value.split('/').map(x => parseInt(x, 10)), day = values[DAY], month = values[MONTH], year = values[YEAR], maxDay = getDaysInMonthCount(month, year);
13
- if (isNaN(day) || day < 0 || day > maxDay) {
14
- return false;
15
- }
16
- if (isNaN(month) || month < 0 || month > 12) {
17
- return false;
18
- }
19
- if (isNaN(year) || year < 0 || year > 9999) {
20
- return false;
21
- }
22
- return true;
23
- function isLeapYear(year) {
24
- // Year is leap if it is evenly divisible by 400 or evenly divisible by 4 and not evenly divisible by 100.
25
- return !(year % 400) || (!!(year % 100) && !(year % 4));
26
- }
27
- function getDaysInMonthCount(month, year) {
28
- switch (month) {
29
- case 1: // January
30
- case 3: // March
31
- case 5: // May
32
- case 7: // July
33
- case 8: // August
34
- case 10: // October
35
- case 12: // December
36
- return 31;
37
- case 4: // April
38
- case 6: // June
39
- case 9: // September
40
- case 11: // November
41
- return 30;
42
- case 2: // February
43
- return isLeapYear(year) ? 29 : 28;
44
- default:
45
- return 31;
46
- }
47
- }
48
- }
49
- }
@@ -1,5 +0,0 @@
1
- export default class Email extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,15 +0,0 @@
1
- import Rule from './Rule';
2
- export default class Email extends Rule {
3
- defaultMessage = '{{field}} must be a valid email.';
4
- check(value) {
5
- if (!value) {
6
- return true;
7
- }
8
- /* eslint-disable max-len */
9
- // From http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
10
- const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
11
- /* eslint-enable max-len */
12
- // Allow emails to be valid if the component is pristine and no value is provided.
13
- return re.test(value);
14
- }
15
- }
@@ -1,5 +0,0 @@
1
- export default class JSON extends Rule {
2
- defaultMessage: string;
3
- check(value: any, data: any, row: any, index: any): any;
4
- }
5
- import Rule from './Rule';
@@ -1,20 +0,0 @@
1
- import Rule from './Rule';
2
- export default class JSON extends Rule {
3
- defaultMessage = '{{error}}';
4
- check(value, data, row, index) {
5
- const { json } = this.settings;
6
- if (!json) {
7
- return true;
8
- }
9
- const valid = this.component.evaluate(json, {
10
- data,
11
- row,
12
- rowIndex: index,
13
- input: value
14
- });
15
- if (valid === null) {
16
- return true;
17
- }
18
- return valid;
19
- }
20
- }
@@ -1,5 +0,0 @@
1
- export default class Mask extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,23 +0,0 @@
1
- import { getInputMask, matchInputMask } from '../../utils/utils';
2
- import Rule from './Rule';
3
- export default class Mask extends Rule {
4
- defaultMessage = '{{field}} does not match the mask.';
5
- check(value) {
6
- let inputMask;
7
- if (this.component.isMultipleMasksField) {
8
- const maskName = value ? value.maskName : undefined;
9
- const formioInputMask = this.component.getMaskByName(maskName);
10
- if (formioInputMask) {
11
- inputMask = getInputMask(formioInputMask);
12
- }
13
- value = value ? value.value : value;
14
- }
15
- else {
16
- inputMask = getInputMask(this.settings.mask);
17
- }
18
- if (value && inputMask) {
19
- return matchInputMask(value, inputMask);
20
- }
21
- return true;
22
- }
23
- }
@@ -1,5 +0,0 @@
1
- export default class Max extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,12 +0,0 @@
1
- import Rule from './Rule';
2
- export default class Max extends Rule {
3
- defaultMessage = '{{field}} cannot be greater than {{settings.limit}}.';
4
- check(value) {
5
- const max = parseFloat(this.settings.limit);
6
- const parsedValue = parseFloat(value);
7
- if (Number.isNaN(max) || Number.isNaN(parsedValue)) {
8
- return true;
9
- }
10
- return parsedValue <= max;
11
- }
12
- }
@@ -1,5 +0,0 @@
1
- export default class MaxDate extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,25 +0,0 @@
1
- import { getDateSetting } from '../../utils/utils';
2
- import moment from 'moment';
3
- import _ from 'lodash';
4
- import Rule from './Rule';
5
- export default class MaxDate extends Rule {
6
- defaultMessage = '{{field}} should not contain date after {{settings.dateLimit}}';
7
- check(value) {
8
- if (!value) {
9
- return true;
10
- }
11
- // If they are the exact same string or object, then return true.
12
- if (value === this.settings.dateLimit) {
13
- return true;
14
- }
15
- const date = moment(value);
16
- const maxDate = getDateSetting(this.settings.dateLimit);
17
- if (_.isNull(maxDate)) {
18
- return true;
19
- }
20
- else {
21
- maxDate.setHours(0, 0, 0, 0);
22
- }
23
- return date.isBefore(maxDate) || date.isSame(maxDate);
24
- }
25
- }
@@ -1,5 +0,0 @@
1
- export default class MaxLength extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,11 +0,0 @@
1
- import Rule from './Rule';
2
- export default class MaxLength extends Rule {
3
- defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';
4
- check(value) {
5
- const maxLength = parseInt(this.settings.length, 10);
6
- if (!value || !maxLength || !value.hasOwnProperty('length')) {
7
- return true;
8
- }
9
- return (value.length <= maxLength);
10
- }
11
- }
@@ -1,5 +0,0 @@
1
- export default class MaxWords extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,11 +0,0 @@
1
- import Rule from './Rule';
2
- export default class MaxWords extends Rule {
3
- defaultMessage = '{{field}} must have no more than {{- settings.length}} words.';
4
- check(value) {
5
- const maxWords = parseInt(this.settings.length, 10);
6
- if (!maxWords || (typeof value !== 'string')) {
7
- return true;
8
- }
9
- return (value.trim().split(/\s+/).length <= maxWords);
10
- }
11
- }
@@ -1,5 +0,0 @@
1
- export default class MaxYear extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,13 +0,0 @@
1
- import Rule from './Rule';
2
- export default class MaxYear extends Rule {
3
- defaultMessage = '{{field}} should not contain year greater than {{maxYear}}';
4
- check(value) {
5
- const maxYear = this.settings;
6
- let year = /\d{4}$/.exec(value);
7
- year = year ? year[0] : null;
8
- if (!(+maxYear) || !(+year)) {
9
- return true;
10
- }
11
- return +year <= +maxYear;
12
- }
13
- }
@@ -1,5 +0,0 @@
1
- export default class Min extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,12 +0,0 @@
1
- import Rule from './Rule';
2
- export default class Min extends Rule {
3
- defaultMessage = '{{field}} cannot be less than {{settings.limit}}.';
4
- check(value) {
5
- const min = parseFloat(this.settings.limit);
6
- const parsedValue = parseFloat(value);
7
- if (Number.isNaN(min) || Number.isNaN(parsedValue)) {
8
- return true;
9
- }
10
- return parsedValue >= min;
11
- }
12
- }
@@ -1,5 +0,0 @@
1
- export default class MinDate extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,21 +0,0 @@
1
- import { getDateSetting } from '../../utils/utils';
2
- import moment from 'moment';
3
- import _ from 'lodash';
4
- import Rule from './Rule';
5
- export default class MinDate extends Rule {
6
- defaultMessage = '{{field}} should not contain date before {{settings.dateLimit}}';
7
- check(value) {
8
- if (!value) {
9
- return true;
10
- }
11
- const date = moment(value);
12
- const minDate = getDateSetting(this.settings.dateLimit);
13
- if (_.isNull(minDate)) {
14
- return true;
15
- }
16
- else {
17
- minDate.setHours(0, 0, 0, 0);
18
- }
19
- return date.isAfter(minDate) || date.isSame(minDate);
20
- }
21
- }
@@ -1,5 +0,0 @@
1
- export default class MinLength extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,11 +0,0 @@
1
- import Rule from './Rule';
2
- export default class MinLength extends Rule {
3
- defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';
4
- check(value) {
5
- const minLength = parseInt(this.settings.length, 10);
6
- if (!minLength || !value || !value.hasOwnProperty('length') || this.component.isEmpty(value)) {
7
- return true;
8
- }
9
- return (value.length >= minLength);
10
- }
11
- }
@@ -1,5 +0,0 @@
1
- export default class MinWords extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,11 +0,0 @@
1
- import Rule from './Rule';
2
- export default class MinWords extends Rule {
3
- defaultMessage = '{{field}} must have at least {{- settings.length}} words.';
4
- check(value) {
5
- const minWords = parseInt(this.settings.length, 10);
6
- if (!minWords || !value || (typeof value !== 'string')) {
7
- return true;
8
- }
9
- return (value.trim().split(/\s+/).length >= minWords);
10
- }
11
- }
@@ -1,5 +0,0 @@
1
- export default class MinYear extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,13 +0,0 @@
1
- import Rule from './Rule';
2
- export default class MinYear extends Rule {
3
- defaultMessage = '{{field}} should not contain year less than {{minYear}}';
4
- check(value) {
5
- const minYear = this.settings;
6
- let year = /\d{4}$/.exec(value);
7
- year = year ? year[0] : null;
8
- if (!(+minYear) || !(+year)) {
9
- return true;
10
- }
11
- return +year >= +minYear;
12
- }
13
- }
@@ -1,5 +0,0 @@
1
- export default class Pattern extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,11 +0,0 @@
1
- import Rule from './Rule';
2
- export default class Pattern extends Rule {
3
- defaultMessage = '{{field}} does not match the pattern {{settings.pattern}}';
4
- check(value) {
5
- const { pattern } = this.settings;
6
- if (!pattern) {
7
- return true;
8
- }
9
- return (new RegExp(`^${pattern}$`)).test(value);
10
- }
11
- }
@@ -1,5 +0,0 @@
1
- export default class Required extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';
@@ -1,8 +0,0 @@
1
- import Rule from './Rule';
2
- export default class Required extends Rule {
3
- defaultMessage = '{{field}} is required';
4
- check(value) {
5
- // TODO: Day, Survey overrides.
6
- return !this.component.isValueHidden() && !this.component.isEmpty(value);
7
- }
8
- }
@@ -1,7 +0,0 @@
1
- export default class Rule {
2
- constructor(component: any, settings: any, config: any);
3
- component: any;
4
- settings: any;
5
- config: any;
6
- check(): void;
7
- }
@@ -1,9 +0,0 @@
1
- export default class Rule {
2
- constructor(component, settings, config) {
3
- this.component = component;
4
- this.settings = settings;
5
- this.config = config;
6
- }
7
- check() {
8
- }
9
- }
@@ -1,5 +0,0 @@
1
- export default class Select extends Rule {
2
- defaultMessage: string;
3
- check(value: any, data: any, row: any, async: any): any;
4
- }
5
- import Rule from './Rule';
@@ -1,86 +0,0 @@
1
- import { interpolate } from '../../utils/utils';
2
- import fetchPonyfill from 'fetch-ponyfill';
3
- const { fetch, Headers, Request } = fetchPonyfill({
4
- Promise: Promise
5
- });
6
- import _ from 'lodash';
7
- import Rule from './Rule';
8
- export default class Select extends Rule {
9
- defaultMessage = '{{field}} contains an invalid selection';
10
- check(value, data, row, async) {
11
- // Skip if value is empty
12
- if (!value || _.isEmpty(value)) {
13
- return true;
14
- }
15
- // Skip if we're not async-capable
16
- if (!async) {
17
- return true;
18
- }
19
- const schema = this.component.component;
20
- // Initialize the request options
21
- const requestOptions = {
22
- url: this.settings.url,
23
- method: 'GET',
24
- qs: {},
25
- json: true,
26
- headers: {}
27
- };
28
- // If the url is a boolean value
29
- if (_.isBoolean(requestOptions.url)) {
30
- requestOptions.url = !!requestOptions.url;
31
- if (!requestOptions.url ||
32
- schema.dataSrc !== 'url' ||
33
- !schema.data.url ||
34
- !schema.searchField) {
35
- return true;
36
- }
37
- // Get the validation url
38
- requestOptions.url = schema.data.url;
39
- // Add the search field
40
- requestOptions.qs[schema.searchField] = value;
41
- // Add the filters
42
- if (schema.filter) {
43
- requestOptions.url += (!requestOptions.url.includes('?') ? '?' : '&') + schema.filter;
44
- }
45
- // If they only wish to return certain fields.
46
- if (schema.selectFields) {
47
- requestOptions.qs.select = schema.selectFields;
48
- }
49
- }
50
- if (!requestOptions.url) {
51
- return true;
52
- }
53
- // Make sure to interpolate.
54
- requestOptions.url = interpolate(requestOptions.url, { data: this.component.data });
55
- // Add query string to URL
56
- requestOptions.url += (requestOptions.url.includes('?') ? '&' : '?') + _.chain(requestOptions.qs)
57
- .map((val, key) => `${encodeURIComponent(key)}=${encodeURIComponent(val)}`)
58
- .join('&')
59
- .value();
60
- // Set custom headers.
61
- if (schema.data && schema.data.headers) {
62
- _.each(schema.data.headers, header => {
63
- if (header.key) {
64
- requestOptions.headers[header.key] = header.value;
65
- }
66
- });
67
- }
68
- // Set form.io authentication.
69
- if (schema.authenticate && this.config.token) {
70
- requestOptions.headers['x-jwt-token'] = this.config.token;
71
- }
72
- return fetch(new Request(requestOptions.url, {
73
- headers: new Headers(requestOptions.headers)
74
- }))
75
- .then(response => {
76
- if (!response.ok) {
77
- return false;
78
- }
79
- return response.json();
80
- })
81
- .then((results) => {
82
- return results && results.length;
83
- })
84
- .catch(() => false);
85
- }
86
- }
@@ -1,5 +0,0 @@
1
- export default class Time extends Rule {
2
- defaultMessage: string;
3
- check(value: any): boolean;
4
- }
5
- import Rule from './Rule';