@arquimedes.co/eureka-forms 3.0.41 → 3.0.43-queue-file

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 (414) hide show
  1. package/dist/@Types/Condition.d.ts +4 -6
  2. package/dist/@Types/Form.d.ts +0 -1
  3. package/dist/@Types/FormStep.d.ts +8 -12
  4. package/dist/@Types/GenericFormSteps.d.ts +8 -0
  5. package/dist/App/App.d.ts +1 -3
  6. package/dist/App/App.js +21 -46
  7. package/dist/App/AppFunctions.d.ts +1 -1
  8. package/dist/App/AppFunctions.js +177 -336
  9. package/dist/App/AppFunctions.test.js +708 -0
  10. package/dist/App/AppHooks.d.ts +2 -2
  11. package/dist/App/AppHooks.js +149 -252
  12. package/dist/App/AppHooks.test.js +154 -0
  13. package/dist/Contexts/CustomContext.d.ts +0 -1
  14. package/dist/Contexts/CustomContext.js +1 -1
  15. package/dist/Contexts/FormContext.d.ts +1 -1
  16. package/dist/Contexts/FormContext.js +3 -2
  17. package/dist/Contexts/SectionContext.d.ts +0 -1
  18. package/dist/Contexts/SectionContext.js +1 -1
  19. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +1 -2
  20. package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +36 -62
  21. package/dist/Form/Form.d.ts +2 -3
  22. package/dist/Form/Form.js +74 -164
  23. package/dist/Form/Form.module.css +0 -9
  24. package/dist/Form/FormFunctions.js +63 -112
  25. package/dist/Form/FormFunctions.test.js +458 -0
  26. package/dist/Form/FormHooks.d.ts +1 -2
  27. package/dist/Form/FormHooks.js +14 -21
  28. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +0 -1
  29. package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +34 -105
  30. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -2
  31. package/dist/Form/FormTypes/StepperForm/StepperForm.js +48 -110
  32. package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +0 -1
  33. package/dist/Form/Section/MaterialSection/MaterialSection.js +10 -23
  34. package/dist/Form/Section/MaterialSection/MaterialSection.module.css +0 -2
  35. package/dist/Form/Section/Section.d.ts +0 -1
  36. package/dist/Form/Section/Section.js +4 -15
  37. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +0 -1
  38. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +30 -65
  39. package/dist/Form/Terms/Term/Term.d.ts +0 -1
  40. package/dist/Form/Terms/Term/Term.js +2 -13
  41. package/dist/Form/Terms/Terms.d.ts +0 -1
  42. package/dist/Form/Terms/Terms.js +17 -29
  43. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +0 -1
  44. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +34 -107
  45. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +0 -1
  46. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
  47. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +0 -1
  48. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +12 -40
  49. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +0 -1
  50. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +66 -93
  51. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/addRecursiveElementStep.d.ts +2 -0
  52. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/addRecursiveElementStep.js +22 -0
  53. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +0 -1
  54. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +45 -115
  55. package/dist/FormSteps/AYFStepMapper.d.ts +0 -1
  56. package/dist/FormSteps/AYFStepMapper.js +60 -137
  57. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +0 -1
  58. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +2 -13
  59. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +0 -1
  60. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +66 -172
  61. package/dist/FormSteps/CBRStepMapper.d.ts +0 -1
  62. package/dist/FormSteps/CBRStepMapper.js +57 -169
  63. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +0 -1
  64. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +2 -13
  65. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +0 -1
  66. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +19 -37
  67. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +0 -1
  68. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +2 -13
  69. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +1 -2
  70. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +50 -81
  71. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +0 -1
  72. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +3 -26
  73. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +0 -1
  74. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +35 -66
  75. package/dist/FormSteps/CustomStep.d.ts +0 -1
  76. package/dist/FormSteps/CustomStep.js +17 -31
  77. package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.d.ts +10 -0
  78. package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.js +14 -0
  79. package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.d.ts +3 -0
  80. package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +34 -0
  81. package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +1 -2
  82. package/dist/FormSteps/DatePickerStep/DatePickerStep.js +2 -13
  83. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +1 -2
  84. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +9 -20
  85. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +0 -1
  86. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +2 -13
  87. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +0 -1
  88. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +16 -32
  89. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +1 -2
  90. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +107 -302
  91. package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +0 -1
  92. package/dist/FormSteps/FileUploadStep/FileUploadStep.js +2 -13
  93. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +0 -1
  94. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +33 -95
  95. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +2 -0
  96. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +3 -0
  97. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +0 -2
  98. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +91 -184
  99. package/dist/FormSteps/MapperStep/MapperStep.d.ts +0 -1
  100. package/dist/FormSteps/MapperStep/MapperStep.js +2 -13
  101. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +0 -1
  102. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +16 -38
  103. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +22 -33
  104. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +0 -1
  105. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +89 -175
  106. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +0 -1
  107. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +20 -47
  108. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +0 -1
  109. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +78 -117
  110. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +1 -2
  111. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +15 -33
  112. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +0 -1
  113. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +2 -13
  114. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +0 -1
  115. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +17 -31
  116. package/dist/FormSteps/RatingStep/RatingStep.d.ts +0 -1
  117. package/dist/FormSteps/RatingStep/RatingStep.js +2 -13
  118. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +0 -1
  119. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +36 -61
  120. package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +0 -1
  121. package/dist/FormSteps/SelectorStep/SelectorStep.js +2 -13
  122. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +0 -1
  123. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -3
  124. package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +0 -1
  125. package/dist/FormSteps/SeparatorStep/SeparatorStep.js +2 -13
  126. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +1 -2
  127. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +81 -155
  128. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +7 -7
  129. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +2 -13
  130. package/dist/FormSteps/Step.d.ts +0 -1
  131. package/dist/FormSteps/Step.js +33 -58
  132. package/dist/FormSteps/StepFunctions.d.ts +4 -6
  133. package/dist/FormSteps/StepFunctions.js +153 -208
  134. package/dist/FormSteps/StepFunctions.test.js +702 -0
  135. package/dist/FormSteps/StepHooks.d.ts +68 -14
  136. package/dist/FormSteps/StepHooks.js +97 -155
  137. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +18 -20
  138. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +0 -1
  139. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +39 -75
  140. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -2
  141. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +12 -28
  142. package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +0 -1
  143. package/dist/FormSteps/TextAreaStep/TextAreaStep.js +3 -14
  144. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -2
  145. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +13 -31
  146. package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +1 -2
  147. package/dist/FormSteps/TextInputStep/TextInputStep.js +2 -13
  148. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +1 -2
  149. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +9 -26
  150. package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +0 -1
  151. package/dist/FormSteps/TimePickerStep/TimePickerStep.js +2 -13
  152. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +0 -1
  153. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +25 -55
  154. package/dist/FormSteps/TitleStep/TitleStep.d.ts +0 -1
  155. package/dist/FormSteps/TitleStep/TitleStep.js +2 -13
  156. package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +1 -2
  157. package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +15 -27
  158. package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.d.ts +1 -0
  159. package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.js +2 -0
  160. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +2 -3
  161. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +8 -23
  162. package/dist/Icons/@ErkIcon.d.ts +14 -0
  163. package/dist/Icons/@ErkIcon.js +9 -0
  164. package/dist/Icons/ArrowLeftIcon.d.ts +3 -0
  165. package/dist/Icons/ArrowLeftIcon.js +7 -0
  166. package/dist/Icons/ArrowRightIcon.d.ts +3 -0
  167. package/dist/Icons/ArrowRightIcon.js +7 -0
  168. package/dist/Icons/CalendarIcon.d.ts +2 -3
  169. package/dist/Icons/CalendarIcon.js +4 -14
  170. package/dist/Icons/CheckCircleIcon.d.ts +3 -0
  171. package/dist/Icons/CheckCircleIcon.js +7 -0
  172. package/dist/Icons/CheckboxCheckedIcon.d.ts +3 -0
  173. package/dist/Icons/CheckboxCheckedIcon.js +7 -0
  174. package/dist/Icons/CheckboxUncheckedIcon.d.ts +3 -0
  175. package/dist/Icons/CheckboxUncheckedIcon.js +7 -0
  176. package/dist/Icons/ClockIcon.d.ts +3 -0
  177. package/dist/Icons/ClockIcon.js +7 -0
  178. package/dist/Icons/CloseIcon.d.ts +3 -0
  179. package/dist/Icons/CloseIcon.js +7 -0
  180. package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
  181. package/dist/Icons/Construction/LeakIcon.js +3 -13
  182. package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
  183. package/dist/Icons/Construction/ProjectIcon.js +3 -13
  184. package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
  185. package/dist/Icons/Construction/PropertyIcon.js +3 -13
  186. package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
  187. package/dist/Icons/Construction/SpaceIcon.js +3 -13
  188. package/dist/Icons/DeleteIcon.d.ts +3 -0
  189. package/dist/Icons/DeleteIcon.js +7 -0
  190. package/dist/Icons/DocumentIcon.d.ts +2 -2
  191. package/dist/Icons/DocumentIcon.js +3 -13
  192. package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
  193. package/dist/Icons/Entities/CheckListIcon.js +3 -13
  194. package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
  195. package/dist/Icons/Entities/GenericEntityIcon.js +5 -15
  196. package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
  197. package/dist/Icons/Entities/HandshakeIcon.js +5 -15
  198. package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
  199. package/dist/Icons/Entities/SupplierIcon.js +5 -15
  200. package/dist/Icons/Entities/WorkIcon.d.ts +3 -0
  201. package/dist/Icons/Entities/WorkIcon.js +7 -0
  202. package/dist/Icons/ErrorIcon.d.ts +3 -0
  203. package/dist/Icons/ErrorIcon.js +7 -0
  204. package/dist/Icons/ExpandLessIcon.d.ts +3 -0
  205. package/dist/Icons/ExpandLessIcon.js +7 -0
  206. package/dist/Icons/ExpandMoreIcon.d.ts +3 -0
  207. package/dist/Icons/ExpandMoreIcon.js +7 -0
  208. package/dist/Icons/FileIcon.d.ts +3 -0
  209. package/dist/Icons/FileIcon.js +7 -0
  210. package/dist/Icons/InfoIcon.d.ts +3 -0
  211. package/dist/Icons/InfoIcon.js +7 -0
  212. package/dist/Icons/LocationIcon.d.ts +2 -3
  213. package/dist/Icons/LocationIcon.js +4 -14
  214. package/dist/Icons/PersonIcon.d.ts +2 -3
  215. package/dist/Icons/PersonIcon.js +6 -16
  216. package/dist/Icons/Ratings/DislikeIcon.d.ts +3 -0
  217. package/dist/Icons/Ratings/DislikeIcon.js +7 -0
  218. package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +3 -0
  219. package/dist/Icons/Ratings/DissatisfiedIcon.js +7 -0
  220. package/dist/Icons/Ratings/LikeIcon.d.ts +3 -0
  221. package/dist/Icons/Ratings/LikeIcon.js +7 -0
  222. package/dist/Icons/Ratings/SatisfiedIcon.d.ts +3 -0
  223. package/dist/Icons/Ratings/SatisfiedIcon.js +7 -0
  224. package/dist/Icons/Ratings/StarIcon.d.ts +3 -0
  225. package/dist/Icons/Ratings/StarIcon.js +7 -0
  226. package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +3 -0
  227. package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +7 -0
  228. package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +3 -0
  229. package/dist/Icons/Ratings/VerySatisfiedIcon.js +7 -0
  230. package/dist/Icons/WarningIcon.d.ts +3 -0
  231. package/dist/Icons/WarningIcon.js +7 -0
  232. package/dist/Init.d.ts +1 -0
  233. package/dist/Init.js +2 -0
  234. package/dist/Services/DraftService.d.ts +14 -14
  235. package/dist/Services/DraftService.js +22 -72
  236. package/dist/Services/FileService.d.ts +1 -1
  237. package/dist/Services/FileService.js +29 -86
  238. package/dist/Services/FormService.js +11 -56
  239. package/dist/Services/OrganizationService.js +11 -62
  240. package/dist/Shared/CustomBtn/CustomBtn.d.ts +1 -2
  241. package/dist/Shared/CustomBtn/CustomBtn.js +25 -88
  242. package/dist/Shared/ErkButton/ErkButton.d.ts +25 -0
  243. package/dist/Shared/ErkButton/ErkButton.js +31 -0
  244. package/dist/Shared/ErkButton/ErkButton.stories.d.ts +16 -0
  245. package/dist/Shared/ErkButton/ErkButton.stories.js +28 -0
  246. package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +19 -0
  247. package/dist/Shared/ErkCheckbox/ErkCheckBox.js +31 -0
  248. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +13 -0
  249. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +34 -0
  250. package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +18 -0
  251. package/dist/Shared/ErkDatePicker/ErkDatePicker.js +277 -0
  252. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +23 -0
  253. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +98 -0
  254. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.d.ts +18 -0
  255. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +180 -0
  256. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.stories.d.ts +36 -0
  257. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.stories.js +274 -0
  258. package/dist/Shared/ErkMenuItem.d.ts +2 -0
  259. package/dist/Shared/ErkMenuItem.js +18 -0
  260. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +17 -0
  261. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +96 -0
  262. package/dist/Shared/ErkSelect/ErkSelect.d.ts +48 -0
  263. package/dist/Shared/ErkSelect/ErkSelect.js +142 -0
  264. package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +21 -0
  265. package/dist/Shared/ErkSelect/ErkSelect.stories.js +87 -0
  266. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +28 -0
  267. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +54 -0
  268. package/dist/Shared/{RoundedSmartSelect/RoundedSmartSelect.stories.d.ts → ErkSmartSelect/ErkSmartSelect.stories.d.ts} +3 -13
  269. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +159 -0
  270. package/dist/Shared/ErkTextField/ErkTextField.d.ts +34 -0
  271. package/dist/Shared/ErkTextField/ErkTextField.js +149 -0
  272. package/dist/Shared/{RoundedTextField/RoundedTextField.stories.d.ts → ErkTextField/ErkTextField.stories.d.ts} +4 -17
  273. package/dist/Shared/ErkTextField/ErkTextField.stories.js +99 -0
  274. package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +32 -0
  275. package/dist/Shared/ErkTimePicker/ErkTimePicker.js +107 -0
  276. package/dist/Shared/InputIcon/InputIcon.d.ts +3 -3
  277. package/dist/Shared/InputIcon/InputIcon.js +29 -112
  278. package/dist/Shared/Loader/Loader.d.ts +0 -1
  279. package/dist/Shared/Loader/Loader.js +6 -18
  280. package/dist/Shared/Navbar/Navbar.d.ts +1 -3
  281. package/dist/Shared/Navbar/Navbar.js +3 -96
  282. package/dist/Shared/Navbar/Navbar.module.css +0 -15
  283. package/dist/Shared/Navbar/Navbar.stories.d.ts +1 -1
  284. package/dist/Shared/Navbar/Navbar.stories.js +2 -2
  285. package/dist/Shared/Rating/Rating.d.ts +3 -5
  286. package/dist/Shared/Rating/Rating.js +4 -27
  287. package/dist/Shared/Rating/Rating.stories.d.ts +1 -1
  288. package/dist/Shared/Rating/Rating.stories.js +13 -19
  289. package/dist/Shared/Rating/Ratings/LikeRating.d.ts +1 -2
  290. package/dist/Shared/Rating/Ratings/LikeRating.js +19 -33
  291. package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +1 -2
  292. package/dist/Shared/Rating/Ratings/SatisfactionRating.js +27 -47
  293. package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +1 -2
  294. package/dist/Shared/Rating/Ratings/ScaleRating.js +23 -54
  295. package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +1 -0
  296. package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +2 -0
  297. package/dist/Shared/SmartDraftRenderer/FormDecorator.d.ts +1 -2
  298. package/dist/Shared/SmartDraftRenderer/FormDecorator.js +8 -22
  299. package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +1 -2
  300. package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +27 -43
  301. package/dist/Shared/Toggle/Toggle.d.ts +5 -14
  302. package/dist/Shared/Toggle/Toggle.js +29 -32
  303. package/dist/States/GlobalSlice.d.ts +7 -12
  304. package/dist/States/GlobalSlice.js +6 -26
  305. package/dist/States/SiteSlice.d.ts +30 -48
  306. package/dist/States/SiteSlice.js +58 -76
  307. package/dist/States/WidthStatsSlice.d.ts +2 -2
  308. package/dist/States/WidthStatsSlice.js +8 -9
  309. package/dist/Utils/AxiosAPI.d.ts +4 -5
  310. package/dist/Utils/AxiosAPI.js +23 -73
  311. package/dist/Utils/AxiosWidget.js +4 -4
  312. package/dist/Utils/CBRFunctions.js +29 -30
  313. package/dist/Utils/DraftFunctions.d.ts +3 -3
  314. package/dist/Utils/DraftFunctions.js +102 -143
  315. package/dist/Utils/FormStepFunctions.d.ts +1 -1
  316. package/dist/Utils/FormStepFunctions.js +27 -45
  317. package/dist/Utils/LocaleUtils.d.ts +2 -0
  318. package/dist/Utils/LocaleUtils.js +12 -0
  319. package/dist/Utils/MaterialProviders.d.ts +21 -1
  320. package/dist/Utils/MaterialProviders.js +46 -28
  321. package/dist/Utils/MuiClassnameSetup.d.ts +1 -0
  322. package/dist/Utils/MuiClassnameSetup.js +3 -0
  323. package/dist/Utils/PhoneFunctions.js +5 -5
  324. package/dist/Utils/StoreContext.js +1 -1
  325. package/dist/Utils/TestUtils.d.ts +60 -81
  326. package/dist/Utils/TestUtils.js +28 -57
  327. package/dist/Utils/_api.d.ts +7 -7
  328. package/dist/Utils/_api.js +10 -8
  329. package/dist/Utils/store.d.ts +9 -17
  330. package/dist/Utils/store.js +15 -74
  331. package/dist/Widget.d.ts +1 -1
  332. package/dist/Widget.js +17 -27
  333. package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
  334. package/dist/constants/{IconTypes.d.ts → ErkIconTypes.d.ts} +2 -4
  335. package/dist/constants/ErkIconTypes.js +16 -0
  336. package/dist/constants/Files/FileExtensions.js +3 -3
  337. package/dist/constants/Files/FileMaxSize.js +1 -1
  338. package/dist/constants/FormStepTypes.d.ts +2 -2
  339. package/dist/constants/FormStepTypes.js +1 -1
  340. package/dist/constants/InternalFormStyle.js +1 -1
  341. package/dist/hooks.d.ts +0 -3
  342. package/dist/hooks.js +14 -77
  343. package/dist/index.css +15 -0
  344. package/dist/index.lib.d.ts +0 -1
  345. package/dist/index.lib.js +0 -1
  346. package/dist/main.d.ts +3 -0
  347. package/dist/main.js +25 -0
  348. package/package.json +111 -125
  349. package/dist/@Types/ErkValue.d.ts +0 -16
  350. package/dist/@Types/User.d.ts +0 -13
  351. package/dist/Icons/@IconTypes.d.ts +0 -7
  352. package/dist/Icons/EmailIcon.d.ts +0 -4
  353. package/dist/Icons/EmailIcon.js +0 -17
  354. package/dist/Icons/Entities/SchoolIcon.d.ts +0 -2
  355. package/dist/Icons/Entities/SchoolIcon.js +0 -17
  356. package/dist/Icons/GroupIcon.d.ts +0 -4
  357. package/dist/Icons/GroupIcon.js +0 -17
  358. package/dist/Icons/LockedIcon.d.ts +0 -4
  359. package/dist/Icons/LockedIcon.js +0 -17
  360. package/dist/Login/Login.module.css +0 -135
  361. package/dist/Login/LoginLayout.module.css +0 -68
  362. package/dist/Login/LoginPage.d.ts +0 -11
  363. package/dist/Login/LoginPage.js +0 -179
  364. package/dist/Login/LoginTextField.d.ts +0 -15
  365. package/dist/Login/LoginTextField.js +0 -134
  366. package/dist/Services/ApiSelectorService.d.ts +0 -39
  367. package/dist/Services/ApiSelectorService.js +0 -244
  368. package/dist/Services/IntegrationService.d.ts +0 -21
  369. package/dist/Services/IntegrationService.js +0 -69
  370. package/dist/Services/UserService.d.ts +0 -10
  371. package/dist/Services/UserService.js +0 -71
  372. package/dist/Shared/RoundedButton/RoundedButton.d.ts +0 -30
  373. package/dist/Shared/RoundedButton/RoundedButton.js +0 -45
  374. package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +0 -23
  375. package/dist/Shared/RoundedButton/RoundedButton.stories.js +0 -36
  376. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +0 -24
  377. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +0 -101
  378. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +0 -21
  379. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +0 -50
  380. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +0 -49
  381. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +0 -351
  382. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +0 -36
  383. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +0 -223
  384. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +0 -43
  385. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +0 -226
  386. package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +0 -68
  387. package/dist/Shared/RoundedSelect/RoundedSelect.js +0 -214
  388. package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +0 -28
  389. package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +0 -91
  390. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -63
  391. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +0 -236
  392. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +0 -318
  393. package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +0 -45
  394. package/dist/Shared/RoundedTextField/RoundedTextField.js +0 -175
  395. package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +0 -224
  396. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +0 -41
  397. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +0 -314
  398. package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +0 -14
  399. package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +0 -60
  400. package/dist/__mocks__/axios.d.ts +0 -2
  401. package/dist/__mocks__/axios.js +0 -2
  402. package/dist/constants/ErkValueTypes.d.ts +0 -6
  403. package/dist/constants/ErkValueTypes.js +0 -7
  404. package/dist/constants/IconTypes.js +0 -18
  405. package/dist/constants/MaterialClassNameSeed.d.ts +0 -1
  406. package/dist/constants/MaterialClassNameSeed.js +0 -1
  407. package/dist/index.js +0 -31
  408. /package/dist/{@Types/ErkValue.js → App/AppFunctions.test.d.ts} +0 -0
  409. /package/dist/{@Types/User.js → App/AppHooks.test.d.ts} +0 -0
  410. /package/dist/{Icons/@IconTypes.js → Form/FormFunctions.test.d.ts} +0 -0
  411. /package/dist/{index.d.ts → FormSteps/StepFunctions.test.d.ts} +0 -0
  412. /package/dist/Shared/{RoundedTimePicker/RoundedTimePicker.module.css → ErkTimePicker/ErkTimePicker.module.css} +0 -0
  413. /package/dist/{setupTests.d.ts → __tests__/setup.d.ts} +0 -0
  414. /package/dist/{setupTests.js → __tests__/setup.js} +0 -0
