@digigov/form 2.0.0-cbc56209 → 2.0.0-d0adc9fb

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 (757) hide show
  1. package/Field/FieldBase/index.js +104 -76
  2. package/Field/FieldBase.js.map +7 -0
  3. package/Field/FieldBaseContainer/index.js +29 -37
  4. package/Field/FieldBaseContainer.js.map +7 -0
  5. package/Field/FieldConditional/index.js +79 -53
  6. package/Field/FieldConditional.js.map +7 -0
  7. package/Field/index.js +107 -63
  8. package/Field/index.js.map +7 -0
  9. package/Field/types/index.js +1 -1
  10. package/Field/types.d.ts +42 -5
  11. package/Field/types.js.map +7 -0
  12. package/Field/utils/calculateField/index.js +27 -0
  13. package/{FieldArray/FieldArray.stories → Field/utils/calculateField}/package.json +1 -1
  14. package/Field/utils/calculateField.d.ts +2 -0
  15. package/Field/utils/calculateField.js.map +7 -0
  16. package/Field/utils/evaluateFieldWithConditions/index.js +26 -0
  17. package/{inputs/DateInput/__stories__/Default → Field/utils/evaluateFieldWithConditions}/package.json +1 -1
  18. package/Field/utils/evaluateFieldWithConditions.d.ts +2 -0
  19. package/Field/utils/evaluateFieldWithConditions.js.map +7 -0
  20. package/Field/utils/index.d.ts +4 -0
  21. package/Field/utils/index.js +47 -116
  22. package/Field/utils/index.js.map +7 -0
  23. package/Field/utils/useField/index.js +57 -0
  24. package/{FormBuilder/FormBuilder → Field/utils/useField}/package.json +1 -1
  25. package/Field/utils/useField.d.ts +2 -0
  26. package/Field/utils/useField.js.map +7 -0
  27. package/FieldArray/FieldArray.stories.d.ts +2 -2
  28. package/FieldArray/FormDialog/index.js +280 -0
  29. package/{validators/validators.spec → FieldArray/FormDialog}/package.json +1 -1
  30. package/FieldArray/FormDialog.d.ts +53 -0
  31. package/FieldArray/FormDialog.js.map +7 -0
  32. package/FieldArray/__stories__/Default.d.ts +2 -2
  33. package/FieldArray/__stories__/WithExactLength.d.ts +2 -2
  34. package/FieldArray/index.d.ts +6 -0
  35. package/FieldArray/index.js +107 -59
  36. package/FieldArray/index.js.map +7 -0
  37. package/FieldArray/index.test.d.ts +1 -0
  38. package/FieldObject/index.d.ts +5 -0
  39. package/FieldObject/index.js +75 -52
  40. package/FieldObject/index.js.map +7 -0
  41. package/Fieldset/FieldsetWithContext/index.js +27 -31
  42. package/Fieldset/FieldsetWithContext.js.map +7 -0
  43. package/Fieldset/index.d.ts +1 -1
  44. package/Fieldset/index.js +27 -29
  45. package/Fieldset/index.js.map +7 -0
  46. package/Fieldset/types/index.js +1 -1
  47. package/Fieldset/types.d.ts +3 -2
  48. package/Fieldset/types.js.map +7 -0
  49. package/FormBuilder/FormBuilder.stories.d.ts +1 -1
  50. package/FormBuilder/__stories__/Default.d.ts +2 -2
  51. package/FormBuilder/index.d.ts +8 -1
  52. package/FormBuilder/index.js +161 -2
  53. package/FormBuilder/index.js.map +7 -0
  54. package/FormBuilder/index.test.d.ts +1 -0
  55. package/FormBuilder/scenarios.test.d.ts +88 -0
  56. package/FormContext/index.js +7 -3
  57. package/FormContext.js.map +7 -0
  58. package/MultiplicityField/MultiplicityField.stories.d.ts +6 -6
  59. package/MultiplicityField/__stories__/Default.d.ts +2 -2
  60. package/MultiplicityField/__stories__/PreviewDisplay.d.ts +2 -2
  61. package/MultiplicityField/__stories__/WithExactLength.d.ts +2 -2
  62. package/MultiplicityField/__stories__/WithMaxLength.d.ts +2 -2
  63. package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +2 -2
  64. package/MultiplicityField/__stories__/WithMinLength.d.ts +2 -2
  65. package/MultiplicityField/add-objects/index.js +137 -132
  66. package/MultiplicityField/add-objects.d.ts +2 -1
  67. package/MultiplicityField/add-objects.js.map +7 -0
  68. package/MultiplicityField/index.d.ts +2 -19
  69. package/MultiplicityField/index.js +113 -106
  70. package/MultiplicityField/index.js.map +7 -0
  71. package/MultiplicityField/index.test.d.ts +1 -0
  72. package/MultiplicityField/types/index.js +1 -0
  73. package/MultiplicityField/types/package.json +6 -0
  74. package/MultiplicityField/types.d.ts +18 -0
  75. package/MultiplicityField/types.js.map +7 -0
  76. package/Questions/Questions/index.js +48 -56
  77. package/Questions/Questions.js.map +7 -0
  78. package/Questions/Questions.stories.d.ts +1 -1
  79. package/Questions/QuestionsContext/index.js +9 -9
  80. package/Questions/QuestionsContext.d.ts +0 -1
  81. package/Questions/QuestionsContext.js.map +7 -0
  82. package/Questions/Step/ReviewStep/index.js +35 -47
  83. package/Questions/Step/ReviewStep.js.map +7 -0
  84. package/Questions/Step/Step/index.js +39 -47
  85. package/Questions/Step/Step.js.map +7 -0
  86. package/Questions/Step/StepArrayReview/index.js +41 -45
  87. package/Questions/Step/StepArrayReview.js.map +7 -0
  88. package/Questions/Step/StepContext/index.js +15 -19
  89. package/Questions/Step/StepContext.d.ts +0 -1
  90. package/Questions/Step/StepContext.js.map +7 -0
  91. package/Questions/Step/StepDescription/index.js +22 -22
  92. package/Questions/Step/StepDescription.js.map +7 -0
  93. package/Questions/Step/StepForm/index.js +33 -43
  94. package/Questions/Step/StepForm.js.map +7 -0
  95. package/Questions/Step/StepQuote/index.js +10 -9
  96. package/Questions/Step/StepQuote.js.map +7 -0
  97. package/Questions/Step/StepTitle/index.js +41 -38
  98. package/Questions/Step/StepTitle.d.ts +2 -1
  99. package/Questions/Step/StepTitle.js.map +7 -0
  100. package/Questions/Step/getAddMoreFields/index.js +28 -20
  101. package/Questions/Step/getAddMoreFields.js.map +7 -0
  102. package/Questions/Step/index.d.ts +0 -1
  103. package/Questions/Step/index.js +16 -13
  104. package/Questions/Step/index.js.map +7 -0
  105. package/Questions/Step/types/index.js +1 -1
  106. package/Questions/Step/types.d.ts +1 -0
  107. package/Questions/Step/types.js.map +7 -0
  108. package/Questions/__stories__/Default.d.ts +2 -2
  109. package/Questions/getNextStep/index.js +12 -10
  110. package/Questions/getNextStep.js.map +7 -0
  111. package/Questions/index.js +7 -3
  112. package/Questions/index.js.map +7 -0
  113. package/Questions/index.test.d.ts +1 -0
  114. package/Questions/types/index.js +1 -1
  115. package/Questions/types.d.ts +1 -0
  116. package/Questions/types.js.map +7 -0
  117. package/cjs/Field/FieldBase/index.js +136 -82
  118. package/cjs/Field/FieldBase.js.map +7 -0
  119. package/cjs/Field/FieldBaseContainer/index.js +61 -43
  120. package/cjs/Field/FieldBaseContainer.js.map +7 -0
  121. package/cjs/Field/FieldConditional/index.js +111 -59
  122. package/cjs/Field/FieldConditional.js.map +7 -0
  123. package/cjs/Field/index.js +136 -72
  124. package/cjs/Field/index.js.map +7 -0
  125. package/cjs/Field/types/index.js +16 -5
  126. package/cjs/Field/types.js.map +7 -0
  127. package/cjs/Field/utils/calculateField/index.js +50 -0
  128. package/cjs/Field/utils/calculateField.js.map +7 -0
  129. package/cjs/Field/utils/evaluateFieldWithConditions/index.js +49 -0
  130. package/cjs/Field/utils/evaluateFieldWithConditions.js.map +7 -0
  131. package/cjs/Field/utils/index.js +91 -139
  132. package/cjs/Field/utils/index.js.map +7 -0
  133. package/cjs/Field/utils/useField/index.js +80 -0
  134. package/cjs/Field/utils/useField.js.map +7 -0
  135. package/cjs/FieldArray/FormDialog/index.js +302 -0
  136. package/cjs/FieldArray/FormDialog.js.map +7 -0
  137. package/cjs/FieldArray/index.js +139 -65
  138. package/cjs/FieldArray/index.js.map +7 -0
  139. package/cjs/FieldObject/index.js +104 -61
  140. package/cjs/FieldObject/index.js.map +7 -0
  141. package/cjs/Fieldset/FieldsetWithContext/index.js +54 -40
  142. package/cjs/Fieldset/FieldsetWithContext.js.map +7 -0
  143. package/cjs/Fieldset/index.js +61 -39
  144. package/cjs/Fieldset/index.js.map +7 -0
  145. package/cjs/Fieldset/types/index.js +16 -5
  146. package/cjs/Fieldset/types.js.map +7 -0
  147. package/cjs/FormBuilder/index.js +197 -8
  148. package/cjs/FormBuilder/index.js.map +7 -0
  149. package/cjs/FormContext/index.js +29 -8
  150. package/cjs/FormContext.js.map +7 -0
  151. package/cjs/MultiplicityField/add-objects/index.js +164 -138
  152. package/cjs/MultiplicityField/add-objects.js.map +7 -0
  153. package/cjs/MultiplicityField/index.js +141 -115
  154. package/cjs/MultiplicityField/index.js.map +7 -0
  155. package/cjs/MultiplicityField/types/index.js +16 -0
  156. package/cjs/MultiplicityField/types.js.map +7 -0
  157. package/cjs/Questions/Questions/index.js +80 -65
  158. package/cjs/Questions/Questions.js.map +7 -0
  159. package/cjs/Questions/QuestionsContext/index.js +31 -14
  160. package/cjs/Questions/QuestionsContext.js.map +7 -0
  161. package/cjs/Questions/Step/ReviewStep/index.js +61 -56
  162. package/cjs/Questions/Step/ReviewStep.js.map +7 -0
  163. package/cjs/Questions/Step/Step/index.js +71 -56
  164. package/cjs/Questions/Step/Step.js.map +7 -0
  165. package/cjs/Questions/Step/StepArrayReview/index.js +65 -54
  166. package/cjs/Questions/Step/StepArrayReview.js.map +7 -0
  167. package/cjs/Questions/Step/StepContext/index.js +37 -24
  168. package/cjs/Questions/Step/StepContext.js.map +7 -0
  169. package/cjs/Questions/Step/StepDescription/index.js +55 -31
  170. package/cjs/Questions/Step/StepDescription.js.map +7 -0
  171. package/cjs/Questions/Step/StepForm/index.js +65 -52
  172. package/cjs/Questions/Step/StepForm.js.map +7 -0
  173. package/cjs/Questions/Step/StepQuote/index.js +42 -15
  174. package/cjs/Questions/Step/StepQuote.js.map +7 -0
  175. package/cjs/Questions/Step/StepTitle/index.js +72 -47
  176. package/cjs/Questions/Step/StepTitle.js.map +7 -0
  177. package/cjs/Questions/Step/getAddMoreFields/index.js +50 -25
  178. package/cjs/Questions/Step/getAddMoreFields.js.map +7 -0
  179. package/cjs/Questions/Step/index.js +59 -143
  180. package/cjs/Questions/Step/index.js.map +7 -0
  181. package/cjs/Questions/Step/types/index.js +16 -5
  182. package/cjs/Questions/Step/types.js.map +7 -0
  183. package/cjs/Questions/getNextStep/index.js +33 -14
  184. package/cjs/Questions/getNextStep.js.map +7 -0
  185. package/cjs/Questions/index.js +29 -19
  186. package/cjs/Questions/index.js.map +7 -0
  187. package/cjs/Questions/types/index.js +16 -5
  188. package/cjs/Questions/types.js.map +7 -0
  189. package/cjs/index.js +47 -20
  190. package/cjs/index.js.map +7 -0
  191. package/cjs/inputs/AutoCompleteInput/index.js +92 -46
  192. package/cjs/inputs/AutoCompleteInput/index.js.map +7 -0
  193. package/cjs/inputs/Checkboxes/index.js +101 -96
  194. package/cjs/inputs/Checkboxes/index.js.map +7 -0
  195. package/cjs/inputs/DateInput/index.js +121 -109
  196. package/cjs/inputs/DateInput/index.js.map +7 -0
  197. package/cjs/inputs/DateTimeInput/index.js +206 -0
  198. package/cjs/inputs/DateTimeInput/index.js.map +7 -0
  199. package/cjs/inputs/FileInput/index.js +75 -63
  200. package/cjs/inputs/FileInput/index.js.map +7 -0
  201. package/cjs/inputs/ImageInput/index.js +95 -83
  202. package/cjs/inputs/ImageInput/index.js.map +7 -0
  203. package/cjs/inputs/Input/index.js +104 -71
  204. package/cjs/inputs/Input/index.js.map +7 -0
  205. package/cjs/inputs/Input/inputsInputScenarios/index.js +439 -0
  206. package/cjs/inputs/Input/inputsInputScenarios.js.map +7 -0
  207. package/cjs/inputs/Label/index.js +45 -24
  208. package/cjs/inputs/Label/index.js.map +7 -0
  209. package/cjs/inputs/OtpInput/index.js +142 -112
  210. package/cjs/inputs/OtpInput/index.js.map +7 -0
  211. package/cjs/inputs/Radio/index.js +131 -61
  212. package/cjs/inputs/Radio/index.js.map +7 -0
  213. package/cjs/inputs/Select/index.js +59 -36
  214. package/cjs/inputs/Select/index.js.map +7 -0
  215. package/cjs/inputs/index.js +62 -69
  216. package/cjs/inputs/index.js.map +7 -0
  217. package/cjs/inputs/inputsScenarios/index.js +533 -0
  218. package/cjs/inputs/inputsScenarios.js.map +7 -0
  219. package/cjs/internal/index.js +36 -346
  220. package/cjs/internal.js.map +7 -0
  221. package/cjs/lazy/index.js +107 -516
  222. package/cjs/lazy.js.map +7 -0
  223. package/cjs/locales/el/index.js +35 -0
  224. package/cjs/locales/el.js.map +7 -0
  225. package/cjs/registry/index.js +188 -142
  226. package/cjs/registry.js.map +7 -0
  227. package/cjs/types/index.js +22 -5
  228. package/cjs/types.js.map +7 -0
  229. package/cjs/utils/index.js +79 -83
  230. package/cjs/utils.js.map +7 -0
  231. package/cjs/validators/index.js +124 -163
  232. package/cjs/validators/index.js.map +7 -0
  233. package/cjs/validators/types/index.js +16 -5
  234. package/cjs/validators/types.js.map +7 -0
  235. package/cjs/validators/utils/afm/index.js +38 -21
  236. package/cjs/validators/utils/afm.js.map +7 -0
  237. package/cjs/validators/utils/date/index.js +138 -0
  238. package/cjs/validators/utils/date.js.map +7 -0
  239. package/cjs/validators/utils/datetime/index.js +151 -0
  240. package/cjs/validators/utils/datetime.js.map +7 -0
  241. package/cjs/validators/utils/file/index.js +44 -47
  242. package/cjs/validators/utils/file.js.map +7 -0
  243. package/cjs/validators/utils/iban/index.js +36 -17
  244. package/cjs/validators/utils/iban.js.map +7 -0
  245. package/cjs/validators/utils/image/index.js +88 -112
  246. package/cjs/validators/utils/image.js.map +7 -0
  247. package/cjs/validators/utils/index.js +99 -159
  248. package/cjs/validators/utils/index.js.map +7 -0
  249. package/cjs/validators/utils/int/index.js +34 -12
  250. package/cjs/validators/utils/int.js.map +7 -0
  251. package/cjs/validators/utils/number/index.js +33 -11
  252. package/cjs/validators/utils/number.js.map +7 -0
  253. package/cjs/validators/utils/otp/index.js +35 -13
  254. package/cjs/validators/utils/otp.js.map +7 -0
  255. package/cjs/validators/utils/phone/index.js +113 -58
  256. package/cjs/validators/utils/phone.js.map +7 -0
  257. package/cjs/validators/utils/postal_code/index.js +36 -16
  258. package/cjs/validators/utils/postal_code.js.map +7 -0
  259. package/cjs/validators/utils/text_limit/index.js +40 -25
  260. package/cjs/validators/utils/text_limit.js.map +7 -0
  261. package/cjs/validators/utils/uuid4/index.js +34 -13
  262. package/cjs/validators/utils/uuid4.js.map +7 -0
  263. package/index.d.ts +4 -1
  264. package/index.js +13 -4
  265. package/index.js.map +7 -0
  266. package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +2 -1
  267. package/inputs/AutoCompleteInput/__stories__/Default.d.ts +3 -2
  268. package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +3 -0
  269. package/inputs/AutoCompleteInput/index.d.ts +2 -2
  270. package/inputs/AutoCompleteInput/index.js +62 -37
  271. package/inputs/AutoCompleteInput/index.js.map +7 -0
  272. package/inputs/AutoCompleteInput/index.test.d.ts +1 -0
  273. package/inputs/Checkboxes/Checkboxes.stories.d.ts +3 -3
  274. package/inputs/Checkboxes/__stories__/Conditional.d.ts +3 -2
  275. package/inputs/Checkboxes/__stories__/Default.d.ts +2 -2
  276. package/inputs/Checkboxes/__stories__/WithDivider.d.ts +2 -2
  277. package/inputs/Checkboxes/index.d.ts +2 -1
  278. package/inputs/Checkboxes/index.js +73 -87
  279. package/inputs/Checkboxes/index.js.map +7 -0
  280. package/inputs/Checkboxes/index.test.d.ts +1 -0
  281. package/inputs/DateInput/DateInput.stories.d.ts +1 -1
  282. package/inputs/DateInput/__stories__/Default.d.ts +2 -2
  283. package/inputs/DateInput/index.d.ts +3 -4
  284. package/inputs/DateInput/index.js +91 -99
  285. package/inputs/DateInput/index.js.map +7 -0
  286. package/inputs/DateInput/index.test.d.ts +1 -0
  287. package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +7 -0
  288. package/inputs/DateTimeInput/__stories__/Default.d.ts +3 -0
  289. package/inputs/DateTimeInput/index.d.ts +13 -0
  290. package/inputs/DateTimeInput/index.js +176 -0
  291. package/inputs/DateTimeInput/index.js.map +7 -0
  292. package/inputs/DateTimeInput/index.test.d.ts +1 -0
  293. package/{Questions/index.spec → inputs/DateTimeInput}/package.json +1 -1
  294. package/inputs/FileInput/FileInput.stories.d.ts +1 -1
  295. package/inputs/FileInput/__stories__/Default.d.ts +2 -2
  296. package/inputs/FileInput/index.js +43 -54
  297. package/inputs/FileInput/index.js.map +7 -0
  298. package/inputs/FileInput/index.test.d.ts +1 -0
  299. package/inputs/ImageInput/ImageInput.stories.d.ts +3 -3
  300. package/inputs/ImageInput/__stories__/Default.d.ts +2 -2
  301. package/inputs/ImageInput/__stories__/MaxSize.d.ts +3 -0
  302. package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +2 -2
  303. package/inputs/ImageInput/__stories__/WithInvalidImageSize.d.ts +2 -2
  304. package/inputs/ImageInput/index.js +63 -75
  305. package/inputs/ImageInput/index.js.map +7 -0
  306. package/inputs/ImageInput/index.test.d.ts +1 -0
  307. package/inputs/Input/Input.stories.d.ts +10 -10
  308. package/inputs/Input/__stories__/AFM.d.ts +2 -2
  309. package/inputs/Input/__stories__/Boolean.d.ts +2 -2
  310. package/inputs/Input/__stories__/IBAN.d.ts +2 -2
  311. package/inputs/Input/__stories__/Integer.d.ts +2 -2
  312. package/inputs/Input/__stories__/LandlineNumber.d.ts +2 -2
  313. package/inputs/Input/__stories__/MobilePhone.d.ts +2 -2
  314. package/inputs/Input/__stories__/PhoneNumber.d.ts +2 -2
  315. package/inputs/Input/__stories__/PostalCode.d.ts +2 -2
  316. package/inputs/Input/__stories__/String.d.ts +3 -0
  317. package/inputs/Input/__stories__/TextWithLimit.d.ts +3 -0
  318. package/inputs/Input/index.js +73 -66
  319. package/inputs/Input/index.js.map +7 -0
  320. package/inputs/Input/index.test.d.ts +1 -0
  321. package/inputs/Input/inputsInputScenarios/index.js +406 -0
  322. package/{FieldArray/__stories__/Default → inputs/Input/inputsInputScenarios}/package.json +1 -1
  323. package/inputs/Input/inputsInputScenarios.d.ts +57 -0
  324. package/inputs/Input/inputsInputScenarios.js.map +7 -0
  325. package/inputs/Label/Label.stories.d.ts +1 -1
  326. package/inputs/Label/__stories__/Default.d.ts +2 -2
  327. package/inputs/Label/index.d.ts +1 -3
  328. package/inputs/Label/index.js +12 -17
  329. package/inputs/Label/index.js.map +7 -0
  330. package/inputs/Label/index.test.d.ts +1 -0
  331. package/inputs/OtpInput/OtpInput.stories.d.ts +1 -1
  332. package/inputs/OtpInput/__stories__/Default.d.ts +2 -2
  333. package/inputs/OtpInput/index.d.ts +9 -2
  334. package/inputs/OtpInput/index.js +109 -103
  335. package/inputs/OtpInput/index.js.map +7 -0
  336. package/inputs/OtpInput/index.test.d.ts +1 -0
  337. package/inputs/Radio/Radio.stories.d.ts +3 -3
  338. package/inputs/Radio/__stories__/Conditional.d.ts +3 -2
  339. package/inputs/Radio/__stories__/Default.d.ts +2 -2
  340. package/inputs/Radio/__stories__/WithDivider.d.ts +2 -2
  341. package/inputs/Radio/index.d.ts +6 -1
  342. package/inputs/Radio/index.js +102 -55
  343. package/inputs/Radio/index.js.map +7 -0
  344. package/inputs/Radio/index.test.d.ts +1 -0
  345. package/inputs/Select/Select.stories.d.ts +1 -1
  346. package/inputs/Select/__stories__/Default.d.ts +2 -2
  347. package/inputs/Select/index.d.ts +1 -1
  348. package/inputs/Select/index.js +31 -31
  349. package/inputs/Select/index.js.map +7 -0
  350. package/inputs/Select/index.test.d.ts +1 -0
  351. package/inputs/index.js +21 -9
  352. package/inputs/index.js.map +7 -0
  353. package/inputs/inputsScenarios/index.js +499 -0
  354. package/inputs/inputsScenarios/package.json +6 -0
  355. package/inputs/inputsScenarios.d.ts +296 -0
  356. package/inputs/inputsScenarios.js.map +7 -0
  357. package/internal/index.js +10 -34
  358. package/internal.d.ts +2 -31
  359. package/internal.js.map +7 -0
  360. package/lazy/index.js +73 -393
  361. package/locales/el/index.js +6 -0
  362. package/{Form.stories → locales/el}/package.json +1 -1
  363. package/locales/el.d.ts +2 -0
  364. package/locales/el.js.map +7 -0
  365. package/package.json +7 -8
  366. package/registry/index.js +124 -99
  367. package/src/Field/FieldBase.tsx +3 -0
  368. package/src/Field/FieldBaseContainer.tsx +4 -2
  369. package/src/Field/FieldConditional.tsx +5 -1
  370. package/src/Field/index.tsx +27 -3
  371. package/src/Field/types.tsx +71 -5
  372. package/src/Field/utils/calculateField.ts +49 -0
  373. package/src/Field/utils/evaluateFieldWithConditions.ts +30 -0
  374. package/src/Field/utils/index.ts +82 -0
  375. package/src/Field/utils/useField.ts +58 -0
  376. package/src/FieldArray/FieldArray.stories.js +2 -2
  377. package/src/FieldArray/FormDialog.tsx +379 -0
  378. package/src/FieldArray/__stories__/Default.tsx +1 -0
  379. package/src/FieldArray/__stories__/WithExactLength.tsx +77 -13
  380. package/src/FieldArray/index.test.tsx +24 -0
  381. package/src/FieldArray/index.tsx +91 -39
  382. package/src/FieldObject/index.tsx +28 -8
  383. package/src/Fieldset/index.tsx +5 -5
  384. package/src/Fieldset/types.tsx +5 -3
  385. package/src/FormBuilder/FormBuilder.stories.js +1 -1
  386. package/{FormBuilder/FormBuilder.mdx → src/FormBuilder/doc.mdx} +20 -33
  387. package/src/FormBuilder/index.test.tsx +20 -0
  388. package/src/FormBuilder/index.tsx +180 -1
  389. package/src/FormBuilder/scenarios.test.tsx +1864 -0
  390. package/src/FormContext.tsx +1 -2
  391. package/src/MultiplicityField/MultiplicityField.stories.js +6 -6
  392. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +2 -2
  393. package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
  394. package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
  395. package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
  396. package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
  397. package/src/MultiplicityField/add-objects.tsx +31 -15
  398. package/{MultiplicityField/MultiplicityField.mdx → src/MultiplicityField/doc.mdx} +12 -16
  399. package/src/MultiplicityField/index.test.tsx +40 -0
  400. package/src/MultiplicityField/index.tsx +21 -35
  401. package/src/MultiplicityField/types.ts +21 -0
  402. package/src/Questions/Questions.stories.js +1 -1
  403. package/src/Questions/Questions.tsx +4 -4
  404. package/src/Questions/Step/StepArrayReview.tsx +1 -1
  405. package/src/Questions/Step/StepTitle.tsx +5 -3
  406. package/src/Questions/Step/index.ts +0 -1
  407. package/src/Questions/Step/types.tsx +1 -0
  408. package/src/Questions/__snapshots__/index.spec.tsx.snap +72 -587
  409. package/src/Questions/{index.mdx → doc.mdx} +13 -16
  410. package/src/Questions/index.spec.tsx +9 -5
  411. package/src/Questions/index.test.tsx +20 -0
  412. package/src/Questions/types.tsx +1 -0
  413. package/src/create-simple-form.mdx +2 -6
  414. package/{index.mdx → src/doc.mdx} +4 -8
  415. package/src/index.ts +4 -1
  416. package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +2 -1
  417. package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +19 -18
  418. package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +47 -0
  419. package/src/inputs/AutoCompleteInput/doc.mdx +18 -0
  420. package/src/inputs/AutoCompleteInput/index.test.tsx +24 -0
  421. package/src/inputs/AutoCompleteInput/index.tsx +46 -29
  422. package/src/inputs/Checkboxes/Checkboxes.stories.js +3 -3
  423. package/src/inputs/Checkboxes/__stories__/Conditional.tsx +2 -3
  424. package/src/inputs/Checkboxes/doc.mdx +23 -0
  425. package/src/inputs/Checkboxes/index.test.tsx +28 -0
  426. package/src/inputs/Checkboxes/index.tsx +39 -33
  427. package/src/inputs/DateInput/DateInput.stories.js +1 -1
  428. package/src/inputs/DateInput/__stories__/Default.tsx +16 -15
  429. package/src/inputs/DateInput/doc.mdx +16 -0
  430. package/src/inputs/DateInput/index.test.tsx +20 -0
  431. package/src/inputs/DateInput/index.tsx +11 -9
  432. package/src/inputs/DateTimeInput/DateTimeInput.stories.js +8 -0
  433. package/src/inputs/DateTimeInput/__stories__/Default.tsx +25 -0
  434. package/src/inputs/DateTimeInput/doc.mdx +16 -0
  435. package/src/inputs/DateTimeInput/index.test.tsx +18 -0
  436. package/src/inputs/DateTimeInput/index.tsx +189 -0
  437. package/src/inputs/FileInput/FileInput.stories.js +1 -1
  438. package/src/inputs/FileInput/doc.mdx +15 -0
  439. package/src/inputs/FileInput/index.test.tsx +20 -0
  440. package/src/inputs/FileInput/index.tsx +8 -9
  441. package/src/inputs/ImageInput/ImageInput.stories.js +3 -3
  442. package/src/inputs/ImageInput/__stories__/MaxSize.tsx +37 -0
  443. package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +2 -0
  444. package/src/inputs/ImageInput/doc.mdx +23 -0
  445. package/src/inputs/ImageInput/index.test.tsx +32 -0
  446. package/src/inputs/ImageInput/index.tsx +16 -16
  447. package/src/inputs/Input/Input.stories.js +10 -10
  448. package/src/inputs/Input/__stories__/LandlineNumber.tsx +2 -1
  449. package/src/inputs/Input/__stories__/MobilePhone.tsx +1 -0
  450. package/src/inputs/Input/__stories__/PhoneNumber.tsx +1 -0
  451. package/src/inputs/Input/__stories__/PostalCode.tsx +1 -0
  452. package/src/inputs/Input/__stories__/{Default.tsx → String.tsx} +2 -2
  453. package/src/inputs/Input/__stories__/{TextWithCharacterLimit.tsx → TextWithLimit.tsx} +2 -2
  454. package/src/inputs/Input/doc.mdx +56 -0
  455. package/src/inputs/Input/index.test.tsx +56 -0
  456. package/src/inputs/Input/index.tsx +39 -30
  457. package/src/inputs/Input/inputsInputScenarios.ts +404 -0
  458. package/src/inputs/Label/Label.stories.js +1 -1
  459. package/src/inputs/Label/__stories__/Default.tsx +3 -1
  460. package/src/inputs/Label/doc.mdx +14 -0
  461. package/src/inputs/Label/index.test.tsx +20 -0
  462. package/src/inputs/Label/index.tsx +3 -10
  463. package/src/inputs/OtpInput/OtpInput.stories.js +1 -1
  464. package/src/inputs/OtpInput/doc.mdx +16 -0
  465. package/src/inputs/OtpInput/index.test.tsx +20 -0
  466. package/src/inputs/OtpInput/index.tsx +4 -3
  467. package/src/inputs/Radio/Radio.stories.js +3 -3
  468. package/src/inputs/Radio/__stories__/Conditional.tsx +4 -1
  469. package/src/inputs/Radio/doc.mdx +23 -0
  470. package/src/inputs/Radio/index.test.tsx +28 -0
  471. package/src/inputs/Radio/index.tsx +79 -9
  472. package/src/inputs/Select/Select.stories.js +1 -1
  473. package/src/inputs/Select/doc.mdx +13 -0
  474. package/src/inputs/Select/index.test.tsx +20 -0
  475. package/src/inputs/Select/index.tsx +11 -4
  476. package/src/inputs/inputsScenarios.ts +496 -0
  477. package/src/installation.mdx +2 -5
  478. package/src/internal.ts +2 -31
  479. package/src/lazy.js +74 -59
  480. package/src/locales/el.ts +3 -0
  481. package/src/registry.js +107 -89
  482. package/src/types.tsx +11 -64
  483. package/src/utils.ts +34 -33
  484. package/src/validators/index.ts +60 -79
  485. package/src/validators/utils/date.ts +107 -0
  486. package/src/validators/utils/datetime.ts +130 -0
  487. package/src/validators/utils/file.ts +11 -9
  488. package/src/validators/utils/index.ts +2 -0
  489. package/src/validators/utils/phone.ts +63 -72
  490. package/src/validators/utils/postal_code.ts +1 -1
  491. package/src/validators/utils/uuid4.ts +2 -1
  492. package/src/validators/validators.spec.ts +6 -40
  493. package/types/index.js +2 -1
  494. package/types.d.ts +6 -35
  495. package/types.js.map +7 -0
  496. package/utils/index.js +57 -77
  497. package/utils.js.map +7 -0
  498. package/validators/index.js +104 -148
  499. package/validators/index.js.map +7 -0
  500. package/validators/types/index.js +1 -1
  501. package/validators/types.js.map +7 -0
  502. package/validators/utils/afm/index.js +16 -16
  503. package/validators/utils/afm.js.map +7 -0
  504. package/validators/utils/date/index.js +103 -0
  505. package/validators/utils/date/package.json +6 -0
  506. package/validators/utils/date.d.ts +9 -0
  507. package/validators/utils/date.js.map +7 -0
  508. package/validators/utils/datetime/index.js +116 -0
  509. package/{Questions/Questions.stories → validators/utils/datetime}/package.json +1 -1
  510. package/validators/utils/datetime.d.ts +9 -0
  511. package/validators/utils/datetime.js.map +7 -0
  512. package/validators/utils/file/index.js +22 -42
  513. package/validators/utils/file.js.map +7 -0
  514. package/validators/utils/iban/index.js +14 -12
  515. package/validators/utils/iban.js.map +7 -0
  516. package/validators/utils/image/index.js +66 -106
  517. package/validators/utils/image.js.map +7 -0
  518. package/validators/utils/index.d.ts +2 -0
  519. package/validators/utils/index.js +56 -48
  520. package/validators/utils/index.js.map +7 -0
  521. package/validators/utils/int/index.js +12 -7
  522. package/validators/utils/int.js.map +7 -0
  523. package/validators/utils/number/index.js +11 -6
  524. package/validators/utils/number.js.map +7 -0
  525. package/validators/utils/otp/index.js +13 -8
  526. package/validators/utils/otp.js.map +7 -0
  527. package/validators/utils/phone/index.js +89 -51
  528. package/validators/utils/phone.d.ts +1 -1
  529. package/validators/utils/phone.js.map +7 -0
  530. package/validators/utils/postal_code/index.js +14 -11
  531. package/validators/utils/postal_code.d.ts +1 -1
  532. package/validators/utils/postal_code.js.map +7 -0
  533. package/validators/utils/text_limit/index.js +18 -20
  534. package/validators/utils/text_limit.js.map +7 -0
  535. package/validators/utils/uuid4/index.js +12 -8
  536. package/validators/utils/uuid4.js.map +7 -0
  537. package/Field/utils.d.ts +0 -5
  538. package/FieldArray/FieldArray.stories/index.js +0 -8
  539. package/FieldArray/FieldArray.stories.playwright.json +0 -353
  540. package/FieldArray/__stories__/Default/index.js +0 -88
  541. package/FieldArray/__stories__/WithExactLength/index.js +0 -88
  542. package/FieldArray/__stories__/WithExactLength/package.json +0 -6
  543. package/Form.stories/index.js +0 -3
  544. package/FormBuilder/FormBuilder/index.js +0 -152
  545. package/FormBuilder/FormBuilder.d.ts +0 -5
  546. package/FormBuilder/FormBuilder.stories/index.js +0 -7
  547. package/FormBuilder/FormBuilder.stories/package.json +0 -6
  548. package/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  549. package/FormBuilder/__stories__/Default/index.js +0 -26
  550. package/FormBuilder/__stories__/Default/package.json +0 -6
  551. package/MultiplicityField/MultiplicityField.stories/index.js +0 -12
  552. package/MultiplicityField/MultiplicityField.stories/package.json +0 -6
  553. package/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  554. package/MultiplicityField/__stories__/Default/index.js +0 -95
  555. package/MultiplicityField/__stories__/Default/package.json +0 -6
  556. package/MultiplicityField/__stories__/PreviewDisplay/index.js +0 -72
  557. package/MultiplicityField/__stories__/PreviewDisplay/package.json +0 -6
  558. package/MultiplicityField/__stories__/WithExactLength/index.js +0 -90
  559. package/MultiplicityField/__stories__/WithExactLength/package.json +0 -6
  560. package/MultiplicityField/__stories__/WithMaxLength/index.js +0 -93
  561. package/MultiplicityField/__stories__/WithMaxLength/package.json +0 -6
  562. package/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +0 -94
  563. package/MultiplicityField/__stories__/WithMinAndMaxLength/package.json +0 -6
  564. package/MultiplicityField/__stories__/WithMinLength/index.js +0 -93
  565. package/MultiplicityField/__stories__/WithMinLength/package.json +0 -6
  566. package/Questions/Questions.stories/index.js +0 -7
  567. package/Questions/__snapshots__/index.spec.tsx.snap +0 -596
  568. package/Questions/__stories__/Default/index.js +0 -102
  569. package/Questions/__stories__/Default/package.json +0 -6
  570. package/Questions/index.mdx +0 -415
  571. package/Questions/index.spec/index.js +0 -59
  572. package/cjs/Field/index.mdx +0 -6
  573. package/cjs/FieldArray/FieldArray.stories/index.js +0 -38
  574. package/cjs/FieldArray/FieldArray.stories.playwright.json +0 -353
  575. package/cjs/FieldArray/__stories__/Default/index.js +0 -98
  576. package/cjs/FieldArray/__stories__/WithExactLength/index.js +0 -98
  577. package/cjs/Form.stories/index.js +0 -9
  578. package/cjs/FormBuilder/FormBuilder/index.js +0 -162
  579. package/cjs/FormBuilder/FormBuilder.mdx +0 -256
  580. package/cjs/FormBuilder/FormBuilder.stories/index.js +0 -26
  581. package/cjs/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  582. package/cjs/FormBuilder/__stories__/Default/index.js +0 -36
  583. package/cjs/MultiplicityField/MultiplicityField.mdx +0 -590
  584. package/cjs/MultiplicityField/MultiplicityField.stories/index.js +0 -86
  585. package/cjs/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  586. package/cjs/MultiplicityField/__stories__/Default/index.js +0 -105
  587. package/cjs/MultiplicityField/__stories__/PreviewDisplay/index.js +0 -82
  588. package/cjs/MultiplicityField/__stories__/WithExactLength/index.js +0 -100
  589. package/cjs/MultiplicityField/__stories__/WithMaxLength/index.js +0 -103
  590. package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +0 -104
  591. package/cjs/MultiplicityField/__stories__/WithMinLength/index.js +0 -103
  592. package/cjs/Questions/Questions.stories/index.js +0 -26
  593. package/cjs/Questions/__snapshots__/index.spec.tsx.snap +0 -596
  594. package/cjs/Questions/__stories__/Default/index.js +0 -113
  595. package/cjs/Questions/index.mdx +0 -415
  596. package/cjs/Questions/index.spec/index.js +0 -63
  597. package/cjs/create-simple-form.mdx +0 -539
  598. package/cjs/index.mdx +0 -51
  599. package/cjs/inputs/AutoCompleteInput/AutoComplete.stories/index.js +0 -26
  600. package/cjs/inputs/AutoCompleteInput/__stories__/Default/index.js +0 -56
  601. package/cjs/inputs/Checkboxes/Checkboxes.stories/index.js +0 -50
  602. package/cjs/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  603. package/cjs/inputs/Checkboxes/__stories__/Conditional/index.js +0 -102
  604. package/cjs/inputs/Checkboxes/__stories__/Default/index.js +0 -50
  605. package/cjs/inputs/Checkboxes/__stories__/WithDivider/index.js +0 -51
  606. package/cjs/inputs/Checkboxes/index.mdx +0 -0
  607. package/cjs/inputs/DateInput/DateInput.stories/index.js +0 -26
  608. package/cjs/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  609. package/cjs/inputs/DateInput/__stories__/Default/index.js +0 -33
  610. package/cjs/inputs/FileInput/FileInput.stories/index.js +0 -26
  611. package/cjs/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  612. package/cjs/inputs/FileInput/__stories__/Default/index.js +0 -30
  613. package/cjs/inputs/ImageInput/ImageInput.stories/index.js +0 -50
  614. package/cjs/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  615. package/cjs/inputs/ImageInput/__stories__/Default/index.js +0 -38
  616. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +0 -46
  617. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +0 -43
  618. package/cjs/inputs/Input/Input.stories/index.js +0 -134
  619. package/cjs/inputs/Input/Input.stories.playwright.json +0 -376
  620. package/cjs/inputs/Input/__stories__/AFM/index.js +0 -32
  621. package/cjs/inputs/Input/__stories__/Boolean/index.js +0 -33
  622. package/cjs/inputs/Input/__stories__/Default/index.js +0 -33
  623. package/cjs/inputs/Input/__stories__/IBAN/index.js +0 -33
  624. package/cjs/inputs/Input/__stories__/Integer/index.js +0 -41
  625. package/cjs/inputs/Input/__stories__/LandlineNumber/index.js +0 -36
  626. package/cjs/inputs/Input/__stories__/MobilePhone/index.js +0 -36
  627. package/cjs/inputs/Input/__stories__/PhoneNumber/index.js +0 -35
  628. package/cjs/inputs/Input/__stories__/PostalCode/index.js +0 -35
  629. package/cjs/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -39
  630. package/cjs/inputs/Input/index.mdx +0 -8
  631. package/cjs/inputs/Label/Label.stories/index.js +0 -26
  632. package/cjs/inputs/Label/Label.stories.playwright.json +0 -40
  633. package/cjs/inputs/Label/__stories__/Default/index.js +0 -37
  634. package/cjs/inputs/Label/index.mdx +0 -0
  635. package/cjs/inputs/OtpInput/OtpInput.stories/index.js +0 -26
  636. package/cjs/inputs/OtpInput/__stories__/Default/index.js +0 -39
  637. package/cjs/inputs/Radio/Radio.stories/index.js +0 -50
  638. package/cjs/inputs/Radio/Radio.stories.playwright.json +0 -73
  639. package/cjs/inputs/Radio/__stories__/Conditional/index.js +0 -102
  640. package/cjs/inputs/Radio/__stories__/Default/index.js +0 -55
  641. package/cjs/inputs/Radio/__stories__/WithDivider/index.js +0 -56
  642. package/cjs/inputs/Radio/index.mdx +0 -0
  643. package/cjs/inputs/Select/Select.stories/index.js +0 -26
  644. package/cjs/inputs/Select/Select.stories.playwright.json +0 -22
  645. package/cjs/inputs/Select/__stories__/Default/index.js +0 -61
  646. package/cjs/installation.mdx +0 -68
  647. package/cjs/validators/validators.spec/index.js +0 -87
  648. package/create-simple-form.mdx +0 -539
  649. package/inputs/AutoCompleteInput/AutoComplete.stories/index.js +0 -7
  650. package/inputs/AutoCompleteInput/AutoComplete.stories/package.json +0 -6
  651. package/inputs/AutoCompleteInput/__stories__/Default/index.js +0 -46
  652. package/inputs/AutoCompleteInput/__stories__/Default/package.json +0 -6
  653. package/inputs/Checkboxes/Checkboxes.stories/index.js +0 -9
  654. package/inputs/Checkboxes/Checkboxes.stories/package.json +0 -6
  655. package/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  656. package/inputs/Checkboxes/__stories__/Conditional/index.js +0 -92
  657. package/inputs/Checkboxes/__stories__/Conditional/package.json +0 -6
  658. package/inputs/Checkboxes/__stories__/Default/index.js +0 -40
  659. package/inputs/Checkboxes/__stories__/Default/package.json +0 -6
  660. package/inputs/Checkboxes/__stories__/WithDivider/index.js +0 -41
  661. package/inputs/Checkboxes/__stories__/WithDivider/package.json +0 -6
  662. package/inputs/Checkboxes/index.mdx +0 -0
  663. package/inputs/DateInput/DateInput.stories/index.js +0 -7
  664. package/inputs/DateInput/DateInput.stories/package.json +0 -6
  665. package/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  666. package/inputs/DateInput/__stories__/Default/index.js +0 -23
  667. package/inputs/FileInput/FileInput.stories/index.js +0 -7
  668. package/inputs/FileInput/FileInput.stories/package.json +0 -6
  669. package/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  670. package/inputs/FileInput/__stories__/Default/index.js +0 -20
  671. package/inputs/FileInput/__stories__/Default/package.json +0 -6
  672. package/inputs/ImageInput/ImageInput.stories/index.js +0 -9
  673. package/inputs/ImageInput/ImageInput.stories/package.json +0 -6
  674. package/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  675. package/inputs/ImageInput/__stories__/Default/index.js +0 -28
  676. package/inputs/ImageInput/__stories__/Default/package.json +0 -6
  677. package/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +0 -36
  678. package/inputs/ImageInput/__stories__/WithInvalidImageDimension/package.json +0 -6
  679. package/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +0 -33
  680. package/inputs/ImageInput/__stories__/WithInvalidImageSize/package.json +0 -6
  681. package/inputs/Input/Input.stories/index.js +0 -16
  682. package/inputs/Input/Input.stories/package.json +0 -6
  683. package/inputs/Input/Input.stories.playwright.json +0 -376
  684. package/inputs/Input/__stories__/AFM/index.js +0 -22
  685. package/inputs/Input/__stories__/AFM/package.json +0 -6
  686. package/inputs/Input/__stories__/Boolean/index.js +0 -23
  687. package/inputs/Input/__stories__/Boolean/package.json +0 -6
  688. package/inputs/Input/__stories__/Default/index.js +0 -23
  689. package/inputs/Input/__stories__/Default/package.json +0 -6
  690. package/inputs/Input/__stories__/Default.d.ts +0 -3
  691. package/inputs/Input/__stories__/IBAN/index.js +0 -23
  692. package/inputs/Input/__stories__/IBAN/package.json +0 -6
  693. package/inputs/Input/__stories__/Integer/index.js +0 -31
  694. package/inputs/Input/__stories__/Integer/package.json +0 -6
  695. package/inputs/Input/__stories__/LandlineNumber/index.js +0 -26
  696. package/inputs/Input/__stories__/LandlineNumber/package.json +0 -6
  697. package/inputs/Input/__stories__/MobilePhone/index.js +0 -26
  698. package/inputs/Input/__stories__/MobilePhone/package.json +0 -6
  699. package/inputs/Input/__stories__/PhoneNumber/index.js +0 -25
  700. package/inputs/Input/__stories__/PhoneNumber/package.json +0 -6
  701. package/inputs/Input/__stories__/PostalCode/index.js +0 -25
  702. package/inputs/Input/__stories__/PostalCode/package.json +0 -6
  703. package/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -29
  704. package/inputs/Input/__stories__/TextWithCharacterLimit/package.json +0 -6
  705. package/inputs/Input/__stories__/TextWithCharacterLimit.d.ts +0 -3
  706. package/inputs/Input/index.mdx +0 -8
  707. package/inputs/Label/Label.stories/index.js +0 -7
  708. package/inputs/Label/Label.stories/package.json +0 -6
  709. package/inputs/Label/Label.stories.playwright.json +0 -40
  710. package/inputs/Label/__stories__/Default/index.js +0 -27
  711. package/inputs/Label/__stories__/Default/package.json +0 -6
  712. package/inputs/Label/index.mdx +0 -0
  713. package/inputs/OtpInput/OtpInput.stories/index.js +0 -7
  714. package/inputs/OtpInput/OtpInput.stories/package.json +0 -6
  715. package/inputs/OtpInput/__stories__/Default/index.js +0 -29
  716. package/inputs/OtpInput/__stories__/Default/package.json +0 -6
  717. package/inputs/Radio/Radio.stories/index.js +0 -9
  718. package/inputs/Radio/Radio.stories/package.json +0 -6
  719. package/inputs/Radio/Radio.stories.playwright.json +0 -73
  720. package/inputs/Radio/__stories__/Conditional/index.js +0 -92
  721. package/inputs/Radio/__stories__/Conditional/package.json +0 -6
  722. package/inputs/Radio/__stories__/Default/index.js +0 -45
  723. package/inputs/Radio/__stories__/Default/package.json +0 -6
  724. package/inputs/Radio/__stories__/WithDivider/index.js +0 -46
  725. package/inputs/Radio/__stories__/WithDivider/package.json +0 -6
  726. package/inputs/Radio/index.mdx +0 -0
  727. package/inputs/Select/Select.stories/index.js +0 -7
  728. package/inputs/Select/Select.stories/package.json +0 -6
  729. package/inputs/Select/Select.stories.playwright.json +0 -22
  730. package/inputs/Select/__stories__/Default/index.js +0 -51
  731. package/inputs/Select/__stories__/Default/package.json +0 -6
  732. package/installation.mdx +0 -68
  733. package/lazy.d.ts +0 -69
  734. package/registry.d.ts +0 -64
  735. package/src/Field/index.mdx +0 -6
  736. package/src/Field/utils.ts +0 -191
  737. package/src/FieldArray/FieldArray.stories.playwright.json +0 -353
  738. package/src/FormBuilder/FormBuilder.mdx +0 -256
  739. package/src/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  740. package/src/FormBuilder/FormBuilder.tsx +0 -166
  741. package/src/MultiplicityField/MultiplicityField.mdx +0 -590
  742. package/src/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  743. package/src/index.mdx +0 -51
  744. package/src/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  745. package/src/inputs/Checkboxes/index.mdx +0 -0
  746. package/src/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  747. package/src/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  748. package/src/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  749. package/src/inputs/Input/Input.stories.playwright.json +0 -376
  750. package/src/inputs/Input/index.mdx +0 -8
  751. package/src/inputs/Label/Label.stories.playwright.json +0 -40
  752. package/src/inputs/Label/index.mdx +0 -0
  753. package/src/inputs/Radio/Radio.stories.playwright.json +0 -73
  754. package/src/inputs/Radio/index.mdx +0 -0
  755. package/src/inputs/Select/Select.stories.playwright.json +0 -22
  756. package/validators/validators.spec/index.js +0 -85
  757. /package/{Field/index.mdx → src/Field/doc.mdx} +0 -0
@@ -1,353 +0,0 @@
1
- {
2
- "version": "4",
3
- "stories": {
4
- "digigov-form-fieldarray--default": {
5
- "actionSets": [
6
- {
7
- "actions": [
8
- {
9
- "name": "click",
10
- "args": {
11
- "selector": "text=Προσθήκη συνυπογράφοντα"
12
- }
13
- },
14
- {
15
- "name": "click",
16
- "args": {
17
- "selector": "text=Συνέχεια"
18
- }
19
- },
20
- {
21
- "name": "waitForSelector",
22
- "args": {
23
- "selector": "text=Το πεδίο πρέπει να έχει τουλάχιστον 2 εγγραφές. Προσθέστε μια ακόμα επιλέγοντας την απάντηση «Ναι» στην επόμενη ερώτηση.",
24
- "options": {
25
- "state": "visible"
26
- }
27
- }
28
- },
29
- {
30
- "name": "click",
31
- "args": {
32
- "selector": "text=Προσθήκη συνυπογράφοντα",
33
- "options": {
34
- "clickCount": 2
35
- }
36
- }
37
- },
38
- {
39
- "name": "click",
40
- "args": {
41
- "selector": "text=Συνέχεια"
42
- }
43
- },
44
- {
45
- "name": "waitForSelector",
46
- "args": {
47
- "selector": "text=Το πεδίο είναι υποχρεωτικό.",
48
- "options": {
49
- "state": "visible"
50
- }
51
- }
52
- },
53
- {
54
- "name": "type",
55
- "args": {
56
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
57
- "text": "2107474274"
58
- }
59
- },
60
- {
61
- "name": "click",
62
- "args": {
63
- "selector": "html>body>div:nth-child(5)>form>button"
64
- }
65
- }
66
- ],
67
- "id": "iMmV-vvS4iNn",
68
- "title": "Add new items to FieldArray"
69
- },
70
- {
71
- "actions": [
72
- {
73
- "name": "click",
74
- "args": {
75
- "selector": "html>body>div:nth-child(5)>form>button"
76
- }
77
- }
78
- ],
79
- "id": "Lhj8o_MByws7",
80
- "title": "Validation errors"
81
- },
82
- {
83
- "actions": [
84
- {
85
- "name": "type",
86
- "args": {
87
- "selector": "html>body",
88
- "text": "hello"
89
- }
90
- },
91
- {
92
- "name": "click",
93
- "args": {
94
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
95
- }
96
- },
97
- {
98
- "name": "type",
99
- "args": {
100
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(1)>label>input",
101
- "text": "150000496"
102
- }
103
- },
104
- {
105
- "name": "type",
106
- "args": {
107
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(2)>label>input",
108
- "text": "Jon"
109
- }
110
- },
111
- {
112
- "name": "type",
113
- "args": {
114
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(3)>label>input",
115
- "text": "Doe"
116
- }
117
- },
118
- {
119
- "name": "click",
120
- "args": {
121
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
122
- }
123
- },
124
- {
125
- "name": "type",
126
- "args": {
127
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(1)>label>input",
128
- "text": "150000496"
129
- }
130
- },
131
- {
132
- "name": "type",
133
- "args": {
134
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(2)>label>input",
135
- "text": "Mar"
136
- }
137
- },
138
- {
139
- "name": "type",
140
- "args": {
141
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(3)>label>input",
142
- "text": "P"
143
- }
144
- },
145
- {
146
- "name": "type",
147
- "args": {
148
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
149
- "text": "6977777777"
150
- }
151
- },
152
- {
153
- "name": "click",
154
- "args": {
155
- "selector": "html>body>div:nth-child(5)>form>button"
156
- }
157
- }
158
- ],
159
- "id": "OCWrR7oFA3YV",
160
- "title": "add 2 items"
161
- },
162
- {
163
- "actions": [
164
- {
165
- "name": "type",
166
- "args": {
167
- "selector": "html>body",
168
- "text": "hello"
169
- }
170
- },
171
- {
172
- "name": "click",
173
- "args": {
174
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
175
- }
176
- },
177
- {
178
- "name": "type",
179
- "args": {
180
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(1)>label>input",
181
- "text": "150000496"
182
- }
183
- },
184
- {
185
- "name": "type",
186
- "args": {
187
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(2)>label>input",
188
- "text": "Jon"
189
- }
190
- },
191
- {
192
- "name": "type",
193
- "args": {
194
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(3)>label>input",
195
- "text": "Doe"
196
- }
197
- },
198
- {
199
- "name": "click",
200
- "args": {
201
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
202
- }
203
- },
204
- {
205
- "name": "type",
206
- "args": {
207
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(1)>label>input",
208
- "text": "150000496"
209
- }
210
- },
211
- {
212
- "name": "type",
213
- "args": {
214
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(2)>label>input",
215
- "text": "Mar"
216
- }
217
- },
218
- {
219
- "name": "type",
220
- "args": {
221
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(3)>label>input",
222
- "text": "P"
223
- }
224
- },
225
- {
226
- "name": "click",
227
- "args": {
228
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(3)>div>fieldset>button"
229
- }
230
- },
231
- {
232
- "name": "type",
233
- "args": {
234
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
235
- "text": "6977777777"
236
- }
237
- },
238
- {
239
- "name": "click",
240
- "args": {
241
- "selector": "html>body>div:nth-child(5)>form>button"
242
- }
243
- }
244
- ],
245
- "id": "8ZxUUjo0Yxnr",
246
- "title": "add 2 items and remove 1"
247
- }
248
- ]
249
- },
250
- "digigov-form-fieldarray--with-exact-length": {
251
- "actionSets": [
252
- {
253
- "actions": [
254
- {
255
- "name": "click",
256
- "args": {
257
- "selector": "html>body>div:nth-child(5)>form>button"
258
- }
259
- },
260
- {
261
- "name": "click",
262
- "args": {
263
- "selector": "html>body>div:nth-child(5)>form>button"
264
- }
265
- }
266
- ],
267
- "id": "WG3dAbfXa-Sn",
268
- "title": "validation errors"
269
- },
270
- {
271
- "actions": [
272
- {
273
- "name": "type",
274
- "args": {
275
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(1)>label>input",
276
- "text": "Hello"
277
- }
278
- },
279
- {
280
- "name": "click",
281
- "args": {
282
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
283
- }
284
- },
285
- {
286
- "name": "type",
287
- "args": {
288
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(1)>label>input",
289
- "text": "150000496"
290
- }
291
- },
292
- {
293
- "name": "type",
294
- "args": {
295
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(2)>label>input",
296
- "text": "Μάρω"
297
- }
298
- },
299
- {
300
- "name": "type",
301
- "args": {
302
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(3)>label>input",
303
- "text": "Μενεξέ"
304
- }
305
- },
306
- {
307
- "name": "click",
308
- "args": {
309
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
310
- }
311
- },
312
- {
313
- "name": "type",
314
- "args": {
315
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(1)>label>input",
316
- "text": "150000496"
317
- }
318
- },
319
- {
320
- "name": "type",
321
- "args": {
322
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(2)>label>input",
323
- "text": "Ηλέκτρα"
324
- }
325
- },
326
- {
327
- "name": "type",
328
- "args": {
329
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(3)>label>input",
330
- "text": "Αποστόλου"
331
- }
332
- },
333
- {
334
- "name": "type",
335
- "args": {
336
- "selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
337
- "text": "6977654321"
338
- }
339
- },
340
- {
341
- "name": "click",
342
- "args": {
343
- "selector": "html>body>div:nth-child(5)>form>button"
344
- }
345
- }
346
- ],
347
- "id": "-U0EryxXC-g7",
348
- "title": "add exact length of items"
349
- }
350
- ]
351
- }
352
- }
353
- }
@@ -1,256 +0,0 @@
1
- ---
2
- id: FormBuilder
3
- title: FormBuilder
4
- sidebar_label: FormBuilder
5
- ---
6
-
7
- `FormBuilder` is a React component that provides an easy way to efficiently create reusable form page. Forms are a flexible mechanism for collecting user input because there are suitable widgets for entering many different types of data, including text boxes, checkboxes, radio buttons, dropdowns and so on for submission to a server. Actually when we use `stepForm` for building step-forms all we do is to render `FormBuilder` component.
8
-
9
- `stepForm` component:
10
-
11
- <Story
12
- packageName="@digigov/form"
13
- component="FormBuilder"
14
- story="Default.tsx"
15
- />
16
-
17
- ### Importing and using FormBuilder Component
18
-
19
- To import `FormBuilder` component simply import it from `'@digigov/form`.
20
-
21
- ```javascript
22
- import { FormBuilder } from '@digigov/form';
23
- ```
24
-
25
- Now you can use the current component inisde of your component
26
-
27
- ```javascript
28
- import BasicLayout, {
29
- Top,
30
- Container,
31
- Main,
32
- Bottom,
33
- } from '@digigov/ui/layouts/Basic';
34
- import {FormBuilder} from '@digigov/form';
35
-
36
- export default function MyComponent({ props }) {
37
-
38
- return (
39
- <BasicLayout>
40
- .
41
- .
42
- <Container>
43
- <Main>
44
- .
45
- .
46
- <FormBuilder></FormBuilder>
47
- .
48
- .
49
- </Main>
50
- </Container>
51
- <Bottom>
52
- <GovGRFooter />
53
- </Bottom>
54
- </BasicLayout>
55
- );
56
- }
57
- }
58
- ```
59
-
60
- ### Props
61
-
62
- `FormBuilder` component accepts several arguments as input props.
63
-
64
- | Name | Type | Default | Description |
65
- | ------------ | :-----: | :-----: | :------------------------------------------------------------------------------------: |
66
- | children | node | | allow you to pass components as data. |
67
- | steps | array | | an array which includes each step-form format data |
68
- | name | string | | the name of the step. |
69
- | title | string | | the title from each step |
70
- | fields | array | | an array of object fields which they describe each field for each step-form |
71
- | key | string | | the key value of the input field |
72
- | label | object | | an object prop which describes the label primary and the secondary name of the field |
73
- | primary | string | | the name of te field |
74
- | required | boolean | false | describes the validation of the field |
75
- | submitButton | boolean | false | if true, it creates a button to continue to the next step |
76
- | type | string | | describes the format of each field, e.x `type:'string'` is a simple input format field |
77
-
78
- ### Field types
79
-
80
- Below are demostrated some examples for each type of field
81
-
82
- ### FormBuilder implementation
83
-
84
- The examples above are implemented by using the code below
85
-
86
- ```javascript
87
- import React, { useState } from 'react';
88
- import BasicLayout, {
89
- Top,
90
- Container,
91
- Main,
92
- Bottom,
93
- } from '@digigov/ui/layouts/Basic';
94
- import Header, { HeaderTitle } from '@digigov/ui/app/Header';
95
- import GovGRLogo from '@digigov/ui/govgr/GovGRLogo';
96
- import GovGRFooter from '@digigov/ui/govgr/Footer';
97
- import Button from '@digigov/ui/form/Button';
98
- import PageTitleContainer, {
99
- PageTitleCaption,
100
- PageTitleHeading,
101
- } from '@digigov/ui/app/PageTitleContainer';
102
- import BackButton from '@digigov/ui/form/Button/BackButton';
103
- import FormBuilder, { Fieldset, FieldsetLabel, Field } from '@digigov/form';
104
- import { useTranslation } from '@digigov/ui/i18n';
105
-
106
- const FIELDS = [
107
- {
108
- key: 'phone',
109
- label: {
110
- primary: 'Mobile phone',
111
- secondary: 'A valid mobile number, eg. +306988848888',
112
- },
113
- required: true,
114
- type: 'mobile_phone',
115
- },
116
- {
117
- key: 'choice_single',
118
- label: { primary: 'Is this true or not' },
119
- type: 'choice:single',
120
- required: true,
121
- extra: {
122
- options: [
123
- {
124
- label: { primary: 'Yes' },
125
- value: 'yes',
126
- },
127
- {
128
- label: { primary: 'No', secondary: 'Explanation about no option' },
129
- value: 'no',
130
- },
131
- ],
132
- },
133
- },
134
- {
135
- key: 'choice_single_notitle',
136
- type: 'choice:single',
137
- extra: {
138
- options: [
139
- {
140
- label: { primary: 'One' },
141
- value: '1',
142
- },
143
- {
144
- label: { primary: 'Two' },
145
- value: '2',
146
- },
147
- ],
148
- },
149
- },
150
- {
151
- key: 'choice_multiple',
152
- label: 'Select from below',
153
- type: 'choice:multiple',
154
- extra: {
155
- options: [
156
- {
157
- label: { primary: 'Choice 1', secondary: 'Choice 1 explanation' },
158
- value: 'choice_1',
159
- },
160
- {
161
- label: { primary: 'Choice 2' },
162
- value: 'choice_2',
163
- },
164
- ],
165
- },
166
- },
167
- {
168
- key: 'choice_single_select',
169
- label: 'Select from below',
170
- type: 'choice:single',
171
- extra: {
172
- options: [
173
- {
174
- label: { primary: 'Choice 1', secondary: 'Choice 1 explanation' },
175
- value: 'choice_1',
176
- },
177
- {
178
- label: { primary: 'Choice 2 lenghty explanation without reason' },
179
- value: 'choice_2',
180
- },
181
- ],
182
- component: 'Select',
183
- },
184
- },
185
- {
186
- key: 'number',
187
- label: { primary: 'A positive number' },
188
- required: true,
189
- width: '100px',
190
- type: 'int',
191
- },
192
- {
193
- key: 'string',
194
- label: null,
195
- width: '100px',
196
- required: true,
197
- type: 'string',
198
- },
199
- ];
200
- const initialValues = {
201
- phone: '6988888888',
202
- choice_multiple: ['choice_2'],
203
- string: 'default content',
204
- };
205
-
206
- const useStyles = makeStyles(
207
- {
208
- top: { minHeight: '75px' },
209
- main: {},
210
- side: {},
211
- },
212
- { name: 'MuiSite' }
213
- );
214
-
215
- export default function Index() {
216
- const styles = useStyles();
217
- const [data, setData] = useState(null);
218
- const { t } = useTranslation();
219
- return (
220
- <BasicLayout>
221
- <Top className={styles.top}>
222
- <Header>
223
- <GovGRLogo />
224
- <HeaderTitle>Service name</HeaderTitle>
225
- </Header>
226
- </Top>
227
- <Container>
228
- <Main className={styles.main}>
229
- <BackButton>{t('button.back')}</BackButton>
230
- <PageTitleContainer>
231
- <PageTitleCaption>Before we start</PageTitleCaption>
232
- <PageTitleHeading>Submit a form</PageTitleHeading>
233
- </PageTitleContainer>
234
- <FormBuilder
235
- fields={FIELDS}
236
- onSubmit={setData}
237
- initial={initialValues}
238
- >
239
- <Fieldset>
240
- <FieldsetLabel>This is a fieldset</FieldsetLabel>
241
- {FIELDS.map((field) => (
242
- <Field key={field.key} name={field.key} />
243
- ))}
244
- </Fieldset>
245
- <Button type="submit">{t('button.continue')}</Button>
246
- </FormBuilder>
247
- {data && <pre>{JSON.stringify(data, null, 2)}</pre>}
248
- </Main>
249
- </Container>
250
- <Bottom>
251
- <GovGRFooter />
252
- </Bottom>
253
- </BasicLayout>
254
- );
255
- }
256
- ```
@@ -1,52 +0,0 @@
1
- {
2
- "version": "4",
3
- "stories": {
4
- "digigov-form-formbuilder--default": {
5
- "actionSets": [
6
- {
7
- "actions": [
8
- {
9
- "name": "type",
10
- "args": {
11
- "selector": "html>body>div:nth-child(5)>form>div>label>input",
12
- "text": "hello"
13
- }
14
- },
15
- {
16
- "name": "click",
17
- "args": {
18
- "selector": "html>body>div:nth-child(5)>form>button"
19
- }
20
- }
21
- ],
22
- "id": "96MZZJqDNLCc",
23
- "title": "type and submit"
24
- },
25
- {
26
- "actions": [
27
- {
28
- "name": "keyboard.press",
29
- "args": {
30
- "key": "Tab"
31
- }
32
- },
33
- {
34
- "name": "keyboard.press",
35
- "args": {
36
- "key": "Tab"
37
- }
38
- },
39
- {
40
- "name": "keyboard.press",
41
- "args": {
42
- "key": "Enter"
43
- }
44
- }
45
- ],
46
- "id": "El5R6WiI7IMr",
47
- "title": "focus and show validation error"
48
- }
49
- ]
50
- }
51
- }
52
- }