@digigov/form 1.2.0-dcbd7ded → 2.0.0-0c4be34e

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 (801) 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 +102 -63
  8. package/Field/index.js.map +7 -0
  9. package/Field/types/index.js +1 -1
  10. package/Field/types.d.ts +40 -5
  11. package/Field/types.js.map +7 -0
  12. package/Field/utils/calculateField/index.js +27 -0
  13. package/{inputs/Input/__stories__/Default → 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/Field/utils/evaluateFieldWithConditions/package.json +6 -0
  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 +41 -116
  22. package/Field/utils/index.js.map +7 -0
  23. package/Field/utils/useField/index.js +51 -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/index.js +12 -6
  28. package/FieldArray/FieldArray.stories.d.ts +2 -2
  29. package/FieldArray/FieldArray.stories.js.map +7 -0
  30. package/FieldArray/__stories__/Default/index.js +87 -80
  31. package/FieldArray/__stories__/Default.d.ts +2 -2
  32. package/FieldArray/__stories__/Default.js.map +7 -0
  33. package/FieldArray/__stories__/WithExactLength/index.js +87 -80
  34. package/FieldArray/__stories__/WithExactLength.d.ts +2 -2
  35. package/FieldArray/__stories__/WithExactLength.js.map +7 -0
  36. package/FieldArray/index.d.ts +1 -0
  37. package/FieldArray/index.js +73 -59
  38. package/FieldArray/index.js.map +7 -0
  39. package/FieldArray/index.test.d.ts +1 -0
  40. package/FieldObject/index.d.ts +3 -0
  41. package/FieldObject/index.js +70 -52
  42. package/FieldObject/index.js.map +7 -0
  43. package/Fieldset/FieldsetWithContext/index.js +27 -31
  44. package/Fieldset/FieldsetWithContext.js.map +7 -0
  45. package/Fieldset/index.d.ts +1 -1
  46. package/Fieldset/index.js +27 -29
  47. package/Fieldset/index.js.map +7 -0
  48. package/Fieldset/types/index.js +1 -1
  49. package/Fieldset/types.d.ts +3 -2
  50. package/Fieldset/types.js.map +7 -0
  51. package/Form.stories/index.js +7 -3
  52. package/Form.stories.js.map +7 -0
  53. package/FormBuilder/FormBuilder.stories/index.js +10 -5
  54. package/FormBuilder/FormBuilder.stories.d.ts +1 -1
  55. package/FormBuilder/FormBuilder.stories.js.map +7 -0
  56. package/FormBuilder/__stories__/Default/index.js +27 -21
  57. package/FormBuilder/__stories__/Default.d.ts +2 -2
  58. package/FormBuilder/__stories__/Default.js.map +7 -0
  59. package/FormBuilder/index.d.ts +8 -1
  60. package/FormBuilder/index.js +158 -2
  61. package/FormBuilder/index.js.map +7 -0
  62. package/FormBuilder/index.test.d.ts +1 -0
  63. package/FormBuilder/scenarios.test.d.ts +88 -0
  64. package/FormContext/index.js +7 -3
  65. package/FormContext.js.map +7 -0
  66. package/MultiplicityField/MultiplicityField.stories/index.js +20 -10
  67. package/MultiplicityField/MultiplicityField.stories.d.ts +6 -6
  68. package/MultiplicityField/MultiplicityField.stories.js.map +7 -0
  69. package/MultiplicityField/__stories__/Default/index.js +90 -85
  70. package/MultiplicityField/__stories__/Default.d.ts +2 -2
  71. package/MultiplicityField/__stories__/Default.js.map +7 -0
  72. package/MultiplicityField/__stories__/PreviewDisplay/index.js +70 -72
  73. package/MultiplicityField/__stories__/PreviewDisplay.d.ts +2 -2
  74. package/MultiplicityField/__stories__/PreviewDisplay.js.map +7 -0
  75. package/MultiplicityField/__stories__/WithExactLength/index.js +87 -80
  76. package/MultiplicityField/__stories__/WithExactLength.d.ts +2 -2
  77. package/MultiplicityField/__stories__/WithExactLength.js.map +7 -0
  78. package/MultiplicityField/__stories__/WithMaxLength/index.js +90 -83
  79. package/MultiplicityField/__stories__/WithMaxLength.d.ts +2 -2
  80. package/MultiplicityField/__stories__/WithMaxLength.js.map +7 -0
  81. package/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +91 -84
  82. package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +2 -2
  83. package/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +7 -0
  84. package/MultiplicityField/__stories__/WithMinLength/index.js +90 -83
  85. package/MultiplicityField/__stories__/WithMinLength.d.ts +2 -2
  86. package/MultiplicityField/__stories__/WithMinLength.js.map +7 -0
  87. package/MultiplicityField/add-objects/index.js +137 -132
  88. package/MultiplicityField/add-objects.d.ts +2 -1
  89. package/MultiplicityField/add-objects.js.map +7 -0
  90. package/MultiplicityField/index.d.ts +2 -19
  91. package/MultiplicityField/index.js +113 -106
  92. package/MultiplicityField/index.js.map +7 -0
  93. package/MultiplicityField/index.test.d.ts +1 -0
  94. package/MultiplicityField/types/index.js +1 -0
  95. package/{validators/validators.spec → MultiplicityField/types}/package.json +1 -1
  96. package/MultiplicityField/types.d.ts +18 -0
  97. package/MultiplicityField/types.js.map +7 -0
  98. package/Questions/Questions/index.js +48 -56
  99. package/Questions/Questions.js.map +7 -0
  100. package/Questions/Questions.stories/index.js +10 -5
  101. package/Questions/Questions.stories.d.ts +1 -1
  102. package/Questions/Questions.stories.js.map +7 -0
  103. package/Questions/QuestionsContext/index.js +9 -9
  104. package/Questions/QuestionsContext.d.ts +0 -1
  105. package/Questions/QuestionsContext.js.map +7 -0
  106. package/Questions/Step/ReviewStep/index.js +35 -47
  107. package/Questions/Step/ReviewStep.js.map +7 -0
  108. package/Questions/Step/Step/index.js +39 -47
  109. package/Questions/Step/Step.js.map +7 -0
  110. package/Questions/Step/StepArrayReview/index.js +41 -45
  111. package/Questions/Step/StepArrayReview.js.map +7 -0
  112. package/Questions/Step/StepContext/index.js +15 -19
  113. package/Questions/Step/StepContext.d.ts +0 -1
  114. package/Questions/Step/StepContext.js.map +7 -0
  115. package/Questions/Step/StepDescription/index.js +22 -22
  116. package/Questions/Step/StepDescription.js.map +7 -0
  117. package/Questions/Step/StepForm/index.js +33 -43
  118. package/Questions/Step/StepForm.js.map +7 -0
  119. package/Questions/Step/StepQuote/index.js +10 -9
  120. package/Questions/Step/StepQuote.js.map +7 -0
  121. package/Questions/Step/StepTitle/index.js +41 -38
  122. package/Questions/Step/StepTitle.d.ts +2 -1
  123. package/Questions/Step/StepTitle.js.map +7 -0
  124. package/Questions/Step/getAddMoreFields/index.js +28 -20
  125. package/Questions/Step/getAddMoreFields.js.map +7 -0
  126. package/Questions/Step/index.d.ts +0 -1
  127. package/Questions/Step/index.js +16 -13
  128. package/Questions/Step/index.js.map +7 -0
  129. package/Questions/Step/types/index.js +1 -1
  130. package/Questions/Step/types.d.ts +1 -0
  131. package/Questions/Step/types.js.map +7 -0
  132. package/Questions/__stories__/Default/index.js +106 -100
  133. package/Questions/__stories__/Default.d.ts +2 -2
  134. package/Questions/__stories__/Default.js.map +7 -0
  135. package/Questions/getNextStep/index.js +12 -10
  136. package/Questions/getNextStep.js.map +7 -0
  137. package/Questions/index.js +7 -3
  138. package/Questions/index.js.map +7 -0
  139. package/Questions/index.test.d.ts +1 -0
  140. package/Questions/types/index.js +1 -1
  141. package/Questions/types.d.ts +1 -0
  142. package/Questions/types.js.map +7 -0
  143. package/cjs/Field/FieldBase/index.js +136 -82
  144. package/cjs/Field/FieldBase.js.map +7 -0
  145. package/cjs/Field/FieldBaseContainer/index.js +61 -43
  146. package/cjs/Field/FieldBaseContainer.js.map +7 -0
  147. package/cjs/Field/FieldConditional/index.js +111 -59
  148. package/cjs/Field/FieldConditional.js.map +7 -0
  149. package/cjs/Field/index.js +131 -72
  150. package/cjs/Field/index.js.map +7 -0
  151. package/cjs/Field/types/index.js +16 -5
  152. package/cjs/Field/types.js.map +7 -0
  153. package/cjs/Field/utils/calculateField/index.js +50 -0
  154. package/cjs/Field/utils/calculateField.js.map +7 -0
  155. package/cjs/Field/utils/evaluateFieldWithConditions/index.js +49 -0
  156. package/cjs/Field/utils/evaluateFieldWithConditions.js.map +7 -0
  157. package/cjs/Field/utils/index.js +85 -139
  158. package/cjs/Field/utils/index.js.map +7 -0
  159. package/cjs/Field/utils/useField/index.js +74 -0
  160. package/cjs/Field/utils/useField.js.map +7 -0
  161. package/cjs/FieldArray/FieldArray.stories/index.js +46 -36
  162. package/cjs/FieldArray/FieldArray.stories.js.map +7 -0
  163. package/cjs/FieldArray/__stories__/Default/index.js +119 -89
  164. package/cjs/FieldArray/__stories__/Default.js.map +7 -0
  165. package/cjs/FieldArray/__stories__/WithExactLength/index.js +119 -89
  166. package/cjs/FieldArray/__stories__/WithExactLength.js.map +7 -0
  167. package/cjs/FieldArray/index.js +105 -65
  168. package/cjs/FieldArray/index.js.map +7 -0
  169. package/cjs/FieldObject/index.js +99 -61
  170. package/cjs/FieldObject/index.js.map +7 -0
  171. package/cjs/Fieldset/FieldsetWithContext/index.js +54 -40
  172. package/cjs/Fieldset/FieldsetWithContext.js.map +7 -0
  173. package/cjs/Fieldset/index.js +61 -39
  174. package/cjs/Fieldset/index.js.map +7 -0
  175. package/cjs/Fieldset/types/index.js +16 -5
  176. package/cjs/Fieldset/types.js.map +7 -0
  177. package/cjs/Form.stories/index.js +25 -8
  178. package/cjs/Form.stories.js.map +7 -0
  179. package/cjs/FormBuilder/FormBuilder.stories/index.js +43 -24
  180. package/cjs/FormBuilder/FormBuilder.stories.js.map +7 -0
  181. package/cjs/FormBuilder/__stories__/Default/index.js +60 -31
  182. package/cjs/FormBuilder/__stories__/Default.js.map +7 -0
  183. package/cjs/FormBuilder/index.js +194 -8
  184. package/cjs/FormBuilder/index.js.map +7 -0
  185. package/cjs/FormContext/index.js +29 -8
  186. package/cjs/FormContext.js.map +7 -0
  187. package/cjs/MultiplicityField/MultiplicityField.stories/index.js +58 -84
  188. package/cjs/MultiplicityField/MultiplicityField.stories.js.map +7 -0
  189. package/cjs/MultiplicityField/__stories__/Default/index.js +122 -94
  190. package/cjs/MultiplicityField/__stories__/Default.js.map +7 -0
  191. package/cjs/MultiplicityField/__stories__/PreviewDisplay/index.js +85 -81
  192. package/cjs/MultiplicityField/__stories__/PreviewDisplay.js.map +7 -0
  193. package/cjs/MultiplicityField/__stories__/WithExactLength/index.js +119 -89
  194. package/cjs/MultiplicityField/__stories__/WithExactLength.js.map +7 -0
  195. package/cjs/MultiplicityField/__stories__/WithMaxLength/index.js +122 -92
  196. package/cjs/MultiplicityField/__stories__/WithMaxLength.js.map +7 -0
  197. package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +123 -93
  198. package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +7 -0
  199. package/cjs/MultiplicityField/__stories__/WithMinLength/index.js +122 -92
  200. package/cjs/MultiplicityField/__stories__/WithMinLength.js.map +7 -0
  201. package/cjs/MultiplicityField/add-objects/index.js +164 -138
  202. package/cjs/MultiplicityField/add-objects.js.map +7 -0
  203. package/cjs/MultiplicityField/index.js +141 -115
  204. package/cjs/MultiplicityField/index.js.map +7 -0
  205. package/cjs/MultiplicityField/types/index.js +16 -0
  206. package/cjs/MultiplicityField/types.js.map +7 -0
  207. package/cjs/Questions/Questions/index.js +80 -65
  208. package/cjs/Questions/Questions.js.map +7 -0
  209. package/cjs/Questions/Questions.stories/index.js +43 -24
  210. package/cjs/Questions/Questions.stories.js.map +7 -0
  211. package/cjs/Questions/QuestionsContext/index.js +31 -14
  212. package/cjs/Questions/QuestionsContext.js.map +7 -0
  213. package/cjs/Questions/Step/ReviewStep/index.js +61 -56
  214. package/cjs/Questions/Step/ReviewStep.js.map +7 -0
  215. package/cjs/Questions/Step/Step/index.js +71 -56
  216. package/cjs/Questions/Step/Step.js.map +7 -0
  217. package/cjs/Questions/Step/StepArrayReview/index.js +65 -54
  218. package/cjs/Questions/Step/StepArrayReview.js.map +7 -0
  219. package/cjs/Questions/Step/StepContext/index.js +37 -24
  220. package/cjs/Questions/Step/StepContext.js.map +7 -0
  221. package/cjs/Questions/Step/StepDescription/index.js +55 -31
  222. package/cjs/Questions/Step/StepDescription.js.map +7 -0
  223. package/cjs/Questions/Step/StepForm/index.js +65 -52
  224. package/cjs/Questions/Step/StepForm.js.map +7 -0
  225. package/cjs/Questions/Step/StepQuote/index.js +42 -15
  226. package/cjs/Questions/Step/StepQuote.js.map +7 -0
  227. package/cjs/Questions/Step/StepTitle/index.js +72 -47
  228. package/cjs/Questions/Step/StepTitle.js.map +7 -0
  229. package/cjs/Questions/Step/getAddMoreFields/index.js +50 -25
  230. package/cjs/Questions/Step/getAddMoreFields.js.map +7 -0
  231. package/cjs/Questions/Step/index.js +59 -143
  232. package/cjs/Questions/Step/index.js.map +7 -0
  233. package/cjs/Questions/Step/types/index.js +16 -5
  234. package/cjs/Questions/Step/types.js.map +7 -0
  235. package/cjs/Questions/__stories__/Default/index.js +132 -109
  236. package/cjs/Questions/__stories__/Default.js.map +7 -0
  237. package/cjs/Questions/getNextStep/index.js +33 -14
  238. package/cjs/Questions/getNextStep.js.map +7 -0
  239. package/cjs/Questions/index.js +29 -19
  240. package/cjs/Questions/index.js.map +7 -0
  241. package/cjs/Questions/types/index.js +16 -5
  242. package/cjs/Questions/types.js.map +7 -0
  243. package/cjs/index.js +47 -20
  244. package/cjs/index.js.map +7 -0
  245. package/cjs/inputs/AutoCompleteInput/AutoComplete.stories/index.js +46 -24
  246. package/cjs/inputs/AutoCompleteInput/AutoComplete.stories.js.map +7 -0
  247. package/cjs/inputs/AutoCompleteInput/__stories__/Default/index.js +72 -51
  248. package/cjs/inputs/AutoCompleteInput/__stories__/Default.js.map +7 -0
  249. package/cjs/inputs/AutoCompleteInput/__stories__/Multiple/index.js +77 -0
  250. package/cjs/inputs/AutoCompleteInput/__stories__/Multiple.js.map +7 -0
  251. package/cjs/inputs/AutoCompleteInput/index.js +91 -46
  252. package/cjs/inputs/AutoCompleteInput/index.js.map +7 -0
  253. package/cjs/inputs/Checkboxes/Checkboxes.stories/index.js +49 -48
  254. package/cjs/inputs/Checkboxes/Checkboxes.stories.js.map +7 -0
  255. package/cjs/inputs/Checkboxes/__stories__/Conditional/index.js +120 -89
  256. package/cjs/inputs/Checkboxes/__stories__/Conditional.js.map +7 -0
  257. package/cjs/inputs/Checkboxes/__stories__/Default/index.js +73 -46
  258. package/cjs/inputs/Checkboxes/__stories__/Default.js.map +7 -0
  259. package/cjs/inputs/Checkboxes/__stories__/WithDivider/index.js +74 -47
  260. package/cjs/inputs/Checkboxes/__stories__/WithDivider.js.map +7 -0
  261. package/cjs/inputs/Checkboxes/index.js +100 -96
  262. package/cjs/inputs/Checkboxes/index.js.map +7 -0
  263. package/cjs/inputs/DateInput/DateInput.stories/index.js +43 -24
  264. package/cjs/inputs/DateInput/DateInput.stories.js.map +7 -0
  265. package/cjs/inputs/DateInput/__stories__/Default/index.js +51 -28
  266. package/cjs/inputs/DateInput/__stories__/Default.js.map +7 -0
  267. package/cjs/inputs/DateInput/index.js +121 -109
  268. package/cjs/inputs/DateInput/index.js.map +7 -0
  269. package/cjs/inputs/FileInput/FileInput.stories/index.js +43 -24
  270. package/cjs/inputs/FileInput/FileInput.stories.js.map +7 -0
  271. package/cjs/inputs/FileInput/__stories__/Default/index.js +57 -26
  272. package/cjs/inputs/FileInput/__stories__/Default.js.map +7 -0
  273. package/cjs/inputs/FileInput/index.js +75 -63
  274. package/cjs/inputs/FileInput/index.js.map +7 -0
  275. package/cjs/inputs/ImageInput/ImageInput.stories/index.js +49 -48
  276. package/cjs/inputs/ImageInput/ImageInput.stories.js.map +7 -0
  277. package/cjs/inputs/ImageInput/__stories__/Default/index.js +58 -33
  278. package/cjs/inputs/ImageInput/__stories__/Default.js.map +7 -0
  279. package/cjs/inputs/ImageInput/__stories__/MaxSize/index.js +69 -0
  280. package/cjs/inputs/ImageInput/__stories__/MaxSize.js.map +7 -0
  281. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +66 -40
  282. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +7 -0
  283. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +62 -37
  284. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +7 -0
  285. package/cjs/inputs/ImageInput/index.js +90 -83
  286. package/cjs/inputs/ImageInput/index.js.map +7 -0
  287. package/cjs/inputs/Input/Input.stories/index.js +70 -132
  288. package/cjs/inputs/Input/Input.stories.js.map +7 -0
  289. package/cjs/inputs/Input/__stories__/AFM/index.js +60 -29
  290. package/cjs/inputs/Input/__stories__/AFM.js.map +7 -0
  291. package/cjs/inputs/Input/__stories__/Boolean/index.js +61 -30
  292. package/cjs/inputs/Input/__stories__/Boolean.js.map +7 -0
  293. package/cjs/inputs/Input/__stories__/IBAN/index.js +61 -30
  294. package/cjs/inputs/Input/__stories__/IBAN.js.map +7 -0
  295. package/cjs/inputs/Input/__stories__/Integer/index.js +75 -38
  296. package/cjs/inputs/Input/__stories__/Integer.js.map +7 -0
  297. package/cjs/inputs/Input/__stories__/LandlineNumber/index.js +65 -33
  298. package/cjs/inputs/Input/__stories__/LandlineNumber.js.map +7 -0
  299. package/cjs/inputs/Input/__stories__/MobilePhone/index.js +65 -33
  300. package/cjs/inputs/Input/__stories__/MobilePhone.js.map +7 -0
  301. package/cjs/inputs/Input/__stories__/PhoneNumber/index.js +64 -32
  302. package/cjs/inputs/Input/__stories__/PhoneNumber.js.map +7 -0
  303. package/cjs/inputs/Input/__stories__/PostalCode/index.js +61 -31
  304. package/cjs/inputs/Input/__stories__/PostalCode.js.map +7 -0
  305. package/cjs/inputs/Input/__stories__/String/index.js +64 -0
  306. package/cjs/inputs/Input/__stories__/String.js.map +7 -0
  307. package/cjs/inputs/Input/__stories__/TextWithLimit/index.js +64 -0
  308. package/cjs/inputs/Input/__stories__/TextWithLimit.js.map +7 -0
  309. package/cjs/inputs/Input/index.js +98 -71
  310. package/cjs/inputs/Input/index.js.map +7 -0
  311. package/cjs/inputs/Input/inputsInputScenarios/index.js +439 -0
  312. package/cjs/inputs/Input/inputsInputScenarios.js.map +7 -0
  313. package/cjs/inputs/Label/Label.stories/index.js +43 -24
  314. package/cjs/inputs/Label/Label.stories.js.map +7 -0
  315. package/cjs/inputs/Label/__stories__/Default/index.js +68 -33
  316. package/cjs/inputs/Label/__stories__/Default.js.map +7 -0
  317. package/cjs/inputs/Label/index.js +45 -24
  318. package/cjs/inputs/Label/index.js.map +7 -0
  319. package/cjs/inputs/OtpInput/OtpInput.stories/index.js +43 -24
  320. package/cjs/inputs/OtpInput/OtpInput.stories.js.map +7 -0
  321. package/cjs/inputs/OtpInput/__stories__/Default/index.js +59 -34
  322. package/cjs/inputs/OtpInput/__stories__/Default.js.map +7 -0
  323. package/cjs/inputs/OtpInput/index.js +142 -112
  324. package/cjs/inputs/OtpInput/index.js.map +7 -0
  325. package/cjs/inputs/Radio/Radio.stories/index.js +49 -48
  326. package/cjs/inputs/Radio/Radio.stories.js.map +7 -0
  327. package/cjs/inputs/Radio/__stories__/Conditional/index.js +120 -89
  328. package/cjs/inputs/Radio/__stories__/Conditional.js.map +7 -0
  329. package/cjs/inputs/Radio/__stories__/Default/index.js +77 -51
  330. package/cjs/inputs/Radio/__stories__/Default.js.map +7 -0
  331. package/cjs/inputs/Radio/__stories__/WithDivider/index.js +78 -52
  332. package/cjs/inputs/Radio/__stories__/WithDivider.js.map +7 -0
  333. package/cjs/inputs/Radio/index.js +130 -61
  334. package/cjs/inputs/Radio/index.js.map +7 -0
  335. package/cjs/inputs/Select/Select.stories/index.js +43 -24
  336. package/cjs/inputs/Select/Select.stories.js.map +7 -0
  337. package/cjs/inputs/Select/__stories__/Default/index.js +82 -57
  338. package/cjs/inputs/Select/__stories__/Default.js.map +7 -0
  339. package/cjs/inputs/Select/index.js +54 -36
  340. package/cjs/inputs/Select/index.js.map +7 -0
  341. package/cjs/inputs/index.js +62 -69
  342. package/cjs/inputs/index.js.map +7 -0
  343. package/cjs/inputs/inputsScenarios/index.js +533 -0
  344. package/cjs/inputs/inputsScenarios.js.map +7 -0
  345. package/cjs/internal/index.js +36 -346
  346. package/cjs/internal.js.map +7 -0
  347. package/cjs/lazy/index.js +355 -516
  348. package/cjs/lazy.js.map +7 -0
  349. package/cjs/locales/el/index.js +35 -0
  350. package/cjs/locales/el.js.map +7 -0
  351. package/cjs/registry/index.js +260 -142
  352. package/cjs/registry.js.map +7 -0
  353. package/cjs/types/index.js +22 -5
  354. package/cjs/types.js.map +7 -0
  355. package/cjs/utils/index.js +79 -83
  356. package/cjs/utils.js.map +7 -0
  357. package/cjs/validators/index.js +115 -163
  358. package/cjs/validators/index.js.map +7 -0
  359. package/cjs/validators/types/index.js +16 -5
  360. package/cjs/validators/types.js.map +7 -0
  361. package/cjs/validators/utils/afm/index.js +38 -21
  362. package/cjs/validators/utils/afm.js.map +7 -0
  363. package/cjs/validators/utils/date/index.js +138 -0
  364. package/cjs/validators/utils/date.js.map +7 -0
  365. package/cjs/validators/utils/file/index.js +44 -47
  366. package/cjs/validators/utils/file.js.map +7 -0
  367. package/cjs/validators/utils/iban/index.js +36 -17
  368. package/cjs/validators/utils/iban.js.map +7 -0
  369. package/cjs/validators/utils/image/index.js +88 -112
  370. package/cjs/validators/utils/image.js.map +7 -0
  371. package/cjs/validators/utils/index.js +97 -159
  372. package/cjs/validators/utils/index.js.map +7 -0
  373. package/cjs/validators/utils/int/index.js +34 -12
  374. package/cjs/validators/utils/int.js.map +7 -0
  375. package/cjs/validators/utils/number/index.js +33 -11
  376. package/cjs/validators/utils/number.js.map +7 -0
  377. package/cjs/validators/utils/otp/index.js +35 -13
  378. package/cjs/validators/utils/otp.js.map +7 -0
  379. package/cjs/validators/utils/phone/index.js +113 -58
  380. package/cjs/validators/utils/phone.js.map +7 -0
  381. package/cjs/validators/utils/postal_code/index.js +36 -16
  382. package/cjs/validators/utils/postal_code.js.map +7 -0
  383. package/cjs/validators/utils/text_limit/index.js +40 -25
  384. package/cjs/validators/utils/text_limit.js.map +7 -0
  385. package/cjs/validators/utils/uuid4/index.js +34 -13
  386. package/cjs/validators/utils/uuid4.js.map +7 -0
  387. package/index.d.ts +4 -1
  388. package/index.js +13 -4
  389. package/index.js.map +7 -0
  390. package/inputs/AutoCompleteInput/AutoComplete.stories/index.js +12 -5
  391. package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +2 -1
  392. package/inputs/AutoCompleteInput/AutoComplete.stories.js.map +7 -0
  393. package/inputs/AutoCompleteInput/__stories__/Default/index.js +40 -42
  394. package/inputs/AutoCompleteInput/__stories__/Default.d.ts +3 -2
  395. package/inputs/AutoCompleteInput/__stories__/Default.js.map +7 -0
  396. package/inputs/AutoCompleteInput/__stories__/Multiple/index.js +44 -0
  397. package/inputs/AutoCompleteInput/__stories__/Multiple/package.json +6 -0
  398. package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +3 -0
  399. package/inputs/AutoCompleteInput/__stories__/Multiple.js.map +7 -0
  400. package/inputs/AutoCompleteInput/index.d.ts +2 -2
  401. package/inputs/AutoCompleteInput/index.js +61 -37
  402. package/inputs/AutoCompleteInput/index.js.map +7 -0
  403. package/inputs/AutoCompleteInput/index.test.d.ts +1 -0
  404. package/inputs/Checkboxes/Checkboxes.stories/index.js +14 -7
  405. package/inputs/Checkboxes/Checkboxes.stories.d.ts +3 -3
  406. package/inputs/Checkboxes/Checkboxes.stories.js.map +7 -0
  407. package/inputs/Checkboxes/__stories__/Conditional/index.js +88 -80
  408. package/inputs/Checkboxes/__stories__/Conditional.d.ts +3 -2
  409. package/inputs/Checkboxes/__stories__/Conditional.js.map +7 -0
  410. package/inputs/Checkboxes/__stories__/Default/index.js +40 -36
  411. package/inputs/Checkboxes/__stories__/Default.d.ts +2 -2
  412. package/inputs/Checkboxes/__stories__/Default.js.map +7 -0
  413. package/inputs/Checkboxes/__stories__/WithDivider/index.js +41 -37
  414. package/inputs/Checkboxes/__stories__/WithDivider.d.ts +2 -2
  415. package/inputs/Checkboxes/__stories__/WithDivider.js.map +7 -0
  416. package/inputs/Checkboxes/index.d.ts +2 -1
  417. package/inputs/Checkboxes/index.js +72 -87
  418. package/inputs/Checkboxes/index.js.map +7 -0
  419. package/inputs/Checkboxes/index.test.d.ts +1 -0
  420. package/inputs/DateInput/DateInput.stories/index.js +10 -5
  421. package/inputs/DateInput/DateInput.stories.d.ts +1 -1
  422. package/inputs/DateInput/DateInput.stories.js.map +7 -0
  423. package/inputs/DateInput/__stories__/Default/index.js +18 -18
  424. package/inputs/DateInput/__stories__/Default.d.ts +2 -2
  425. package/inputs/DateInput/__stories__/Default.js.map +7 -0
  426. package/inputs/DateInput/index.d.ts +3 -4
  427. package/inputs/DateInput/index.js +91 -99
  428. package/inputs/DateInput/index.js.map +7 -0
  429. package/inputs/DateInput/index.test.d.ts +1 -0
  430. package/inputs/FileInput/FileInput.stories/index.js +10 -5
  431. package/inputs/FileInput/FileInput.stories.d.ts +1 -1
  432. package/inputs/FileInput/FileInput.stories.js.map +7 -0
  433. package/inputs/FileInput/__stories__/Default/index.js +24 -16
  434. package/inputs/FileInput/__stories__/Default.d.ts +2 -2
  435. package/inputs/FileInput/__stories__/Default.js.map +7 -0
  436. package/inputs/FileInput/index.js +43 -54
  437. package/inputs/FileInput/index.js.map +7 -0
  438. package/inputs/FileInput/index.test.d.ts +1 -0
  439. package/inputs/ImageInput/ImageInput.stories/index.js +14 -7
  440. package/inputs/ImageInput/ImageInput.stories.d.ts +3 -3
  441. package/inputs/ImageInput/ImageInput.stories.js.map +7 -0
  442. package/inputs/ImageInput/__stories__/Default/index.js +25 -23
  443. package/inputs/ImageInput/__stories__/Default.d.ts +2 -2
  444. package/inputs/ImageInput/__stories__/Default.js.map +7 -0
  445. package/inputs/ImageInput/__stories__/MaxSize/index.js +36 -0
  446. package/inputs/ImageInput/__stories__/MaxSize/package.json +6 -0
  447. package/inputs/ImageInput/__stories__/MaxSize.d.ts +3 -0
  448. package/inputs/ImageInput/__stories__/MaxSize.js.map +7 -0
  449. package/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +33 -30
  450. package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +2 -2
  451. package/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +7 -0
  452. package/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +29 -27
  453. package/inputs/ImageInput/__stories__/WithInvalidImageSize.d.ts +2 -2
  454. package/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +7 -0
  455. package/inputs/ImageInput/index.js +58 -75
  456. package/inputs/ImageInput/index.js.map +7 -0
  457. package/inputs/ImageInput/index.test.d.ts +1 -0
  458. package/inputs/Input/Input.stories/index.js +28 -14
  459. package/inputs/Input/Input.stories.d.ts +10 -10
  460. package/inputs/Input/Input.stories.js.map +7 -0
  461. package/inputs/Input/__stories__/AFM/index.js +27 -19
  462. package/inputs/Input/__stories__/AFM.d.ts +2 -2
  463. package/inputs/Input/__stories__/AFM.js.map +7 -0
  464. package/inputs/Input/__stories__/Boolean/index.js +28 -20
  465. package/inputs/Input/__stories__/Boolean.d.ts +2 -2
  466. package/inputs/Input/__stories__/Boolean.js.map +7 -0
  467. package/inputs/Input/__stories__/IBAN/index.js +28 -20
  468. package/inputs/Input/__stories__/IBAN.d.ts +2 -2
  469. package/inputs/Input/__stories__/IBAN.js.map +7 -0
  470. package/inputs/Input/__stories__/Integer/index.js +43 -29
  471. package/inputs/Input/__stories__/Integer.d.ts +2 -2
  472. package/inputs/Input/__stories__/Integer.js.map +7 -0
  473. package/inputs/Input/__stories__/LandlineNumber/index.js +32 -23
  474. package/inputs/Input/__stories__/LandlineNumber.d.ts +2 -2
  475. package/inputs/Input/__stories__/LandlineNumber.js.map +7 -0
  476. package/inputs/Input/__stories__/MobilePhone/index.js +32 -23
  477. package/inputs/Input/__stories__/MobilePhone.d.ts +2 -2
  478. package/inputs/Input/__stories__/MobilePhone.js.map +7 -0
  479. package/inputs/Input/__stories__/PhoneNumber/index.js +31 -22
  480. package/inputs/Input/__stories__/PhoneNumber.d.ts +2 -2
  481. package/inputs/Input/__stories__/PhoneNumber.js.map +7 -0
  482. package/inputs/Input/__stories__/PostalCode/index.js +28 -21
  483. package/inputs/Input/__stories__/PostalCode.d.ts +2 -2
  484. package/inputs/Input/__stories__/PostalCode.js.map +7 -0
  485. package/inputs/Input/__stories__/String/index.js +31 -0
  486. package/inputs/Input/__stories__/String/package.json +6 -0
  487. package/inputs/Input/__stories__/String.d.ts +3 -0
  488. package/inputs/Input/__stories__/String.js.map +7 -0
  489. package/inputs/Input/__stories__/TextWithLimit/index.js +31 -0
  490. package/inputs/Input/__stories__/TextWithLimit/package.json +6 -0
  491. package/inputs/Input/__stories__/TextWithLimit.d.ts +3 -0
  492. package/inputs/Input/__stories__/TextWithLimit.js.map +7 -0
  493. package/inputs/Input/index.js +67 -66
  494. package/inputs/Input/index.js.map +7 -0
  495. package/inputs/Input/index.test.d.ts +1 -0
  496. package/inputs/Input/inputsInputScenarios/index.js +406 -0
  497. package/inputs/Input/inputsInputScenarios/package.json +6 -0
  498. package/inputs/Input/inputsInputScenarios.d.ts +57 -0
  499. package/inputs/Input/inputsInputScenarios.js.map +7 -0
  500. package/inputs/Label/Label.stories/index.js +10 -5
  501. package/inputs/Label/Label.stories.d.ts +1 -1
  502. package/inputs/Label/Label.stories.js.map +7 -0
  503. package/inputs/Label/__stories__/Default/index.js +35 -23
  504. package/inputs/Label/__stories__/Default.d.ts +2 -2
  505. package/inputs/Label/__stories__/Default.js.map +7 -0
  506. package/inputs/Label/index.d.ts +1 -3
  507. package/inputs/Label/index.js +12 -17
  508. package/inputs/Label/index.js.map +7 -0
  509. package/inputs/Label/index.test.d.ts +1 -0
  510. package/inputs/OtpInput/OtpInput.stories/index.js +10 -5
  511. package/inputs/OtpInput/OtpInput.stories.d.ts +1 -1
  512. package/inputs/OtpInput/OtpInput.stories.js.map +7 -0
  513. package/inputs/OtpInput/__stories__/Default/index.js +26 -24
  514. package/inputs/OtpInput/__stories__/Default.d.ts +2 -2
  515. package/inputs/OtpInput/__stories__/Default.js.map +7 -0
  516. package/inputs/OtpInput/index.d.ts +9 -2
  517. package/inputs/OtpInput/index.js +109 -103
  518. package/inputs/OtpInput/index.js.map +7 -0
  519. package/inputs/OtpInput/index.test.d.ts +1 -0
  520. package/inputs/Radio/Radio.stories/index.js +14 -7
  521. package/inputs/Radio/Radio.stories.d.ts +3 -3
  522. package/inputs/Radio/Radio.stories.js.map +7 -0
  523. package/inputs/Radio/__stories__/Conditional/index.js +88 -80
  524. package/inputs/Radio/__stories__/Conditional.d.ts +3 -2
  525. package/inputs/Radio/__stories__/Conditional.js.map +7 -0
  526. package/inputs/Radio/__stories__/Default/index.js +44 -41
  527. package/inputs/Radio/__stories__/Default.d.ts +2 -2
  528. package/inputs/Radio/__stories__/Default.js.map +7 -0
  529. package/inputs/Radio/__stories__/WithDivider/index.js +45 -42
  530. package/inputs/Radio/__stories__/WithDivider.d.ts +2 -2
  531. package/inputs/Radio/__stories__/WithDivider.js.map +7 -0
  532. package/inputs/Radio/index.d.ts +6 -1
  533. package/inputs/Radio/index.js +101 -55
  534. package/inputs/Radio/index.js.map +7 -0
  535. package/inputs/Radio/index.test.d.ts +1 -0
  536. package/inputs/Select/Select.stories/index.js +10 -5
  537. package/inputs/Select/Select.stories.d.ts +1 -1
  538. package/inputs/Select/Select.stories.js.map +7 -0
  539. package/inputs/Select/__stories__/Default/index.js +49 -47
  540. package/inputs/Select/__stories__/Default.d.ts +2 -2
  541. package/inputs/Select/__stories__/Default.js.map +7 -0
  542. package/inputs/Select/index.d.ts +1 -1
  543. package/inputs/Select/index.js +26 -31
  544. package/inputs/Select/index.js.map +7 -0
  545. package/inputs/Select/index.test.d.ts +1 -0
  546. package/inputs/index.js +21 -9
  547. package/inputs/index.js.map +7 -0
  548. package/inputs/inputsScenarios/index.js +499 -0
  549. package/inputs/inputsScenarios/package.json +6 -0
  550. package/inputs/inputsScenarios.d.ts +296 -0
  551. package/inputs/inputsScenarios.js.map +7 -0
  552. package/internal/index.js +10 -34
  553. package/internal.d.ts +2 -31
  554. package/internal.js.map +7 -0
  555. package/lazy/index.js +327 -395
  556. package/lazy.d.ts +41 -31
  557. package/lazy.js.map +7 -0
  558. package/locales/el/index.js +6 -0
  559. package/{Questions/index.spec → locales/el}/package.json +1 -1
  560. package/locales/el.d.ts +2 -0
  561. package/locales/el.js.map +7 -0
  562. package/package.json +7 -8
  563. package/registry/index.js +232 -134
  564. package/registry.d.ts +8 -1
  565. package/registry.js.map +7 -0
  566. package/src/Field/FieldBase.tsx +3 -0
  567. package/src/Field/FieldBaseContainer.tsx +2 -2
  568. package/src/Field/FieldConditional.tsx +5 -1
  569. package/src/Field/index.tsx +22 -3
  570. package/src/Field/types.tsx +68 -5
  571. package/src/Field/utils/calculateField.ts +49 -0
  572. package/src/Field/utils/evaluateFieldWithConditions.ts +30 -0
  573. package/src/Field/utils/index.ts +76 -0
  574. package/src/Field/utils/useField.ts +54 -0
  575. package/src/FieldArray/FieldArray.stories.js +2 -2
  576. package/src/FieldArray/index.test.tsx +25 -0
  577. package/src/FieldArray/index.tsx +20 -9
  578. package/src/FieldObject/index.tsx +18 -5
  579. package/src/Fieldset/index.tsx +5 -5
  580. package/src/Fieldset/types.tsx +5 -3
  581. package/src/FormBuilder/FormBuilder.stories.js +1 -1
  582. package/{FormBuilder/FormBuilder.mdx → src/FormBuilder/doc.mdx} +20 -33
  583. package/src/FormBuilder/index.test.tsx +21 -0
  584. package/src/FormBuilder/index.tsx +177 -1
  585. package/src/FormBuilder/scenarios.test.tsx +1864 -0
  586. package/src/FormContext.tsx +1 -2
  587. package/src/MultiplicityField/MultiplicityField.stories.js +6 -6
  588. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +2 -2
  589. package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
  590. package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
  591. package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
  592. package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
  593. package/src/MultiplicityField/add-objects.tsx +31 -15
  594. package/{MultiplicityField/MultiplicityField.mdx → src/MultiplicityField/doc.mdx} +12 -16
  595. package/src/MultiplicityField/index.test.tsx +41 -0
  596. package/src/MultiplicityField/index.tsx +20 -34
  597. package/src/MultiplicityField/types.ts +21 -0
  598. package/src/Questions/Questions.stories.js +1 -1
  599. package/src/Questions/Questions.tsx +4 -4
  600. package/src/Questions/Step/StepArrayReview.tsx +1 -1
  601. package/src/Questions/Step/StepTitle.tsx +5 -3
  602. package/src/Questions/Step/index.ts +0 -1
  603. package/src/Questions/Step/types.tsx +1 -0
  604. package/src/Questions/__snapshots__/index.spec.tsx.snap +72 -587
  605. package/src/Questions/{index.mdx → doc.mdx} +13 -16
  606. package/src/Questions/index.spec.tsx +9 -5
  607. package/src/Questions/index.test.tsx +21 -0
  608. package/src/Questions/types.tsx +1 -0
  609. package/src/create-simple-form.mdx +2 -6
  610. package/{index.mdx → src/doc.mdx} +4 -8
  611. package/src/index.ts +4 -1
  612. package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +2 -1
  613. package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +19 -18
  614. package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +47 -0
  615. package/src/inputs/AutoCompleteInput/doc.mdx +18 -0
  616. package/src/inputs/AutoCompleteInput/index.test.tsx +25 -0
  617. package/src/inputs/AutoCompleteInput/index.tsx +45 -29
  618. package/src/inputs/Checkboxes/Checkboxes.stories.js +3 -3
  619. package/src/inputs/Checkboxes/__stories__/Conditional.tsx +2 -3
  620. package/src/inputs/Checkboxes/doc.mdx +23 -0
  621. package/src/inputs/Checkboxes/index.test.tsx +29 -0
  622. package/src/inputs/Checkboxes/index.tsx +38 -33
  623. package/src/inputs/DateInput/DateInput.stories.js +1 -1
  624. package/src/inputs/DateInput/__stories__/Default.tsx +16 -15
  625. package/src/inputs/DateInput/doc.mdx +16 -0
  626. package/src/inputs/DateInput/index.test.tsx +21 -0
  627. package/src/inputs/DateInput/index.tsx +8 -6
  628. package/src/inputs/FileInput/FileInput.stories.js +1 -1
  629. package/src/inputs/FileInput/doc.mdx +15 -0
  630. package/src/inputs/FileInput/index.test.tsx +21 -0
  631. package/src/inputs/FileInput/index.tsx +7 -8
  632. package/src/inputs/ImageInput/ImageInput.stories.js +3 -3
  633. package/src/inputs/ImageInput/__stories__/MaxSize.tsx +37 -0
  634. package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +2 -0
  635. package/src/inputs/ImageInput/doc.mdx +23 -0
  636. package/src/inputs/ImageInput/index.test.tsx +33 -0
  637. package/src/inputs/ImageInput/index.tsx +10 -15
  638. package/src/inputs/Input/Input.stories.js +10 -10
  639. package/src/inputs/Input/__stories__/LandlineNumber.tsx +2 -1
  640. package/src/inputs/Input/__stories__/MobilePhone.tsx +1 -0
  641. package/src/inputs/Input/__stories__/PhoneNumber.tsx +1 -0
  642. package/src/inputs/Input/__stories__/PostalCode.tsx +1 -0
  643. package/src/inputs/Input/__stories__/{Default.tsx → String.tsx} +2 -2
  644. package/src/inputs/Input/__stories__/{TextWithCharacterLimit.tsx → TextWithLimit.tsx} +2 -2
  645. package/src/inputs/Input/doc.mdx +56 -0
  646. package/src/inputs/Input/index.test.tsx +57 -0
  647. package/src/inputs/Input/index.tsx +32 -29
  648. package/src/inputs/Input/inputsInputScenarios.ts +404 -0
  649. package/src/inputs/Label/Label.stories.js +1 -1
  650. package/src/inputs/Label/__stories__/Default.tsx +3 -1
  651. package/src/inputs/Label/doc.mdx +14 -0
  652. package/src/inputs/Label/index.test.tsx +21 -0
  653. package/src/inputs/Label/index.tsx +3 -10
  654. package/src/inputs/OtpInput/OtpInput.stories.js +1 -1
  655. package/src/inputs/OtpInput/doc.mdx +16 -0
  656. package/src/inputs/OtpInput/index.test.tsx +21 -0
  657. package/src/inputs/OtpInput/index.tsx +4 -3
  658. package/src/inputs/Radio/Radio.stories.js +3 -3
  659. package/src/inputs/Radio/__stories__/Conditional.tsx +4 -1
  660. package/src/inputs/Radio/doc.mdx +23 -0
  661. package/src/inputs/Radio/index.test.tsx +29 -0
  662. package/src/inputs/Radio/index.tsx +78 -9
  663. package/src/inputs/Select/Select.stories.js +1 -1
  664. package/src/inputs/Select/doc.mdx +13 -0
  665. package/src/inputs/Select/index.test.tsx +21 -0
  666. package/src/inputs/Select/index.tsx +5 -3
  667. package/src/inputs/inputsScenarios.ts +496 -0
  668. package/src/installation.mdx +2 -5
  669. package/src/internal.ts +2 -31
  670. package/src/lazy.js +322 -59
  671. package/src/locales/el.ts +3 -0
  672. package/src/registry.js +129 -41
  673. package/src/types.tsx +11 -64
  674. package/src/utils.ts +34 -33
  675. package/src/validators/index.ts +38 -71
  676. package/src/validators/utils/date.ts +107 -0
  677. package/src/validators/utils/file.ts +11 -9
  678. package/src/validators/utils/index.ts +1 -0
  679. package/src/validators/utils/phone.ts +63 -72
  680. package/src/validators/utils/postal_code.ts +1 -1
  681. package/src/validators/utils/uuid4.ts +2 -1
  682. package/src/validators/validators.spec.ts +6 -40
  683. package/types/index.js +2 -1
  684. package/types.d.ts +6 -35
  685. package/types.js.map +7 -0
  686. package/utils/index.js +57 -77
  687. package/utils.js.map +7 -0
  688. package/validators/index.js +92 -148
  689. package/validators/index.js.map +7 -0
  690. package/validators/types/index.js +1 -1
  691. package/validators/types.js.map +7 -0
  692. package/validators/utils/afm/index.js +16 -16
  693. package/validators/utils/afm.js.map +7 -0
  694. package/validators/utils/date/index.js +103 -0
  695. package/validators/utils/date/package.json +6 -0
  696. package/validators/utils/date.d.ts +9 -0
  697. package/validators/utils/date.js.map +7 -0
  698. package/validators/utils/file/index.js +22 -42
  699. package/validators/utils/file.js.map +7 -0
  700. package/validators/utils/iban/index.js +14 -12
  701. package/validators/utils/iban.js.map +7 -0
  702. package/validators/utils/image/index.js +66 -106
  703. package/validators/utils/image.js.map +7 -0
  704. package/validators/utils/index.d.ts +1 -0
  705. package/validators/utils/index.js +55 -48
  706. package/validators/utils/index.js.map +7 -0
  707. package/validators/utils/int/index.js +12 -7
  708. package/validators/utils/int.js.map +7 -0
  709. package/validators/utils/number/index.js +11 -6
  710. package/validators/utils/number.js.map +7 -0
  711. package/validators/utils/otp/index.js +13 -8
  712. package/validators/utils/otp.js.map +7 -0
  713. package/validators/utils/phone/index.js +89 -51
  714. package/validators/utils/phone.d.ts +1 -1
  715. package/validators/utils/phone.js.map +7 -0
  716. package/validators/utils/postal_code/index.js +14 -11
  717. package/validators/utils/postal_code.d.ts +1 -1
  718. package/validators/utils/postal_code.js.map +7 -0
  719. package/validators/utils/text_limit/index.js +18 -20
  720. package/validators/utils/text_limit.js.map +7 -0
  721. package/validators/utils/uuid4/index.js +12 -8
  722. package/validators/utils/uuid4.js.map +7 -0
  723. package/Field/utils.d.ts +0 -5
  724. package/FieldArray/FieldArray.stories.playwright.json +0 -353
  725. package/FormBuilder/FormBuilder/index.js +0 -152
  726. package/FormBuilder/FormBuilder.d.ts +0 -5
  727. package/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  728. package/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  729. package/Questions/__snapshots__/index.spec.tsx.snap +0 -596
  730. package/Questions/index.mdx +0 -415
  731. package/Questions/index.spec/index.js +0 -59
  732. package/cjs/Field/index.mdx +0 -6
  733. package/cjs/FieldArray/FieldArray.stories.playwright.json +0 -353
  734. package/cjs/FormBuilder/FormBuilder/index.js +0 -162
  735. package/cjs/FormBuilder/FormBuilder.mdx +0 -256
  736. package/cjs/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  737. package/cjs/MultiplicityField/MultiplicityField.mdx +0 -590
  738. package/cjs/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  739. package/cjs/Questions/__snapshots__/index.spec.tsx.snap +0 -596
  740. package/cjs/Questions/index.mdx +0 -415
  741. package/cjs/Questions/index.spec/index.js +0 -63
  742. package/cjs/create-simple-form.mdx +0 -539
  743. package/cjs/index.mdx +0 -51
  744. package/cjs/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  745. package/cjs/inputs/Checkboxes/index.mdx +0 -0
  746. package/cjs/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  747. package/cjs/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  748. package/cjs/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  749. package/cjs/inputs/Input/Input.stories.playwright.json +0 -376
  750. package/cjs/inputs/Input/__stories__/Default/index.js +0 -33
  751. package/cjs/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -39
  752. package/cjs/inputs/Input/index.mdx +0 -8
  753. package/cjs/inputs/Label/Label.stories.playwright.json +0 -40
  754. package/cjs/inputs/Label/index.mdx +0 -0
  755. package/cjs/inputs/Radio/Radio.stories.playwright.json +0 -73
  756. package/cjs/inputs/Radio/index.mdx +0 -0
  757. package/cjs/inputs/Select/Select.stories.playwright.json +0 -22
  758. package/cjs/installation.mdx +0 -68
  759. package/cjs/validators/validators.spec/index.js +0 -87
  760. package/create-simple-form.mdx +0 -539
  761. package/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  762. package/inputs/Checkboxes/index.mdx +0 -0
  763. package/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  764. package/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  765. package/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  766. package/inputs/Input/Input.stories.playwright.json +0 -376
  767. package/inputs/Input/__stories__/Default/index.js +0 -23
  768. package/inputs/Input/__stories__/Default.d.ts +0 -3
  769. package/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -29
  770. package/inputs/Input/__stories__/TextWithCharacterLimit/package.json +0 -6
  771. package/inputs/Input/__stories__/TextWithCharacterLimit.d.ts +0 -3
  772. package/inputs/Input/index.mdx +0 -8
  773. package/inputs/Label/Label.stories.playwright.json +0 -40
  774. package/inputs/Label/index.mdx +0 -0
  775. package/inputs/Radio/Radio.stories.playwright.json +0 -73
  776. package/inputs/Radio/index.mdx +0 -0
  777. package/inputs/Select/Select.stories.playwright.json +0 -22
  778. package/installation.mdx +0 -68
  779. package/src/Field/index.mdx +0 -6
  780. package/src/Field/utils.ts +0 -191
  781. package/src/FieldArray/FieldArray.stories.playwright.json +0 -353
  782. package/src/FormBuilder/FormBuilder.mdx +0 -256
  783. package/src/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  784. package/src/FormBuilder/FormBuilder.tsx +0 -166
  785. package/src/MultiplicityField/MultiplicityField.mdx +0 -590
  786. package/src/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  787. package/src/index.mdx +0 -51
  788. package/src/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  789. package/src/inputs/Checkboxes/index.mdx +0 -0
  790. package/src/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  791. package/src/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  792. package/src/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  793. package/src/inputs/Input/Input.stories.playwright.json +0 -376
  794. package/src/inputs/Input/index.mdx +0 -8
  795. package/src/inputs/Label/Label.stories.playwright.json +0 -40
  796. package/src/inputs/Label/index.mdx +0 -0
  797. package/src/inputs/Radio/Radio.stories.playwright.json +0 -73
  798. package/src/inputs/Radio/index.mdx +0 -0
  799. package/src/inputs/Select/Select.stories.playwright.json +0 -22
  800. package/validators/validators.spec/index.js +0 -85
  801. /package/{Field/index.mdx → src/Field/doc.mdx} +0 -0
@@ -1,35 +1,65 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: 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 });
10
+ };
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var PostalCode_exports = {};
29
+ __export(PostalCode_exports, {
30
+ PostalCode: () => PostalCode,
31
+ default: () => PostalCode_default
7
32
  });
