@digigov/form 2.0.0-254f7786 → 2.0.0-264e5fff

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 (627) hide show
  1. package/Field/ErrorGroup/index.js +48 -0
  2. package/{inputs/inputsScenarios → Field/ErrorGroup}/package.json +1 -1
  3. package/Field/ErrorGroup.d.ts +15 -0
  4. package/Field/ErrorGroup.js.map +7 -0
  5. package/Field/FieldBase/index.js +39 -26
  6. package/Field/FieldBase.d.ts +1 -1
  7. package/Field/FieldBase.js.map +2 -2
  8. package/Field/FieldBaseContainer/index.js +37 -17
  9. package/Field/FieldBaseContainer.d.ts +2 -2
  10. package/Field/FieldBaseContainer.js.map +2 -2
  11. package/Field/FieldConditional/index.js +4 -0
  12. package/Field/FieldConditional.d.ts +1 -1
  13. package/Field/FieldConditional.js.map +2 -2
  14. package/Field/index.d.ts +1 -1
  15. package/Field/index.js +29 -28
  16. package/Field/index.js.map +2 -2
  17. package/Field/types.d.ts +27 -12
  18. package/Field/utils/evaluateFieldWithConditions.d.ts +2 -2
  19. package/Field/utils/evaluateFieldWithConditions.js.map +2 -2
  20. package/Field/utils/resolveField/index.js +35 -0
  21. package/Field/utils/{calculateField → resolveField}/package.json +1 -1
  22. package/Field/utils/resolveField.d.ts +3 -0
  23. package/Field/utils/resolveField.js.map +7 -0
  24. package/Field/utils/useField/index.js +17 -2
  25. package/Field/utils/useField.d.ts +1 -1
  26. package/Field/utils/useField.js.map +2 -2
  27. package/FieldArray/BaseFieldArray/index.js +76 -0
  28. package/FieldArray/BaseFieldArray/package.json +6 -0
  29. package/FieldArray/BaseFieldArray.d.ts +5 -0
  30. package/FieldArray/BaseFieldArray.js.map +7 -0
  31. package/FieldArray/FieldArray.stories.d.ts +2 -0
  32. package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay/index.js +23 -0
  33. package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay/package.json +6 -0
  34. package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.d.ts +9 -0
  35. package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.js.map +7 -0
  36. package/FieldArray/FormDialog/ArrayDisplay/ArrayDisplay.stories.d.ts +13 -0
  37. package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay/index.js +184 -0
  38. package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay/package.json +6 -0
  39. package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.d.ts +26 -0
  40. package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.js.map +7 -0
  41. package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader/index.js +11 -0
  42. package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader/package.json +6 -0
  43. package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.d.ts +5 -0
  44. package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.js.map +7 -0
  45. package/FieldArray/FormDialog/ArrayDisplay/__stories__/Cards.d.ts +2 -0
  46. package/FieldArray/FormDialog/ArrayDisplay/__stories__/Default.d.ts +2 -0
  47. package/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnly.d.ts +2 -0
  48. package/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnlyCards.d.ts +2 -0
  49. package/FieldArray/FormDialog/ArrayDisplay/__stories__/Sortable.d.ts +2 -0
  50. package/FieldArray/FormDialog/ArrayDisplay/__stories__/SortableCards.d.ts +2 -0
  51. package/FieldArray/FormDialog/ArrayDisplay/index.d.ts +15 -0
  52. package/FieldArray/FormDialog/ArrayDisplay/index.js +57 -0
  53. package/FieldArray/FormDialog/ArrayDisplay/index.js.map +7 -0
  54. package/{inputs/Input/inputsInputScenarios → FieldArray/FormDialog/ArrayDisplay}/package.json +1 -1
  55. package/FieldArray/FormDialog/ArrayEditModal/index.js +158 -0
  56. package/FieldArray/FormDialog/ArrayEditModal/package.json +6 -0
  57. package/FieldArray/FormDialog/ArrayEditModal.d.ts +24 -0
  58. package/FieldArray/FormDialog/ArrayEditModal.js.map +7 -0
  59. package/FieldArray/FormDialog/index.d.ts +19 -0
  60. package/FieldArray/FormDialog/index.js +234 -0
  61. package/FieldArray/FormDialog/index.js.map +7 -0
  62. package/FieldArray/FormDialog/package.json +6 -0
  63. package/FieldArray/__stories__/CardsWithError.d.ts +15 -0
  64. package/FieldArray/__stories__/Default.d.ts +1 -1
  65. package/FieldArray/__stories__/WithExactLength.d.ts +1 -1
  66. package/FieldArray/__stories__/WithModal.d.ts +2 -0
  67. package/FieldArray/index.d.ts +10 -2
  68. package/FieldArray/index.js +60 -42
  69. package/FieldArray/index.js.map +2 -2
  70. package/FieldObject/index.d.ts +8 -3
  71. package/FieldObject/index.js +32 -24
  72. package/FieldObject/index.js.map +2 -2
  73. package/Fieldset/FieldsetWithContext.js.map +1 -1
  74. package/Fieldset/index.d.ts +1 -1
  75. package/Fieldset/index.js.map +1 -1
  76. package/Fieldset/types.d.ts +2 -2
  77. package/FormBuilder/FormBuilder.stories.d.ts +4 -0
  78. package/FormBuilder/__stories__/AutoErrorGrouping.d.ts +3 -0
  79. package/FormBuilder/__stories__/Default.d.ts +1 -1
  80. package/FormBuilder/__stories__/ErrorGrouping.d.ts +3 -0
  81. package/FormBuilder/index.d.ts +2 -2
  82. package/FormBuilder/index.js +189 -80
  83. package/FormBuilder/index.js.map +2 -2
  84. package/FormContext/index.js +6 -2
  85. package/FormContext.d.ts +3 -2
  86. package/FormContext.js.map +2 -2
  87. package/MultiplicityField/MultiplicityField.stories.d.ts +2 -0
  88. package/MultiplicityField/__stories__/Default.d.ts +1 -1
  89. package/MultiplicityField/__stories__/PreviewDisplay.d.ts +1 -1
  90. package/MultiplicityField/__stories__/WithExactLength.d.ts +1 -1
  91. package/MultiplicityField/__stories__/WithMaxLength.d.ts +1 -1
  92. package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +1 -1
  93. package/MultiplicityField/__stories__/WithMinLength.d.ts +1 -1
  94. package/MultiplicityField/add-objects/index.js +12 -19
  95. package/MultiplicityField/add-objects.d.ts +1 -1
  96. package/MultiplicityField/add-objects.js.map +2 -2
  97. package/MultiplicityField/index.d.ts +2 -2
  98. package/MultiplicityField/index.js +5 -1
  99. package/MultiplicityField/index.js.map +2 -2
  100. package/MultiplicityField/types.d.ts +3 -2
  101. package/Questions/Questions.d.ts +1 -1
  102. package/Questions/Questions.js.map +1 -1
  103. package/Questions/Questions.stories.d.ts +2 -0
  104. package/Questions/QuestionsContext.d.ts +1 -1
  105. package/Questions/QuestionsContext.js.map +1 -1
  106. package/Questions/Step/Step.d.ts +1 -1
  107. package/Questions/Step/Step.js.map +1 -1
  108. package/Questions/Step/StepArrayReview.d.ts +1 -1
  109. package/Questions/Step/StepArrayReview.js.map +1 -1
  110. package/Questions/Step/StepContext.d.ts +1 -1
  111. package/Questions/Step/StepContext.js.map +1 -1
  112. package/Questions/Step/StepDescription.d.ts +1 -1
  113. package/Questions/Step/StepDescription.js.map +2 -2
  114. package/Questions/Step/StepForm.d.ts +2 -2
  115. package/Questions/Step/StepForm.js.map +1 -1
  116. package/Questions/Step/StepQuote.d.ts +1 -1
  117. package/Questions/Step/StepQuote.js.map +2 -2
  118. package/Questions/Step/StepTitle.d.ts +1 -1
  119. package/Questions/Step/StepTitle.js.map +2 -2
  120. package/Questions/Step/getAddMoreFields.d.ts +2 -2
  121. package/Questions/Step/getAddMoreFields.js.map +1 -1
  122. package/Questions/Step/types.d.ts +1 -1
  123. package/Questions/__stories__/Default.d.ts +1 -1
  124. package/Questions/getNextStep.d.ts +1 -1
  125. package/Questions/getNextStep.js.map +1 -1
  126. package/Questions/types.d.ts +1 -1
  127. package/cjs/Field/ErrorGroup/index.js +82 -0
  128. package/cjs/Field/ErrorGroup.js.map +7 -0
  129. package/cjs/Field/FieldBase/index.js +38 -25
  130. package/cjs/Field/FieldBase.js.map +2 -2
  131. package/cjs/Field/FieldBaseContainer/index.js +36 -16
  132. package/cjs/Field/FieldBaseContainer.js.map +3 -3
  133. package/cjs/Field/FieldConditional/index.js +4 -0
  134. package/cjs/Field/FieldConditional.js.map +2 -2
  135. package/cjs/Field/index.js +29 -25
  136. package/cjs/Field/index.js.map +2 -2
  137. package/cjs/Field/types.js.map +1 -1
  138. package/cjs/Field/utils/evaluateFieldWithConditions.js.map +2 -2
  139. package/cjs/Field/utils/resolveField/index.js +55 -0
  140. package/cjs/Field/utils/resolveField.js.map +7 -0
  141. package/cjs/Field/utils/useField/index.js +17 -2
  142. package/cjs/Field/utils/useField.js.map +2 -2
  143. package/cjs/FieldArray/BaseFieldArray/index.js +109 -0
  144. package/cjs/FieldArray/BaseFieldArray.js.map +7 -0
  145. package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay/index.js +56 -0
  146. package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.js.map +7 -0
  147. package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay/index.js +209 -0
  148. package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.js.map +7 -0
  149. package/cjs/{locales/el → FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader}/index.js +16 -7
  150. package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.js.map +7 -0
  151. package/cjs/FieldArray/FormDialog/ArrayDisplay/index.js +90 -0
  152. package/cjs/FieldArray/FormDialog/ArrayDisplay/index.js.map +7 -0
  153. package/cjs/FieldArray/FormDialog/ArrayEditModal/index.js +186 -0
  154. package/cjs/FieldArray/FormDialog/ArrayEditModal.js.map +7 -0
  155. package/cjs/FieldArray/FormDialog/index.js +261 -0
  156. package/cjs/FieldArray/FormDialog/index.js.map +7 -0
  157. package/cjs/FieldArray/index.js +59 -41
  158. package/cjs/FieldArray/index.js.map +3 -3
  159. package/cjs/FieldObject/index.js +32 -21
  160. package/cjs/FieldObject/index.js.map +2 -2
  161. package/cjs/Fieldset/FieldsetWithContext.js.map +1 -1
  162. package/cjs/Fieldset/index.js.map +1 -1
  163. package/cjs/Fieldset/types.js.map +1 -1
  164. package/cjs/FormBuilder/index.js +191 -82
  165. package/cjs/FormBuilder/index.js.map +3 -3
  166. package/cjs/FormContext/index.js +7 -2
  167. package/cjs/FormContext.js.map +2 -2
  168. package/cjs/MultiplicityField/add-objects/index.js +11 -13
  169. package/cjs/MultiplicityField/add-objects.js.map +2 -2
  170. package/cjs/MultiplicityField/index.js +5 -1
  171. package/cjs/MultiplicityField/index.js.map +2 -2
  172. package/cjs/MultiplicityField/types.js.map +1 -1
  173. package/cjs/Questions/Questions.js.map +1 -1
  174. package/cjs/Questions/QuestionsContext.js.map +1 -1
  175. package/cjs/Questions/Step/Step.js.map +1 -1
  176. package/cjs/Questions/Step/StepArrayReview.js.map +1 -1
  177. package/cjs/Questions/Step/StepContext.js.map +1 -1
  178. package/cjs/Questions/Step/StepDescription.js.map +2 -2
  179. package/cjs/Questions/Step/StepForm.js.map +1 -1
  180. package/cjs/Questions/Step/StepQuote.js.map +2 -2
  181. package/cjs/Questions/Step/StepTitle.js.map +2 -2
  182. package/cjs/Questions/Step/getAddMoreFields.js.map +1 -1
  183. package/cjs/Questions/Step/types.js.map +1 -1
  184. package/cjs/Questions/getNextStep.js.map +1 -1
  185. package/cjs/Questions/types.js.map +1 -1
  186. package/cjs/hooks/useFieldFocusManager/index.js +135 -0
  187. package/cjs/hooks/useFieldFocusManager.js.map +7 -0
  188. package/cjs/hooks/utils/index.js +98 -0
  189. package/cjs/hooks/utils.js.map +7 -0
  190. package/cjs/inputs/AutoCompleteInput/index.js +2 -1
  191. package/cjs/inputs/AutoCompleteInput/index.js.map +2 -2
  192. package/cjs/inputs/Checkboxes/index.js +68 -61
  193. package/cjs/inputs/Checkboxes/index.js.map +2 -2
  194. package/cjs/inputs/DateInput/index.js +57 -22
  195. package/cjs/inputs/DateInput/index.js.map +2 -2
  196. package/cjs/inputs/DateTimeInput/index.js +250 -0
  197. package/cjs/inputs/DateTimeInput/index.js.map +7 -0
  198. package/cjs/inputs/FileInput/index.js +60 -30
  199. package/cjs/inputs/FileInput/index.js.map +2 -2
  200. package/cjs/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
  201. package/cjs/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
  202. package/cjs/inputs/ImageInput/index.js +49 -12
  203. package/cjs/inputs/ImageInput/index.js.map +2 -2
  204. package/cjs/inputs/Input/index.js +15 -3
  205. package/cjs/inputs/Input/index.js.map +2 -2
  206. package/cjs/inputs/Label/index.js.map +1 -1
  207. package/cjs/inputs/OtpInput/index.js +36 -30
  208. package/cjs/inputs/OtpInput/index.js.map +2 -2
  209. package/cjs/inputs/Radio/index.js +8 -5
  210. package/cjs/inputs/Radio/index.js.map +3 -3
  211. package/cjs/inputs/Select/index.js +9 -2
  212. package/cjs/inputs/Select/index.js.map +2 -2
  213. package/cjs/{Field/utils → inputs/registry}/index.js +13 -5
  214. package/cjs/inputs/registry.js.map +7 -0
  215. package/cjs/lazy/index.js +22 -8
  216. package/cjs/lazy.js.map +2 -2
  217. package/cjs/registry/index.js +39 -17
  218. package/cjs/registry.js.map +2 -2
  219. package/cjs/types.js.map +1 -1
  220. package/cjs/utils/index.js +29 -6
  221. package/cjs/utils.js.map +2 -2
  222. package/cjs/validators/index.js +54 -20
  223. package/cjs/validators/index.js.map +2 -2
  224. package/cjs/validators/types.js.map +1 -1
  225. package/cjs/validators/utils/amka/index.js +60 -0
  226. package/cjs/validators/utils/amka.js.map +7 -0
  227. package/cjs/validators/utils/date/index.js +26 -3
  228. package/cjs/validators/utils/date.js.map +2 -2
  229. package/cjs/validators/utils/datetime/index.js +245 -0
  230. package/cjs/validators/utils/datetime.js.map +7 -0
  231. package/cjs/validators/utils/email/index.js +39 -0
  232. package/cjs/validators/utils/email.js.map +7 -0
  233. package/cjs/validators/utils/file/index.js +30 -17
  234. package/cjs/validators/utils/file.js.map +2 -2
  235. package/cjs/validators/utils/iban.js.map +1 -1
  236. package/cjs/validators/utils/image.js.map +1 -1
  237. package/cjs/validators/utils/index.js +15 -5
  238. package/cjs/validators/utils/index.js.map +2 -2
  239. package/cjs/validators/utils/int/index.js +1 -1
  240. package/cjs/validators/utils/int.js.map +2 -2
  241. package/cjs/validators/utils/number/index.js +1 -1
  242. package/cjs/validators/utils/number.js.map +2 -2
  243. package/cjs/validators/utils/otp.js.map +1 -1
  244. package/cjs/validators/utils/phone.js.map +1 -1
  245. package/cjs/validators/utils/postal_code.js.map +1 -1
  246. package/cjs/validators/utils/text_limit.js.map +1 -1
  247. package/hooks/useFieldFocusManager/index.js +116 -0
  248. package/hooks/useFieldFocusManager/package.json +6 -0
  249. package/hooks/useFieldFocusManager.d.ts +25 -0
  250. package/hooks/useFieldFocusManager.js.map +7 -0
  251. package/hooks/utils/index.js +73 -0
  252. package/{Field → hooks}/utils/package.json +1 -1
  253. package/hooks/utils.d.ts +18 -0
  254. package/hooks/utils.js.map +7 -0
  255. package/index.js +1 -1
  256. package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +2 -0
  257. package/inputs/AutoCompleteInput/__stories__/Default.d.ts +1 -1
  258. package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +1 -1
  259. package/inputs/AutoCompleteInput/index.d.ts +3 -3
  260. package/inputs/AutoCompleteInput/index.js +3 -4
  261. package/inputs/AutoCompleteInput/index.js.map +2 -2
  262. package/inputs/Checkboxes/Checkboxes.stories.d.ts +2 -0
  263. package/inputs/Checkboxes/__stories__/Conditional.d.ts +1 -1
  264. package/inputs/Checkboxes/__stories__/Default.d.ts +1 -1
  265. package/inputs/Checkboxes/__stories__/WithDivider.d.ts +1 -1
  266. package/inputs/Checkboxes/index.d.ts +5 -3
  267. package/inputs/Checkboxes/index.js +68 -61
  268. package/inputs/Checkboxes/index.js.map +2 -2
  269. package/inputs/DateInput/DateInput.stories.d.ts +6 -0
  270. package/inputs/DateInput/__stories__/Default.d.ts +1 -1
  271. package/inputs/DateInput/__stories__/WithDefaultValue.d.ts +3 -0
  272. package/inputs/DateInput/__stories__/WithInitialValue.d.ts +3 -0
  273. package/inputs/DateInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
  274. package/inputs/DateInput/__stories__/WithWrongInitialValue.d.ts +3 -0
  275. package/inputs/DateInput/index.d.ts +2 -5
  276. package/inputs/DateInput/index.js +58 -23
  277. package/inputs/DateInput/index.js.map +2 -2
  278. package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +14 -0
  279. package/inputs/DateTimeInput/__stories__/Default.d.ts +3 -0
  280. package/inputs/DateTimeInput/__stories__/WithDefaultValue.d.ts +3 -0
  281. package/inputs/DateTimeInput/__stories__/WithInitialValue.d.ts +3 -0
  282. package/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
  283. package/inputs/DateTimeInput/__stories__/WithWrongInitialValue.d.ts +3 -0
  284. package/inputs/DateTimeInput/index.d.ts +10 -0
  285. package/inputs/DateTimeInput/index.js +220 -0
  286. package/inputs/DateTimeInput/index.js.map +7 -0
  287. package/inputs/DateTimeInput/package.json +6 -0
  288. package/inputs/FileInput/FileInput.stories.d.ts +3 -0
  289. package/inputs/FileInput/__stories__/Default.d.ts +1 -1
  290. package/inputs/FileInput/__stories__/WithBorderAndLink.d.ts +3 -0
  291. package/inputs/FileInput/index.d.ts +18 -2
  292. package/inputs/FileInput/index.js +61 -31
  293. package/inputs/FileInput/index.js.map +2 -2
  294. package/inputs/ImageInput/ImageInput.stories.d.ts +4 -1
  295. package/inputs/ImageInput/__stories__/Default.d.ts +1 -1
  296. package/inputs/ImageInput/__stories__/MaxSize.d.ts +1 -1
  297. package/inputs/ImageInput/__stories__/WithInitialValues.d.ts +3 -0
  298. package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +1 -1
  299. package/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
  300. package/inputs/ImageInput/__stories__/logo.d/package.json +6 -0
  301. package/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
  302. package/inputs/ImageInput/index.d.ts +10 -2
  303. package/inputs/ImageInput/index.js +50 -13
  304. package/inputs/ImageInput/index.js.map +2 -2
  305. package/inputs/Input/Input.stories.d.ts +6 -0
  306. package/inputs/Input/__stories__/AFM.d.ts +1 -1
  307. package/inputs/Input/__stories__/AMKA.d.ts +3 -0
  308. package/inputs/Input/__stories__/Boolean.d.ts +1 -1
  309. package/inputs/Input/__stories__/Email.d.ts +3 -0
  310. package/inputs/Input/__stories__/IBAN.d.ts +1 -1
  311. package/inputs/Input/__stories__/Integer.d.ts +1 -1
  312. package/inputs/Input/__stories__/LandlineNumber.d.ts +1 -1
  313. package/inputs/Input/__stories__/MobilePhone.d.ts +1 -1
  314. package/inputs/Input/__stories__/PhoneNumber.d.ts +1 -1
  315. package/inputs/Input/__stories__/PostalCode.d.ts +1 -1
  316. package/inputs/Input/__stories__/Rate.d.ts +3 -0
  317. package/inputs/Input/__stories__/String.d.ts +1 -1
  318. package/inputs/Input/__stories__/StringWithTrimValidation.d.ts +3 -0
  319. package/inputs/Input/__stories__/TextWithLimit.d.ts +1 -1
  320. package/inputs/Input/index.d.ts +5 -2
  321. package/inputs/Input/index.js +15 -3
  322. package/inputs/Input/index.js.map +2 -2
  323. package/inputs/Label/Label.stories.d.ts +2 -0
  324. package/inputs/Label/__stories__/Default.d.ts +1 -1
  325. package/inputs/Label/index.d.ts +1 -1
  326. package/inputs/Label/index.js.map +1 -1
  327. package/inputs/OtpInput/OtpInput.stories.d.ts +2 -0
  328. package/inputs/OtpInput/__stories__/Default.d.ts +1 -1
  329. package/inputs/OtpInput/index.d.ts +1 -5
  330. package/inputs/OtpInput/index.js +36 -30
  331. package/inputs/OtpInput/index.js.map +2 -2
  332. package/inputs/Radio/Radio.stories.d.ts +2 -0
  333. package/inputs/Radio/__stories__/Conditional.d.ts +1 -1
  334. package/inputs/Radio/__stories__/Default.d.ts +1 -1
  335. package/inputs/Radio/__stories__/WithDivider.d.ts +1 -1
  336. package/inputs/Radio/index.d.ts +6 -4
  337. package/inputs/Radio/index.js +8 -5
  338. package/inputs/Radio/index.js.map +3 -3
  339. package/inputs/Select/Select.stories.d.ts +2 -0
  340. package/inputs/Select/__stories__/Default.d.ts +1 -1
  341. package/inputs/Select/index.d.ts +6 -3
  342. package/inputs/Select/index.js +9 -2
  343. package/inputs/Select/index.js.map +2 -2
  344. package/{Field/utils → inputs/registry}/index.js +10 -2
  345. package/{locales/el → inputs/registry}/package.json +1 -1
  346. package/{Field/utils/index.d.ts → inputs/registry.d.ts} +2 -1
  347. package/inputs/registry.js.map +7 -0
  348. package/lazy/index.js +22 -8
  349. package/package.json +8 -8
  350. package/registry/index.js +39 -17
  351. package/src/Field/ErrorGroup.tsx +84 -0
  352. package/src/Field/FieldBase.tsx +42 -26
  353. package/src/Field/FieldBaseContainer.tsx +69 -45
  354. package/src/Field/FieldConditional.tsx +5 -1
  355. package/src/Field/doc.mdx +202 -1
  356. package/src/Field/index.tsx +32 -37
  357. package/src/Field/types.tsx +30 -14
  358. package/src/Field/utils/evaluateFieldWithConditions.ts +5 -2
  359. package/src/Field/utils/resolveField.ts +58 -0
  360. package/src/Field/utils/useField.ts +17 -3
  361. package/src/FieldArray/BaseFieldArray.tsx +97 -0
  362. package/src/FieldArray/FieldArray.stories.js +2 -0
  363. package/src/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.tsx +45 -0
  364. package/src/FieldArray/FormDialog/ArrayDisplay/ArrayDisplay.stories.js +14 -0
  365. package/src/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.tsx +337 -0
  366. package/src/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.tsx +15 -0
  367. package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/Cards.tsx +88 -0
  368. package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/Default.tsx +93 -0
  369. package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnly.tsx +79 -0
  370. package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnlyCards.tsx +75 -0
  371. package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/Sortable.tsx +93 -0
  372. package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/SortableCards.tsx +88 -0
  373. package/src/FieldArray/FormDialog/ArrayDisplay/index.test.tsx +44 -0
  374. package/src/FieldArray/FormDialog/ArrayDisplay/index.tsx +67 -0
  375. package/src/FieldArray/FormDialog/ArrayEditModal.tsx +241 -0
  376. package/src/FieldArray/FormDialog/index.tsx +302 -0
  377. package/src/FieldArray/__stories__/CardsWithError.tsx +124 -0
  378. package/src/FieldArray/__stories__/Default.tsx +2 -1
  379. package/src/FieldArray/__stories__/WithExactLength.tsx +2 -1
  380. package/src/FieldArray/__stories__/WithModal.tsx +160 -0
  381. package/src/FieldArray/__tests__/fieldset-multiplicity.spec.tsx +271 -0
  382. package/src/FieldArray/__tests__/multiplicity-attachment.spec.tsx +280 -0
  383. package/src/FieldArray/__tests__/multiplicity-optional.spec.tsx +232 -0
  384. package/src/FieldArray/__tests__/multiplicity-required.spec.tsx +170 -0
  385. package/src/FieldArray/__tests__/nested-fieldset-multiplicity.spec.tsx +627 -0
  386. package/src/FieldArray/__tests__/preference-multiple-choice.spec.tsx +222 -0
  387. package/src/FieldArray/index.spec.tsx +355 -0
  388. package/src/FieldArray/index.test.tsx +25 -14
  389. package/src/FieldArray/index.tsx +78 -60
  390. package/src/FieldObject/index.tsx +43 -30
  391. package/src/Fieldset/FieldsetWithContext.tsx +1 -1
  392. package/src/Fieldset/index.tsx +1 -1
  393. package/src/Fieldset/types.tsx +2 -2
  394. package/src/FormBuilder/FormBuilder.stories.js +5 -0
  395. package/src/FormBuilder/__stories__/AutoErrorGrouping.tsx +63 -0
  396. package/src/FormBuilder/__stories__/Default.tsx +1 -1
  397. package/src/FormBuilder/__stories__/ErrorGrouping.tsx +43 -0
  398. package/src/FormBuilder/doc.mdx +9 -4
  399. package/src/FormBuilder/index.test.tsx +22 -11
  400. package/src/FormBuilder/index.tsx +226 -89
  401. package/src/FormBuilder/interaction.test.tsx +40 -0
  402. package/src/FormBuilder/scenarios.test.tsx +1042 -131
  403. package/src/FormContext.tsx +7 -2
  404. package/src/MultiplicityField/MultiplicityField.stories.js +3 -0
  405. package/src/MultiplicityField/__stories__/Default.tsx +1 -1
  406. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +2 -4
  407. package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
  408. package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
  409. package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
  410. package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
  411. package/src/MultiplicityField/add-objects.tsx +14 -21
  412. package/src/MultiplicityField/doc.mdx +101 -83
  413. package/src/MultiplicityField/index.test.tsx +29 -26
  414. package/src/MultiplicityField/index.tsx +7 -2
  415. package/src/MultiplicityField/types.ts +6 -2
  416. package/src/Questions/Questions.stories.js +3 -0
  417. package/src/Questions/Questions.tsx +2 -2
  418. package/src/Questions/QuestionsContext.tsx +1 -1
  419. package/src/Questions/Step/Step.tsx +1 -1
  420. package/src/Questions/Step/StepArrayReview.tsx +2 -2
  421. package/src/Questions/Step/StepContext.tsx +1 -1
  422. package/src/Questions/Step/StepDescription.tsx +2 -1
  423. package/src/Questions/Step/StepForm.tsx +2 -2
  424. package/src/Questions/Step/StepQuote.tsx +2 -1
  425. package/src/Questions/Step/StepTitle.tsx +2 -1
  426. package/src/Questions/Step/getAddMoreFields.tsx +2 -2
  427. package/src/Questions/Step/types.tsx +1 -1
  428. package/src/Questions/__snapshots__/index.spec.tsx.snap +3 -1
  429. package/src/Questions/__stories__/Default.tsx +1 -1
  430. package/src/Questions/doc.mdx +21 -41
  431. package/src/Questions/getNextStep.tsx +1 -1
  432. package/src/Questions/index.spec.tsx +8 -0
  433. package/src/Questions/index.test.tsx +14 -11
  434. package/src/Questions/types.tsx +1 -1
  435. package/src/doc.mdx +26 -11
  436. package/src/hooks/__tests__/useFieldFocusManager.spec.tsx +1079 -0
  437. package/src/hooks/__tests__/utils.spec.ts +568 -0
  438. package/src/hooks/useFieldFocusManager.ts +162 -0
  439. package/src/hooks/utils.ts +122 -0
  440. package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +3 -0
  441. package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +1 -1
  442. package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +1 -1
  443. package/src/inputs/AutoCompleteInput/index.test.tsx +17 -14
  444. package/src/inputs/AutoCompleteInput/index.tsx +5 -6
  445. package/src/inputs/Checkboxes/Checkboxes.stories.js +3 -0
  446. package/src/inputs/Checkboxes/__stories__/Conditional.tsx +1 -1
  447. package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
  448. package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
  449. package/src/inputs/Checkboxes/index.test.tsx +20 -17
  450. package/src/inputs/Checkboxes/index.tsx +98 -89
  451. package/src/inputs/DateInput/DateInput.stories.js +7 -0
  452. package/src/inputs/DateInput/__stories__/Default.tsx +1 -1
  453. package/src/inputs/DateInput/__stories__/WithDefaultValue.tsx +26 -0
  454. package/src/inputs/DateInput/__stories__/WithInitialValue.tsx +28 -0
  455. package/src/inputs/DateInput/__stories__/WithWrongDefaultValue.tsx +26 -0
  456. package/src/inputs/DateInput/__stories__/WithWrongInitialValue.tsx +28 -0
  457. package/src/inputs/DateInput/index.test.tsx +30 -11
  458. package/src/inputs/DateInput/index.tsx +71 -23
  459. package/src/inputs/DateTimeInput/DateTimeInput.stories.js +14 -0
  460. package/src/inputs/DateTimeInput/__stories__/Default.tsx +25 -0
  461. package/src/inputs/DateTimeInput/__stories__/WithDefaultValue.tsx +26 -0
  462. package/src/inputs/DateTimeInput/__stories__/WithInitialValue.tsx +28 -0
  463. package/src/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.tsx +26 -0
  464. package/src/inputs/DateTimeInput/__stories__/WithWrongInitialValue.tsx +28 -0
  465. package/src/inputs/DateTimeInput/doc.mdx +16 -0
  466. package/src/inputs/DateTimeInput/index.test.tsx +40 -0
  467. package/src/inputs/DateTimeInput/index.tsx +246 -0
  468. package/src/inputs/FileInput/FileInput.stories.js +4 -0
  469. package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
  470. package/src/inputs/FileInput/__stories__/WithBorderAndLink.tsx +34 -0
  471. package/src/inputs/FileInput/index.test.tsx +18 -11
  472. package/src/inputs/FileInput/index.tsx +98 -38
  473. package/src/inputs/ImageInput/ImageInput.stories.js +5 -1
  474. package/src/inputs/ImageInput/__stories__/Default.tsx +1 -1
  475. package/src/inputs/ImageInput/__stories__/MaxSize.tsx +3 -2
  476. package/src/inputs/ImageInput/__stories__/{WithInvalidImageSize.tsx → WithInitialValues.tsx} +12 -3
  477. package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +1 -1
  478. package/src/inputs/ImageInput/__stories__/logo.d.ts +4 -0
  479. package/src/inputs/ImageInput/__stories__/logo.png +0 -0
  480. package/src/inputs/ImageInput/index.test.tsx +24 -21
  481. package/src/inputs/ImageInput/index.tsx +102 -44
  482. package/src/inputs/Input/Input.stories.js +7 -0
  483. package/src/inputs/Input/__stories__/AFM.tsx +1 -1
  484. package/src/inputs/Input/__stories__/AMKA.tsx +23 -0
  485. package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
  486. package/src/inputs/Input/__stories__/Email.tsx +23 -0
  487. package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
  488. package/src/inputs/Input/__stories__/Integer.tsx +1 -1
  489. package/src/inputs/Input/__stories__/LandlineNumber.tsx +1 -1
  490. package/src/inputs/Input/__stories__/MobilePhone.tsx +1 -1
  491. package/src/inputs/Input/__stories__/PhoneNumber.tsx +1 -1
  492. package/src/inputs/Input/__stories__/PostalCode.tsx +1 -1
  493. package/src/inputs/Input/__stories__/Rate.tsx +25 -0
  494. package/src/inputs/Input/__stories__/String.tsx +1 -1
  495. package/src/inputs/Input/__stories__/StringWithTrimValidation.tsx +26 -0
  496. package/src/inputs/Input/__stories__/TextWithLimit.tsx +2 -1
  497. package/src/inputs/Input/index.test.tsx +57 -38
  498. package/src/inputs/Input/index.tsx +25 -8
  499. package/src/inputs/Label/Label.stories.js +3 -0
  500. package/src/inputs/Label/__stories__/Default.tsx +1 -1
  501. package/src/inputs/Label/index.test.tsx +14 -11
  502. package/src/inputs/Label/index.tsx +1 -1
  503. package/src/inputs/OtpInput/OtpInput.stories.js +3 -0
  504. package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
  505. package/src/inputs/OtpInput/index.test.tsx +14 -11
  506. package/src/inputs/OtpInput/index.tsx +43 -33
  507. package/src/inputs/Radio/Radio.stories.js +3 -0
  508. package/src/inputs/Radio/__stories__/Conditional.tsx +1 -1
  509. package/src/inputs/Radio/__stories__/Default.tsx +1 -1
  510. package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
  511. package/src/inputs/Radio/index.test.tsx +20 -17
  512. package/src/inputs/Radio/index.tsx +34 -22
  513. package/src/inputs/Select/Select.stories.js +3 -0
  514. package/src/inputs/Select/__stories__/Default.tsx +1 -1
  515. package/src/inputs/Select/index.test.tsx +14 -11
  516. package/src/inputs/Select/index.tsx +17 -6
  517. package/src/{Field/utils/index.ts → inputs/registry.ts} +11 -1
  518. package/src/lazy.js +81 -0
  519. package/src/registry.js +179 -0
  520. package/src/types.tsx +14 -5
  521. package/src/utils.ts +41 -8
  522. package/src/validators/index.ts +101 -29
  523. package/src/validators/types.ts +1 -1
  524. package/src/validators/utils/amka.ts +39 -0
  525. package/src/validators/utils/date.ts +30 -6
  526. package/src/validators/utils/datetime.ts +222 -0
  527. package/src/validators/utils/email.ts +11 -0
  528. package/src/validators/utils/file.ts +35 -21
  529. package/src/validators/utils/iban.ts +2 -2
  530. package/src/validators/utils/image.ts +2 -2
  531. package/src/validators/utils/index.ts +14 -6
  532. package/src/validators/utils/int.ts +2 -2
  533. package/src/validators/utils/number.ts +2 -2
  534. package/src/validators/utils/otp.ts +2 -2
  535. package/src/validators/utils/phone.ts +2 -2
  536. package/src/validators/utils/postal_code.ts +2 -2
  537. package/src/validators/utils/text_limit.ts +2 -2
  538. package/types.d.ts +10 -4
  539. package/types.js.map +1 -1
  540. package/utils/index.js +28 -6
  541. package/utils.d.ts +4 -1
  542. package/utils.js.map +2 -2
  543. package/validators/index.d.ts +6 -6
  544. package/validators/index.js +59 -21
  545. package/validators/index.js.map +2 -2
  546. package/validators/types.d.ts +1 -1
  547. package/validators/utils/amka/index.js +36 -0
  548. package/validators/utils/amka/package.json +6 -0
  549. package/validators/utils/amka.d.ts +6 -0
  550. package/validators/utils/amka.js.map +7 -0
  551. package/validators/utils/date/index.js +26 -3
  552. package/validators/utils/date.d.ts +3 -3
  553. package/validators/utils/date.js.map +2 -2
  554. package/validators/utils/datetime/index.js +210 -0
  555. package/validators/utils/datetime/package.json +6 -0
  556. package/validators/utils/datetime.d.ts +9 -0
  557. package/validators/utils/datetime.js.map +7 -0
  558. package/validators/utils/email/index.js +16 -0
  559. package/validators/utils/email/package.json +6 -0
  560. package/validators/utils/email.d.ts +5 -0
  561. package/validators/utils/email.js.map +7 -0
  562. package/validators/utils/file/index.js +30 -17
  563. package/validators/utils/file.d.ts +2 -2
  564. package/validators/utils/file.js.map +2 -2
  565. package/validators/utils/iban.d.ts +2 -2
  566. package/validators/utils/iban.js.map +1 -1
  567. package/validators/utils/image.d.ts +2 -2
  568. package/validators/utils/image.js.map +1 -1
  569. package/validators/utils/index.d.ts +4 -2
  570. package/validators/utils/index.js +12 -4
  571. package/validators/utils/index.js.map +2 -2
  572. package/validators/utils/int/index.js +1 -1
  573. package/validators/utils/int.d.ts +1 -1
  574. package/validators/utils/int.js.map +2 -2
  575. package/validators/utils/number/index.js +1 -1
  576. package/validators/utils/number.d.ts +1 -1
  577. package/validators/utils/number.js.map +2 -2
  578. package/validators/utils/otp.d.ts +2 -2
  579. package/validators/utils/otp.js.map +1 -1
  580. package/validators/utils/phone.d.ts +2 -2
  581. package/validators/utils/phone.js.map +1 -1
  582. package/validators/utils/postal_code.d.ts +2 -2
  583. package/validators/utils/postal_code.js.map +1 -1
  584. package/validators/utils/text_limit.d.ts +2 -2
  585. package/validators/utils/text_limit.js.map +1 -1
  586. package/Field/utils/calculateField/index.js +0 -27
  587. package/Field/utils/calculateField.d.ts +0 -2
  588. package/Field/utils/calculateField.js.map +0 -7
  589. package/Field/utils/index.js.map +0 -7
  590. package/FormBuilder/index.test.d.ts +0 -1
  591. package/FormBuilder/scenarios.test.d.ts +0 -88
  592. package/MultiplicityField/index.test.d.ts +0 -1
  593. package/Questions/index.spec.d.ts +0 -1
  594. package/Questions/index.test.d.ts +0 -1
  595. package/cjs/Field/utils/calculateField/index.js +0 -50
  596. package/cjs/Field/utils/calculateField.js.map +0 -7
  597. package/cjs/Field/utils/index.js.map +0 -7
  598. package/cjs/inputs/Input/inputsInputScenarios/index.js +0 -439
  599. package/cjs/inputs/Input/inputsInputScenarios.js.map +0 -7
  600. package/cjs/inputs/inputsScenarios/index.js +0 -533
  601. package/cjs/inputs/inputsScenarios.js.map +0 -7
  602. package/cjs/locales/el.js.map +0 -7
  603. package/inputs/AutoCompleteInput/index.test.d.ts +0 -1
  604. package/inputs/Checkboxes/index.test.d.ts +0 -1
  605. package/inputs/DateInput/index.test.d.ts +0 -1
  606. package/inputs/FileInput/index.test.d.ts +0 -1
  607. package/inputs/ImageInput/__stories__/WithInvalidImageSize.d.ts +0 -3
  608. package/inputs/ImageInput/index.test.d.ts +0 -1
  609. package/inputs/Input/index.test.d.ts +0 -1
  610. package/inputs/Input/inputsInputScenarios/index.js +0 -406
  611. package/inputs/Input/inputsInputScenarios.d.ts +0 -57
  612. package/inputs/Input/inputsInputScenarios.js.map +0 -7
  613. package/inputs/Label/index.test.d.ts +0 -1
  614. package/inputs/OtpInput/index.test.d.ts +0 -1
  615. package/inputs/Radio/index.test.d.ts +0 -1
  616. package/inputs/Select/index.test.d.ts +0 -1
  617. package/inputs/inputsScenarios/index.js +0 -499
  618. package/inputs/inputsScenarios.d.ts +0 -296
  619. package/inputs/inputsScenarios.js.map +0 -7
  620. package/locales/el/index.js +0 -6
  621. package/locales/el.d.ts +0 -2
  622. package/locales/el.js.map +0 -7
  623. package/src/Field/utils/calculateField.ts +0 -49
  624. package/src/inputs/Input/inputsInputScenarios.ts +0 -404
  625. package/src/inputs/inputsScenarios.ts +0 -496
  626. package/src/locales/el.ts +0 -3
  627. /package/{FieldArray/index.test.d.ts → hooks/__tests__/utils.spec.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validators/utils/index.ts"],
4
- "sourcesContent": ["import * as yup from 'yup';\nimport { FieldSpec } from '@digigov/form/types';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport * from '@digigov/form/validators/utils/afm';\nexport * from '@digigov/form/validators/utils/file';\nexport * from '@digigov/form/validators/utils/iban';\nexport * from '@digigov/form/validators/utils/otp';\nexport * from '@digigov/form/validators/utils/image';\nexport * from '@digigov/form/validators/utils/phone';\nexport * from '@digigov/form/validators/utils/postal_code';\nexport * from '@digigov/form/validators/utils/uuid4';\nexport * from '@digigov/form/validators/utils/text_limit';\nexport * from '@digigov/form/validators/utils/date';\n\nexport function getYupField(field: FieldSpec, yupTypeMap: Record<string, any>) {\n const yupField = yupTypeMap[field?.type || 'string'] || yupTypeMap['string'];\n return yupField(field);\n}\nexport function computeShape(\n fields: FieldSpec[],\n yupTypeMap: Record<string, ValidatorSchema>,\n validatorRegistry: Record<string, ValidatorSchema[]> | undefined\n) {\n const fieldSchemas = {};\n const objectFields: Record<string, FieldSpec[]> = {};\n fields.forEach((field) => {\n let yupField = getYupField(field, yupTypeMap);\n if (field.condition) {\n for (const key in field.condition) {\n let then: any, otherwise: any;\n if (field.condition[key].then) {\n if (field.condition[key].then?.required === false) {\n then = yupField.nullable();\n } else if (field.condition[key].then?.required === true) {\n then = yupField.nullable().required('form.error.required');\n }\n }\n if (field.condition[key].else) {\n if (field.condition[key].else?.required === false) {\n otherwise = yupField.nullable();\n } else if (field.condition[key].else?.required === true) {\n otherwise = yupField.nullable().required('form.error.required');\n }\n }\n if (then || otherwise) {\n yupField = yupField.when(key, {\n is: (val) => {\n //@ts-ignore\n const is = field.condition[key].is;\n if (is === val || (Array.isArray(val) && val.includes(is))) {\n return true;\n } else {\n return false;\n }\n },\n then,\n otherwise,\n });\n }\n }\n } else if (field.required) {\n yupField = yupField.nullable().required('form.error.required');\n }\n if (validatorRegistry && field.type && validatorRegistry[field.type]) {\n validatorRegistry[field.type].forEach((validator: any) => {\n yupField = yupField.test(validator);\n });\n }\n if (field.validators) {\n field.validators.forEach((validator) => {\n yupField = yupField.test(validator);\n });\n }\n fieldSchemas[field.key] = yupField;\n });\n for (const objectKey in objectFields) {\n fieldSchemas[objectKey] = getYupObjectShape(\n objectFields[objectKey],\n yupTypeMap,\n validatorRegistry\n );\n }\n return fieldSchemas;\n}\n\nexport function getYupObjectShape(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fields: FieldSpec[] | any,\n yupTypeMap: Record<string, any>,\n validatorRegistry?: Record<string, ValidatorSchema[]>\n) {\n if (!fields.current) {\n const fieldSchemas = computeShape(fields, yupTypeMap, validatorRegistry);\n return yup.object().shape(fieldSchemas);\n }\n\n return yup.lazy(function () {\n const fieldSchemas = computeShape(\n Object.values(fields.current),\n yupTypeMap,\n validatorRegistry\n );\n return yup.object().shape(fieldSchemas);\n });\n}\n"],
5
- "mappings": "AAAA,YAAY,SAAS;AAIrB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEP,SAAS,YAAY,OAAkB,YAAiC;AAC7E,QAAM,WAAW,WAAW,OAAO,QAAQ,QAAQ,KAAK,WAAW,QAAQ;AAC3E,SAAO,SAAS,KAAK;AACvB;AACO,SAAS,aACd,QACA,YACA,mBACA;AACA,QAAM,eAAe,CAAC;AACtB,QAAM,eAA4C,CAAC;AACnD,SAAO,QAAQ,CAAC,UAAU;AACxB,QAAI,WAAW,YAAY,OAAO,UAAU;AAC5C,QAAI,MAAM,WAAW;AACnB,iBAAW,OAAO,MAAM,WAAW;AACjC,YAAI,MAAW;AACf,YAAI,MAAM,UAAU,GAAG,EAAE,MAAM;AAC7B,cAAI,MAAM,UAAU,GAAG,EAAE,MAAM,aAAa,OAAO;AACjD,mBAAO,SAAS,SAAS;AAAA,UAC3B,WAAW,MAAM,UAAU,GAAG,EAAE,MAAM,aAAa,MAAM;AACvD,mBAAO,SAAS,SAAS,EAAE,SAAS,qBAAqB;AAAA,UAC3D;AAAA,QACF;AACA,YAAI,MAAM,UAAU,GAAG,EAAE,MAAM;AAC7B,cAAI,MAAM,UAAU,GAAG,EAAE,MAAM,aAAa,OAAO;AACjD,wBAAY,SAAS,SAAS;AAAA,UAChC,WAAW,MAAM,UAAU,GAAG,EAAE,MAAM,aAAa,MAAM;AACvD,wBAAY,SAAS,SAAS,EAAE,SAAS,qBAAqB;AAAA,UAChE;AAAA,QACF;AACA,YAAI,QAAQ,WAAW;AACrB,qBAAW,SAAS,KAAK,KAAK;AAAA,YAC5B,IAAI,CAAC,QAAQ;AAEX,oBAAM,KAAK,MAAM,UAAU,GAAG,EAAE;AAChC,kBAAI,OAAO,OAAQ,MAAM,QAAQ,GAAG,KAAK,IAAI,SAAS,EAAE,GAAI;AAC1D,uBAAO;AAAA,cACT,OAAO;AACL,uBAAO;AAAA,cACT;AAAA,YACF;AAAA,YACA;AAAA,YACA;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,WAAW,MAAM,UAAU;AACzB,iBAAW,SAAS,SAAS,EAAE,SAAS,qBAAqB;AAAA,IAC/D;AACA,QAAI,qBAAqB,MAAM,QAAQ,kBAAkB,MAAM,IAAI,GAAG;AACpE,wBAAkB,MAAM,IAAI,EAAE,QAAQ,CAAC,cAAmB;AACxD,mBAAW,SAAS,KAAK,SAAS;AAAA,MACpC,CAAC;AAAA,IACH;AACA,QAAI,MAAM,YAAY;AACpB,YAAM,WAAW,QAAQ,CAAC,cAAc;AACtC,mBAAW,SAAS,KAAK,SAAS;AAAA,MACpC,CAAC;AAAA,IACH;AACA,iBAAa,MAAM,GAAG,IAAI;AAAA,EAC5B,CAAC;AACD,aAAW,aAAa,cAAc;AACpC,iBAAa,SAAS,IAAI;AAAA,MACxB,aAAa,SAAS;AAAA,MACtB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,kBAEd,QACA,YACA,mBACA;AACA,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,eAAe,aAAa,QAAQ,YAAY,iBAAiB;AACvE,WAAO,IAAI,OAAO,EAAE,MAAM,YAAY;AAAA,EACxC;AAEA,SAAO,IAAI,KAAK,WAAY;AAC1B,UAAM,eAAe;AAAA,MACnB,OAAO,OAAO,OAAO,OAAO;AAAA,MAC5B;AAAA,MACA;AAAA,IACF;AACA,WAAO,IAAI,OAAO,EAAE,MAAM,YAAY;AAAA,EACxC,CAAC;AACH;",
4
+ "sourcesContent": ["import * as yup from 'yup';\nimport type { FieldSpec } from '@digigov/form/types';\nimport type { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport * from '@digigov/form/validators/utils/afm';\nexport * from '@digigov/form/validators/utils/amka';\nexport * from '@digigov/form/validators/utils/file';\nexport * from '@digigov/form/validators/utils/iban';\nexport * from '@digigov/form/validators/utils/otp';\nexport * from '@digigov/form/validators/utils/image';\nexport * from '@digigov/form/validators/utils/phone';\nexport * from '@digigov/form/validators/utils/postal_code';\nexport * from '@digigov/form/validators/utils/uuid4';\nexport * from '@digigov/form/validators/utils/text_limit';\nexport * from '@digigov/form/validators/utils/date';\nexport * from '@digigov/form/validators/utils/datetime';\n\nexport function getYupField(field: FieldSpec, yupTypeMap: Record<string, any>) {\n const yupField = yupTypeMap[field?.type || 'string'] || yupTypeMap['string'];\n return yupField(field);\n}\nexport function computeShape(\n fields: FieldSpec[],\n yupTypeMap: Record<string, ValidatorSchema>,\n validatorRegistry: Record<string, ValidatorSchema[]> | undefined\n) {\n const fieldSchemas = {};\n const objectFields: Record<string, FieldSpec[]> = {};\n fields.forEach((field) => {\n let yupField = getYupField(field, yupTypeMap);\n if (field.condition) {\n for (const key in field.condition) {\n let then: any, otherwise: any;\n if (field.condition[key].then) {\n if (field.condition[key].then?.required === false) {\n then = yupField.nullable();\n } else if (field.condition[key].then?.required === true) {\n then = yupField.nullable().required('form.error.required');\n }\n }\n if (field.condition[key].else) {\n if (field.condition[key].else?.required === false) {\n otherwise = yupField.nullable();\n } else if (field.condition[key].else?.required === true) {\n otherwise = yupField.nullable().required('form.error.required');\n }\n }\n if (then || otherwise) {\n yupField = yupField.when(key, {\n is: (val) => {\n //@ts-ignore\n const is = field.condition[key].is;\n if (is === val || (Array.isArray(val) && val.includes(is))) {\n return true;\n } else {\n return false;\n }\n },\n then,\n otherwise,\n });\n }\n }\n } else if (field.required) {\n yupField = yupField.nullable().required('form.error.required');\n }\n if (validatorRegistry && field.type && validatorRegistry[field.type]) {\n if (Array.isArray(validatorRegistry[field.type])) {\n validatorRegistry[field.type].forEach((validator: any) => {\n yupField = yupField.test(validator);\n });\n } else {\n yupField = yupField.test(validatorRegistry[field.type]);\n }\n }\n if (field.validators) {\n field.validators.forEach((validator) => {\n yupField = yupField.test(validator);\n });\n }\n fieldSchemas[field.key] = yupField;\n });\n for (const objectKey in objectFields) {\n fieldSchemas[objectKey] = getYupObjectShape(\n objectFields[objectKey],\n yupTypeMap,\n validatorRegistry\n );\n }\n return fieldSchemas;\n}\n\nexport function getYupObjectShape(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fields: FieldSpec[] | any,\n yupTypeMap: Record<string, any>,\n validatorRegistry?: Record<string, ValidatorSchema[]>\n) {\n if (!fields.current) {\n const fieldSchemas = computeShape(fields, yupTypeMap, validatorRegistry);\n return yup.object().shape(fieldSchemas);\n }\n\n return yup.lazy(function () {\n const fieldSchemas = computeShape(\n Object.values(fields.current).filter(\n (f: FieldSpec) => !f.key.includes('.')\n ) as FieldSpec[],\n yupTypeMap,\n validatorRegistry\n );\n return yup.object().shape(fieldSchemas);\n });\n}\n"],
5
+ "mappings": "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",
6
6
  "names": []
7
7
  }
