@digigov/form 2.0.0-a32ad9b2 → 2.0.0-abd768eb

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 (331) hide show
  1. package/Field/FieldBase/index.js +7 -2
  2. package/Field/FieldBase.js.map +2 -2
  3. package/Field/FieldBaseContainer/index.js +37 -18
  4. package/Field/FieldBaseContainer.d.ts +1 -1
  5. package/Field/FieldBaseContainer.js.map +2 -2
  6. package/Field/FieldConditional/index.js +4 -0
  7. package/Field/FieldConditional.js.map +2 -2
  8. package/Field/index.js +10 -4
  9. package/Field/index.js.map +2 -2
  10. package/Field/types.d.ts +10 -3
  11. package/Field/utils/index.js +3 -1
  12. package/Field/utils/index.js.map +2 -2
  13. package/Field/utils/useField/index.js +8 -1
  14. package/Field/utils/useField.js.map +2 -2
  15. package/FieldArray/FormDialog/index.js +314 -196
  16. package/FieldArray/FormDialog.d.ts +20 -7
  17. package/FieldArray/FormDialog.js.map +3 -3
  18. package/FieldArray/__stories__/Default.d.ts +1 -1
  19. package/FieldArray/__stories__/WithExactLength.d.ts +1 -1
  20. package/FieldArray/__stories__/WithModal.d.ts +1 -1
  21. package/FieldArray/index.d.ts +1 -0
  22. package/FieldArray/index.js +32 -8
  23. package/FieldArray/index.js.map +2 -2
  24. package/FieldObject/index.d.ts +3 -0
  25. package/FieldObject/index.js +26 -15
  26. package/FieldObject/index.js.map +2 -2
  27. package/FormBuilder/FormBuilder.stories.d.ts +2 -0
  28. package/FormBuilder/__stories__/AutoErrorGrouping.d.ts +1 -1
  29. package/FormBuilder/__stories__/Default.d.ts +1 -1
  30. package/FormBuilder/__stories__/ErrorGrouping.d.ts +1 -1
  31. package/FormBuilder/index.d.ts +1 -1
  32. package/FormBuilder/index.js +11 -7
  33. package/FormBuilder/index.js.map +2 -2
  34. package/FormContext/index.js +6 -2
  35. package/FormContext.d.ts +1 -0
  36. package/FormContext.js.map +2 -2
  37. package/MultiplicityField/MultiplicityField.stories.d.ts +2 -0
  38. package/MultiplicityField/__stories__/Default.d.ts +1 -1
  39. package/MultiplicityField/__stories__/PreviewDisplay.d.ts +1 -1
  40. package/MultiplicityField/__stories__/WithExactLength.d.ts +1 -1
  41. package/MultiplicityField/__stories__/WithMaxLength.d.ts +1 -1
  42. package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +1 -1
  43. package/MultiplicityField/__stories__/WithMinLength.d.ts +1 -1
  44. package/MultiplicityField/add-objects/index.js +2 -0
  45. package/MultiplicityField/add-objects.js.map +2 -2
  46. package/MultiplicityField/index.js +4 -1
  47. package/MultiplicityField/index.js.map +2 -2
  48. package/MultiplicityField/types.d.ts +1 -0
  49. package/Questions/Questions.stories.d.ts +2 -0
  50. package/Questions/__stories__/Default.d.ts +1 -1
  51. package/cjs/Field/FieldBase/index.js +7 -2
  52. package/cjs/Field/FieldBase.js.map +2 -2
  53. package/cjs/Field/FieldBaseContainer/index.js +36 -17
  54. package/cjs/Field/FieldBaseContainer.js.map +3 -3
  55. package/cjs/Field/FieldConditional/index.js +4 -0
  56. package/cjs/Field/FieldConditional.js.map +2 -2
  57. package/cjs/Field/index.js +10 -4
  58. package/cjs/Field/index.js.map +2 -2
  59. package/cjs/Field/types.js.map +1 -1
  60. package/cjs/Field/utils/index.js +3 -1
  61. package/cjs/Field/utils/index.js.map +2 -2
  62. package/cjs/Field/utils/useField/index.js +8 -1
  63. package/cjs/Field/utils/useField.js.map +2 -2
  64. package/cjs/FieldArray/FormDialog/index.js +309 -194
  65. package/cjs/FieldArray/FormDialog.js.map +3 -3
  66. package/cjs/FieldArray/index.js +31 -7
  67. package/cjs/FieldArray/index.js.map +2 -2
  68. package/cjs/FieldObject/index.js +26 -15
  69. package/cjs/FieldObject/index.js.map +2 -2
  70. package/cjs/FormBuilder/index.js +11 -7
  71. package/cjs/FormBuilder/index.js.map +2 -2
  72. package/cjs/FormContext/index.js +7 -2
  73. package/cjs/FormContext.js.map +2 -2
  74. package/cjs/MultiplicityField/add-objects/index.js +2 -0
  75. package/cjs/MultiplicityField/add-objects.js.map +2 -2
  76. package/cjs/MultiplicityField/index.js +4 -1
  77. package/cjs/MultiplicityField/index.js.map +2 -2
  78. package/cjs/MultiplicityField/types.js.map +1 -1
  79. package/cjs/inputs/Checkboxes/index.js +2 -2
  80. package/cjs/inputs/Checkboxes/index.js.map +2 -2
  81. package/cjs/inputs/DateInput/index.js +41 -14
  82. package/cjs/inputs/DateInput/index.js.map +2 -2
  83. package/cjs/inputs/DateTimeInput/index.js +68 -34
  84. package/cjs/inputs/DateTimeInput/index.js.map +2 -2
  85. package/cjs/inputs/FileInput/index.js +52 -29
  86. package/cjs/inputs/FileInput/index.js.map +2 -2
  87. package/cjs/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
  88. package/cjs/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
  89. package/cjs/inputs/ImageInput/index.js +41 -10
  90. package/cjs/inputs/ImageInput/index.js.map +2 -2
  91. package/cjs/inputs/Input/index.js +4 -4
  92. package/cjs/inputs/Input/index.js.map +2 -2
  93. package/cjs/inputs/Select/index.js +4 -3
  94. package/cjs/inputs/Select/index.js.map +2 -2
  95. package/cjs/inputs/inputsScenarios/index.js +2 -2
  96. package/cjs/inputs/inputsScenarios.js.map +2 -2
  97. package/cjs/lazy/index.js +2 -1
  98. package/cjs/lazy.js.map +2 -2
  99. package/cjs/registry/index.js +6 -6
  100. package/cjs/registry.js.map +2 -2
  101. package/cjs/types.js.map +1 -1
  102. package/cjs/utils/index.js +20 -6
  103. package/cjs/utils.js.map +2 -2
  104. package/cjs/validators/index.js +11 -6
  105. package/cjs/validators/index.js.map +2 -2
  106. package/cjs/validators/utils/amka/index.js +60 -0
  107. package/cjs/validators/utils/amka.js.map +7 -0
  108. package/cjs/validators/utils/date/index.js +26 -3
  109. package/cjs/validators/utils/date.js.map +2 -2
  110. package/cjs/validators/utils/datetime/index.js +118 -24
  111. package/cjs/validators/utils/datetime.js.map +2 -2
  112. package/cjs/validators/utils/file/index.js +30 -17
  113. package/cjs/validators/utils/file.js.map +2 -2
  114. package/cjs/validators/utils/index.js +5 -1
  115. package/cjs/validators/utils/index.js.map +2 -2
  116. package/index.js +1 -1
  117. package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +2 -0
  118. package/inputs/AutoCompleteInput/__stories__/Default.d.ts +1 -1
  119. package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +1 -1
  120. package/inputs/Checkboxes/Checkboxes.stories.d.ts +2 -0
  121. package/inputs/Checkboxes/__stories__/Conditional.d.ts +1 -1
  122. package/inputs/Checkboxes/__stories__/Default.d.ts +1 -1
  123. package/inputs/Checkboxes/__stories__/WithDivider.d.ts +1 -1
  124. package/inputs/Checkboxes/index.js +2 -2
  125. package/inputs/Checkboxes/index.js.map +2 -2
  126. package/inputs/DateInput/DateInput.stories.d.ts +6 -0
  127. package/inputs/DateInput/__stories__/Default.d.ts +1 -1
  128. package/inputs/DateInput/__stories__/WithDefaultValue.d.ts +3 -0
  129. package/inputs/DateInput/__stories__/WithInitialValue.d.ts +3 -0
  130. package/inputs/DateInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
  131. package/inputs/DateInput/__stories__/WithWrongInitialValue.d.ts +3 -0
  132. package/inputs/DateInput/index.js +42 -15
  133. package/inputs/DateInput/index.js.map +2 -2
  134. package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +10 -3
  135. package/inputs/DateTimeInput/__stories__/Default.d.ts +1 -1
  136. package/inputs/DateTimeInput/__stories__/WithDefaultValue.d.ts +3 -0
  137. package/inputs/DateTimeInput/__stories__/WithInitialValue.d.ts +3 -0
  138. package/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
  139. package/inputs/DateTimeInput/__stories__/WithWrongInitialValue.d.ts +3 -0
  140. package/inputs/DateTimeInput/index.js +69 -35
  141. package/inputs/DateTimeInput/index.js.map +2 -2
  142. package/inputs/FileInput/FileInput.stories.d.ts +3 -0
  143. package/inputs/FileInput/__stories__/Default.d.ts +1 -1
  144. package/inputs/FileInput/__stories__/WithBorderAndLink.d.ts +3 -0
  145. package/inputs/FileInput/index.d.ts +11 -4
  146. package/inputs/FileInput/index.js +57 -31
  147. package/inputs/FileInput/index.js.map +2 -2
  148. package/inputs/ImageInput/ImageInput.stories.d.ts +4 -1
  149. package/inputs/ImageInput/__stories__/Default.d.ts +1 -1
  150. package/inputs/ImageInput/__stories__/MaxSize.d.ts +1 -1
  151. package/inputs/ImageInput/__stories__/WithInitialValues.d.ts +3 -0
  152. package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +1 -1
  153. package/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
  154. package/inputs/ImageInput/__stories__/logo.d/package.json +6 -0
  155. package/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
  156. package/inputs/ImageInput/index.d.ts +9 -1
  157. package/inputs/ImageInput/index.js +42 -11
  158. package/inputs/ImageInput/index.js.map +2 -2
  159. package/inputs/Input/Input.stories.d.ts +4 -0
  160. package/inputs/Input/__stories__/AFM.d.ts +1 -1
  161. package/inputs/Input/__stories__/AMKA.d.ts +3 -0
  162. package/inputs/Input/__stories__/Boolean.d.ts +1 -1
  163. package/inputs/Input/__stories__/Email.d.ts +3 -0
  164. package/inputs/Input/__stories__/IBAN.d.ts +1 -1
  165. package/inputs/Input/__stories__/Integer.d.ts +1 -1
  166. package/inputs/Input/__stories__/LandlineNumber.d.ts +1 -1
  167. package/inputs/Input/__stories__/MobilePhone.d.ts +1 -1
  168. package/inputs/Input/__stories__/PhoneNumber.d.ts +1 -1
  169. package/inputs/Input/__stories__/PostalCode.d.ts +1 -1
  170. package/inputs/Input/__stories__/String.d.ts +1 -1
  171. package/inputs/Input/__stories__/StringWithTrimValidation.d.ts +1 -1
  172. package/inputs/Input/__stories__/TextWithLimit.d.ts +1 -1
  173. package/inputs/Input/index.d.ts +2 -1
  174. package/inputs/Input/index.js +4 -4
  175. package/inputs/Input/index.js.map +2 -2
  176. package/inputs/Label/Label.stories.d.ts +2 -0
  177. package/inputs/Label/__stories__/Default.d.ts +1 -1
  178. package/inputs/OtpInput/OtpInput.stories.d.ts +2 -0
  179. package/inputs/OtpInput/__stories__/Default.d.ts +1 -1
  180. package/inputs/Radio/Radio.stories.d.ts +2 -0
  181. package/inputs/Radio/__stories__/Conditional.d.ts +1 -1
  182. package/inputs/Radio/__stories__/Default.d.ts +1 -1
  183. package/inputs/Radio/__stories__/WithDivider.d.ts +1 -1
  184. package/inputs/Select/Select.stories.d.ts +2 -0
  185. package/inputs/Select/__stories__/Default.d.ts +1 -1
  186. package/inputs/Select/index.d.ts +2 -1
  187. package/inputs/Select/index.js +4 -3
  188. package/inputs/Select/index.js.map +2 -2
  189. package/inputs/inputsScenarios/index.js +2 -2
  190. package/inputs/inputsScenarios.d.ts +1 -1
  191. package/inputs/inputsScenarios.js.map +2 -2
  192. package/lazy/index.js +2 -1
  193. package/package.json +4 -4
  194. package/registry/index.js +6 -6
  195. package/src/Field/FieldBase.tsx +6 -1
  196. package/src/Field/FieldBaseContainer.tsx +68 -48
  197. package/src/Field/FieldConditional.tsx +4 -0
  198. package/src/Field/index.tsx +15 -5
  199. package/src/Field/types.tsx +11 -3
  200. package/src/Field/utils/index.ts +2 -0
  201. package/src/Field/utils/useField.ts +9 -1
  202. package/src/FieldArray/FormDialog.tsx +430 -243
  203. package/src/FieldArray/__stories__/Default.tsx +1 -1
  204. package/src/FieldArray/__stories__/WithExactLength.tsx +1 -1
  205. package/src/FieldArray/__stories__/WithModal.tsx +4 -3
  206. package/src/FieldArray/index.tsx +53 -30
  207. package/src/FieldObject/index.tsx +33 -18
  208. package/src/FormBuilder/FormBuilder.stories.js +3 -0
  209. package/src/FormBuilder/__stories__/AutoErrorGrouping.tsx +1 -1
  210. package/src/FormBuilder/__stories__/Default.tsx +1 -1
  211. package/src/FormBuilder/__stories__/ErrorGrouping.tsx +1 -1
  212. package/src/FormBuilder/index.tsx +12 -7
  213. package/src/FormBuilder/scenarios.test.tsx +763 -5
  214. package/src/FormContext.tsx +5 -1
  215. package/src/MultiplicityField/MultiplicityField.stories.js +3 -0
  216. package/src/MultiplicityField/__stories__/Default.tsx +1 -1
  217. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +1 -1
  218. package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
  219. package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
  220. package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
  221. package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
  222. package/src/MultiplicityField/add-objects.tsx +2 -0
  223. package/src/MultiplicityField/index.tsx +3 -0
  224. package/src/MultiplicityField/types.ts +1 -0
  225. package/src/Questions/Questions.stories.js +3 -0
  226. package/src/Questions/__stories__/Default.tsx +1 -1
  227. package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +3 -0
  228. package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +1 -1
  229. package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +1 -1
  230. package/src/inputs/Checkboxes/Checkboxes.stories.js +3 -0
  231. package/src/inputs/Checkboxes/__stories__/Conditional.tsx +1 -1
  232. package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
  233. package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
  234. package/src/inputs/Checkboxes/index.tsx +2 -6
  235. package/src/inputs/DateInput/DateInput.stories.js +7 -0
  236. package/src/inputs/DateInput/__stories__/Default.tsx +1 -1
  237. package/src/inputs/DateInput/__stories__/WithDefaultValue.tsx +26 -0
  238. package/src/inputs/DateInput/__stories__/WithInitialValue.tsx +28 -0
  239. package/src/inputs/DateInput/__stories__/WithWrongDefaultValue.tsx +26 -0
  240. package/src/inputs/DateInput/__stories__/WithWrongInitialValue.tsx +28 -0
  241. package/src/inputs/DateInput/index.test.tsx +16 -0
  242. package/src/inputs/DateInput/index.tsx +46 -14
  243. package/src/inputs/DateTimeInput/DateTimeInput.stories.js +12 -6
  244. package/src/inputs/DateTimeInput/__stories__/Default.tsx +1 -1
  245. package/src/inputs/DateTimeInput/__stories__/WithDefaultValue.tsx +26 -0
  246. package/src/inputs/DateTimeInput/__stories__/WithInitialValue.tsx +28 -0
  247. package/src/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.tsx +26 -0
  248. package/src/inputs/DateTimeInput/__stories__/WithWrongInitialValue.tsx +28 -0
  249. package/src/inputs/DateTimeInput/index.test.tsx +16 -0
  250. package/src/inputs/DateTimeInput/index.tsx +73 -34
  251. package/src/inputs/FileInput/FileInput.stories.js +4 -0
  252. package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
  253. package/src/inputs/FileInput/__stories__/WithBorderAndLink.tsx +34 -0
  254. package/src/inputs/FileInput/index.test.tsx +4 -0
  255. package/src/inputs/FileInput/index.tsx +90 -48
  256. package/src/inputs/ImageInput/ImageInput.stories.js +5 -1
  257. package/src/inputs/ImageInput/__stories__/Default.tsx +1 -1
  258. package/src/inputs/ImageInput/__stories__/MaxSize.tsx +3 -2
  259. package/src/inputs/ImageInput/__stories__/WithInitialValues.tsx +45 -0
  260. package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +1 -1
  261. package/src/inputs/ImageInput/__stories__/logo.d.ts +4 -0
  262. package/src/inputs/ImageInput/__stories__/logo.png +0 -0
  263. package/src/inputs/ImageInput/index.test.tsx +21 -17
  264. package/src/inputs/ImageInput/index.tsx +100 -48
  265. package/src/inputs/Input/Input.stories.js +5 -0
  266. package/src/inputs/Input/__stories__/AFM.tsx +1 -1
  267. package/src/inputs/Input/__stories__/AMKA.tsx +23 -0
  268. package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
  269. package/src/inputs/Input/__stories__/Email.tsx +23 -0
  270. package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
  271. package/src/inputs/Input/__stories__/Integer.tsx +1 -1
  272. package/src/inputs/Input/__stories__/LandlineNumber.tsx +1 -1
  273. package/src/inputs/Input/__stories__/MobilePhone.tsx +1 -1
  274. package/src/inputs/Input/__stories__/PhoneNumber.tsx +1 -1
  275. package/src/inputs/Input/__stories__/PostalCode.tsx +1 -1
  276. package/src/inputs/Input/__stories__/String.tsx +1 -1
  277. package/src/inputs/Input/__stories__/StringWithTrimValidation.tsx +1 -1
  278. package/src/inputs/Input/__stories__/TextWithLimit.tsx +1 -1
  279. package/src/inputs/Input/index.test.tsx +8 -0
  280. package/src/inputs/Input/index.tsx +5 -3
  281. package/src/inputs/Label/Label.stories.js +3 -0
  282. package/src/inputs/Label/__stories__/Default.tsx +1 -1
  283. package/src/inputs/OtpInput/OtpInput.stories.js +3 -0
  284. package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
  285. package/src/inputs/Radio/Radio.stories.js +3 -0
  286. package/src/inputs/Radio/__stories__/Conditional.tsx +1 -1
  287. package/src/inputs/Radio/__stories__/Default.tsx +1 -1
  288. package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
  289. package/src/inputs/Select/Select.stories.js +3 -0
  290. package/src/inputs/Select/__stories__/Default.tsx +1 -1
  291. package/src/inputs/Select/index.tsx +7 -4
  292. package/src/inputs/inputsScenarios.ts +2 -2
  293. package/src/lazy.js +2 -1
  294. package/src/registry.js +6 -6
  295. package/src/types.tsx +2 -1
  296. package/src/utils.ts +27 -6
  297. package/src/validators/index.ts +17 -6
  298. package/src/validators/utils/amka.ts +39 -0
  299. package/src/validators/utils/date.ts +28 -4
  300. package/src/validators/utils/datetime.ts +121 -29
  301. package/src/validators/utils/file.ts +33 -19
  302. package/src/validators/utils/index.ts +4 -1
  303. package/types.d.ts +2 -1
  304. package/types.js.map +1 -1
  305. package/utils/index.js +20 -6
  306. package/utils.d.ts +2 -0
  307. package/utils.js.map +2 -2
  308. package/validators/index.d.ts +1 -1
  309. package/validators/index.js +12 -6
  310. package/validators/index.js.map +2 -2
  311. package/validators/utils/amka/index.js +36 -0
  312. package/{inputs/Input/inputsInputScenarios → validators/utils/amka}/package.json +1 -1
  313. package/validators/utils/amka.d.ts +6 -0
  314. package/validators/utils/amka.js.map +7 -0
  315. package/validators/utils/date/index.js +26 -3
  316. package/validators/utils/date.d.ts +1 -1
  317. package/validators/utils/date.js.map +2 -2
  318. package/validators/utils/datetime/index.js +118 -24
  319. package/validators/utils/datetime.d.ts +1 -1
  320. package/validators/utils/datetime.js.map +2 -2
  321. package/validators/utils/file/index.js +30 -17
  322. package/validators/utils/file.js.map +2 -2
  323. package/validators/utils/index.d.ts +1 -0
  324. package/validators/utils/index.js +4 -1
  325. package/validators/utils/index.js.map +2 -2
  326. package/cjs/inputs/Input/inputsInputScenarios/index.js +0 -439
  327. package/cjs/inputs/Input/inputsInputScenarios.js.map +0 -7
  328. package/inputs/Input/inputsInputScenarios/index.js +0 -406
  329. package/inputs/Input/inputsInputScenarios.d.ts +0 -57
  330. package/inputs/Input/inputsInputScenarios.js.map +0 -7
  331. package/src/inputs/Input/inputsInputScenarios.ts +0 -404