8
- exports["default"] = exports.PostalCode = void 0;
9
- var _react = _interopRequireDefault(require("react"));
10
- var _form = _interopRequireWildcard(require("@digigov/form"));
11
- var _Button = require("@digigov/ui/cjs/form/Button");
12
- 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); }
13
- 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; }
14
- var _ref = /*#__PURE__*/_react["default"].createElement(_Button.Button, {
15
- type: "submit"
16
- }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
17
- var PostalCode = exports.PostalCode = function PostalCode() {
18
- return /*#__PURE__*/_react["default"].createElement(_form["default"], {
19
- onSubmit: function onSubmit(data) {
33
+ module.exports = __toCommonJS(PostalCode_exports);
34
+ var import_react = __toESM(require("react"));
35
+ var import_form = __toESM(require("@digigov/form"));
36
+ var import_Button = require("@digigov/ui/form/Button");
37
+ const PostalCode = () => /* @__PURE__ */ import_react.default.createElement(
38
+ import_form.default,
39
+ {
40
+ onSubmit: (data) => {
20
41
  console.log(data);
21
42
  }
22
- }, /*#__PURE__*/_react["default"].createElement(_form.Field, {
23
- key: "postal-code",
24
- name: "postal-code",
25
- type: "postal_code",
26
- label: {
27
- primary: 'Ταχυδρομικός κωδικός'
28
- },
29
- required: true,
30
- extra: {
31
- countries: ['GR']
43
+ },
44
+ /* @__PURE__ */ import_react.default.createElement(
45
+ import_form.Field,
46
+ {
47
+ key: "postal-code",
48
+ name: "postal-code",
49
+ type: "postal_code",
50
+ autoComplete: "postal-code",
51
+ label: {
52
+ primary: "\u03A4\u03B1\u03C7\u03C5\u03B4\u03C1\u03BF\u03BC\u03B9\u03BA\u03CC\u03C2 \u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2"
53
+ },
54
+ required: true,
55
+ extra: { countries: ["GR"] }
32
56
  }
33
- }), _ref);
34
- };
35
- var _default = exports["default"] = PostalCode;
57
+ ),
58
+ /* @__PURE__ */ import_react.default.createElement(import_Button.Button, { type: "submit" }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1")
59
+ );
60
+ var PostalCode_default = PostalCode;
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ PostalCode
64
+ });
65
+ //# sourceMappingURL=PostalCode.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/inputs/Input/__stories__/PostalCode.tsx"],
4
+ "sourcesContent": ["import React from 'react';\nimport FormBuilder, { Field } from '@digigov/form';\nimport { Button } from '@digigov/ui/form/Button';\n\nexport const PostalCode = () => (\n <FormBuilder\n onSubmit={(data) => {\n console.log(data);\n }}\n >\n <Field\n key=\"postal-code\"\n name=\"postal-code\"\n type=\"postal_code\"\n autoComplete=\"postal-code\"\n label={{\n primary: '\u03A4\u03B1\u03C7\u03C5\u03B4\u03C1\u03BF\u03BC\u03B9\u03BA\u03CC\u03C2 \u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2',\n }}\n required\n extra={{ countries: ['GR'] }}\n />\n <Button type=\"submit\">\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1</Button>\n </FormBuilder>\n);\nexport default PostalCode;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAmC;AACnC,oBAAuB;AAEhB,MAAM,aAAa,MACxB,6BAAAA,QAAA;AAAA,EAAC,YAAAC;AAAA,EAAA;AAAA,IACC,UAAU,CAAC,SAAS;AAClB,cAAQ,IAAI,IAAI;AAAA,IAClB;AAAA;AAAA,EAEA,6BAAAD,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,KAAI;AAAA,MACJ,MAAK;AAAA,MACL,MAAK;AAAA,MACL,cAAa;AAAA,MACb,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,MACA,UAAQ;AAAA,MACR,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE;AAAA;AAAA,EAC7B;AAAA,EACA,6BAAAA,QAAA,cAAC,wBAAO,MAAK,YAAS,kDAAQ;AAChC;AAEF,IAAO,qBAAQ;",
6
+ "names": ["React", "FormBuilder"]
7
+ }
@@ -0,0 +1,64 @@
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 });
10
+ };
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var String_exports = {};
29
+ __export(String_exports, {
30
+ String: () => String,
31
+ default: () => String_default
32
+ });
33
+ module.exports = __toCommonJS(String_exports);
34
+ var import_react = __toESM(require("react"));
35
+ var import_form = __toESM(require("@digigov/form"));
36
+ var import_Button = require("@digigov/ui/form/Button");
37
+ const String = () => /* @__PURE__ */ import_react.default.createElement(
38
+ import_form.default,
39
+ {
40
+ onSubmit: (data) => {
41
+ console.log(data);
42
+ }
43
+ },
44
+ /* @__PURE__ */ import_react.default.createElement(
45
+ import_form.Field,
46
+ {
47
+ key: "business-title",
48
+ name: "business-title",
49
+ type: "string",
50
+ label: {
51
+ primary: "\u038C\u03BD\u03BF\u03BC\u03B1 \u03B5\u03C0\u03B9\u03C7\u03B5\u03AF\u03C1\u03B7\u03C3\u03B7\u03C2",
52
+ secondary: "\u0395\u03B9\u03C3\u03AC\u03B3\u03B5\u03C4\u03B5 \u03BC\u03B9\u03B1 \u03C3\u03B5\u03B9\u03C1\u03AC \u03B1\u03C0\u03CC \u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2 \u03BA\u03B1\u03B9 \u03B1\u03C1\u03B9\u03B8\u03BC\u03BF\u03CD\u03C2"
53
+ },
54
+ required: true
55
+ }
56
+ ),
57
+ /* @__PURE__ */ import_react.default.createElement(import_Button.Button, { type: "submit" }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1")
58
+ );
59
+ var String_default = String;
60
+ // Annotate the CommonJS export names for ESM import in node:
61
+ 0 && (module.exports = {
62
+ String
63
+ });
64
+ //# sourceMappingURL=String.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/inputs/Input/__stories__/String.tsx"],
4
+ "sourcesContent": ["import React from 'react';\nimport FormBuilder, { Field } from '@digigov/form';\nimport { Button } from '@digigov/ui/form/Button';\n\nexport const String = () => (\n <FormBuilder\n onSubmit={(data) => {\n console.log(data);\n }}\n >\n <Field\n key=\"business-title\"\n name=\"business-title\"\n type=\"string\"\n label={{\n primary: '\u038C\u03BD\u03BF\u03BC\u03B1 \u03B5\u03C0\u03B9\u03C7\u03B5\u03AF\u03C1\u03B7\u03C3\u03B7\u03C2',\n secondary: '\u0395\u03B9\u03C3\u03AC\u03B3\u03B5\u03C4\u03B5 \u03BC\u03B9\u03B1 \u03C3\u03B5\u03B9\u03C1\u03AC \u03B1\u03C0\u03CC \u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2 \u03BA\u03B1\u03B9 \u03B1\u03C1\u03B9\u03B8\u03BC\u03BF\u03CD\u03C2',\n }}\n required\n />\n <Button type=\"submit\">\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1</Button>\n </FormBuilder>\n);\nexport default String;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAmC;AACnC,oBAAuB;AAEhB,MAAM,SAAS,MACpB,6BAAAA,QAAA;AAAA,EAAC,YAAAC;AAAA,EAAA;AAAA,IACC,UAAU,CAAC,SAAS;AAClB,cAAQ,IAAI,IAAI;AAAA,IAClB;AAAA;AAAA,EAEA,6BAAAD,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,KAAI;AAAA,MACJ,MAAK;AAAA,MACL,MAAK;AAAA,MACL,OAAO;AAAA,QACL,SAAS;AAAA,QACT,WAAW;AAAA,MACb;AAAA,MACA,UAAQ;AAAA;AAAA,EACV;AAAA,EACA,6BAAAA,QAAA,cAAC,wBAAO,MAAK,YAAS,kDAAQ;AAChC;AAEF,IAAO,iBAAQ;",
6
+ "names": ["React", "FormBuilder"]
7
+ }
@@ -0,0 +1,64 @@
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 });
10
+ };
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var TextWithLimit_exports = {};
29
+ __export(TextWithLimit_exports, {
30
+ TextWithLimit: () => TextWithLimit,
31
+ default: () => TextWithLimit_default
32
+ });
33
+ module.exports = __toCommonJS(TextWithLimit_exports);
34
+ var import_react = __toESM(require("react"));
35
+ var import_form = __toESM(require("@digigov/form"));
36
+ var import_form2 = require("@digigov/ui/form");
37
+ const TextWithLimit = () => /* @__PURE__ */ import_react.default.createElement(
38
+ import_form.default,
39
+ {
40
+ onSubmit: (data) => {
41
+ console.log(data);
42
+ }
43
+ },
44
+ /* @__PURE__ */ import_react.default.createElement(
45
+ import_form.Field,
46
+ {
47
+ key: "text",
48
+ name: "text",
49
+ type: "text",
50
+ label: {
51
+ primary: "\u039C\u03C0\u03BF\u03C1\u03B5\u03AF\u03C4\u03B5 \u03BD\u03B1 \u03B4\u03CE\u03C3\u03B5\u03C4\u03B5 \u03C0\u03B5\u03C1\u03B9\u03C3\u03C3\u03CC\u03C4\u03B5\u03C1\u03B5\u03C2 \u03C0\u03BB\u03B7\u03C1\u03BF\u03C6\u03BF\u03C1\u03AF\u03B5\u03C2;"
52
+ },
53
+ required: true,
54
+ extra: { limit: { min: 3, max: 10 }, multiline: true }
55
+ }
56
+ ),
57
+ /* @__PURE__ */ import_react.default.createElement(import_form2.Button, { type: "submit" }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1")
58
+ );
59
+ var TextWithLimit_default = TextWithLimit;
60
+ // Annotate the CommonJS export names for ESM import in node:
61
+ 0 && (module.exports = {
62
+ TextWithLimit
63
+ });
64
+ //# sourceMappingURL=TextWithLimit.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/inputs/Input/__stories__/TextWithLimit.tsx"],
4
+ "sourcesContent": ["import React from 'react';\nimport FormBuilder, { Field } from '@digigov/form';\nimport { Button } from '@digigov/ui/form';\n\nexport const TextWithLimit = () => (\n <FormBuilder\n onSubmit={(data) => {\n console.log(data);\n }}\n >\n <Field\n key=\"text\"\n name=\"text\"\n type=\"text\"\n label={{\n primary: '\u039C\u03C0\u03BF\u03C1\u03B5\u03AF\u03C4\u03B5 \u03BD\u03B1 \u03B4\u03CE\u03C3\u03B5\u03C4\u03B5 \u03C0\u03B5\u03C1\u03B9\u03C3\u03C3\u03CC\u03C4\u03B5\u03C1\u03B5\u03C2 \u03C0\u03BB\u03B7\u03C1\u03BF\u03C6\u03BF\u03C1\u03AF\u03B5\u03C2;',\n }}\n required\n extra={{ limit: { min: 3, max: 10 }, multiline: true }}\n />\n <Button type=\"submit\">\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1</Button>\n </FormBuilder>\n);\nexport default TextWithLimit;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAmC;AACnC,IAAAA,eAAuB;AAEhB,MAAM,gBAAgB,MAC3B,6BAAAC,QAAA;AAAA,EAAC,YAAAC;AAAA,EAAA;AAAA,IACC,UAAU,CAAC,SAAS;AAClB,cAAQ,IAAI,IAAI;AAAA,IAClB;AAAA;AAAA,EAEA,6BAAAD,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,KAAI;AAAA,MACJ,MAAK;AAAA,MACL,MAAK;AAAA,MACL,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,MACA,UAAQ;AAAA,MACR,OAAO,EAAE,OAAO,EAAE,KAAK,GAAG,KAAK,GAAG,GAAG,WAAW,KAAK;AAAA;AAAA,EACvD;AAAA,EACA,6BAAAA,QAAA,cAAC,uBAAO,MAAK,YAAS,kDAAQ;AAChC;AAEF,IAAO,wBAAQ;",
6
+ "names": ["import_form", "React", "FormBuilder"]
7
+ }
@@ -1,76 +1,103 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: 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 });
10
+ };
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var Input_exports = {};
29
+ __export(Input_exports, {
30
+ Input: () => Input,
31
+ default: () => Input_default
6
32
  });