@@ -25,10 +25,10 @@ interface FormCache {
25
25
  export declare function stringToDraft(text: string): RawDraftContentState;
26
26
  export declare const getRawText: (draft?: RawDraftContentState, text?: string) => RawDraftContentState;
27
27
  export declare function mapDraftEntities(cache: FormCache, draft: EurekaDraft, mapToId?: boolean): RawDraftContentState;
28
- type MappedBlock = {
28
+ interface MappedBlock {
29
29
  text: string;
30
30
  inlineStyleRanges?: RawDraftContentBlock['inlineStyleRanges'];
31
- };
31
+ }
32
32
  export declare const draftEntityMapper: (cache: FormCache, entityData: DraftEntityData, mapToId?: boolean) => MappedBlock;
33
33
  type DraftBlock = EurekaDraft['blocks'][0];
34
34
  /**
@@ -52,5 +52,5 @@ export declare function isAtomicBlock(block: DraftBlock): boolean;
52
52
  */
53
53
  export declare function isEmptyString(str: string): boolean;
54
54
  export declare function getDepthPadding(depth: number): string;
55
- export declare function formStepToString(step: FormStep, value: any | undefined, mapToId?: boolean): string | null;
55
+ export declare function formStepToString(step: FormStep, value: any, mapToId?: boolean): string | null;
56
56
  export {};
@@ -1,18 +1,18 @@
1
1
  import { nanoid } from '@reduxjs/toolkit';
2
- import { DraftEntityDataMappingTypes, DraftEntityDataTypes, } from '../constants/Draft/DraftEntityDataTypes';
2
+ import { DraftEntityDataMappingTypes, DraftEntityDataTypes } from '../constants/Draft/DraftEntityDataTypes';
3
3
  import { DraftEntityTypes } from '../constants/Draft/DraftEntityTypes';
4
4
  import { evaluateCondition } from '../FormSteps/StepFunctions';
5
- import { getLocale } from '../Form/Form';
6
5
  import { TicketPropertyTypes } from '../constants/TicketPropertyTypes';
7
6
  import { format } from 'date-fns';
8
7
  import EntityPropertyTypes from '../constants/EntityPropertyTypes';
9
8
  import FormStepTypes, { RatingTypes } from '../constants/FormStepTypes';
9
+ import { getLocale } from './LocaleUtils';
10
10
  export function stringToDraft(text) {
11
- var draftStructure = {
11
+ const draftStructure = {
12
12
  blocks: [],
13
13
  entityMap: {},
14
14
  };
15
- text.split('\n').forEach(function (element, index) {
15
+ text.split('\n').forEach((element, index) => {
16
16
  draftStructure.blocks.push({
17
17
  key: String(index),
18
18
  text: element,
@@ -25,7 +25,7 @@ export function stringToDraft(text) {
25
25
  });
26
26
  return draftStructure;
27
27
  }
28
- export var getRawText = function (draft, text) {
28
+ export const getRawText = (draft, text) => {
29
29
  if (draft !== undefined) {
30
30
  return draft;
31
31
  }
@@ -49,33 +49,28 @@ export var getRawText = function (draft, text) {
49
49
  };
50
50
  }
51
51
  };
52
- export function mapDraftEntities(cache, draft, mapToId) {
53
- if (mapToId === void 0) { mapToId = false; }
54
- var newBlocks = [];
55
- var _a = JSON.parse(JSON.stringify(draft)), blocks = _a.blocks, entityMap = _a.entityMap;
56
- for (var _i = 0, blocks_1 = blocks; _i < blocks_1.length; _i++) {
57
- var block = blocks_1[_i];
58
- newBlocks.push.apply(newBlocks, setBlockEntities(cache, block, entityMap, mapToId));
52
+ export function mapDraftEntities(cache, draft, mapToId = false) {
53
+ const newBlocks = [];
54
+ const { blocks, entityMap } = JSON.parse(JSON.stringify(draft));
55
+ for (const block of blocks) {
56
+ newBlocks.push(...setBlockEntities(cache, block, entityMap, mapToId));
59
57
  }
60
- return { blocks: blocks, entityMap: entityMap };
58
+ return { blocks, entityMap };
61
59
  }
62
- function setBlockEntities(cache, block, entityMap, mapToId) {
63
- if (mapToId === void 0) { mapToId = false; }
60
+ function setBlockEntities(cache, block, entityMap, mapToId = false) {
64
61
  //Con esta funcion saca el texto remplazado de la entidad
65
- var entities = block.entityRanges.sort(function (s1, s2) { return s2.offset - s1.offset; });
66
- var newEntities = [];
67
- for (var _i = 0, entities_1 = entities; _i < entities_1.length; _i++) {
68
- var entity = entities_1[_i];
69
- var styles = block.inlineStyleRanges.sort(function (s1, s2) { return s2.offset - s1.offset; });
70
- var entityEnd = entity.offset + entity.length - 1;
71
- var entityData = entityMap[entity.key];
62
+ const entities = block.entityRanges.sort((s1, s2) => s2.offset - s1.offset);
63
+ const newEntities = [];
64
+ for (const entity of entities) {
65
+ const styles = block.inlineStyleRanges.sort((s1, s2) => s2.offset - s1.offset);
66
+ const entityEnd = entity.offset + entity.length - 1;
67
+ const entityData = entityMap[entity.key];
72
68
  if (entityData.type === DraftEntityTypes.EUREKA) {
73
- var mappedBlock = draftEntityMapper(cache, entityData.data, mapToId);
74
- var entityText = mappedBlock.text;
75
- var entitySizeDelta = entityText.length - entity.length;
76
- for (var _a = 0, styles_1 = styles; _a < styles_1.length; _a++) {
77
- var style = styles_1[_a];
78
- var styleEnd = style.offset + style.length - 1;
69
+ const mappedBlock = draftEntityMapper(cache, entityData.data, mapToId);
70
+ const entityText = mappedBlock.text;
71
+ const entitySizeDelta = entityText.length - entity.length;
72
+ for (const style of styles) {
73
+ const styleEnd = style.offset + style.length - 1;
79
74
  //revisa si el estilo termina después del inicio del entity, de lo contrario el estilo no se ve afectado por el entity
80
75
  if (styleEnd > entity.offset) {
81
76
  //si el estilo termina en la mitad del entity
@@ -83,10 +78,8 @@ function setBlockEntities(cache, block, entityMap, mapToId) {
83
78
  style.length = entityEnd - style.offset + 1;
84
79
  }
85
80
  //si el estilo empieza en la mitad del entity
86
- if (style.offset < entityEnd &&
87
- style.offset > entity.offset) {
88
- style.length =
89
- style.length + style.offset - entity.offset;
81
+ if (style.offset < entityEnd && style.offset > entity.offset) {
82
+ style.length = style.length + style.offset - entity.offset;
90
83
  style.offset = entity.offset;
91
84
  }
92
85
  //Ahora se modifica el style con base en el tamaño del entityText a reemplazar
@@ -101,56 +94,43 @@ function setBlockEntities(cache, block, entityMap, mapToId) {
101
94
  }
102
95
  }
103
96
  //reemplaza el entity por su text
104
- var originalBlockText = block.text;
97
+ const originalBlockText = block.text;
105
98
  block.text =
106
99
  block.text.substring(0, entity.offset) +
107
100
  entityText +
108
101
  originalBlockText.substring(entityEnd + 1, originalBlockText.length);
109
- block.entityRanges = block.entityRanges.filter(function (entity) {
110
- return newEntities.includes(entity.key);
111
- });
102
+ block.entityRanges = block.entityRanges.filter((entity) => newEntities.includes(entity.key));
112
103
  delete entityMap[entity.key];
113
104
  /** Add new block styles */
114
105
  if (!mappedBlock.inlineStyleRanges)
115
106
  continue;
116
- var _loop_1 = function (style) {
107
+ for (const style of mappedBlock.inlineStyleRanges) {
117
108
  style.offset += entity.offset;
118
109
  /** Obs: no hay estilos(ya existentes) que se partan en la mitad de la entidad! */
119
110
  /** If new style intersects with current style of same type modify the current one */
120
- var currentInStart = block.inlineStyleRanges.find(function (blockStyle) {
121
- return blockStyle.offset <= style.offset &&
122
- blockStyle.offset + blockStyle.length > style.offset &&
123
- blockStyle.style === style.style;
124
- });
111
+ const currentInStart = block.inlineStyleRanges.find((blockStyle) => blockStyle.offset <= style.offset &&
112
+ blockStyle.offset + blockStyle.length > style.offset &&
113
+ blockStyle.style === style.style);
125
114
  if (currentInStart) {
126
115
  //If the current style covers the new style's range, ignore it
127
- if (currentInStart.offset + currentInStart.length >
128
- style.offset + style.length)
129
- return "continue";
116
+ if (currentInStart.offset + currentInStart.length > style.offset + style.length)
117
+ continue;
130
118
  else {
131
119
  //Modify the current style to cover the new style's range
132
- currentInStart.length =
133
- style.offset + style.length - currentInStart.offset;
134
- return "continue";
120
+ currentInStart.length = style.offset + style.length - currentInStart.offset;
121
+ continue;
135
122
  }
136
123
  }
137
- var currentInEnd = block.inlineStyleRanges.find(function (blockStyle) {
138
- return blockStyle.offset < style.offset + style.length &&
139
- blockStyle.offset + blockStyle.length >
140
- style.offset + style.length &&
141
- blockStyle.style === style.style;
142
- });
124
+ const currentInEnd = block.inlineStyleRanges.find((blockStyle) => blockStyle.offset < style.offset + style.length &&
125
+ blockStyle.offset + blockStyle.length > style.offset + style.length &&
126
+ blockStyle.style === style.style);
143
127
  if (currentInEnd) {
144
128
  if (currentInEnd.offset < style.offset)
145
- return "continue";
129
+ continue;
146
130
  currentInEnd.offset = style.offset;
147
- return "continue";
131
+ continue;
148
132
  }
149
133
  block.inlineStyleRanges.push(style);
150
- };
151
- for (var _b = 0, _c = mappedBlock.inlineStyleRanges; _b < _c.length; _b++) {
152
- var style = _c[_b];
153
- _loop_1(style);
154
134
  }
155
135
  //No filtrar sino cambiar? o poner en estado "Mappeado?"
156
136
  //Actualmente el draft queda sin entityMap y sin entityRanges en los bloques. para cambiarlo quitar el delete y el filter
@@ -162,97 +142,89 @@ function setBlockEntities(cache, block, entityMap, mapToId) {
162
142
  block.entityRanges = newEntities;
163
143
  return [block];
164
144
  }
165
- export var draftEntityMapper = function (cache, entityData, mapToId) {
166
- var _a;
167
- if (mapToId === void 0) { mapToId = false; }
168
- if (entityData.condition &&
169
- entityData.type !== DraftEntityDataTypes.CONDITION_MET) {
145
+ export const draftEntityMapper = (cache, entityData, mapToId = false) => {
146
+ if (entityData.condition && entityData.type !== DraftEntityDataTypes.CONDITION_MET) {
170
147
  if (!evaluateCondition(entityData.condition, cache.dependencies))
171
148
  return { text: '' };
172
149
  }
173
- var value = entityMapper(cache, entityData, mapToId);
174
- if (!(value === null || value === void 0 ? void 0 : value.text) && entityData.fallback) {
150
+ let value = entityMapper(cache, entityData, mapToId);
151
+ if (!value?.text && entityData.fallback) {
175
152
  value = { text: entityData.fallback };
176
153
  }
177
- if ((value === null || value === void 0 ? void 0 : value.text) && entityData.prefix) {
154
+ if (value?.text && entityData.prefix) {
178
155
  value.text = entityData.prefix + value.text;
179
156
  }
180
- if ((value === null || value === void 0 ? void 0 : value.text) && entityData.suffix) {
157
+ if (value?.text && entityData.suffix) {
181
158
  value.text = value.text + entityData.suffix;
182
159
  }
183
160
  return {
184
- text: (_a = value === null || value === void 0 ? void 0 : value.text) !== null && _a !== void 0 ? _a : '',
185
- inlineStyleRanges: value === null || value === void 0 ? void 0 : value.inlineStyleRanges,
161
+ text: value?.text ?? '',
162
+ inlineStyleRanges: value?.inlineStyleRanges,
186
163
  };
187
164
  };
188
- var entityMapper = function (cache, entityData, mapToId) {
189
- var _a, _b, _c, _d, _e, _f, _g;
190
- if (mapToId === void 0) { mapToId = false; }
165
+ const entityMapper = (cache, entityData, mapToId = false) => {
191
166
  switch (entityData.type) {
192
167
  case DraftEntityDataTypes.CONDITION_MET: {
193
168
  if (evaluateCondition(entityData.condition, cache.dependencies)) {
194
- return { text: (_a = entityData.ifTrue) !== null && _a !== void 0 ? _a : 'Sí' };
169
+ return { text: entityData.ifTrue ?? 'Sí' };
195
170
  }
196
- return { text: (_b = entityData.ifFalse) !== null && _b !== void 0 ? _b : 'No' };
171
+ return { text: entityData.ifFalse ?? 'No' };
197
172
  }
198
173
  case DraftEntityDataMappingTypes.ENTITYVALUE_MAPPING: {
199
- if (!(cache === null || cache === void 0 ? void 0 : cache.entityValue))
174
+ if (!cache?.entityValue)
200
175
  throw new Error('Invalid EntityValue Mapping');
201
- var property = (_c = cache.entity) === null || _c === void 0 ? void 0 : _c.steps[entityData.idProperty];
176
+ const property = cache.entity?.steps[entityData.idProperty];
202
177
  if (!property)
203
178
  return null;
204
- var text = calcEntityProperty(property, cache.entityValue[entityData.idProperty]);
205
- return text ? { text: text } : null;
179
+ const text = calcEntityProperty(property, cache.entityValue[entityData.idProperty]);
180
+ return text ? { text } : null;
206
181
  }
207
182
  case DraftEntityDataTypes.COMPANY: {
208
- var company = cache.company;
183
+ const company = cache.company;
209
184
  if (company) {
210
- var property = (_d = cache.entity) === null || _d === void 0 ? void 0 : _d.steps[entityData.idProperty];
185
+ const property = cache.entity?.steps[entityData.idProperty];
211
186
  if (!property)
212
187
  return null;
213
- var text = calcEntityProperty(property, company[entityData.idProperty]);
214
- return text ? { text: text } : null;
188
+ const text = calcEntityProperty(property, company[entityData.idProperty]);
189
+ return text ? { text } : null;
215
190
  }
216
191
  break;
217
192
  }
218
193
  case DraftEntityDataTypes.TICKET: {
219
- var text = calcTicketProperty(cache, entityData);
220
- return text ? { text: text } : null;
194
+ const text = calcTicketProperty(cache, entityData);
195
+ return text ? { text } : null;
221
196
  }
222
197
  case DraftEntityDataTypes.NESTED: {
223
- var blocks = setBlockEntities(cache, JSON.parse(JSON.stringify(entityData.block)), JSON.parse(JSON.stringify(entityData.entityMap)));
224
- var block = { text: '', inlineStyleRanges: [] };
225
- for (var i = 0; i < blocks.length; i++) {
226
- var nested = blocks[i];
198
+ const blocks = setBlockEntities(cache, JSON.parse(JSON.stringify(entityData.block)), JSON.parse(JSON.stringify(entityData.entityMap)));
199
+ const block = { text: '', inlineStyleRanges: [] };
200
+ for (let i = 0; i < blocks.length; i++) {
201
+ const nested = blocks[i];
227
202
  if (i > 0)
228
203
  block.text += ' ';
229
- var offset = block.text.length;
204
+ const offset = block.text.length;
230
205
  block.text += nested.text;
231
- for (var _i = 0, _h = nested.inlineStyleRanges; _i < _h.length; _i++) {
232
- var style = _h[_i];
206
+ for (const style of nested.inlineStyleRanges) {
233
207
  style.offset += offset;
234
- (_e = block.inlineStyleRanges) === null || _e === void 0 ? void 0 : _e.push(style);
208
+ block.inlineStyleRanges?.push(style);
235
209
  }
236
210
  }
237
211
  return block;
238
212
  }
239
213
  case DraftEntityDataTypes.FORM_STEP: {
240
- var step = cache.form.steps[entityData.idStep];
214
+ const step = cache.form.steps[entityData.idStep];
241
215
  if (!step)
242
216
  return null;
243
- var text = formStepToString(step, (_f = cache.dependencies[step.id]) === null || _f === void 0 ? void 0 : _f.value, mapToId);
217
+ const text = formStepToString(step, cache.dependencies[step.id]?.value, mapToId);
244
218
  if (text === null)
245
219
  return null;
246
- return { text: text, inlineStyleRanges: [] };
220
+ return { text, inlineStyleRanges: [] };
247
221
  }
248
222
  case DraftEntityDataTypes.DATE: {
249
- var millis = entityData.days * 86400000 +
250
- entityData.hours * 3600000 +
251
- entityData.minutes * 60000;
252
- var subtract = false;
253
- var date = new Date(new Date().getTime() + (subtract ? -millis : millis));
223
+ const millis = entityData.days * 86400000 + entityData.hours * 3600000 + entityData.minutes * 60000;
224
+ const subtract = false;
225
+ const date = new Date(new Date().getTime() + (subtract ? -millis : millis));
254
226
  return {
255
- text: format(date, (_g = entityData.format) !== null && _g !== void 0 ? _g : 'Pp', {
227
+ text: format(date, entityData.format ?? 'Pp', {
256
228
  locale: getLocale(),
257
229
  }),
258
230
  };
@@ -263,11 +235,10 @@ var entityMapper = function (cache, entityData, mapToId) {
263
235
  return null;
264
236
  };
265
237
  function calcTicketProperty(cache, entityData) {
266
- var _a, _b;
267
- var property = entityData.property;
238
+ const property = entityData.property;
268
239
  switch (property) {
269
240
  case TicketPropertyTypes.CASENUMBER:
270
- return (_b = (_a = cache.ticket) === null || _a === void 0 ? void 0 : _a.caseNumber) !== null && _b !== void 0 ? _b : null;
241
+ return cache.ticket?.caseNumber ?? null;
271
242
  default:
272
243
  break;
273
244
  }
@@ -297,14 +268,13 @@ function calcEntityProperty(property, value) {
297
268
  /**
298
269
  * The function will generate text for given draftjs editorContent.
299
270
  */
300
- export function draftToString(cache, draft, mapToId) {
301
- if (mapToId === void 0) { mapToId = false; }
302
- var text = [];
271
+ export function draftToString(cache, draft, mapToId = false) {
272
+ const text = [];
303
273
  if (draft) {
304
- var _a = JSON.parse(JSON.stringify(draft)), blocks_2 = _a.blocks, entityMap_1 = _a.entityMap;
305
- if (blocks_2 && blocks_2.length > 0) {
306
- blocks_2.forEach(function (block) {
307
- var content = getBlockText(cache, block, entityMap_1, blocks_2.length === 1, mapToId);
274
+ const { blocks, entityMap } = JSON.parse(JSON.stringify(draft));
275
+ if (blocks && blocks.length > 0) {
276
+ blocks.forEach((block) => {
277
+ let content = getBlockText(cache, block, entityMap, blocks.length === 1, mapToId);
308
278
  if (isList(block.type)) {
309
279
  content = getDepthPadding(block.depth) + content;
310
280
  }
@@ -312,7 +282,7 @@ export function draftToString(cache, draft, mapToId) {
312
282
  });
313
283
  }
314
284
  }
315
- var response = text.join('');
285
+ const response = text.join('');
316
286
  if (response === '\n') {
317
287
  return '';
318
288
  }
@@ -321,10 +291,8 @@ export function draftToString(cache, draft, mapToId) {
321
291
  /**
322
292
  * Function will return text for the block.
323
293
  */
324
- function getBlockText(cache, block, entityMap, skipNextLine, mapToId) {
325
- if (skipNextLine === void 0) { skipNextLine = false; }
326
- if (mapToId === void 0) { mapToId = false; }
327
- var blockMarkdown = [];
294
+ function getBlockText(cache, block, entityMap, skipNextLine = false, mapToId = false) {
295
+ const blockMarkdown = [];
328
296
  blockMarkdown.push(getBlockContentText(cache, block, entityMap, mapToId));
329
297
  if (!isAtomicBlock(block) && !skipNextLine)
330
298
  blockMarkdown.push('\n');
@@ -333,8 +301,7 @@ function getBlockText(cache, block, entityMap, skipNextLine, mapToId) {
333
301
  /**
334
302
  * Function will return the text for block content.
335
303
  */
336
- function getBlockContentText(cache, block, entityMap, mapToId) {
337
- if (mapToId === void 0) { mapToId = false; }
304
+ function getBlockContentText(cache, block, entityMap, mapToId = false) {
338
305
  if (isAtomicBlock(block)) {
339
306
  return getEntityText(entityMap, block.entityRanges[0].key, block.text);
340
307
  }
@@ -345,14 +312,14 @@ function getBlockContentText(cache, block, entityMap, mapToId) {
345
312
  * Function to check if a block is of type list.
346
313
  */
347
314
  export function isList(blockType) {
348
- return (blockType === 'unordered-list-item' || blockType === 'ordered-list-item');
315
+ return blockType === 'unordered-list-item' || blockType === 'ordered-list-item';
349
316
  }
350
317
  /**
351
318
  * Function will return text for Entity.
352
319
  */
353
320
  export function getEntityText(entityMap, entityKey, blockText) {
354
- var entity = entityMap[entityKey];
355
- if (entity && entity.type === 'EUREKA') {
321
+ const entity = entityMap[entityKey];
322
+ if (entity && entity.type === DraftEntityTypes.EUREKA) {
356
323
  return blockText;
357
324
  }
358
325
  return '';
@@ -370,44 +337,38 @@ export function isAtomicBlock(block) {
370
337
  * The function returns true if the string passed to it has no content.
371
338
  */
372
339
  export function isEmptyString(str) {
373
- if (str === undefined ||
374
- str === null ||
375
- str.length === 0 ||
376
- str.trim().length === 0) {
340
+ if (str === undefined || str === null || str.length === 0 || str.trim().length === 0) {
377
341
  return true;
378
342
  }
379
343
  return false;
380
344
  }
381
345
  export function getDepthPadding(depth) {
382
- var padding = '';
383
- for (var i = 0; i < depth * 4; i += 1) {
346
+ let padding = '';
347
+ for (let i = 0; i < depth * 4; i += 1) {
384
348
  padding += ' ';
385
349
  }
386
350
  return padding;
387
351
  }
388
- export function formStepToString(step, value, mapToId) {
389
- if (mapToId === void 0) { mapToId = false; }
352
+ export function formStepToString(step, value, mapToId = false) {
390
353
  if (value === undefined || value === null)
391
354
  return null;
392
355
  switch (step.type) {
393
356
  case FormStepTypes.TIMEPICKER: {
394
- var time = value;
395
- var parts = [];
357
+ const time = value;
358
+ const parts = [];
396
359
  if (time.days) {
397
- parts.push("".concat(time.days, " d\u00EDa").concat(time.days > 1 ? 's' : ''));
360
+ parts.push(`${time.days} día${time.days > 1 ? 's' : ''}`);
398
361
  }
399
362
  if (time.hours) {
400
- parts.push("".concat(time.hours, " hora").concat(time.hours > 1 ? 's' : ''));
363
+ parts.push(`${time.hours} hora${time.hours > 1 ? 's' : ''}`);
401
364
  }
402
365
  if (time.minutes) {
403
- parts.push("".concat(time.minutes, " minuto").concat(time.minutes > 1 ? 's' : ''));
366
+ parts.push(`${time.minutes} minuto${time.minutes > 1 ? 's' : ''}`);
404
367
  }
405
368
  if (parts.length === 0)
406
- return time.working
407
- ? 'horario hábil más cercano'
408
- : 'inmediatamente';
369
+ return time.working ? 'horario hábil más cercano' : 'inmediatamente';
409
370
  if (time.working) {
410
- var isMultiple = parts.length > 1 || parts[0].includes('s');
371
+ const isMultiple = parts.length > 1 || parts[0].includes('s');
411
372
  return parts.join(', ') + (isMultiple ? ' hábiles' : 'hábil');
412
373
  }
413
374
  return parts.join(', ');
@@ -436,9 +397,7 @@ export function formStepToString(step, value, mapToId) {
436
397
  return value[step.labelAttribute];
437
398
  return null;
438
399
  case FormStepTypes.FILEUPLOAD: {
439
- return value
440
- .map(function (file) { var _a; return (_a = file.fileName) !== null && _a !== void 0 ? _a : 'Archivo'; })
441
- .join(', ');
400
+ return value.map((file) => file.fileName ?? 'Archivo').join(', ');
442
401
  }
443
402
  case FormStepTypes.RATING:
444
403
  switch (step.ratingType) {
@@ -12,4 +12,4 @@ export declare const calcRecursiveCondition: (condition: Condition, ids: Record<
12
12
  * @param idModifier optional modifier for the ids of the substeps and all other properties
13
13
  * @returns list of the ids of the substeps of the step, if modifier returns modified steps
14
14
  */
15
- export declare const calcSubSteps: (idStep: string, allSteps: Record<string, FormStep | CBRFormStep | AYFFormStep>, idModifier?: ((idSubStep: string) => string) | undefined) => string[];
15
+ export declare const calcSubSteps: (idStep: string, allSteps: Record<string, FormStep | CBRFormStep | AYFFormStep>, idModifier?: (idSubStep: string) => string) => string[];
@@ -1,12 +1,3 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
- if (ar || !(i in from)) {
4
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
- ar[i] = from[i];
6
- }
7
- }
8
- return to.concat(ar || Array.prototype.slice.call(from));
9
- };
10
1
  import AYFFormStepTypes from '../constants/AYFFormStepTypes';
11
2
  import CBRFormStepTypes from '../constants/CBRFormStepTypes';
12
3
  import ConditionTypes from '../constants/ConditionTypes';
@@ -14,38 +5,36 @@ import FormStepTypes, { ClassifierOptionTypes, EntityValueDataTypes, EntityValue
14
5
  export function calcRecursiveData(element, newSteps, customSteps) {
15
6
  if (!newSteps)
16
7
  return;
17
- for (var _i = 0, _a = Object.entries(newSteps); _i < _a.length; _i++) {
18
- var _b = _a[_i], idStep = _b[0], step = _b[1];
8
+ for (const [idStep, step] of Object.entries(newSteps)) {
19
9
  step.id = idStep;
20
10
  if (step.dependencies) {
21
- for (var i = 0; i < step.dependencies.length; i++) {
22
- var idDep = step.dependencies[i];
23
- var newId = element.ids[idDep];
11
+ for (let i = 0; i < step.dependencies.length; i++) {
12
+ const idDep = step.dependencies[i];
13
+ const newId = element.ids[idDep];
24
14
  if (newId) {
25
15
  step.dependencies[i] = newId;
26
16
  }
27
17
  }
28
18
  }
29
- var custom = customSteps[step === null || step === void 0 ? void 0 : step.type];
30
- if (custom === null || custom === void 0 ? void 0 : custom.calcRecursiveData) {
19
+ const custom = customSteps[step?.type];
20
+ if (custom?.calcRecursiveData) {
31
21
  custom.calcRecursiveData(step, element.ids);
32
22
  }
33
23
  if (step.condition) {
34
24
  calcRecursiveCondition(step.condition, element.ids);
35
25
  }
36
- calcSubSteps(step.id, newSteps, function (idStep) { var _a; return (_a = element.ids[idStep]) !== null && _a !== void 0 ? _a : idStep; });
26
+ calcSubSteps(step.id, newSteps, (idStep) => element.ids[idStep] ?? idStep);
37
27
  }
38
28
  }
39
- export var calcRecursiveCondition = function (condition, ids) {
29
+ export const calcRecursiveCondition = (condition, ids) => {
40
30
  switch (condition.type) {
41
31
  case ConditionTypes.EXPRESSION:
42
- for (var _i = 0, _a = condition.conditions; _i < _a.length; _i++) {
43
- var subCondition = _a[_i];
32
+ for (const subCondition of condition.conditions) {
44
33
  calcRecursiveCondition(subCondition, ids);
45
34
  }
46
35
  break;
47
36
  case ConditionTypes.FORM_STEP: {
48
- var newId = ids[condition.idStep];
37
+ const newId = ids[condition.idStep];
49
38
  if (newId) {
50
39
  condition.idStep = newId;
51
40
  }
@@ -61,24 +50,22 @@ export var calcRecursiveCondition = function (condition, ids) {
61
50
  * @param idModifier optional modifier for the ids of the substeps and all other properties
62
51
  * @returns list of the ids of the substeps of the step, if modifier returns modified steps
63
52
  */
64
- export var calcSubSteps = function (idStep, allSteps, idModifier) {
65
- var _a;
66
- var step = allSteps[idStep];
67
- var subSteps = [];
53
+ export const calcSubSteps = (idStep, allSteps, idModifier) => {
54
+ const step = allSteps[idStep];
55
+ const subSteps = [];
68
56
  if (!step)
69
57
  return [];
70
- var handleSteps = function (steps) {
71
- for (var i = 0; i < steps.length; i++) {
72
- var idSubStep = steps[i];
58
+ const handleSteps = (steps) => {
59
+ for (let i = 0; i < steps.length; i++) {
60
+ const idSubStep = steps[i];
73
61
  if (idModifier)
74
62
  steps[i] = idModifier(steps[i]);
75
- subSteps.push.apply(subSteps, __spreadArray([idSubStep], calcSubSteps(idSubStep, allSteps, idModifier), false));
63
+ subSteps.push(idSubStep, ...calcSubSteps(idSubStep, allSteps, idModifier));
76
64
  }
77
65
  };
78
66
  switch (step.type) {
79
67
  case FormStepTypes.SELECTOR: {
80
- for (var _i = 0, _b = step.options; _i < _b.length; _i++) {
81
- var option = _b[_i];
68
+ for (const option of step.options) {
82
69
  if (option.type === OptionTypes.NESTED) {
83
70
  handleSteps(option.steps);
84
71
  }
@@ -86,9 +73,8 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
86
73
  break;
87
74
  }
88
75
  case FormStepTypes.CLASSIFIER_SELECTOR:
89
- for (var _c = 0, _d = Object.keys(step.options); _c < _d.length; _c++) {
90
- var idOption = _d[_c];
91
- var option = step.options[idOption];
76
+ for (const idOption of Object.keys(step.options)) {
77
+ const option = step.options[idOption];
92
78
  if (option.type === ClassifierOptionTypes.NESTED) {
93
79
  handleSteps(option.steps);
94
80
  }
@@ -96,8 +82,7 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
96
82
  break;
97
83
  case FormStepTypes.RATING:
98
84
  if (step.nestedSteps) {
99
- for (var _e = 0, _f = step.nestedSteps; _e < _f.length; _e++) {
100
- var steps = _f[_e];
85
+ for (const steps of step.nestedSteps) {
101
86
  handleSteps(steps);
102
87
  }
103
88
  }
@@ -115,22 +100,19 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
115
100
  }
116
101
  case FormStepTypes.ENTITYVALUEPICKER:
117
102
  if (idModifier) {
118
- for (var _g = 0, _h = step.path; _g < _h.length; _g++) {
119
- var path = _h[_g];
103
+ for (const path of step.path) {
120
104
  if (path.type === EntityValueDataTypes.STEP) {
121
105
  path.idStep = idModifier(path.idStep);
122
106
  }
123
107
  }
124
- for (var _j = 0, _k = step.filters; _j < _k.length; _j++) {
125
- var filter = _k[_j];
108
+ for (const filter of step.filters) {
126
109
  if (filter.type === EntityValueDataTypes.STEP) {
127
110
  filter.idStep = idModifier(filter.idStep);
128
111
  }
129
112
  }
130
113
  }
131
- for (var _l = 0, _m = Object.keys((_a = step.options) !== null && _a !== void 0 ? _a : {}); _l < _m.length; _l++) {
132
- var idOption = _m[_l];
133
- var option = step.options[idOption];
114
+ for (const idOption of Object.keys(step.options ?? {})) {
115
+ const option = step.options[idOption];
134
116
  if (option.type === EntityValueOptionTypes.NESTED) {
135
117
  handleSteps(option.steps);
136
118
  }
@@ -138,7 +120,7 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
138
120
  break;
139
121
  case CBRFormStepTypes.CBR_LOCATIVAS:
140
122
  {
141
- var elementStep = step;
123
+ const elementStep = step;
142
124
  if (elementStep.subStep) {
143
125
  if (idModifier)
144
126
  elementStep.subStep = idModifier(elementStep.subStep);
@@ -147,7 +129,7 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
147
129
  }
148
130
  break;
149
131
  case AYFFormStepTypes.AYF_ICA_CITY: {
150
- var cityStep = step;
132
+ const cityStep = step;
151
133
  if (cityStep.idNitStep) {
152
134
  if (idModifier)
153
135
  cityStep.idNitStep = idModifier(cityStep.idNitStep);
@@ -0,0 +1,2 @@
1
+ import { Locale } from 'date-fns';
2
+ export declare const getLocale: () => Locale;