@arquimedes.co/eureka-forms 2.0.99-test → 3.0.0-refactor

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 (339) hide show
  1. package/dist/App/App.js +21 -46
  2. package/dist/App/AppFunctions.js +177 -328
  3. package/dist/App/AppFunctions.test.js +638 -0
  4. package/dist/App/AppHooks.js +127 -223
  5. package/dist/App/AppHooks.test.js +154 -0
  6. package/dist/Contexts/CustomContext.js +1 -1
  7. package/dist/Contexts/FormContext.js +3 -2
  8. package/dist/Contexts/SectionContext.js +1 -1
  9. package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +43 -62
  10. package/dist/Form/Form.js +75 -160
  11. package/dist/Form/FormFunctions.js +64 -114
  12. package/dist/Form/FormFunctions.test.js +454 -0
  13. package/dist/Form/FormHooks.js +14 -21
  14. package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +34 -105
  15. package/dist/Form/FormTypes/StepperForm/StepperForm.js +48 -110
  16. package/dist/Form/Section/MaterialSection/MaterialSection.js +10 -23
  17. package/dist/Form/Section/MaterialSection/MaterialSection.module.css +0 -2
  18. package/dist/Form/Section/Section.js +4 -15
  19. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +30 -65
  20. package/dist/Form/Terms/Term/Term.js +2 -13
  21. package/dist/Form/Terms/Terms.js +11 -27
  22. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +36 -106
  23. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
  24. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +12 -40
  25. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +57 -77
  26. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +46 -111
  27. package/dist/FormSteps/AYFStepMapper.js +63 -127
  28. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +2 -13
  29. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +63 -165
  30. package/dist/FormSteps/CBRStepMapper.js +61 -152
  31. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +2 -13
  32. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +19 -37
  33. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +2 -13
  34. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +47 -80
  35. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +3 -26
  36. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +33 -61
  37. package/dist/FormSteps/CustomStep.js +17 -31
  38. package/dist/FormSteps/DatePickerStep/DatePickerStep.js +2 -13
  39. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +7 -20
  40. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +2 -13
  41. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +16 -32
  42. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +94 -180
  43. package/dist/FormSteps/FileUploadStep/FileUploadStep.js +2 -13
  44. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +33 -95
  45. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +3 -0
  46. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +86 -180
  47. package/dist/FormSteps/MapperStep/MapperStep.js +2 -13
  48. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +16 -38
  49. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +21 -31
  50. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +89 -175
  51. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +20 -47
  52. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +81 -117
  53. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +15 -33
  54. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +2 -13
  55. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +17 -31
  56. package/dist/FormSteps/RatingStep/RatingStep.js +2 -13
  57. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +35 -61
  58. package/dist/FormSteps/SelectorStep/SelectorStep.js +2 -13
  59. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -3
  60. package/dist/FormSteps/SeparatorStep/SeparatorStep.js +2 -13
  61. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +77 -142
  62. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +2 -13
  63. package/dist/FormSteps/Step.js +29 -58
  64. package/dist/FormSteps/StepFunctions.js +149 -204
  65. package/dist/FormSteps/StepFunctions.test.js +695 -0
  66. package/dist/FormSteps/StepHooks.js +94 -146
  67. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +38 -74
  68. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +12 -28
  69. package/dist/FormSteps/TextAreaStep/TextAreaStep.js +3 -14
  70. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +12 -30
  71. package/dist/FormSteps/TextInputStep/TextInputStep.js +2 -13
  72. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +9 -26
  73. package/dist/FormSteps/TimePickerStep/TimePickerStep.js +2 -13
  74. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +13 -26
  75. package/dist/FormSteps/TitleStep/TitleStep.js +2 -13
  76. package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +14 -26
  77. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +6 -18
  78. package/dist/Icons/ArrowLeftIcon.js +6 -0
  79. package/dist/Icons/ArrowRightIcon.js +6 -0
  80. package/dist/Icons/CalendarIcon.js +3 -14
  81. package/dist/Icons/CheckCircleIcon.js +6 -0
  82. package/dist/Icons/CheckboxCheckedIcon.js +6 -0
  83. package/dist/Icons/CheckboxUncheckedIcon.js +6 -0
  84. package/dist/Icons/ClockIcon.js +6 -0
  85. package/dist/Icons/CloseIcon.js +6 -0
  86. package/dist/Icons/Construction/LeakIcon.js +3 -14
  87. package/dist/Icons/Construction/ProjectIcon.js +3 -14
  88. package/dist/Icons/Construction/PropertyIcon.js +3 -14
  89. package/dist/Icons/Construction/SpaceIcon.js +3 -14
  90. package/dist/Icons/DeleteIcon.js +6 -0
  91. package/dist/Icons/DocumentIcon.js +3 -14
  92. package/dist/Icons/Entities/CheckListIcon.js +3 -14
  93. package/dist/Icons/Entities/GenericEntityIcon.js +4 -15
  94. package/dist/Icons/Entities/HandshakeIcon.js +4 -15
  95. package/dist/Icons/Entities/SupplierIcon.js +4 -15
  96. package/dist/Icons/ErkIcon.module.css +9 -0
  97. package/dist/Icons/ErrorIcon.js +6 -0
  98. package/dist/Icons/ExpandLessIcon.js +6 -0
  99. package/dist/Icons/ExpandMoreIcon.js +6 -0
  100. package/dist/Icons/FileIcon.js +6 -0
  101. package/dist/Icons/InfoIcon.js +6 -0
  102. package/dist/Icons/LocationIcon.js +3 -14
  103. package/dist/Icons/PersonIcon.js +4 -15
  104. package/dist/Icons/Ratings/DislikeIcon.js +6 -0
  105. package/dist/Icons/Ratings/DissatisfiedIcon.js +6 -0
  106. package/dist/Icons/Ratings/LikeIcon.js +6 -0
  107. package/dist/Icons/Ratings/SatisfiedIcon.js +6 -0
  108. package/dist/Icons/Ratings/StarIcon.js +6 -0
  109. package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +6 -0
  110. package/dist/Icons/Ratings/VerySatisfiedIcon.js +6 -0
  111. package/dist/Icons/WarningIcon.js +6 -0
  112. package/dist/Init.js +2 -0
  113. package/dist/Services/FileService.js +29 -86
  114. package/dist/Services/FormService.js +11 -56
  115. package/dist/Services/OrganizationService.js +11 -62
  116. package/dist/Shared/CustomBtn/CustomBtn.js +25 -88
  117. package/dist/Shared/ErkButton/ErkButton.js +31 -0
  118. package/dist/Shared/{RoundedButton/RoundedButton.stories.js → ErkButton/ErkButton.stories.js} +6 -6
  119. package/dist/Shared/ErkCheckbox/ErkCheckBox.js +30 -0
  120. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +37 -0
  121. package/dist/Shared/ErkDatePicker/ErkDatePicker.js +210 -0
  122. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +103 -0
  123. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +83 -0
  124. package/dist/Shared/ErkSelect/ErkSelect.js +90 -0
  125. package/dist/Shared/ErkSelect/ErkSelect.stories.js +64 -0
  126. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +56 -0
  127. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +167 -0
  128. package/dist/Shared/ErkTextField/ErkTextField.js +111 -0
  129. package/dist/Shared/ErkTextField/ErkTextField.stories.js +105 -0
  130. package/dist/Shared/ErkTimePicker/ErkTimePicker.js +131 -0
  131. package/dist/Shared/InputIcon/InputIcon.js +25 -48
  132. package/dist/Shared/Loader/Loader.js +6 -18
  133. package/dist/Shared/Navbar/Navbar.js +2 -14
  134. package/dist/Shared/Navbar/Navbar.stories.js +2 -2
  135. package/dist/Shared/Rating/Rating.js +4 -27
  136. package/dist/Shared/Rating/Rating.stories.js +13 -19
  137. package/dist/Shared/Rating/Ratings/LikeRating.js +19 -33
  138. package/dist/Shared/Rating/Ratings/SatisfactionRating.js +27 -47
  139. package/dist/Shared/Rating/Ratings/ScaleRating.js +23 -54
  140. package/dist/Shared/Toggle/Toggle.js +11 -34
  141. package/dist/States/GlobalSlice.js +6 -17
  142. package/dist/States/SiteSlice.js +58 -76
  143. package/dist/States/WidthStatsSlice.js +8 -9
  144. package/dist/Utils/AxiosAPI.js +3 -3
  145. package/dist/Utils/AxiosWidget.js +4 -4
  146. package/dist/Utils/CBRFunctions.js +29 -30
  147. package/dist/Utils/DraftFunctions.js +102 -143
  148. package/dist/Utils/FormStepFunctions.js +27 -45
  149. package/dist/Utils/LocaleUtils.js +12 -0
  150. package/dist/Utils/MaterialProviders.js +43 -28
  151. package/dist/Utils/MuiClassnameSetup.js +3 -0
  152. package/dist/Utils/PhoneFunctions.js +5 -5
  153. package/dist/Utils/TestUtils.js +22 -51
  154. package/dist/Utils/store.js +10 -65
  155. package/dist/Widget.js +15 -26
  156. package/dist/constants/Files/FileExtensions.js +3 -3
  157. package/dist/constants/Files/FileMaxSize.js +1 -1
  158. package/dist/constants/InternalFormStyle.js +1 -1
  159. package/dist/hooks.js +14 -16
  160. package/dist/index.css +4 -0
  161. package/dist/main.js +22 -0
  162. package/package.json +108 -124
  163. package/dist/@Types/@Types.d.ts +0 -2
  164. package/dist/@Types/AYFFormStep.d.ts +0 -19
  165. package/dist/@Types/Branding.d.ts +0 -13
  166. package/dist/@Types/CBRFormStep.d.ts +0 -74
  167. package/dist/@Types/Condition.d.ts +0 -143
  168. package/dist/@Types/Draft/Draft.d.ts +0 -12
  169. package/dist/@Types/Draft/DraftEntityData.d.ts +0 -54
  170. package/dist/@Types/Entity.d.ts +0 -36
  171. package/dist/@Types/Form.d.ts +0 -75
  172. package/dist/@Types/FormStep.d.ts +0 -219
  173. package/dist/@Types/GenericFormSteps.d.ts +0 -84
  174. package/dist/@Types/MapperElement.d.ts +0 -8
  175. package/dist/@Types/Organization.d.ts +0 -11
  176. package/dist/@Types/Time.d.ts +0 -6
  177. package/dist/@Types/index.d.ts +0 -1
  178. package/dist/App/App.d.ts +0 -59
  179. package/dist/App/AppFunctions.d.ts +0 -23
  180. package/dist/App/AppHooks.d.ts +0 -10
  181. package/dist/Contexts/CustomContext.d.ts +0 -12
  182. package/dist/Contexts/FormContext.d.ts +0 -6
  183. package/dist/Contexts/SectionContext.d.ts +0 -3
  184. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +0 -12
  185. package/dist/Form/Form.d.ts +0 -40
  186. package/dist/Form/FormFunctions.d.ts +0 -12
  187. package/dist/Form/FormHooks.d.ts +0 -3
  188. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +0 -4
  189. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +0 -4
  190. package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +0 -4
  191. package/dist/Form/Section/Section.d.ts +0 -6
  192. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +0 -4
  193. package/dist/Form/Terms/Term/Term.d.ts +0 -8
  194. package/dist/Form/Terms/Terms.d.ts +0 -3
  195. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +0 -8
  196. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +0 -9
  197. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +0 -8
  198. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +0 -11
  199. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +0 -8
  200. package/dist/FormSteps/AYFStepMapper.d.ts +0 -12
  201. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +0 -15
  202. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +0 -4
  203. package/dist/FormSteps/CBRStepMapper.d.ts +0 -13
  204. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +0 -9
  205. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +0 -4
  206. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +0 -9
  207. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +0 -4
  208. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +0 -9
  209. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +0 -4
  210. package/dist/FormSteps/CustomStep.d.ts +0 -27
  211. package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +0 -11
  212. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +0 -4
  213. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +0 -15
  214. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +0 -12
  215. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +0 -4
  216. package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +0 -9
  217. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +0 -14
  218. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +0 -18
  219. package/dist/FormSteps/MapperStep/MapperStep.d.ts +0 -18
  220. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +0 -5
  221. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.d.ts +0 -15
  222. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +0 -5
  223. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +0 -5
  224. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +0 -21
  225. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +0 -4
  226. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +0 -11
  227. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +0 -4
  228. package/dist/FormSteps/RatingStep/RatingStep.d.ts +0 -9
  229. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +0 -4
  230. package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +0 -9
  231. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +0 -4
  232. package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +0 -9
  233. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +0 -5
  234. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +0 -35
  235. package/dist/FormSteps/Step.d.ts +0 -8
  236. package/dist/FormSteps/StepFunctions.d.ts +0 -29
  237. package/dist/FormSteps/StepHooks.d.ts +0 -55
  238. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +0 -10
  239. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +0 -8
  240. package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +0 -10
  241. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +0 -4
  242. package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +0 -17
  243. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +0 -4
  244. package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +0 -12
  245. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +0 -4
  246. package/dist/FormSteps/TitleStep/TitleStep.d.ts +0 -9
  247. package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +0 -9
  248. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +0 -12
  249. package/dist/Icons/@IconTypes.d.ts +0 -7
  250. package/dist/Icons/CalendarIcon.d.ts +0 -4
  251. package/dist/Icons/Construction/LeakIcon.d.ts +0 -3
  252. package/dist/Icons/Construction/ProjectIcon.d.ts +0 -3
  253. package/dist/Icons/Construction/PropertyIcon.d.ts +0 -3
  254. package/dist/Icons/Construction/SpaceIcon.d.ts +0 -3
  255. package/dist/Icons/DocumentIcon.d.ts +0 -3
  256. package/dist/Icons/Entities/CheckListIcon.d.ts +0 -3
  257. package/dist/Icons/Entities/GenericEntityIcon.d.ts +0 -3
  258. package/dist/Icons/Entities/HandshakeIcon.d.ts +0 -3
  259. package/dist/Icons/Entities/SupplierIcon.d.ts +0 -3
  260. package/dist/Icons/LocationIcon.d.ts +0 -4
  261. package/dist/Icons/PersonIcon.d.ts +0 -4
  262. package/dist/Services/FileService.d.ts +0 -5
  263. package/dist/Services/FormService.d.ts +0 -5
  264. package/dist/Services/OrganizationService.d.ts +0 -2
  265. package/dist/Shared/CustomBtn/CustomBtn.d.ts +0 -18
  266. package/dist/Shared/InputIcon/InputIcon.d.ts +0 -7
  267. package/dist/Shared/Loader/Loader.d.ts +0 -18
  268. package/dist/Shared/Navbar/Navbar.d.ts +0 -9
  269. package/dist/Shared/Navbar/Navbar.stories.d.ts +0 -13
  270. package/dist/Shared/Rating/Rating.d.ts +0 -15
  271. package/dist/Shared/Rating/Rating.stories.d.ts +0 -15
  272. package/dist/Shared/Rating/Ratings/LikeRating.d.ts +0 -4
  273. package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +0 -4
  274. package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +0 -4
  275. package/dist/Shared/RoundedButton/RoundedButton.d.ts +0 -30
  276. package/dist/Shared/RoundedButton/RoundedButton.js +0 -45
  277. package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +0 -23
  278. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +0 -24
  279. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +0 -101
  280. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +0 -21
  281. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +0 -50
  282. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +0 -49
  283. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +0 -351
  284. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +0 -36
  285. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +0 -223
  286. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +0 -43
  287. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +0 -226
  288. package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +0 -68
  289. package/dist/Shared/RoundedSelect/RoundedSelect.js +0 -214
  290. package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +0 -28
  291. package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +0 -91
  292. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -63
  293. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +0 -236
  294. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.d.ts +0 -36
  295. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +0 -318
  296. package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +0 -45
  297. package/dist/Shared/RoundedTextField/RoundedTextField.js +0 -175
  298. package/dist/Shared/RoundedTextField/RoundedTextField.stories.d.ts +0 -37
  299. package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +0 -224
  300. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +0 -41
  301. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +0 -314
  302. package/dist/Shared/Toggle/Toggle.d.ts +0 -18
  303. package/dist/States/GlobalSlice.d.ts +0 -46
  304. package/dist/States/SiteSlice.d.ts +0 -95
  305. package/dist/States/WidthStatsSlice.d.ts +0 -7
  306. package/dist/Utils/AxiosAPI.d.ts +0 -2
  307. package/dist/Utils/AxiosWidget.d.ts +0 -2
  308. package/dist/Utils/CBRFunctions.d.ts +0 -8
  309. package/dist/Utils/DraftFunctions.d.ts +0 -56
  310. package/dist/Utils/FormStepFunctions.d.ts +0 -15
  311. package/dist/Utils/MaterialProviders.d.ts +0 -6
  312. package/dist/Utils/PhoneFunctions.d.ts +0 -2
  313. package/dist/Utils/TestUtils.d.ts +0 -77
  314. package/dist/Utils/store.d.ts +0 -27
  315. package/dist/Widget.d.ts +0 -1
  316. package/dist/__mocks__/axios.d.ts +0 -2
  317. package/dist/__mocks__/axios.js +0 -2
  318. package/dist/constants/AYFFormStepTypes.d.ts +0 -9
  319. package/dist/constants/CBRFormStepTypes.d.ts +0 -21
  320. package/dist/constants/ConditionTypes.d.ts +0 -27
  321. package/dist/constants/Draft/DraftEntityDataTypes.d.ts +0 -11
  322. package/dist/constants/Draft/DraftEntityTypes.d.ts +0 -3
  323. package/dist/constants/Draft/DraftStyleTypes.d.ts +0 -7
  324. package/dist/constants/EntityPropertyTypes.d.ts +0 -10
  325. package/dist/constants/Files/FileExtensions.d.ts +0 -3
  326. package/dist/constants/Files/FileMaxSize.d.ts +0 -2
  327. package/dist/constants/FormStepTypes.d.ts +0 -64
  328. package/dist/constants/IconTypes.d.ts +0 -15
  329. package/dist/constants/InternalFormStyle.d.ts +0 -3
  330. package/dist/constants/MaterialClassNameSeed.d.ts +0 -1
  331. package/dist/constants/MaterialClassNameSeed.js +0 -1
  332. package/dist/constants/TicketPropertyTypes.d.ts +0 -3
  333. package/dist/hooks.d.ts +0 -7
  334. package/dist/index.d.ts +0 -1
  335. package/dist/index.js +0 -31
  336. package/dist/index.lib.d.ts +0 -7
  337. package/dist/setupTests.d.ts +0 -1
  338. /package/dist/Shared/{RoundedTimePicker/RoundedTimePicker.module.css → ErkTimePicker/ErkTimePicker.module.css} +0 -0
  339. /package/dist/{setupTests.js → __tests__/setup.js} +0 -0
