@arquimedes.co/eureka-forms 3.0.35-test → 3.0.36

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