@digigov/form 2.0.0-4be8f7cc → 2.0.0-555d1027

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (843) hide show
  1. package/Field/ErrorGroup/index.js +48 -0
  2. package/{Questions/index.spec → Field/ErrorGroup}/package.json +1 -1
  3. package/Field/ErrorGroup.d.ts +15 -0
  4. package/Field/ErrorGroup.js.map +7 -0
  5. package/Field/FieldBase/index.js +116 -77
  6. package/Field/FieldBase.js.map +7 -0
  7. package/Field/FieldBaseContainer/index.js +47 -37
  8. package/Field/FieldBaseContainer.js.map +7 -0
  9. package/Field/FieldConditional/index.js +83 -53
  10. package/Field/FieldConditional.js.map +7 -0
  11. package/Field/index.js +113 -63
  12. package/Field/index.js.map +7 -0
  13. package/Field/types/index.js +1 -1
  14. package/Field/types.d.ts +52 -5
  15. package/Field/types.js.map +7 -0
  16. package/Field/utils/calculateField/index.js +27 -0
  17. package/{FieldArray/FieldArray.stories → Field/utils/calculateField}/package.json +1 -1
  18. package/Field/utils/calculateField.d.ts +2 -0
  19. package/Field/utils/calculateField.js.map +7 -0
  20. package/Field/utils/evaluateFieldWithConditions/index.js +26 -0
  21. package/{inputs/DateInput/__stories__/Default → Field/utils/evaluateFieldWithConditions}/package.json +1 -1
  22. package/Field/utils/evaluateFieldWithConditions.d.ts +2 -0
  23. package/Field/utils/evaluateFieldWithConditions.js.map +7 -0
  24. package/Field/utils/index.d.ts +4 -0
  25. package/Field/utils/index.js +49 -116
  26. package/Field/utils/index.js.map +7 -0
  27. package/Field/utils/useField/index.js +64 -0
  28. package/{FormBuilder/FormBuilder → Field/utils/useField}/package.json +1 -1
  29. package/Field/utils/useField.d.ts +2 -0
  30. package/Field/utils/useField.js.map +7 -0
  31. package/FieldArray/FieldArray.stories.d.ts +3 -2
  32. package/FieldArray/FormDialog/index.js +399 -0
  33. package/{validators/validators.spec → FieldArray/FormDialog}/package.json +1 -1
  34. package/FieldArray/FormDialog.d.ts +67 -0
  35. package/FieldArray/FormDialog.js.map +7 -0
  36. package/FieldArray/__stories__/Default.d.ts +2 -2
  37. package/FieldArray/__stories__/WithExactLength.d.ts +2 -2
  38. package/FieldArray/__stories__/WithModal.d.ts +2 -0
  39. package/FieldArray/index.d.ts +7 -0
  40. package/FieldArray/index.js +113 -59
  41. package/FieldArray/index.js.map +7 -0
  42. package/FieldArray/index.test.d.ts +1 -0
  43. package/FieldObject/index.d.ts +8 -0
  44. package/FieldObject/index.js +85 -52
  45. package/FieldObject/index.js.map +7 -0
  46. package/Fieldset/FieldsetWithContext/index.js +27 -31
  47. package/Fieldset/FieldsetWithContext.js.map +7 -0
  48. package/Fieldset/index.d.ts +1 -1
  49. package/Fieldset/index.js +27 -29
  50. package/Fieldset/index.js.map +7 -0
  51. package/Fieldset/types/index.js +1 -1
  52. package/Fieldset/types.d.ts +3 -2
  53. package/Fieldset/types.js.map +7 -0
  54. package/FormBuilder/FormBuilder.stories.d.ts +5 -1
  55. package/FormBuilder/__stories__/AutoErrorGrouping.d.ts +3 -0
  56. package/FormBuilder/__stories__/Default.d.ts +2 -2
  57. package/FormBuilder/__stories__/ErrorGrouping.d.ts +3 -0
  58. package/FormBuilder/index.d.ts +8 -1
  59. package/FormBuilder/index.js +241 -2
  60. package/FormBuilder/index.js.map +7 -0
  61. package/FormBuilder/index.test.d.ts +1 -0
  62. package/FormBuilder/interaction.test.d.ts +1 -0
  63. package/FormBuilder/scenarios.test.d.ts +88 -0
  64. package/FormContext/index.js +11 -3
  65. package/FormContext.d.ts +1 -0
  66. package/FormContext.js.map +7 -0
  67. package/MultiplicityField/MultiplicityField.stories.d.ts +8 -6
  68. package/MultiplicityField/__stories__/Default.d.ts +2 -2
  69. package/MultiplicityField/__stories__/PreviewDisplay.d.ts +2 -2
  70. package/MultiplicityField/__stories__/WithExactLength.d.ts +2 -2
  71. package/MultiplicityField/__stories__/WithMaxLength.d.ts +2 -2
  72. package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +2 -2
  73. package/MultiplicityField/__stories__/WithMinLength.d.ts +2 -2
  74. package/MultiplicityField/add-objects/index.js +139 -132
  75. package/MultiplicityField/add-objects.d.ts +2 -1
  76. package/MultiplicityField/add-objects.js.map +7 -0
  77. package/MultiplicityField/index.d.ts +2 -19
  78. package/MultiplicityField/index.js +117 -106
  79. package/MultiplicityField/index.js.map +7 -0
  80. package/MultiplicityField/index.test.d.ts +1 -0
  81. package/MultiplicityField/types/index.js +1 -0
  82. package/MultiplicityField/types/package.json +6 -0
  83. package/MultiplicityField/types.d.ts +19 -0
  84. package/MultiplicityField/types.js.map +7 -0
  85. package/Questions/Questions/index.js +48 -56
  86. package/Questions/Questions.js.map +7 -0
  87. package/Questions/Questions.stories.d.ts +3 -1
  88. package/Questions/QuestionsContext/index.js +9 -9
  89. package/Questions/QuestionsContext.d.ts +0 -1
  90. package/Questions/QuestionsContext.js.map +7 -0
  91. package/Questions/Step/ReviewStep/index.js +35 -47
  92. package/Questions/Step/ReviewStep.js.map +7 -0
  93. package/Questions/Step/Step/index.js +39 -47
  94. package/Questions/Step/Step.js.map +7 -0
  95. package/Questions/Step/StepArrayReview/index.js +41 -45
  96. package/Questions/Step/StepArrayReview.js.map +7 -0
  97. package/Questions/Step/StepContext/index.js +15 -19
  98. package/Questions/Step/StepContext.d.ts +0 -1
  99. package/Questions/Step/StepContext.js.map +7 -0
  100. package/Questions/Step/StepDescription/index.js +22 -22
  101. package/Questions/Step/StepDescription.js.map +7 -0
  102. package/Questions/Step/StepForm/index.js +33 -43
  103. package/Questions/Step/StepForm.js.map +7 -0
  104. package/Questions/Step/StepQuote/index.js +10 -9
  105. package/Questions/Step/StepQuote.js.map +7 -0
  106. package/Questions/Step/StepTitle/index.js +41 -38
  107. package/Questions/Step/StepTitle.d.ts +2 -1
  108. package/Questions/Step/StepTitle.js.map +7 -0
  109. package/Questions/Step/getAddMoreFields/index.js +28 -20
  110. package/Questions/Step/getAddMoreFields.js.map +7 -0
  111. package/Questions/Step/index.d.ts +0 -1
  112. package/Questions/Step/index.js +16 -13
  113. package/Questions/Step/index.js.map +7 -0
  114. package/Questions/Step/types/index.js +1 -1
  115. package/Questions/Step/types.d.ts +1 -0
  116. package/Questions/Step/types.js.map +7 -0
  117. package/Questions/__stories__/Default.d.ts +2 -2
  118. package/Questions/getNextStep/index.js +12 -10
  119. package/Questions/getNextStep.js.map +7 -0
  120. package/Questions/index.js +7 -3
  121. package/Questions/index.js.map +7 -0
  122. package/Questions/index.test.d.ts +1 -0
  123. package/Questions/types/index.js +1 -1
  124. package/Questions/types.d.ts +1 -0
  125. package/Questions/types.js.map +7 -0
  126. package/cjs/Field/ErrorGroup/index.js +82 -0
  127. package/cjs/Field/ErrorGroup.js.map +7 -0
  128. package/cjs/Field/FieldBase/index.js +148 -83
  129. package/cjs/Field/FieldBase.js.map +7 -0
  130. package/cjs/Field/FieldBaseContainer/index.js +79 -43
  131. package/cjs/Field/FieldBaseContainer.js.map +7 -0
  132. package/cjs/Field/FieldConditional/index.js +115 -59
  133. package/cjs/Field/FieldConditional.js.map +7 -0
  134. package/cjs/Field/index.js +142 -72
  135. package/cjs/Field/index.js.map +7 -0
  136. package/cjs/Field/types/index.js +16 -5
  137. package/cjs/Field/types.js.map +7 -0
  138. package/cjs/Field/utils/calculateField/index.js +50 -0
  139. package/cjs/Field/utils/calculateField.js.map +7 -0
  140. package/cjs/Field/utils/evaluateFieldWithConditions/index.js +49 -0
  141. package/cjs/Field/utils/evaluateFieldWithConditions.js.map +7 -0
  142. package/cjs/Field/utils/index.js +92 -133
  143. package/cjs/Field/utils/index.js.map +7 -0
  144. package/cjs/Field/utils/useField/index.js +87 -0
  145. package/cjs/Field/utils/useField.js.map +7 -0
  146. package/cjs/FieldArray/FormDialog/index.js +418 -0
  147. package/cjs/FieldArray/FormDialog.js.map +7 -0
  148. package/cjs/FieldArray/index.js +145 -65
  149. package/cjs/FieldArray/index.js.map +7 -0
  150. package/cjs/FieldObject/index.js +114 -61
  151. package/cjs/FieldObject/index.js.map +7 -0
  152. package/cjs/Fieldset/FieldsetWithContext/index.js +54 -40
  153. package/cjs/Fieldset/FieldsetWithContext.js.map +7 -0
  154. package/cjs/Fieldset/index.js +61 -39
  155. package/cjs/Fieldset/index.js.map +7 -0
  156. package/cjs/Fieldset/types/index.js +16 -5
  157. package/cjs/Fieldset/types.js.map +7 -0
  158. package/cjs/FormBuilder/index.js +277 -8
  159. package/cjs/FormBuilder/index.js.map +7 -0
  160. package/cjs/FormContext/index.js +34 -8
  161. package/cjs/FormContext.js.map +7 -0
  162. package/cjs/MultiplicityField/add-objects/index.js +166 -138
  163. package/cjs/MultiplicityField/add-objects.js.map +7 -0
  164. package/cjs/MultiplicityField/index.js +145 -115
  165. package/cjs/MultiplicityField/index.js.map +7 -0
  166. package/cjs/MultiplicityField/types/index.js +16 -0
  167. package/cjs/MultiplicityField/types.js.map +7 -0
  168. package/cjs/Questions/Questions/index.js +80 -65
  169. package/cjs/Questions/Questions.js.map +7 -0
  170. package/cjs/Questions/QuestionsContext/index.js +31 -14
  171. package/cjs/Questions/QuestionsContext.js.map +7 -0
  172. package/cjs/Questions/Step/ReviewStep/index.js +61 -56
  173. package/cjs/Questions/Step/ReviewStep.js.map +7 -0
  174. package/cjs/Questions/Step/Step/index.js +71 -56
  175. package/cjs/Questions/Step/Step.js.map +7 -0
  176. package/cjs/Questions/Step/StepArrayReview/index.js +65 -54
  177. package/cjs/Questions/Step/StepArrayReview.js.map +7 -0
  178. package/cjs/Questions/Step/StepContext/index.js +37 -24
  179. package/cjs/Questions/Step/StepContext.js.map +7 -0
  180. package/cjs/Questions/Step/StepDescription/index.js +55 -31
  181. package/cjs/Questions/Step/StepDescription.js.map +7 -0
  182. package/cjs/Questions/Step/StepForm/index.js +65 -52
  183. package/cjs/Questions/Step/StepForm.js.map +7 -0
  184. package/cjs/Questions/Step/StepQuote/index.js +42 -15
  185. package/cjs/Questions/Step/StepQuote.js.map +7 -0
  186. package/cjs/Questions/Step/StepTitle/index.js +72 -47
  187. package/cjs/Questions/Step/StepTitle.js.map +7 -0
  188. package/cjs/Questions/Step/getAddMoreFields/index.js +50 -25
  189. package/cjs/Questions/Step/getAddMoreFields.js.map +7 -0
  190. package/cjs/Questions/Step/index.js +59 -143
  191. package/cjs/Questions/Step/index.js.map +7 -0
  192. package/cjs/Questions/Step/types/index.js +16 -5
  193. package/cjs/Questions/Step/types.js.map +7 -0
  194. package/cjs/Questions/getNextStep/index.js +33 -14
  195. package/cjs/Questions/getNextStep.js.map +7 -0
  196. package/cjs/Questions/index.js +29 -19
  197. package/cjs/Questions/index.js.map +7 -0
  198. package/cjs/Questions/types/index.js +16 -5
  199. package/cjs/Questions/types.js.map +7 -0
  200. package/cjs/index.js +47 -20
  201. package/cjs/index.js.map +7 -0
  202. package/cjs/inputs/AutoCompleteInput/index.js +92 -49
  203. package/cjs/inputs/AutoCompleteInput/index.js.map +7 -0
  204. package/cjs/inputs/Checkboxes/index.js +102 -96
  205. package/cjs/inputs/Checkboxes/index.js.map +7 -0
  206. package/cjs/inputs/DateInput/index.js +157 -115
  207. package/cjs/inputs/DateInput/index.js.map +7 -0
  208. package/cjs/inputs/DateTimeInput/index.js +245 -0
  209. package/cjs/inputs/DateTimeInput/index.js.map +7 -0
  210. package/cjs/inputs/FileInput/index.js +115 -65
  211. package/cjs/inputs/FileInput/index.js.map +7 -0
  212. package/cjs/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
  213. package/cjs/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
  214. package/cjs/inputs/ImageInput/index.js +127 -83
  215. package/cjs/inputs/ImageInput/index.js.map +7 -0
  216. package/cjs/inputs/Input/index.js +106 -71
  217. package/cjs/inputs/Input/index.js.map +7 -0
  218. package/cjs/inputs/Label/index.js +45 -24
  219. package/cjs/inputs/Label/index.js.map +7 -0
  220. package/cjs/inputs/OtpInput/index.js +143 -113
  221. package/cjs/inputs/OtpInput/index.js.map +7 -0
  222. package/cjs/inputs/Radio/index.js +131 -61
  223. package/cjs/inputs/Radio/index.js.map +7 -0
  224. package/cjs/inputs/Select/index.js +61 -36
  225. package/cjs/inputs/Select/index.js.map +7 -0
  226. package/cjs/inputs/index.js +62 -69
  227. package/cjs/inputs/index.js.map +7 -0
  228. package/cjs/inputs/inputsScenarios/index.js +533 -0
  229. package/cjs/inputs/inputsScenarios.js.map +7 -0
  230. package/cjs/internal/index.js +36 -346
  231. package/cjs/internal.js.map +7 -0
  232. package/cjs/lazy/index.js +110 -516
  233. package/cjs/lazy.js.map +7 -0
  234. package/cjs/locales/el/index.js +35 -0
  235. package/cjs/locales/el.js.map +7 -0
  236. package/cjs/registry/index.js +190 -142
  237. package/cjs/registry.js.map +7 -0
  238. package/cjs/types/index.js +22 -5
  239. package/cjs/types.js.map +7 -0
  240. package/cjs/utils/index.js +93 -83
  241. package/cjs/utils.js.map +7 -0
  242. package/cjs/validators/index.js +139 -167
  243. package/cjs/validators/index.js.map +7 -0
  244. package/cjs/validators/types/index.js +16 -5
  245. package/cjs/validators/types.js.map +7 -0
  246. package/cjs/validators/utils/afm/index.js +38 -21
  247. package/cjs/validators/utils/afm.js.map +7 -0
  248. package/cjs/validators/utils/amka/index.js +60 -0
  249. package/cjs/validators/utils/amka.js.map +7 -0
  250. package/cjs/validators/utils/date/index.js +156 -0
  251. package/cjs/validators/utils/date.js.map +7 -0
  252. package/cjs/validators/utils/datetime/index.js +240 -0
  253. package/cjs/validators/utils/datetime.js.map +7 -0
  254. package/cjs/validators/utils/file/index.js +48 -30
  255. package/cjs/validators/utils/file.js.map +7 -0
  256. package/cjs/validators/utils/iban/index.js +36 -17
  257. package/cjs/validators/utils/iban.js.map +7 -0
  258. package/cjs/validators/utils/image/index.js +88 -112
  259. package/cjs/validators/utils/image.js.map +7 -0
  260. package/cjs/validators/utils/index.js +103 -159
  261. package/cjs/validators/utils/index.js.map +7 -0
  262. package/cjs/validators/utils/int/index.js +35 -13
  263. package/cjs/validators/utils/int.js.map +7 -0
  264. package/cjs/validators/utils/number/index.js +34 -12
  265. package/cjs/validators/utils/number.js.map +7 -0
  266. package/cjs/validators/utils/otp/index.js +35 -13
  267. package/cjs/validators/utils/otp.js.map +7 -0
  268. package/cjs/validators/utils/phone/index.js +113 -58
  269. package/cjs/validators/utils/phone.js.map +7 -0
  270. package/cjs/validators/utils/postal_code/index.js +36 -16
  271. package/cjs/validators/utils/postal_code.js.map +7 -0
  272. package/cjs/validators/utils/text_limit/index.js +40 -25
  273. package/cjs/validators/utils/text_limit.js.map +7 -0
  274. package/cjs/validators/utils/uuid4/index.js +34 -13
  275. package/cjs/validators/utils/uuid4.js.map +7 -0
  276. package/index.d.ts +4 -1
  277. package/index.js +13 -4
  278. package/index.js.map +7 -0
  279. package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +4 -2
  280. package/inputs/AutoCompleteInput/__stories__/Default.d.ts +2 -2
  281. package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +2 -2
  282. package/inputs/AutoCompleteInput/index.d.ts +2 -2
  283. package/inputs/AutoCompleteInput/index.js +62 -40
  284. package/inputs/AutoCompleteInput/index.js.map +7 -0
  285. package/inputs/AutoCompleteInput/index.test.d.ts +1 -0
  286. package/inputs/Checkboxes/Checkboxes.stories.d.ts +5 -3
  287. package/inputs/Checkboxes/__stories__/Conditional.d.ts +2 -2
  288. package/inputs/Checkboxes/__stories__/Default.d.ts +2 -2
  289. package/inputs/Checkboxes/__stories__/WithDivider.d.ts +2 -2
  290. package/inputs/Checkboxes/index.d.ts +2 -1
  291. package/inputs/Checkboxes/index.js +74 -87
  292. package/inputs/Checkboxes/index.js.map +7 -0
  293. package/inputs/Checkboxes/index.test.d.ts +1 -0
  294. package/inputs/DateInput/DateInput.stories.d.ts +7 -1
  295. package/inputs/DateInput/__stories__/Default.d.ts +2 -2
  296. package/inputs/DateInput/__stories__/WithDefaultValue.d.ts +3 -0
  297. package/inputs/DateInput/__stories__/WithInitialValue.d.ts +3 -0
  298. package/inputs/DateInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
  299. package/inputs/DateInput/__stories__/WithWrongInitialValue.d.ts +3 -0
  300. package/inputs/DateInput/index.d.ts +3 -4
  301. package/inputs/DateInput/index.js +127 -105
  302. package/inputs/DateInput/index.js.map +7 -0
  303. package/inputs/DateInput/index.test.d.ts +1 -0
  304. package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +14 -0
  305. package/inputs/DateTimeInput/__stories__/Default.d.ts +3 -0
  306. package/inputs/DateTimeInput/__stories__/WithDefaultValue.d.ts +3 -0
  307. package/inputs/DateTimeInput/__stories__/WithInitialValue.d.ts +3 -0
  308. package/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
  309. package/inputs/DateTimeInput/__stories__/WithWrongInitialValue.d.ts +3 -0
  310. package/inputs/DateTimeInput/index.d.ts +13 -0
  311. package/inputs/DateTimeInput/index.js +215 -0
  312. package/inputs/DateTimeInput/index.js.map +7 -0
  313. package/inputs/DateTimeInput/index.test.d.ts +1 -0
  314. package/inputs/DateTimeInput/package.json +6 -0
  315. package/inputs/FileInput/FileInput.stories.d.ts +4 -1
  316. package/inputs/FileInput/__stories__/Default.d.ts +2 -2
  317. package/inputs/FileInput/__stories__/WithBorderAndLink.d.ts +3 -0
  318. package/inputs/FileInput/index.d.ts +17 -1
  319. package/inputs/FileInput/index.js +86 -56
  320. package/inputs/FileInput/index.js.map +7 -0
  321. package/inputs/FileInput/index.test.d.ts +1 -0
  322. package/inputs/ImageInput/ImageInput.stories.d.ts +6 -3
  323. package/inputs/ImageInput/__stories__/Default.d.ts +2 -2
  324. package/inputs/ImageInput/__stories__/MaxSize.d.ts +3 -0
  325. package/inputs/ImageInput/__stories__/WithInitialValues.d.ts +3 -0
  326. package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +2 -2
  327. package/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
  328. package/inputs/{FileInput/__stories__/Default → ImageInput/__stories__/logo.d}/package.json +1 -1
  329. package/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
  330. package/inputs/ImageInput/index.d.ts +9 -1
  331. package/inputs/ImageInput/index.js +95 -75
  332. package/inputs/ImageInput/index.js.map +7 -0
  333. package/inputs/ImageInput/index.test.d.ts +1 -0
  334. package/inputs/Input/Input.stories.d.ts +15 -10
  335. package/inputs/Input/__stories__/AFM.d.ts +2 -2
  336. package/inputs/Input/__stories__/AMKA.d.ts +3 -0
  337. package/inputs/Input/__stories__/Boolean.d.ts +2 -2
  338. package/inputs/Input/__stories__/Email.d.ts +3 -0
  339. package/inputs/Input/__stories__/IBAN.d.ts +2 -2
  340. package/inputs/Input/__stories__/Integer.d.ts +2 -2
  341. package/inputs/Input/__stories__/LandlineNumber.d.ts +2 -2
  342. package/inputs/Input/__stories__/MobilePhone.d.ts +2 -2
  343. package/inputs/Input/__stories__/PhoneNumber.d.ts +2 -2
  344. package/inputs/Input/__stories__/PostalCode.d.ts +2 -2
  345. package/inputs/Input/__stories__/String.d.ts +3 -0
  346. package/inputs/Input/__stories__/StringWithTrimValidation.d.ts +3 -0
  347. package/inputs/Input/__stories__/TextWithLimit.d.ts +3 -0
  348. package/inputs/Input/index.d.ts +2 -1
  349. package/inputs/Input/index.js +75 -66
  350. package/inputs/Input/index.js.map +7 -0
  351. package/inputs/Input/index.test.d.ts +1 -0
  352. package/inputs/Label/Label.stories.d.ts +3 -1
  353. package/inputs/Label/__stories__/Default.d.ts +2 -2
  354. package/inputs/Label/index.d.ts +1 -3
  355. package/inputs/Label/index.js +12 -17
  356. package/inputs/Label/index.js.map +7 -0
  357. package/inputs/Label/index.test.d.ts +1 -0
  358. package/inputs/OtpInput/OtpInput.stories.d.ts +3 -1
  359. package/inputs/OtpInput/__stories__/Default.d.ts +2 -2
  360. package/inputs/OtpInput/index.d.ts +1 -1
  361. package/inputs/OtpInput/index.js +111 -104
  362. package/inputs/OtpInput/index.js.map +7 -0
  363. package/inputs/OtpInput/index.test.d.ts +1 -0
  364. package/inputs/Radio/Radio.stories.d.ts +5 -3
  365. package/inputs/Radio/__stories__/Conditional.d.ts +2 -2
  366. package/inputs/Radio/__stories__/Default.d.ts +2 -2
  367. package/inputs/Radio/__stories__/WithDivider.d.ts +2 -2
  368. package/inputs/Radio/index.d.ts +6 -1
  369. package/inputs/Radio/index.js +102 -55
  370. package/inputs/Radio/index.js.map +7 -0
  371. package/inputs/Radio/index.test.d.ts +1 -0
  372. package/inputs/Select/Select.stories.d.ts +3 -1
  373. package/inputs/Select/__stories__/Default.d.ts +2 -2
  374. package/inputs/Select/index.d.ts +3 -2
  375. package/inputs/Select/index.js +33 -31
  376. package/inputs/Select/index.js.map +7 -0
  377. package/inputs/Select/index.test.d.ts +1 -0
  378. package/inputs/index.js +21 -9
  379. package/inputs/index.js.map +7 -0
  380. package/inputs/inputsScenarios/index.js +499 -0
  381. package/inputs/inputsScenarios/package.json +6 -0
  382. package/inputs/inputsScenarios.d.ts +296 -0
  383. package/inputs/inputsScenarios.js.map +7 -0
  384. package/internal/index.js +10 -34
  385. package/internal.d.ts +2 -31
  386. package/internal.js.map +7 -0
  387. package/lazy/index.js +76 -393
  388. package/locales/el/index.js +6 -0
  389. package/{Form.stories → locales/el}/package.json +1 -1
  390. package/locales/el.d.ts +2 -0
  391. package/locales/el.js.map +7 -0
  392. package/package.json +8 -9
  393. package/registry/index.js +125 -98
  394. package/src/Field/ErrorGroup.tsx +84 -0
  395. package/src/Field/FieldBase.tsx +40 -23
  396. package/src/Field/FieldBaseContainer.tsx +22 -8
  397. package/src/Field/FieldConditional.tsx +9 -1
  398. package/src/Field/doc.mdx +207 -0
  399. package/src/Field/index.tsx +40 -6
  400. package/src/Field/types.tsx +82 -5
  401. package/src/Field/utils/calculateField.ts +49 -0
  402. package/src/Field/utils/evaluateFieldWithConditions.ts +30 -0
  403. package/src/Field/utils/index.ts +84 -0
  404. package/src/Field/utils/useField.ts +66 -0
  405. package/src/FieldArray/FieldArray.stories.js +3 -2
  406. package/src/FieldArray/FormDialog.tsx +568 -0
  407. package/src/FieldArray/__stories__/Default.tsx +2 -1
  408. package/src/FieldArray/__stories__/WithExactLength.tsx +2 -1
  409. package/src/FieldArray/__stories__/WithModal.tsx +160 -0
  410. package/src/FieldArray/index.test.tsx +32 -0
  411. package/src/FieldArray/index.tsx +99 -50
  412. package/src/FieldObject/index.tsx +56 -22
  413. package/src/Fieldset/index.tsx +5 -5
  414. package/src/Fieldset/types.tsx +5 -3
  415. package/src/FormBuilder/FormBuilder.stories.js +6 -1
  416. package/src/FormBuilder/__stories__/AutoErrorGrouping.tsx +63 -0
  417. package/src/FormBuilder/__stories__/Default.tsx +1 -1
  418. package/src/FormBuilder/__stories__/ErrorGrouping.tsx +43 -0
  419. package/{FormBuilder/FormBuilder.mdx → src/FormBuilder/doc.mdx} +27 -35
  420. package/src/FormBuilder/index.test.tsx +32 -0
  421. package/src/FormBuilder/index.tsx +268 -1
  422. package/src/FormBuilder/interaction.test.tsx +40 -0
  423. package/src/FormBuilder/scenarios.test.tsx +1978 -0
  424. package/src/FormContext.tsx +5 -2
  425. package/src/MultiplicityField/MultiplicityField.stories.js +9 -6
  426. package/src/MultiplicityField/__stories__/Default.tsx +1 -1
  427. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +3 -3
  428. package/src/MultiplicityField/__stories__/WithExactLength.tsx +2 -2
  429. package/src/MultiplicityField/__stories__/WithMaxLength.tsx +2 -2
  430. package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +2 -2
  431. package/src/MultiplicityField/__stories__/WithMinLength.tsx +2 -2
  432. package/src/MultiplicityField/add-objects.tsx +33 -15
  433. package/{MultiplicityField/MultiplicityField.mdx → src/MultiplicityField/doc.mdx} +112 -98
  434. package/src/MultiplicityField/index.test.tsx +44 -0
  435. package/src/MultiplicityField/index.tsx +24 -34
  436. package/src/MultiplicityField/types.ts +22 -0
  437. package/src/Questions/Questions.stories.js +4 -1
  438. package/src/Questions/Questions.tsx +4 -4
  439. package/src/Questions/Step/StepArrayReview.tsx +1 -1
  440. package/src/Questions/Step/StepTitle.tsx +5 -3
  441. package/src/Questions/Step/index.ts +0 -1
  442. package/src/Questions/Step/types.tsx +1 -0
  443. package/src/Questions/__snapshots__/index.spec.tsx.snap +74 -587
  444. package/src/Questions/__stories__/Default.tsx +1 -1
  445. package/src/Questions/{index.mdx → doc.mdx} +34 -57
  446. package/src/Questions/index.spec.tsx +17 -5
  447. package/src/Questions/index.test.tsx +24 -0
  448. package/src/Questions/types.tsx +1 -0
  449. package/src/create-simple-form.mdx +2 -6
  450. package/{index.mdx → src/doc.mdx} +29 -18
  451. package/src/index.ts +4 -1
  452. package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +5 -2
  453. package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +3 -11
  454. package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +3 -10
  455. package/{inputs/AutoCompleteInput/index.mdx → src/inputs/AutoCompleteInput/doc.mdx} +2 -13
  456. package/src/inputs/AutoCompleteInput/index.test.tsx +28 -0
  457. package/src/inputs/AutoCompleteInput/index.tsx +47 -31
  458. package/src/inputs/Checkboxes/Checkboxes.stories.js +6 -3
  459. package/src/inputs/Checkboxes/__stories__/Conditional.tsx +1 -1
  460. package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
  461. package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
  462. package/src/inputs/Checkboxes/{index.mdx → doc.mdx} +5 -15
  463. package/src/inputs/Checkboxes/index.test.tsx +32 -0
  464. package/src/inputs/Checkboxes/index.tsx +34 -31
  465. package/src/inputs/DateInput/DateInput.stories.js +8 -1
  466. package/src/inputs/DateInput/__stories__/Default.tsx +17 -16
  467. package/src/inputs/DateInput/__stories__/WithDefaultValue.tsx +26 -0
  468. package/src/inputs/DateInput/__stories__/WithInitialValue.tsx +28 -0
  469. package/src/inputs/DateInput/__stories__/WithWrongDefaultValue.tsx +26 -0
  470. package/src/inputs/DateInput/__stories__/WithWrongInitialValue.tsx +28 -0
  471. package/src/inputs/DateInput/{index.mdx → doc.mdx} +1 -8
  472. package/src/inputs/DateInput/index.test.tsx +40 -0
  473. package/src/inputs/DateInput/index.tsx +60 -23
  474. package/src/inputs/DateTimeInput/DateTimeInput.stories.js +14 -0
  475. package/src/inputs/DateTimeInput/__stories__/Default.tsx +25 -0
  476. package/src/inputs/DateTimeInput/__stories__/WithDefaultValue.tsx +26 -0
  477. package/src/inputs/DateTimeInput/__stories__/WithInitialValue.tsx +28 -0
  478. package/src/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.tsx +26 -0
  479. package/src/inputs/DateTimeInput/__stories__/WithWrongInitialValue.tsx +28 -0
  480. package/src/inputs/DateTimeInput/doc.mdx +16 -0
  481. package/src/inputs/DateTimeInput/index.test.tsx +40 -0
  482. package/src/inputs/DateTimeInput/index.tsx +233 -0
  483. package/src/inputs/FileInput/FileInput.stories.js +5 -1
  484. package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
  485. package/src/inputs/FileInput/__stories__/WithBorderAndLink.tsx +34 -0
  486. package/src/inputs/FileInput/{index.mdx → doc.mdx} +1 -5
  487. package/src/inputs/FileInput/index.test.tsx +28 -0
  488. package/src/inputs/FileInput/index.tsx +106 -41
  489. package/src/inputs/ImageInput/ImageInput.stories.js +7 -3
  490. package/src/inputs/ImageInput/__stories__/Default.tsx +1 -1
  491. package/src/inputs/ImageInput/__stories__/{WithInvalidImageSize.tsx → MaxSize.tsx} +5 -3
  492. package/src/inputs/ImageInput/__stories__/WithInitialValues.tsx +45 -0
  493. package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +3 -1
  494. package/src/inputs/ImageInput/__stories__/logo.d.ts +4 -0
  495. package/src/inputs/ImageInput/__stories__/logo.png +0 -0
  496. package/src/inputs/ImageInput/doc.mdx +23 -0
  497. package/src/inputs/ImageInput/index.test.tsx +36 -0
  498. package/src/inputs/ImageInput/index.tsx +103 -50
  499. package/src/inputs/Input/Input.stories.js +16 -10
  500. package/src/inputs/Input/__stories__/AFM.tsx +1 -1
  501. package/src/inputs/Input/__stories__/AMKA.tsx +23 -0
  502. package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
  503. package/src/inputs/Input/__stories__/Email.tsx +23 -0
  504. package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
  505. package/src/inputs/Input/__stories__/Integer.tsx +1 -1
  506. package/src/inputs/Input/__stories__/LandlineNumber.tsx +3 -2
  507. package/src/inputs/Input/__stories__/MobilePhone.tsx +2 -1
  508. package/src/inputs/Input/__stories__/PhoneNumber.tsx +2 -1
  509. package/src/inputs/Input/__stories__/PostalCode.tsx +2 -1
  510. package/src/inputs/Input/__stories__/{Default.tsx → String.tsx} +2 -2
  511. package/src/inputs/Input/__stories__/StringWithTrimValidation.tsx +26 -0
  512. package/src/inputs/Input/__stories__/{TextWithCharacterLimit.tsx → TextWithLimit.tsx} +3 -2
  513. package/src/inputs/Input/doc.mdx +56 -0
  514. package/src/inputs/Input/index.test.tsx +72 -0
  515. package/src/inputs/Input/index.tsx +44 -31
  516. package/src/inputs/Label/Label.stories.js +4 -1
  517. package/src/inputs/Label/__stories__/Default.tsx +4 -2
  518. package/src/inputs/Label/doc.mdx +14 -0
  519. package/src/inputs/Label/index.test.tsx +24 -0
  520. package/src/inputs/Label/index.tsx +3 -10
  521. package/src/inputs/OtpInput/OtpInput.stories.js +4 -1
  522. package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
  523. package/{inputs/OtpInput/index.mdx → src/inputs/OtpInput/doc.mdx} +1 -8
  524. package/src/inputs/OtpInput/index.test.tsx +24 -0
  525. package/src/inputs/OtpInput/index.tsx +3 -1
  526. package/src/inputs/Radio/Radio.stories.js +6 -3
  527. package/src/inputs/Radio/__stories__/Conditional.tsx +3 -2
  528. package/src/inputs/Radio/__stories__/Default.tsx +1 -1
  529. package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
  530. package/{cjs/inputs/Radio/index.mdx → src/inputs/Radio/doc.mdx} +5 -15
  531. package/src/inputs/Radio/index.test.tsx +32 -0
  532. package/src/inputs/Radio/index.tsx +79 -9
  533. package/src/inputs/Select/Select.stories.js +4 -1
  534. package/src/inputs/Select/__stories__/Default.tsx +1 -1
  535. package/{inputs/Select/index.mdx → src/inputs/Select/doc.mdx} +1 -5
  536. package/src/inputs/Select/index.test.tsx +24 -0
  537. package/src/inputs/Select/index.tsx +18 -7
  538. package/src/inputs/inputsScenarios.ts +496 -0
  539. package/src/installation.mdx +2 -5
  540. package/src/internal.ts +2 -31
  541. package/src/lazy.js +77 -59
  542. package/src/locales/el.ts +3 -0
  543. package/src/registry.js +108 -88
  544. package/src/types.tsx +13 -65
  545. package/src/utils.ts +55 -33
  546. package/src/validators/index.ts +107 -90
  547. package/src/validators/utils/amka.ts +39 -0
  548. package/src/validators/utils/date.ts +126 -0
  549. package/src/validators/utils/datetime.ts +217 -0
  550. package/src/validators/utils/file.ts +33 -17
  551. package/src/validators/utils/index.ts +6 -1
  552. package/src/validators/utils/int.ts +1 -1
  553. package/src/validators/utils/number.ts +1 -1
  554. package/src/validators/utils/phone.ts +63 -72
  555. package/src/validators/utils/postal_code.ts +1 -1
  556. package/src/validators/utils/uuid4.ts +2 -1
  557. package/src/validators/validators.spec.ts +6 -40
  558. package/types/index.js +2 -1
  559. package/types.d.ts +8 -36
  560. package/types.js.map +7 -0
  561. package/utils/index.js +71 -77
  562. package/utils.d.ts +2 -0
  563. package/utils.js.map +7 -0
  564. package/validators/index.d.ts +1 -1
  565. package/validators/index.js +121 -153
  566. package/validators/index.js.map +7 -0
  567. package/validators/types/index.js +1 -1
  568. package/validators/types.js.map +7 -0
  569. package/validators/utils/afm/index.js +16 -16
  570. package/validators/utils/afm.js.map +7 -0
  571. package/validators/utils/amka/index.js +36 -0
  572. package/validators/utils/amka/package.json +6 -0
  573. package/validators/utils/amka.d.ts +6 -0
  574. package/validators/utils/amka.js.map +7 -0
  575. package/validators/utils/date/index.js +121 -0
  576. package/validators/utils/date/package.json +6 -0
  577. package/validators/utils/date.d.ts +9 -0
  578. package/validators/utils/date.js.map +7 -0
  579. package/validators/utils/datetime/index.js +205 -0
  580. package/{Questions/Questions.stories → validators/utils/datetime}/package.json +1 -1
  581. package/validators/utils/datetime.d.ts +9 -0
  582. package/validators/utils/datetime.js.map +7 -0
  583. package/validators/utils/file/index.js +26 -25
  584. package/validators/utils/file.js.map +7 -0
  585. package/validators/utils/iban/index.js +14 -12
  586. package/validators/utils/iban.js.map +7 -0
  587. package/validators/utils/image/index.js +66 -106
  588. package/validators/utils/image.js.map +7 -0
  589. package/validators/utils/index.d.ts +3 -0
  590. package/validators/utils/index.js +59 -48
  591. package/validators/utils/index.js.map +7 -0
  592. package/validators/utils/int/index.js +13 -8
  593. package/validators/utils/int.js.map +7 -0
  594. package/validators/utils/number/index.js +12 -7
  595. package/validators/utils/number.js.map +7 -0
  596. package/validators/utils/otp/index.js +13 -8
  597. package/validators/utils/otp.js.map +7 -0
  598. package/validators/utils/phone/index.js +89 -51
  599. package/validators/utils/phone.d.ts +1 -1
  600. package/validators/utils/phone.js.map +7 -0
  601. package/validators/utils/postal_code/index.js +14 -11
  602. package/validators/utils/postal_code.d.ts +1 -1
  603. package/validators/utils/postal_code.js.map +7 -0
  604. package/validators/utils/text_limit/index.js +18 -20
  605. package/validators/utils/text_limit.js.map +7 -0
  606. package/validators/utils/uuid4/index.js +12 -8
  607. package/validators/utils/uuid4.js.map +7 -0
  608. package/Field/index.mdx +0 -6
  609. package/Field/utils.d.ts +0 -5
  610. package/FieldArray/FieldArray.stories/index.js +0 -8
  611. package/FieldArray/FieldArray.stories.playwright.json +0 -353
  612. package/FieldArray/__stories__/Default/index.js +0 -88
  613. package/FieldArray/__stories__/Default/package.json +0 -6
  614. package/FieldArray/__stories__/WithExactLength/index.js +0 -88
  615. package/FieldArray/__stories__/WithExactLength/package.json +0 -6
  616. package/Form.stories/index.js +0 -3
  617. package/FormBuilder/FormBuilder/index.js +0 -152
  618. package/FormBuilder/FormBuilder.d.ts +0 -5
  619. package/FormBuilder/FormBuilder.stories/index.js +0 -7
  620. package/FormBuilder/FormBuilder.stories/package.json +0 -6
  621. package/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  622. package/FormBuilder/__stories__/Default/index.js +0 -26
  623. package/FormBuilder/__stories__/Default/package.json +0 -6
  624. package/MultiplicityField/MultiplicityField.stories/index.js +0 -12
  625. package/MultiplicityField/MultiplicityField.stories/package.json +0 -6
  626. package/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  627. package/MultiplicityField/__stories__/Default/index.js +0 -95
  628. package/MultiplicityField/__stories__/Default/package.json +0 -6
  629. package/MultiplicityField/__stories__/PreviewDisplay/index.js +0 -72
  630. package/MultiplicityField/__stories__/PreviewDisplay/package.json +0 -6
  631. package/MultiplicityField/__stories__/WithExactLength/index.js +0 -90
  632. package/MultiplicityField/__stories__/WithExactLength/package.json +0 -6
  633. package/MultiplicityField/__stories__/WithMaxLength/index.js +0 -93
  634. package/MultiplicityField/__stories__/WithMaxLength/package.json +0 -6
  635. package/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +0 -94
  636. package/MultiplicityField/__stories__/WithMinAndMaxLength/package.json +0 -6
  637. package/MultiplicityField/__stories__/WithMinLength/index.js +0 -93
  638. package/MultiplicityField/__stories__/WithMinLength/package.json +0 -6
  639. package/Questions/Questions.stories/index.js +0 -7
  640. package/Questions/__snapshots__/index.spec.tsx.snap +0 -596
  641. package/Questions/__stories__/Default/index.js +0 -102
  642. package/Questions/__stories__/Default/package.json +0 -6
  643. package/Questions/index.mdx +0 -415
  644. package/Questions/index.spec/index.js +0 -59
  645. package/cjs/Field/index.mdx +0 -6
  646. package/cjs/FieldArray/FieldArray.stories/index.js +0 -38
  647. package/cjs/FieldArray/FieldArray.stories.playwright.json +0 -353
  648. package/cjs/FieldArray/__stories__/Default/index.js +0 -98
  649. package/cjs/FieldArray/__stories__/WithExactLength/index.js +0 -98
  650. package/cjs/Form.stories/index.js +0 -9
  651. package/cjs/FormBuilder/FormBuilder/index.js +0 -162
  652. package/cjs/FormBuilder/FormBuilder.mdx +0 -256
  653. package/cjs/FormBuilder/FormBuilder.stories/index.js +0 -26
  654. package/cjs/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  655. package/cjs/FormBuilder/__stories__/Default/index.js +0 -36
  656. package/cjs/MultiplicityField/MultiplicityField.mdx +0 -590
  657. package/cjs/MultiplicityField/MultiplicityField.stories/index.js +0 -86
  658. package/cjs/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  659. package/cjs/MultiplicityField/__stories__/Default/index.js +0 -105
  660. package/cjs/MultiplicityField/__stories__/PreviewDisplay/index.js +0 -82
  661. package/cjs/MultiplicityField/__stories__/WithExactLength/index.js +0 -100
  662. package/cjs/MultiplicityField/__stories__/WithMaxLength/index.js +0 -103
  663. package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +0 -104
  664. package/cjs/MultiplicityField/__stories__/WithMinLength/index.js +0 -103
  665. package/cjs/Questions/Questions.stories/index.js +0 -26
  666. package/cjs/Questions/__snapshots__/index.spec.tsx.snap +0 -596
  667. package/cjs/Questions/__stories__/Default/index.js +0 -113
  668. package/cjs/Questions/index.mdx +0 -415
  669. package/cjs/Questions/index.spec/index.js +0 -63
  670. package/cjs/create-simple-form.mdx +0 -539
  671. package/cjs/index.mdx +0 -51
  672. package/cjs/inputs/AutoCompleteInput/AutoComplete.stories/index.js +0 -38
  673. package/cjs/inputs/AutoCompleteInput/__stories__/Default/index.js +0 -51
  674. package/cjs/inputs/AutoCompleteInput/__stories__/Multiple/index.js +0 -52
  675. package/cjs/inputs/AutoCompleteInput/index.mdx +0 -29
  676. package/cjs/inputs/Checkboxes/Checkboxes.stories/index.js +0 -50
  677. package/cjs/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  678. package/cjs/inputs/Checkboxes/__stories__/Conditional/index.js +0 -103
  679. package/cjs/inputs/Checkboxes/__stories__/Default/index.js +0 -50
  680. package/cjs/inputs/Checkboxes/__stories__/WithDivider/index.js +0 -51
  681. package/cjs/inputs/Checkboxes/index.mdx +0 -33
  682. package/cjs/inputs/DateInput/DateInput.stories/index.js +0 -26
  683. package/cjs/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  684. package/cjs/inputs/DateInput/__stories__/Default/index.js +0 -33
  685. package/cjs/inputs/DateInput/index.mdx +0 -23
  686. package/cjs/inputs/FileInput/FileInput.stories/index.js +0 -26
  687. package/cjs/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  688. package/cjs/inputs/FileInput/__stories__/Default/index.js +0 -30
  689. package/cjs/inputs/FileInput/index.mdx +0 -19
  690. package/cjs/inputs/ImageInput/ImageInput.stories/index.js +0 -50
  691. package/cjs/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  692. package/cjs/inputs/ImageInput/__stories__/Default/index.js +0 -38
  693. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +0 -46
  694. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +0 -43
  695. package/cjs/inputs/ImageInput/index.mdx +0 -19
  696. package/cjs/inputs/Input/Input.stories/index.js +0 -134
  697. package/cjs/inputs/Input/Input.stories.playwright.json +0 -376
  698. package/cjs/inputs/Input/__stories__/AFM/index.js +0 -32
  699. package/cjs/inputs/Input/__stories__/Boolean/index.js +0 -33
  700. package/cjs/inputs/Input/__stories__/Default/index.js +0 -33
  701. package/cjs/inputs/Input/__stories__/IBAN/index.js +0 -33
  702. package/cjs/inputs/Input/__stories__/Integer/index.js +0 -41
  703. package/cjs/inputs/Input/__stories__/LandlineNumber/index.js +0 -36
  704. package/cjs/inputs/Input/__stories__/MobilePhone/index.js +0 -36
  705. package/cjs/inputs/Input/__stories__/PhoneNumber/index.js +0 -35
  706. package/cjs/inputs/Input/__stories__/PostalCode/index.js +0 -35
  707. package/cjs/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -39
  708. package/cjs/inputs/Input/index.mdx +0 -95
  709. package/cjs/inputs/Label/Label.stories/index.js +0 -26
  710. package/cjs/inputs/Label/Label.stories.playwright.json +0 -40
  711. package/cjs/inputs/Label/__stories__/Default/index.js +0 -37
  712. package/cjs/inputs/Label/index.mdx +0 -0
  713. package/cjs/inputs/OtpInput/OtpInput.stories/index.js +0 -26
  714. package/cjs/inputs/OtpInput/__stories__/Default/index.js +0 -39
  715. package/cjs/inputs/OtpInput/index.mdx +0 -23
  716. package/cjs/inputs/Radio/Radio.stories/index.js +0 -50
  717. package/cjs/inputs/Radio/Radio.stories.playwright.json +0 -73
  718. package/cjs/inputs/Radio/__stories__/Conditional/index.js +0 -103
  719. package/cjs/inputs/Radio/__stories__/Default/index.js +0 -55
  720. package/cjs/inputs/Radio/__stories__/WithDivider/index.js +0 -56
  721. package/cjs/inputs/Select/Select.stories/index.js +0 -26
  722. package/cjs/inputs/Select/Select.stories.playwright.json +0 -22
  723. package/cjs/inputs/Select/__stories__/Default/index.js +0 -61
  724. package/cjs/inputs/Select/index.mdx +0 -17
  725. package/cjs/installation.mdx +0 -68
  726. package/cjs/validators/validators.spec/index.js +0 -87
  727. package/create-simple-form.mdx +0 -539
  728. package/inputs/AutoCompleteInput/AutoComplete.stories/index.js +0 -8
  729. package/inputs/AutoCompleteInput/AutoComplete.stories/package.json +0 -6
  730. package/inputs/AutoCompleteInput/__stories__/Default/index.js +0 -44
  731. package/inputs/AutoCompleteInput/__stories__/Default/package.json +0 -6
  732. package/inputs/AutoCompleteInput/__stories__/Multiple/index.js +0 -45
  733. package/inputs/AutoCompleteInput/__stories__/Multiple/package.json +0 -6
  734. package/inputs/Checkboxes/Checkboxes.stories/index.js +0 -9
  735. package/inputs/Checkboxes/Checkboxes.stories/package.json +0 -6
  736. package/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  737. package/inputs/Checkboxes/__stories__/Conditional/index.js +0 -93
  738. package/inputs/Checkboxes/__stories__/Conditional/package.json +0 -6
  739. package/inputs/Checkboxes/__stories__/Default/index.js +0 -40
  740. package/inputs/Checkboxes/__stories__/Default/package.json +0 -6
  741. package/inputs/Checkboxes/__stories__/WithDivider/index.js +0 -41
  742. package/inputs/Checkboxes/__stories__/WithDivider/package.json +0 -6
  743. package/inputs/Checkboxes/index.mdx +0 -33
  744. package/inputs/DateInput/DateInput.stories/index.js +0 -7
  745. package/inputs/DateInput/DateInput.stories/package.json +0 -6
  746. package/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  747. package/inputs/DateInput/__stories__/Default/index.js +0 -23
  748. package/inputs/DateInput/index.mdx +0 -23
  749. package/inputs/FileInput/FileInput.stories/index.js +0 -7
  750. package/inputs/FileInput/FileInput.stories/package.json +0 -6
  751. package/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  752. package/inputs/FileInput/__stories__/Default/index.js +0 -20
  753. package/inputs/FileInput/index.mdx +0 -19
  754. package/inputs/ImageInput/ImageInput.stories/index.js +0 -9
  755. package/inputs/ImageInput/ImageInput.stories/package.json +0 -6
  756. package/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  757. package/inputs/ImageInput/__stories__/Default/index.js +0 -28
  758. package/inputs/ImageInput/__stories__/Default/package.json +0 -6
  759. package/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +0 -36
  760. package/inputs/ImageInput/__stories__/WithInvalidImageDimension/package.json +0 -6
  761. package/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +0 -33
  762. package/inputs/ImageInput/__stories__/WithInvalidImageSize/package.json +0 -6
  763. package/inputs/ImageInput/__stories__/WithInvalidImageSize.d.ts +0 -3
  764. package/inputs/ImageInput/index.mdx +0 -19
  765. package/inputs/Input/Input.stories/index.js +0 -16
  766. package/inputs/Input/Input.stories/package.json +0 -6
  767. package/inputs/Input/Input.stories.playwright.json +0 -376
  768. package/inputs/Input/__stories__/AFM/index.js +0 -22
  769. package/inputs/Input/__stories__/AFM/package.json +0 -6
  770. package/inputs/Input/__stories__/Boolean/index.js +0 -23
  771. package/inputs/Input/__stories__/Boolean/package.json +0 -6
  772. package/inputs/Input/__stories__/Default/index.js +0 -23
  773. package/inputs/Input/__stories__/Default/package.json +0 -6
  774. package/inputs/Input/__stories__/Default.d.ts +0 -3
  775. package/inputs/Input/__stories__/IBAN/index.js +0 -23
  776. package/inputs/Input/__stories__/IBAN/package.json +0 -6
  777. package/inputs/Input/__stories__/Integer/index.js +0 -31
  778. package/inputs/Input/__stories__/Integer/package.json +0 -6
  779. package/inputs/Input/__stories__/LandlineNumber/index.js +0 -26
  780. package/inputs/Input/__stories__/LandlineNumber/package.json +0 -6
  781. package/inputs/Input/__stories__/MobilePhone/index.js +0 -26
  782. package/inputs/Input/__stories__/MobilePhone/package.json +0 -6
  783. package/inputs/Input/__stories__/PhoneNumber/index.js +0 -25
  784. package/inputs/Input/__stories__/PhoneNumber/package.json +0 -6
  785. package/inputs/Input/__stories__/PostalCode/index.js +0 -25
  786. package/inputs/Input/__stories__/PostalCode/package.json +0 -6
  787. package/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -29
  788. package/inputs/Input/__stories__/TextWithCharacterLimit/package.json +0 -6
  789. package/inputs/Input/__stories__/TextWithCharacterLimit.d.ts +0 -3
  790. package/inputs/Input/index.mdx +0 -95
  791. package/inputs/Label/Label.stories/index.js +0 -7
  792. package/inputs/Label/Label.stories/package.json +0 -6
  793. package/inputs/Label/Label.stories.playwright.json +0 -40
  794. package/inputs/Label/__stories__/Default/index.js +0 -27
  795. package/inputs/Label/__stories__/Default/package.json +0 -6
  796. package/inputs/Label/index.mdx +0 -0
  797. package/inputs/OtpInput/OtpInput.stories/index.js +0 -7
  798. package/inputs/OtpInput/OtpInput.stories/package.json +0 -6
  799. package/inputs/OtpInput/__stories__/Default/index.js +0 -29
  800. package/inputs/OtpInput/__stories__/Default/package.json +0 -6
  801. package/inputs/Radio/Radio.stories/index.js +0 -9
  802. package/inputs/Radio/Radio.stories/package.json +0 -6
  803. package/inputs/Radio/Radio.stories.playwright.json +0 -73
  804. package/inputs/Radio/__stories__/Conditional/index.js +0 -93
  805. package/inputs/Radio/__stories__/Conditional/package.json +0 -6
  806. package/inputs/Radio/__stories__/Default/index.js +0 -45
  807. package/inputs/Radio/__stories__/Default/package.json +0 -6
  808. package/inputs/Radio/__stories__/WithDivider/index.js +0 -46
  809. package/inputs/Radio/__stories__/WithDivider/package.json +0 -6
  810. package/inputs/Radio/index.mdx +0 -33
  811. package/inputs/Select/Select.stories/index.js +0 -7
  812. package/inputs/Select/Select.stories/package.json +0 -6
  813. package/inputs/Select/Select.stories.playwright.json +0 -22
  814. package/inputs/Select/__stories__/Default/index.js +0 -51
  815. package/inputs/Select/__stories__/Default/package.json +0 -6
  816. package/installation.mdx +0 -68
  817. package/lazy.d.ts +0 -69
  818. package/registry.d.ts +0 -64
  819. package/src/Field/index.mdx +0 -6
  820. package/src/Field/utils.ts +0 -191
  821. package/src/FieldArray/FieldArray.stories.playwright.json +0 -353
  822. package/src/FormBuilder/FormBuilder.mdx +0 -256
  823. package/src/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  824. package/src/FormBuilder/FormBuilder.tsx +0 -166
  825. package/src/MultiplicityField/MultiplicityField.mdx +0 -590
  826. package/src/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  827. package/src/index.mdx +0 -51
  828. package/src/inputs/AutoCompleteInput/index.mdx +0 -29
  829. package/src/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  830. package/src/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  831. package/src/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  832. package/src/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  833. package/src/inputs/ImageInput/index.mdx +0 -19
  834. package/src/inputs/Input/Input.stories.playwright.json +0 -376
  835. package/src/inputs/Input/index.mdx +0 -95
  836. package/src/inputs/Label/Label.stories.playwright.json +0 -40
  837. package/src/inputs/Label/index.mdx +0 -0
  838. package/src/inputs/OtpInput/index.mdx +0 -23
  839. package/src/inputs/Radio/Radio.stories.playwright.json +0 -73
  840. package/src/inputs/Radio/index.mdx +0 -33
  841. package/src/inputs/Select/Select.stories.playwright.json +0 -22
  842. package/src/inputs/Select/index.mdx +0 -17
  843. package/validators/validators.spec/index.js +0 -85