@@ -10,7 +10,7 @@ const INT_VALIDATOR = () => {
10
10
  name: "int-validator",
11
11
  message: "form.error.positive_integer_number",
12
12
  test: (value) => {
13
- if (value === null) {
13
+ if (value === void 0) {
14
14
  return true;
15
15
  }
16
16
  return validateIntNumber(value);
@@ -1,3 +1,3 @@
1
- import { ValidatorSchema } from '@digigov/form/validators/types';
1
+ import type { ValidatorSchema } from '@digigov/form/validators/types';
2
2
  export declare function validateIntNumber(number: number): boolean;
3
3
  export declare const INT_VALIDATOR: () => ValidatorSchema;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validators/utils/int.ts"],
4
- "sourcesContent": ["import { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport function validateIntNumber(number: number): boolean {\n if (number === undefined) {\n return false;\n } else {\n return Number.isInteger(number) && Number(number) > 0;\n }\n}\n\nexport const INT_VALIDATOR = (): ValidatorSchema => {\n return {\n name: 'int-validator',\n message: 'form.error.positive_integer_number',\n test: (value: number): boolean => {\n if (value === null) {\n return true;\n }\n return validateIntNumber(value);\n },\n };\n};\n"],
5
- "mappings": "AAEO,SAAS,kBAAkB,QAAyB;AACzD,MAAI,WAAW,QAAW;AACxB,WAAO;AAAA,EACT,OAAO;AACL,WAAO,OAAO,UAAU,MAAM,KAAK,OAAO,MAAM,IAAI;AAAA,EACtD;AACF;AAEO,MAAM,gBAAgB,MAAuB;AAClD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,CAAC,UAA2B;AAChC,UAAI,UAAU,MAAM;AAClB,eAAO;AAAA,MACT;AACA,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import type { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport function validateIntNumber(number: number): boolean {\n if (number === undefined) {\n return false;\n } else {\n return Number.isInteger(number) && Number(number) > 0;\n }\n}\n\nexport const INT_VALIDATOR = (): ValidatorSchema => {\n return {\n name: 'int-validator',\n message: 'form.error.positive_integer_number',\n test: (value: number): boolean => {\n if (value === undefined) {\n return true;\n }\n return validateIntNumber(value);\n },\n };\n};\n"],
5
+ "mappings": "AAEO,SAAS,kBAAkB,QAAyB;AACzD,MAAI,WAAW,QAAW;AACxB,WAAO;AAAA,EACT,OAAO;AACL,WAAO,OAAO,UAAU,MAAM,KAAK,OAAO,MAAM,IAAI;AAAA,EACtD;AACF;AAEO,MAAM,gBAAgB,MAAuB;AAClD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,CAAC,UAA2B;AAChC,UAAI,UAAU,QAAW;AACvB,eAAO;AAAA,MACT;AACA,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -6,7 +6,7 @@ const NUMBER_VALIDATOR = () => {
6
6
  name: "number-validator",
7
7
  message: "form.error.number",
8
8
  test: (value) => {
9
- if (value === null) {
9
+ if (value === void 0) {
10
10
  return true;
11
11
  }
12
12
  return validateNumber(value);
@@ -1,3 +1,3 @@
1
- import { ValidatorSchema } from '@digigov/form/validators/types';
1
+ import type { ValidatorSchema } from '@digigov/form/validators/types';
2
2
  export declare function validateNumber(number: number): boolean;
3
3
  export declare const NUMBER_VALIDATOR: () => ValidatorSchema;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validators/utils/number.ts"],
4
- "sourcesContent": ["import { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport function validateNumber(number: number): boolean {\n return !Number.isNaN(number);\n}\n\nexport const NUMBER_VALIDATOR = (): ValidatorSchema => {\n return {\n name: 'number-validator',\n message: 'form.error.number',\n test: (value: number): boolean => {\n if (value === null) {\n return true;\n }\n return validateNumber(value);\n },\n };\n};\n"],
5
- "mappings": "AAEO,SAAS,eAAe,QAAyB;AACtD,SAAO,CAAC,OAAO,MAAM,MAAM;AAC7B;AAEO,MAAM,mBAAmB,MAAuB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,CAAC,UAA2B;AAChC,UAAI,UAAU,MAAM;AAClB,eAAO;AAAA,MACT;AACA,aAAO,eAAe,KAAK;AAAA,IAC7B;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import type { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport function validateNumber(number: number): boolean {\n return !Number.isNaN(number);\n}\n\nexport const NUMBER_VALIDATOR = (): ValidatorSchema => {\n return {\n name: 'number-validator',\n message: 'form.error.number',\n test: (value: number): boolean => {\n if (value === undefined) {\n return true;\n }\n return validateNumber(value);\n },\n };\n};\n"],
5
+ "mappings": "AAEO,SAAS,eAAe,QAAyB;AACtD,SAAO,CAAC,OAAO,MAAM,MAAM;AAC7B;AAEO,MAAM,mBAAmB,MAAuB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,CAAC,UAA2B;AAChC,UAAI,UAAU,QAAW;AACvB,eAAO;AAAA,MACT;AACA,aAAO,eAAe,KAAK;AAAA,IAC7B;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { FieldSpec } from '@digigov/form/types';
2
- import { ValidatorSchema } from '@digigov/form/validators/types';
1
+ import type { FieldSpec } from '@digigov/form/types';
2
+ import type { ValidatorSchema } from '@digigov/form/validators/types';
3
3
  export declare function validateOtp(value: string, maxLength: number): boolean;
4
4
  export declare const OTP_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validators/utils/otp.ts"],
4
- "sourcesContent": ["import { FieldSpec } from '@digigov/form/types';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\nexport function validateOtp(value: string, maxLength: number): boolean {\n if (value.length === maxLength) {\n return true;\n } else {\n return false;\n }\n}\n\nexport const OTP_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const maxLength = field?.maxLength;\n return {\n name: 'otp-validator',\n message: {\n key: 'form.error.otp.less_than',\n context: {\n maxLength: field?.maxLength,\n },\n },\n test: (value: string): boolean => {\n if (!value) {\n return true;\n }\n return validateOtp(value, maxLength as number);\n },\n };\n};\n"],
4
+ "sourcesContent": ["import type { FieldSpec } from '@digigov/form/types';\nimport type { ValidatorSchema } from '@digigov/form/validators/types';\nexport function validateOtp(value: string, maxLength: number): boolean {\n if (value.length === maxLength) {\n return true;\n } else {\n return false;\n }\n}\n\nexport const OTP_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const maxLength = field?.maxLength;\n return {\n name: 'otp-validator',\n message: {\n key: 'form.error.otp.less_than',\n context: {\n maxLength: field?.maxLength,\n },\n },\n test: (value: string): boolean => {\n if (!value) {\n return true;\n }\n return validateOtp(value, maxLength as number);\n },\n };\n};\n"],
5
5
  "mappings": "AAEO,SAAS,YAAY,OAAe,WAA4B;AACrE,MAAI,MAAM,WAAW,WAAW;AAC9B,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAEO,MAAM,gBAAgB,CAAC,UAAsC;AAClE,QAAM,YAAY,OAAO;AACzB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,MACP,KAAK;AAAA,MACL,SAAS;AAAA,QACP,WAAW,OAAO;AAAA,MACpB;AAAA,IACF;AAAA,IACA,MAAM,CAAC,UAA2B;AAChC,UAAI,CAAC,OAAO;AACV,eAAO;AAAA,MACT;AACA,aAAO,YAAY,OAAO,SAAmB;AAAA,IAC/C;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
- import { FieldSpec } from '@digigov/form/types';
2
- import { ValidatorSchema } from '@digigov/form/validators/types';
1
+ import type { FieldSpec } from '@digigov/form/types';
2
+ import type { ValidatorSchema } from '@digigov/form/validators/types';
3
3
  export type PhoneNumberType = 'landline' | 'mobile' | null;
4
4
  export declare function discoverPhoneType(phoneNumber: string, config: any): string;
5
5
  export declare function validatePhoneNumber(phoneNumber: string, countries?: string[], typeOfPhoneNumber?: PhoneNumberType): boolean;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validators/utils/phone.ts"],
4
- "sourcesContent": ["import { FieldSpec } from '@digigov/form/types';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport type PhoneNumberType = 'landline' | 'mobile' | null;\n// add more countries from here libphonenumber-js/metadata.full.json\nconst countryPhoneData = {\n GR: [\n '30',\n '00',\n '5005000\\\\d{3}|8\\\\d{9,11}|(?:[269]\\\\d|70)\\\\d{8}',\n [10, 11, 12],\n [\n ['(\\\\d{2})(\\\\d{4})(\\\\d{4})', '$1 $2 $3', ['21|7']],\n [\n '(\\\\d{4})(\\\\d{6})',\n '$1 $2',\n ['2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5'],\n ],\n ['(\\\\d{3})(\\\\d{3})(\\\\d{4})', '$1 $2 $3', ['[2689]']],\n ['(\\\\d{3})(\\\\d{3,4})(\\\\d{5})', '$1 $2 $3', ['8']],\n ],\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n [\n [\n '2(?:1\\\\d\\\\d|2(?:2[1-46-9]|[36][1-8]|4[1-7]|5[1-4]|7[1-5]|[89][1-9])|3(?:1\\\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\\\d|[269][1-6]|3[1245]|4[1-7]|5[13-9]|7[14]|8[1-5])|7(?:1\\\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\\\d|2[1-5]|[34][1-4]|9[1-57]))\\\\d{6}',\n [10],\n ],\n ['68[57-9]\\\\d{7}|(?:69|94)\\\\d{8}', [10]],\n ['800\\\\d{7,9}'],\n ['90[19]\\\\d{7}', [10]],\n ['70\\\\d{8}', [10]],\n 0,\n ['5005000\\\\d{3}', [10]],\n 0,\n 0,\n ['8(?:0[16]|12|[27]5|50)\\\\d{7}', [10]],\n ],\n ],\n};\n\nfunction expandPhoneNumberStructure(compressed) {\n const countries = Object.keys(compressed);\n const expanded: any = {};\n for (const country of countries) {\n expanded[country] = {\n fixedLine: {\n possibleLengths: {\n _national: compressed[country][3].map(String),\n },\n nationalNumberPattern: compressed[country][11][0][0],\n },\n mobile: {\n nationalNumberPattern: compressed[country][11][1][0],\n },\n tollFree: {\n nationalNumberPattern: compressed[country][11][2][0],\n },\n premiumRate: {\n nationalNumberPattern: compressed[country][11][3][0],\n },\n sharedCost: {\n nationalNumberPattern: compressed[country][11][9][0],\n },\n personalNumber: {\n nationalNumberPattern: compressed[country][11][4][0],\n },\n uan: {\n nationalNumberPattern: compressed[country][11][6][0],\n },\n id: country,\n countryCode: compressed[country][0],\n internationalPrefix: compressed[country][1],\n };\n }\n return expanded;\n}\nconst PHONENUMBER_SPEC = expandPhoneNumberStructure(countryPhoneData);\nexport function discoverPhoneType(phoneNumber: string, config: any): string {\n const cleanNumber = phoneNumber\n .replace(/\\D/g, '')\n .replace(/\\s/g, '')\n .replace(/^\\+/, '')\n .replace(new RegExp('^' + config.internationalPrefix, ''), '')\n .replace(new RegExp('^' + config.countryCode, ''), '');\n const categories = {\n landline: config.fixedLine,\n mobile: config.mobile,\n 'toll-free': config.tollFree,\n 'premium-rate': config.premiumRate,\n };\n\n for (const [categoryName, categoryDetails] of Object.entries(categories)) {\n const pattern = new RegExp(\n '^(' + categoryDetails.nationalNumberPattern.replace(/\\s/g, '') + ')$',\n ''\n );\n if (cleanNumber.match(pattern)) {\n return categoryName; // Returns the category name if the number matches the pattern\n }\n }\n\n // If no category matches, return 'Unknown'\n return 'unknown';\n}\nfunction getNumberType(phoneNumber: string, country: string) {\n const spec = PHONENUMBER_SPEC[country.toUpperCase()];\n if (!spec) {\n throw new Error(`Country ${country} is not supported`);\n }\n const type = discoverPhoneType(phoneNumber, spec);\n return type;\n}\n\nfunction isPhoneNumberValid(\n phoneNumber: string,\n countries: string[],\n types = ['mobile', 'landline']\n) {\n return countries.some((country) => {\n const numberType = getNumberType(phoneNumber, country);\n if (numberType && types.includes(numberType)) {\n return true;\n }\n return false;\n });\n}\nfunction isNumberOfType(phoneNumber: string, country: string, type: string) {\n const numberType = getNumberType(phoneNumber, country);\n if (numberType === type) {\n return true;\n }\n return false;\n}\nexport function validatePhoneNumber(\n phoneNumber: string,\n countries: string[] = ['gr'],\n typeOfPhoneNumber?: PhoneNumberType\n): boolean {\n if (!countries || countries.length === 0) {\n return true;\n }\n return isPhoneNumberValid(\n phoneNumber,\n countries,\n typeOfPhoneNumber ? [typeOfPhoneNumber] : undefined\n );\n}\n\nfunction validateMobile(value): boolean {\n return isNumberOfType(value, 'gr', 'mobile');\n}\n\nexport const MOBILE_PHONE_VALIDATOR = {\n name: 'mobile-phone-validator',\n message: 'form.error.mobile_phone',\n test: (value): boolean => {\n if (value) {\n return validateMobile(value);\n }\n return true;\n },\n};\n\nexport const PHONE_NUMBER_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const countryCodes = field?.extra?.countries;\n const typeOfPhone: PhoneNumberType | null = field?.extra?.phoneType;\n return {\n name: 'phone-number-validator',\n message: (): string => {\n if (typeOfPhone === 'mobile') {\n return 'form.error.mobile_phone';\n }\n if (typeOfPhone === 'landline') {\n return 'form.error.landline';\n } else {\n return 'form.error.phone_number';\n }\n },\n test: (value: string): boolean => {\n if (!value) {\n return true;\n }\n return validatePhoneNumber(value, countryCodes, typeOfPhone);\n },\n };\n};\n"],
4
+ "sourcesContent": ["import type { FieldSpec } from '@digigov/form/types';\nimport type { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport type PhoneNumberType = 'landline' | 'mobile' | null;\n// add more countries from here libphonenumber-js/metadata.full.json\nconst countryPhoneData = {\n GR: [\n '30',\n '00',\n '5005000\\\\d{3}|8\\\\d{9,11}|(?:[269]\\\\d|70)\\\\d{8}',\n [10, 11, 12],\n [\n ['(\\\\d{2})(\\\\d{4})(\\\\d{4})', '$1 $2 $3', ['21|7']],\n [\n '(\\\\d{4})(\\\\d{6})',\n '$1 $2',\n ['2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5'],\n ],\n ['(\\\\d{3})(\\\\d{3})(\\\\d{4})', '$1 $2 $3', ['[2689]']],\n ['(\\\\d{3})(\\\\d{3,4})(\\\\d{5})', '$1 $2 $3', ['8']],\n ],\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n [\n [\n '2(?:1\\\\d\\\\d|2(?:2[1-46-9]|[36][1-8]|4[1-7]|5[1-4]|7[1-5]|[89][1-9])|3(?:1\\\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\\\d|[269][1-6]|3[1245]|4[1-7]|5[13-9]|7[14]|8[1-5])|7(?:1\\\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\\\d|2[1-5]|[34][1-4]|9[1-57]))\\\\d{6}',\n [10],\n ],\n ['68[57-9]\\\\d{7}|(?:69|94)\\\\d{8}', [10]],\n ['800\\\\d{7,9}'],\n ['90[19]\\\\d{7}', [10]],\n ['70\\\\d{8}', [10]],\n 0,\n ['5005000\\\\d{3}', [10]],\n 0,\n 0,\n ['8(?:0[16]|12|[27]5|50)\\\\d{7}', [10]],\n ],\n ],\n};\n\nfunction expandPhoneNumberStructure(compressed) {\n const countries = Object.keys(compressed);\n const expanded: any = {};\n for (const country of countries) {\n expanded[country] = {\n fixedLine: {\n possibleLengths: {\n _national: compressed[country][3].map(String),\n },\n nationalNumberPattern: compressed[country][11][0][0],\n },\n mobile: {\n nationalNumberPattern: compressed[country][11][1][0],\n },\n tollFree: {\n nationalNumberPattern: compressed[country][11][2][0],\n },\n premiumRate: {\n nationalNumberPattern: compressed[country][11][3][0],\n },\n sharedCost: {\n nationalNumberPattern: compressed[country][11][9][0],\n },\n personalNumber: {\n nationalNumberPattern: compressed[country][11][4][0],\n },\n uan: {\n nationalNumberPattern: compressed[country][11][6][0],\n },\n id: country,\n countryCode: compressed[country][0],\n internationalPrefix: compressed[country][1],\n };\n }\n return expanded;\n}\nconst PHONENUMBER_SPEC = expandPhoneNumberStructure(countryPhoneData);\nexport function discoverPhoneType(phoneNumber: string, config: any): string {\n const cleanNumber = phoneNumber\n .replace(/\\D/g, '')\n .replace(/\\s/g, '')\n .replace(/^\\+/, '')\n .replace(new RegExp('^' + config.internationalPrefix, ''), '')\n .replace(new RegExp('^' + config.countryCode, ''), '');\n const categories = {\n landline: config.fixedLine,\n mobile: config.mobile,\n 'toll-free': config.tollFree,\n 'premium-rate': config.premiumRate,\n };\n\n for (const [categoryName, categoryDetails] of Object.entries(categories)) {\n const pattern = new RegExp(\n '^(' + categoryDetails.nationalNumberPattern.replace(/\\s/g, '') + ')$',\n ''\n );\n if (cleanNumber.match(pattern)) {\n return categoryName; // Returns the category name if the number matches the pattern\n }\n }\n\n // If no category matches, return 'Unknown'\n return 'unknown';\n}\nfunction getNumberType(phoneNumber: string, country: string) {\n const spec = PHONENUMBER_SPEC[country.toUpperCase()];\n if (!spec) {\n throw new Error(`Country ${country} is not supported`);\n }\n const type = discoverPhoneType(phoneNumber, spec);\n return type;\n}\n\nfunction isPhoneNumberValid(\n phoneNumber: string,\n countries: string[],\n types = ['mobile', 'landline']\n) {\n return countries.some((country) => {\n const numberType = getNumberType(phoneNumber, country);\n if (numberType && types.includes(numberType)) {\n return true;\n }\n return false;\n });\n}\nfunction isNumberOfType(phoneNumber: string, country: string, type: string) {\n const numberType = getNumberType(phoneNumber, country);\n if (numberType === type) {\n return true;\n }\n return false;\n}\nexport function validatePhoneNumber(\n phoneNumber: string,\n countries: string[] = ['gr'],\n typeOfPhoneNumber?: PhoneNumberType\n): boolean {\n if (!countries || countries.length === 0) {\n return true;\n }\n return isPhoneNumberValid(\n phoneNumber,\n countries,\n typeOfPhoneNumber ? [typeOfPhoneNumber] : undefined\n );\n}\n\nfunction validateMobile(value): boolean {\n return isNumberOfType(value, 'gr', 'mobile');\n}\n\nexport const MOBILE_PHONE_VALIDATOR = {\n name: 'mobile-phone-validator',\n message: 'form.error.mobile_phone',\n test: (value): boolean => {\n if (value) {\n return validateMobile(value);\n }\n return true;\n },\n};\n\nexport const PHONE_NUMBER_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const countryCodes = field?.extra?.countries;\n const typeOfPhone: PhoneNumberType | null = field?.extra?.phoneType;\n return {\n name: 'phone-number-validator',\n message: (): string => {\n if (typeOfPhone === 'mobile') {\n return 'form.error.mobile_phone';\n }\n if (typeOfPhone === 'landline') {\n return 'form.error.landline';\n } else {\n return 'form.error.phone_number';\n }\n },\n test: (value: string): boolean => {\n if (!value) {\n return true;\n }\n return validatePhoneNumber(value, countryCodes, typeOfPhone);\n },\n };\n};\n"],
5
5
  "mappings": "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",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { FieldSpec } from '@digigov/form/types';
2
- import { ValidatorSchema } from '@digigov/form/validators/types';
1
+ import type { FieldSpec } from '@digigov/form/types';
2
+ import type { ValidatorSchema } from '@digigov/form/validators/types';
3
3
  export declare function validatePostalCode(number: string, countries: string[]): boolean;
4
4
  export declare const POSTALCODE_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validators/utils/postal_code.ts"],
4
- "sourcesContent": ["import { FieldSpec } from '@digigov/form/types';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\n\nconst CODE_REGEX = /^[12345678][0-9]{4}$/;\nexport function validatePostalCode(\n number: string,\n countries: string[]\n): boolean {\n if (!countries) {\n return false;\n } else {\n if (countries.length === 1 && countries[0].toUpperCase() === 'GR') {\n // Greek postal code must be 5 digits long and shouldn't start with 0 or 9.\n return CODE_REGEX.test(number);\n } else {\n return true;\n }\n }\n}\n\nexport const POSTALCODE_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const countryCode = field?.extra?.countries;\n return {\n name: 'postal-code-validator',\n message: 'form.error.postalCode',\n test: (value: string): boolean => {\n if (!value) {\n return true;\n }\n return validatePostalCode(value, countryCode);\n },\n };\n};\n"],
4
+ "sourcesContent": ["import type { FieldSpec } from '@digigov/form/types';\nimport type { ValidatorSchema } from '@digigov/form/validators/types';\n\nconst CODE_REGEX = /^[12345678][0-9]{4}$/;\nexport function validatePostalCode(\n number: string,\n countries: string[]\n): boolean {\n if (!countries) {\n return false;\n } else {\n if (countries.length === 1 && countries[0].toUpperCase() === 'GR') {\n // Greek postal code must be 5 digits long and shouldn't start with 0 or 9.\n return CODE_REGEX.test(number);\n } else {\n return true;\n }\n }\n}\n\nexport const POSTALCODE_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const countryCode = field?.extra?.countries;\n return {\n name: 'postal-code-validator',\n message: 'form.error.postalCode',\n test: (value: string): boolean => {\n if (!value) {\n return true;\n }\n return validatePostalCode(value, countryCode);\n },\n };\n};\n"],
5
5
  "mappings": "AAGA,MAAM,aAAa;AACZ,SAAS,mBACd,QACA,WACS;AACT,MAAI,CAAC,WAAW;AACd,WAAO;AAAA,EACT,OAAO;AACL,QAAI,UAAU,WAAW,KAAK,UAAU,CAAC,EAAE,YAAY,MAAM,MAAM;AAEjE,aAAO,WAAW,KAAK,MAAM;AAAA,IAC/B,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEO,MAAM,uBAAuB,CAAC,UAAsC;AACzE,QAAM,cAAc,OAAO,OAAO;AAClC,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,CAAC,UAA2B;AAChC,UAAI,CAAC,OAAO;AACV,eAAO;AAAA,MACT;AACA,aAAO,mBAAmB,OAAO,WAAW;AAAA,IAC9C;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { FieldSpec } from '@digigov/form/types';
2
- import { ValidatorSchema } from '@digigov/form/validators/types';
1
+ import type { FieldSpec } from '@digigov/form/types';
2
+ import type { ValidatorSchema } from '@digigov/form/validators/types';
3
3
  export declare function validateText(value: string, min: number, max: number): boolean;
4
4
  export declare const TEXT_LIMIT_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validators/utils/text_limit.ts"],
4
- "sourcesContent": ["import { FieldSpec } from '@digigov/form/types';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport function validateText(value: string, min: number, max: number): boolean {\n let validator;\n if (min || max) {\n if (value.length < min || value.length > max) {\n return (validator = false);\n } else {\n return (validator = true);\n }\n }\n return validator;\n}\n\nexport const TEXT_LIMIT_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const min: number = field?.extra?.limit?.min;\n const max: number = field?.extra?.limit?.max;\n return {\n name: 'text-limit-validator',\n message: (v: any): any => {\n if (min || max) {\n if (v.value.length < min) {\n return {\n key: 'form.error.text.less_than',\n context: { min: field?.extra?.limit?.min },\n };\n }\n if (v.value.length > max) {\n return {\n key: 'form.error.text.more_than',\n context: { max: field?.extra?.limit?.max },\n };\n }\n }\n },\n test: (value: string): boolean => {\n if (!value) {\n return true;\n }\n return validateText(value, min as number, max as number);\n },\n };\n};\n"],
4
+ "sourcesContent": ["import type { FieldSpec } from '@digigov/form/types';\nimport type { ValidatorSchema } from '@digigov/form/validators/types';\n\nexport function validateText(value: string, min: number, max: number): boolean {\n let validator;\n if (min || max) {\n if (value.length < min || value.length > max) {\n return (validator = false);\n } else {\n return (validator = true);\n }\n }\n return validator;\n}\n\nexport const TEXT_LIMIT_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const min: number = field?.extra?.limit?.min;\n const max: number = field?.extra?.limit?.max;\n return {\n name: 'text-limit-validator',\n message: (v: any): any => {\n if (min || max) {\n if (v.value.length < min) {\n return {\n key: 'form.error.text.less_than',\n context: { min: field?.extra?.limit?.min },\n };\n }\n if (v.value.length > max) {\n return {\n key: 'form.error.text.more_than',\n context: { max: field?.extra?.limit?.max },\n };\n }\n }\n },\n test: (value: string): boolean => {\n if (!value) {\n return true;\n }\n return validateText(value, min as number, max as number);\n },\n };\n};\n"],
5
5
  "mappings": "AAGO,SAAS,aAAa,OAAe,KAAa,KAAsB;AAC7E,MAAI;AACJ,MAAI,OAAO,KAAK;AACd,QAAI,MAAM,SAAS,OAAO,MAAM,SAAS,KAAK;AAC5C,aAAQ,YAAY;AAAA,IACtB,OAAO;AACL,aAAQ,YAAY;AAAA,IACtB;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,uBAAuB,CAAC,UAAsC;AACzE,QAAM,MAAc,OAAO,OAAO,OAAO;AACzC,QAAM,MAAc,OAAO,OAAO,OAAO;AACzC,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS,CAAC,MAAgB;AACxB,UAAI,OAAO,KAAK;AACd,YAAI,EAAE,MAAM,SAAS,KAAK;AACxB,iBAAO;AAAA,YACL,KAAK;AAAA,YACL,SAAS,EAAE,KAAK,OAAO,OAAO,OAAO,IAAI;AAAA,UAC3C;AAAA,QACF;AACA,YAAI,EAAE,MAAM,SAAS,KAAK;AACxB,iBAAO;AAAA,YACL,KAAK;AAAA,YACL,SAAS,EAAE,KAAK,OAAO,OAAO,OAAO,IAAI;AAAA,UAC3C;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,MAAM,CAAC,UAA2B;AAChC,UAAI,CAAC,OAAO;AACV,eAAO;AAAA,MACT;AACA,aAAO,aAAa,OAAO,KAAe,GAAa;AAAA,IACzD;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,27 +0,0 @@
1
- function calculateField(children, field, fieldComponentRegistry, alternativeComponents) {
2
- const calculatedField = { ...field };
3
- if (children) {
4
- calculatedField.component = children;
5
- calculatedField.controlled = true;
6
- } else if (typeof field.component === "function") {
7
- } else if (!field.component && !field.type) {
8
- calculatedField.component = fieldComponentRegistry.string.component;
9
- calculatedField.controlled = fieldComponentRegistry.string?.controlled || false;
10
- } else if (typeof field?.extra?.component === "string" && alternativeComponents[field.extra.component]) {
11
- calculatedField.controlled = alternativeComponents[field.extra.component]?.controlled || false;
12
- calculatedField.component = alternativeComponents[field.extra.component].component;
13
- calculatedField.wrapper = alternativeComponents[field.extra.component].wrapper;
14
- } else if (!field.component && field.type && fieldComponentRegistry[field.type]) {
15
- calculatedField.component = fieldComponentRegistry[field.type].component;
16
- calculatedField.wrapper = fieldComponentRegistry[field.type].wrapper;
17
- calculatedField.controlled = fieldComponentRegistry[field.type]?.controlled || false;
18
- } else {
19
- calculatedField.component = fieldComponentRegistry.string.component;
20
- calculatedField.controlled = fieldComponentRegistry.string?.controlled || false;
21
- }
22
- return calculatedField;
23
- }
24
- export {
25
- calculateField
26
- };
27
- //# sourceMappingURL=calculateField.js.map
@@ -1,2 +0,0 @@
1
- import { FieldProps, FieldSpec, FieldComponentRegistry, CalculatedField } from '@digigov/form/Field/types';
2
- export declare function calculateField(children: FieldProps['children'], field: FieldSpec, fieldComponentRegistry: FieldComponentRegistry, alternativeComponents: FieldComponentRegistry): CalculatedField;
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/Field/utils/calculateField.ts"],
4
- "sourcesContent": ["import {\n FieldProps,\n FieldSpec,\n FieldComponentRegistry,\n CalculatedField,\n} from '@digigov/form/Field/types';\n\nexport function calculateField(\n children: FieldProps['children'],\n field: FieldSpec,\n fieldComponentRegistry: FieldComponentRegistry,\n alternativeComponents: FieldComponentRegistry\n): CalculatedField {\n const calculatedField = { ...field };\n if (children) {\n calculatedField.component = children;\n calculatedField.controlled = true;\n } else if (typeof field.component === 'function') {\n // leave as is\n } else if (!field.component && !field.type) {\n calculatedField.component = fieldComponentRegistry.string.component;\n calculatedField.controlled =\n fieldComponentRegistry.string?.controlled || false;\n } else if (\n typeof field?.extra?.component === 'string' &&\n alternativeComponents[field.extra.component]\n ) {\n calculatedField.controlled =\n alternativeComponents[field.extra.component]?.controlled || false;\n calculatedField.component =\n alternativeComponents[field.extra.component].component;\n calculatedField.wrapper =\n alternativeComponents[field.extra.component].wrapper;\n } else if (\n !field.component &&\n field.type &&\n fieldComponentRegistry[field.type]\n ) {\n calculatedField.component = fieldComponentRegistry[field.type].component;\n calculatedField.wrapper = fieldComponentRegistry[field.type].wrapper;\n calculatedField.controlled =\n fieldComponentRegistry[field.type]?.controlled || false;\n } else {\n calculatedField.component = fieldComponentRegistry.string.component;\n calculatedField.controlled =\n fieldComponentRegistry.string?.controlled || false;\n }\n return calculatedField as CalculatedField;\n}\n"],
5
- "mappings": "AAOO,SAAS,eACd,UACA,OACA,wBACA,uBACiB;AACjB,QAAM,kBAAkB,EAAE,GAAG,MAAM;AACnC,MAAI,UAAU;AACZ,oBAAgB,YAAY;AAC5B,oBAAgB,aAAa;AAAA,EAC/B,WAAW,OAAO,MAAM,cAAc,YAAY;AAAA,EAElD,WAAW,CAAC,MAAM,aAAa,CAAC,MAAM,MAAM;AAC1C,oBAAgB,YAAY,uBAAuB,OAAO;AAC1D,oBAAgB,aACd,uBAAuB,QAAQ,cAAc;AAAA,EACjD,WACE,OAAO,OAAO,OAAO,cAAc,YACnC,sBAAsB,MAAM,MAAM,SAAS,GAC3C;AACA,oBAAgB,aACd,sBAAsB,MAAM,MAAM,SAAS,GAAG,cAAc;AAC9D,oBAAgB,YACd,sBAAsB,MAAM,MAAM,SAAS,EAAE;AAC/C,oBAAgB,UACd,sBAAsB,MAAM,MAAM,SAAS,EAAE;AAAA,EACjD,WACE,CAAC,MAAM,aACP,MAAM,QACN,uBAAuB,MAAM,IAAI,GACjC;AACA,oBAAgB,YAAY,uBAAuB,MAAM,IAAI,EAAE;AAC/D,oBAAgB,UAAU,uBAAuB,MAAM,IAAI,EAAE;AAC7D,oBAAgB,aACd,uBAAuB,MAAM,IAAI,GAAG,cAAc;AAAA,EACtD,OAAO;AACL,oBAAgB,YAAY,uBAAuB,OAAO;AAC1D,oBAAgB,aACd,uBAAuB,QAAQ,cAAc;AAAA,EACjD;AACA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/Field/utils/index.ts"],
4
- "sourcesContent": ["import { FieldComponentRegistry } from '@digigov/form/Field/types';\nimport AutoCompleteInput from '@digigov/form/inputs/AutoCompleteInput';\nimport Checkboxes from '@digigov/form/inputs/Checkboxes';\nimport DateInput from '@digigov/form/inputs/DateInput';\nimport FileInput from '@digigov/form/inputs/FileInput';\nimport ImageInput from '@digigov/form/inputs/ImageInput';\nimport Input from '@digigov/form/inputs/Input';\nimport OtpInput from '@digigov/form/inputs/OtpInput';\nimport Radio, { ControlledRadioButtonsGroup } from '@digigov/form/inputs/Radio';\nimport Select from '@digigov/form/inputs/Select';\n\nexport const FIELD_COMPONENTS: FieldComponentRegistry = {\n text: {\n component: Input,\n },\n string: {\n component: Input,\n },\n file: {\n wrapper: 'fieldset',\n component: FileInput,\n },\n image: {\n wrapper: 'fieldset',\n component: ImageInput,\n },\n date: {\n wrapper: 'fieldset',\n controlled: true,\n component: DateInput,\n },\n otp: {\n wrapper: 'fieldset',\n controlled: true,\n component: OtpInput,\n },\n 'choice:multiple': {\n wrapper: 'fieldset',\n controlled: true,\n component: Checkboxes,\n },\n 'choice:single': {\n wrapper: 'fieldset',\n controlled: false,\n component: Radio,\n },\n};\n\nexport const ALTERNATIVE_COMPONENTS: FieldComponentRegistry = {\n Select: {\n component: Select,\n controlled: false,\n },\n AutoComplete: {\n component: AutoCompleteInput,\n controlled: true,\n wrapper: 'fieldset',\n },\n};\n\nexport const CONTROLLED_FIELD_COMPONENTS: FieldComponentRegistry = {\n ...FIELD_COMPONENTS,\n 'choice:single': {\n wrapper: 'fieldset',\n controlled: true,\n component: ControlledRadioButtonsGroup,\n },\n text: {\n component: Input,\n controlled: true,\n },\n string: {\n component: Input,\n controlled: true,\n },\n};\n"],
5
- "mappings": "AACA,OAAO,uBAAuB;AAC9B,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,OAAO,WAAW;AAClB,OAAO,cAAc;AACrB,OAAO,SAAS,mCAAmC;AACnD,OAAO,YAAY;AAEZ,MAAM,mBAA2C;AAAA,EACtD,MAAM;AAAA,IACJ,WAAW;AAAA,EACb;AAAA,EACA,QAAQ;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AAAA,EACA,KAAK;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AAAA,EACA,mBAAmB;AAAA,IACjB,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAEO,MAAM,yBAAiD;AAAA,EAC5D,QAAQ;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,cAAc;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AACF;AAEO,MAAM,8BAAsD;AAAA,EACjE,GAAG;AAAA,EACH,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AAAA,EACA,MAAM;AAAA,IACJ,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,QAAQ;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AACF;",
6
- "names": []
7
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,88 +0,0 @@
1
- export declare const INPUTS_FIELDS: ({
2
- key: string;
3
- type: string;
4
- required: boolean;
5
- label: {
6
- primary: string;
7
- secondary: string;
8
- };
9
- maxLength?: undefined;
10
- extra?: undefined;
11
- } | {
12
- key: string;
13
- type: string;
14
- maxLength: number;
15
- label: {
16
- primary: string;
17
- secondary?: undefined;
18
- };
19
- required: boolean;
20
- extra?: undefined;
21
- } | {
22
- key: string;
23
- type: string;
24
- required: boolean;
25
- label: {
26
- primary: string;
27
- secondary?: undefined;
28
- };
29
- extra: {
30
- options: {
31
- label: {
32
- primary: string;
33
- };
34
- value: string;
35
- }[];
36
- component?: undefined;
37
- multiple?: undefined;
38
- };
39
- maxLength?: undefined;
40
- } | {
41
- key: string;
42
- required: boolean;
43
- type: string;
44
- label: {
45
- primary: string;
46
- secondary?: undefined;
47
- };
48
- extra: {
49
- component: string;
50
- multiple: boolean;
51
- options: {
52
- label: {
53
- primary: string;
54
- };
55
- value: string;
56
- }[];
57
- };
58
- maxLength?: undefined;
59
- } | {
60
- key: string;
61
- type: string;
62
- required: boolean;
63
- label: {
64
- primary: string;
65
- secondary?: undefined;
66
- };
67
- extra: {
68
- component: string;
69
- options: {
70
- label: {
71
- primary: string;
72
- };
73
- value: string;
74
- }[];
75
- multiple?: undefined;
76
- };
77
- maxLength?: undefined;
78
- } | {
79
- key: string;
80
- type: string;
81
- required: boolean;
82
- label: {
83
- primary: string;
84
- secondary?: undefined;
85
- };
86
- maxLength?: undefined;
87
- extra?: undefined;
88
- })[];
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,50 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var calculateField_exports = {};
19
- __export(calculateField_exports, {
20
- calculateField: () => calculateField
21
- });
22
- module.exports = __toCommonJS(calculateField_exports);
23
- function calculateField(children, field, fieldComponentRegistry, alternativeComponents) {
24
- const calculatedField = { ...field };
25
- if (children) {
26
- calculatedField.component = children;
27
- calculatedField.controlled = true;
28
- } else if (typeof field.component === "function") {
29
- } else if (!field.component && !field.type) {
30
- calculatedField.component = fieldComponentRegistry.string.component;
31
- calculatedField.controlled = fieldComponentRegistry.string?.controlled || false;
32
- } else if (typeof field?.extra?.component === "string" && alternativeComponents[field.extra.component]) {
33
- calculatedField.controlled = alternativeComponents[field.extra.component]?.controlled || false;
34
- calculatedField.component = alternativeComponents[field.extra.component].component;
35
- calculatedField.wrapper = alternativeComponents[field.extra.component].wrapper;
36
- } else if (!field.component && field.type && fieldComponentRegistry[field.type]) {
37
- calculatedField.component = fieldComponentRegistry[field.type].component;
38
- calculatedField.wrapper = fieldComponentRegistry[field.type].wrapper;
39
- calculatedField.controlled = fieldComponentRegistry[field.type]?.controlled || false;
40
- } else {
41
- calculatedField.component = fieldComponentRegistry.string.component;
42
- calculatedField.controlled = fieldComponentRegistry.string?.controlled || false;
43
- }
44
- return calculatedField;
45
- }
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {
48
- calculateField
49
- });
50
- //# sourceMappingURL=calculateField.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/Field/utils/calculateField.ts"],
4
- "sourcesContent": ["import {\n FieldProps,\n FieldSpec,\n FieldComponentRegistry,\n CalculatedField,\n} from '@digigov/form/Field/types';\n\nexport function calculateField(\n children: FieldProps['children'],\n field: FieldSpec,\n fieldComponentRegistry: FieldComponentRegistry,\n alternativeComponents: FieldComponentRegistry\n): CalculatedField {\n const calculatedField = { ...field };\n if (children) {\n calculatedField.component = children;\n calculatedField.controlled = true;\n } else if (typeof field.component === 'function') {\n // leave as is\n } else if (!field.component && !field.type) {\n calculatedField.component = fieldComponentRegistry.string.component;\n calculatedField.controlled =\n fieldComponentRegistry.string?.controlled || false;\n } else if (\n typeof field?.extra?.component === 'string' &&\n alternativeComponents[field.extra.component]\n ) {\n calculatedField.controlled =\n alternativeComponents[field.extra.component]?.controlled || false;\n calculatedField.component =\n alternativeComponents[field.extra.component].component;\n calculatedField.wrapper =\n alternativeComponents[field.extra.component].wrapper;\n } else if (\n !field.component &&\n field.type &&\n fieldComponentRegistry[field.type]\n ) {\n calculatedField.component = fieldComponentRegistry[field.type].component;\n calculatedField.wrapper = fieldComponentRegistry[field.type].wrapper;\n calculatedField.controlled =\n fieldComponentRegistry[field.type]?.controlled || false;\n } else {\n calculatedField.component = fieldComponentRegistry.string.component;\n calculatedField.controlled =\n fieldComponentRegistry.string?.controlled || false;\n }\n return calculatedField as CalculatedField;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,eACd,UACA,OACA,wBACA,uBACiB;AACjB,QAAM,kBAAkB,EAAE,GAAG,MAAM;AACnC,MAAI,UAAU;AACZ,oBAAgB,YAAY;AAC5B,oBAAgB,aAAa;AAAA,EAC/B,WAAW,OAAO,MAAM,cAAc,YAAY;AAAA,EAElD,WAAW,CAAC,MAAM,aAAa,CAAC,MAAM,MAAM;AAC1C,oBAAgB,YAAY,uBAAuB,OAAO;AAC1D,oBAAgB,aACd,uBAAuB,QAAQ,cAAc;AAAA,EACjD,WACE,OAAO,OAAO,OAAO,cAAc,YACnC,sBAAsB,MAAM,MAAM,SAAS,GAC3C;AACA,oBAAgB,aACd,sBAAsB,MAAM,MAAM,SAAS,GAAG,cAAc;AAC9D,oBAAgB,YACd,sBAAsB,MAAM,MAAM,SAAS,EAAE;AAC/C,oBAAgB,UACd,sBAAsB,MAAM,MAAM,SAAS,EAAE;AAAA,EACjD,WACE,CAAC,MAAM,aACP,MAAM,QACN,uBAAuB,MAAM,IAAI,GACjC;AACA,oBAAgB,YAAY,uBAAuB,MAAM,IAAI,EAAE;AAC/D,oBAAgB,UAAU,uBAAuB,MAAM,IAAI,EAAE;AAC7D,oBAAgB,aACd,uBAAuB,MAAM,IAAI,GAAG,cAAc;AAAA,EACtD,OAAO;AACL,oBAAgB,YAAY,uBAAuB,OAAO;AAC1D,oBAAgB,aACd,uBAAuB,QAAQ,cAAc;AAAA,EACjD;AACA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/Field/utils/index.ts"],
4
- "sourcesContent": ["import { FieldComponentRegistry } from '@digigov/form/Field/types';\nimport AutoCompleteInput from '@digigov/form/inputs/AutoCompleteInput';\nimport Checkboxes from '@digigov/form/inputs/Checkboxes';\nimport DateInput from '@digigov/form/inputs/DateInput';\nimport FileInput from '@digigov/form/inputs/FileInput';\nimport ImageInput from '@digigov/form/inputs/ImageInput';\nimport Input from '@digigov/form/inputs/Input';\nimport OtpInput from '@digigov/form/inputs/OtpInput';\nimport Radio, { ControlledRadioButtonsGroup } from '@digigov/form/inputs/Radio';\nimport Select from '@digigov/form/inputs/Select';\n\nexport const FIELD_COMPONENTS: FieldComponentRegistry = {\n text: {\n component: Input,\n },\n string: {\n component: Input,\n },\n file: {\n wrapper: 'fieldset',\n component: FileInput,\n },\n image: {\n wrapper: 'fieldset',\n component: ImageInput,\n },\n date: {\n wrapper: 'fieldset',\n controlled: true,\n component: DateInput,\n },\n otp: {\n wrapper: 'fieldset',\n controlled: true,\n component: OtpInput,\n },\n 'choice:multiple': {\n wrapper: 'fieldset',\n controlled: true,\n component: Checkboxes,\n },\n 'choice:single': {\n wrapper: 'fieldset',\n controlled: false,\n component: Radio,\n },\n};\n\nexport const ALTERNATIVE_COMPONENTS: FieldComponentRegistry = {\n Select: {\n component: Select,\n controlled: false,\n },\n AutoComplete: {\n component: AutoCompleteInput,\n controlled: true,\n wrapper: 'fieldset',\n },\n};\n\nexport const CONTROLLED_FIELD_COMPONENTS: FieldComponentRegistry = {\n ...FIELD_COMPONENTS,\n 'choice:single': {\n wrapper: 'fieldset',\n controlled: true,\n component: ControlledRadioButtonsGroup,\n },\n text: {\n component: Input,\n controlled: true,\n },\n string: {\n component: Input,\n controlled: true,\n },\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,+BAA8B;AAC9B,wBAAuB;AACvB,uBAAsB;AACtB,uBAAsB;AACtB,wBAAuB;AACvB,mBAAkB;AAClB,sBAAqB;AACrB,mBAAmD;AACnD,oBAAmB;AAEZ,MAAM,mBAA2C;AAAA,EACtD,MAAM;AAAA,IACJ,WAAW,aAAAA;AAAA,EACb;AAAA,EACA,QAAQ;AAAA,IACN,WAAW,aAAAA;AAAA,EACb;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,WAAW,iBAAAC;AAAA,EACb;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,IACT,WAAW,kBAAAC;AAAA,EACb;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,iBAAAC;AAAA,EACb;AAAA,EACA,KAAK;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,gBAAAC;AAAA,EACb;AAAA,EACA,mBAAmB;AAAA,IACjB,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,kBAAAC;AAAA,EACb;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,aAAAC;AAAA,EACb;AACF;AAEO,MAAM,yBAAiD;AAAA,EAC5D,QAAQ;AAAA,IACN,WAAW,cAAAC;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,cAAc;AAAA,IACZ,WAAW,yBAAAC;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AACF;AAEO,MAAM,8BAAsD;AAAA,EACjE,GAAG;AAAA,EACH,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AAAA,EACA,MAAM;AAAA,IACJ,WAAW,aAAAR;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,QAAQ;AAAA,IACN,WAAW,aAAAA;AAAA,IACX,YAAY;AAAA,EACd;AACF;",
6
- "names": ["Input", "FileInput", "ImageInput", "DateInput", "OtpInput", "Checkboxes", "Radio", "Select", "AutoCompleteInput"]
7
- }