7
- exports["default"] = exports.Input = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _reactHookForm = require("react-hook-form");
12
- var _Hint = require("@digigov/react-core/cjs/Hint");
13
- var _TextArea = _interopRequireDefault(require("@digigov/react-core/cjs/TextArea"));
14
- var _TextInput = _interopRequireDefault(require("@digigov/react-core/cjs/TextInput"));
15
- var _i18n = require("@digigov/ui/cjs/i18n");
16
- var _excluded = ["name", "control", "type", "extra"];
17
- var TYPES_MAP = {
18
- string: 'text',
19
- "int": 'text',
20
- text: 'text',
21
- date: 'date'
33
+ module.exports = __toCommonJS(Input_exports);
34
+ var import_react = __toESM(require("react"));
35
+ var import_react_hook_form = require("react-hook-form");
36
+ var import_TextArea = require("@digigov/ui/form/TextArea");
37
+ var import_TextInput = require("@digigov/ui/form/TextInput");
38
+ var import_i18n = require("@digigov/ui/i18n");
39
+ var import_Hint = require("@digigov/ui/typography/Hint");
40
+ const TYPES_MAP = {
41
+ string: "text",
42
+ int: "text",
43
+ text: "text",
44
+ date: "date"
22
45
  };
23
- var Input = exports.Input = /*#__PURE__*/_react["default"].forwardRef(function WrappedInput(_ref, ref) {
24
- var name = _ref.name,
25
- control = _ref.control,
26
- type = _ref.type,
27
- extra = _ref.extra,
28
- props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
29
- // eslint-disable-next-line prefer-const
30
- var _ref2 = extra || {},
31
- _ref2$multiline = _ref2.multiline,
32
- multiline = _ref2$multiline === void 0 ? false : _ref2$multiline,
33
- rows = _ref2.rows,
34
- limit = _ref2.limit;
35
- var _ref3 = extra || {},
36
- className = _ref3.className;
37
- // if enforced to multiline use true. Derive from type otherwise.
38
- multiline = multiline === true || type === 'text';
39
- // use explicit rows value if set. Derive from multiline otherwise.
40
- rows = rows || (multiline ? 4 : 1);
41
- // translate dilosi type to HTML Input type
42
- var fieldType = TYPES_MAP[type || 'text'] || 'text';
43
- var _useTranslation = (0, _i18n.useTranslation)(),
44
- t = _useTranslation.t;
45
- var currentValue = (0, _reactHookForm.useWatch)({
46
- control: control,
47
- name: name
48
- });
49
- if (multiline === true) {
50
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_TextArea["default"], (0, _extends2["default"])({
51
- name: name,
52
- className: className,
53
- rows: rows,
54
- ref: ref
55
- }, (0, _extends2["default"])({}, props, {
56
- reset: undefined,
57
- required: undefined,
58
- type: fieldType
59
- }))), (limit === null || limit === void 0 ? void 0 : limit.max) && /*#__PURE__*/_react["default"].createElement(_Hint.Hint, null, currentValue === undefined || (currentValue === null || currentValue === void 0 ? void 0 : currentValue.length) >= 0 && (currentValue === null || currentValue === void 0 ? void 0 : currentValue.length) <= (limit === null || limit === void 0 ? void 0 : limit.max) ? /*#__PURE__*/_react["default"].createElement("span", null, t('form.info.text.you_have'), ' ', /*#__PURE__*/_react["default"].createElement("b", null, !currentValue ? limit.max : (limit === null || limit === void 0 ? void 0 : limit.max) - (currentValue === null || currentValue === void 0 ? void 0 : currentValue.length)), ' ', currentValue && (limit === null || limit === void 0 ? void 0 : limit.max) - (currentValue === null || currentValue === void 0 ? void 0 : currentValue.length) === 1 ? "".concat(t('form.info.text.character')) : "".concat(t('form.info.text.characters')), ' ', t('form.info.text.remaining'), ".") : /*#__PURE__*/_react["default"].createElement("span", {
60
- style: {
61
- color: '#b60202'
46
+ const Input = import_react.default.forwardRef(
47
+ function WrappedInput({ name, control, type, extra, ...props }, ref) {
48
+ let { multiline = false, rows, limit } = extra || {};
49
+ const { className } = extra || {};
50
+ multiline = multiline === true || type === "text";
51
+ rows = rows || (multiline ? 4 : 1);
52
+ const fieldType = TYPES_MAP[type || "text"] || "text";
53
+ const { t } = (0, import_i18n.useTranslation)();
54
+ const currentValue = (0, import_react_hook_form.useWatch)({ control, name });
55
+ const getRemainingChars = (currentValue2, limit2) => {
56
+ if (currentValue2) {
57
+ return limit2?.max - currentValue2.length;
62
58
  }
63
- }, t('form.info.text.you_have'), ' ', /*#__PURE__*/_react["default"].createElement("b", null, currentValue && (currentValue === null || currentValue === void 0 ? void 0 : currentValue.length) - (limit === null || limit === void 0 ? void 0 : limit.max)), ' ', (currentValue === null || currentValue === void 0 ? void 0 : currentValue.length) - (limit === null || limit === void 0 ? void 0 : limit.max) === 1 ? "".concat(t('form.info.text.character')) : "".concat(t('form.info.text.characters')), ' ', t('form.info.text.too_many'), ".")));
64
- } else {
65
- return /*#__PURE__*/_react["default"].createElement(_TextInput["default"], (0, _extends2["default"])({
66
- name: name,
67
- type: fieldType,
68
- className: className,
69
- ref: ref
70
- }, (0, _extends2["default"])({}, props, {
71
- reset: undefined,
72
- required: undefined
73
- })));
59
+ return limit2?.max;
60
+ };
61
+ const constructRemainingText = (currentValue2, limit2) => {
62
+ const remainingChars = getRemainingChars(currentValue2, limit2);
63
+ let remainingText = Math.abs(remainingChars) === 1 ? t("form.info.text.character") : t("form.info.text.characters");
64
+ remainingText += remainingChars > 0 ? ` ${t("form.info.text.remaining")}.` : ` ${t("form.info.text.too_many")}.`;
65
+ return remainingText;
66
+ };
67
+ if (multiline === true) {
68
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
69
+ import_TextArea.TextArea,
70
+ {
71
+ name,
72
+ className,
73
+ rows,
74
+ ref,
75
+ ...{
76
+ ...props,
77
+ reset: void 0,
78
+ required: void 0,
79
+ type: fieldType
80
+ }
81
+ }
82
+ ), limit?.max && /* @__PURE__ */ import_react.default.createElement(import_Hint.Hint, { display: "flex" }, t("form.info.text.you_have"), /* @__PURE__ */ import_react.default.createElement(import_Hint.Hint, { fontWeight: "bold" }, "\xA0", `${Math.abs(getRemainingChars(currentValue, limit))}`, "\xA0"), constructRemainingText(currentValue, limit)));
83
+ } else {
84
+ return /* @__PURE__ */ import_react.default.createElement(
85
+ import_TextInput.TextInput,
86
+ {
87
+ name,
88
+ type: fieldType,
89
+ "data-type": type,
90
+ className,
91
+ ref,
92
+ ...{ ...props, reset: void 0, required: void 0 }
93
+ }
94
+ );
95
+ }
74
96
  }
97
+ );
98
+ var Input_default = Input;
99
+ // Annotate the CommonJS export names for ESM import in node:
100
+ 0 && (module.exports = {
101
+ Input
75
102
  });
76
- var _default = exports["default"] = Input;
103
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inputs/Input/index.tsx"],
4
+ "sourcesContent": ["import React from 'react';\nimport { useWatch } from 'react-hook-form';\nimport { UncontrolledFieldProps } from '@digigov/form/Field/types';\nimport { TextArea } from '@digigov/ui/form/TextArea';\nimport { TextInput } from '@digigov/ui/form/TextInput';\nimport { useTranslation } from '@digigov/ui/i18n';\nimport { Hint } from '@digigov/ui/typography/Hint';\n\nconst TYPES_MAP = {\n string: 'text',\n int: 'text',\n text: 'text',\n date: 'date',\n};\n\nexport interface InputProps extends Omit<UncontrolledFieldProps, 'extra'> {\n extra?: {\n fullWidth?: boolean;\n multiline?: boolean;\n className?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rows?: any;\n limit: {\n min?: number;\n max?: number;\n };\n };\n}\n\nexport const Input: React.ExoticComponent<InputProps> = React.forwardRef(\n function WrappedInput({ name, control, type, extra, ...props }, ref: never) {\n // eslint-disable-next-line prefer-const\n let { multiline = false, rows, limit } = extra || {};\n const { className } = extra || {};\n // if enforced to multiline use true. Derive from type otherwise.\n multiline = multiline === true || type === 'text';\n // use explicit rows value if set. Derive from multiline otherwise.\n rows = rows || (multiline ? 4 : 1);\n // translate dilosi type to HTML Input type\n const fieldType = TYPES_MAP[type || 'text'] || 'text';\n const { t } = useTranslation();\n const currentValue: string | '' = useWatch({ control, name });\n\n const getRemainingChars = (currentValue, limit) => {\n if (currentValue) {\n return limit?.max - currentValue.length;\n }\n return limit?.max;\n };\n\n const constructRemainingText = (currentValue, limit) => {\n const remainingChars = getRemainingChars(currentValue, limit);\n let remainingText =\n Math.abs(remainingChars) === 1\n ? t('form.info.text.character')\n : t('form.info.text.characters');\n remainingText +=\n remainingChars > 0\n ? ` ${t('form.info.text.remaining')}.`\n : ` ${t('form.info.text.too_many')}.`;\n return remainingText;\n };\n\n if (multiline === true) {\n return (\n <>\n <TextArea\n name={name}\n className={className}\n rows={rows}\n ref={ref}\n {...{\n ...props,\n reset: undefined,\n required: undefined,\n type: fieldType,\n }}\n />\n {limit?.max && (\n <Hint display={'flex'}>\n {t('form.info.text.you_have')}\n <Hint fontWeight=\"bold\">\n &nbsp;{`${Math.abs(getRemainingChars(currentValue, limit))}`}\n &nbsp;\n </Hint>\n {constructRemainingText(currentValue, limit)}\n </Hint>\n )}\n </>\n );\n } else {\n return (\n <TextInput\n name={name}\n type={fieldType}\n data-type={type}\n className={className}\n ref={ref}\n {...{ ...props, reset: undefined, required: undefined }}\n />\n );\n }\n }\n);\n\nexport default Input;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,6BAAyB;AAEzB,sBAAyB;AACzB,uBAA0B;AAC1B,kBAA+B;AAC/B,kBAAqB;AAErB,MAAM,YAAY;AAAA,EAChB,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AACR;AAgBO,MAAM,QAA2C,aAAAA,QAAM;AAAA,EAC5D,SAAS,aAAa,EAAE,MAAM,SAAS,MAAM,OAAO,GAAG,MAAM,GAAG,KAAY;AAE1E,QAAI,EAAE,YAAY,OAAO,MAAM,MAAM,IAAI,SAAS,CAAC;AACnD,UAAM,EAAE,UAAU,IAAI,SAAS,CAAC;AAEhC,gBAAY,cAAc,QAAQ,SAAS;AAE3C,WAAO,SAAS,YAAY,IAAI;AAEhC,UAAM,YAAY,UAAU,QAAQ,MAAM,KAAK;AAC/C,UAAM,EAAE,EAAE,QAAI,4BAAe;AAC7B,UAAM,mBAA4B,iCAAS,EAAE,SAAS,KAAK,CAAC;AAE5D,UAAM,oBAAoB,CAACC,eAAcC,WAAU;AACjD,UAAID,eAAc;AAChB,eAAOC,QAAO,MAAMD,cAAa;AAAA,MACnC;AACA,aAAOC,QAAO;AAAA,IAChB;AAEA,UAAM,yBAAyB,CAACD,eAAcC,WAAU;AACtD,YAAM,iBAAiB,kBAAkBD,eAAcC,MAAK;AAC5D,UAAI,gBACF,KAAK,IAAI,cAAc,MAAM,IACzB,EAAE,0BAA0B,IAC5B,EAAE,2BAA2B;AACnC,uBACE,iBAAiB,IACb,IAAI,EAAE,0BAA0B,CAAC,MACjC,IAAI,EAAE,yBAAyB,CAAC;AACtC,aAAO;AAAA,IACT;AAEA,QAAI,cAAc,MAAM;AACtB,aACE,6BAAAF,QAAA,2BAAAA,QAAA,gBACE,6BAAAA,QAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACC,GAAG;AAAA,YACF,GAAG;AAAA,YACH,OAAO;AAAA,YACP,UAAU;AAAA,YACV,MAAM;AAAA,UACR;AAAA;AAAA,MACF,GACC,OAAO,OACN,6BAAAA,QAAA,cAAC,oBAAK,SAAS,UACZ,EAAE,yBAAyB,GAC5B,6BAAAA,QAAA,cAAC,oBAAK,YAAW,UAAO,QACf,GAAG,KAAK,IAAI,kBAAkB,cAAc,KAAK,CAAC,CAAC,IAAG,MAE/D,GACC,uBAAuB,cAAc,KAAK,CAC7C,CAEJ;AAAA,IAEJ,OAAO;AACL,aACE,6BAAAA,QAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,MAAM;AAAA,UACN,aAAW;AAAA,UACX;AAAA,UACA;AAAA,UACC,GAAG,EAAE,GAAG,OAAO,OAAO,QAAW,UAAU,OAAU;AAAA;AAAA,MACxD;AAAA,IAEJ;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;",
6
+ "names": ["React", "currentValue", "limit"]
7
+ }