contentoh-components-library 21.5.35 → 21.5.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 (989) hide show
  1. package/.storybook/main.js +10 -10
  2. package/.storybook/preview-head.html +4 -4
  3. package/.storybook/preview.js +9 -9
  4. package/CHANGELOG.md +115 -115
  5. package/README.md +70 -70
  6. package/dist/assets/fonts/avenirnext/AvenirNextLTPro-Bold.otf +0 -0
  7. package/dist/assets/fonts/avenirnext/AvenirNextLTPro-It.otf +0 -0
  8. package/dist/assets/fonts/avenirnext/AvenirNextLTPro-Regular.otf +0 -0
  9. package/dist/assets/fonts/lato/Lato-Bold.ttf +0 -0
  10. package/dist/assets/fonts/lato/Lato-Italic.ttf +0 -0
  11. package/dist/assets/fonts/lato/Lato-Light.ttf +0 -0
  12. package/dist/assets/fonts/lato/Lato-Regular.ttf +0 -0
  13. package/dist/assets/fonts/lato/Lato-Thin.ttf +0 -0
  14. package/dist/assets/fonts/lato/OFL.txt +93 -0
  15. package/dist/assets/fonts/raleway/Raleway-Black.ttf +0 -0
  16. package/dist/assets/fonts/raleway/Raleway-Bold.ttf +0 -0
  17. package/dist/assets/fonts/raleway/Raleway-ExtraBold.ttf +0 -0
  18. package/dist/assets/fonts/raleway/Raleway-Italic.ttf +0 -0
  19. package/dist/assets/fonts/raleway/Raleway-Medium.ttf +0 -0
  20. package/dist/assets/fonts/raleway/Raleway-Regular.ttf +0 -0
  21. package/dist/assets/fonts/raleway/Raleway-SemiBold.ttf +0 -0
  22. package/dist/assets/fonts/roboto/Roboto-Black.ttf +0 -0
  23. package/dist/assets/fonts/roboto/Roboto-BlackItalic.ttf +0 -0
  24. package/dist/assets/fonts/roboto/Roboto-Bold.ttf +0 -0
  25. package/dist/assets/fonts/roboto/Roboto-BoldItalic.ttf +0 -0
  26. package/dist/assets/fonts/roboto/Roboto-Italic.ttf +0 -0
  27. package/dist/assets/fonts/roboto/Roboto-Light.ttf +0 -0
  28. package/dist/assets/fonts/roboto/Roboto-LightItalic.ttf +0 -0
  29. package/dist/assets/fonts/roboto/Roboto-Medium.ttf +0 -0
  30. package/dist/assets/fonts/roboto/Roboto-MediumItalic.ttf +0 -0
  31. package/dist/assets/fonts/roboto/Roboto-Regular.ttf +0 -0
  32. package/dist/assets/fonts/roboto/Roboto-Thin.ttf +0 -0
  33. package/dist/assets/fonts/roboto/Roboto-ThinItalic.ttf +0 -0
  34. package/dist/assets/images/Icons/DownloadIcon.svg +4 -0
  35. package/dist/assets/images/Icons/Spinner.gif +0 -0
  36. package/dist/assets/images/Icons/addv2.svg +8 -0
  37. package/dist/assets/images/Icons/beenhere.svg +9 -0
  38. package/dist/assets/images/Icons/checkv2.svg +8 -0
  39. package/dist/assets/images/Icons/close-magenta.svg +9 -0
  40. package/dist/assets/images/Icons/close.svg +8 -0
  41. package/dist/assets/images/Icons/closeCircle.svg +8 -0
  42. package/dist/assets/images/Icons/delete-forever-red.svg +9 -0
  43. package/dist/assets/images/Icons/delete-forever-white.svg +10 -0
  44. package/dist/assets/images/Icons/edit.svg +8 -0
  45. package/dist/assets/images/Icons/fullscreen.svg +3 -0
  46. package/dist/assets/images/Icons/info.svg +8 -0
  47. package/dist/assets/images/Icons/infoNR.svg +8 -0
  48. package/dist/assets/images/Icons/options.svg +3 -0
  49. package/dist/assets/images/Icons/save-white-gray.svg +9 -0
  50. package/dist/assets/images/Icons/save-white.svg +9 -0
  51. package/dist/assets/images/Icons/save.svg +8 -0
  52. package/dist/assets/images/Icons/search.svg +3 -0
  53. package/dist/assets/images/Icons/settings.svg +8 -0
  54. package/dist/assets/images/Icons/trash.svg +8 -0
  55. package/dist/assets/images/Icons/undo.svg +8 -0
  56. package/dist/assets/images/Icons/upload-file-white.svg +4 -0
  57. package/dist/assets/images/Icons/upload-file.svg +10 -0
  58. package/dist/assets/images/Icons/upload_file.svg +10 -0
  59. package/dist/assets/images/Icons/warningv2.svg +3 -0
  60. package/dist/assets/images/activedFilter/removeFilter.svg +3 -0
  61. package/dist/assets/images/arrow/arrowIcon.svg +3 -0
  62. package/dist/assets/images/arrow/polygon.svg +3 -0
  63. package/dist/assets/images/asignationOptions/availableIcon.svg +3 -0
  64. package/dist/assets/images/asignationOptions/removeAsigned.svg +4 -0
  65. package/dist/assets/images/asignationOptions/requestToProvider.svg +3 -0
  66. package/dist/assets/images/asignationOptions/requestToTeam.svg +3 -0
  67. package/dist/assets/images/card/masterCardIcon.svg +5 -0
  68. package/dist/assets/images/carouselImagesLogin/login2.svg +117 -0
  69. package/dist/assets/images/carouselImagesLogin/login3.svg +147 -0
  70. package/dist/assets/images/carouselImagesLogin/loginImage.svg +301 -0
  71. package/dist/assets/images/checkBox/checked.svg +3 -0
  72. package/dist/assets/images/checkBox/checkrosa.svg +3 -0
  73. package/dist/assets/images/checkBox/checkverde.svg +3 -0
  74. package/dist/assets/images/checkBox/unchecked.svg +3 -0
  75. package/dist/assets/images/componentAssigned/assignedImage1.svg +9 -0
  76. package/dist/assets/images/componentAssigned/assignedImage2.svg +9 -0
  77. package/dist/assets/images/componentAssigned/clock.svg +4 -0
  78. package/dist/assets/images/componentAssigned/flag.svg +3 -0
  79. package/dist/assets/images/customSelect/searchIcon.png +0 -0
  80. package/dist/assets/images/customSelect/starIcon.svg +14 -0
  81. package/dist/assets/images/defaultImages/Spinner.gif +0 -0
  82. package/dist/assets/images/defaultImages/check_circle.svg +10 -0
  83. package/dist/assets/images/defaultImages/defaultProductImage.png +0 -0
  84. package/dist/assets/images/defaultImages/defaultProfileImage.svg +13 -0
  85. package/dist/assets/images/defaultImages/defaultUpdate.png +0 -0
  86. package/dist/assets/images/defaultImages/notFound.svg +124 -0
  87. package/dist/assets/images/dropDownButton/dropDownArrowButton.svg +3 -0
  88. package/dist/assets/images/editField/editField.svg +3 -0
  89. package/dist/assets/images/editField/showPassword.png +0 -0
  90. package/dist/assets/images/flags/highPriority.svg +3 -0
  91. package/dist/assets/images/flags/lowPriority.svg +3 -0
  92. package/dist/assets/images/flags/mediumPriority.svg +3 -0
  93. package/dist/assets/images/flags/noPriority.svg +3 -0
  94. package/dist/assets/images/flagsv2/highPriority.svg +3 -0
  95. package/dist/assets/images/flagsv2/lowPriority.svg +3 -0
  96. package/dist/assets/images/flagsv2/mediumPriority.svg +3 -0
  97. package/dist/assets/images/flagsv2/noPriority.svg +3 -0
  98. package/dist/assets/images/generalButton/Icono AB.svg +14 -0
  99. package/dist/assets/images/generalButton/acceptIcon.svg +3 -0
  100. package/dist/assets/images/generalButton/closeIcon.svg +4 -0
  101. package/dist/assets/images/generalButton/closeIconWhite.svg +4 -0
  102. package/dist/assets/images/generalButton/closeIconv2.svg +4 -0
  103. package/dist/assets/images/generalButton/deleteIcon.svg +13 -0
  104. package/dist/assets/images/generalButton/deleteIconHover.svg +13 -0
  105. package/dist/assets/images/generalButton/downloadIcon.svg +3 -0
  106. package/dist/assets/images/generalButton/gridLayout.svg +3 -0
  107. package/dist/assets/images/generalButton/nullIcon.svg +3 -0
  108. package/dist/assets/images/generalButton/openModal.svg +3 -0
  109. package/dist/assets/images/generalButton/rejectIcon.svg +3 -0
  110. package/dist/assets/images/generalButton/rowLayout.svg +3 -0
  111. package/dist/assets/images/generalButton/saveIcon.svg +3 -0
  112. package/dist/assets/images/generalButton/saveIconHover.svg +3 -0
  113. package/dist/assets/images/generalButton/saveIconpink.svg +3 -0
  114. package/dist/assets/images/generalImage/assigned.svg +14 -0
  115. package/dist/assets/images/generalImage/bags.svg +25 -0
  116. package/dist/assets/images/generalImage/clock.svg +4 -0
  117. package/dist/assets/images/generalImage/flag.svg +3 -0
  118. package/dist/assets/images/genericModal/closeWhite.svg +3 -0
  119. package/dist/assets/images/genericModal/errorModal.svg +3 -0
  120. package/dist/assets/images/genericModal/genericModalCheck.svg +3 -0
  121. package/dist/assets/images/genericModal/genericModalClose.svg +3 -0
  122. package/dist/assets/images/genericModal/genericModalDown.svg +3 -0
  123. package/dist/assets/images/genericModal/genericModalUp.svg +3 -0
  124. package/dist/assets/images/genericModal/genericModalWarning.svg +12 -0
  125. package/dist/assets/images/genericModal/yellowAlert.svg +12 -0
  126. package/dist/assets/images/logo/logoLogin.svg +15 -0
  127. package/dist/assets/images/menuNotification/menuNotificationComment.svg +3 -0
  128. package/dist/assets/images/menuNotification/menuNotificationProduct.svg +3 -0
  129. package/dist/assets/images/menuProfile/logOut.svg +3 -0
  130. package/dist/assets/images/menuProfile/myAccount.svg +3 -0
  131. package/dist/assets/images/menuProfile/settings.svg +3 -0
  132. package/dist/assets/images/modalsSVGs/attributesSent.svg +208 -0
  133. package/dist/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  134. package/dist/assets/images/modalsSVGs/providerSent.svg +445 -0
  135. package/dist/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  136. package/dist/assets/images/productImage/openModal.svg +3 -0
  137. package/dist/assets/images/productNotification/productNotification.svg +3 -0
  138. package/dist/assets/images/profileHeader/profilePicture.svg +9 -0
  139. package/dist/assets/images/providerAndCadena/Cadena.svg +188 -0
  140. package/dist/assets/images/providerAndCadena/LoginContentoh.svg +15 -0
  141. package/dist/assets/images/providerAndCadena/Proveedor.svg +231 -0
  142. package/dist/assets/images/sideMenuButton/contenoh.svg +5 -0
  143. package/dist/assets/images/sideMenuButton/dashboard.svg +5 -0
  144. package/dist/assets/images/sideMenuButton/products.svg +10 -0
  145. package/dist/assets/images/sideMenuButton/providers.svg +10 -0
  146. package/dist/assets/images/sideMenuButton/tasks.svg +3 -0
  147. package/dist/assets/images/sliderToolTip/infoIcon.svg +4 -0
  148. package/dist/assets/images/sliderToolTip/slide1.svg +5 -0
  149. package/dist/assets/images/sliderToolTip/slide2.svg +9 -0
  150. package/dist/assets/images/sliderToolTip/slide21.svg +9 -0
  151. package/dist/assets/images/sliderToolTip/slide22.svg +9 -0
  152. package/dist/assets/images/sliderToolTip/slide23.svg +9 -0
  153. package/dist/assets/images/sliderToolTip/slide3.svg +9 -0
  154. package/dist/assets/images/sliderToolTip/slide4.svg +9 -0
  155. package/dist/assets/images/sliderToolTip/slide5.svg +40 -0
  156. package/dist/assets/images/versionSelector/acceptIcon.svg +3 -0
  157. package/dist/assets/images/versionSelector/addVersion.svg +5 -0
  158. package/dist/assets/images/versionSelector/closeVersionSelector.svg +4 -0
  159. package/dist/assets/images/versionSelector/createVersion.svg +3 -0
  160. package/dist/assets/images/versionSelector/nullIcon.svg +3 -0
  161. package/dist/assets/images/versionSelector/versionSelected.svg +3 -0
  162. package/dist/assets/images/verticalSideMenuMainPage/closeMenu.svg +4 -0
  163. package/dist/assets/images/verticalSideMenuMainPage/iconFAQS.svg +12 -0
  164. package/dist/assets/images/verticalSideMenuMainPage/iconGroup.svg +3 -0
  165. package/dist/assets/images/verticalSideMenuMainPage/iconLogo.svg +12 -0
  166. package/dist/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +15 -0
  167. package/dist/assets/images/verticalSideMenuMainPage/iconProduct.svg +3 -0
  168. package/dist/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +12 -0
  169. package/dist/assets/images/verticalSideMenuMainPage/iconTask.svg +10 -0
  170. package/dist/assets/images/verticalSideMenuMainPage/openMenu.svg +4 -0
  171. package/dist/assets/sounds/newMessage.mp3 +0 -0
  172. package/dist/components/atoms/Image/index.js +5 -5
  173. package/dist/components/atoms/ImageLink/index.js +5 -5
  174. package/dist/components/molecules/Dropdown/index.js +1 -1
  175. package/dist/components/molecules/StripeCardForm/paymentForm.js +5 -5
  176. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +19 -19
  177. package/dist/components/organisms/Chat/Chat.stories.js +8 -8
  178. package/dist/components/organisms/Chat/ContainerItems/index.js +18 -18
  179. package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +6 -6
  180. package/dist/components/organisms/Chat/ContentChat/index.js +26 -26
  181. package/dist/components/organisms/Chatv2/Chatv2.stories.js +8 -8
  182. package/dist/components/organisms/Chatv2/ContainerItems/index.js +18 -18
  183. package/dist/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +6 -6
  184. package/dist/components/organisms/Chatv2/ContentChat/index.js +26 -26
  185. package/dist/components/organisms/GlobalModal/index.js +9 -9
  186. package/dist/components/organisms/TableResizable/index.js +3 -3
  187. package/dist/components/pages/MultipleEdition/utils.js +14 -14
  188. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +61 -63
  189. package/dist/components/pages/ProviderProductEdition/index.js +10 -26
  190. package/dist/components/pages/RetailerProductEdition/index.js +6 -2
  191. package/dist/components/pages/VerificationCodeResetPassword/utils.js +19 -19
  192. package/dist/global-files/data.js +6 -6
  193. package/dist/global-files/fonts.css +69 -0
  194. package/dist/global-files/global-styles.css +42 -0
  195. package/dist/global-files/handle_http.js +42 -42
  196. package/dist/global-files/utils.js +95 -95
  197. package/package.json +116 -116
  198. package/src/_utils/helper.js +23 -23
  199. package/src/assets/images/Icons/DownloadIcon.svg +4 -4
  200. package/src/assets/images/Icons/addv2.svg +8 -8
  201. package/src/assets/images/Icons/beenhere.svg +9 -9
  202. package/src/assets/images/Icons/checkv2.svg +8 -8
  203. package/src/assets/images/Icons/close-magenta.svg +9 -9
  204. package/src/assets/images/Icons/close.svg +8 -8
  205. package/src/assets/images/Icons/closeCircle.svg +7 -7
  206. package/src/assets/images/Icons/delete-forever-red.svg +9 -9
  207. package/src/assets/images/Icons/delete-forever-white.svg +10 -10
  208. package/src/assets/images/Icons/edit.svg +8 -8
  209. package/src/assets/images/Icons/fullscreen.svg +2 -2
  210. package/src/assets/images/Icons/info.svg +8 -8
  211. package/src/assets/images/Icons/infoNR.svg +8 -8
  212. package/src/assets/images/Icons/options.svg +3 -3
  213. package/src/assets/images/Icons/save-white-gray.svg +9 -9
  214. package/src/assets/images/Icons/save-white.svg +9 -9
  215. package/src/assets/images/Icons/save.svg +8 -8
  216. package/src/assets/images/Icons/search.svg +3 -3
  217. package/src/assets/images/Icons/settings.svg +8 -8
  218. package/src/assets/images/Icons/trash.svg +8 -8
  219. package/src/assets/images/Icons/undo.svg +8 -8
  220. package/src/assets/images/Icons/upload-file-white.svg +3 -3
  221. package/src/assets/images/Icons/upload-file.svg +10 -10
  222. package/src/assets/images/Icons/upload_file.svg +10 -10
  223. package/src/assets/images/Icons/warningv2.svg +3 -3
  224. package/src/assets/images/activedFilter/removeFilter.svg +3 -3
  225. package/src/assets/images/arrow/arrowIcon.svg +3 -3
  226. package/src/assets/images/arrow/polygon.svg +3 -3
  227. package/src/assets/images/asignationOptions/availableIcon.svg +3 -3
  228. package/src/assets/images/asignationOptions/removeAsigned.svg +4 -4
  229. package/src/assets/images/asignationOptions/requestToProvider.svg +3 -3
  230. package/src/assets/images/asignationOptions/requestToTeam.svg +3 -3
  231. package/src/assets/images/card/masterCardIcon.svg +5 -5
  232. package/src/assets/images/checkBox/checked.svg +3 -3
  233. package/src/assets/images/checkBox/checkrosa.svg +3 -3
  234. package/src/assets/images/checkBox/checkverde.svg +3 -3
  235. package/src/assets/images/checkBox/unchecked.svg +3 -3
  236. package/src/assets/images/componentAssigned/assignedImage1.svg +9 -9
  237. package/src/assets/images/componentAssigned/assignedImage2.svg +9 -9
  238. package/src/assets/images/componentAssigned/clock.svg +4 -4
  239. package/src/assets/images/componentAssigned/flag.svg +3 -3
  240. package/src/assets/images/customSelect/starIcon.svg +14 -14
  241. package/src/assets/images/defaultImages/check_circle.svg +10 -10
  242. package/src/assets/images/defaultImages/defaultProfileImage.svg +13 -13
  243. package/src/assets/images/dropDownButton/dropDownArrowButton.svg +3 -3
  244. package/src/assets/images/editField/editField.svg +3 -3
  245. package/src/assets/images/flags/highPriority.svg +3 -3
  246. package/src/assets/images/flags/lowPriority.svg +3 -3
  247. package/src/assets/images/flags/mediumPriority.svg +3 -3
  248. package/src/assets/images/flags/noPriority.svg +3 -3
  249. package/src/assets/images/flagsv2/highPriority.svg +2 -2
  250. package/src/assets/images/flagsv2/lowPriority.svg +3 -3
  251. package/src/assets/images/flagsv2/mediumPriority.svg +2 -2
  252. package/src/assets/images/flagsv2/noPriority.svg +3 -3
  253. package/src/assets/images/generalButton/Icono AB.svg +14 -14
  254. package/src/assets/images/generalButton/acceptIcon.svg +3 -3
  255. package/src/assets/images/generalButton/closeIcon.svg +4 -4
  256. package/src/assets/images/generalButton/closeIconWhite.svg +4 -4
  257. package/src/assets/images/generalButton/closeIconv2.svg +4 -4
  258. package/src/assets/images/generalButton/deleteIcon.svg +13 -13
  259. package/src/assets/images/generalButton/deleteIconHover.svg +13 -13
  260. package/src/assets/images/generalButton/downloadIcon.svg +3 -3
  261. package/src/assets/images/generalButton/gridLayout.svg +3 -3
  262. package/src/assets/images/generalButton/nullIcon.svg +3 -3
  263. package/src/assets/images/generalButton/openModal.svg +3 -3
  264. package/src/assets/images/generalButton/rejectIcon.svg +3 -3
  265. package/src/assets/images/generalButton/rowLayout.svg +3 -3
  266. package/src/assets/images/generalButton/saveIcon.svg +3 -3
  267. package/src/assets/images/generalButton/saveIconHover.svg +3 -3
  268. package/src/assets/images/generalButton/saveIconpink.svg +3 -3
  269. package/src/assets/images/generalImage/assigned.svg +14 -14
  270. package/src/assets/images/generalImage/bags.svg +25 -25
  271. package/src/assets/images/generalImage/clock.svg +4 -4
  272. package/src/assets/images/generalImage/flag.svg +3 -3
  273. package/src/assets/images/genericModal/errorModal.svg +3 -3
  274. package/src/assets/images/genericModal/genericModalCheck.svg +3 -3
  275. package/src/assets/images/genericModal/genericModalClose.svg +3 -3
  276. package/src/assets/images/genericModal/genericModalDown.svg +3 -3
  277. package/src/assets/images/genericModal/genericModalUp.svg +3 -3
  278. package/src/assets/images/genericModal/genericModalWarning.svg +12 -12
  279. package/src/assets/images/genericModal/yellowAlert.svg +12 -12
  280. package/src/assets/images/logo/logoLogin.svg +15 -15
  281. package/src/assets/images/menuNotification/menuNotificationComment.svg +3 -3
  282. package/src/assets/images/menuNotification/menuNotificationProduct.svg +3 -3
  283. package/src/assets/images/menuProfile/logOut.svg +3 -3
  284. package/src/assets/images/menuProfile/myAccount.svg +3 -3
  285. package/src/assets/images/menuProfile/settings.svg +3 -3
  286. package/src/assets/images/modalsSVGs/attributesSent.svg +208 -208
  287. package/src/assets/images/modalsSVGs/descriptionSent.svg +237 -237
  288. package/src/assets/images/modalsSVGs/providerSent.svg +445 -445
  289. package/src/assets/images/modalsSVGs/uploadingImages.svg +148 -148
  290. package/src/assets/images/productImage/openModal.svg +3 -3
  291. package/src/assets/images/productNotification/productNotification.svg +3 -3
  292. package/src/assets/images/profileHeader/profilePicture.svg +9 -9
  293. package/src/assets/images/providerAndCadena/Cadena.svg +188 -188
  294. package/src/assets/images/providerAndCadena/LoginContentoh.svg +15 -15
  295. package/src/assets/images/providerAndCadena/Proveedor.svg +231 -231
  296. package/src/assets/images/sideMenuButton/contenoh.svg +5 -5
  297. package/src/assets/images/sideMenuButton/dashboard.svg +5 -5
  298. package/src/assets/images/sideMenuButton/products.svg +10 -10
  299. package/src/assets/images/sideMenuButton/providers.svg +10 -10
  300. package/src/assets/images/sideMenuButton/tasks.svg +3 -3
  301. package/src/assets/images/sliderToolTip/infoIcon.svg +4 -4
  302. package/src/assets/images/sliderToolTip/slide1.svg +5 -5
  303. package/src/assets/images/sliderToolTip/slide2.svg +9 -9
  304. package/src/assets/images/sliderToolTip/slide21.svg +9 -9
  305. package/src/assets/images/sliderToolTip/slide22.svg +9 -9
  306. package/src/assets/images/sliderToolTip/slide23.svg +9 -9
  307. package/src/assets/images/sliderToolTip/slide3.svg +9 -9
  308. package/src/assets/images/sliderToolTip/slide4.svg +9 -9
  309. package/src/assets/images/sliderToolTip/slide5.svg +40 -40
  310. package/src/assets/images/versionSelector/acceptIcon.svg +3 -3
  311. package/src/assets/images/versionSelector/addVersion.svg +5 -5
  312. package/src/assets/images/versionSelector/closeVersionSelector.svg +4 -4
  313. package/src/assets/images/versionSelector/createVersion.svg +3 -3
  314. package/src/assets/images/versionSelector/nullIcon.svg +3 -3
  315. package/src/assets/images/versionSelector/versionSelected.svg +3 -3
  316. package/src/assets/images/verticalSideMenuMainPage/closeMenu.svg +4 -4
  317. package/src/assets/images/verticalSideMenuMainPage/iconFAQS.svg +12 -12
  318. package/src/assets/images/verticalSideMenuMainPage/iconGroup.svg +3 -3
  319. package/src/assets/images/verticalSideMenuMainPage/iconLogo.svg +12 -12
  320. package/src/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +15 -15
  321. package/src/assets/images/verticalSideMenuMainPage/iconProduct.svg +3 -3
  322. package/src/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +12 -12
  323. package/src/assets/images/verticalSideMenuMainPage/iconTask.svg +10 -10
  324. package/src/assets/images/verticalSideMenuMainPage/openMenu.svg +4 -4
  325. package/src/components/atoms/ActivedFilter/ActivedFilter.stories.js +13 -13
  326. package/src/components/atoms/ActivedFilter/index.js +13 -13
  327. package/src/components/atoms/ActivedFilter/styles.js +36 -36
  328. package/src/components/atoms/AsignationOption/AsignationOptions.stories.js +20 -20
  329. package/src/components/atoms/AsignationOption/index.js +60 -60
  330. package/src/components/atoms/AsignationOption/styles.js +69 -69
  331. package/src/components/atoms/AtomList/AtomList.stories.js +15 -15
  332. package/src/components/atoms/AtomList/index.js +14 -14
  333. package/src/components/atoms/AtomList/styles.js +17 -17
  334. package/src/components/atoms/Avatar/AsignationImage.stories.js +27 -27
  335. package/src/components/atoms/Avatar/index.js +22 -22
  336. package/src/components/atoms/Avatar/styles.js +34 -34
  337. package/src/components/atoms/Button/index.js +16 -16
  338. package/src/components/atoms/Button/styles.js +38 -38
  339. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -47
  340. package/src/components/atoms/ButtonFileChooser/index.js +68 -68
  341. package/src/components/atoms/ButtonFileChooser/styles.js +4 -4
  342. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +54 -54
  343. package/src/components/atoms/ButtonV2/index.js +86 -86
  344. package/src/components/atoms/ButtonV2/styles.js +233 -233
  345. package/src/components/atoms/Card/Card.stories.js +12 -12
  346. package/src/components/atoms/Card/index.js +42 -42
  347. package/src/components/atoms/Card/styles.js +44 -44
  348. package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -11
  349. package/src/components/atoms/CharCounter/index.js +13 -13
  350. package/src/components/atoms/CharCounter/styles.js +10 -10
  351. package/src/components/atoms/CharsMissing/Wysiwyg.stories.js +12 -12
  352. package/src/components/atoms/CharsMissing/index.js +60 -60
  353. package/src/components/atoms/CharsMissing/styles.js +44 -44
  354. package/src/components/atoms/CheckBox/CheckBox.stories.js +25 -25
  355. package/src/components/atoms/CheckBox/index.js +33 -33
  356. package/src/components/atoms/CheckBox/styles.js +57 -57
  357. package/src/components/atoms/Commentary/index.js +9 -9
  358. package/src/components/atoms/Commentary/styles.js +15 -15
  359. package/src/components/atoms/CustomChip/CustomChip.stories.js +15 -15
  360. package/src/components/atoms/CustomChip/index.js +34 -34
  361. package/src/components/atoms/CustomChip/styles.js +5 -5
  362. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -36
  363. package/src/components/atoms/CustomIcon/index.js +41 -41
  364. package/src/components/atoms/CustomIcon/styles.js +85 -85
  365. package/src/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +410 -410
  366. package/src/components/atoms/CustomSelectItem/index.js +150 -150
  367. package/src/components/atoms/CustomSelectItem/styles.js +32 -32
  368. package/src/components/atoms/CustomerTypeImage/CustomerTypeImage.stories.js +10 -10
  369. package/src/components/atoms/CustomerTypeImage/index.js +14 -14
  370. package/src/components/atoms/CustomerTypeImage/styles.js +14 -14
  371. package/src/components/atoms/DropDownButton/DropDownButton.stories.js +20 -20
  372. package/src/components/atoms/DropDownButton/index.js +10 -10
  373. package/src/components/atoms/DropDownButton/styles.js +19 -19
  374. package/src/components/atoms/EditField/EditField.stories.js +13 -13
  375. package/src/components/atoms/EditField/index.js +15 -15
  376. package/src/components/atoms/EditField/styles.js +35 -35
  377. package/src/components/atoms/FeatureTag/FeatureTag.stories.js +16 -16
  378. package/src/components/atoms/FeatureTag/index.js +10 -10
  379. package/src/components/atoms/FeatureTag/styles.js +43 -43
  380. package/src/components/atoms/FeatureTagv2/FeatureTagv2.stories.js +16 -16
  381. package/src/components/atoms/FeatureTagv2/index.js +10 -10
  382. package/src/components/atoms/FeatureTagv2/styles.js +56 -56
  383. package/src/components/atoms/GeneralButton/GeneralButton.stories.js +76 -76
  384. package/src/components/atoms/GeneralButton/index.js +34 -34
  385. package/src/components/atoms/GeneralButton/styles.js +235 -235
  386. package/src/components/atoms/GeneralInput/GeneralInput.stories.js +33 -33
  387. package/src/components/atoms/GeneralInput/index.js +159 -159
  388. package/src/components/atoms/GeneralInput/styles.js +86 -86
  389. package/src/components/atoms/GeneralInputv2/GeneralInputv2.stories.js +33 -33
  390. package/src/components/atoms/GeneralInputv2/index.js +155 -155
  391. package/src/components/atoms/GeneralInputv2/styles.js +67 -67
  392. package/src/components/atoms/GeneralTextBox/GeneralTextBox.stories.js +13 -13
  393. package/src/components/atoms/GeneralTextBox/index.js +10 -10
  394. package/src/components/atoms/GeneralTextBox/styles.js +35 -35
  395. package/src/components/atoms/GenericModal/GenericModal.stories.js +140 -140
  396. package/src/components/atoms/GenericModal/index.js +12 -12
  397. package/src/components/atoms/GenericModal/styles.js +134 -134
  398. package/src/components/atoms/GradientPanel/GradientPanel.stories.js +134 -134
  399. package/src/components/atoms/GradientPanel/index.js +15 -15
  400. package/src/components/atoms/GradientPanel/styles.js +139 -139
  401. package/src/components/atoms/Graphic/Graphic.stories.js +29 -29
  402. package/src/components/atoms/Graphic/index.js +43 -43
  403. package/src/components/atoms/Graphic/styles.js +3 -3
  404. package/src/components/atoms/IconFile/IconFile.stories.js +35 -35
  405. package/src/components/atoms/IconFile/index.js +119 -119
  406. package/src/components/atoms/IconFile/styles.js +67 -67
  407. package/src/components/atoms/Image/Image.stories.js +51 -51
  408. package/src/components/atoms/Image/index.js +55 -55
  409. package/src/components/atoms/Image/styles.js +34 -34
  410. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -76
  411. package/src/components/atoms/ImageCarousel/index.js +103 -103
  412. package/src/components/atoms/ImageCarousel/styles.js +79 -79
  413. package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -43
  414. package/src/components/atoms/ImageLink/index.js +57 -57
  415. package/src/components/atoms/ImageLink/styles.js +30 -30
  416. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -52
  417. package/src/components/atoms/ImagePreview/index.js +178 -178
  418. package/src/components/atoms/ImagePreview/styles.js +77 -77
  419. package/src/components/atoms/Input/index.js +15 -15
  420. package/src/components/atoms/Input/style.js +31 -31
  421. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +12 -12
  422. package/src/components/atoms/InputFormatter/index.js +152 -152
  423. package/src/components/atoms/InputFormatter/styles.js +46 -46
  424. package/src/components/atoms/InputFormatterv2/Wysiwyg.stories.js +12 -12
  425. package/src/components/atoms/InputFormatterv2/index.js +148 -148
  426. package/src/components/atoms/InputFormatterv2/styles.js +39 -39
  427. package/src/components/atoms/InputImages/InputImages.stories.js +19 -19
  428. package/src/components/atoms/InputImages/index.js +25 -25
  429. package/src/components/atoms/InputImages/styles.js +17 -17
  430. package/src/components/atoms/InputText/InputText.stories.js +39 -39
  431. package/src/components/atoms/InputText/index.js +61 -61
  432. package/src/components/atoms/InputText/styles.js +89 -89
  433. package/src/components/atoms/LabelToInput/index.js +26 -26
  434. package/src/components/atoms/LabelToInput/style.js +41 -41
  435. package/src/components/atoms/LoadImageMenu/LoadImageMenu.stories.js +17 -17
  436. package/src/components/atoms/LoadImageMenu/index.js +58 -58
  437. package/src/components/atoms/LoadImageMenu/styles.js +72 -72
  438. package/src/components/atoms/Loading/Loading.stories.js +9 -9
  439. package/src/components/atoms/Loading/index.js +13 -13
  440. package/src/components/atoms/Loading/styles.js +57 -57
  441. package/src/components/atoms/LogoImage/LogoImage.stories.js +9 -9
  442. package/src/components/atoms/LogoImage/index.js +10 -10
  443. package/src/components/atoms/LogoImage/styles.js +11 -11
  444. package/src/components/atoms/MenuNotification/MenuNotification.stories.js +17 -17
  445. package/src/components/atoms/MenuNotification/index.js +30 -30
  446. package/src/components/atoms/MenuNotification/styles.js +50 -50
  447. package/src/components/atoms/MenuProfile/MenuProfile.stories.js +13 -13
  448. package/src/components/atoms/MenuProfile/index.js +31 -31
  449. package/src/components/atoms/MenuProfile/styles.js +57 -57
  450. package/src/components/atoms/MetricCard/MetricCard.stories.js +14 -14
  451. package/src/components/atoms/MetricCard/index.js +10 -10
  452. package/src/components/atoms/MetricCard/styles.js +30 -30
  453. package/src/components/atoms/MetricSelect/MetricSelect.stories.js +37 -37
  454. package/src/components/atoms/MetricSelect/index.js +22 -22
  455. package/src/components/atoms/MetricSelect/styles.js +20 -20
  456. package/src/components/atoms/Multiselect/Multiselect.stories.js +364 -364
  457. package/src/components/atoms/Multiselect/index.js +351 -351
  458. package/src/components/atoms/Multiselect/styles.js +33 -33
  459. package/src/components/atoms/NotFound/NotFound.stories.js +19 -19
  460. package/src/components/atoms/NotFound/index.js +52 -52
  461. package/src/components/atoms/NotFound/styles.js +55 -55
  462. package/src/components/atoms/Notification/Notification.stories.js +16 -16
  463. package/src/components/atoms/Notification/index.js +20 -20
  464. package/src/components/atoms/Notification/styles.js +42 -42
  465. package/src/components/atoms/NumberMandatory/NumberMandatory.stories.js +19 -19
  466. package/src/components/atoms/NumberMandatory/index.js +16 -16
  467. package/src/components/atoms/NumberMandatory/styles.js +11 -11
  468. package/src/components/atoms/ObservationFlag/ObservationFlag.stories.js +20 -20
  469. package/src/components/atoms/ObservationFlag/index.js +167 -167
  470. package/src/components/atoms/ObservationFlag/styles.js +104 -104
  471. package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -7
  472. package/src/components/atoms/PercentTag/index.js +9 -9
  473. package/src/components/atoms/PercentTag/styles.js +69 -69
  474. package/src/components/atoms/PriorityFlag/PriorityFlag.stories.js +20 -20
  475. package/src/components/atoms/PriorityFlag/index.js +20 -20
  476. package/src/components/atoms/PriorityFlag/styles.js +3 -3
  477. package/src/components/atoms/PriorityFlagv2/PriorityFlagv2.stories.js +20 -20
  478. package/src/components/atoms/PriorityFlagv2/index.js +20 -20
  479. package/src/components/atoms/PriorityFlagv2/styles.js +6 -6
  480. package/src/components/atoms/ProductImage/ProductImage.stories.js +28 -28
  481. package/src/components/atoms/ProductImage/index.js +29 -29
  482. package/src/components/atoms/ProductImage/styles.js +69 -69
  483. package/src/components/atoms/ProductImagev2/ProductImagev2.stories.js +28 -28
  484. package/src/components/atoms/ProductImagev2/index.js +16 -16
  485. package/src/components/atoms/ProductImagev2/styles.js +62 -62
  486. package/src/components/atoms/ProductPercentCard/Percent.stories.js +40 -40
  487. package/src/components/atoms/ProductPercentCard/index.js +23 -23
  488. package/src/components/atoms/ProductPercentCard/styles.js +83 -83
  489. package/src/components/atoms/Progress/Progress.stories.js +25 -25
  490. package/src/components/atoms/Progress/index.js +74 -74
  491. package/src/components/atoms/Progress/styles.js +98 -98
  492. package/src/components/atoms/ProgressBar/ProgressBar.stories.js +25 -25
  493. package/src/components/atoms/ProgressBar/index.js +53 -53
  494. package/src/components/atoms/ProgressBar/styles.js +94 -94
  495. package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -10
  496. package/src/components/atoms/RatingStars/index.js +31 -31
  497. package/src/components/atoms/RatingStars/styles.js +28 -28
  498. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -36
  499. package/src/components/atoms/RetailerCatalog/index.js +49 -49
  500. package/src/components/atoms/RetailerCatalog/styles.js +30 -30
  501. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -15
  502. package/src/components/atoms/RetailerOption/index.js +53 -53
  503. package/src/components/atoms/RetailerOption/styles.js +41 -41
  504. package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -33
  505. package/src/components/atoms/RetailersList/index.js +20 -20
  506. package/src/components/atoms/RetailersList/styles.js +19 -19
  507. package/src/components/atoms/ScreenHeader/ScreenHeader.stories.js +52 -52
  508. package/src/components/atoms/ScreenHeader/index.js +29 -29
  509. package/src/components/atoms/ScreenHeader/styles.js +90 -90
  510. package/src/components/atoms/ScreenHeaderv2/ScreenHeaderv2.stories.js +52 -52
  511. package/src/components/atoms/ScreenHeaderv2/index.js +134 -134
  512. package/src/components/atoms/ScreenHeaderv2/styles.js +103 -103
  513. package/src/components/atoms/Select/VersionSelect.js +27 -27
  514. package/src/components/atoms/Select/index.js +35 -35
  515. package/src/components/atoms/Select/style.js +95 -95
  516. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -26
  517. package/src/components/atoms/SelectItemV2/index.js +61 -61
  518. package/src/components/atoms/SelectItemV2/styles.js +90 -90
  519. package/src/components/atoms/Selectv2/VersionSelect.js +27 -27
  520. package/src/components/atoms/Selectv2/index.js +35 -35
  521. package/src/components/atoms/Selectv2/style.js +93 -93
  522. package/src/components/atoms/SideMenuButton/SideMenuButton.stories.js +16 -16
  523. package/src/components/atoms/SideMenuButton/index.js +10 -10
  524. package/src/components/atoms/SideMenuButton/styles.js +28 -28
  525. package/src/components/atoms/SliderToolTip/SliderToolTip.stories.js +89 -89
  526. package/src/components/atoms/SliderToolTip/index.js +110 -110
  527. package/src/components/atoms/SliderToolTip/styles.js +197 -197
  528. package/src/components/atoms/Status/Status.stories.js +14 -14
  529. package/src/components/atoms/Status/index.js +13 -13
  530. package/src/components/atoms/Status/styles.js +78 -78
  531. package/src/components/atoms/TabSection/TabSection.stories.js +25 -25
  532. package/src/components/atoms/TabSection/index.js +9 -9
  533. package/src/components/atoms/TabSection/styles.js +19 -19
  534. package/src/components/atoms/TabSectionv2/TabSection.stories.js +25 -25
  535. package/src/components/atoms/TabSectionv2/index.js +9 -9
  536. package/src/components/atoms/TabSectionv2/styles.js +20 -20
  537. package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -51
  538. package/src/components/atoms/Tooltip/index.js +59 -59
  539. package/src/components/atoms/Tooltip/styles.js +42 -42
  540. package/src/components/atoms/TooltipLight/Tooltip.stories.js +20 -20
  541. package/src/components/atoms/TooltipLight/index.js +46 -46
  542. package/src/components/atoms/TooltipLight/styles.js +65 -65
  543. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +67 -67
  544. package/src/components/atoms/UserCatalog/index.js +100 -100
  545. package/src/components/atoms/UserCatalog/styles.js +24 -24
  546. package/src/components/atoms/UserOption/UserOption.stories.js +25 -25
  547. package/src/components/atoms/UserOption/index.js +95 -95
  548. package/src/components/atoms/UserOption/styles.js +61 -61
  549. package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -25
  550. package/src/components/atoms/UserSelector/index.js +92 -92
  551. package/src/components/atoms/UserSelector/styles.js +55 -55
  552. package/src/components/atoms/ValidationPanel/ValidationPanel.stories.js +10 -10
  553. package/src/components/atoms/ValidationPanel/index.js +59 -59
  554. package/src/components/atoms/ValidationPanel/styles.js +44 -44
  555. package/src/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +39 -39
  556. package/src/components/atoms/VerticalSideMenuMainPage/index.js +59 -59
  557. package/src/components/atoms/VerticalSideMenuMainPage/styles.js +187 -187
  558. package/src/components/atoms/WordsMissing/Wysiwyg.stories.js +12 -12
  559. package/src/components/atoms/WordsMissing/index.js +60 -60
  560. package/src/components/atoms/WordsMissing/styles.js +10 -10
  561. package/src/components/molecules/AddGroup/AddGroup.stories.js +14 -14
  562. package/src/components/molecules/AddGroup/index.js +84 -84
  563. package/src/components/molecules/AddGroup/styles.js +141 -141
  564. package/src/components/molecules/AddProvidersAndProducts/AddProvidersAndProducts.stories.js +15 -15
  565. package/src/components/molecules/AddProvidersAndProducts/index.js +19 -19
  566. package/src/components/molecules/AddProvidersAndProducts/styles.js +22 -22
  567. package/src/components/molecules/AsignationInfo/AsignationInfo.stories.js +17 -17
  568. package/src/components/molecules/AsignationInfo/index.js +108 -108
  569. package/src/components/molecules/AsignationInfo/styles.js +86 -86
  570. package/src/components/molecules/AssignedWork/AssignedWork.stories.js +41 -41
  571. package/src/components/molecules/AssignedWork/index.js +40 -40
  572. package/src/components/molecules/AssignedWork/styles.js +110 -110
  573. package/src/components/molecules/AvatarAndValidation/AvatarAndValidation.stories.js +12 -12
  574. package/src/components/molecules/AvatarAndValidation/index.js +75 -75
  575. package/src/components/molecules/AvatarAndValidation/styles.js +15 -15
  576. package/src/components/molecules/BoxAttribute/BoxAttribute.stories.js +15 -15
  577. package/src/components/molecules/BoxAttribute/index.js +78 -78
  578. package/src/components/molecules/BoxAttribute/styles.js +38 -38
  579. package/src/components/molecules/BoxButtons/BoxButtons.stories.js +14 -14
  580. package/src/components/molecules/BoxButtons/index.js +29 -29
  581. package/src/components/molecules/BoxButtons/styles.js +43 -43
  582. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -54
  583. package/src/components/molecules/ButtonDownloadFile/index.js +109 -109
  584. package/src/components/molecules/ButtonDownloadFile/styles.js +66 -66
  585. package/src/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +17 -17
  586. package/src/components/molecules/CarouselImagesLogin/index.js +65 -65
  587. package/src/components/molecules/CarouselImagesLogin/styles.js +60 -60
  588. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +35 -35
  589. package/src/components/molecules/CustomSelect/SelectItem.js +104 -104
  590. package/src/components/molecules/CustomSelect/index.js +194 -194
  591. package/src/components/molecules/CustomSelect/styles.js +126 -126
  592. package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -103
  593. package/src/components/molecules/Dropdown/index.js +150 -150
  594. package/src/components/molecules/Dropdown/styles.js +75 -75
  595. package/src/components/molecules/EditionActiveImage/EditionActiveImage.stories.js +12 -12
  596. package/src/components/molecules/EditionActiveImage/index.js +15 -15
  597. package/src/components/molecules/EditionActiveImage/styles.js +7 -7
  598. package/src/components/molecules/EditionActiveImagev2/EditionActiveImagev2.stories.js +12 -12
  599. package/src/components/molecules/EditionActiveImagev2/index.js +15 -15
  600. package/src/components/molecules/EditionActiveImagev2/styles.js +7 -7
  601. package/src/components/molecules/EditionTabs/EditionTabs.stories.js +12 -12
  602. package/src/components/molecules/EditionTabs/index.js +33 -33
  603. package/src/components/molecules/EditionTabs/styles.js +23 -23
  604. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +11 -11
  605. package/src/components/molecules/EmailResetPasswordLogin/index.js +85 -85
  606. package/src/components/molecules/EmailResetPasswordLogin/styles.js +23 -23
  607. package/src/components/molecules/FeaturesBar/FeaturesBar.stories.js +20 -20
  608. package/src/components/molecules/FeaturesBar/index.js +30 -30
  609. package/src/components/molecules/FeaturesBar/styles.js +16 -16
  610. package/src/components/molecules/FeaturesBarv2/FeaturesBarv2.stories.js +20 -20
  611. package/src/components/molecules/FeaturesBarv2/index.js +32 -32
  612. package/src/components/molecules/FeaturesBarv2/styles.js +17 -17
  613. package/src/components/molecules/GalleryElement/GalleryElement.stories.js +30 -30
  614. package/src/components/molecules/GalleryElement/index.js +225 -225
  615. package/src/components/molecules/GalleryElement/styles.js +125 -125
  616. package/src/components/molecules/GalleryElementv2/GalleryElementv2.stories.js +30 -30
  617. package/src/components/molecules/GalleryElementv2/index.js +142 -142
  618. package/src/components/molecules/GalleryElementv2/styles.js +119 -119
  619. package/src/components/molecules/GalleryHeader/GalleryHeader.stories.js +10 -10
  620. package/src/components/molecules/GalleryHeader/index.js +27 -27
  621. package/src/components/molecules/GalleryHeader/styles.js +49 -49
  622. package/src/components/molecules/GalleryHeaderv2/GalleryHeaderv2.stories.js +10 -10
  623. package/src/components/molecules/GalleryHeaderv2/index.js +25 -25
  624. package/src/components/molecules/GalleryHeaderv2/styles.js +47 -47
  625. package/src/components/molecules/GridItem/GridItem.stories.js +126 -126
  626. package/src/components/molecules/GridItem/index.js +128 -128
  627. package/src/components/molecules/GridItem/styles.js +129 -129
  628. package/src/components/molecules/GroupSelect/GroupSelect.stories.js +35 -35
  629. package/src/components/molecules/GroupSelect/SelectItem.js +105 -105
  630. package/src/components/molecules/GroupSelect/index.js +190 -190
  631. package/src/components/molecules/GroupSelect/styles.js +124 -124
  632. package/src/components/molecules/HeaderItem/ColumnItem.js +9 -9
  633. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -24
  634. package/src/components/molecules/HeaderItem/index.js +26 -26
  635. package/src/components/molecules/HeaderItem/styles.js +27 -27
  636. package/src/components/molecules/HeaderTop/HeaderTop.stories.js +10 -10
  637. package/src/components/molecules/HeaderTop/index.js +106 -106
  638. package/src/components/molecules/HeaderTop/styles.js +33 -33
  639. package/src/components/molecules/HeaderTopv2/HeaderTopv2.stories.js +10 -10
  640. package/src/components/molecules/HeaderTopv2/index.js +100 -100
  641. package/src/components/molecules/HeaderTopv2/styles.js +33 -33
  642. package/src/components/molecules/ImageSelector/ImageSelector.stories.js +46 -46
  643. package/src/components/molecules/ImageSelector/index.js +22 -22
  644. package/src/components/molecules/ImageSelector/styles.js +13 -13
  645. package/src/components/molecules/ImageSelectorv2/ImageSelectorv2.stories.js +46 -46
  646. package/src/components/molecules/ImageSelectorv2/index.js +22 -22
  647. package/src/components/molecules/ImageSelectorv2/styles.js +15 -15
  648. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -68
  649. package/src/components/molecules/ImageTooltip/index.js +53 -53
  650. package/src/components/molecules/ImageTooltip/styles.js +18 -18
  651. package/src/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +8 -8
  652. package/src/components/molecules/LoginPasswordStrength/index.js +84 -84
  653. package/src/components/molecules/LoginPasswordStrength/styles.js +91 -91
  654. package/src/components/molecules/LogoLoading/Loading.stories.js +9 -9
  655. package/src/components/molecules/LogoLoading/index.js +12 -12
  656. package/src/components/molecules/LogoLoading/styles.js +16 -16
  657. package/src/components/molecules/ParentComponent/ParentComponent.stories.js +18 -18
  658. package/src/components/molecules/ParentComponent/index.js +66 -66
  659. package/src/components/molecules/ParentComponent/styles.js +7 -7
  660. package/src/components/molecules/PayMethod/PayMethod.stories.js +12 -12
  661. package/src/components/molecules/PayMethod/index.js +46 -46
  662. package/src/components/molecules/PayMethod/styles.js +31 -31
  663. package/src/components/molecules/Phase/Phase.stories.js +107 -107
  664. package/src/components/molecules/Phase/index.js +391 -391
  665. package/src/components/molecules/Phase/styles.js +97 -97
  666. package/src/components/molecules/PlanSelection/PlanSelection.stories.js +19 -19
  667. package/src/components/molecules/PlanSelection/index.js +25 -25
  668. package/src/components/molecules/PlanSelection/styles.js +14 -14
  669. package/src/components/molecules/ProductNameHeader/ProductNameHeader.stories.js +37 -37
  670. package/src/components/molecules/ProductNameHeader/index.js +45 -45
  671. package/src/components/molecules/ProductNameHeader/styles.js +10 -10
  672. package/src/components/molecules/ProductNameHeaderv2/ProductNameHeaderv2.stories.js +37 -37
  673. package/src/components/molecules/ProductNameHeaderv2/index.js +12 -12
  674. package/src/components/molecules/ProductNameHeaderv2/styles.js +10 -10
  675. package/src/components/molecules/ProductNotification/ProductNotification.stories.js +13 -13
  676. package/src/components/molecules/ProductNotification/index.js +53 -53
  677. package/src/components/molecules/ProductNotification/styles.js +37 -37
  678. package/src/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +37 -37
  679. package/src/components/molecules/ProductSkuStatus/index.js +26 -26
  680. package/src/components/molecules/ProductSkuStatus/styles.js +7 -7
  681. package/src/components/molecules/ProfileHeader/ProfileHeader.stories.js +16 -16
  682. package/src/components/molecules/ProfileHeader/index.js +54 -54
  683. package/src/components/molecules/ProfileHeader/styles.js +30 -30
  684. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +11 -11
  685. package/src/components/molecules/RegistrationFirstStep/index.js +227 -227
  686. package/src/components/molecules/RegistrationFirstStep/styles.js +87 -87
  687. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +11 -11
  688. package/src/components/molecules/RegistrationSecondStep/index.js +135 -135
  689. package/src/components/molecules/RegistrationSecondStep/styles.js +64 -64
  690. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +11 -11
  691. package/src/components/molecules/RegistrationThirdStep/index.js +130 -130
  692. package/src/components/molecules/RegistrationThirdStep/styles.js +44 -44
  693. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +35 -35
  694. package/src/components/molecules/RetailerSelector/index.js +81 -81
  695. package/src/components/molecules/RetailerSelector/styles.js +21 -21
  696. package/src/components/molecules/RetailerSelectorv2/RetailerSelectorv2.stories.js +35 -35
  697. package/src/components/molecules/RetailerSelectorv2/index.js +80 -80
  698. package/src/components/molecules/RetailerSelectorv2/styles.js +21 -21
  699. package/src/components/molecules/RowItem/ColumnItem.js +9 -9
  700. package/src/components/molecules/RowItem/RowItem.stories.js +5660 -5660
  701. package/src/components/molecules/RowItem/index.js +45 -45
  702. package/src/components/molecules/RowItem/styles.js +41 -41
  703. package/src/components/molecules/SelectV2/SelectV2.stories.js +115 -115
  704. package/src/components/molecules/SelectV2/index.js +357 -357
  705. package/src/components/molecules/SelectV2/styles.js +105 -105
  706. package/src/components/molecules/SelectV2/test.js +60 -60
  707. package/src/components/molecules/SelectV2/test.stories.js +10 -10
  708. package/src/components/molecules/ServiceDataValidator/ServiceDataValidator.stories.js +89 -89
  709. package/src/components/molecules/ServiceDataValidator/index.js +49 -49
  710. package/src/components/molecules/ServiceDataValidator/styles.js +36 -36
  711. package/src/components/molecules/SidebarNotification/SidebarNotification.stories.js +101 -101
  712. package/src/components/molecules/SidebarNotification/index.js +95 -95
  713. package/src/components/molecules/SidebarNotification/styles.js +63 -63
  714. package/src/components/molecules/SignInLogin/SignInLogin.stories.js +11 -11
  715. package/src/components/molecules/SignInLogin/index.js +244 -244
  716. package/src/components/molecules/SignInLogin/styles.js +111 -111
  717. package/src/components/molecules/StatusAsignationInfo/FinancedCompanies.js +44 -44
  718. package/src/components/molecules/StatusAsignationInfo/StatusAsignationInfo.stories.js +17 -17
  719. package/src/components/molecules/StatusAsignationInfo/index.js +197 -197
  720. package/src/components/molecules/StatusAsignationInfo/styles.js +82 -82
  721. package/src/components/molecules/StatusRetailer/StatusAsignationInfo.stories.js +17 -17
  722. package/src/components/molecules/StatusRetailer/index.js +55 -55
  723. package/src/components/molecules/StatusRetailer/styles.js +85 -85
  724. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +14 -14
  725. package/src/components/molecules/StripeCardForm/index.js +45 -45
  726. package/src/components/molecules/StripeCardForm/paymentForm.js +126 -126
  727. package/src/components/molecules/StripeCardForm/styles.js +84 -84
  728. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -12
  729. package/src/components/molecules/StripeCardSelector/index.js +59 -59
  730. package/src/components/molecules/StripeCardSelector/styles.js +15 -15
  731. package/src/components/molecules/StripeCardSelector/utils.js +17 -17
  732. package/src/components/molecules/TableHeader/TableHeader.stories.js +20 -20
  733. package/src/components/molecules/TableHeader/index.js +36 -36
  734. package/src/components/molecules/TableHeader/styles.js +30 -30
  735. package/src/components/molecules/TableRow/TableRow.stories.js +18 -18
  736. package/src/components/molecules/TableRow/index.js +14 -14
  737. package/src/components/molecules/TableRow/styles.js +11 -11
  738. package/src/components/molecules/TabsMenu/TabsMenu.stories.js +19 -19
  739. package/src/components/molecules/TabsMenu/index.js +110 -110
  740. package/src/components/molecules/TabsMenu/styles.js +5 -5
  741. package/src/components/molecules/TabsMenuv2/TabsMenuv2.stories.js +19 -19
  742. package/src/components/molecules/TabsMenuv2/index.js +112 -112
  743. package/src/components/molecules/TabsMenuv2/styles.js +19 -19
  744. package/src/components/molecules/TagAndInput/TagAndInput.stories.js +24 -24
  745. package/src/components/molecules/TagAndInput/index.js +120 -120
  746. package/src/components/molecules/TagAndInput/styles.js +36 -36
  747. package/src/components/molecules/TagAndInputv2/TagAndInputv2.stories.js +24 -24
  748. package/src/components/molecules/TagAndInputv2/index.js +86 -86
  749. package/src/components/molecules/TagAndInputv2/styles.js +35 -35
  750. package/src/components/molecules/Validation/Validation.stories.js +12 -12
  751. package/src/components/molecules/Validation/index.js +77 -77
  752. package/src/components/molecules/Validation/styles.js +19 -19
  753. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +11 -11
  754. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +171 -171
  755. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +54 -54
  756. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +54 -54
  757. package/src/components/molecules/VersionItem/VersionItem.stories.js +14 -14
  758. package/src/components/molecules/VersionItem/index.js +55 -55
  759. package/src/components/molecules/VersionItem/styles.js +32 -32
  760. package/src/components/molecules/VersionItemv2/VersionItemv2.stories.js +14 -14
  761. package/src/components/molecules/VersionItemv2/index.js +59 -59
  762. package/src/components/molecules/VersionItemv2/styles.js +47 -47
  763. package/src/components/organisms/BarButtons/BarButtons.stories.js +12 -12
  764. package/src/components/organisms/BarButtons/index.js +150 -150
  765. package/src/components/organisms/BarButtons/styles.js +54 -54
  766. package/src/components/organisms/Box/Box.stories.js +16 -16
  767. package/src/components/organisms/Box/index.js +103 -103
  768. package/src/components/organisms/Box/styles.js +47 -47
  769. package/src/components/organisms/BoxOnboarding/BoxOnboarding.stories.js +16 -16
  770. package/src/components/organisms/BoxOnboarding/index.js +59 -59
  771. package/src/components/organisms/BoxOnboarding/styles.js +44 -44
  772. package/src/components/organisms/Calendar/Calendar.stories.js +10 -10
  773. package/src/components/organisms/Calendar/index.js +17 -17
  774. package/src/components/organisms/Calendar/styles.js +853 -853
  775. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +11 -11
  776. package/src/components/organisms/ChangePassword/index.js +77 -77
  777. package/src/components/organisms/ChangePassword/styles.js +13 -13
  778. package/src/components/organisms/Chat/Chat.stories.js +184 -184
  779. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -65
  780. package/src/components/organisms/Chat/ChatLists/index.js +141 -141
  781. package/src/components/organisms/Chat/ChatLists/styles.js +162 -162
  782. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -142
  783. package/src/components/organisms/Chat/ContainerItems/index.js +538 -538
  784. package/src/components/organisms/Chat/ContainerItems/styles.js +360 -360
  785. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -102
  786. package/src/components/organisms/Chat/ContentChat/index.js +1016 -1016
  787. package/src/components/organisms/Chat/ContentChat/styles.js +44 -44
  788. package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -22
  789. package/src/components/organisms/Chat/Footer/index.js +668 -668
  790. package/src/components/organisms/Chat/Footer/styles.js +290 -290
  791. package/src/components/organisms/Chat/Header/Header.stories.js +66 -66
  792. package/src/components/organisms/Chat/Header/index.js +93 -93
  793. package/src/components/organisms/Chat/Header/styles.js +49 -49
  794. package/src/components/organisms/Chat/index.js +282 -282
  795. package/src/components/organisms/Chat/styles.js +50 -50
  796. package/src/components/organisms/Chatv2/ChatLists/ChatLists.stories.js +65 -65
  797. package/src/components/organisms/Chatv2/ChatLists/index.js +141 -141
  798. package/src/components/organisms/Chatv2/ChatLists/styles.js +162 -162
  799. package/src/components/organisms/Chatv2/Chatv2.stories.js +184 -184
  800. package/src/components/organisms/Chatv2/ContainerItems/ContainerItems.stories.js +142 -142
  801. package/src/components/organisms/Chatv2/ContainerItems/index.js +538 -538
  802. package/src/components/organisms/Chatv2/ContainerItems/styles.js +360 -360
  803. package/src/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +102 -102
  804. package/src/components/organisms/Chatv2/ContentChat/index.js +1016 -1016
  805. package/src/components/organisms/Chatv2/ContentChat/styles.js +44 -44
  806. package/src/components/organisms/Chatv2/Footer/Footer.stories.js +22 -22
  807. package/src/components/organisms/Chatv2/Footer/index.js +668 -668
  808. package/src/components/organisms/Chatv2/Footer/styles.js +290 -290
  809. package/src/components/organisms/Chatv2/Header/Header.stories.js +66 -66
  810. package/src/components/organisms/Chatv2/Header/index.js +93 -93
  811. package/src/components/organisms/Chatv2/Header/styles.js +49 -49
  812. package/src/components/organisms/Chatv2/index.js +281 -281
  813. package/src/components/organisms/Chatv2/styles.js +85 -85
  814. package/src/components/organisms/CompleteServices/CompleteServices.stories.js +90 -90
  815. package/src/components/organisms/CompleteServices/index.js +82 -82
  816. package/src/components/organisms/CompleteServices/styles.js +35 -35
  817. package/src/components/organisms/CreateVersion/CreateVersion.stories.js +14 -14
  818. package/src/components/organisms/CreateVersion/RenderChilds.js +131 -131
  819. package/src/components/organisms/CreateVersion/index.js +68 -68
  820. package/src/components/organisms/CreateVersion/styles.js +79 -79
  821. package/src/components/organisms/DashboardMetric/DashboardMetric.stories.js +28 -28
  822. package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +130 -130
  823. package/src/components/organisms/DashboardMetric/index.js +120 -120
  824. package/src/components/organisms/DashboardMetric/styles.js +91 -91
  825. package/src/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +12 -12
  826. package/src/components/organisms/DragAndDropPhases/index.js +336 -336
  827. package/src/components/organisms/DragAndDropPhases/styles.js +107 -107
  828. package/src/components/organisms/DragPrueba/DragPrueba.stories.js +11 -11
  829. package/src/components/organisms/DragPrueba/index.js +57 -57
  830. package/src/components/organisms/DragPrueba/styles.js +8 -8
  831. package/src/components/organisms/EditGroup/EditGroup.stories.js +19 -19
  832. package/src/components/organisms/EditGroup/index.js +321 -321
  833. package/src/components/organisms/EditGroup/styles.js +206 -206
  834. package/src/components/organisms/FullProductNameHeader/FullProductNameHeader.stories.js +28 -28
  835. package/src/components/organisms/FullProductNameHeader/index.js +102 -102
  836. package/src/components/organisms/FullProductNameHeader/styles.js +12 -12
  837. package/src/components/organisms/FullProductNamev2/FullProductNamev2.stories.js +28 -28
  838. package/src/components/organisms/FullProductNamev2/index.js +101 -101
  839. package/src/components/organisms/FullProductNamev2/styles.js +49 -49
  840. package/src/components/organisms/FullTabsMenu/FullTabsMenu.stories.js +22 -22
  841. package/src/components/organisms/FullTabsMenu/index.js +69 -69
  842. package/src/components/organisms/FullTabsMenu/styles.js +10 -10
  843. package/src/components/organisms/FullTabsMenuv2/FullTabsMenuv2.stories.js +22 -22
  844. package/src/components/organisms/FullTabsMenuv2/index.js +142 -142
  845. package/src/components/organisms/FullTabsMenuv2/styles.js +47 -47
  846. package/src/components/organisms/Fullplan/FullPlan.stories.js +21 -21
  847. package/src/components/organisms/Fullplan/index.js +34 -34
  848. package/src/components/organisms/Fullplan/styles.js +26 -26
  849. package/src/components/organisms/GlobalModal/index.js +68 -68
  850. package/src/components/organisms/GlobalModal/styles.js +123 -123
  851. package/src/components/organisms/GridProducts/GridProducts.stories.js +5853 -5853
  852. package/src/components/organisms/GridProducts/index.js +50 -50
  853. package/src/components/organisms/GridProducts/styles.js +15 -15
  854. package/src/components/organisms/GridProducts/utils.js +111 -111
  855. package/src/components/organisms/ImageDataTable/ImageDataTable.stories.js +24 -24
  856. package/src/components/organisms/ImageDataTable/index.js +124 -124
  857. package/src/components/organisms/ImageDataTable/styles.js +17 -17
  858. package/src/components/organisms/ImageDataTablev2/ImageDataTablev2.stories.js +24 -24
  859. package/src/components/organisms/ImageDataTablev2/index.js +124 -124
  860. package/src/components/organisms/ImageDataTablev2/styles.js +18 -18
  861. package/src/components/organisms/ImagePreviewer/ImagePreviewer.stories.js +38 -38
  862. package/src/components/organisms/ImagePreviewer/index.js +21 -21
  863. package/src/components/organisms/ImagePreviewer/styles.js +7 -7
  864. package/src/components/organisms/ImagePreviewerv2/ImagePreviewerv2.stories.js +38 -38
  865. package/src/components/organisms/ImagePreviewerv2/index.js +22 -22
  866. package/src/components/organisms/ImagePreviewerv2/styles.js +7 -7
  867. package/src/components/organisms/ImageUploader/ImageUploader.stories.js +15 -15
  868. package/src/components/organisms/ImageUploader/index.js +62 -62
  869. package/src/components/organisms/ImageUploader/styles.js +29 -29
  870. package/src/components/organisms/ImageVisor/ImageVisor.stories.js +15 -15
  871. package/src/components/organisms/ImageVisor/index.js +143 -143
  872. package/src/components/organisms/ImageVisor/styles.js +106 -106
  873. package/src/components/organisms/ImagesGroup/index.js +10 -10
  874. package/src/components/organisms/ImagesGroup/styles.js +3 -3
  875. package/src/components/organisms/InputGroup/InputGroup.stories.js +31 -31
  876. package/src/components/organisms/InputGroup/index.js +439 -439
  877. package/src/components/organisms/InputGroup/styles.js +87 -87
  878. package/src/components/organisms/InputGroupv2/InputGroupv2.stories.js +31 -31
  879. package/src/components/organisms/InputGroupv2/index.js +296 -296
  880. package/src/components/organisms/InputGroupv2/styles.js +90 -90
  881. package/src/components/organisms/MandatoryBar/MandatoryBar.stories.js +18 -18
  882. package/src/components/organisms/MandatoryBar/index.js +31 -31
  883. package/src/components/organisms/MandatoryBar/styles.js +12 -12
  884. package/src/components/organisms/Modal/Modal.stories.js +56 -56
  885. package/src/components/organisms/Modal/index.js +104 -104
  886. package/src/components/organisms/Modal/styles.js +110 -110
  887. package/src/components/organisms/OrderDetail/OrderDetail.stories.js +87 -87
  888. package/src/components/organisms/OrderDetail/index.js +216 -216
  889. package/src/components/organisms/OrderDetail/styles.js +122 -122
  890. package/src/components/organisms/OrderDetail/utils/ImageGroup/index.js +34 -34
  891. package/src/components/organisms/OrderDetail/utils/ImageGroup/styles.js +46 -46
  892. package/src/components/organisms/OrderDetail/utils/Table/index.js +133 -133
  893. package/src/components/organisms/OrderDetail/utils/Table/styles.js +74 -74
  894. package/src/components/organisms/OrderDetail/utils/Table/utils.js +32 -32
  895. package/src/components/organisms/PanelLayout/PanelLayout.stories.js +63 -63
  896. package/src/components/organisms/PanelLayout/index.js +11 -11
  897. package/src/components/organisms/PanelLayout/styles.js +39 -39
  898. package/src/components/organisms/ProductImageModal/ProductImageModal.stories.js +90 -90
  899. package/src/components/organisms/ProductImageModal/index.js +98 -98
  900. package/src/components/organisms/ProductImageModal/styles.js +60 -60
  901. package/src/components/organisms/ProductImageModalv2/ProductImageModalv2.stories.js +90 -90
  902. package/src/components/organisms/ProductImageModalv2/index.js +105 -105
  903. package/src/components/organisms/ProductImageModalv2/styles.js +71 -71
  904. package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -16
  905. package/src/components/organisms/RangeCalendar/index.js +121 -121
  906. package/src/components/organisms/RangeCalendar/styles.js +883 -883
  907. package/src/components/organisms/RenameImagesBar/RenameImagesBar.stories.js +18 -18
  908. package/src/components/organisms/RenameImagesBar/index.js +30 -30
  909. package/src/components/organisms/RenameImagesBar/styles.js +12 -12
  910. package/src/components/organisms/SideModal/SideModal.stories.js +23 -23
  911. package/src/components/organisms/SideModal/index.js +50 -50
  912. package/src/components/organisms/SideModal/styles.js +30 -30
  913. package/src/components/organisms/Table/Table.stories.js +609 -609
  914. package/src/components/organisms/Table/index.js +84 -84
  915. package/src/components/organisms/Table/styles.js +119 -119
  916. package/src/components/organisms/TableResizable/TableResizable.stories.js +17 -17
  917. package/src/components/organisms/TableResizable/index.js +119 -119
  918. package/src/components/organisms/TableResizable/styles.js +133 -133
  919. package/src/components/organisms/TableResizable/utils.js +46 -46
  920. package/src/components/organisms/VersionSelector/VersionSelector.stories.js +15 -15
  921. package/src/components/organisms/VersionSelector/index.js +106 -106
  922. package/src/components/organisms/VersionSelector/styles.js +29 -29
  923. package/src/components/organisms/VersionSelectorv2/VersionSelectorv2.stories.js +15 -15
  924. package/src/components/organisms/VersionSelectorv2/index.js +105 -105
  925. package/src/components/organisms/VersionSelectorv2/styles.js +45 -45
  926. package/src/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +18 -18
  927. package/src/components/pages/ChangePasswordLogin/index.js +77 -77
  928. package/src/components/pages/ChangePasswordLogin/styles.js +20 -20
  929. package/src/components/pages/CustomerLogin/CustomerLogin.stories.js +78 -78
  930. package/src/components/pages/CustomerLogin/index.js +22 -22
  931. package/src/components/pages/CustomerLogin/styles.js +12 -12
  932. package/src/components/pages/CustomerPayMethod/CustomerPayMethod.stories.js +56 -56
  933. package/src/components/pages/CustomerPayMethod/index.js +23 -23
  934. package/src/components/pages/CustomerPayMethod/styles.js +21 -21
  935. package/src/components/pages/CustomerType/CustomerType.stories.js +33 -33
  936. package/src/components/pages/CustomerType/index.js +22 -22
  937. package/src/components/pages/CustomerType/styles.js +21 -21
  938. package/src/components/pages/Dashboard/Dashboard.stories.js +62 -62
  939. package/src/components/pages/Dashboard/dashboardUtils.js +74 -74
  940. package/src/components/pages/Dashboard/index.js +382 -382
  941. package/src/components/pages/Dashboard/styles.js +37 -37
  942. package/src/components/pages/EmailResetPassword/EmailResetPassword.stories.js +17 -17
  943. package/src/components/pages/EmailResetPassword/index.js +77 -77
  944. package/src/components/pages/EmailResetPassword/styles.js +27 -27
  945. package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +16 -16
  946. package/src/components/pages/MultipleEdition/components/ImageUploader.js +62 -62
  947. package/src/components/pages/MultipleEdition/components/ImageUploaderStyles.js +29 -29
  948. package/src/components/pages/MultipleEdition/components/ImageVisor.js +143 -143
  949. package/src/components/pages/MultipleEdition/components/styles.js +106 -106
  950. package/src/components/pages/MultipleEdition/index.js +248 -248
  951. package/src/components/pages/MultipleEdition/saveData.js +92 -92
  952. package/src/components/pages/MultipleEdition/styles.js +197 -197
  953. package/src/components/pages/MultipleEdition/utils.js +1074 -1074
  954. package/src/components/pages/OnboardPlan/OnboardPlan.stories.js +51 -51
  955. package/src/components/pages/OnboardPlan/index.js +22 -22
  956. package/src/components/pages/OnboardPlan/styles.js +33 -33
  957. package/src/components/pages/ProductEditionv2/ProductEditionv2.stories.js +213 -213
  958. package/src/components/pages/ProductEditionv2/index.js +1758 -1758
  959. package/src/components/pages/ProductEditionv2/styles.js +154 -154
  960. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +139 -139
  961. package/src/components/pages/ProviderProductEdition/index.js +1779 -1785
  962. package/src/components/pages/ProviderProductEdition/styles.js +122 -122
  963. package/src/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +18 -18
  964. package/src/components/pages/RegistrationLoginSecondStep/index.js +111 -111
  965. package/src/components/pages/RegistrationLoginSecondStep/styles.js +64 -64
  966. package/src/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +17 -17
  967. package/src/components/pages/RegistrationLoginThirdStep/index.js +105 -105
  968. package/src/components/pages/RegistrationLoginThirdStep/styles.js +48 -48
  969. package/src/components/pages/RetailerPlan/RetailerPlan.stories.js +49 -49
  970. package/src/components/pages/RetailerPlan/index.js +24 -24
  971. package/src/components/pages/RetailerPlan/styles.js +26 -26
  972. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +119 -119
  973. package/src/components/pages/RetailerProductEdition/generateThumnail.js +20 -20
  974. package/src/components/pages/RetailerProductEdition/index.js +1838 -1838
  975. package/src/components/pages/RetailerProductEdition/styles.js +104 -104
  976. package/src/components/pages/RetailerProductEdition/utils.js +71 -71
  977. package/src/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +17 -17
  978. package/src/components/pages/VerificationCodeResetPassword/index.js +92 -92
  979. package/src/components/pages/VerificationCodeResetPassword/styles.js +54 -54
  980. package/src/components/pages/VerificationCodeResetPassword/utils.js +56 -56
  981. package/src/global-files/customHooks.js +24 -24
  982. package/src/global-files/data.js +186 -186
  983. package/src/global-files/fonts.css +69 -69
  984. package/src/global-files/global-styles.css +42 -42
  985. package/src/global-files/handle_http.js +224 -224
  986. package/src/global-files/handle_userTech.js +7 -7
  987. package/src/global-files/utils.js +330 -330
  988. package/src/global-files/variables.js +56 -56
  989. package/src/index.js +113 -113
@@ -1,1016 +1,1016 @@
1
- import ReactHowler from "react-howler";
2
- import { Container } from "./styles";
3
- import { useEffect, useState } from "react";
4
- import { NotFound } from "../../../atoms/NotFound";
5
- import { Header } from "../Header";
6
- import { faComments as IconChat } from "@fortawesome/free-solid-svg-icons";
7
- import { Loading } from "../../../atoms/Loading";
8
- import { ContainerItems } from "../ContainerItems";
9
- import { Footer } from "../Footer";
10
- import { ChatLists } from "../ChatLists";
11
- import { CustomIcon } from "../../../atoms/CustomIcon";
12
- import { fetchGET, fetchPOST } from "../../../../global-files/handle_http";
13
- import {
14
- encodeUriJson,
15
- isStringEmpty,
16
- isValidNaturalNumber,
17
- } from "../../../../global-files/utils";
18
- import newMessage from "../../../../assets/sounds/newMessage.mp3";
19
-
20
- export const ContentChat = (props) => {
21
- const {
22
- chatType, // "merchant_product" | "order_product" | "ticket"
23
- chatContainerType, // "fixed" | "popUp"
24
- dataChat, // { data | error }
25
- showBtnClose, // boolean
26
- onClickBtnClose, // () => {}
27
- showPopUpChat, // boolean
28
- ticketCompany, // id de la compañía que creó el ticket
29
- activeRetailer, // object retailer
30
- } = props;
31
- const [companies, setCompanies] = useState({}); /* {
32
- companyId: {
33
- name: string,
34
- statusChat: string => current | open | closed
35
- items: [{..}] ,
36
- enabledLoadMore: boolean
37
- },
38
- ...
39
- } chat orderProduct */
40
- const [singleChat, setSingleChat] = useState({
41
- items: undefined,
42
- enabledLoadMore: false,
43
- statusChat: undefined,
44
- }); // chat merchantProduct o ticket
45
- const [activeCompanyId, setActiveCompanyId] = useState(); // number
46
- const [allUsers, setAllUsers] = useState({}); // {...}
47
- const [currentUser, setCurrentUser] = useState({
48
- id: undefined,
49
- companyId: undefined,
50
- });
51
- const [currentArticle, setCurrentArticle] = useState({
52
- status: undefined,
53
- version: undefined,
54
- });
55
- const [lastUpdateDate, setLastUpdateDate] = useState(); // string
56
- const [isLoading, setIsLoading] = useState(true); // boolean
57
- const [showChatsList, setShowChatsList] = useState(false); // boolean
58
- const [processUpdateID, setProcessUpdateID] = useState(); // number
59
- const [startUpdate, setStartUpdate] = useState(0); // number
60
- const [runUpdate, setRunUpdate] = useState(0); // number
61
- const [errorChat, setErrorChat] = useState({
62
- existError: false,
63
- code: undefined,
64
- message: undefined,
65
- errorDetail: undefined,
66
- });
67
- const [errorUpdate, setErrorUpdate] = useState({
68
- startDate: undefined, // Date()
69
- lastDate: undefined, // Date()
70
- });
71
- const [playSound, setPlaySound] = useState(false);
72
-
73
- // matar update al desmontar el componente del chat
74
- useEffect(() => {
75
- return () => {
76
- if (processUpdateID !== undefined) clearTimeout(processUpdateID);
77
- };
78
- }, []);
79
-
80
- const stopUpdate = () => {
81
- if (processUpdateID !== undefined) {
82
- clearTimeout(processUpdateID);
83
- setProcessUpdateID(undefined);
84
- }
85
- };
86
-
87
- // al cargar el componente
88
- useEffect(() => {
89
- //if (dataChat && showPopUpChat) {
90
- if (Object.keys(dataChat || {}).length) {
91
- stopUpdate();
92
- if (dataChat.code) {
93
- setErrorChat({
94
- existError: true,
95
- code: dataChat.code,
96
- message: dataChat.message,
97
- errorDetail: dataChat.errorDetail,
98
- });
99
- setIsLoading(false);
100
- return;
101
- }
102
- if (chatType === "merchant_product") getInitialMerchantProduct();
103
- else if (chatType === "order_product") getInitialOrderProduct();
104
- else if (chatType === "product_status") getInitialProductStatus();
105
- else getInitialTicket();
106
- }
107
- if (!showPopUpChat) {
108
- stopUpdate();
109
- }
110
- }, [dataChat, showPopUpChat]);
111
-
112
- // comenzar temporizador del update de 20s
113
- useEffect(() => {
114
- // return; // -- descomentarizar para hacer pruebas sin update
115
- if (startUpdate === 0) return;
116
- const processID = setTimeout(() => {
117
- setRunUpdate((prev) => prev + 1);
118
- }, 15000);
119
- setProcessUpdateID(processID);
120
- return () => clearTimeout(processID);
121
- }, [startUpdate]);
122
-
123
- // ejecutar update
124
- useEffect(() => {
125
- if (chatType === "merchant_product") {
126
- if (singleChat.items) getUpdateLatestMerchantProduct(true);
127
- else getInitialMerchantProduct();
128
- } else if (chatType === "order_product") {
129
- if (companies) getUpdateLatestOrderProduct(true);
130
- else getInitialOrderProduct();
131
- } else if (chatType === "product_status") {
132
- getInitialProductStatus();
133
- } else {
134
- if (singleChat.items) getUpdateLatestTicket(true);
135
- else getInitialTicket();
136
- }
137
- }, [runUpdate]);
138
-
139
- /*=======================================================================
140
- PETICION GET INICIAL SEGUN EL TIPO DE CHAT
141
- ======================================================================= */
142
- const getInitialProductStatus = async () => {
143
- const paramsQuery = {
144
- articleData: JSON.stringify({
145
- articleId: JSON.stringify(dataChat.id),
146
- version: JSON.stringify(dataChat.version),
147
- retailerId: JSON.stringify(dataChat.retailerId),
148
- status: dataChat.status,
149
- })
150
- };
151
- const paramsHeaders = { Authorization: dataChat.userToken };
152
- const response = await fetchGET(
153
- process.env.REACT_APP_READ_MESSAGES,
154
- paramsQuery,
155
- paramsHeaders
156
- );
157
- if (!response.body) {
158
- setErrorChat({
159
- existError: true,
160
- code: 400,
161
- message: response.message,
162
- errorDetail: response.errorDetail,
163
- });
164
- setIsLoading(false);
165
- return;
166
- }
167
- // success
168
- setStartUpdate((prev) => prev + 1);
169
- setCurrentUser({
170
- id: response.body.data.currentUserId,
171
- companyId: response.body.data.currentCompanyId,
172
- });
173
- setLastUpdateDate(response.body.data.lastUpdateDate);
174
- setAllUsers(response.body.users);
175
- setSingleChat({
176
- items: response.body.items,
177
- enabledLoadMore: response.body.items.length === 50,
178
- });
179
- setErrorChat({ existError: false });
180
- setIsLoading(false);
181
- };
182
-
183
- const getInitialMerchantProduct = async () => {
184
- const paramsQuery = {
185
- getType: "initial",
186
- id: JSON.stringify(dataChat.id),
187
- version: JSON.stringify(dataChat.version),
188
- };
189
- const paramsHeaders = { Authorization: dataChat.userToken };
190
- const response = await fetchGET(
191
- process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
192
- paramsQuery,
193
- paramsHeaders
194
- );
195
- if (!response.body) {
196
- setErrorChat({
197
- existError: true,
198
- code: 400,
199
- message: response.message,
200
- errorDetail: response.errorDetail,
201
- });
202
- setIsLoading(false);
203
- return;
204
- }
205
- // success
206
- setStartUpdate((prev) => prev + 1);
207
- setCurrentUser({
208
- id: response.body.data.currentUserId,
209
- companyId: response.body.data.currentCompanyId,
210
- });
211
- setLastUpdateDate(response.body.data.lastUpdateDate);
212
- setAllUsers(response.body.users);
213
- setSingleChat({
214
- items: response.body.items,
215
- enabledLoadMore: response.body.items.length === 50,
216
- });
217
- setErrorChat({ existError: false });
218
- setIsLoading(false);
219
- };
220
-
221
- const getInitialOrderProduct = async () => {
222
- clearTimeout(processUpdateID); // finalizamos el temporizador
223
- const paramsQuery = {
224
- getType: "initial",
225
- id: JSON.stringify(dataChat.id),
226
- orderId: JSON.stringify(dataChat.orderId),
227
- retailerId: JSON.stringify(dataChat.retailerId),
228
- };
229
- const paramsHeaders = { Authorization: dataChat.userToken };
230
- const response = await fetchGET(
231
- process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
232
- paramsQuery,
233
- paramsHeaders
234
- );
235
- setStartUpdate((prev) => prev + 1); // TEMPORAL
236
- if (!response.body) {
237
- setErrorChat({
238
- existError: true,
239
- code: 400,
240
- message: response.message,
241
- errorDetail: response.errorDetail,
242
- });
243
- setIsLoading(false);
244
- return;
245
- }
246
- // success
247
- setCurrentUser({
248
- id: response.body.data.currentUserId,
249
- companyId: response.body.data.currentCompanyId,
250
- });
251
- setLastUpdateDate(response.body.data.lastUpdateDate);
252
- setCurrentArticle({
253
- status: response.body.data.status,
254
- version: response.body.data.version,
255
- });
256
- setAllUsers(response.body.users);
257
- const companiesList = response.body.companies;
258
- const companiesIdList = Object.keys(companiesList);
259
- let companyActive;
260
- // encontrar el chat inicial a cargar y si se debe permitir cargar mas
261
- for (const companyId of companiesIdList) {
262
- if (companiesList[companyId].items.length < 50) {
263
- companiesList[companyId].enabledLoadMore = false;
264
- } else {
265
- companiesList[companyId].enabledLoadMore = true;
266
- }
267
-
268
- if (companiesList[companyId].statusChat === "current") {
269
- companyActive = Number(companyId);
270
- }
271
- }
272
- if (!companyActive && companiesIdList.length) {
273
- companyActive = Number(companiesIdList[0]);
274
- }
275
- setCompanies(companiesList);
276
- if (companyActive) setActiveCompanyId(companyActive);
277
- setErrorChat({ existError: false });
278
- setIsLoading(false);
279
- };
280
-
281
- const getInitialTicket = async () => {
282
- stopUpdate(); // finalizamos el temporizador
283
- const dataUser = {
284
- id: dataChat.currentUser?.id,
285
- companyId: dataChat.currentUser?.companyId,
286
- isUserTech: dataChat.currentUser?.isUserTech,
287
- };
288
- const paramsQuery = {
289
- //id: JSON.stringify(dataChat.id),
290
- id: dataChat.id,
291
- getType: "initial",
292
- //currentUser: encodeUriJson(dataUser),
293
- currentUser: encodeURIComponent(JSON.stringify(dataUser)),
294
- currentItemsFront: encodeUriJson(getItemsIdSingleChat()),
295
- };
296
- const response = await fetchGET(
297
- process.env.REACT_APP_TICKETS_CHAT_ENDPOINT,
298
- paramsQuery,
299
- { Authorization: dataChat.currentUser?.token }
300
- );
301
- // programar update en 20s
302
- setStartUpdate((prev) => prev + 1);
303
- if (!response.body) {
304
- setErrorChat({
305
- existError: true,
306
- code: 400,
307
- message: response.message,
308
- errorDetail: response.errorDetail,
309
- });
310
- setIsLoading(false);
311
- return;
312
- }
313
- // success
314
- setLastUpdateDate(response.body.data.lastUpdateDate);
315
- setAllUsers(response.body.users);
316
- setSingleChat({
317
- items: response.body.items,
318
- enabledLoadMore: response.body.items.length === 50,
319
- statusChat: dataChat.statusChat,
320
- });
321
- setErrorChat({ existError: false });
322
- setIsLoading(false);
323
- };
324
-
325
- /*=======================================================================
326
- PETICION GET LOAD_MORE SEGUN EL TIPO DE CHAT
327
- ======================================================================= */
328
- const getLoadMoreMerchantProduct = async () => {
329
- clearTimeout(processUpdateID); // finalizamos el temporizador
330
- let date = singleChat.items[singleChat.items.length - 1].date;
331
- const paramsQuery = {
332
- getType: "loadMore",
333
- id: JSON.stringify(dataChat.id),
334
- version: JSON.stringify(dataChat.version),
335
- date: encodeURIComponent(date),
336
- };
337
- const response = await fetchGET(
338
- process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
339
- paramsQuery
340
- );
341
- //setStartUpdate((prev) => prev + 1); // comendar un nuevo temporizador
342
- if (!response.body) {
343
- return {
344
- title: response.message,
345
- message: response.errorDetail,
346
- };
347
- }
348
- // success
349
- // actualizar la lista de los users
350
- updateAllUsers(response.body.users);
351
- // actualizar los items del chat
352
- let newSingleChat = { ...singleChat };
353
- newSingleChat.items = addOldItemsChat(
354
- newSingleChat.items,
355
- response.body.items
356
- );
357
- newSingleChat.enabledLoadMore = response.body.items.length === 50;
358
- setSingleChat(newSingleChat);
359
- };
360
-
361
- const getLoadMoreOrderProduct = async () => {
362
- clearTimeout(processUpdateID); // finalizamos el temporizador
363
- let company = companies[activeCompanyId];
364
- let date = company.items[company.items.length - 1].date;
365
- const paramsQuery = {
366
- getType: "loadMore",
367
- id: JSON.stringify(dataChat.id),
368
- orderId: JSON.stringify(dataChat.orderId),
369
- version: JSON.stringify(currentArticle.version),
370
- currentCompanyId: JSON.stringify(currentUser.companyId),
371
- date: encodeURIComponent(date),
372
- othersCompanyId: JSON.stringify([activeCompanyId]),
373
- };
374
- const response = await fetchGET(
375
- process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
376
- paramsQuery
377
- );
378
- //setStartUpdate((prev) => prev + 1); // comendar un nuevo temporizador
379
- if (!response.body) {
380
- return {
381
- title: response.message,
382
- message: response.errorDetail,
383
- };
384
- }
385
- // success
386
- // actualizar la lista de los users
387
- updateAllUsers(response.body.users);
388
- // actualizar los items del chat y la lista de users
389
- company.items = addOldItemsChat(company.items, response.body.items);
390
- company.enabledLoadMore = response.body.items.length === 50;
391
- setCompanies((prev) => ({
392
- ...prev,
393
- [activeCompanyId]: company,
394
- }));
395
- };
396
-
397
- // este GET obtiene la lista de compañoas con las que se puede chatear
398
- const getLoadMoreTicket = async () => {
399
- stopUpdate(); // finalizamos el temporizador
400
- let date = singleChat.items[singleChat.items.length - 1].date;
401
- const dataUser = {
402
- id: dataChat.currentUser?.id,
403
- companyId: dataChat.currentUser?.companyId,
404
- isUserTech: dataChat.currentUser?.isUserTech,
405
- };
406
- const paramsQuery = {
407
- id: JSON.stringify(dataChat.id),
408
- getType: "loadMore",
409
- date: encodeURIComponent(date),
410
- currentUser: encodeUriJson(dataUser),
411
- currentItemsFront: encodeUriJson(getItemsIdSingleChat()),
412
- };
413
- const response = await fetchGET(
414
- process.env.REACT_APP_TICKETS_CHAT_ENDPOINT,
415
- paramsQuery,
416
- { Authorization: dataChat.currentUser?.token }
417
- );
418
- //programar update en 20s
419
- setStartUpdate((prev) => prev + 1);
420
- if (!response.body) {
421
- return {
422
- title: response.message,
423
- message: response.errorDetail,
424
- };
425
- }
426
- // success
427
- // actualizar la lista de los users
428
- updateAllUsers(response.body.users);
429
- // actualizar los items del chat
430
- let newSingleChat = { ...singleChat };
431
- newSingleChat.items = addOldItemsChat(
432
- newSingleChat.items,
433
- response.body.items
434
- );
435
- newSingleChat.enabledLoadMore = response.body.items.length === 50;
436
- setSingleChat(newSingleChat);
437
- };
438
-
439
- /*=======================================================================
440
- PETICION GET UPDATE_LATEST SEGUN EL TIPO DE CHAT
441
- ======================================================================= */
442
- const getUpdateLatestMerchantProduct = async (fromUpdate = false) => {
443
- const paramsQuery = {
444
- getType: "updateLatest",
445
- id: JSON.stringify(dataChat.id),
446
- version: JSON.stringify(dataChat.version),
447
- date: encodeURIComponent(lastUpdateDate),
448
- };
449
- const paramsHeaders = { Authorization: dataChat.userToken };
450
- const response = await fetchGET(
451
- process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
452
- paramsQuery,
453
- paramsHeaders
454
- );
455
- if (!response.body) {
456
- console.log("ERROR updateLatest:", {
457
- message: response.message,
458
- errorDetail: response.errorDetail,
459
- });
460
- return;
461
- }
462
- // success
463
- setStartUpdate((prev) => prev + 1);
464
- setLastUpdateDate(response.body.data.lastUpdateDate);
465
- // actualizar la lista de los users
466
- updateAllUsers(response.body.users);
467
- // actualizar los items del chat
468
- let newSingleChat = { ...singleChat };
469
- newSingleChat.items = addNewItemsChat(
470
- newSingleChat.items,
471
- response.body.items,
472
- fromUpdate
473
- );
474
- setSingleChat(newSingleChat);
475
- };
476
-
477
- const getUpdateLatestOrderProduct = async (fromUpdate = false) => {
478
- const paramsQuery = {
479
- getType: "updateLatest",
480
- id: JSON.stringify(dataChat.id),
481
- orderId: JSON.stringify(dataChat.orderId),
482
- retailerId: JSON.stringify(dataChat.retailerId),
483
- version: JSON.stringify(currentArticle.version),
484
- status: currentArticle.status,
485
- currentCompanyId: JSON.stringify(currentUser.companyId),
486
- othersCompanyId: encodeURIComponent(
487
- JSON.stringify(Object.keys(companies))
488
- ),
489
- date: encodeURIComponent(lastUpdateDate),
490
- };
491
- const response = await fetchGET(
492
- process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
493
- paramsQuery
494
- );
495
- if (!response.body) {
496
- console.log("ERROR update: ", {
497
- message: response.message,
498
- errorDetail: response.errorDetail,
499
- });
500
- return;
501
- }
502
- // success
503
- setStartUpdate((prev) => prev + 1);
504
- // cuando cambie la lista de chats por un cambio de version o estatus
505
- if (response.body.data.status) {
506
- setIsLoading(true);
507
- setTimeout(() => {
508
- setLastUpdateDate(response.body.data.lastUpdateDate);
509
- setCurrentArticle({
510
- status: response.body.data.status,
511
- version: response.body.data.version,
512
- });
513
- setAllUsers(response.body.users);
514
- const companiesList = response.body.companies;
515
- const companiesIdList = Object.keys(companiesList);
516
- let companyActive;
517
- // encontrar el chat inicial a cargar y si se debe permitir cargar mas
518
- for (const companyId of companiesIdList) {
519
- if (companiesList[companyId].items.length < 50) {
520
- companiesList[companyId].enabledLoadMore = false;
521
- } else {
522
- companiesList[companyId].enabledLoadMore = true;
523
- }
524
-
525
- if (companiesList[companyId].statusChat === "current") {
526
- companyActive = Number(companyId);
527
- }
528
- }
529
- if (!companyActive && companiesIdList.length) {
530
- companyActive = Number(companiesIdList[0]);
531
- }
532
- setCompanies(companiesList);
533
- if (companyActive) setActiveCompanyId(companyActive);
534
- setErrorChat({ existError: false });
535
- setIsLoading(false);
536
- }, 2000);
537
- }
538
- // cuando se hizo un update de los mismos chats
539
- else {
540
- setLastUpdateDate(response.body.data.lastUpdateDate);
541
- // actualizar la lista de los users
542
- updateAllUsers(response.body.users);
543
- // actualizar los items de los chats
544
- let companiesList = { ...companies };
545
- Object.keys(response.body.companies).forEach((companyId) => {
546
- companiesList[companyId].items = addNewItemsChat(
547
- companiesList[companyId].items,
548
- response.body.companies[companyId].items,
549
- fromUpdate
550
- );
551
- });
552
- setCompanies(companiesList);
553
- }
554
- };
555
-
556
- const getUpdateLatestTicket = async (fromUpdate = false) => {
557
- if (singleChat.statusChat === "closed") return;
558
- const dataUser = {
559
- id: dataChat.currentUser?.id,
560
- companyId: dataChat.currentUser?.companyId,
561
- isUserTech: dataChat.currentUser?.isUserTech,
562
- };
563
- const paramsQuery = {
564
- id: JSON.stringify(dataChat.id),
565
- getType: "updateLatest",
566
- date: encodeURIComponent(lastUpdateDate),
567
- currentUser: encodeUriJson(dataUser),
568
- currentItemsFront: encodeUriJson(getItemsIdSingleChat()),
569
- };
570
- const response = await fetchGET(
571
- process.env.REACT_APP_TICKETS_CHAT_ENDPOINT,
572
- paramsQuery,
573
- { Authorization: dataChat.currentUser?.token }
574
- );
575
- //programar update en 20s
576
- setStartUpdate((prev) => prev + 1);
577
- if (!response.body) {
578
- if (errorUpdate.startDate) {
579
- setErrorUpdate((prev) => ({
580
- ...prev,
581
- lastDate: new Date(),
582
- }));
583
- } else {
584
- setErrorUpdate((prev) => ({
585
- startDate: new Date(),
586
- }));
587
- }
588
- console.log("ERROR updateLatest:", {
589
- message: response.message,
590
- errorDetail: response.errorDetail,
591
- });
592
- return;
593
- }
594
- // limpiar error update
595
- if (errorUpdate.startDate) {
596
- setErrorUpdate({});
597
- }
598
- // success
599
- setLastUpdateDate(response.body.data.lastUpdateDate);
600
- // actualizar la lista de los users
601
- updateAllUsers(response.body.users);
602
- // actualizar los items del chat
603
- if (response.body.items.length === 0) return;
604
- let newSingleChat = { ...singleChat };
605
- newSingleChat.items = addNewItemsChat(
606
- newSingleChat.items,
607
- response.body.items,
608
- fromUpdate
609
- );
610
- newSingleChat.statusChat = response.body.data.statusChat;
611
-
612
- setSingleChat(newSingleChat);
613
- };
614
-
615
- /*=======================================================================
616
- FUNCION QUE EJECUTA EL MICROSERVICIO CREATE-ITEM
617
- Este metodo recibe los items que queremos agregar al chat.
618
- requiere:
619
- => items: [ { type , value } , ... ]
620
- NOTA: si se quiere agregar un mensaje mandar un array con un object
621
- example: [ {
622
- type: "message" ,
623
- value: "mi mensaje"
624
- } ]
625
- ======================================================================= */
626
- const createItemsChat = async (items = []) => {
627
- if (items.length === 0) {
628
- return {
629
- message:
630
- "No se especifico ningun mensaje, imagen o archivo nuevo " +
631
- "que se quiera enviar al chat",
632
- errorDetail: "Reporta esto a TI",
633
- };
634
- }
635
- for (const item of items) {
636
- if (!["message", "img", "file"].includes(item.type)) {
637
- return {
638
- message:
639
- "Uno de los elementos que se quiere enviar al chat " +
640
- `no es un tipo valido "${item.type}"`,
641
- errorDetail: "Reporta esto a TI",
642
- };
643
- }
644
- if (isStringEmpty(item.value)) {
645
- return {
646
- message:
647
- "Uno de los elementos que se quiere enviar al chat " +
648
- `contiene un valor vacio`,
649
- errorDetail: "Reporta esto a TI",
650
- };
651
- }
652
- }
653
- let errorCreate;
654
- stopUpdate(); // finalizamos el temporizador
655
-
656
- // enviar items a la BD
657
- if (chatType === "merchant_product") {
658
- errorCreate = await createItemsMerchantProduct(items);
659
- } else if (chatType === "product_status") {
660
- errorCreate = await createItemsProductStatus(items);
661
- } else if (chatType === "order_product") {
662
- errorCreate = await createItemsOrderProduct(items);
663
- } else errorCreate = await createItemsTicket(items);
664
-
665
- // actualizar chat para que aparezcan los items enviados
666
- if (["merchant_product", "product_status"].includes(chatType)) {
667
- await getUpdateLatestMerchantProduct();
668
- } else if (chatType === "order_product") {
669
- await getUpdateLatestOrderProduct();
670
- } else await getUpdateLatestTicket();
671
-
672
- // cuando no se pudieron guardar los items
673
- if (errorCreate) {
674
- return errorCreate;
675
- }
676
- };
677
-
678
- const createItemsMerchantProduct = async (items = []) => {
679
- const { id, version, orderId } = dataChat;
680
- const { id: retailerId } = activeRetailer;
681
- const paramsBody = { id, version, items, retailerId };
682
- if (chatType === "product_status") paramsBody["orderId"] = orderId;
683
- const paramsHeaders = { Authorization: dataChat.userToken };
684
- const response = await fetchPOST(
685
- process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
686
- paramsBody,
687
- paramsHeaders
688
- );
689
- if (!response.body) {
690
- return {
691
- message: response.message,
692
- errorDetail: response.errorDetail,
693
- };
694
- }
695
- };
696
- const createItemsProductStatus = async (items = []) => {
697
- const { id, version, orderId, status } = dataChat;
698
- const { id: retailerId } = activeRetailer;
699
- const paramsBody = { id, version, items, retailerId, orderId, status };
700
- const paramsHeaders = { Authorization: dataChat.userToken };
701
- const response = await fetchPOST(
702
- process.env.REACT_APP_CREATE_MESSAGES,
703
- paramsBody,
704
- paramsHeaders
705
- );
706
- if (!response.body) {
707
- return {
708
- message: response.message,
709
- errorDetail: response.errorDetail,
710
- };
711
- }
712
- };
713
-
714
- const createItemsOrderProduct = async (items = []) => {
715
- const paramsBody = {
716
- id: dataChat.id,
717
- version: currentArticle.version,
718
- items,
719
- orderId: dataChat.orderId,
720
- retailerId: activeRetailer?.id,
721
- };
722
- const paramsHeaders = { Authorization: dataChat.userToken };
723
- const response = await fetchPOST(
724
- process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
725
- paramsBody,
726
- paramsHeaders
727
- );
728
- if (!response.body) {
729
- return {
730
- message: response.message,
731
- errorDetail: response.errorDetail,
732
- };
733
- }
734
- };
735
-
736
- const createItemsTicket = async (items = []) => {
737
- const paramsBody = {
738
- id: JSON.stringify(dataChat.id),
739
- userId: JSON.stringify(dataChat.currentUser.id),
740
- items: JSON.stringify(items),
741
- };
742
- const paramsHeaders = { Authorization: dataChat.userToken };
743
- const response = await fetchPOST(
744
- process.env.REACT_APP_TICKETS_CHAT_ENDPOINT,
745
- paramsBody,
746
- paramsHeaders
747
- );
748
- if (!response.body) {
749
- return {
750
- message: response.message,
751
- errorDetail: response.errorDetail,
752
- };
753
- }
754
- };
755
-
756
- /*=======================================================================
757
- SECCION DE FUNCIONES
758
- ======================================================================= */
759
- const isSingleChat = () => {
760
- if (
761
- chatType === "merchant_product" ||
762
- chatType === "ticket" ||
763
- chatType === "product_status"
764
- ) {
765
- return true;
766
- }
767
- if (companies && Object.keys(companies).length < 2) return true;
768
- else return false;
769
- };
770
-
771
- const getItemsIdSingleChat = () => {
772
- const itemsId = {};
773
- if (Array.isArray(singleChat.items)) {
774
- singleChat.items.forEach((item) => {
775
- if (isValidNaturalNumber(item.id)) itemsId[item.id] = true;
776
- });
777
- }
778
- return itemsId;
779
- };
780
-
781
- const getChatCompany = () => {
782
- if (chatType === "merchant_product" || chatType === "ticket") {
783
- return undefined;
784
- }
785
- if (companies && companies[activeCompanyId]) {
786
- return {
787
- ...companies[activeCompanyId],
788
- id: activeCompanyId,
789
- };
790
- }
791
- return undefined;
792
- };
793
-
794
- const addOldItemsChat = (currentItems = [], newItems = []) => {
795
- let items = currentItems.slice();
796
- let itemsId = {};
797
- items.forEach((item) => {
798
- itemsId[item.id] = true;
799
- });
800
- newItems.forEach((item) => {
801
- if (!itemsId[item.id]) {
802
- items.push(item);
803
- itemsId[item.id] = true;
804
- }
805
- });
806
- return items;
807
- };
808
-
809
- const addNewItemsChat = (
810
- currentItems = [],
811
- newItems = [],
812
- fromUpdate = false
813
- ) => {
814
- let itemsId = {};
815
- currentItems.forEach((item) => {
816
- itemsId[item.id] = item;
817
- });
818
- let thereAreNewItems = false;
819
- newItems.forEach((newitem) => {
820
- if (!itemsId[newitem.id]) {
821
- itemsId[newitem.id] = newitem;
822
- thereAreNewItems = true;
823
- }
824
- });
825
- if (thereAreNewItems && fromUpdate) {
826
- setPlaySound(true);
827
- setTimeout(() => {
828
- setPlaySound(false);
829
- }, 5000);
830
- }
831
- if (chatType !== "ticket") {
832
- return Object.values(itemsId).sort((a, b) => {
833
- if (a.id > b.id) return 1;
834
- if (a.id < b.id) return -1;
835
- return 0;
836
- });
837
- } else {
838
- return Object.values(itemsId).reverse();
839
- }
840
- };
841
-
842
- const updateAllUsers = (newUsers = {}) => {
843
- let currentUsers = { ...allUsers };
844
- Object.keys(newUsers).forEach((userId) => {
845
- if (!currentUsers[userId]) {
846
- currentUsers[userId] = newUsers[userId];
847
- }
848
- });
849
- setAllUsers(currentUsers);
850
- };
851
-
852
- const renderBodyChat = () => {
853
- if (isLoading) return <Loading />;
854
- if (errorChat.existError) {
855
- return (
856
- <NotFound
857
- code={errorChat.code}
858
- message={errorChat.message}
859
- details={errorChat.errorDetail}
860
- />
861
- );
862
- }
863
- // cuando se quiere ver la lista de chats
864
- if (showChatsList) {
865
- return (
866
- <ChatLists
867
- companies={companies}
868
- currentCompanyId={currentUser?.companyId}
869
- onClickCompany={(companyIdSelected) => {
870
- setActiveCompanyId(Number(companyIdSelected));
871
- setShowChatsList(false);
872
- }}
873
- />
874
- );
875
- }
876
- // mostrar chat?
877
- let items;
878
- let enabledLoadMore;
879
- if (["merchant_product", "ticket", "product_status"].includes(chatType)) {
880
- items = singleChat.items;
881
- enabledLoadMore = singleChat.enabledLoadMore;
882
- }
883
- // ORDER_PRODUCT
884
- else if (companies) {
885
- // caso 0 chats
886
- if (Object.keys(companies).length === 0) {
887
- return (
888
- <div className="container-chatEmpty">
889
- <CustomIcon
890
- className="icon-chat"
891
- transparent
892
- size={35}
893
- icon={IconChat}
894
- type={"gray"}
895
- />
896
- <label>
897
- De acuerdo al estatus del producto, tu compañia no tiene
898
- disponible ningun chat abierto o cerrado
899
- </label>
900
- </div>
901
- );
902
- }
903
- // caso 1 o mas chats
904
- if (companies[activeCompanyId]) {
905
- items = companies[activeCompanyId].items;
906
- enabledLoadMore = companies[activeCompanyId].enabledLoadMore;
907
- }
908
- }
909
- if (items) {
910
- let containerItems = null;
911
- if (items.length) {
912
- containerItems = (
913
- <ContainerItems
914
- items={items}
915
- users={allUsers}
916
- showBtnLoadMore={enabledLoadMore}
917
- chatType={chatType}
918
- activeCompanyId={activeCompanyId}
919
- ticketCompany={ticketCompany}
920
- currentUser={
921
- ["merchant_product", "order_product", "product_status"].includes(
922
- chatType
923
- )
924
- ? currentUser
925
- : dataChat.currentUser
926
- }
927
- onClickBtnLoadMore={
928
- chatType === "merchant_product"
929
- ? getLoadMoreMerchantProduct
930
- : chatType === "order_product"
931
- ? getLoadMoreOrderProduct
932
- : getLoadMoreTicket
933
- }
934
- />
935
- );
936
- } else {
937
- containerItems = (
938
- <div className="container-chatEmpty">
939
- <CustomIcon
940
- className="icon-chat"
941
- size={35}
942
- icon={IconChat}
943
- type={"gray"}
944
- transparent
945
- />
946
- <label>Este chat no tiene mensajes</label>
947
- </div>
948
- );
949
- }
950
- return (
951
- <>
952
- {containerItems}
953
- <Footer
954
- chatType={chatType}
955
- dataChat={
956
- chatType === "merchant_product"
957
- ? { id: dataChat.id, version: dataChat.version }
958
- : chatType === "order_product"
959
- ? { id: dataChat.id, version: currentArticle.version }
960
- : chatType === "ticket"
961
- ? { id: dataChat.id }
962
- : chatType === "product_status"
963
- ? {
964
- id: dataChat.id,
965
- version: dataChat.version,
966
- retailerId: dataChat.retailerId,
967
- }
968
- : undefined
969
- }
970
- chatCompany={getChatCompany()}
971
- statusChat={
972
- chatType === "order_product"
973
- ? getChatCompany()?.statusChat
974
- : chatType === "ticket"
975
- ? singleChat.statusChat
976
- : undefined
977
- }
978
- messageDisabled={
979
- chatType === "order_product"
980
- ? `La conversación con ${getChatCompany()?.name} ha finalizado`
981
- : chatType === "ticket"
982
- ? "Ticket cerrado"
983
- : `La conversación ha finalizado`
984
- }
985
- createItemsChat={createItemsChat}
986
- errorUpdate={errorUpdate}
987
- />
988
- </>
989
- );
990
- }
991
- return <Loading />;
992
- };
993
-
994
- return (
995
- <>
996
- <Container>
997
- {/* header */}
998
- {(chatContainerType !== "fixed" || !isSingleChat()) && (
999
- <Header
1000
- showBtnClose={showBtnClose}
1001
- onClickBtnClose={onClickBtnClose}
1002
- showChatsList={showChatsList}
1003
- chatCompany={getChatCompany()}
1004
- multipleCompanies={!isSingleChat()}
1005
- onClickBtnChooseChat={() => {
1006
- setShowChatsList(true);
1007
- }}
1008
- />
1009
- )}
1010
- {/* body */}
1011
- {renderBodyChat()}
1012
- </Container>
1013
- <ReactHowler src={newMessage} playing={playSound} />
1014
- </>
1015
- );
1016
- };
1
+ import ReactHowler from "react-howler";
2
+ import { Container } from "./styles";
3
+ import { useEffect, useState } from "react";
4
+ import { NotFound } from "../../../atoms/NotFound";
5
+ import { Header } from "../Header";
6
+ import { faComments as IconChat } from "@fortawesome/free-solid-svg-icons";
7
+ import { Loading } from "../../../atoms/Loading";
8
+ import { ContainerItems } from "../ContainerItems";
9
+ import { Footer } from "../Footer";
10
+ import { ChatLists } from "../ChatLists";
11
+ import { CustomIcon } from "../../../atoms/CustomIcon";
12
+ import { fetchGET, fetchPOST } from "../../../../global-files/handle_http";
13
+ import {
14
+ encodeUriJson,
15
+ isStringEmpty,
16
+ isValidNaturalNumber,
17
+ } from "../../../../global-files/utils";
18
+ import newMessage from "../../../../assets/sounds/newMessage.mp3";
19
+
20
+ export const ContentChat = (props) => {
21
+ const {
22
+ chatType, // "merchant_product" | "order_product" | "ticket"
23
+ chatContainerType, // "fixed" | "popUp"
24
+ dataChat, // { data | error }
25
+ showBtnClose, // boolean
26
+ onClickBtnClose, // () => {}
27
+ showPopUpChat, // boolean
28
+ ticketCompany, // id de la compañía que creó el ticket
29
+ activeRetailer, // object retailer
30
+ } = props;
31
+ const [companies, setCompanies] = useState({}); /* {
32
+ companyId: {
33
+ name: string,
34
+ statusChat: string => current | open | closed
35
+ items: [{..}] ,
36
+ enabledLoadMore: boolean
37
+ },
38
+ ...
39
+ } chat orderProduct */
40
+ const [singleChat, setSingleChat] = useState({
41
+ items: undefined,
42
+ enabledLoadMore: false,
43
+ statusChat: undefined,
44
+ }); // chat merchantProduct o ticket
45
+ const [activeCompanyId, setActiveCompanyId] = useState(); // number
46
+ const [allUsers, setAllUsers] = useState({}); // {...}
47
+ const [currentUser, setCurrentUser] = useState({
48
+ id: undefined,
49
+ companyId: undefined,
50
+ });
51
+ const [currentArticle, setCurrentArticle] = useState({
52
+ status: undefined,
53
+ version: undefined,
54
+ });
55
+ const [lastUpdateDate, setLastUpdateDate] = useState(); // string
56
+ const [isLoading, setIsLoading] = useState(true); // boolean
57
+ const [showChatsList, setShowChatsList] = useState(false); // boolean
58
+ const [processUpdateID, setProcessUpdateID] = useState(); // number
59
+ const [startUpdate, setStartUpdate] = useState(0); // number
60
+ const [runUpdate, setRunUpdate] = useState(0); // number
61
+ const [errorChat, setErrorChat] = useState({
62
+ existError: false,
63
+ code: undefined,
64
+ message: undefined,
65
+ errorDetail: undefined,
66
+ });
67
+ const [errorUpdate, setErrorUpdate] = useState({
68
+ startDate: undefined, // Date()
69
+ lastDate: undefined, // Date()
70
+ });
71
+ const [playSound, setPlaySound] = useState(false);
72
+
73
+ // matar update al desmontar el componente del chat
74
+ useEffect(() => {
75
+ return () => {
76
+ if (processUpdateID !== undefined) clearTimeout(processUpdateID);
77
+ };
78
+ }, []);
79
+
80
+ const stopUpdate = () => {
81
+ if (processUpdateID !== undefined) {
82
+ clearTimeout(processUpdateID);
83
+ setProcessUpdateID(undefined);
84
+ }
85
+ };
86
+
87
+ // al cargar el componente
88
+ useEffect(() => {
89
+ //if (dataChat && showPopUpChat) {
90
+ if (Object.keys(dataChat || {}).length) {
91
+ stopUpdate();
92
+ if (dataChat.code) {
93
+ setErrorChat({
94
+ existError: true,
95
+ code: dataChat.code,
96
+ message: dataChat.message,
97
+ errorDetail: dataChat.errorDetail,
98
+ });
99
+ setIsLoading(false);
100
+ return;
101
+ }
102
+ if (chatType === "merchant_product") getInitialMerchantProduct();
103
+ else if (chatType === "order_product") getInitialOrderProduct();
104
+ else if (chatType === "product_status") getInitialProductStatus();
105
+ else getInitialTicket();
106
+ }
107
+ if (!showPopUpChat) {
108
+ stopUpdate();
109
+ }
110
+ }, [dataChat, showPopUpChat]);
111
+
112
+ // comenzar temporizador del update de 20s
113
+ useEffect(() => {
114
+ // return; // -- descomentarizar para hacer pruebas sin update
115
+ if (startUpdate === 0) return;
116
+ const processID = setTimeout(() => {
117
+ setRunUpdate((prev) => prev + 1);
118
+ }, 15000);
119
+ setProcessUpdateID(processID);
120
+ return () => clearTimeout(processID);
121
+ }, [startUpdate]);
122
+
123
+ // ejecutar update
124
+ useEffect(() => {
125
+ if (chatType === "merchant_product") {
126
+ if (singleChat.items) getUpdateLatestMerchantProduct(true);
127
+ else getInitialMerchantProduct();
128
+ } else if (chatType === "order_product") {
129
+ if (companies) getUpdateLatestOrderProduct(true);
130
+ else getInitialOrderProduct();
131
+ } else if (chatType === "product_status") {
132
+ getInitialProductStatus();
133
+ } else {
134
+ if (singleChat.items) getUpdateLatestTicket(true);
135
+ else getInitialTicket();
136
+ }
137
+ }, [runUpdate]);
138
+
139
+ /*=======================================================================
140
+ PETICION GET INICIAL SEGUN EL TIPO DE CHAT
141
+ ======================================================================= */
142
+ const getInitialProductStatus = async () => {
143
+ const paramsQuery = {
144
+ articleData: JSON.stringify({
145
+ articleId: JSON.stringify(dataChat.id),
146
+ version: JSON.stringify(dataChat.version),
147
+ retailerId: JSON.stringify(dataChat.retailerId),
148
+ status: dataChat.status,
149
+ })
150
+ };
151
+ const paramsHeaders = { Authorization: dataChat.userToken };
152
+ const response = await fetchGET(
153
+ process.env.REACT_APP_READ_MESSAGES,
154
+ paramsQuery,
155
+ paramsHeaders
156
+ );
157
+ if (!response.body) {
158
+ setErrorChat({
159
+ existError: true,
160
+ code: 400,
161
+ message: response.message,
162
+ errorDetail: response.errorDetail,
163
+ });
164
+ setIsLoading(false);
165
+ return;
166
+ }
167
+ // success
168
+ setStartUpdate((prev) => prev + 1);
169
+ setCurrentUser({
170
+ id: response.body.data.currentUserId,
171
+ companyId: response.body.data.currentCompanyId,
172
+ });
173
+ setLastUpdateDate(response.body.data.lastUpdateDate);
174
+ setAllUsers(response.body.users);
175
+ setSingleChat({
176
+ items: response.body.items,
177
+ enabledLoadMore: response.body.items.length === 50,
178
+ });
179
+ setErrorChat({ existError: false });
180
+ setIsLoading(false);
181
+ };
182
+
183
+ const getInitialMerchantProduct = async () => {
184
+ const paramsQuery = {
185
+ getType: "initial",
186
+ id: JSON.stringify(dataChat.id),
187
+ version: JSON.stringify(dataChat.version),
188
+ };
189
+ const paramsHeaders = { Authorization: dataChat.userToken };
190
+ const response = await fetchGET(
191
+ process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
192
+ paramsQuery,
193
+ paramsHeaders
194
+ );
195
+ if (!response.body) {
196
+ setErrorChat({
197
+ existError: true,
198
+ code: 400,
199
+ message: response.message,
200
+ errorDetail: response.errorDetail,
201
+ });
202
+ setIsLoading(false);
203
+ return;
204
+ }
205
+ // success
206
+ setStartUpdate((prev) => prev + 1);
207
+ setCurrentUser({
208
+ id: response.body.data.currentUserId,
209
+ companyId: response.body.data.currentCompanyId,
210
+ });
211
+ setLastUpdateDate(response.body.data.lastUpdateDate);
212
+ setAllUsers(response.body.users);
213
+ setSingleChat({
214
+ items: response.body.items,
215
+ enabledLoadMore: response.body.items.length === 50,
216
+ });
217
+ setErrorChat({ existError: false });
218
+ setIsLoading(false);
219
+ };
220
+
221
+ const getInitialOrderProduct = async () => {
222
+ clearTimeout(processUpdateID); // finalizamos el temporizador
223
+ const paramsQuery = {
224
+ getType: "initial",
225
+ id: JSON.stringify(dataChat.id),
226
+ orderId: JSON.stringify(dataChat.orderId),
227
+ retailerId: JSON.stringify(dataChat.retailerId),
228
+ };
229
+ const paramsHeaders = { Authorization: dataChat.userToken };
230
+ const response = await fetchGET(
231
+ process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
232
+ paramsQuery,
233
+ paramsHeaders
234
+ );
235
+ setStartUpdate((prev) => prev + 1); // TEMPORAL
236
+ if (!response.body) {
237
+ setErrorChat({
238
+ existError: true,
239
+ code: 400,
240
+ message: response.message,
241
+ errorDetail: response.errorDetail,
242
+ });
243
+ setIsLoading(false);
244
+ return;
245
+ }
246
+ // success
247
+ setCurrentUser({
248
+ id: response.body.data.currentUserId,
249
+ companyId: response.body.data.currentCompanyId,
250
+ });
251
+ setLastUpdateDate(response.body.data.lastUpdateDate);
252
+ setCurrentArticle({
253
+ status: response.body.data.status,
254
+ version: response.body.data.version,
255
+ });
256
+ setAllUsers(response.body.users);
257
+ const companiesList = response.body.companies;
258
+ const companiesIdList = Object.keys(companiesList);
259
+ let companyActive;
260
+ // encontrar el chat inicial a cargar y si se debe permitir cargar mas
261
+ for (const companyId of companiesIdList) {
262
+ if (companiesList[companyId].items.length < 50) {
263
+ companiesList[companyId].enabledLoadMore = false;
264
+ } else {
265
+ companiesList[companyId].enabledLoadMore = true;
266
+ }
267
+
268
+ if (companiesList[companyId].statusChat === "current") {
269
+ companyActive = Number(companyId);
270
+ }
271
+ }
272
+ if (!companyActive && companiesIdList.length) {
273
+ companyActive = Number(companiesIdList[0]);
274
+ }
275
+ setCompanies(companiesList);
276
+ if (companyActive) setActiveCompanyId(companyActive);
277
+ setErrorChat({ existError: false });
278
+ setIsLoading(false);
279
+ };
280
+
281
+ const getInitialTicket = async () => {
282
+ stopUpdate(); // finalizamos el temporizador
283
+ const dataUser = {
284
+ id: dataChat.currentUser?.id,
285
+ companyId: dataChat.currentUser?.companyId,
286
+ isUserTech: dataChat.currentUser?.isUserTech,
287
+ };
288
+ const paramsQuery = {
289
+ //id: JSON.stringify(dataChat.id),
290
+ id: dataChat.id,
291
+ getType: "initial",
292
+ //currentUser: encodeUriJson(dataUser),
293
+ currentUser: encodeURIComponent(JSON.stringify(dataUser)),
294
+ currentItemsFront: encodeUriJson(getItemsIdSingleChat()),
295
+ };
296
+ const response = await fetchGET(
297
+ process.env.REACT_APP_TICKETS_CHAT_ENDPOINT,
298
+ paramsQuery,
299
+ { Authorization: dataChat.currentUser?.token }
300
+ );
301
+ // programar update en 20s
302
+ setStartUpdate((prev) => prev + 1);
303
+ if (!response.body) {
304
+ setErrorChat({
305
+ existError: true,
306
+ code: 400,
307
+ message: response.message,
308
+ errorDetail: response.errorDetail,
309
+ });
310
+ setIsLoading(false);
311
+ return;
312
+ }
313
+ // success
314
+ setLastUpdateDate(response.body.data.lastUpdateDate);
315
+ setAllUsers(response.body.users);
316
+ setSingleChat({
317
+ items: response.body.items,
318
+ enabledLoadMore: response.body.items.length === 50,
319
+ statusChat: dataChat.statusChat,
320
+ });
321
+ setErrorChat({ existError: false });
322
+ setIsLoading(false);
323
+ };
324
+
325
+ /*=======================================================================
326
+ PETICION GET LOAD_MORE SEGUN EL TIPO DE CHAT
327
+ ======================================================================= */
328
+ const getLoadMoreMerchantProduct = async () => {
329
+ clearTimeout(processUpdateID); // finalizamos el temporizador
330
+ let date = singleChat.items[singleChat.items.length - 1].date;
331
+ const paramsQuery = {
332
+ getType: "loadMore",
333
+ id: JSON.stringify(dataChat.id),
334
+ version: JSON.stringify(dataChat.version),
335
+ date: encodeURIComponent(date),
336
+ };
337
+ const response = await fetchGET(
338
+ process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
339
+ paramsQuery
340
+ );
341
+ //setStartUpdate((prev) => prev + 1); // comendar un nuevo temporizador
342
+ if (!response.body) {
343
+ return {
344
+ title: response.message,
345
+ message: response.errorDetail,
346
+ };
347
+ }
348
+ // success
349
+ // actualizar la lista de los users
350
+ updateAllUsers(response.body.users);
351
+ // actualizar los items del chat
352
+ let newSingleChat = { ...singleChat };
353
+ newSingleChat.items = addOldItemsChat(
354
+ newSingleChat.items,
355
+ response.body.items
356
+ );
357
+ newSingleChat.enabledLoadMore = response.body.items.length === 50;
358
+ setSingleChat(newSingleChat);
359
+ };
360
+
361
+ const getLoadMoreOrderProduct = async () => {
362
+ clearTimeout(processUpdateID); // finalizamos el temporizador
363
+ let company = companies[activeCompanyId];
364
+ let date = company.items[company.items.length - 1].date;
365
+ const paramsQuery = {
366
+ getType: "loadMore",
367
+ id: JSON.stringify(dataChat.id),
368
+ orderId: JSON.stringify(dataChat.orderId),
369
+ version: JSON.stringify(currentArticle.version),
370
+ currentCompanyId: JSON.stringify(currentUser.companyId),
371
+ date: encodeURIComponent(date),
372
+ othersCompanyId: JSON.stringify([activeCompanyId]),
373
+ };
374
+ const response = await fetchGET(
375
+ process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
376
+ paramsQuery
377
+ );
378
+ //setStartUpdate((prev) => prev + 1); // comendar un nuevo temporizador
379
+ if (!response.body) {
380
+ return {
381
+ title: response.message,
382
+ message: response.errorDetail,
383
+ };
384
+ }
385
+ // success
386
+ // actualizar la lista de los users
387
+ updateAllUsers(response.body.users);
388
+ // actualizar los items del chat y la lista de users
389
+ company.items = addOldItemsChat(company.items, response.body.items);
390
+ company.enabledLoadMore = response.body.items.length === 50;
391
+ setCompanies((prev) => ({
392
+ ...prev,
393
+ [activeCompanyId]: company,
394
+ }));
395
+ };
396
+
397
+ // este GET obtiene la lista de compañoas con las que se puede chatear
398
+ const getLoadMoreTicket = async () => {
399
+ stopUpdate(); // finalizamos el temporizador
400
+ let date = singleChat.items[singleChat.items.length - 1].date;
401
+ const dataUser = {
402
+ id: dataChat.currentUser?.id,
403
+ companyId: dataChat.currentUser?.companyId,
404
+ isUserTech: dataChat.currentUser?.isUserTech,
405
+ };
406
+ const paramsQuery = {
407
+ id: JSON.stringify(dataChat.id),
408
+ getType: "loadMore",
409
+ date: encodeURIComponent(date),
410
+ currentUser: encodeUriJson(dataUser),
411
+ currentItemsFront: encodeUriJson(getItemsIdSingleChat()),
412
+ };
413
+ const response = await fetchGET(
414
+ process.env.REACT_APP_TICKETS_CHAT_ENDPOINT,
415
+ paramsQuery,
416
+ { Authorization: dataChat.currentUser?.token }
417
+ );
418
+ //programar update en 20s
419
+ setStartUpdate((prev) => prev + 1);
420
+ if (!response.body) {
421
+ return {
422
+ title: response.message,
423
+ message: response.errorDetail,
424
+ };
425
+ }
426
+ // success
427
+ // actualizar la lista de los users
428
+ updateAllUsers(response.body.users);
429
+ // actualizar los items del chat
430
+ let newSingleChat = { ...singleChat };
431
+ newSingleChat.items = addOldItemsChat(
432
+ newSingleChat.items,
433
+ response.body.items
434
+ );
435
+ newSingleChat.enabledLoadMore = response.body.items.length === 50;
436
+ setSingleChat(newSingleChat);
437
+ };
438
+
439
+ /*=======================================================================
440
+ PETICION GET UPDATE_LATEST SEGUN EL TIPO DE CHAT
441
+ ======================================================================= */
442
+ const getUpdateLatestMerchantProduct = async (fromUpdate = false) => {
443
+ const paramsQuery = {
444
+ getType: "updateLatest",
445
+ id: JSON.stringify(dataChat.id),
446
+ version: JSON.stringify(dataChat.version),
447
+ date: encodeURIComponent(lastUpdateDate),
448
+ };
449
+ const paramsHeaders = { Authorization: dataChat.userToken };
450
+ const response = await fetchGET(
451
+ process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
452
+ paramsQuery,
453
+ paramsHeaders
454
+ );
455
+ if (!response.body) {
456
+ console.log("ERROR updateLatest:", {
457
+ message: response.message,
458
+ errorDetail: response.errorDetail,
459
+ });
460
+ return;
461
+ }
462
+ // success
463
+ setStartUpdate((prev) => prev + 1);
464
+ setLastUpdateDate(response.body.data.lastUpdateDate);
465
+ // actualizar la lista de los users
466
+ updateAllUsers(response.body.users);
467
+ // actualizar los items del chat
468
+ let newSingleChat = { ...singleChat };
469
+ newSingleChat.items = addNewItemsChat(
470
+ newSingleChat.items,
471
+ response.body.items,
472
+ fromUpdate
473
+ );
474
+ setSingleChat(newSingleChat);
475
+ };
476
+
477
+ const getUpdateLatestOrderProduct = async (fromUpdate = false) => {
478
+ const paramsQuery = {
479
+ getType: "updateLatest",
480
+ id: JSON.stringify(dataChat.id),
481
+ orderId: JSON.stringify(dataChat.orderId),
482
+ retailerId: JSON.stringify(dataChat.retailerId),
483
+ version: JSON.stringify(currentArticle.version),
484
+ status: currentArticle.status,
485
+ currentCompanyId: JSON.stringify(currentUser.companyId),
486
+ othersCompanyId: encodeURIComponent(
487
+ JSON.stringify(Object.keys(companies))
488
+ ),
489
+ date: encodeURIComponent(lastUpdateDate),
490
+ };
491
+ const response = await fetchGET(
492
+ process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
493
+ paramsQuery
494
+ );
495
+ if (!response.body) {
496
+ console.log("ERROR update: ", {
497
+ message: response.message,
498
+ errorDetail: response.errorDetail,
499
+ });
500
+ return;
501
+ }
502
+ // success
503
+ setStartUpdate((prev) => prev + 1);
504
+ // cuando cambie la lista de chats por un cambio de version o estatus
505
+ if (response.body.data.status) {
506
+ setIsLoading(true);
507
+ setTimeout(() => {
508
+ setLastUpdateDate(response.body.data.lastUpdateDate);
509
+ setCurrentArticle({
510
+ status: response.body.data.status,
511
+ version: response.body.data.version,
512
+ });
513
+ setAllUsers(response.body.users);
514
+ const companiesList = response.body.companies;
515
+ const companiesIdList = Object.keys(companiesList);
516
+ let companyActive;
517
+ // encontrar el chat inicial a cargar y si se debe permitir cargar mas
518
+ for (const companyId of companiesIdList) {
519
+ if (companiesList[companyId].items.length < 50) {
520
+ companiesList[companyId].enabledLoadMore = false;
521
+ } else {
522
+ companiesList[companyId].enabledLoadMore = true;
523
+ }
524
+
525
+ if (companiesList[companyId].statusChat === "current") {
526
+ companyActive = Number(companyId);
527
+ }
528
+ }
529
+ if (!companyActive && companiesIdList.length) {
530
+ companyActive = Number(companiesIdList[0]);
531
+ }
532
+ setCompanies(companiesList);
533
+ if (companyActive) setActiveCompanyId(companyActive);
534
+ setErrorChat({ existError: false });
535
+ setIsLoading(false);
536
+ }, 2000);
537
+ }
538
+ // cuando se hizo un update de los mismos chats
539
+ else {
540
+ setLastUpdateDate(response.body.data.lastUpdateDate);
541
+ // actualizar la lista de los users
542
+ updateAllUsers(response.body.users);
543
+ // actualizar los items de los chats
544
+ let companiesList = { ...companies };
545
+ Object.keys(response.body.companies).forEach((companyId) => {
546
+ companiesList[companyId].items = addNewItemsChat(
547
+ companiesList[companyId].items,
548
+ response.body.companies[companyId].items,
549
+ fromUpdate
550
+ );
551
+ });
552
+ setCompanies(companiesList);
553
+ }
554
+ };
555
+
556
+ const getUpdateLatestTicket = async (fromUpdate = false) => {
557
+ if (singleChat.statusChat === "closed") return;
558
+ const dataUser = {
559
+ id: dataChat.currentUser?.id,
560
+ companyId: dataChat.currentUser?.companyId,
561
+ isUserTech: dataChat.currentUser?.isUserTech,
562
+ };
563
+ const paramsQuery = {
564
+ id: JSON.stringify(dataChat.id),
565
+ getType: "updateLatest",
566
+ date: encodeURIComponent(lastUpdateDate),
567
+ currentUser: encodeUriJson(dataUser),
568
+ currentItemsFront: encodeUriJson(getItemsIdSingleChat()),
569
+ };
570
+ const response = await fetchGET(
571
+ process.env.REACT_APP_TICKETS_CHAT_ENDPOINT,
572
+ paramsQuery,
573
+ { Authorization: dataChat.currentUser?.token }
574
+ );
575
+ //programar update en 20s
576
+ setStartUpdate((prev) => prev + 1);
577
+ if (!response.body) {
578
+ if (errorUpdate.startDate) {
579
+ setErrorUpdate((prev) => ({
580
+ ...prev,
581
+ lastDate: new Date(),
582
+ }));
583
+ } else {
584
+ setErrorUpdate((prev) => ({
585
+ startDate: new Date(),
586
+ }));
587
+ }
588
+ console.log("ERROR updateLatest:", {
589
+ message: response.message,
590
+ errorDetail: response.errorDetail,
591
+ });
592
+ return;
593
+ }
594
+ // limpiar error update
595
+ if (errorUpdate.startDate) {
596
+ setErrorUpdate({});
597
+ }
598
+ // success
599
+ setLastUpdateDate(response.body.data.lastUpdateDate);
600
+ // actualizar la lista de los users
601
+ updateAllUsers(response.body.users);
602
+ // actualizar los items del chat
603
+ if (response.body.items.length === 0) return;
604
+ let newSingleChat = { ...singleChat };
605
+ newSingleChat.items = addNewItemsChat(
606
+ newSingleChat.items,
607
+ response.body.items,
608
+ fromUpdate
609
+ );
610
+ newSingleChat.statusChat = response.body.data.statusChat;
611
+
612
+ setSingleChat(newSingleChat);
613
+ };
614
+
615
+ /*=======================================================================
616
+ FUNCION QUE EJECUTA EL MICROSERVICIO CREATE-ITEM
617
+ Este metodo recibe los items que queremos agregar al chat.
618
+ requiere:
619
+ => items: [ { type , value } , ... ]
620
+ NOTA: si se quiere agregar un mensaje mandar un array con un object
621
+ example: [ {
622
+ type: "message" ,
623
+ value: "mi mensaje"
624
+ } ]
625
+ ======================================================================= */
626
+ const createItemsChat = async (items = []) => {
627
+ if (items.length === 0) {
628
+ return {
629
+ message:
630
+ "No se especifico ningun mensaje, imagen o archivo nuevo " +
631
+ "que se quiera enviar al chat",
632
+ errorDetail: "Reporta esto a TI",
633
+ };
634
+ }
635
+ for (const item of items) {
636
+ if (!["message", "img", "file"].includes(item.type)) {
637
+ return {
638
+ message:
639
+ "Uno de los elementos que se quiere enviar al chat " +
640
+ `no es un tipo valido "${item.type}"`,
641
+ errorDetail: "Reporta esto a TI",
642
+ };
643
+ }
644
+ if (isStringEmpty(item.value)) {
645
+ return {
646
+ message:
647
+ "Uno de los elementos que se quiere enviar al chat " +
648
+ `contiene un valor vacio`,
649
+ errorDetail: "Reporta esto a TI",
650
+ };
651
+ }
652
+ }
653
+ let errorCreate;
654
+ stopUpdate(); // finalizamos el temporizador
655
+
656
+ // enviar items a la BD
657
+ if (chatType === "merchant_product") {
658
+ errorCreate = await createItemsMerchantProduct(items);
659
+ } else if (chatType === "product_status") {
660
+ errorCreate = await createItemsProductStatus(items);
661
+ } else if (chatType === "order_product") {
662
+ errorCreate = await createItemsOrderProduct(items);
663
+ } else errorCreate = await createItemsTicket(items);
664
+
665
+ // actualizar chat para que aparezcan los items enviados
666
+ if (["merchant_product", "product_status"].includes(chatType)) {
667
+ await getUpdateLatestMerchantProduct();
668
+ } else if (chatType === "order_product") {
669
+ await getUpdateLatestOrderProduct();
670
+ } else await getUpdateLatestTicket();
671
+
672
+ // cuando no se pudieron guardar los items
673
+ if (errorCreate) {
674
+ return errorCreate;
675
+ }
676
+ };
677
+
678
+ const createItemsMerchantProduct = async (items = []) => {
679
+ const { id, version, orderId } = dataChat;
680
+ const { id: retailerId } = activeRetailer;
681
+ const paramsBody = { id, version, items, retailerId };
682
+ if (chatType === "product_status") paramsBody["orderId"] = orderId;
683
+ const paramsHeaders = { Authorization: dataChat.userToken };
684
+ const response = await fetchPOST(
685
+ process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
686
+ paramsBody,
687
+ paramsHeaders
688
+ );
689
+ if (!response.body) {
690
+ return {
691
+ message: response.message,
692
+ errorDetail: response.errorDetail,
693
+ };
694
+ }
695
+ };
696
+ const createItemsProductStatus = async (items = []) => {
697
+ const { id, version, orderId, status } = dataChat;
698
+ const { id: retailerId } = activeRetailer;
699
+ const paramsBody = { id, version, items, retailerId, orderId, status };
700
+ const paramsHeaders = { Authorization: dataChat.userToken };
701
+ const response = await fetchPOST(
702
+ process.env.REACT_APP_CREATE_MESSAGES,
703
+ paramsBody,
704
+ paramsHeaders
705
+ );
706
+ if (!response.body) {
707
+ return {
708
+ message: response.message,
709
+ errorDetail: response.errorDetail,
710
+ };
711
+ }
712
+ };
713
+
714
+ const createItemsOrderProduct = async (items = []) => {
715
+ const paramsBody = {
716
+ id: dataChat.id,
717
+ version: currentArticle.version,
718
+ items,
719
+ orderId: dataChat.orderId,
720
+ retailerId: activeRetailer?.id,
721
+ };
722
+ const paramsHeaders = { Authorization: dataChat.userToken };
723
+ const response = await fetchPOST(
724
+ process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
725
+ paramsBody,
726
+ paramsHeaders
727
+ );
728
+ if (!response.body) {
729
+ return {
730
+ message: response.message,
731
+ errorDetail: response.errorDetail,
732
+ };
733
+ }
734
+ };
735
+
736
+ const createItemsTicket = async (items = []) => {
737
+ const paramsBody = {
738
+ id: JSON.stringify(dataChat.id),
739
+ userId: JSON.stringify(dataChat.currentUser.id),
740
+ items: JSON.stringify(items),
741
+ };
742
+ const paramsHeaders = { Authorization: dataChat.userToken };
743
+ const response = await fetchPOST(
744
+ process.env.REACT_APP_TICKETS_CHAT_ENDPOINT,
745
+ paramsBody,
746
+ paramsHeaders
747
+ );
748
+ if (!response.body) {
749
+ return {
750
+ message: response.message,
751
+ errorDetail: response.errorDetail,
752
+ };
753
+ }
754
+ };
755
+
756
+ /*=======================================================================
757
+ SECCION DE FUNCIONES
758
+ ======================================================================= */
759
+ const isSingleChat = () => {
760
+ if (
761
+ chatType === "merchant_product" ||
762
+ chatType === "ticket" ||
763
+ chatType === "product_status"
764
+ ) {
765
+ return true;
766
+ }
767
+ if (companies && Object.keys(companies).length < 2) return true;
768
+ else return false;
769
+ };
770
+
771
+ const getItemsIdSingleChat = () => {
772
+ const itemsId = {};
773
+ if (Array.isArray(singleChat.items)) {
774
+ singleChat.items.forEach((item) => {
775
+ if (isValidNaturalNumber(item.id)) itemsId[item.id] = true;
776
+ });
777
+ }
778
+ return itemsId;
779
+ };
780
+
781
+ const getChatCompany = () => {
782
+ if (chatType === "merchant_product" || chatType === "ticket") {
783
+ return undefined;
784
+ }
785
+ if (companies && companies[activeCompanyId]) {
786
+ return {
787
+ ...companies[activeCompanyId],
788
+ id: activeCompanyId,
789
+ };
790
+ }
791
+ return undefined;
792
+ };
793
+
794
+ const addOldItemsChat = (currentItems = [], newItems = []) => {
795
+ let items = currentItems.slice();
796
+ let itemsId = {};
797
+ items.forEach((item) => {
798
+ itemsId[item.id] = true;
799
+ });
800
+ newItems.forEach((item) => {
801
+ if (!itemsId[item.id]) {
802
+ items.push(item);
803
+ itemsId[item.id] = true;
804
+ }
805
+ });
806
+ return items;
807
+ };
808
+
809
+ const addNewItemsChat = (
810
+ currentItems = [],
811
+ newItems = [],
812
+ fromUpdate = false
813
+ ) => {
814
+ let itemsId = {};
815
+ currentItems.forEach((item) => {
816
+ itemsId[item.id] = item;
817
+ });
818
+ let thereAreNewItems = false;
819
+ newItems.forEach((newitem) => {
820
+ if (!itemsId[newitem.id]) {
821
+ itemsId[newitem.id] = newitem;
822
+ thereAreNewItems = true;
823
+ }
824
+ });
825
+ if (thereAreNewItems && fromUpdate) {
826
+ setPlaySound(true);
827
+ setTimeout(() => {
828
+ setPlaySound(false);
829
+ }, 5000);
830
+ }
831
+ if (chatType !== "ticket") {
832
+ return Object.values(itemsId).sort((a, b) => {
833
+ if (a.id > b.id) return 1;
834
+ if (a.id < b.id) return -1;
835
+ return 0;
836
+ });
837
+ } else {
838
+ return Object.values(itemsId).reverse();
839
+ }
840
+ };
841
+
842
+ const updateAllUsers = (newUsers = {}) => {
843
+ let currentUsers = { ...allUsers };
844
+ Object.keys(newUsers).forEach((userId) => {
845
+ if (!currentUsers[userId]) {
846
+ currentUsers[userId] = newUsers[userId];
847
+ }
848
+ });
849
+ setAllUsers(currentUsers);
850
+ };
851
+
852
+ const renderBodyChat = () => {
853
+ if (isLoading) return <Loading />;
854
+ if (errorChat.existError) {
855
+ return (
856
+ <NotFound
857
+ code={errorChat.code}
858
+ message={errorChat.message}
859
+ details={errorChat.errorDetail}
860
+ />
861
+ );
862
+ }
863
+ // cuando se quiere ver la lista de chats
864
+ if (showChatsList) {
865
+ return (
866
+ <ChatLists
867
+ companies={companies}
868
+ currentCompanyId={currentUser?.companyId}
869
+ onClickCompany={(companyIdSelected) => {
870
+ setActiveCompanyId(Number(companyIdSelected));
871
+ setShowChatsList(false);
872
+ }}
873
+ />
874
+ );
875
+ }
876
+ // mostrar chat?
877
+ let items;
878
+ let enabledLoadMore;
879
+ if (["merchant_product", "ticket", "product_status"].includes(chatType)) {
880
+ items = singleChat.items;
881
+ enabledLoadMore = singleChat.enabledLoadMore;
882
+ }
883
+ // ORDER_PRODUCT
884
+ else if (companies) {
885
+ // caso 0 chats
886
+ if (Object.keys(companies).length === 0) {
887
+ return (
888
+ <div className="container-chatEmpty">
889
+ <CustomIcon
890
+ className="icon-chat"
891
+ transparent
892
+ size={35}
893
+ icon={IconChat}
894
+ type={"gray"}
895
+ />
896
+ <label>
897
+ De acuerdo al estatus del producto, tu compañia no tiene
898
+ disponible ningun chat abierto o cerrado
899
+ </label>
900
+ </div>
901
+ );
902
+ }
903
+ // caso 1 o mas chats
904
+ if (companies[activeCompanyId]) {
905
+ items = companies[activeCompanyId].items;
906
+ enabledLoadMore = companies[activeCompanyId].enabledLoadMore;
907
+ }
908
+ }
909
+ if (items) {
910
+ let containerItems = null;
911
+ if (items.length) {
912
+ containerItems = (
913
+ <ContainerItems
914
+ items={items}
915
+ users={allUsers}
916
+ showBtnLoadMore={enabledLoadMore}
917
+ chatType={chatType}
918
+ activeCompanyId={activeCompanyId}
919
+ ticketCompany={ticketCompany}
920
+ currentUser={
921
+ ["merchant_product", "order_product", "product_status"].includes(
922
+ chatType
923
+ )
924
+ ? currentUser
925
+ : dataChat.currentUser
926
+ }
927
+ onClickBtnLoadMore={
928
+ chatType === "merchant_product"
929
+ ? getLoadMoreMerchantProduct
930
+ : chatType === "order_product"
931
+ ? getLoadMoreOrderProduct
932
+ : getLoadMoreTicket
933
+ }
934
+ />
935
+ );
936
+ } else {
937
+ containerItems = (
938
+ <div className="container-chatEmpty">
939
+ <CustomIcon
940
+ className="icon-chat"
941
+ size={35}
942
+ icon={IconChat}
943
+ type={"gray"}
944
+ transparent
945
+ />
946
+ <label>Este chat no tiene mensajes</label>
947
+ </div>
948
+ );
949
+ }
950
+ return (
951
+ <>
952
+ {containerItems}
953
+ <Footer
954
+ chatType={chatType}
955
+ dataChat={
956
+ chatType === "merchant_product"
957
+ ? { id: dataChat.id, version: dataChat.version }
958
+ : chatType === "order_product"
959
+ ? { id: dataChat.id, version: currentArticle.version }
960
+ : chatType === "ticket"
961
+ ? { id: dataChat.id }
962
+ : chatType === "product_status"
963
+ ? {
964
+ id: dataChat.id,
965
+ version: dataChat.version,
966
+ retailerId: dataChat.retailerId,
967
+ }
968
+ : undefined
969
+ }
970
+ chatCompany={getChatCompany()}
971
+ statusChat={
972
+ chatType === "order_product"
973
+ ? getChatCompany()?.statusChat
974
+ : chatType === "ticket"
975
+ ? singleChat.statusChat
976
+ : undefined
977
+ }
978
+ messageDisabled={
979
+ chatType === "order_product"
980
+ ? `La conversación con ${getChatCompany()?.name} ha finalizado`
981
+ : chatType === "ticket"
982
+ ? "Ticket cerrado"
983
+ : `La conversación ha finalizado`
984
+ }
985
+ createItemsChat={createItemsChat}
986
+ errorUpdate={errorUpdate}
987
+ />
988
+ </>
989
+ );
990
+ }
991
+ return <Loading />;
992
+ };
993
+
994
+ return (
995
+ <>
996
+ <Container>
997
+ {/* header */}
998
+ {(chatContainerType !== "fixed" || !isSingleChat()) && (
999
+ <Header
1000
+ showBtnClose={showBtnClose}
1001
+ onClickBtnClose={onClickBtnClose}
1002
+ showChatsList={showChatsList}
1003
+ chatCompany={getChatCompany()}
1004
+ multipleCompanies={!isSingleChat()}
1005
+ onClickBtnChooseChat={() => {
1006
+ setShowChatsList(true);
1007
+ }}
1008
+ />
1009
+ )}
1010
+ {/* body */}
1011
+ {renderBodyChat()}
1012
+ </Container>
1013
+ <ReactHowler src={newMessage} playing={playSound} />
1014
+ </>
1015
+ );
1016
+ };