@@ -1,204 +1,148 @@
1
- "use strict";
2
-
3
- var _typeof = require("@babel/runtime/helpers/typeof");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- var _exportNames = {
8
- getYupField: true,
9
- computeShape: true,
10
- getYupObjectShape: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- exports.computeShape = computeShape;
13
- exports.getYupField = getYupField;
14
- exports.getYupObjectShape = getYupObjectShape;
15
- var yup = _interopRequireWildcard(require("yup"));
16
- var _afm = require("@digigov/form/validators/utils/afm");
17
- Object.keys(_afm).forEach(function (key) {
18
- if (key === "default" || key === "__esModule") return;
19
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
20
- if (key in exports && exports[key] === _afm[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function get() {
24
- return _afm[key];
25
- }
26
- });
27
- });
28
- var _file = require("@digigov/form/validators/utils/file");
29
- Object.keys(_file).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
32
- if (key in exports && exports[key] === _file[key]) return;
33
- Object.defineProperty(exports, key, {
34
- enumerable: true,
35
- get: function get() {
36
- return _file[key];
37
- }
38
- });
39
- });
40
- var _iban = require("@digigov/form/validators/utils/iban");
41
- Object.keys(_iban).forEach(function (key) {
42
- if (key === "default" || key === "__esModule") return;
43
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
44
- if (key in exports && exports[key] === _iban[key]) return;
45
- Object.defineProperty(exports, key, {
46
- enumerable: true,
47
- get: function get() {
48
- return _iban[key];
49
- }
50
- });
51
- });
52
- var _otp = require("@digigov/form/validators/utils/otp");
53
- Object.keys(_otp).forEach(function (key) {
54
- if (key === "default" || key === "__esModule") return;
55
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
56
- if (key in exports && exports[key] === _otp[key]) return;
57
- Object.defineProperty(exports, key, {
58
- enumerable: true,
59
- get: function get() {
60
- return _otp[key];
61
- }
62
- });
63
- });
64
- var _image = require("@digigov/form/validators/utils/image");
65
- Object.keys(_image).forEach(function (key) {
66
- if (key === "default" || key === "__esModule") return;
67
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
68
- if (key in exports && exports[key] === _image[key]) return;
69
- Object.defineProperty(exports, key, {
70
- enumerable: true,
71
- get: function get() {
72
- return _image[key];
73
- }
74
- });
75
- });
76
- var _phone = require("@digigov/form/validators/utils/phone");
77
- Object.keys(_phone).forEach(function (key) {
78
- if (key === "default" || key === "__esModule") return;
79
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
80
- if (key in exports && exports[key] === _phone[key]) return;
81
- Object.defineProperty(exports, key, {
82
- enumerable: true,
83
- get: function get() {
84
- return _phone[key];
85
- }
86
- });
87
- });
88
- var _postal_code = require("@digigov/form/validators/utils/postal_code");
89
- Object.keys(_postal_code).forEach(function (key) {
90
- if (key === "default" || key === "__esModule") return;
91
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
92
- if (key in exports && exports[key] === _postal_code[key]) return;
93
- Object.defineProperty(exports, key, {
94
- enumerable: true,
95
- get: function get() {
96
- return _postal_code[key];
97
- }
98
- });
99
- });
100
- var _uuid = require("@digigov/form/validators/utils/uuid4");
101
- Object.keys(_uuid).forEach(function (key) {
102
- if (key === "default" || key === "__esModule") return;
103
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
104
- if (key in exports && exports[key] === _uuid[key]) return;
105
- Object.defineProperty(exports, key, {
106
- enumerable: true,
107
- get: function get() {
108
- return _uuid[key];
109
- }
110
- });
111
- });
112
- var _text_limit = require("@digigov/form/validators/utils/text_limit");
113
- Object.keys(_text_limit).forEach(function (key) {
114
- if (key === "default" || key === "__esModule") return;
115
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
116
- if (key in exports && exports[key] === _text_limit[key]) return;
117
- Object.defineProperty(exports, key, {
118
- enumerable: true,
119
- get: function get() {
120
- return _text_limit[key];
121
- }
122
- });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var utils_exports = {};
30
+ __export(utils_exports, {
31
+ computeShape: () => computeShape,
32
+ getYupField: () => getYupField,
33
+ getYupObjectShape: () => getYupObjectShape
123
34
  });
124
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
125
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
35
+ module.exports = __toCommonJS(utils_exports);
36
+ var yup = __toESM(require("yup"));
37
+ __reExport(utils_exports, require("@digigov/form/validators/utils/afm"), module.exports);
38
+ __reExport(utils_exports, require("@digigov/form/validators/utils/amka"), module.exports);
39
+ __reExport(utils_exports, require("@digigov/form/validators/utils/file"), module.exports);
40
+ __reExport(utils_exports, require("@digigov/form/validators/utils/iban"), module.exports);
41
+ __reExport(utils_exports, require("@digigov/form/validators/utils/otp"), module.exports);
42
+ __reExport(utils_exports, require("@digigov/form/validators/utils/image"), module.exports);
43
+ __reExport(utils_exports, require("@digigov/form/validators/utils/phone"), module.exports);
44
+ __reExport(utils_exports, require("@digigov/form/validators/utils/postal_code"), module.exports);
45
+ __reExport(utils_exports, require("@digigov/form/validators/utils/uuid4"), module.exports);
46
+ __reExport(utils_exports, require("@digigov/form/validators/utils/text_limit"), module.exports);
47
+ __reExport(utils_exports, require("@digigov/form/validators/utils/date"), module.exports);
48
+ __reExport(utils_exports, require("@digigov/form/validators/utils/datetime"), module.exports);
126
49
  function getYupField(field, yupTypeMap) {
127
- var yupField = yupTypeMap[(field === null || field === void 0 ? void 0 : field.type) || 'string'] || yupTypeMap['string'];
50
+ const yupField = yupTypeMap[field?.type || "string"] || yupTypeMap["string"];
128
51
  return yupField(field);
129
52
  }
130
53
  function computeShape(fields, yupTypeMap, validatorRegistry) {
131
- var fieldSchemas = {};
132
- var objectFields = {};
133
- fields.forEach(function (field) {
134
- var yupField = getYupField(field, yupTypeMap);
54
+ const fieldSchemas = {};
55
+ const objectFields = {};
56
+ fields.forEach((field) => {
57
+ let yupField = getYupField(field, yupTypeMap);
135
58
  if (field.condition) {
136
- var _loop = function _loop(key) {
137
- var then, otherwise;
59
+ for (const key in field.condition) {
60
+ let then, otherwise;
138
61
  if (field.condition[key].then) {
139
- var _field$condition$key$, _field$condition$key$2;
140
- if (((_field$condition$key$ = field.condition[key].then) === null || _field$condition$key$ === void 0 ? void 0 : _field$condition$key$.required) === false) {
62
+ if (field.condition[key].then?.required === false) {
141
63
  then = yupField.nullable();
142
- } else if (((_field$condition$key$2 = field.condition[key].then) === null || _field$condition$key$2 === void 0 ? void 0 : _field$condition$key$2.required) === true) {
143
- then = yupField.nullable().required('form.error.required');
64
+ } else if (field.condition[key].then?.required === true) {
65
+ then = yupField.nullable().required("form.error.required");
144
66
  }
145
67
  }
146
- if (field.condition[key]["else"]) {
147
- var _field$condition$key$3, _field$condition$key$4;
148
- if (((_field$condition$key$3 = field.condition[key]["else"]) === null || _field$condition$key$3 === void 0 ? void 0 : _field$condition$key$3.required) === false) {
68
+ if (field.condition[key].else) {
69
+ if (field.condition[key].else?.required === false) {
149
70
  otherwise = yupField.nullable();
150
- } else if (((_field$condition$key$4 = field.condition[key]["else"]) === null || _field$condition$key$4 === void 0 ? void 0 : _field$condition$key$4.required) === true) {
151
- otherwise = yupField.nullable().required('form.error.required');
71
+ } else if (field.condition[key].else?.required === true) {
72
+ otherwise = yupField.nullable().required("form.error.required");
152
73
  }
153
74
  }
154
75
  if (then || otherwise) {
155
76
  yupField = yupField.when(key, {
156
- is: function is(val) {
157
- //@ts-ignore
158
- var is = field.condition[key].is;
77
+ is: (val) => {
78
+ const is = field.condition[key].is;
159
79
  if (is === val || Array.isArray(val) && val.includes(is)) {
160
80
  return true;
161
81
  } else {
162
82
  return false;
163
83
  }
164
84
  },
165
- then: then,
166
- otherwise: otherwise
85
+ then,
86
+ otherwise
167
87
  });
168
88
  }
169
- };
170
- for (var key in field.condition) {
171
- _loop(key);
172
89
  }
173
90
  } else if (field.required) {
174
- yupField = yupField.nullable().required('form.error.required');
91
+ yupField = yupField.nullable().required("form.error.required");
175
92
  }
176
93
  if (validatorRegistry && field.type && validatorRegistry[field.type]) {
177
- validatorRegistry[field.type].forEach(function (validator) {
94
+ validatorRegistry[field.type].forEach((validator) => {
178
95
  yupField = yupField.test(validator);
179
96
  });
180
97
  }
181
98
  if (field.validators) {
182
- field.validators.forEach(function (validator) {
99
+ field.validators.forEach((validator) => {
183
100
  yupField = yupField.test(validator);
184
101
  });
185
102
  }
186
103
  fieldSchemas[field.key] = yupField;
187
104
  });
188
- for (var objectKey in objectFields) {
189
- fieldSchemas[objectKey] = getYupObjectShape(objectFields[objectKey], yupTypeMap, validatorRegistry);
105
+ for (const objectKey in objectFields) {
106
+ fieldSchemas[objectKey] = getYupObjectShape(
107
+ objectFields[objectKey],
108
+ yupTypeMap,
109
+ validatorRegistry
110
+ );
190
111
  }
191
112
  return fieldSchemas;
192
113
  }
193
- function getYupObjectShape(
194
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
195
- fields, yupTypeMap, validatorRegistry) {
114
+ function getYupObjectShape(fields, yupTypeMap, validatorRegistry) {
196
115
  if (!fields.current) {
197
- var fieldSchemas = computeShape(fields, yupTypeMap, validatorRegistry);
116
+ const fieldSchemas = computeShape(fields, yupTypeMap, validatorRegistry);
198
117
  return yup.object().shape(fieldSchemas);
199
118
  }
200
- return yup.lazy(function () {
201
- var fieldSchemas = computeShape(Object.values(fields.current), yupTypeMap, validatorRegistry);
119
+ return yup.lazy(function() {
120
+ const fieldSchemas = computeShape(
121
+ Object.values(fields.current).filter(
122
+ (f) => !f.key.includes(".")
123
+ ),
124
+ yupTypeMap,
125
+ validatorRegistry
126
+ );
202
127
  return yup.object().shape(fieldSchemas);
203
128
  });
204
- }
129
+ }
130
+ // Annotate the CommonJS export names for ESM import in node:
131
+ 0 && (module.exports = {
132
+ computeShape,
133
+ getYupField,
134
+ getYupObjectShape,
135
+ ...require("@digigov/form/validators/utils/afm"),
136
+ ...require("@digigov/form/validators/utils/amka"),
137
+ ...require("@digigov/form/validators/utils/file"),
138
+ ...require("@digigov/form/validators/utils/iban"),
139
+ ...require("@digigov/form/validators/utils/otp"),
140
+ ...require("@digigov/form/validators/utils/image"),
141
+ ...require("@digigov/form/validators/utils/phone"),
142
+ ...require("@digigov/form/validators/utils/postal_code"),
143
+ ...require("@digigov/form/validators/utils/uuid4"),
144
+ ...require("@digigov/form/validators/utils/text_limit"),
145
+ ...require("@digigov/form/validators/utils/date"),
146
+ ...require("@digigov/form/validators/utils/datetime")
147
+ });
148
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/validators/utils/index.ts"],
4
+ "sourcesContent": ["import * as yup from 'yup';\nimport { FieldSpec } from '@digigov/form/types';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport * from '@digigov/form/validators/utils/afm';\nexport * from '@digigov/form/validators/utils/amka';\nexport * from '@digigov/form/validators/utils/file';\nexport * from '@digigov/form/validators/utils/iban';\nexport * from '@digigov/form/validators/utils/otp';\nexport * from '@digigov/form/validators/utils/image';\nexport * from '@digigov/form/validators/utils/phone';\nexport * from '@digigov/form/validators/utils/postal_code';\nexport * from '@digigov/form/validators/utils/uuid4';\nexport * from '@digigov/form/validators/utils/text_limit';\nexport * from '@digigov/form/validators/utils/date';\nexport * from '@digigov/form/validators/utils/datetime';\n\nexport function getYupField(field: FieldSpec, yupTypeMap: Record<string, any>) {\n const yupField = yupTypeMap[field?.type || 'string'] || yupTypeMap['string'];\n return yupField(field);\n}\nexport function computeShape(\n fields: FieldSpec[],\n yupTypeMap: Record<string, ValidatorSchema>,\n validatorRegistry: Record<string, ValidatorSchema[]> | undefined\n) {\n const fieldSchemas = {};\n const objectFields: Record<string, FieldSpec[]> = {};\n fields.forEach((field) => {\n let yupField = getYupField(field, yupTypeMap);\n if (field.condition) {\n for (const key in field.condition) {\n let then: any, otherwise: any;\n if (field.condition[key].then) {\n if (field.condition[key].then?.required === false) {\n then = yupField.nullable();\n } else if (field.condition[key].then?.required === true) {\n then = yupField.nullable().required('form.error.required');\n }\n }\n if (field.condition[key].else) {\n if (field.condition[key].else?.required === false) {\n otherwise = yupField.nullable();\n } else if (field.condition[key].else?.required === true) {\n otherwise = yupField.nullable().required('form.error.required');\n }\n }\n if (then || otherwise) {\n yupField = yupField.when(key, {\n is: (val) => {\n //@ts-ignore\n const is = field.condition[key].is;\n if (is === val || (Array.isArray(val) && val.includes(is))) {\n return true;\n } else {\n return false;\n }\n },\n then,\n otherwise,\n });\n }\n }\n } else if (field.required) {\n yupField = yupField.nullable().required('form.error.required');\n }\n if (validatorRegistry && field.type && validatorRegistry[field.type]) {\n validatorRegistry[field.type].forEach((validator: any) => {\n yupField = yupField.test(validator);\n });\n }\n if (field.validators) {\n field.validators.forEach((validator) => {\n yupField = yupField.test(validator);\n });\n }\n fieldSchemas[field.key] = yupField;\n });\n for (const objectKey in objectFields) {\n fieldSchemas[objectKey] = getYupObjectShape(\n objectFields[objectKey],\n yupTypeMap,\n validatorRegistry\n );\n }\n return fieldSchemas;\n}\n\nexport function getYupObjectShape(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fields: FieldSpec[] | any,\n yupTypeMap: Record<string, any>,\n validatorRegistry?: Record<string, ValidatorSchema[]>\n) {\n if (!fields.current) {\n const fieldSchemas = computeShape(fields, yupTypeMap, validatorRegistry);\n return yup.object().shape(fieldSchemas);\n }\n\n return yup.lazy(function () {\n const fieldSchemas = computeShape(\n Object.values(fields.current).filter(\n (f: FieldSpec) => !f.key.includes('.')\n ) as FieldSpec[],\n yupTypeMap,\n validatorRegistry\n );\n return yup.object().shape(fieldSchemas);\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAAqB;AAIrB,0BAAc,+CAJd;AAKA,0BAAc,gDALd;AAMA,0BAAc,gDANd;AAOA,0BAAc,gDAPd;AAQA,0BAAc,+CARd;AASA,0BAAc,iDATd;AAUA,0BAAc,iDAVd;AAWA,0BAAc,uDAXd;AAYA,0BAAc,iDAZd;AAaA,0BAAc,sDAbd;AAcA,0BAAc,gDAdd;AAeA,0BAAc,oDAfd;AAiBO,SAAS,YAAY,OAAkB,YAAiC;AAC7E,QAAM,WAAW,WAAW,OAAO,QAAQ,QAAQ,KAAK,WAAW,QAAQ;AAC3E,SAAO,SAAS,KAAK;AACvB;AACO,SAAS,aACd,QACA,YACA,mBACA;AACA,QAAM,eAAe,CAAC;AACtB,QAAM,eAA4C,CAAC;AACnD,SAAO,QAAQ,CAAC,UAAU;AACxB,QAAI,WAAW,YAAY,OAAO,UAAU;AAC5C,QAAI,MAAM,WAAW;AACnB,iBAAW,OAAO,MAAM,WAAW;AACjC,YAAI,MAAW;AACf,YAAI,MAAM,UAAU,GAAG,EAAE,MAAM;AAC7B,cAAI,MAAM,UAAU,GAAG,EAAE,MAAM,aAAa,OAAO;AACjD,mBAAO,SAAS,SAAS;AAAA,UAC3B,WAAW,MAAM,UAAU,GAAG,EAAE,MAAM,aAAa,MAAM;AACvD,mBAAO,SAAS,SAAS,EAAE,SAAS,qBAAqB;AAAA,UAC3D;AAAA,QACF;AACA,YAAI,MAAM,UAAU,GAAG,EAAE,MAAM;AAC7B,cAAI,MAAM,UAAU,GAAG,EAAE,MAAM,aAAa,OAAO;AACjD,wBAAY,SAAS,SAAS;AAAA,UAChC,WAAW,MAAM,UAAU,GAAG,EAAE,MAAM,aAAa,MAAM;AACvD,wBAAY,SAAS,SAAS,EAAE,SAAS,qBAAqB;AAAA,UAChE;AAAA,QACF;AACA,YAAI,QAAQ,WAAW;AACrB,qBAAW,SAAS,KAAK,KAAK;AAAA,YAC5B,IAAI,CAAC,QAAQ;AAEX,oBAAM,KAAK,MAAM,UAAU,GAAG,EAAE;AAChC,kBAAI,OAAO,OAAQ,MAAM,QAAQ,GAAG,KAAK,IAAI,SAAS,EAAE,GAAI;AAC1D,uBAAO;AAAA,cACT,OAAO;AACL,uBAAO;AAAA,cACT;AAAA,YACF;AAAA,YACA;AAAA,YACA;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,WAAW,MAAM,UAAU;AACzB,iBAAW,SAAS,SAAS,EAAE,SAAS,qBAAqB;AAAA,IAC/D;AACA,QAAI,qBAAqB,MAAM,QAAQ,kBAAkB,MAAM,IAAI,GAAG;AACpE,wBAAkB,MAAM,IAAI,EAAE,QAAQ,CAAC,cAAmB;AACxD,mBAAW,SAAS,KAAK,SAAS;AAAA,MACpC,CAAC;AAAA,IACH;AACA,QAAI,MAAM,YAAY;AACpB,YAAM,WAAW,QAAQ,CAAC,cAAc;AACtC,mBAAW,SAAS,KAAK,SAAS;AAAA,MACpC,CAAC;AAAA,IACH;AACA,iBAAa,MAAM,GAAG,IAAI;AAAA,EAC5B,CAAC;AACD,aAAW,aAAa,cAAc;AACpC,iBAAa,SAAS,IAAI;AAAA,MACxB,aAAa,SAAS;AAAA,MACtB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,kBAEd,QACA,YACA,mBACA;AACA,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,eAAe,aAAa,QAAQ,YAAY,iBAAiB;AACvE,WAAO,IAAI,OAAO,EAAE,MAAM,YAAY;AAAA,EACxC;AAEA,SAAO,IAAI,KAAK,WAAY;AAC1B,UAAM,eAAe;AAAA,MACnB,OAAO,OAAO,OAAO,OAAO,EAAE;AAAA,QAC5B,CAAC,MAAiB,CAAC,EAAE,IAAI,SAAS,GAAG;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,IACF;AACA,WAAO,IAAI,OAAO,EAAE,MAAM,YAAY;AAAA,EACxC,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -1,26 +1,48 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var int_exports = {};
19
+ __export(int_exports, {
20
+ INT_VALIDATOR: () => INT_VALIDATOR,
21
+ validateIntNumber: () => validateIntNumber
5
22
  });
6
- exports.INT_VALIDATOR = void 0;
7
- exports.validateIntNumber = validateIntNumber;
23
+ module.exports = __toCommonJS(int_exports);
8
24
  function validateIntNumber(number) {
9
- if (number === undefined) {
25
+ if (number === void 0) {
10
26
  return false;
11
27
  } else {
12
28
  return Number.isInteger(number) && Number(number) > 0;
13
29
  }
14
30
  }
15
- var INT_VALIDATOR = exports.INT_VALIDATOR = function INT_VALIDATOR() {
31
+ const INT_VALIDATOR = () => {
16
32
  return {
17
- name: 'int-validator',
18
- message: 'form.error.positive_integer_number',
19
- test: function test(value) {
20
- if (value === null) {
33
+ name: "int-validator",
34
+ message: "form.error.positive_integer_number",
35
+ test: (value) => {
36
+ if (value === void 0) {
21
37
  return true;
22
38
  }
23
39
  return validateIntNumber(value);
24
40
  }
25
41
  };
26
- };
42
+ };
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ INT_VALIDATOR,
46
+ validateIntNumber
47
+ });
48
+ //# sourceMappingURL=int.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/validators/utils/int.ts"],
4
+ "sourcesContent": ["import { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport function validateIntNumber(number: number): boolean {\n if (number === undefined) {\n return false;\n } else {\n return Number.isInteger(number) && Number(number) > 0;\n }\n}\n\nexport const INT_VALIDATOR = (): ValidatorSchema => {\n return {\n name: 'int-validator',\n message: 'form.error.positive_integer_number',\n test: (value: number): boolean => {\n if (value === undefined) {\n return true;\n }\n return validateIntNumber(value);\n },\n };\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,kBAAkB,QAAyB;AACzD,MAAI,WAAW,QAAW;AACxB,WAAO;AAAA,EACT,OAAO;AACL,WAAO,OAAO,UAAU,MAAM,KAAK,OAAO,MAAM,IAAI;AAAA,EACtD;AACF;AAEO,MAAM,gBAAgB,MAAuB;AAClD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,CAAC,UAA2B;AAChC,UAAI,UAAU,QAAW;AACvB,eAAO;AAAA,MACT;AACA,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -1,22 +1,44 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var number_exports = {};
19
+ __export(number_exports, {
20
+ NUMBER_VALIDATOR: () => NUMBER_VALIDATOR,
21
+ validateNumber: () => validateNumber
5
22
  });
6
- exports.NUMBER_VALIDATOR = void 0;
7
- exports.validateNumber = validateNumber;
23
+ module.exports = __toCommonJS(number_exports);
8
24
  function validateNumber(number) {
9
25
  return !Number.isNaN(number);
10
26
  }
11
- var NUMBER_VALIDATOR = exports.NUMBER_VALIDATOR = function NUMBER_VALIDATOR() {
27
+ const NUMBER_VALIDATOR = () => {
12
28
  return {
13
- name: 'number-validator',
14
- message: 'form.error.number',
15
- test: function test(value) {
16
- if (value === null) {
29
+ name: "number-validator",
30
+ message: "form.error.number",
31
+ test: (value) => {
32
+ if (value === void 0) {
17
33
  return true;
18
34
  }
19
35
  return validateNumber(value);
20
36
  }
21
37
  };
22
- };
38
+ };
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ NUMBER_VALIDATOR,
42
+ validateNumber
43
+ });
44
+ //# sourceMappingURL=number.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/validators/utils/number.ts"],
4
+ "sourcesContent": ["import { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport function validateNumber(number: number): boolean {\n return !Number.isNaN(number);\n}\n\nexport const NUMBER_VALIDATOR = (): ValidatorSchema => {\n return {\n name: 'number-validator',\n message: 'form.error.number',\n test: (value: number): boolean => {\n if (value === undefined) {\n return true;\n }\n return validateNumber(value);\n },\n };\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,eAAe,QAAyB;AACtD,SAAO,CAAC,OAAO,MAAM,MAAM;AAC7B;AAEO,MAAM,mBAAmB,MAAuB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,CAAC,UAA2B;AAChC,UAAI,UAAU,QAAW;AACvB,eAAO;AAAA,MACT;AACA,aAAO,eAAe,KAAK;AAAA,IAC7B;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -1,10 +1,26 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var otp_exports = {};
19
+ __export(otp_exports, {
20
+ OTP_VALIDATOR: () => OTP_VALIDATOR,
21
+ validateOtp: () => validateOtp
5
22
  });
6
- exports.OTP_VALIDATOR = void 0;
7
- exports.validateOtp = validateOtp;
23
+ module.exports = __toCommonJS(otp_exports);
8
24
  function validateOtp(value, maxLength) {
9
25
  if (value.length === maxLength) {
10
26
  return true;
@@ -12,21 +28,27 @@ function validateOtp(value, maxLength) {
12
28
  return false;
13
29
  }
14
30
  }
15
- var OTP_VALIDATOR = exports.OTP_VALIDATOR = function OTP_VALIDATOR(field) {
16
- var maxLength = field === null || field === void 0 ? void 0 : field.maxLength;
31
+ const OTP_VALIDATOR = (field) => {
32
+ const maxLength = field?.maxLength;
17
33
  return {
18
- name: 'otp-validator',
34
+ name: "otp-validator",
19
35
  message: {
20
- key: 'form.error.otp.less_than',
36
+ key: "form.error.otp.less_than",
21
37
  context: {
22
- maxLength: field === null || field === void 0 ? void 0 : field.maxLength
38
+ maxLength: field?.maxLength
23
39
  }
24
40
  },
25
- test: function test(value) {
41
+ test: (value) => {
26
42
  if (!value) {
27
43
  return true;
28
44
  }
29
45
  return validateOtp(value, maxLength);
30
46
  }
31
47
  };
32
- };
48
+ };
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ OTP_VALIDATOR,
52
+ validateOtp
53
+ });
54
+ //# sourceMappingURL=otp.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/validators/utils/otp.ts"],
4
+ "sourcesContent": ["import { FieldSpec } from '@digigov/form/types';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\nexport function validateOtp(value: string, maxLength: number): boolean {\n if (value.length === maxLength) {\n return true;\n } else {\n return false;\n }\n}\n\nexport const OTP_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const maxLength = field?.maxLength;\n return {\n name: 'otp-validator',\n message: {\n key: 'form.error.otp.less_than',\n context: {\n maxLength: field?.maxLength,\n },\n },\n test: (value: string): boolean => {\n if (!value) {\n return true;\n }\n return validateOtp(value, maxLength as number);\n },\n };\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,YAAY,OAAe,WAA4B;AACrE,MAAI,MAAM,WAAW,WAAW;AAC9B,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAEO,MAAM,gBAAgB,CAAC,UAAsC;AAClE,QAAM,YAAY,OAAO;AACzB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,MACP,KAAK;AAAA,MACL,SAAS;AAAA,QACP,WAAW,OAAO;AAAA,MACpB;AAAA,IACF;AAAA,IACA,MAAM,CAAC,UAA2B;AAChC,UAAI,CAAC,OAAO;AACV,eAAO;AAAA,MACT;AACA,aAAO,YAAY,OAAO,SAAmB;AAAA,IAC/C;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }