@digigov/form 1.0.0-a131264d → 1.0.0-b0737a96

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 (447) hide show
  1. package/Field/FieldBase.js +14 -31
  2. package/Field/FieldBaseContainer.js +19 -41
  3. package/Field/FieldConditional.js +14 -33
  4. package/Field/index.js +18 -45
  5. package/Field/package.json +6 -0
  6. package/Field/types.js +1 -5
  7. package/Field/utils.js +30 -63
  8. package/FieldArray/FieldArray.stories.js +5 -42
  9. package/FieldArray/__stories__/Default.js +11 -32
  10. package/FieldArray/__stories__/WithExactLength.js +11 -32
  11. package/FieldArray/index.js +19 -41
  12. package/FieldArray/package.json +6 -0
  13. package/FieldObject/index.js +16 -41
  14. package/FieldObject/package.json +6 -0
  15. package/Fieldset/FieldsetWithContext.js +13 -35
  16. package/Fieldset/index.js +21 -51
  17. package/Fieldset/package.json +6 -0
  18. package/Fieldset/types.js +1 -5
  19. package/Form.stories.js +2 -9
  20. package/FormBuilder/FormBuilder.js +33 -62
  21. package/FormBuilder/FormBuilder.stories.js +4 -28
  22. package/FormBuilder/__stories__/Default.js +8 -29
  23. package/FormBuilder/index.js +2 -11
  24. package/FormBuilder/package.json +6 -0
  25. package/FormContext.js +3 -12
  26. package/MultiplicityField/MultiplicityField.stories.js +9 -98
  27. package/MultiplicityField/__stories__/Default.js +11 -32
  28. package/MultiplicityField/__stories__/PreviewDisplay.js +29 -52
  29. package/MultiplicityField/__stories__/WithExactLength.js +11 -32
  30. package/MultiplicityField/__stories__/WithMaxLength.js +11 -32
  31. package/MultiplicityField/__stories__/WithMinAndMaxLength.js +11 -32
  32. package/MultiplicityField/__stories__/WithMinLength.js +11 -32
  33. package/MultiplicityField/add-objects.js +25 -49
  34. package/MultiplicityField/index.js +26 -55
  35. package/MultiplicityField/package.json +6 -0
  36. package/Questions/Questions.js +14 -35
  37. package/Questions/Questions.stories.js +4 -28
  38. package/Questions/QuestionsContext.js +3 -12
  39. package/Questions/Step/ReviewStep.js +21 -47
  40. package/Questions/Step/Step.js +18 -42
  41. package/Questions/Step/StepArrayReview.js +23 -52
  42. package/Questions/Step/StepContext.js +3 -13
  43. package/Questions/Step/StepDescription.js +14 -42
  44. package/Questions/Step/StepForm.js +19 -45
  45. package/Questions/Step/StepQuote.js +8 -23
  46. package/Questions/Step/StepTitle.js +17 -48
  47. package/Questions/Step/getAddMoreFields.js +2 -11
  48. package/Questions/Step/index.js +13 -170
  49. package/Questions/Step/package.json +6 -0
  50. package/Questions/Step/types.js +1 -5
  51. package/Questions/__stories__/Default.js +24 -51
  52. package/Questions/getNextStep.js +1 -8
  53. package/Questions/index.js +3 -25
  54. package/Questions/index.spec.js +12 -23
  55. package/Questions/package.json +6 -0
  56. package/Questions/types.js +1 -5
  57. package/{es → cjs}/Field/FieldBase.js +31 -14
  58. package/cjs/Field/FieldBaseContainer.js +65 -0
  59. package/cjs/Field/FieldConditional.js +81 -0
  60. package/cjs/Field/index.js +103 -0
  61. package/cjs/Field/types.js +5 -0
  62. package/{es → cjs}/Field/utils.js +63 -30
  63. package/cjs/FieldArray/FieldArray.stories.js +45 -0
  64. package/cjs/FieldArray/__stories__/Default.js +111 -0
  65. package/cjs/FieldArray/__stories__/WithExactLength.js +111 -0
  66. package/cjs/FieldArray/index.js +87 -0
  67. package/cjs/FieldObject/index.js +83 -0
  68. package/cjs/Fieldset/FieldsetWithContext.js +63 -0
  69. package/cjs/Fieldset/index.js +64 -0
  70. package/cjs/Fieldset/types.js +5 -0
  71. package/cjs/Form.stories.js +10 -0
  72. package/{es → cjs}/FormBuilder/FormBuilder.js +62 -33
  73. package/cjs/FormBuilder/FormBuilder.stories.js +31 -0
  74. package/cjs/FormBuilder/__stories__/Default.js +49 -0
  75. package/cjs/FormBuilder/index.js +11 -0
  76. package/cjs/FormContext.js +14 -0
  77. package/cjs/MultiplicityField/MultiplicityField.stories.js +101 -0
  78. package/{es → cjs}/MultiplicityField/__stories__/Default.js +32 -11
  79. package/cjs/MultiplicityField/__stories__/PreviewDisplay.js +106 -0
  80. package/{es → cjs}/MultiplicityField/__stories__/WithExactLength.js +32 -11
  81. package/{es → cjs}/MultiplicityField/__stories__/WithMaxLength.js +32 -11
  82. package/{es → cjs}/MultiplicityField/__stories__/WithMinAndMaxLength.js +32 -11
  83. package/{es → cjs}/MultiplicityField/__stories__/WithMinLength.js +32 -11
  84. package/{es → cjs}/MultiplicityField/add-objects.js +49 -25
  85. package/cjs/MultiplicityField/index.js +143 -0
  86. package/cjs/Questions/Questions.js +105 -0
  87. package/cjs/Questions/Questions.stories.js +31 -0
  88. package/cjs/Questions/QuestionsContext.js +20 -0
  89. package/cjs/Questions/Step/ReviewStep.js +79 -0
  90. package/cjs/Questions/Step/Step.js +93 -0
  91. package/cjs/Questions/Step/StepArrayReview.js +79 -0
  92. package/{es → cjs}/Questions/Step/StepContext.js +13 -3
  93. package/cjs/Questions/Step/StepDescription.js +55 -0
  94. package/cjs/Questions/Step/StepForm.js +74 -0
  95. package/cjs/Questions/Step/StepQuote.js +26 -0
  96. package/cjs/Questions/Step/StepTitle.js +75 -0
  97. package/{es → cjs}/Questions/Step/getAddMoreFields.js +11 -2
  98. package/cjs/Questions/Step/index.js +170 -0
  99. package/cjs/Questions/Step/types.js +5 -0
  100. package/cjs/Questions/__stories__/Default.js +135 -0
  101. package/{es → cjs}/Questions/getNextStep.js +8 -1
  102. package/cjs/Questions/index.js +25 -0
  103. package/cjs/Questions/index.spec.js +73 -0
  104. package/cjs/Questions/types.js +5 -0
  105. package/cjs/index.js +28 -0
  106. package/cjs/inputs/AutoComplete/AutoComplete.stories.js +31 -0
  107. package/cjs/inputs/AutoComplete/__stories__/Default.js +71 -0
  108. package/cjs/inputs/AutoComplete/index.js +68 -0
  109. package/cjs/inputs/Checkboxes/Checkboxes.stories.js +59 -0
  110. package/{es → cjs}/inputs/Checkboxes/__stories__/Conditional.js +28 -8
  111. package/cjs/inputs/Checkboxes/__stories__/Default.js +62 -0
  112. package/cjs/inputs/Checkboxes/__stories__/WithDivider.js +63 -0
  113. package/cjs/inputs/Checkboxes/index.js +127 -0
  114. package/cjs/inputs/DateInput/DateInput.stories.js +31 -0
  115. package/cjs/inputs/DateInput/__stories__/Default.js +45 -0
  116. package/cjs/inputs/DateInput/index.js +181 -0
  117. package/cjs/inputs/FileInput/FileInput.stories.js +31 -0
  118. package/cjs/inputs/FileInput/__stories__/Default.js +42 -0
  119. package/cjs/inputs/FileInput/index.js +92 -0
  120. package/cjs/inputs/Input/Input.stories.js +143 -0
  121. package/cjs/inputs/Input/__stories__/AFM.js +44 -0
  122. package/cjs/inputs/Input/__stories__/Boolean.js +45 -0
  123. package/cjs/inputs/Input/__stories__/Default.js +45 -0
  124. package/cjs/inputs/Input/__stories__/IBAN.js +45 -0
  125. package/cjs/inputs/Input/__stories__/Integer.js +53 -0
  126. package/cjs/inputs/Input/__stories__/MobilePhone.js +44 -0
  127. package/cjs/inputs/Input/__stories__/PhoneNumber.js +44 -0
  128. package/cjs/inputs/Input/__stories__/PostalCode.js +47 -0
  129. package/cjs/inputs/Input/__stories__/TextWithCharacterLimit.js +51 -0
  130. package/cjs/inputs/Input/index.js +96 -0
  131. package/cjs/inputs/Label/Label.stories.js +31 -0
  132. package/cjs/inputs/Label/__stories__/Default.js +49 -0
  133. package/cjs/inputs/Label/index.js +41 -0
  134. package/cjs/inputs/OtpInput/OtpInput.stories.js +31 -0
  135. package/cjs/inputs/OtpInput/__stories__/Default.js +52 -0
  136. package/cjs/inputs/OtpInput/index.js +182 -0
  137. package/cjs/inputs/Radio/Radio.stories.js +59 -0
  138. package/{es → cjs}/inputs/Radio/__stories__/Conditional.js +28 -8
  139. package/cjs/inputs/Radio/__stories__/Default.js +67 -0
  140. package/cjs/inputs/Radio/__stories__/WithDivider.js +68 -0
  141. package/cjs/inputs/Radio/index.js +82 -0
  142. package/cjs/inputs/Select/Select.stories.js +31 -0
  143. package/cjs/inputs/Select/__stories__/Default.js +73 -0
  144. package/cjs/inputs/Select/index.js +49 -0
  145. package/cjs/inputs/index.js +71 -0
  146. package/cjs/internal.js +391 -0
  147. package/cjs/registry.js +208 -0
  148. package/cjs/types.js +5 -0
  149. package/{es → cjs}/utils.js +26 -12
  150. package/{es → cjs}/validators/index.js +54 -26
  151. package/cjs/validators/types.js +5 -0
  152. package/{es → cjs}/validators/utils/afm.js +13 -3
  153. package/{es → cjs}/validators/utils/file.js +12 -2
  154. package/{es → cjs}/validators/utils/iban.js +13 -2
  155. package/cjs/validators/utils/index.js +229 -0
  156. package/{es → cjs}/validators/utils/int.js +14 -3
  157. package/cjs/validators/utils/number.js +27 -0
  158. package/{es → cjs}/validators/utils/otp.js +14 -3
  159. package/{es → cjs}/validators/utils/phone.js +28 -6
  160. package/{es → cjs}/validators/utils/postal_code.js +14 -3
  161. package/{es → cjs}/validators/utils/text_limit.js +14 -3
  162. package/{es → cjs}/validators/utils/uuid4.js +13 -3
  163. package/cjs/validators/validators.spec.js +88 -0
  164. package/index.js +8 -28
  165. package/inputs/AutoComplete/AutoComplete.stories.js +4 -28
  166. package/inputs/AutoComplete/__stories__/Default.js +13 -35
  167. package/inputs/AutoComplete/index.js +12 -35
  168. package/inputs/AutoComplete/package.json +6 -0
  169. package/inputs/Checkboxes/Checkboxes.stories.js +6 -56
  170. package/inputs/Checkboxes/__stories__/Conditional.js +8 -28
  171. package/inputs/Checkboxes/__stories__/Default.js +8 -28
  172. package/inputs/Checkboxes/__stories__/WithDivider.js +8 -28
  173. package/inputs/Checkboxes/index.js +25 -52
  174. package/inputs/Checkboxes/package.json +6 -0
  175. package/inputs/DateInput/DateInput.stories.js +4 -28
  176. package/inputs/DateInput/__stories__/Default.js +8 -28
  177. package/inputs/DateInput/index.js +26 -52
  178. package/inputs/DateInput/package.json +6 -0
  179. package/inputs/FileInput/FileInput.stories.js +4 -28
  180. package/inputs/FileInput/__stories__/Default.js +8 -28
  181. package/inputs/FileInput/index.js +22 -52
  182. package/inputs/FileInput/package.json +6 -0
  183. package/inputs/Input/Input.stories.js +12 -140
  184. package/inputs/Input/__stories__/AFM.js +8 -28
  185. package/inputs/Input/__stories__/Boolean.js +8 -28
  186. package/inputs/Input/__stories__/Default.js +8 -28
  187. package/inputs/Input/__stories__/IBAN.js +8 -28
  188. package/inputs/Input/__stories__/Integer.js +9 -29
  189. package/inputs/Input/__stories__/MobilePhone.js +8 -28
  190. package/inputs/Input/__stories__/PhoneNumber.js +8 -28
  191. package/inputs/Input/__stories__/PostalCode.js +8 -28
  192. package/inputs/Input/__stories__/TextWithCharacterLimit.js +8 -28
  193. package/inputs/Input/index.js +19 -40
  194. package/inputs/Input/package.json +6 -0
  195. package/inputs/Label/Label.stories.js +4 -28
  196. package/inputs/Label/__stories__/Default.js +9 -29
  197. package/inputs/Label/index.js +9 -25
  198. package/inputs/Label/package.json +6 -0
  199. package/inputs/OtpInput/OtpInput.stories.js +4 -28
  200. package/inputs/OtpInput/__stories__/Default.js +9 -30
  201. package/inputs/OtpInput/index.js +28 -53
  202. package/inputs/OtpInput/package.json +6 -0
  203. package/inputs/Radio/Radio.stories.js +6 -56
  204. package/inputs/Radio/__stories__/Conditional.js +8 -28
  205. package/inputs/Radio/__stories__/Default.js +8 -28
  206. package/inputs/Radio/__stories__/WithDivider.js +8 -28
  207. package/inputs/Radio/index.js +24 -45
  208. package/inputs/Radio/package.json +6 -0
  209. package/inputs/Select/Select.stories.js +4 -28
  210. package/inputs/Select/__stories__/Default.js +8 -28
  211. package/inputs/Select/index.js +12 -29
  212. package/inputs/Select/package.json +6 -0
  213. package/inputs/index.js +8 -71
  214. package/inputs/package.json +6 -0
  215. package/internal.js +34 -391
  216. package/package.json +6 -6
  217. package/registry.d.ts +1 -1
  218. package/registry.js +61 -133
  219. package/types.js +1 -5
  220. package/utils.js +12 -26
  221. package/validators/index.js +26 -54
  222. package/validators/package.json +6 -0
  223. package/validators/types.js +1 -5
  224. package/validators/utils/afm.js +3 -13
  225. package/validators/utils/file.js +2 -12
  226. package/validators/utils/iban.js +2 -13
  227. package/validators/utils/index.js +12 -139
  228. package/validators/utils/int.js +3 -14
  229. package/validators/utils/number.js +3 -14
  230. package/validators/utils/otp.js +3 -14
  231. package/validators/utils/package.json +6 -0
  232. package/validators/utils/phone.js +6 -28
  233. package/validators/utils/postal_code.js +3 -14
  234. package/validators/utils/text_limit.js +3 -14
  235. package/validators/utils/uuid4.js +3 -13
  236. package/validators/validators.spec.js +29 -32
  237. package/Field/FieldBase.mjs +0 -84
  238. package/Field/FieldBaseContainer.mjs +0 -43
  239. package/Field/FieldConditional.mjs +0 -62
  240. package/Field/index.mjs +0 -76
  241. package/Field/types.mjs +0 -1
  242. package/Field/utils.mjs +0 -162
  243. package/FieldArray/FieldArray.stories.mjs +0 -8
  244. package/FieldArray/__stories__/Default.mjs +0 -90
  245. package/FieldArray/__stories__/WithExactLength.mjs +0 -90
  246. package/FieldArray/index.mjs +0 -65
  247. package/FieldObject/index.mjs +0 -58
  248. package/Fieldset/FieldsetWithContext.mjs +0 -41
  249. package/Fieldset/index.mjs +0 -34
  250. package/Fieldset/types.mjs +0 -1
  251. package/Form.stories.mjs +0 -3
  252. package/FormBuilder/FormBuilder.mjs +0 -160
  253. package/FormBuilder/FormBuilder.stories.mjs +0 -7
  254. package/FormBuilder/__stories__/Default.mjs +0 -28
  255. package/FormBuilder/index.mjs +0 -2
  256. package/FormContext.mjs +0 -5
  257. package/MultiplicityField/MultiplicityField.stories.mjs +0 -12
  258. package/MultiplicityField/__stories__/Default.mjs +0 -97
  259. package/MultiplicityField/__stories__/PreviewDisplay.mjs +0 -83
  260. package/MultiplicityField/__stories__/WithExactLength.mjs +0 -92
  261. package/MultiplicityField/__stories__/WithMaxLength.mjs +0 -95
  262. package/MultiplicityField/__stories__/WithMinAndMaxLength.mjs +0 -96
  263. package/MultiplicityField/__stories__/WithMinLength.mjs +0 -95
  264. package/MultiplicityField/add-objects.mjs +0 -160
  265. package/MultiplicityField/index.mjs +0 -114
  266. package/Questions/Questions.mjs +0 -84
  267. package/Questions/Questions.stories.mjs +0 -7
  268. package/Questions/QuestionsContext.mjs +0 -11
  269. package/Questions/Step/ReviewStep.mjs +0 -53
  270. package/Questions/Step/Step.mjs +0 -69
  271. package/Questions/Step/StepArrayReview.mjs +0 -50
  272. package/Questions/Step/StepContext.mjs +0 -27
  273. package/Questions/Step/StepDescription.mjs +0 -27
  274. package/Questions/Step/StepForm.mjs +0 -48
  275. package/Questions/Step/StepQuote.mjs +0 -11
  276. package/Questions/Step/StepTitle.mjs +0 -44
  277. package/Questions/Step/getAddMoreFields.mjs +0 -22
  278. package/Questions/Step/index.mjs +0 -13
  279. package/Questions/Step/types.mjs +0 -1
  280. package/Questions/__stories__/Default.mjs +0 -108
  281. package/Questions/getNextStep.mjs +0 -23
  282. package/Questions/index.mjs +0 -3
  283. package/Questions/index.spec.mjs +0 -62
  284. package/Questions/types.mjs +0 -1
  285. package/es/Field/FieldBaseContainer.js +0 -43
  286. package/es/Field/FieldConditional.js +0 -62
  287. package/es/Field/index.js +0 -76
  288. package/es/Field/types.js +0 -1
  289. package/es/FieldArray/FieldArray.stories.js +0 -8
  290. package/es/FieldArray/__stories__/Default.js +0 -90
  291. package/es/FieldArray/__stories__/WithExactLength.js +0 -90
  292. package/es/FieldArray/index.js +0 -65
  293. package/es/FieldObject/index.js +0 -58
  294. package/es/Fieldset/FieldsetWithContext.js +0 -41
  295. package/es/Fieldset/index.js +0 -34
  296. package/es/Fieldset/types.js +0 -1
  297. package/es/Form.stories.js +0 -3
  298. package/es/FormBuilder/FormBuilder.stories.js +0 -7
  299. package/es/FormBuilder/__stories__/Default.js +0 -28
  300. package/es/FormBuilder/index.js +0 -2
  301. package/es/FormContext.js +0 -5
  302. package/es/MultiplicityField/MultiplicityField.stories.js +0 -12
  303. package/es/MultiplicityField/__stories__/PreviewDisplay.js +0 -83
  304. package/es/MultiplicityField/index.js +0 -114
  305. package/es/Questions/Questions.js +0 -84
  306. package/es/Questions/Questions.stories.js +0 -7
  307. package/es/Questions/QuestionsContext.js +0 -11
  308. package/es/Questions/Step/ReviewStep.js +0 -53
  309. package/es/Questions/Step/Step.js +0 -69
  310. package/es/Questions/Step/StepArrayReview.js +0 -50
  311. package/es/Questions/Step/StepDescription.js +0 -27
  312. package/es/Questions/Step/StepForm.js +0 -48
  313. package/es/Questions/Step/StepQuote.js +0 -11
  314. package/es/Questions/Step/StepTitle.js +0 -44
  315. package/es/Questions/Step/index.js +0 -13
  316. package/es/Questions/Step/types.js +0 -1
  317. package/es/Questions/__stories__/Default.js +0 -108
  318. package/es/Questions/index.js +0 -3
  319. package/es/Questions/index.spec.js +0 -62
  320. package/es/Questions/types.js +0 -1
  321. package/es/index.js +0 -3
  322. package/es/inputs/AutoComplete/AutoComplete.stories.js +0 -7
  323. package/es/inputs/AutoComplete/__stories__/Default.js +0 -49
  324. package/es/inputs/AutoComplete/index.js +0 -45
  325. package/es/inputs/Checkboxes/Checkboxes.stories.js +0 -9
  326. package/es/inputs/Checkboxes/__stories__/Default.js +0 -42
  327. package/es/inputs/Checkboxes/__stories__/WithDivider.js +0 -43
  328. package/es/inputs/Checkboxes/index.js +0 -100
  329. package/es/inputs/DateInput/DateInput.stories.js +0 -7
  330. package/es/inputs/DateInput/__stories__/Default.js +0 -25
  331. package/es/inputs/DateInput/index.js +0 -155
  332. package/es/inputs/FileInput/FileInput.stories.js +0 -7
  333. package/es/inputs/FileInput/__stories__/Default.js +0 -22
  334. package/es/inputs/FileInput/index.js +0 -62
  335. package/es/inputs/Input/Input.stories.js +0 -15
  336. package/es/inputs/Input/__stories__/AFM.js +0 -24
  337. package/es/inputs/Input/__stories__/Boolean.js +0 -25
  338. package/es/inputs/Input/__stories__/Default.js +0 -25
  339. package/es/inputs/Input/__stories__/IBAN.js +0 -25
  340. package/es/inputs/Input/__stories__/Integer.js +0 -33
  341. package/es/inputs/Input/__stories__/MobilePhone.js +0 -24
  342. package/es/inputs/Input/__stories__/PhoneNumber.js +0 -24
  343. package/es/inputs/Input/__stories__/PostalCode.js +0 -27
  344. package/es/inputs/Input/__stories__/TextWithCharacterLimit.js +0 -31
  345. package/es/inputs/Input/index.js +0 -75
  346. package/es/inputs/Label/Label.stories.js +0 -7
  347. package/es/inputs/Label/__stories__/Default.js +0 -29
  348. package/es/inputs/Label/index.js +0 -25
  349. package/es/inputs/OtpInput/OtpInput.stories.js +0 -7
  350. package/es/inputs/OtpInput/__stories__/Default.js +0 -31
  351. package/es/inputs/OtpInput/index.js +0 -157
  352. package/es/inputs/Radio/Radio.stories.js +0 -9
  353. package/es/inputs/Radio/__stories__/Default.js +0 -47
  354. package/es/inputs/Radio/__stories__/WithDivider.js +0 -48
  355. package/es/inputs/Radio/index.js +0 -61
  356. package/es/inputs/Select/Select.stories.js +0 -7
  357. package/es/inputs/Select/__stories__/Default.js +0 -53
  358. package/es/inputs/Select/index.js +0 -32
  359. package/es/inputs/index.js +0 -8
  360. package/es/internal.js +0 -34
  361. package/es/registry.js +0 -136
  362. package/es/types.js +0 -1
  363. package/es/validators/types.js +0 -1
  364. package/es/validators/utils/index.js +0 -102
  365. package/es/validators/utils/number.js +0 -16
  366. package/es/validators/validators.spec.js +0 -85
  367. package/index.mjs +0 -8
  368. package/inputs/AutoComplete/AutoComplete.stories.mjs +0 -7
  369. package/inputs/AutoComplete/__stories__/Default.mjs +0 -49
  370. package/inputs/AutoComplete/index.mjs +0 -45
  371. package/inputs/Checkboxes/Checkboxes.stories.mjs +0 -9
  372. package/inputs/Checkboxes/__stories__/Conditional.mjs +0 -95
  373. package/inputs/Checkboxes/__stories__/Default.mjs +0 -42
  374. package/inputs/Checkboxes/__stories__/WithDivider.mjs +0 -43
  375. package/inputs/Checkboxes/index.mjs +0 -100
  376. package/inputs/DateInput/DateInput.stories.mjs +0 -7
  377. package/inputs/DateInput/__stories__/Default.mjs +0 -25
  378. package/inputs/DateInput/index.mjs +0 -155
  379. package/inputs/FileInput/FileInput.stories.mjs +0 -7
  380. package/inputs/FileInput/__stories__/Default.mjs +0 -22
  381. package/inputs/FileInput/index.mjs +0 -62
  382. package/inputs/Input/Input.stories.mjs +0 -15
  383. package/inputs/Input/__stories__/AFM.mjs +0 -24
  384. package/inputs/Input/__stories__/Boolean.mjs +0 -25
  385. package/inputs/Input/__stories__/Default.mjs +0 -25
  386. package/inputs/Input/__stories__/IBAN.mjs +0 -25
  387. package/inputs/Input/__stories__/Integer.mjs +0 -33
  388. package/inputs/Input/__stories__/MobilePhone.mjs +0 -24
  389. package/inputs/Input/__stories__/PhoneNumber.mjs +0 -24
  390. package/inputs/Input/__stories__/PostalCode.mjs +0 -27
  391. package/inputs/Input/__stories__/TextWithCharacterLimit.mjs +0 -31
  392. package/inputs/Input/index.mjs +0 -75
  393. package/inputs/Label/Label.stories.mjs +0 -7
  394. package/inputs/Label/__stories__/Default.mjs +0 -29
  395. package/inputs/Label/index.mjs +0 -25
  396. package/inputs/OtpInput/OtpInput.stories.mjs +0 -7
  397. package/inputs/OtpInput/__stories__/Default.mjs +0 -31
  398. package/inputs/OtpInput/index.mjs +0 -157
  399. package/inputs/Radio/Radio.stories.mjs +0 -9
  400. package/inputs/Radio/__stories__/Conditional.mjs +0 -95
  401. package/inputs/Radio/__stories__/Default.mjs +0 -47
  402. package/inputs/Radio/__stories__/WithDivider.mjs +0 -48
  403. package/inputs/Radio/index.mjs +0 -61
  404. package/inputs/Select/Select.stories.mjs +0 -7
  405. package/inputs/Select/__stories__/Default.mjs +0 -53
  406. package/inputs/Select/index.mjs +0 -32
  407. package/inputs/index.mjs +0 -8
  408. package/internal.mjs +0 -34
  409. package/registry.mjs +0 -136
  410. package/types.mjs +0 -1
  411. package/utils.mjs +0 -99
  412. package/validators/index.mjs +0 -186
  413. package/validators/types.mjs +0 -1
  414. package/validators/utils/afm.mjs +0 -35
  415. package/validators/utils/file.mjs +0 -52
  416. package/validators/utils/iban.mjs +0 -123
  417. package/validators/utils/index.mjs +0 -102
  418. package/validators/utils/int.mjs +0 -20
  419. package/validators/utils/number.mjs +0 -16
  420. package/validators/utils/otp.mjs +0 -26
  421. package/validators/utils/phone.mjs +0 -122
  422. package/validators/utils/postal_code.mjs +0 -29
  423. package/validators/utils/text_limit.mjs +0 -54
  424. package/validators/utils/uuid4.mjs +0 -20
  425. package/validators/validators.spec.mjs +0 -85
  426. /package/{es → cjs}/Field/index.mdx +0 -0
  427. /package/{es → cjs}/FieldArray/FieldArray.stories.playwright.json +0 -0
  428. /package/{es → cjs}/FormBuilder/FormBuilder.mdx +0 -0
  429. /package/{es → cjs}/FormBuilder/FormBuilder.stories.playwright.json +0 -0
  430. /package/{es → cjs}/MultiplicityField/MultiplicityField.mdx +0 -0
  431. /package/{es → cjs}/MultiplicityField/MultiplicityField.stories.playwright.json +0 -0
  432. /package/{es → cjs}/Questions/__snapshots__/index.spec.tsx.snap +0 -0
  433. /package/{es → cjs}/Questions/index.mdx +0 -0
  434. /package/{es → cjs}/create-simple-form.mdx +0 -0
  435. /package/{es → cjs}/index.mdx +0 -0
  436. /package/{es → cjs}/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -0
  437. /package/{es → cjs}/inputs/Checkboxes/index.mdx +0 -0
  438. /package/{es → cjs}/inputs/DateInput/DateInput.stories.playwright.json +0 -0
  439. /package/{es → cjs}/inputs/FileInput/FileInput.stories.playwright.json +0 -0
  440. /package/{es → cjs}/inputs/Input/Input.stories.playwright.json +0 -0
  441. /package/{es → cjs}/inputs/Input/index.mdx +0 -0
  442. /package/{es → cjs}/inputs/Label/Label.stories.playwright.json +0 -0
  443. /package/{es → cjs}/inputs/Label/index.mdx +0 -0
  444. /package/{es → cjs}/inputs/Radio/Radio.stories.playwright.json +0 -0
  445. /package/{es → cjs}/inputs/Radio/index.mdx +0 -0
  446. /package/{es → cjs}/inputs/Select/Select.stories.playwright.json +0 -0
  447. /package/{es → cjs}/installation.mdx +0 -0
@@ -1,95 +0,0 @@
1
- import React from 'react';
2
- import FormBuilder, { Field } from "../../..";
3
- import { Button } from '@digigov/ui/form/Button';
4
- var fields = [{
5
- key: 'landline',
6
- type: 'phone_number',
7
- label: {
8
- secondary: 'Εισάγετε το νούμερο του σταθερού σας τηλεφώνου.'
9
- },
10
- enabled: false,
11
- condition: {
12
- auth_form: {
13
- is: 'via_mobile_phone',
14
- then: {
15
- enabled: true,
16
- required: true
17
- }
18
- }
19
- }
20
- }, {
21
- key: 'mobile_phone',
22
- type: 'mobile_phone',
23
- label: {
24
- secondary: 'Εισάγετε το νούμερο του κινητού σας τηλεφώνου.'
25
- },
26
- enabled: false,
27
- condition: {
28
- auth_form: {
29
- is: 'via_mobile_phone',
30
- then: {
31
- enabled: true,
32
- required: true
33
- }
34
- }
35
- }
36
- }, {
37
- key: 'email',
38
- type: 'email',
39
- label: {
40
- secondary: 'Εισάγετε την διεύθυνση του ηλεκτρονικού σας ταχυδρομείου.'
41
- },
42
- enabled: false,
43
- condition: {
44
- auth_form: {
45
- is: 'via_email',
46
- then: {
47
- enabled: true,
48
- required: true
49
- }
50
- }
51
- }
52
- }, {
53
- key: 'auth_form',
54
- type: 'choice:single',
55
- required: true,
56
- label: {
57
- primary: 'Επιλέξτε μέθοδο πιστοποίησης',
58
- secondary: 'Για την ολοκλήρωση της δήλωσης σας, θα χρειαστεί επιπλέον πιστοποίηση. Θα σας στείλουμε ένα κωδικό μιας χρήσης είτε στο τηλέφωνο είτε στην ηλεκτρονική σας διεύθυνση.'
59
- },
60
- extra: {
61
- options: [{
62
- key: 'via_mobile_phone',
63
- label: {
64
- primary: 'Mέσω κινητού τηλεφώνου'
65
- },
66
- value: 'via_mobile_phone',
67
- show: ['mobile_phone', 'landline']
68
- }, {
69
- key: 'via_email',
70
- label: {
71
- primary: 'Μέσω διεύθυνσης ηλεκτρονικού ταχυδρομείου (e-mail)'
72
- },
73
- value: 'via_email',
74
- show: ['email']
75
- }]
76
- }
77
- }];
78
-
79
- var _ref = /*#__PURE__*/React.createElement(Field, {
80
- key: "auth_form",
81
- name: "auth_form"
82
- });
83
-
84
- var _ref2 = /*#__PURE__*/React.createElement(Button, {
85
- type: "submit"
86
- }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
87
-
88
- export var Conditional = function Conditional() {
89
- return /*#__PURE__*/React.createElement(FormBuilder, {
90
- onSubmit: function onSubmit(data) {
91
- console.log(data);
92
- },
93
- fields: fields
94
- }, _ref, _ref2);
95
- };
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import FormBuilder, { Field } from "../../..";
3
- import { Button } from '@digigov/ui/form/Button';
4
-
5
- var _ref = /*#__PURE__*/React.createElement(Button, {
6
- type: "submit"
7
- }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
8
-
9
- export var Default = function Default() {
10
- return /*#__PURE__*/React.createElement(FormBuilder, {
11
- onSubmit: function onSubmit(data) {
12
- console.log(data);
13
- }
14
- }, /*#__PURE__*/React.createElement(Field, {
15
- key: 'string',
16
- name: "string",
17
- type: "choice:single",
18
- required: true,
19
- label: {
20
- primary: 'Ποιά είναι η χώρα της διαμονής σας;'
21
- },
22
- extra: {
23
- options: [{
24
- label: {
25
- primary: 'Ελλάδα'
26
- },
27
- value: 'greece'
28
- }, {
29
- label: {
30
- primary: 'Κύπρος'
31
- },
32
- value: 'cyprus'
33
- }, {
34
- label: {
35
- primary: 'Χώρα της Ευρωπαϊκής Ένωσης'
36
- },
37
- value: 'eu'
38
- }, {
39
- label: {
40
- primary: 'Ηνωμένες Πολιτείες της Αμερικής'
41
- },
42
- value: 'usa'
43
- }]
44
- }
45
- }), _ref);
46
- };
47
- export default Default;
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import FormBuilder, { Field } from "../../..";
3
- import { Button } from '@digigov/ui/form/Button';
4
-
5
- var _ref = /*#__PURE__*/React.createElement(Button, {
6
- type: "submit"
7
- }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
8
-
9
- export var WithDivider = function WithDivider() {
10
- return /*#__PURE__*/React.createElement(FormBuilder, {
11
- onSubmit: function onSubmit(data) {
12
- console.log(data);
13
- }
14
- }, /*#__PURE__*/React.createElement(Field, {
15
- key: 'string',
16
- name: "string",
17
- type: "choice:single",
18
- required: true,
19
- label: {
20
- primary: 'Ποιά είναι η χώρα της διαμονής σας;'
21
- },
22
- extra: {
23
- options: [{
24
- label: {
25
- primary: 'Ελλάδα'
26
- },
27
- value: 'greece'
28
- }, {
29
- label: {
30
- primary: 'Κύπρος'
31
- },
32
- value: 'cyprus'
33
- }, {
34
- label: {
35
- primary: 'Χώρα της Ευρωπαϊκής Ένωσης'
36
- },
37
- value: 'eu'
38
- }, {
39
- label: {
40
- primary: 'Ηνωμένες Πολιτείες της Αμερικής'
41
- },
42
- value: 'usa',
43
- dividerText: 'ή'
44
- }]
45
- }
46
- }), _ref);
47
- };
48
- export default WithDivider;
@@ -1,61 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["name", "control", "register", "extra", "disabled"],
4
- _excluded2 = ["label", "value", "show", "disabled", "selected"];
5
- import React from 'react';
6
- import { useWatch } from 'react-hook-form';
7
- import { Field } from "../..";
8
- import { RadioConditional } from '@digigov/react-core';
9
- import Hint from '@digigov/react-core/Hint';
10
- import RadioContainer from '@digigov/react-core/RadioContainer';
11
- import RadioItem from '@digigov/react-core/RadioItem';
12
- import { useTranslation } from '@digigov/ui/i18n';
13
- export var RadioButtonsGroup = function RadioButtonsGroup(_ref) {
14
- var name = _ref.name,
15
- control = _ref.control,
16
- register = _ref.register,
17
- _ref$extra = _ref.extra,
18
- options = _ref$extra.options,
19
- className = _ref$extra.className,
20
- disabled = _ref.disabled,
21
- props = _objectWithoutProperties(_ref, _excluded);
22
-
23
- var currentValue = useWatch({
24
- control: control,
25
- name: name
26
- });
27
-
28
- var _useTranslation = useTranslation(),
29
- t = _useTranslation.t;
30
-
31
- return /*#__PURE__*/React.createElement(RadioContainer, {
32
- className: className,
33
- defaultValue: currentValue,
34
- id: name
35
- }, options.map(function (_ref2) {
36
- var label = _ref2.label,
37
- v = _ref2.value,
38
- show = _ref2.show,
39
- optionDisabled = _ref2.disabled,
40
- selected = _ref2.selected,
41
- option = _objectWithoutProperties(_ref2, _excluded2);
42
-
43
- return /*#__PURE__*/React.createElement("div", {
44
- key: "".concat(name, ".").concat(v)
45
- }, /*#__PURE__*/React.createElement(RadioItem, _extends({}, register(name), {
46
- value: v,
47
- disabled: disabled || optionDisabled
48
- }, option, _extends({}, props, {
49
- reset: undefined,
50
- required: undefined,
51
- 'aria-describedby': undefined,
52
- type: 'radio'
53
- })), label && label.primary && t(label.primary) || v, label && label.secondary && /*#__PURE__*/React.createElement(Hint, null, t(label.secondary))), selected && selected(), currentValue === v && show && /*#__PURE__*/React.createElement(RadioConditional, null, show.map(function (fieldName) {
54
- return /*#__PURE__*/React.createElement(Field, {
55
- name: fieldName,
56
- key: fieldName
57
- });
58
- })));
59
- }));
60
- };
61
- export default RadioButtonsGroup;
@@ -1,7 +0,0 @@
1
- import Select from "./";
2
- export default {
3
- title: 'Digigov Form/inputs/Select',
4
- component: Select,
5
- displayName: 'Select'
6
- };
7
- export * from "./__stories__/Default";
@@ -1,53 +0,0 @@
1
- import React from 'react';
2
- import FormBuilder, { Field } from "../../..";
3
- import { Button } from '@digigov/ui/form/Button';
4
-
5
- var _ref = /*#__PURE__*/React.createElement(Button, {
6
- type: "submit"
7
- }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
8
-
9
- export var Default = function Default() {
10
- return /*#__PURE__*/React.createElement(FormBuilder, {
11
- onSubmit: function onSubmit(data) {
12
- console.log(data);
13
- }
14
- }, /*#__PURE__*/React.createElement(Field, {
15
- key: 'string',
16
- name: "string",
17
- type: "choice:single",
18
- required: true,
19
- label: {
20
- primary: 'Ποιά είναι η χώρα της διαμονής σας;'
21
- },
22
- extra: {
23
- component: 'Select',
24
- options: [{
25
- label: {
26
- primary: ''
27
- },
28
- value: ''
29
- }, {
30
- label: {
31
- primary: 'Ελλάδα'
32
- },
33
- value: 'greece'
34
- }, {
35
- label: {
36
- primary: 'Κύπρος'
37
- },
38
- value: 'cyprus'
39
- }, {
40
- label: {
41
- primary: 'Χώρα της Ευρωπαϊκής Ένωσης'
42
- },
43
- value: 'eu'
44
- }, {
45
- label: {
46
- primary: 'Ηνωμένες Πολιτείες της Αμερικής'
47
- },
48
- value: 'usa'
49
- }]
50
- }
51
- }), _ref);
52
- };
53
- export default Default;
@@ -1,32 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["name", "extra", "disabled"];
4
- import React from 'react';
5
- import SelectContainer from '@digigov/react-core/SelectContainer';
6
- import SelectOption from '@digigov/react-core/SelectOption';
7
- export var Select = /*#__PURE__*/React.forwardRef(function WrappedSelect(_ref, ref) {
8
- var name = _ref.name,
9
- _ref$extra = _ref.extra,
10
- options = _ref$extra.options,
11
- className = _ref$extra.className,
12
- disabled = _ref.disabled,
13
- props = _objectWithoutProperties(_ref, _excluded);
14
-
15
- return /*#__PURE__*/React.createElement(SelectContainer, _extends({
16
- className: className,
17
- ref: ref,
18
- name: name,
19
- disabled: disabled
20
- }, _extends({}, props, {
21
- reset: undefined,
22
- required: undefined
23
- })), options.map(function (_ref2) {
24
- var value = _ref2.value,
25
- label = _ref2.label;
26
- return /*#__PURE__*/React.createElement(SelectOption, {
27
- key: value,
28
- value: value
29
- }, label && label.primary ? label.primary : value);
30
- }));
31
- });
32
- export default Select;
package/inputs/index.mjs DELETED
@@ -1,8 +0,0 @@
1
- export { default as Checkboxes } from "./Checkboxes";
2
- export { default as DateInput } from "./DateInput";
3
- export { default as OtpInput } from "./OtpInput";
4
- export { default as FileInput } from "./FileInput";
5
- export { default as Input } from "./Input";
6
- export { default as Label } from "./Label";
7
- export { default as Radio } from "./Radio";
8
- export { default as Select } from "./Select";
package/internal.mjs DELETED
@@ -1,34 +0,0 @@
1
- export { default as Field } from "./Field";
2
- export * from "./Field";
3
- export { default as FieldArray } from "./FieldArray";
4
- export * from "./FieldArray";
5
- export { default as FieldConditional } from "./Field/FieldConditional";
6
- export * from "./Field/FieldConditional";
7
- export { default as Fieldset } from "./Fieldset";
8
- export * from "./Fieldset";
9
- export { default as FormBuilder } from "./FormBuilder";
10
- export * from "./FormBuilder";
11
- export { Step } from "./Questions/Step";
12
- export * from "./Questions/Step";
13
- export { default as Questions } from "./Questions";
14
- export * from "./Questions";
15
- export { default as Checkboxes } from "./inputs/Checkboxes";
16
- export * from "./inputs/Checkboxes";
17
- export { default as DateInput } from "./inputs/DateInput";
18
- export * from "./inputs/DateInput";
19
- export { default as FileInput } from "./inputs/FileInput";
20
- export * from "./inputs/FileInput";
21
- export { default as Input } from "./inputs/Input";
22
- export * from "./inputs/Input";
23
- export { default as Label } from "./inputs/Label";
24
- export * from "./inputs/Label";
25
- export { default as Radio } from "./inputs/Radio";
26
- export * from "./inputs/Radio";
27
- export { default as Select } from "./inputs/Select";
28
- export * from "./FormContext";
29
- export * from "./inputs/Select";
30
- export * from "./inputs";
31
- export * from "./internal";
32
- export * from "./types";
33
- export * from "./utils";
34
- export * from "./validators";
package/registry.mjs DELETED
@@ -1,136 +0,0 @@
1
- import * as _digigov_form_Field_FieldBase from "./Field/FieldBase";
2
- import * as _digigov_form_Field_FieldBaseContainer from "./Field/FieldBaseContainer";
3
- import * as _digigov_form_Field_FieldConditional from "./Field/FieldConditional";
4
- import * as _digigov_form_Field from "./Field";
5
- import * as _digigov_form_Field_types from "./Field/types";
6
- import * as _digigov_form_Field_utils from "./Field/utils";
7
- import * as _digigov_form_FieldArray from "./FieldArray";
8
- import * as _digigov_form_FieldObject from "./FieldObject";
9
- import * as _digigov_form_Fieldset_FieldsetWithContext from "./Fieldset/FieldsetWithContext";
10
- import * as _digigov_form_Fieldset from "./Fieldset";
11
- import * as _digigov_form_Fieldset_types from "./Fieldset/types";
12
- import * as _digigov_form_FormBuilder_FormBuilder from "./FormBuilder/FormBuilder";
13
- import * as _digigov_form_FormBuilder from "./FormBuilder";
14
- import * as _digigov_form_FormContext from "./FormContext";
15
- import * as _digigov_form from "./";
16
- import * as _digigov_form_inputs_AutoComplete from "./inputs/AutoComplete";
17
- import * as _digigov_form_inputs_Checkboxes from "./inputs/Checkboxes";
18
- import * as _digigov_form_inputs_DateInput from "./inputs/DateInput";
19
- import * as _digigov_form_inputs_FileInput from "./inputs/FileInput";
20
- import * as _digigov_form_inputs from "./inputs";
21
- import * as _digigov_form_inputs_Input from "./inputs/Input";
22
- import * as _digigov_form_inputs_Label from "./inputs/Label";
23
- import * as _digigov_form_inputs_OtpInput from "./inputs/OtpInput";
24
- import * as _digigov_form_inputs_Radio from "./inputs/Radio";
25
- import * as _digigov_form_inputs_Select from "./inputs/Select";
26
- import * as _digigov_form_internal from "./internal";
27
- import * as _digigov_form_MultiplicityField_add_objects from "./MultiplicityField/add-objects";
28
- import * as _digigov_form_MultiplicityField from "./MultiplicityField";
29
- import * as _digigov_form_Questions_getNextStep from "./Questions/getNextStep";
30
- import * as _digigov_form_Questions from "./Questions";
31
- import * as _digigov_form_Questions_Questions from "./Questions/Questions";
32
- import * as _digigov_form_Questions_QuestionsContext from "./Questions/QuestionsContext";
33
- import * as _digigov_form_Questions_Step_getAddMoreFields from "./Questions/Step/getAddMoreFields";
34
- import * as _digigov_form_Questions_Step from "./Questions/Step";
35
- import * as _digigov_form_Questions_Step_ReviewStep from "./Questions/Step/ReviewStep";
36
- import * as _digigov_form_Questions_Step_Step from "./Questions/Step/Step";
37
- import * as _digigov_form_Questions_Step_StepArrayReview from "./Questions/Step/StepArrayReview";
38
- import * as _digigov_form_Questions_Step_StepContext from "./Questions/Step/StepContext";
39
- import * as _digigov_form_Questions_Step_StepDescription from "./Questions/Step/StepDescription";
40
- import * as _digigov_form_Questions_Step_StepForm from "./Questions/Step/StepForm";
41
- import * as _digigov_form_Questions_Step_StepQuote from "./Questions/Step/StepQuote";
42
- import * as _digigov_form_Questions_Step_StepTitle from "./Questions/Step/StepTitle";
43
- import * as _digigov_form_Questions_Step_types from "./Questions/Step/types";
44
- import * as _digigov_form_Questions_types from "./Questions/types";
45
- import * as _digigov_form_types from "./types";
46
- import * as _digigov_form_utils from "./utils";
47
- import * as _digigov_form_validators from "./validators";
48
- import * as _digigov_form_validators_types from "./validators/types";
49
- import * as _digigov_form_validators_utils_afm from "./validators/utils/afm";
50
- import * as _digigov_form_validators_utils_file from "./validators/utils/file";
51
- import * as _digigov_form_validators_utils_iban from "./validators/utils/iban";
52
- import * as _digigov_form_validators_utils from "./validators/utils";
53
- import * as _digigov_form_validators_utils_int from "./validators/utils/int";
54
- import * as _digigov_form_validators_utils_number from "./validators/utils/number";
55
- import * as _digigov_form_validators_utils_otp from "./validators/utils/otp";
56
- import * as _digigov_form_validators_utils_phone from "./validators/utils/phone";
57
- import * as _digigov_form_validators_utils_postal_code from "./validators/utils/postal_code";
58
- import * as _digigov_form_validators_utils_text_limit from "./validators/utils/text_limit";
59
- import * as _digigov_form_validators_utils_uuid4 from "./validators/utils/uuid4";
60
-
61
- function lazyImport(pkgImport) {
62
- // eslint-disable-next-line no-undef
63
- return new Proxy({}, {
64
- get: function get(_target, name) {
65
- if (name === '__esModule' || name === 'default') {
66
- return pkgImport["default"];
67
- } else if (name === '*') {
68
- return pkgImport;
69
- } else {
70
- return pkgImport[name];
71
- }
72
- }
73
- });
74
- }
75
-
76
- export default {
77
- '@digigov/form/Field/FieldBase': lazyImport(_digigov_form_Field_FieldBase),
78
- '@digigov/form/Field/FieldBaseContainer': lazyImport(_digigov_form_Field_FieldBaseContainer),
79
- '@digigov/form/Field/FieldConditional': lazyImport(_digigov_form_Field_FieldConditional),
80
- '@digigov/form/Field': lazyImport(_digigov_form_Field),
81
- '@digigov/form/Field/types': lazyImport(_digigov_form_Field_types),
82
- '@digigov/form/Field/utils': lazyImport(_digigov_form_Field_utils),
83
- '@digigov/form/FieldArray': lazyImport(_digigov_form_FieldArray),
84
- '@digigov/form/FieldObject': lazyImport(_digigov_form_FieldObject),
85
- '@digigov/form/Fieldset/FieldsetWithContext': lazyImport(_digigov_form_Fieldset_FieldsetWithContext),
86
- '@digigov/form/Fieldset': lazyImport(_digigov_form_Fieldset),
87
- '@digigov/form/Fieldset/types': lazyImport(_digigov_form_Fieldset_types),
88
- '@digigov/form/FormBuilder/FormBuilder': lazyImport(_digigov_form_FormBuilder_FormBuilder),
89
- '@digigov/form/FormBuilder': lazyImport(_digigov_form_FormBuilder),
90
- '@digigov/form/FormContext': lazyImport(_digigov_form_FormContext),
91
- '@digigov/form': lazyImport(_digigov_form),
92
- '@digigov/form/inputs/AutoComplete': lazyImport(_digigov_form_inputs_AutoComplete),
93
- '@digigov/form/inputs/Checkboxes': lazyImport(_digigov_form_inputs_Checkboxes),
94
- '@digigov/form/inputs/DateInput': lazyImport(_digigov_form_inputs_DateInput),
95
- '@digigov/form/inputs/FileInput': lazyImport(_digigov_form_inputs_FileInput),
96
- '@digigov/form/inputs': lazyImport(_digigov_form_inputs),
97
- '@digigov/form/inputs/Input': lazyImport(_digigov_form_inputs_Input),
98
- '@digigov/form/inputs/Label': lazyImport(_digigov_form_inputs_Label),
99
- '@digigov/form/inputs/OtpInput': lazyImport(_digigov_form_inputs_OtpInput),
100
- '@digigov/form/inputs/Radio': lazyImport(_digigov_form_inputs_Radio),
101
- '@digigov/form/inputs/Select': lazyImport(_digigov_form_inputs_Select),
102
- '@digigov/form/internal': lazyImport(_digigov_form_internal),
103
- '@digigov/form/MultiplicityField/add-objects': lazyImport(_digigov_form_MultiplicityField_add_objects),
104
- '@digigov/form/MultiplicityField': lazyImport(_digigov_form_MultiplicityField),
105
- '@digigov/form/Questions/getNextStep': lazyImport(_digigov_form_Questions_getNextStep),
106
- '@digigov/form/Questions': lazyImport(_digigov_form_Questions),
107
- '@digigov/form/Questions/Questions': lazyImport(_digigov_form_Questions_Questions),
108
- '@digigov/form/Questions/QuestionsContext': lazyImport(_digigov_form_Questions_QuestionsContext),
109
- '@digigov/form/Questions/Step/getAddMoreFields': lazyImport(_digigov_form_Questions_Step_getAddMoreFields),
110
- '@digigov/form/Questions/Step': lazyImport(_digigov_form_Questions_Step),
111
- '@digigov/form/Questions/Step/ReviewStep': lazyImport(_digigov_form_Questions_Step_ReviewStep),
112
- '@digigov/form/Questions/Step/Step': lazyImport(_digigov_form_Questions_Step_Step),
113
- '@digigov/form/Questions/Step/StepArrayReview': lazyImport(_digigov_form_Questions_Step_StepArrayReview),
114
- '@digigov/form/Questions/Step/StepContext': lazyImport(_digigov_form_Questions_Step_StepContext),
115
- '@digigov/form/Questions/Step/StepDescription': lazyImport(_digigov_form_Questions_Step_StepDescription),
116
- '@digigov/form/Questions/Step/StepForm': lazyImport(_digigov_form_Questions_Step_StepForm),
117
- '@digigov/form/Questions/Step/StepQuote': lazyImport(_digigov_form_Questions_Step_StepQuote),
118
- '@digigov/form/Questions/Step/StepTitle': lazyImport(_digigov_form_Questions_Step_StepTitle),
119
- '@digigov/form/Questions/Step/types': lazyImport(_digigov_form_Questions_Step_types),
120
- '@digigov/form/Questions/types': lazyImport(_digigov_form_Questions_types),
121
- '@digigov/form/types': lazyImport(_digigov_form_types),
122
- '@digigov/form/utils': lazyImport(_digigov_form_utils),
123
- '@digigov/form/validators': lazyImport(_digigov_form_validators),
124
- '@digigov/form/validators/types': lazyImport(_digigov_form_validators_types),
125
- '@digigov/form/validators/utils/afm': lazyImport(_digigov_form_validators_utils_afm),
126
- '@digigov/form/validators/utils/file': lazyImport(_digigov_form_validators_utils_file),
127
- '@digigov/form/validators/utils/iban': lazyImport(_digigov_form_validators_utils_iban),
128
- '@digigov/form/validators/utils': lazyImport(_digigov_form_validators_utils),
129
- '@digigov/form/validators/utils/int': lazyImport(_digigov_form_validators_utils_int),
130
- '@digigov/form/validators/utils/number': lazyImport(_digigov_form_validators_utils_number),
131
- '@digigov/form/validators/utils/otp': lazyImport(_digigov_form_validators_utils_otp),
132
- '@digigov/form/validators/utils/phone': lazyImport(_digigov_form_validators_utils_phone),
133
- '@digigov/form/validators/utils/postal_code': lazyImport(_digigov_form_validators_utils_postal_code),
134
- '@digigov/form/validators/utils/text_limit': lazyImport(_digigov_form_validators_utils_text_limit),
135
- '@digigov/form/validators/utils/uuid4': lazyImport(_digigov_form_validators_utils_uuid4)
136
- };
package/types.mjs DELETED
@@ -1 +0,0 @@
1
- export {};
package/utils.mjs DELETED
@@ -1,99 +0,0 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
-
5
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
6
-
7
- import { validateFieldsNatively } from '@hookform/resolvers';
8
- import { appendErrors } from 'react-hook-form';
9
-
10
- /**
11
- * Why `path!` ? because it could be `undefined` in some case
12
- * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string
13
- */
14
- var parseErrorSchema = function parseErrorSchema(error, validateAllFieldCriteria) {
15
- return (error.inner || []).reduce(function (previous, error) {
16
- var _error$path;
17
-
18
- error.path = (_error$path = error.path) === null || _error$path === void 0 ? void 0 : _error$path.replace(/\[([0-9]+)\]/g, '.$1');
19
-
20
- if (!previous[error.path]) {
21
- previous[error.path] = {
22
- message: error.message,
23
- type: error.type
24
- };
25
- }
26
-
27
- if (validateAllFieldCriteria) {
28
- var types = previous[error.path].types;
29
- var messages = types && types[error.type];
30
- previous[error.path] = appendErrors(error.path, validateAllFieldCriteria, previous, error.type, messages ? [].concat(messages, error.message) : error.message);
31
- }
32
-
33
- return previous;
34
- }, {});
35
- };
36
-
37
- export var yupResolver = function yupResolver(schema) {
38
- var schemaOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39
- var resolverOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
40
- return /*#__PURE__*/function () {
41
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values, context, options) {
42
- var result, parsed;
43
- return _regeneratorRuntime().wrap(function _callee$(_context) {
44
- while (1) {
45
- switch (_context.prev = _context.next) {
46
- case 0:
47
- _context.prev = 0;
48
-
49
- if (schemaOptions.context && process.env.NODE_ENV === 'development') {
50
- // eslint-disable-next-line no-console
51
- console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead");
52
- }
53
-
54
- _context.next = 4;
55
- return schema[resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'](values, _extends({
56
- abortEarly: false
57
- }, schemaOptions, {
58
- context: context
59
- }));
60
-
61
- case 4:
62
- result = _context.sent;
63
- options.shouldUseNativeValidation && validateFieldsNatively({}, options);
64
- return _context.abrupt("return", {
65
- values: resolverOptions.rawValues ? values : result,
66
- errors: {}
67
- });
68
-
69
- case 9:
70
- _context.prev = 9;
71
- _context.t0 = _context["catch"](0);
72
-
73
- if (_context.t0.inner) {
74
- _context.next = 13;
75
- break;
76
- }
77
-
78
- throw _context.t0;
79
-
80
- case 13:
81
- parsed = parseErrorSchema(_context.t0, !options.shouldUseNativeValidation && options.criteriaMode === 'all');
82
- return _context.abrupt("return", {
83
- values: {},
84
- errors: parsed
85
- });
86
-
87
- case 15:
88
- case "end":
89
- return _context.stop();
90
- }
91
- }
92
- }, _callee, null, [[0, 9]]);
93
- }));
94
-
95
- return function (_x, _x2, _x3) {
96
- return _ref.apply(this, arguments);
97
- };
98
- }();
99
- };