@arquimedes.co/eureka-forms 2.0.99 → 3.0.1-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 (334) hide show
  1. package/dist/@Types/FormStep.d.ts +1 -1
  2. package/dist/App/App.d.ts +1 -3
  3. package/dist/App/App.js +21 -46
  4. package/dist/App/AppFunctions.d.ts +1 -1
  5. package/dist/App/AppFunctions.js +177 -328
  6. package/dist/App/AppFunctions.test.js +638 -0
  7. package/dist/App/AppHooks.d.ts +2 -2
  8. package/dist/App/AppHooks.js +127 -223
  9. package/dist/App/AppHooks.test.d.ts +1 -0
  10. package/dist/App/AppHooks.test.js +154 -0
  11. package/dist/Contexts/CustomContext.d.ts +0 -1
  12. package/dist/Contexts/CustomContext.js +1 -1
  13. package/dist/Contexts/FormContext.d.ts +1 -1
  14. package/dist/Contexts/FormContext.js +3 -2
  15. package/dist/Contexts/SectionContext.d.ts +0 -1
  16. package/dist/Contexts/SectionContext.js +1 -1
  17. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +0 -1
  18. package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +43 -62
  19. package/dist/Form/Form.d.ts +1 -2
  20. package/dist/Form/Form.js +75 -160
  21. package/dist/Form/FormFunctions.js +64 -114
  22. package/dist/Form/FormFunctions.test.d.ts +1 -0
  23. package/dist/Form/FormFunctions.test.js +454 -0
  24. package/dist/Form/FormHooks.d.ts +0 -1
  25. package/dist/Form/FormHooks.js +14 -21
  26. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +0 -1
  27. package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +34 -105
  28. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -2
  29. package/dist/Form/FormTypes/StepperForm/StepperForm.js +48 -110
  30. package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +0 -1
  31. package/dist/Form/Section/MaterialSection/MaterialSection.js +10 -23
  32. package/dist/Form/Section/MaterialSection/MaterialSection.module.css +0 -2
  33. package/dist/Form/Section/Section.d.ts +0 -1
  34. package/dist/Form/Section/Section.js +4 -15
  35. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +0 -1
  36. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +30 -65
  37. package/dist/Form/Terms/Term/Term.d.ts +0 -1
  38. package/dist/Form/Terms/Term/Term.js +2 -13
  39. package/dist/Form/Terms/Terms.d.ts +0 -1
  40. package/dist/Form/Terms/Terms.js +11 -27
  41. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +0 -1
  42. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +36 -106
  43. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +0 -1
  44. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
  45. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +0 -1
  46. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +12 -40
  47. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +0 -1
  48. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +57 -77
  49. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +0 -1
  50. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +46 -111
  51. package/dist/FormSteps/AYFStepMapper.d.ts +0 -1
  52. package/dist/FormSteps/AYFStepMapper.js +63 -127
  53. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +0 -1
  54. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +2 -13
  55. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +0 -1
  56. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +63 -165
  57. package/dist/FormSteps/CBRStepMapper.d.ts +0 -1
  58. package/dist/FormSteps/CBRStepMapper.js +61 -152
  59. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +0 -1
  60. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +2 -13
  61. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +0 -1
  62. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +19 -37
  63. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +0 -1
  64. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +2 -13
  65. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +1 -2
  66. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +47 -80
  67. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +0 -1
  68. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +3 -26
  69. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +0 -1
  70. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +33 -61
  71. package/dist/FormSteps/CustomStep.d.ts +0 -1
  72. package/dist/FormSteps/CustomStep.js +17 -31
  73. package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +0 -1
  74. package/dist/FormSteps/DatePickerStep/DatePickerStep.js +2 -13
  75. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +1 -2
  76. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +7 -20
  77. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +0 -1
  78. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +2 -13
  79. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +0 -1
  80. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +16 -32
  81. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +1 -2
  82. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +94 -180
  83. package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +0 -1
  84. package/dist/FormSteps/FileUploadStep/FileUploadStep.js +2 -13
  85. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +0 -1
  86. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +33 -95
  87. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +2 -0
  88. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +3 -0
  89. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +0 -2
  90. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +86 -180
  91. package/dist/FormSteps/MapperStep/MapperStep.d.ts +0 -1
  92. package/dist/FormSteps/MapperStep/MapperStep.js +2 -13
  93. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +0 -1
  94. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +16 -38
  95. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +21 -31
  96. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +0 -1
  97. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +89 -175
  98. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +0 -1
  99. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +20 -47
  100. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +0 -1
  101. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +81 -117
  102. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +1 -2
  103. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +15 -33
  104. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +0 -1
  105. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +2 -13
  106. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +0 -1
  107. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +17 -31
  108. package/dist/FormSteps/RatingStep/RatingStep.d.ts +0 -1
  109. package/dist/FormSteps/RatingStep/RatingStep.js +2 -13
  110. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +0 -1
  111. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +35 -61
  112. package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +0 -1
  113. package/dist/FormSteps/SelectorStep/SelectorStep.js +2 -13
  114. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +0 -1
  115. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -3
  116. package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +0 -1
  117. package/dist/FormSteps/SeparatorStep/SeparatorStep.js +2 -13
  118. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +1 -2
  119. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +77 -142
  120. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +5 -5
  121. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +2 -13
  122. package/dist/FormSteps/Step.d.ts +0 -1
  123. package/dist/FormSteps/Step.js +29 -58
  124. package/dist/FormSteps/StepFunctions.d.ts +4 -6
  125. package/dist/FormSteps/StepFunctions.js +149 -204
  126. package/dist/FormSteps/StepFunctions.test.d.ts +1 -0
  127. package/dist/FormSteps/StepFunctions.test.js +695 -0
  128. package/dist/FormSteps/StepHooks.d.ts +68 -14
  129. package/dist/FormSteps/StepHooks.js +94 -146
  130. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +0 -1
  131. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +38 -74
  132. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -2
  133. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +12 -28
  134. package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +0 -1
  135. package/dist/FormSteps/TextAreaStep/TextAreaStep.js +3 -14
  136. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -2
  137. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +12 -30
  138. package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +1 -2
  139. package/dist/FormSteps/TextInputStep/TextInputStep.js +2 -13
  140. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +1 -2
  141. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +9 -26
  142. package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +0 -1
  143. package/dist/FormSteps/TimePickerStep/TimePickerStep.js +2 -13
  144. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +0 -1
  145. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +13 -26
  146. package/dist/FormSteps/TitleStep/TitleStep.d.ts +0 -1
  147. package/dist/FormSteps/TitleStep/TitleStep.js +2 -13
  148. package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +1 -1
  149. package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +14 -26
  150. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +0 -1
  151. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +6 -18
  152. package/dist/Icons/@IconTypes.d.ts +0 -1
  153. package/dist/Icons/ArrowLeftIcon.d.ts +3 -0
  154. package/dist/Icons/ArrowLeftIcon.js +6 -0
  155. package/dist/Icons/ArrowRightIcon.d.ts +3 -0
  156. package/dist/Icons/ArrowRightIcon.js +6 -0
  157. package/dist/Icons/CalendarIcon.d.ts +1 -2
  158. package/dist/Icons/CalendarIcon.js +3 -14
  159. package/dist/Icons/CheckCircleIcon.d.ts +3 -0
  160. package/dist/Icons/CheckCircleIcon.js +6 -0
  161. package/dist/Icons/CheckboxCheckedIcon.d.ts +3 -0
  162. package/dist/Icons/CheckboxCheckedIcon.js +6 -0
  163. package/dist/Icons/CheckboxUncheckedIcon.d.ts +3 -0
  164. package/dist/Icons/CheckboxUncheckedIcon.js +6 -0
  165. package/dist/Icons/ClockIcon.d.ts +3 -0
  166. package/dist/Icons/ClockIcon.js +6 -0
  167. package/dist/Icons/CloseIcon.d.ts +3 -0
  168. package/dist/Icons/CloseIcon.js +6 -0
  169. package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
  170. package/dist/Icons/Construction/LeakIcon.js +3 -14
  171. package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
  172. package/dist/Icons/Construction/ProjectIcon.js +3 -14
  173. package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
  174. package/dist/Icons/Construction/PropertyIcon.js +3 -14
  175. package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
  176. package/dist/Icons/Construction/SpaceIcon.js +3 -14
  177. package/dist/Icons/DeleteIcon.d.ts +3 -0
  178. package/dist/Icons/DeleteIcon.js +6 -0
  179. package/dist/Icons/DocumentIcon.d.ts +2 -2
  180. package/dist/Icons/DocumentIcon.js +3 -14
  181. package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
  182. package/dist/Icons/Entities/CheckListIcon.js +3 -14
  183. package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
  184. package/dist/Icons/Entities/GenericEntityIcon.js +4 -15
  185. package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
  186. package/dist/Icons/Entities/HandshakeIcon.js +4 -15
  187. package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
  188. package/dist/Icons/Entities/SupplierIcon.js +4 -15
  189. package/dist/Icons/ErkIcon.module.css +9 -0
  190. package/dist/Icons/ErrorIcon.d.ts +3 -0
  191. package/dist/Icons/ErrorIcon.js +6 -0
  192. package/dist/Icons/ExpandLessIcon.d.ts +3 -0
  193. package/dist/Icons/ExpandLessIcon.js +6 -0
  194. package/dist/Icons/ExpandMoreIcon.d.ts +3 -0
  195. package/dist/Icons/ExpandMoreIcon.js +6 -0
  196. package/dist/Icons/FileIcon.d.ts +3 -0
  197. package/dist/Icons/FileIcon.js +6 -0
  198. package/dist/Icons/InfoIcon.d.ts +3 -0
  199. package/dist/Icons/InfoIcon.js +6 -0
  200. package/dist/Icons/LocationIcon.d.ts +1 -2
  201. package/dist/Icons/LocationIcon.js +3 -14
  202. package/dist/Icons/PersonIcon.d.ts +1 -2
  203. package/dist/Icons/PersonIcon.js +4 -15
  204. package/dist/Icons/Ratings/DislikeIcon.d.ts +3 -0
  205. package/dist/Icons/Ratings/DislikeIcon.js +6 -0
  206. package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +3 -0
  207. package/dist/Icons/Ratings/DissatisfiedIcon.js +6 -0
  208. package/dist/Icons/Ratings/LikeIcon.d.ts +3 -0
  209. package/dist/Icons/Ratings/LikeIcon.js +6 -0
  210. package/dist/Icons/Ratings/SatisfiedIcon.d.ts +3 -0
  211. package/dist/Icons/Ratings/SatisfiedIcon.js +6 -0
  212. package/dist/Icons/Ratings/StarIcon.d.ts +3 -0
  213. package/dist/Icons/Ratings/StarIcon.js +6 -0
  214. package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +3 -0
  215. package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +6 -0
  216. package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +3 -0
  217. package/dist/Icons/Ratings/VerySatisfiedIcon.js +6 -0
  218. package/dist/Icons/WarningIcon.d.ts +3 -0
  219. package/dist/Icons/WarningIcon.js +6 -0
  220. package/dist/Init.d.ts +1 -0
  221. package/dist/Init.js +2 -0
  222. package/dist/Services/FileService.d.ts +1 -1
  223. package/dist/Services/FileService.js +29 -86
  224. package/dist/Services/FormService.js +11 -56
  225. package/dist/Services/OrganizationService.js +11 -62
  226. package/dist/Shared/CustomBtn/CustomBtn.d.ts +1 -2
  227. package/dist/Shared/CustomBtn/CustomBtn.js +25 -88
  228. package/dist/Shared/{RoundedButton/RoundedButton.d.ts → ErkButton/ErkButton.d.ts} +6 -5
  229. package/dist/Shared/ErkButton/ErkButton.js +31 -0
  230. package/dist/Shared/{RoundedButton/RoundedButton.stories.d.ts → ErkButton/ErkButton.stories.d.ts} +2 -2
  231. package/dist/Shared/{RoundedButton/RoundedButton.stories.js → ErkButton/ErkButton.stories.js} +6 -6
  232. package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +19 -0
  233. package/dist/Shared/ErkCheckbox/ErkCheckBox.js +30 -0
  234. package/dist/Shared/{RoundedCheckBox/RoundedCheckBox.stories.d.ts → ErkCheckbox/ErkCheckBox.stories.d.ts} +2 -7
  235. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +37 -0
  236. package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +16 -0
  237. package/dist/Shared/ErkDatePicker/ErkDatePicker.js +210 -0
  238. package/dist/Shared/{RoundedDatePicker/RoundedDatePicker.stories.d.ts → ErkDatePicker/ErkDatePicker.stories.d.ts} +3 -16
  239. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +103 -0
  240. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +16 -0
  241. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +83 -0
  242. package/dist/Shared/ErkSelect/ErkSelect.d.ts +39 -0
  243. package/dist/Shared/ErkSelect/ErkSelect.js +90 -0
  244. package/dist/Shared/{RoundedSelect/RoundedSelect.stories.d.ts → ErkSelect/ErkSelect.stories.d.ts} +2 -12
  245. package/dist/Shared/ErkSelect/ErkSelect.stories.js +64 -0
  246. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +28 -0
  247. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +56 -0
  248. package/dist/Shared/{RoundedSmartSelect/RoundedSmartSelect.stories.d.ts → ErkSmartSelect/ErkSmartSelect.stories.d.ts} +2 -12
  249. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +167 -0
  250. package/dist/Shared/ErkTextField/ErkTextField.d.ts +26 -0
  251. package/dist/Shared/ErkTextField/ErkTextField.js +111 -0
  252. package/dist/Shared/{RoundedTextField/RoundedTextField.stories.d.ts → ErkTextField/ErkTextField.stories.d.ts} +3 -16
  253. package/dist/Shared/ErkTextField/ErkTextField.stories.js +105 -0
  254. package/dist/Shared/{RoundedTimePicker/RoundedTimePicker.d.ts → ErkTimePicker/ErkTimePicker.d.ts} +6 -16
  255. package/dist/Shared/ErkTimePicker/ErkTimePicker.js +131 -0
  256. package/dist/Shared/InputIcon/InputIcon.d.ts +2 -2
  257. package/dist/Shared/InputIcon/InputIcon.js +25 -48
  258. package/dist/Shared/Loader/Loader.d.ts +0 -1
  259. package/dist/Shared/Loader/Loader.js +6 -18
  260. package/dist/Shared/Navbar/Navbar.d.ts +0 -1
  261. package/dist/Shared/Navbar/Navbar.js +2 -14
  262. package/dist/Shared/Navbar/Navbar.stories.js +2 -2
  263. package/dist/Shared/Rating/Rating.d.ts +3 -5
  264. package/dist/Shared/Rating/Rating.js +4 -27
  265. package/dist/Shared/Rating/Rating.stories.js +13 -19
  266. package/dist/Shared/Rating/Ratings/LikeRating.d.ts +1 -2
  267. package/dist/Shared/Rating/Ratings/LikeRating.js +19 -33
  268. package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +1 -2
  269. package/dist/Shared/Rating/Ratings/SatisfactionRating.js +27 -47
  270. package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +1 -2
  271. package/dist/Shared/Rating/Ratings/ScaleRating.js +23 -54
  272. package/dist/Shared/Toggle/Toggle.d.ts +4 -14
  273. package/dist/Shared/Toggle/Toggle.js +11 -34
  274. package/dist/States/GlobalSlice.d.ts +4 -4
  275. package/dist/States/GlobalSlice.js +6 -17
  276. package/dist/States/SiteSlice.d.ts +30 -48
  277. package/dist/States/SiteSlice.js +58 -76
  278. package/dist/States/WidthStatsSlice.d.ts +2 -2
  279. package/dist/States/WidthStatsSlice.js +8 -9
  280. package/dist/Utils/AxiosAPI.js +3 -3
  281. package/dist/Utils/AxiosWidget.js +4 -4
  282. package/dist/Utils/CBRFunctions.js +29 -30
  283. package/dist/Utils/DraftFunctions.d.ts +3 -3
  284. package/dist/Utils/DraftFunctions.js +102 -143
  285. package/dist/Utils/FormStepFunctions.d.ts +1 -1
  286. package/dist/Utils/FormStepFunctions.js +27 -45
  287. package/dist/Utils/LocaleUtils.d.ts +2 -0
  288. package/dist/Utils/LocaleUtils.js +12 -0
  289. package/dist/Utils/MaterialProviders.d.ts +20 -1
  290. package/dist/Utils/MaterialProviders.js +43 -28
  291. package/dist/Utils/MuiClassnameSetup.js +3 -0
  292. package/dist/Utils/PhoneFunctions.js +5 -5
  293. package/dist/Utils/TestUtils.d.ts +55 -62
  294. package/dist/Utils/TestUtils.js +22 -51
  295. package/dist/Utils/store.d.ts +4 -2
  296. package/dist/Utils/store.js +10 -65
  297. package/dist/Widget.js +15 -26
  298. package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
  299. package/dist/constants/Files/FileExtensions.js +3 -3
  300. package/dist/constants/Files/FileMaxSize.js +1 -1
  301. package/dist/constants/InternalFormStyle.js +1 -1
  302. package/dist/hooks.js +14 -16
  303. package/dist/index.css +4 -0
  304. package/dist/main.d.ts +2 -0
  305. package/dist/main.js +22 -0
  306. package/package.json +108 -124
  307. package/dist/Shared/RoundedButton/RoundedButton.js +0 -45
  308. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +0 -24
  309. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +0 -101
  310. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +0 -50
  311. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +0 -49
  312. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +0 -351
  313. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +0 -223
  314. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +0 -43
  315. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +0 -226
  316. package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +0 -68
  317. package/dist/Shared/RoundedSelect/RoundedSelect.js +0 -214
  318. package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +0 -91
  319. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -63
  320. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +0 -236
  321. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +0 -318
  322. package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +0 -45
  323. package/dist/Shared/RoundedTextField/RoundedTextField.js +0 -175
  324. package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +0 -224
  325. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +0 -314
  326. package/dist/__mocks__/axios.d.ts +0 -2
  327. package/dist/__mocks__/axios.js +0 -2
  328. package/dist/constants/MaterialClassNameSeed.js +0 -1
  329. package/dist/index.js +0 -31
  330. /package/dist/{index.d.ts → App/AppFunctions.test.d.ts} +0 -0
  331. /package/dist/Shared/{RoundedTimePicker/RoundedTimePicker.module.css → ErkTimePicker/ErkTimePicker.module.css} +0 -0
  332. /package/dist/{constants/MaterialClassNameSeed.d.ts → Utils/MuiClassnameSetup.d.ts} +0 -0
  333. /package/dist/{setupTests.d.ts → __tests__/setup.d.ts} +0 -0
  334. /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