@@ -0,0 +1,638 @@
1
+ /* eslint-disable @typescript-eslint/require-await */
2
+ import { describe, expect, test } from 'vitest';
3
+ import { calcRecursiveData } from '../Utils/FormStepFunctions';
4
+ import FormStepTypes, { ClassifierOptionTypes, FormTypes, MapperStyleTypes, OptionTypes, } from '../constants/FormStepTypes';
5
+ import { addMapperStep, calcInitialSections, calcValuesStore, mapOriginalValue } from './AppFunctions';
6
+ const OrgInfo = {
7
+ idOrganization: '',
8
+ countryCode: 'CO',
9
+ };
10
+ //Hacer una prueba para validar que no haya quemado nada!
11
+ describe('AppFunctions', function () {
12
+ describe('calcValuesStore', function () {
13
+ const baseForm = {
14
+ firstSection: 'FIRST',
15
+ sections: {
16
+ FIRST: {
17
+ id: 'FIRST',
18
+ name: 'First Section',
19
+ nextSection: 'SECOND',
20
+ steps: [],
21
+ },
22
+ },
23
+ size: {
24
+ blockNum: 4,
25
+ blockSize: 210,
26
+ spacingSize: 20,
27
+ },
28
+ steps: {},
29
+ };
30
+ test('Empty Values and no Mapper', async () => {
31
+ const values = await calcValuesStore(OrgInfo, baseForm);
32
+ expect(Object.keys(values).length).toBe(2);
33
+ });
34
+ test('Original values ', async () => {
35
+ const values = await calcValuesStore(OrgInfo, baseForm, {
36
+ idStep: 'value',
37
+ });
38
+ expect(Object.keys(values.global).length).toBe(1);
39
+ });
40
+ test('Step with value', async () => {
41
+ const values = await calcValuesStore(OrgInfo, {
42
+ ...baseForm,
43
+ steps: {
44
+ idStep: {
45
+ id: 'idStep',
46
+ label: 'Step',
47
+ description: null,
48
+ idSection: 'FIRST',
49
+ type: FormStepTypes.TEXTINPUT,
50
+ required: true,
51
+ size: 1,
52
+ },
53
+ },
54
+ }, {
55
+ idStep: 'value',
56
+ });
57
+ expect(Object.keys(values.sections.FIRST).length).toBe(1);
58
+ });
59
+ test('Step without value', async () => {
60
+ const values = await calcValuesStore(OrgInfo, {
61
+ ...baseForm,
62
+ steps: {
63
+ idStep: {
64
+ id: 'idStep',
65
+ label: 'Step',
66
+ description: null,
67
+ idSection: 'FIRST',
68
+ type: FormStepTypes.TEXTINPUT,
69
+ required: true,
70
+ size: 1,
71
+ },
72
+ },
73
+ });
74
+ expect(values.sections.FIRST).toBeUndefined();
75
+ });
76
+ test('Empty initial Mapper Step', async () => {
77
+ const values = await calcValuesStore(OrgInfo, {
78
+ ...baseForm,
79
+ steps: {
80
+ idStep: {
81
+ id: 'idStep',
82
+ label: 'Step',
83
+ description: null,
84
+ idSection: 'FIRST',
85
+ type: FormStepTypes.MAPPER,
86
+ required: true,
87
+ addBtnLabel: 'Add',
88
+ rootSteps: [],
89
+ steps: {},
90
+ style: { type: MapperStyleTypes.PILL },
91
+ unitLabel: 'Elemento',
92
+ },
93
+ },
94
+ sections: {
95
+ FIRST: { ...baseForm.sections.FIRST, steps: ['idStep'] },
96
+ },
97
+ });
98
+ expect(Object.keys(values.sections.FIRST).length).toBe(1);
99
+ });
100
+ test('Empty initial Mapper Step postview', async () => {
101
+ const values = await calcValuesStore(OrgInfo, {
102
+ ...baseForm,
103
+ steps: {
104
+ idStep: {
105
+ id: 'idStep',
106
+ label: 'Step',
107
+ description: null,
108
+ idSection: 'FIRST',
109
+ type: FormStepTypes.MAPPER,
110
+ required: true,
111
+ addBtnLabel: 'Add',
112
+ rootSteps: [],
113
+ steps: {},
114
+ style: { type: MapperStyleTypes.PILL },
115
+ unitLabel: 'Elemento',
116
+ },
117
+ },
118
+ sections: {
119
+ FIRST: {
120
+ ...baseForm.sections.FIRST,
121
+ steps: ['idStep'],
122
+ },
123
+ },
124
+ }, {}, true);
125
+ expect(Object.keys(values.sections).length).toBe(0);
126
+ });
127
+ test('Mapper Step with initial value', async () => {
128
+ const values = await calcValuesStore(OrgInfo, {
129
+ ...baseForm,
130
+ steps: {
131
+ idStep: {
132
+ id: 'idStep',
133
+ label: 'Step',
134
+ description: null,
135
+ idSection: 'FIRST',
136
+ type: FormStepTypes.MAPPER,
137
+ required: true,
138
+ addBtnLabel: 'Add',
139
+ rootSteps: [],
140
+ steps: {},
141
+ style: { type: MapperStyleTypes.PILL },
142
+ unitLabel: 'Elemento',
143
+ },
144
+ },
145
+ sections: {
146
+ FIRST: {
147
+ ...baseForm.sections.FIRST,
148
+ steps: ['idStep'],
149
+ },
150
+ },
151
+ }, {
152
+ idStep: [{ value: 'value' }],
153
+ });
154
+ expect(Object.keys(values.sections).length).toBe(1);
155
+ const originalValue = values.sections.FIRST.idStep;
156
+ const elements = originalValue.elements;
157
+ expect(elements.length).toBe(1);
158
+ const element = elements[0];
159
+ expect(element.ids).toBeDefined();
160
+ expect(Object.keys(element.ids).length).toBe(0);
161
+ expect(element.value).toBe('value');
162
+ expect(element.isOriginal).toBe(true);
163
+ });
164
+ });
165
+ describe('addMapperStep', function () {
166
+ test('Mapper Step with subSteps', async () => {
167
+ const { element, mappers, steps } = addMapperStep({
168
+ id: 'idStep',
169
+ label: 'Step',
170
+ description: null,
171
+ idSection: 'FIRST',
172
+ type: FormStepTypes.MAPPER,
173
+ required: true,
174
+ addBtnLabel: 'Add',
175
+ rootSteps: ['idSubStep', 'idSubMapperStep'],
176
+ steps: {
177
+ idSubStep: {
178
+ id: 'idSubStep',
179
+ label: 'SubStep',
180
+ description: null,
181
+ idSection: 'FIRST',
182
+ type: FormStepTypes.TEXTINPUT,
183
+ required: true,
184
+ size: 1,
185
+ },
186
+ idSubMapperStep: {
187
+ id: 'idSubMapperStep',
188
+ label: 'SubStep',
189
+ description: null,
190
+ idSection: 'FIRST',
191
+ type: FormStepTypes.MAPPER,
192
+ required: true,
193
+ addBtnLabel: 'Add',
194
+ rootSteps: [],
195
+ steps: {},
196
+ style: { type: MapperStyleTypes.PILL },
197
+ unitLabel: 'SubElemento',
198
+ },
199
+ },
200
+ style: { type: MapperStyleTypes.PILL },
201
+ unitLabel: 'Elemento',
202
+ }, {});
203
+ expect(element.ids).toBeDefined();
204
+ expect(element.isOriginal).toBe(false);
205
+ expect(Object.keys(element.ids).length).toBe(2);
206
+ expect(Object.keys(element.originalValues).length).toBe(0);
207
+ expect(Object.keys(mappers).length).toBe(1);
208
+ expect(mappers[element.ids.idSubMapperStep]).toBeDefined();
209
+ expect(Object.keys(steps).length).toBe(2);
210
+ for (const id of Object.values(element.ids)) {
211
+ expect(steps[id]).toBeDefined();
212
+ }
213
+ });
214
+ });
215
+ describe('calcRecursiveData', function () {
216
+ test('SubSteps without dependencies', async () => {
217
+ const element = {
218
+ id: 'idStep',
219
+ ids: {
220
+ idSubStep: 'idSubStep-idElement',
221
+ },
222
+ originalValues: {},
223
+ isOriginal: false,
224
+ };
225
+ const newSteps = {
226
+ 'idSubStep-idElement': {
227
+ id: 'idSubStep-idElement',
228
+ label: 'SubStep',
229
+ description: null,
230
+ idSection: 'FIRST',
231
+ type: FormStepTypes.TEXTINPUT,
232
+ required: true,
233
+ size: 1,
234
+ },
235
+ };
236
+ calcRecursiveData(element, newSteps, {});
237
+ expect(newSteps['idSubStep-idElement'].dependencies).toBeUndefined();
238
+ });
239
+ test('SubSteps with basic dependencies', async () => {
240
+ const element = {
241
+ id: 'idStep',
242
+ ids: {
243
+ idSubStep: 'idSubStep-idElement',
244
+ },
245
+ originalValues: {},
246
+ isOriginal: false,
247
+ };
248
+ const newSteps = {
249
+ 'idSubStep-idElement': {
250
+ id: 'idSubStep-idElement',
251
+ label: 'SubStep',
252
+ description: null,
253
+ idSection: 'FIRST',
254
+ type: FormStepTypes.TEXTINPUT,
255
+ required: true,
256
+ size: 1,
257
+ dependencies: ['idParentStep'],
258
+ },
259
+ };
260
+ calcRecursiveData(element, newSteps, {});
261
+ expect(newSteps['idSubStep-idElement'].dependencies[0]).toBe('idParentStep');
262
+ });
263
+ test('SubSteps with subStep dependencies', async () => {
264
+ const element = {
265
+ id: 'idStep',
266
+ ids: {
267
+ idSubStep: 'idSubStep-idElement',
268
+ idSubStep2: 'idSubStep2-idElement',
269
+ },
270
+ originalValues: {},
271
+ isOriginal: false,
272
+ };
273
+ const newSteps = {
274
+ 'idSubStep-idElement': {
275
+ id: 'idSubStep-idElement',
276
+ label: 'SubStep',
277
+ description: null,
278
+ idSection: 'FIRST',
279
+ type: FormStepTypes.TEXTINPUT,
280
+ required: true,
281
+ size: 1,
282
+ },
283
+ 'idSubStep2-idElement': {
284
+ id: 'idSubStep2-idElement',
285
+ label: 'SubStep',
286
+ description: null,
287
+ idSection: 'FIRST',
288
+ type: FormStepTypes.TEXTINPUT,
289
+ required: true,
290
+ size: 1,
291
+ dependencies: ['idSubStep'],
292
+ },
293
+ };
294
+ calcRecursiveData(element, newSteps, {});
295
+ expect(newSteps['idSubStep-idElement'].dependencies).toBeUndefined();
296
+ expect(newSteps['idSubStep2-idElement'].dependencies[0]).toBe('idSubStep-idElement');
297
+ });
298
+ test('SubSteps with nested steps', async () => {
299
+ const element = {
300
+ id: 'idStep',
301
+ ids: {
302
+ idSubStep: 'idSubStep-idElement',
303
+ idSubStep2: 'idSubStep2-idElement',
304
+ },
305
+ originalValues: {},
306
+ isOriginal: false,
307
+ };
308
+ const newSteps = {
309
+ 'idSubStep-idElement': {
310
+ id: 'idSubStep-idElement',
311
+ label: 'SubStep',
312
+ description: '',
313
+ idSection: 'FIRST',
314
+ type: FormStepTypes.SELECTOR,
315
+ required: true,
316
+ size: 1,
317
+ options: [
318
+ {
319
+ type: OptionTypes.NESTED,
320
+ label: 'Option',
321
+ steps: ['idSubStep2-idElement'],
322
+ value: 'value',
323
+ },
324
+ ],
325
+ searchable: true,
326
+ },
327
+ 'idSubStep2-idElement': {
328
+ id: 'idSubStep2-idElement',
329
+ label: 'SubStep',
330
+ description: null,
331
+ idSection: 'FIRST',
332
+ type: FormStepTypes.TEXTINPUT,
333
+ required: true,
334
+ size: 1,
335
+ },
336
+ };
337
+ calcRecursiveData(element, newSteps, {});
338
+ expect(newSteps['idSubStep-idElement'].dependencies).toBeUndefined();
339
+ expect(newSteps['idSubStep-idElement'].options[0].steps[0]).toBe('idSubStep2-idElement');
340
+ });
341
+ });
342
+ describe('mapOriginalValue', function () {
343
+ test('No Value', async () => {
344
+ const values = {
345
+ global: {},
346
+ sections: {},
347
+ };
348
+ const value = await mapOriginalValue(OrgInfo, {
349
+ id: 'idStep',
350
+ label: 'Step',
351
+ description: null,
352
+ idSection: 'FIRST',
353
+ type: FormStepTypes.TEXTINPUT,
354
+ required: true,
355
+ size: 1,
356
+ }, undefined, values);
357
+ expect(value).toBeUndefined();
358
+ });
359
+ test('Mapper Step', async () => {
360
+ const values = {
361
+ global: {},
362
+ sections: {},
363
+ };
364
+ const value = await mapOriginalValue(OrgInfo, {
365
+ id: 'idStep',
366
+ label: 'Step',
367
+ description: null,
368
+ idSection: 'FIRST',
369
+ type: FormStepTypes.MAPPER,
370
+ required: true,
371
+ addBtnLabel: 'Add',
372
+ rootSteps: ['idSubStep'],
373
+ steps: {
374
+ idSubStep: {
375
+ id: 'idSubStep',
376
+ label: 'SubStep',
377
+ description: null,
378
+ idSection: 'FIRST',
379
+ type: FormStepTypes.TEXTINPUT,
380
+ required: true,
381
+ size: 1,
382
+ },
383
+ },
384
+ style: { type: MapperStyleTypes.PILL },
385
+ unitLabel: 'Elemento',
386
+ }, [
387
+ {
388
+ idSubStep: 'value',
389
+ },
390
+ ], values);
391
+ expect(value.elements.length).toBe(1);
392
+ expect(values.sections.FIRST.idStep).toBeUndefined();
393
+ expect(values.sections.FIRST[value.elements[0].ids.idSubStep]).toBe('value');
394
+ });
395
+ test('Text Area with editor as string', async () => {
396
+ const value = await mapOriginalValue(OrgInfo, {
397
+ id: 'idStep',
398
+ label: 'Step',
399
+ description: null,
400
+ idSection: 'FIRST',
401
+ type: FormStepTypes.TEXTAREA,
402
+ required: true,
403
+ hasTextEditor: true,
404
+ }, 'value', {
405
+ global: {},
406
+ sections: {},
407
+ });
408
+ expect(value.blocks.length).toBe(1);
409
+ expect(value.blocks[0].text).toBe('value');
410
+ });
411
+ test('Text Area with editor as draft', async () => {
412
+ const value = await mapOriginalValue(OrgInfo, {
413
+ id: 'idStep',
414
+ label: 'Step',
415
+ description: null,
416
+ idSection: 'FIRST',
417
+ type: FormStepTypes.TEXTAREA,
418
+ required: true,
419
+ hasTextEditor: true,
420
+ }, {
421
+ draft: {
422
+ blocks: [
423
+ {
424
+ key: '0',
425
+ text: 'value',
426
+ type: 'unstyled',
427
+ depth: 0,
428
+ inlineStyleRanges: [],
429
+ entityRanges: [],
430
+ data: {},
431
+ },
432
+ ],
433
+ entityMap: {},
434
+ },
435
+ }, {
436
+ global: {},
437
+ sections: {},
438
+ });
439
+ expect(value.blocks.length).toBe(1);
440
+ expect(value.blocks[0].text).toBe('value');
441
+ });
442
+ test('Text Area without editor as string', async () => {
443
+ const value = await mapOriginalValue(OrgInfo, {
444
+ id: 'idStep',
445
+ label: 'Step',
446
+ description: null,
447
+ idSection: 'FIRST',
448
+ type: FormStepTypes.TEXTAREA,
449
+ required: true,
450
+ hasTextEditor: false,
451
+ }, 'value', {
452
+ global: {},
453
+ sections: {},
454
+ });
455
+ expect(value).toBe('value');
456
+ });
457
+ test('Text Area without editor as draft', async () => {
458
+ const value = await mapOriginalValue(OrgInfo, {
459
+ id: 'idStep',
460
+ label: 'Step',
461
+ description: null,
462
+ idSection: 'FIRST',
463
+ type: FormStepTypes.TEXTAREA,
464
+ required: true,
465
+ hasTextEditor: false,
466
+ }, {
467
+ draft: {
468
+ blocks: [
469
+ {
470
+ key: '0',
471
+ text: 'value',
472
+ type: 'unstyled',
473
+ depth: 0,
474
+ inlineStyleRanges: [],
475
+ entityRanges: [],
476
+ data: {},
477
+ },
478
+ ],
479
+ entityMap: {},
480
+ },
481
+ text: 'value',
482
+ }, {
483
+ global: {},
484
+ sections: {},
485
+ });
486
+ expect(value).toBe('value');
487
+ });
488
+ test('Selector with value as text', async () => {
489
+ const value = await mapOriginalValue(OrgInfo, {
490
+ id: 'idStep',
491
+ label: 'Step',
492
+ description: '',
493
+ idSection: 'FIRST',
494
+ type: FormStepTypes.SELECTOR,
495
+ required: true,
496
+ options: [
497
+ {
498
+ type: OptionTypes.DEFAULT,
499
+ label: 'Option',
500
+ value: 'value',
501
+ },
502
+ ],
503
+ searchable: true,
504
+ size: 1,
505
+ }, 'value', {
506
+ global: {},
507
+ sections: {},
508
+ });
509
+ expect(value.label).toBe('Option');
510
+ });
511
+ test('Selector with value as option', async () => {
512
+ const value = await mapOriginalValue(OrgInfo, {
513
+ id: 'idStep',
514
+ label: 'Step',
515
+ description: '',
516
+ idSection: 'FIRST',
517
+ type: FormStepTypes.SELECTOR,
518
+ required: true,
519
+ options: [
520
+ {
521
+ type: OptionTypes.DEFAULT,
522
+ label: 'Option',
523
+ value: 'value',
524
+ },
525
+ ],
526
+ searchable: true,
527
+ size: 1,
528
+ }, { label: 'Label', value: 'value' }, {
529
+ global: {},
530
+ sections: {},
531
+ });
532
+ expect(value.label).toBe('Label');
533
+ });
534
+ test('Selector with value as option', async () => {
535
+ const value = await mapOriginalValue(OrgInfo, {
536
+ id: 'idStep',
537
+ label: 'Step',
538
+ description: '',
539
+ idSection: 'FIRST',
540
+ type: FormStepTypes.CLASSIFIER_SELECTOR,
541
+ required: true,
542
+ options: {
543
+ idClassifier: {
544
+ type: ClassifierOptionTypes.NESTED,
545
+ idClassifier: '12345',
546
+ steps: [],
547
+ },
548
+ },
549
+ idClassifier: '1234',
550
+ searchable: true,
551
+ size: 1,
552
+ }, '12345', {
553
+ global: {},
554
+ sections: {},
555
+ }, {
556
+ classifiers: {
557
+ '1234': {
558
+ _id: '1234',
559
+ name: 'Parent',
560
+ children: ['12345'],
561
+ },
562
+ '12345': {
563
+ _id: '12345',
564
+ name: 'Child',
565
+ children: [],
566
+ },
567
+ },
568
+ });
569
+ expect(value.label).toBe('Child');
570
+ });
571
+ });
572
+ describe('calcInitialSections', function () {
573
+ test('Column with One Section', async () => {
574
+ const state = calcInitialSections({
575
+ firstSection: 'FIRST',
576
+ sections: {
577
+ FIRST: {
578
+ id: 'FIRST',
579
+ name: 'First Section',
580
+ nextSection: null,
581
+ steps: [],
582
+ },
583
+ },
584
+ });
585
+ expect(state.previousSections.length).toBe(0);
586
+ expect(state.nextSections.length).toBe(1);
587
+ expect(state.idCurrentSection).toBe(null);
588
+ });
589
+ test('Column with multiple sections', async () => {
590
+ const state = calcInitialSections({
591
+ firstSection: 'FIRST',
592
+ sections: {
593
+ FIRST: {
594
+ id: 'FIRST',
595
+ name: 'First Section',
596
+ nextSection: 'SECOND',
597
+ steps: [],
598
+ },
599
+ SECOND: {
600
+ id: 'SECOND',
601
+ name: 'Second Section',
602
+ nextSection: null,
603
+ steps: [],
604
+ },
605
+ },
606
+ });
607
+ expect(state.previousSections.length).toBe(0);
608
+ expect(state.nextSections.length).toBe(2);
609
+ expect(state.nextSections[0]).toBe('FIRST');
610
+ expect(state.nextSections[1]).toBe('SECOND');
611
+ expect(state.idCurrentSection).toBe(null);
612
+ });
613
+ test('Stepper Form', async () => {
614
+ const state = calcInitialSections({
615
+ type: FormTypes.STEPPER,
616
+ firstSection: 'FIRST',
617
+ sections: {
618
+ FIRST: {
619
+ id: 'FIRST',
620
+ name: 'First Section',
621
+ nextSection: 'SECOND',
622
+ steps: [],
623
+ },
624
+ SECOND: {
625
+ id: 'SECOND',
626
+ name: 'Second Section',
627
+ nextSection: null,
628
+ steps: [],
629
+ },
630
+ },
631
+ });
632
+ expect(state.previousSections.length).toBe(0);
633
+ expect(state.nextSections.length).toBe(1);
634
+ expect(state.nextSections[0]).toBe('SECOND');
635
+ expect(state.idCurrentSection).toBe('FIRST');
636
+ });
637
+ });
638
+ });