@@ -1,404 +0,0 @@
1
- import el from '@digigov/form/locales/el';
2
-
3
- const INPUTS_INPUT_FIELDS = [
4
- {
5
- key: 'location',
6
- type: 'string',
7
- label: {
8
- primary: 'Συμπληρώστε τον τόπο κατοικίας σας',
9
- },
10
- required: true,
11
- },
12
- {
13
- key: 'text',
14
- type: 'text',
15
- required: true,
16
- label: {
17
- primary: 'Συμπληρώστε το αίτημά σας',
18
- },
19
- },
20
- {
21
- key: 'email',
22
- type: 'email',
23
- label: {
24
- primary: 'Διεύθυνση ηλεκτρονικού ταχυδρομείου (email)',
25
- },
26
- required: true,
27
- },
28
- {
29
- key: 'desired-mount',
30
- type: 'number',
31
- label: {
32
- primary: 'Συμπληρώστε το ποσό που σας ενδιαφέρει',
33
- },
34
- required: true,
35
- },
36
- {
37
- key: 'age',
38
- type: 'int',
39
- required: true,
40
- label: {
41
- primary: 'Ποιά είναι η ηλικία σας;',
42
- secondary: 'Καταχωρίστε την ηλικία σας',
43
- },
44
- },
45
- {
46
- key: 'afm',
47
- type: 'afm',
48
- required: true,
49
- label: { primary: 'ΑΦΜ' },
50
- },
51
- {
52
- key: 'iban',
53
- type: 'iban',
54
- label: {
55
- primary: 'Συμπληρώστε το αριθμό του τραπεζικού σας λογαριασμού',
56
- },
57
- required: true,
58
- },
59
- {
60
- key: 'uuid4',
61
- type: 'uuid4',
62
- label: {
63
- primary: 'Συμπληρώστε το uuid4',
64
- },
65
- required: true,
66
- },
67
- {
68
- key: 'mobile-phone',
69
- type: 'mobile_phone',
70
- label: {
71
- primary: 'Συμπληρώστε το κινητό σας τηλέφωνο',
72
- },
73
- required: true,
74
- extra: {
75
- countries: ['gr'],
76
- phoneType: 'mobile',
77
- },
78
- },
79
- {
80
- key: 'phone-number',
81
- type: 'phone_number',
82
- label: {
83
- primary: 'Συμπληρώστε το τηλέφωνό σας',
84
- },
85
- required: true,
86
- extra: {
87
- countries: ['gr'],
88
- },
89
- },
90
- {
91
- key: 'phone-number-landline',
92
- type: 'phone_number',
93
- label: {
94
- primary: 'Συμπληρώστε το σταθερό σας τηλέφωνό',
95
- },
96
- required: true,
97
- extra: {
98
- countries: ['gr'],
99
- phoneType: 'landline',
100
- },
101
- },
102
- {
103
- key: 'postal-code',
104
- type: 'postal_code',
105
- label: {
106
- primary: 'Συμπληρώστε τον ταχυδρομικό σας κώδικα',
107
- },
108
- extra: { countries: ['GR'] },
109
- required: true,
110
- },
111
- ];
112
-
113
- export const scenarios = [
114
- {
115
- title: 'success fill for inputs Input',
116
- describe: 'inputs Input scenario',
117
- fields: INPUTS_INPUT_FIELDS,
118
- fill: [
119
- {
120
- fieldKey: 'text',
121
- value: 'aaaaaaa',
122
- },
123
- {
124
- fieldKey: 'age',
125
- value: '12',
126
- },
127
- {
128
- fieldKey: 'email',
129
- value: 'example@mail.com',
130
- },
131
- {
132
- fieldKey: 'location',
133
- value: 'Location1',
134
- },
135
- {
136
- fieldKey: 'postal-code',
137
- value: '42100',
138
- },
139
- {
140
- fieldKey: 'afm',
141
- value: '094536469',
142
- },
143
- {
144
- fieldKey: 'desired-mount',
145
- value: '12.5',
146
- },
147
- {
148
- fieldKey: 'mobile-phone',
149
- value: '+306900000000',
150
- },
151
- {
152
- fieldKey: 'phone-number',
153
- value: '6900000000',
154
- },
155
- {
156
- fieldKey: 'phone-number-landline',
157
- value: '2100000000',
158
- },
159
- {
160
- fieldKey: 'iban',
161
- value: 'GR3201122267115323218375195',
162
- },
163
- {
164
- fieldKey: 'uuid4',
165
- value: '1e805d00-ea67-478a-ab8b-d13ff8b38fa3',
166
- },
167
- ],
168
- expect: [
169
- {
170
- type: 'success',
171
- fieldKey: 'age',
172
- text: el.form.error.required,
173
- },
174
- {
175
- type: 'success',
176
- fieldKey: 'text',
177
- text: el.form.error.required,
178
- },
179
- {
180
- type: 'success',
181
- fieldKey: 'email',
182
- text: el.form.error.required,
183
- },
184
- {
185
- type: 'success',
186
- fieldKey: 'location',
187
- text: el.form.error.required,
188
- },
189
- {
190
- type: 'success',
191
- fieldKey: 'postal-code',
192
- text: el.form.error.required,
193
- },
194
- {
195
- type: 'success',
196
- fieldKey: 'afm',
197
- text: el.form.error.required,
198
- },
199
- {
200
- type: 'success',
201
- fieldKey: 'desired-mount',
202
- text: el.form.error.required,
203
- },
204
- {
205
- type: 'success',
206
- fieldKey: 'mobile-phone',
207
- text: el.form.error.required,
208
- },
209
- {
210
- type: 'success',
211
- fieldKey: 'phone-number',
212
- text: el.form.error.required,
213
- },
214
- {
215
- type: 'success',
216
- fieldKey: 'phone-number-landline',
217
- text: el.form.error.required,
218
- },
219
- {
220
- type: 'success',
221
- fieldKey: 'iban',
222
- text: el.form.error.required,
223
- },
224
- {
225
- type: 'success',
226
- fieldKey: 'uuid4',
227
- text: el.form.error.required,
228
- },
229
- ],
230
- },
231
- {
232
- title: 'empty fill for inputs Input',
233
- describe: 'inputs Input scenario',
234
- fields: INPUTS_INPUT_FIELDS,
235
- fill: [],
236
- expect: [
237
- {
238
- type: 'error',
239
- fieldKey: 'age',
240
- text: el.form.error.required,
241
- },
242
- {
243
- type: 'error',
244
- fieldKey: 'email',
245
- text: el.form.error.required,
246
- },
247
- {
248
- type: 'error',
249
- fieldKey: 'location',
250
- text: el.form.error.required,
251
- },
252
- {
253
- type: 'error',
254
- fieldKey: 'postal-code',
255
- text: el.form.error.required,
256
- },
257
- {
258
- type: 'error',
259
- fieldKey: 'afm',
260
- text: el.form.error.required,
261
- },
262
- {
263
- type: 'error',
264
- fieldKey: 'desired-mount',
265
- text: el.form.error.required,
266
- },
267
- {
268
- type: 'error',
269
- fieldKey: 'mobile-phone',
270
- text: el.form.error.required,
271
- },
272
- {
273
- type: 'error',
274
- fieldKey: 'phone-number',
275
- text: el.form.error.required,
276
- },
277
- {
278
- type: 'error',
279
- fieldKey: 'phone-number-landline',
280
- text: el.form.error.required,
281
- },
282
- {
283
- type: 'error',
284
- fieldKey: 'iban',
285
- text: el.form.error.required,
286
- },
287
- {
288
- type: 'error',
289
- fieldKey: 'uuid4',
290
- text: el.form.error.required,
291
- },
292
- ],
293
- },
294
- {
295
- title: 'incorrect types for inputs Input',
296
- describe: 'inputs Input scenario',
297
- fields: INPUTS_INPUT_FIELDS,
298
- fill: [
299
- {
300
- fieldKey: 'age',
301
- value: 'aa',
302
- },
303
- {
304
- fieldKey: 'email',
305
- value: '23232',
306
- },
307
- {
308
- fieldKey: 'location',
309
- value: '23232',
310
- },
311
- {
312
- fieldKey: 'postal-code',
313
- value: 'aaaaa',
314
- },
315
- {
316
- fieldKey: 'afm',
317
- value: 'aaaaaaaaa',
318
- },
319
- {
320
- fieldKey: 'desired-mount',
321
- value: 'aaa',
322
- },
323
- {
324
- fieldKey: 'mobile-phone',
325
- value: '+33690000000',
326
- },
327
- {
328
- fieldKey: 'phone-number',
329
- value: '000000000',
330
- },
331
- {
332
- fieldKey: 'phone-number-landline',
333
- value: '000000000',
334
- },
335
- {
336
- fieldKey: 'iban',
337
- value: 'aaaaaa',
338
- },
339
- {
340
- fieldKey: 'uuid4',
341
- value: 'aaaaaa',
342
- },
343
- ],
344
- expect: [
345
- {
346
- type: 'error',
347
- fieldKey: 'age',
348
- text: el.form.error.number,
349
- },
350
- {
351
- type: 'error',
352
- fieldKey: 'email',
353
- text: el.form.error.email,
354
- },
355
- {
356
- type: 'success',
357
- fieldKey: 'location',
358
- text: el.form.error.string,
359
- },
360
- {
361
- type: 'error',
362
- fieldKey: 'postal-code',
363
- text: el.form.error.postalCode,
364
- },
365
- {
366
- type: 'error',
367
- fieldKey: 'afm',
368
- text: el.form.error.afm,
369
- },
370
- {
371
- type: 'error',
372
- fieldKey: 'desired-mount',
373
- text: el.form.error.number,
374
- },
375
- {
376
- type: 'error',
377
- fieldKey: 'mobile-phone',
378
- text: el.form.error.mobile_phone,
379
- },
380
- {
381
- type: 'error',
382
- fieldKey: 'phone-number',
383
- text: el.form.error.phone_number,
384
- },
385
- {
386
- type: 'error',
387
- fieldKey: 'phone-number-landline',
388
- text: el.form.error.landline,
389
- },
390
- {
391
- type: 'error',
392
- fieldKey: 'iban',
393
- text: el.form.error.iban,
394
- },
395
- {
396
- type: 'error',
397
- fieldKey: 'uuid4',
398
- text: el.form.error.uuid4,
399
- },
400
- ],
401
- },
402
- ];
403
-
404
- export default scenarios;