+ });
@@ -1,10 +1,10 @@
1
1
  import { Form, Organization } from '../@Types';
2
2
  import { AppProps } from './App';
3
3
  import { Branding } from '../@Types/Branding';
4
- export declare const useSetupApp: (isEmbedded: boolean, { preview, internal, postview, partial, editable, handleConfirmed, customSteps, valuesData, apiKey, formData, classifiers, ...others }: Omit<AppProps, 'isWidget'>) => {
4
+ export declare const useSetupApp: (isEmbedded: boolean, { preview, internal, postview, partial, editable, handleConfirmed, customSteps, valuesData, apiKey, formData, classifiers, ...others }: Omit<AppProps, "isWidget">) => {
5
5
  form: Form | undefined | null;
6
6
  organization: Organization | undefined | null;
7
7
  branding: Branding | undefined;
8
8
  reload: () => void;
9
9
  };
10
- export declare const useLogRocket: (organization: Organization | null | undefined, form: Form | null | undefined, { apiKey, internal, postview, preview, }: Pick<AppProps, 'apiKey' | 'internal' | 'postview' | 'preview'>) => void;
10
+ export declare const useLogRocket: (organization: Organization | null | undefined, form: Form | null | undefined, { apiKey, internal, postview, preview }: Pick<AppProps, "apiKey" | "internal" | "postview" | "preview">) => void;