contentoh-components-library 21.5.3 → 21.5.5

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 (295) hide show
  1. package/dist/components/organisms/InputGroup/index.js +1 -1
  2. package/dist/components/organisms/Table/styles.js +1 -1
  3. package/dist/components/pages/MultipleEdition/saveData.js +9 -19
  4. package/dist/components/pages/MultipleEdition/styles.js +1 -1
  5. package/dist/components/pages/MultipleEdition/utils.js +86 -153
  6. package/dist/components/pages/ProviderProductEdition/index.js +3 -4
  7. package/package.json +4 -1
  8. package/src/assets/images/Icons/addv2.svg +8 -0
  9. package/src/assets/images/Icons/beenhere.svg +9 -0
  10. package/src/assets/images/Icons/checkv2.svg +8 -0
  11. package/src/assets/images/Icons/close-magenta.svg +9 -0
  12. package/src/assets/images/Icons/close.svg +8 -0
  13. package/src/assets/images/Icons/closeCircle.svg +8 -0
  14. package/src/assets/images/Icons/delete-forever-red.svg +9 -0
  15. package/src/assets/images/Icons/delete-forever-white.svg +10 -0
  16. package/src/assets/images/Icons/edit.svg +8 -0
  17. package/src/assets/images/Icons/fullscreen.svg +3 -0
  18. package/src/assets/images/Icons/infoNR.svg +8 -0
  19. package/src/assets/images/Icons/options.svg +3 -0
  20. package/src/assets/images/Icons/save-white-gray.svg +9 -0
  21. package/src/assets/images/Icons/save-white.svg +9 -0
  22. package/src/assets/images/Icons/save.svg +8 -0
  23. package/src/assets/images/Icons/search.svg +3 -0
  24. package/src/assets/images/Icons/settings.svg +8 -0
  25. package/src/assets/images/Icons/trash.svg +8 -0
  26. package/src/assets/images/Icons/undo.svg +8 -0
  27. package/src/assets/images/Icons/upload-file-white.svg +4 -0
  28. package/src/assets/images/Icons/upload-file.svg +10 -0
  29. package/src/assets/images/Icons/upload_file.svg +10 -0
  30. package/src/assets/images/Icons/warningv2.svg +3 -0
  31. package/src/assets/images/checkBox/checkrosa.svg +3 -0
  32. package/src/assets/images/checkBox/checkverde.svg +3 -0
  33. package/src/assets/images/flagsv2/highPriority.svg +3 -0
  34. package/src/assets/images/flagsv2/lowPriority.svg +3 -0
  35. package/src/assets/images/flagsv2/mediumPriority.svg +3 -0
  36. package/src/assets/images/flagsv2/noPriority.svg +3 -0
  37. package/src/assets/images/generalButton/closeIconWhite.svg +4 -0
  38. package/src/assets/images/generalButton/closeIconv2.svg +4 -0
  39. package/src/assets/images/generalButton/saveIconpink.svg +3 -0
  40. package/src/components/atoms/Avatar/index.js +8 -2
  41. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +1 -0
  42. package/src/components/atoms/ButtonV2/index.js +1 -0
  43. package/src/components/atoms/ButtonV2/styles.js +16 -0
  44. package/src/components/atoms/CharsMissing/Wysiwyg.stories.js +12 -0
  45. package/src/components/atoms/CharsMissing/index.js +60 -0
  46. package/src/components/atoms/CharsMissing/styles.js +44 -0
  47. package/src/components/atoms/CheckBox/CheckBox.stories.js +5 -0
  48. package/src/components/atoms/CheckBox/index.js +5 -1
  49. package/src/components/atoms/CheckBox/styles.js +9 -3
  50. package/src/components/atoms/CustomChip/CustomChip.stories.js +16 -0
  51. package/src/components/atoms/CustomChip/index.js +34 -0
  52. package/src/components/atoms/CustomChip/styles.js +6 -0
  53. package/src/components/atoms/FeatureTagv2/FeatureTagv2.stories.js +16 -0
  54. package/src/components/atoms/FeatureTagv2/index.js +10 -0
  55. package/src/components/atoms/FeatureTagv2/styles.js +56 -0
  56. package/src/components/atoms/GeneralButton/styles.js +46 -0
  57. package/src/components/atoms/GeneralInput/index.js +3 -0
  58. package/src/components/atoms/GeneralInput/styles.js +19 -1
  59. package/src/components/atoms/GeneralInputv2/GeneralInputv2.stories.js +33 -0
  60. package/src/components/atoms/GeneralInputv2/index.js +155 -0
  61. package/src/components/atoms/GeneralInputv2/styles.js +67 -0
  62. package/src/components/atoms/InputFormatter/index.js +2 -1
  63. package/src/components/atoms/InputFormatter/styles.js +9 -4
  64. package/src/components/atoms/InputFormatterv2/Wysiwyg.stories.js +12 -0
  65. package/src/components/atoms/InputFormatterv2/index.js +148 -0
  66. package/src/components/atoms/InputFormatterv2/styles.js +39 -0
  67. package/src/components/atoms/InputImages/InputImages.stories.js +19 -0
  68. package/src/components/atoms/InputImages/index.js +25 -0
  69. package/src/components/atoms/InputImages/styles.js +17 -0
  70. package/src/components/atoms/Multiselect/Multiselect.stories.js +364 -0
  71. package/src/components/atoms/Multiselect/index.js +351 -0
  72. package/src/components/atoms/Multiselect/styles.js +33 -0
  73. package/src/components/atoms/NumberMandatory/NumberMandatory.stories.js +19 -0
  74. package/src/components/atoms/NumberMandatory/index.js +16 -0
  75. package/src/components/atoms/NumberMandatory/styles.js +11 -0
  76. package/src/components/atoms/ObservationFlag/ObservationFlag.stories.js +20 -0
  77. package/src/components/atoms/ObservationFlag/index.js +167 -0
  78. package/src/components/atoms/ObservationFlag/styles.js +104 -0
  79. package/src/components/atoms/PriorityFlagv2/PriorityFlagv2.stories.js +20 -0
  80. package/src/components/atoms/PriorityFlagv2/index.js +20 -0
  81. package/src/components/atoms/PriorityFlagv2/styles.js +6 -0
  82. package/src/components/atoms/ProductImage/index.js +24 -11
  83. package/src/components/atoms/ProductImage/styles.js +7 -0
  84. package/src/components/atoms/ProductImagev2/ProductImagev2.stories.js +28 -0
  85. package/src/components/atoms/ProductImagev2/index.js +16 -0
  86. package/src/components/atoms/ProductImagev2/styles.js +62 -0
  87. package/src/components/atoms/Progress/Progress.stories.js +25 -0
  88. package/src/components/atoms/Progress/index.js +74 -0
  89. package/src/components/atoms/Progress/styles.js +98 -0
  90. package/src/components/atoms/ScreenHeaderv2/ScreenHeaderv2.stories.js +53 -0
  91. package/src/components/atoms/ScreenHeaderv2/index.js +134 -0
  92. package/src/components/atoms/ScreenHeaderv2/styles.js +103 -0
  93. package/src/components/atoms/Selectv2/VersionSelect.js +27 -0
  94. package/src/components/atoms/Selectv2/index.js +35 -0
  95. package/src/components/atoms/Selectv2/style.js +93 -0
  96. package/src/components/atoms/SliderToolTip/styles.js +1 -1
  97. package/src/components/atoms/TabSection/index.js +1 -1
  98. package/src/components/atoms/TabSection/styles.js +0 -3
  99. package/src/components/atoms/TabSectionv2/TabSection.stories.js +25 -0
  100. package/src/components/atoms/TabSectionv2/index.js +9 -0
  101. package/src/components/atoms/TabSectionv2/styles.js +20 -0
  102. package/src/components/atoms/TooltipLight/Tooltip.stories.js +20 -0
  103. package/src/components/atoms/TooltipLight/index.js +46 -0
  104. package/src/components/atoms/TooltipLight/styles.js +65 -0
  105. package/src/components/atoms/WordsMissing/Wysiwyg.stories.js +12 -0
  106. package/src/components/atoms/WordsMissing/index.js +60 -0
  107. package/src/components/atoms/WordsMissing/styles.js +10 -0
  108. package/src/components/molecules/AddGroup/AddGroup.stories.js +15 -0
  109. package/src/components/molecules/AddGroup/index.js +84 -0
  110. package/src/components/molecules/AddGroup/styles.js +141 -0
  111. package/src/components/molecules/AsignationInfo/AsignationInfo.stories.js +17 -0
  112. package/src/components/molecules/AsignationInfo/index.js +108 -0
  113. package/src/components/molecules/AsignationInfo/styles.js +86 -0
  114. package/src/components/molecules/BoxAttribute/index.js +32 -25
  115. package/src/components/molecules/BoxAttribute/styles.js +1 -1
  116. package/src/components/molecules/BoxButtons/index.js +23 -22
  117. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  118. package/src/components/molecules/EditionActiveImagev2/EditionActiveImagev2.stories.js +12 -0
  119. package/src/components/molecules/EditionActiveImagev2/index.js +15 -0
  120. package/src/components/molecules/EditionActiveImagev2/styles.js +7 -0
  121. package/src/components/molecules/EditionTabs/EditionTabs.stories.js +12 -0
  122. package/src/components/molecules/EditionTabs/index.js +33 -0
  123. package/src/components/molecules/EditionTabs/styles.js +24 -0
  124. package/src/components/molecules/FeaturesBarv2/FeaturesBarv2.stories.js +20 -0
  125. package/src/components/molecules/FeaturesBarv2/index.js +32 -0
  126. package/src/components/molecules/FeaturesBarv2/styles.js +17 -0
  127. package/src/components/molecules/GalleryElement/index.js +76 -1
  128. package/src/components/molecules/GalleryElementv2/GalleryElementv2.stories.js +30 -0
  129. package/src/components/molecules/GalleryElementv2/index.js +142 -0
  130. package/src/components/molecules/GalleryElementv2/styles.js +119 -0
  131. package/src/components/molecules/GalleryHeader/index.js +1 -0
  132. package/src/components/molecules/GalleryHeaderv2/GalleryHeaderv2.stories.js +10 -0
  133. package/src/components/molecules/GalleryHeaderv2/index.js +25 -0
  134. package/src/components/molecules/GalleryHeaderv2/styles.js +47 -0
  135. package/src/components/molecules/GroupSelect/GroupSelect.stories.js +35 -0
  136. package/src/components/molecules/GroupSelect/SelectItem.js +105 -0
  137. package/src/components/molecules/GroupSelect/index.js +190 -0
  138. package/src/components/molecules/GroupSelect/styles.js +124 -0
  139. package/src/components/molecules/HeaderTop/index.js +52 -6
  140. package/src/components/molecules/HeaderTopv2/HeaderTopv2.stories.js +10 -0
  141. package/src/components/molecules/HeaderTopv2/index.js +100 -0
  142. package/src/components/molecules/HeaderTopv2/styles.js +33 -0
  143. package/src/components/molecules/ImageSelectorv2/ImageSelectorv2.stories.js +46 -0
  144. package/src/components/molecules/ImageSelectorv2/index.js +22 -0
  145. package/src/components/molecules/ImageSelectorv2/styles.js +15 -0
  146. package/src/components/molecules/Phase/Phase.stories.js +107 -0
  147. package/src/components/molecules/Phase/index.js +391 -0
  148. package/src/components/molecules/Phase/styles.js +97 -0
  149. package/src/components/molecules/ProductNameHeader/index.js +19 -1
  150. package/src/components/molecules/ProductNameHeaderv2/ProductNameHeaderv2.stories.js +37 -0
  151. package/src/components/molecules/ProductNameHeaderv2/index.js +12 -0
  152. package/src/components/molecules/ProductNameHeaderv2/styles.js +10 -0
  153. package/src/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +37 -0
  154. package/src/components/molecules/ProductSkuStatus/index.js +26 -0
  155. package/src/components/molecules/ProductSkuStatus/styles.js +7 -0
  156. package/src/components/molecules/RetailerSelectorv2/RetailerSelectorv2.stories.js +35 -0
  157. package/src/components/molecules/RetailerSelectorv2/index.js +80 -0
  158. package/src/components/molecules/RetailerSelectorv2/styles.js +21 -0
  159. package/src/components/molecules/ServiceDataValidator/ServiceDataValidator.stories.js +90 -0
  160. package/src/components/molecules/ServiceDataValidator/index.js +49 -0
  161. package/src/components/molecules/ServiceDataValidator/styles.js +36 -0
  162. package/src/components/molecules/SignInLogin/index.js +11 -11
  163. package/src/components/molecules/StatusAsignationInfo/FinancedCompanies.js +501 -63
  164. package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
  165. package/src/components/molecules/StatusRetailer/StatusAsignationInfo.stories.js +17 -0
  166. package/src/components/molecules/StatusRetailer/index.js +55 -0
  167. package/src/components/molecules/StatusRetailer/styles.js +85 -0
  168. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
  169. package/src/components/molecules/TabsMenuv2/TabsMenuv2.stories.js +19 -0
  170. package/src/components/molecules/TabsMenuv2/index.js +112 -0
  171. package/src/components/molecules/TabsMenuv2/styles.js +19 -0
  172. package/src/components/molecules/TagAndInput/index.js +8 -6
  173. package/src/components/molecules/TagAndInputv2/TagAndInputv2.stories.js +24 -0
  174. package/src/components/molecules/TagAndInputv2/index.js +86 -0
  175. package/src/components/molecules/TagAndInputv2/styles.js +35 -0
  176. package/src/components/molecules/Validation/Validation.stories.js +12 -0
  177. package/src/components/molecules/Validation/index.js +77 -0
  178. package/src/components/molecules/Validation/styles.js +19 -0
  179. package/src/components/molecules/VersionItemv2/VersionItemv2.stories.js +14 -0
  180. package/src/components/molecules/VersionItemv2/index.js +59 -0
  181. package/src/components/molecules/VersionItemv2/styles.js +47 -0
  182. package/src/components/organisms/BarButtons/BarButtons.stories.js +13 -0
  183. package/src/components/organisms/BarButtons/index.js +150 -0
  184. package/src/components/organisms/BarButtons/styles.js +54 -0
  185. package/src/components/organisms/Chat/Chat.stories.js +27 -7
  186. package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
  187. package/src/components/organisms/Chat/ContainerItems/styles.js +14 -2
  188. package/src/components/organisms/Chat/ContentChat/index.js +88 -12
  189. package/src/components/organisms/Chat/Footer/index.js +11 -0
  190. package/src/components/organisms/Chat/index.js +46 -4
  191. package/src/components/organisms/Chat/styles.js +4 -0
  192. package/src/components/organisms/Chatv2/ChatLists/ChatLists.stories.js +65 -0
  193. package/src/components/organisms/Chatv2/ChatLists/Rotoplas.jpeg +0 -0
  194. package/src/components/organisms/Chatv2/ChatLists/THD.png +0 -0
  195. package/src/components/organisms/Chatv2/ChatLists/index.js +141 -0
  196. package/src/components/organisms/Chatv2/ChatLists/styles.js +162 -0
  197. package/src/components/organisms/Chatv2/Chatv2.stories.js +184 -0
  198. package/src/components/organisms/Chatv2/ContainerItems/ContainerItems.stories.js +142 -0
  199. package/src/components/organisms/Chatv2/ContainerItems/index.js +538 -0
  200. package/src/components/organisms/Chatv2/ContainerItems/styles.js +360 -0
  201. package/src/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +102 -0
  202. package/src/components/organisms/Chatv2/ContentChat/Rotoplas.jpeg +0 -0
  203. package/src/components/organisms/Chatv2/ContentChat/THD.png +0 -0
  204. package/src/components/organisms/Chatv2/ContentChat/index.js +1016 -0
  205. package/src/components/organisms/Chatv2/ContentChat/styles.js +44 -0
  206. package/src/components/organisms/Chatv2/Footer/Footer.stories.js +22 -0
  207. package/src/components/organisms/Chatv2/Footer/index.js +668 -0
  208. package/src/components/organisms/Chatv2/Footer/styles.js +290 -0
  209. package/src/components/organisms/Chatv2/Header/Header.stories.js +66 -0
  210. package/src/components/organisms/Chatv2/Header/index.js +93 -0
  211. package/src/components/organisms/Chatv2/Header/styles.js +49 -0
  212. package/src/components/organisms/Chatv2/index.js +281 -0
  213. package/src/components/organisms/Chatv2/styles.js +85 -0
  214. package/src/components/organisms/CompleteServices/CompleteServices.stories.js +91 -0
  215. package/src/components/organisms/CompleteServices/index.js +82 -0
  216. package/src/components/organisms/CompleteServices/styles.js +35 -0
  217. package/src/components/organisms/DashboardMetric/index.js +6 -3
  218. package/src/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +13 -0
  219. package/src/components/organisms/DragAndDropPhases/index.js +336 -0
  220. package/src/components/organisms/DragAndDropPhases/styles.js +107 -0
  221. package/src/components/organisms/DragPrueba/DragPrueba.stories.js +12 -0
  222. package/src/components/organisms/DragPrueba/index.js +57 -0
  223. package/src/components/organisms/DragPrueba/styles.js +8 -0
  224. package/src/components/organisms/EditGroup/EditGroup.stories.js +20 -0
  225. package/src/components/organisms/EditGroup/index.js +321 -0
  226. package/src/components/organisms/EditGroup/styles.js +207 -0
  227. package/src/components/organisms/FullProductNameHeader/index.js +13 -1
  228. package/src/components/organisms/FullProductNamev2/FullProductNamev2.stories.js +28 -0
  229. package/src/components/organisms/FullProductNamev2/index.js +101 -0
  230. package/src/components/organisms/FullProductNamev2/styles.js +49 -0
  231. package/src/components/organisms/FullTabsMenuv2/FullTabsMenuv2.stories.js +22 -0
  232. package/src/components/organisms/FullTabsMenuv2/index.js +142 -0
  233. package/src/components/organisms/FullTabsMenuv2/styles.js +47 -0
  234. package/src/components/organisms/GridProducts/GridProducts.stories.js +682 -107
  235. package/src/components/organisms/ImageDataTablev2/ImageDataTablev2.stories.js +24 -0
  236. package/src/components/organisms/ImageDataTablev2/index.js +124 -0
  237. package/src/components/organisms/ImageDataTablev2/styles.js +18 -0
  238. package/src/components/organisms/ImagePreviewerv2/ImagePreviewerv2.stories.js +38 -0
  239. package/src/components/organisms/ImagePreviewerv2/index.js +22 -0
  240. package/src/components/organisms/ImagePreviewerv2/styles.js +7 -0
  241. package/src/components/organisms/ImageUploader/ImageUploader.stories.js +15 -0
  242. package/src/components/organisms/ImageUploader/index.js +62 -0
  243. package/src/components/organisms/ImageUploader/styles.js +29 -0
  244. package/src/components/organisms/ImageVisor/ImageVisor.stories.js +15 -0
  245. package/src/components/organisms/ImageVisor/index.js +143 -0
  246. package/src/components/organisms/ImageVisor/styles.js +106 -0
  247. package/src/components/organisms/InputGroup/index.js +292 -144
  248. package/src/components/organisms/InputGroup/styles.js +31 -0
  249. package/src/components/organisms/InputGroupv2/InputGroupv2.stories.js +31 -0
  250. package/src/components/organisms/InputGroupv2/index.js +296 -0
  251. package/src/components/organisms/InputGroupv2/styles.js +90 -0
  252. package/src/components/organisms/MandatoryBar/MandatoryBar.stories.js +18 -0
  253. package/src/components/organisms/MandatoryBar/index.js +31 -0
  254. package/src/components/organisms/MandatoryBar/styles.js +12 -0
  255. package/src/components/organisms/Modal/Modal.stories.js +2 -1
  256. package/src/components/organisms/Modal/index.js +9 -2
  257. package/src/components/organisms/Modal/styles.js +8 -1
  258. package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
  259. package/src/components/organisms/ProductImageModalv2/ProductImageModalv2.stories.js +90 -0
  260. package/src/components/organisms/ProductImageModalv2/index.js +105 -0
  261. package/src/components/organisms/ProductImageModalv2/styles.js +71 -0
  262. package/src/components/organisms/RenameImagesBar/RenameImagesBar.stories.js +18 -0
  263. package/src/components/organisms/RenameImagesBar/index.js +30 -0
  264. package/src/components/organisms/RenameImagesBar/styles.js +12 -0
  265. package/src/components/organisms/Table/Table.stories.js +609 -0
  266. package/src/components/organisms/Table/index.js +84 -0
  267. package/src/components/organisms/Table/styles.js +114 -0
  268. package/src/components/organisms/VersionSelectorv2/VersionSelectorv2.stories.js +15 -0
  269. package/src/components/organisms/VersionSelectorv2/index.js +105 -0
  270. package/src/components/organisms/VersionSelectorv2/styles.js +45 -0
  271. package/src/components/pages/Dashboard/Dashboard.stories.js +33 -38
  272. package/src/components/pages/Dashboard/index.js +36 -7
  273. package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +17 -0
  274. package/src/components/pages/MultipleEdition/components/ImageUploader.js +62 -0
  275. package/src/components/pages/MultipleEdition/components/ImageUploaderStyles.js +29 -0
  276. package/src/components/pages/MultipleEdition/components/ImageVisor.js +143 -0
  277. package/src/components/pages/MultipleEdition/components/styles.js +106 -0
  278. package/src/components/pages/MultipleEdition/index.js +248 -0
  279. package/src/components/pages/MultipleEdition/saveData.js +92 -0
  280. package/src/components/pages/MultipleEdition/styles.js +201 -0
  281. package/src/components/pages/MultipleEdition/utils.js +1073 -0
  282. package/src/components/pages/ProductEditionv2/ProductEditionv2.stories.js +213 -0
  283. package/src/components/pages/ProductEditionv2/index.js +1758 -0
  284. package/src/components/pages/ProductEditionv2/styles.js +154 -0
  285. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +56 -60
  286. package/src/components/pages/ProviderProductEdition/index.js +149 -133
  287. package/src/components/pages/ProviderProductEdition/styles.js +5 -1
  288. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -0
  289. package/src/components/pages/RetailerProductEdition/generateThumnail.js +21 -0
  290. package/src/components/pages/RetailerProductEdition/index.js +293 -300
  291. package/src/components/pages/RetailerProductEdition/styles.js +4 -0
  292. package/src/components/pages/RetailerProductEdition/utils.js +37 -0
  293. package/src/global-files/data.js +6 -10
  294. package/src/global-files/variables.js +6 -0
  295. package/src/index.js +12 -0
@@ -4,6 +4,10 @@ import { TagAndInput } from "../../molecules/TagAndInput";
4
4
  import { BoxOnboarding } from "../BoxOnboarding";
5
5
  import { Box } from "../Box";
6
6
  import { useEffect, useState } from "react";
7
+ import acceptIcon from "../../../assets/images/generalButton/acceptIcon.svg";
8
+ import rejectIcon from "../../../assets/images/generalButton/rejectIcon.svg";
9
+ import { Tooltip } from "../../atoms/Tooltip";
10
+ import { height, width } from "@mui/system";
7
11
 
8
12
  export const InputGroup = ({
9
13
  inputGroup = {},
@@ -21,8 +25,73 @@ export const InputGroup = ({
21
25
  compare,
22
26
  groupData = [],
23
27
  setUpdatedBoxData,
24
- activeRetailer
28
+ activeRetailer,
29
+ updateApprovedInputs,
25
30
  }) => {
31
+ const InputReviewSection = ({
32
+ inputId,
33
+ isApproved,
34
+ comment,
35
+ handleImgClick,
36
+ changeImageBtn,
37
+ showDivState,
38
+ imageStates,
39
+ }) => (
40
+ <div style={{ "margin-top": "10px" }}>
41
+ <Tooltip
42
+ componentTooltip={
43
+ <>
44
+ <p>
45
+ <b>Comentarios:</b>
46
+ </p>
47
+ <p>{comment}</p>
48
+ </>
49
+ }
50
+ children={
51
+ !isApproved && (
52
+ <img
53
+ src={imageStates[inputId] ? acceptIcon : rejectIcon}
54
+ alt={"botón rechazar"}
55
+ style={{ cursor: "pointer" }}
56
+ onClick={() => handleImgClick(inputId)}
57
+ />
58
+ )
59
+ }
60
+ classNameTooltip={"container-tooltip"}
61
+ />
62
+ {showDivState[inputId] && (
63
+ <div className="btnReviewState">
64
+ <div>
65
+ <button
66
+ id="aceptbtn"
67
+ onClick={() => changeImageBtn(inputId, "validate")}
68
+ >
69
+ <img
70
+ src={acceptIcon}
71
+ alt="acept button"
72
+ style={{ cursor: "pointer" }}
73
+ />
74
+ Validar
75
+ </button>
76
+ </div>
77
+ {/* <div>
78
+ <button
79
+ id="rejectbtn"
80
+ onClick={() => changeImageBtn(inputId, "reject")}
81
+ >
82
+ <img
83
+ src={rejectIcon}
84
+ alt="reject button"
85
+ style={{ cursor: "pointer" }}
86
+ />
87
+ Rechazar
88
+ </button>
89
+ </div> */}
90
+ </div>
91
+ )}
92
+ </div>
93
+ );
94
+
26
95
  const inputTypeValue = (type) => {
27
96
  switch (type) {
28
97
  case "Booleano":
@@ -34,6 +103,23 @@ export const InputGroup = ({
34
103
  }
35
104
  };
36
105
  const [showBox, setShowBox] = useState(false);
106
+ const [showDivStates, setShowDivStates] = useState({});
107
+ const [imageStates, setImageStates] = useState({});
108
+
109
+ const handleImgClick = (inputId) => {
110
+ setShowDivStates((prevStates) => ({
111
+ ...prevStates,
112
+ [inputId]: !prevStates[inputId],
113
+ }));
114
+ };
115
+
116
+ const changeImageBtn = (inputId, action) => {
117
+ setImageStates((prevStates) => ({
118
+ ...prevStates,
119
+ [inputId]: action === "validate",
120
+ }));
121
+ updateApprovedInputs(inputId);
122
+ };
37
123
 
38
124
  const isEquals = (dataInputsVal, auditInputsVal) => {
39
125
  const result = dataInputsVal === auditInputsVal;
@@ -41,7 +127,11 @@ export const InputGroup = ({
41
127
  };
42
128
 
43
129
  useEffect(() => {
44
- if (inputGroup.groupId === "16" && activeRetailer && activeRetailer?.retailer?.id) {
130
+ if (
131
+ inputGroup.groupId === "16" &&
132
+ activeRetailer &&
133
+ activeRetailer?.retailer?.id
134
+ ) {
45
135
  if (activeRetailer?.retailer?.id === 68) {
46
136
  setShowBox(true);
47
137
  } else {
@@ -50,127 +140,152 @@ export const InputGroup = ({
50
140
  }
51
141
  }, [activeRetailer, inputGroup.groupId]);
52
142
 
53
- // useEffect(() => {
54
- // if (showBox) {
55
- // // Realiza la acción que deseas cuando showBox es true
56
- // console.log("showBox es true");
57
- // } else {
58
- // // Realiza la acción que deseas cuando showBox es false
59
- // console.log("showBox es false");
60
- // }
61
- // }, [showBox]);
62
-
63
143
  return (
64
144
  <>
65
145
  {inputGroup.groupId === "16" && activeRetailer?.retailer?.id === 68 && (
66
146
  <Container
67
- className={
68
- activeSection === "Ficha técnica"
69
- ? "datasheets-layout"
70
- : "descriptions-layout"
71
- }
72
- >
73
- <Box
74
- inputGroup={inputGroup}
75
- dataInputs={dataInputs}
76
- onChange={setUpdatedBoxData}
77
- />
78
- </Container>
79
- )}
80
- {(inputGroup.groupId !== "16") && (
81
- <Container
82
- className={
83
- activeSection === "Ficha técnica"
84
- ? "datasheets-layout"
85
- : "descriptions-layout"
86
- }
87
- >
88
- {inputGroup?.dataGroup && (
89
- <ScreenHeader
90
- headerType={"retailer-name-header"}
91
- text={`${inputGroup?.dataGroup}`}
147
+ className={
148
+ activeSection === "Ficha técnica"
149
+ ? "datasheets-layout"
150
+ : "descriptions-layout"
151
+ }
152
+ >
153
+ <Box
154
+ inputGroup={inputGroup}
155
+ dataInputs={dataInputs}
156
+ onChange={setUpdatedBoxData}
92
157
  />
93
- )}
94
- <div className="inputs-container">
95
- {inputGroup?.inputs?.map((input, index) =>
96
- activeSection === "Ficha técnica" ? (
97
- <>
98
- <TagAndInput
99
- key={
100
- index +
101
- "-" +
102
- dataInputs[input]?.value +
103
- "-" +
104
- dataInputs[input]?.id +
105
- "-" +
106
- compare
107
- }
108
- //disabled={input === 40001}
109
- disabled={false}
110
- inputId={dataInputs[input]?.id}
111
- version={version}
112
- inputType={inputTypeValue(dataInputs[input]?.type)}
113
- label={
114
- dataInputs[input]?.name +
115
- (dataInputs[input]?.required ? "*" : "")
116
- }
117
- value={
118
- compare ? auditInputs[input]?.value : dataInputs[input]?.value
119
- }
120
- inputPlaceHolder={input?.placeholder}
121
- articleId={articleId}
122
- isRequired={dataInputs[input]?.required}
123
- updatedDatasheets={updatedDatasheets}
124
- setUpdatedDatasheets={setUpdatedDatasheets}
125
- maxChar={
126
- dataInputs[input]?.max_chars
127
- ? dataInputs[input]?.max_chars
128
- : 999
129
- }
130
- optionList={dataInputs[input]?.option_list}
131
- description={dataInputs[input]?.description}
132
- showTooltip={true}
133
- auditClass={
134
- compare &&
135
- !isEquals(dataInputs[input].value, auditInputs[input].value)
136
- ? "audit-class"
137
- : ""
138
- }
139
- />
140
- </>
141
- ) : (
142
- <TagAndInput
143
- key={index + "-" + input?.value + "-" + compare}
144
- inputId={input.id}
145
- index={index}
146
- inputType={"textarea"}
147
- label={input?.name + (input.required ? "*" : "")}
148
- value={
149
- compare ? auditInputGroup?.inputs[index]?.value : input?.value
150
- }
151
- isRequired={input.required}
152
- maxChar={input.max_chars}
153
- inputPlaceHolder={input?.placeholder}
154
- updatedDescriptions={updatedDescriptions}
155
- setUpdatedDescriptions={setUpdatedDescriptions}
156
- articleId={articleId}
157
- version={version}
158
- dinamicHeight={dinamicHeight}
159
- description={input?.description}
160
- showTooltip={true}
161
- auditClass={
162
- compare &&
163
- !isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
164
- ? "audit-class"
165
- : ""
166
- }
167
- />
168
- )
158
+ </Container>
159
+ )}
160
+ {inputGroup.groupId !== "16" && (
161
+ <Container
162
+ className={
163
+ activeSection === "Ficha técnica"
164
+ ? "datasheets-layout"
165
+ : "descriptions-layout"
166
+ }
167
+ >
168
+ {inputGroup?.dataGroup && (
169
+ <ScreenHeader
170
+ headerType={"retailer-name-header"}
171
+ text={`${inputGroup?.dataGroup}`}
172
+ />
169
173
  )}
170
- </div>
171
- </Container>
174
+ <div className="inputs-container">
175
+ {inputGroup?.inputs?.map((input, index) =>
176
+ activeSection === "Ficha técnica" ? (
177
+ <>
178
+ <TagAndInput
179
+ key={
180
+ index +
181
+ "-" +
182
+ dataInputs[input]?.value +
183
+ "-" +
184
+ dataInputs[input]?.id +
185
+ "-" +
186
+ compare
187
+ }
188
+ //disabled={input === 40001}
189
+ disabled={dataInputs[input]?.isApproved}
190
+ inputId={dataInputs[input]?.id}
191
+ version={version}
192
+ inputType={inputTypeValue(dataInputs[input]?.type)}
193
+ label={
194
+ dataInputs[input]?.name +
195
+ (dataInputs[input]?.required ? "*" : "")
196
+ }
197
+ value={
198
+ compare
199
+ ? auditInputs[input]?.value
200
+ : dataInputs[input]?.value
201
+ }
202
+ inputPlaceHolder={input?.placeholder}
203
+ articleId={articleId}
204
+ isRequired={dataInputs[input]?.required}
205
+ updatedDatasheets={updatedDatasheets}
206
+ setUpdatedDatasheets={setUpdatedDatasheets}
207
+ maxChar={
208
+ dataInputs[input]?.max_chars
209
+ ? dataInputs[input]?.max_chars
210
+ : 999
211
+ }
212
+ optionList={dataInputs[input]?.option_list}
213
+ description={dataInputs[input]?.description}
214
+ showTooltip={true}
215
+ auditClass={
216
+ compare &&
217
+ !isEquals(
218
+ dataInputs[input].value,
219
+ auditInputs[input].value
220
+ )
221
+ ? "audit-class"
222
+ : ""
223
+ }
224
+ />
225
+ {dataInputs[input]?.isApproved === false && (
226
+ <InputReviewSection
227
+ inputId={dataInputs[input]?.id}
228
+ isApproved={dataInputs[input]?.isApproved}
229
+ comment={dataInputs[input]?.comment}
230
+ handleImgClick={handleImgClick}
231
+ changeImageBtn={changeImageBtn}
232
+ showDivState={showDivStates}
233
+ imageStates={imageStates}
234
+ />
235
+ )}
236
+ </>
237
+ ) : (
238
+ <>
239
+ {input?.isApproved === false && (
240
+ <InputReviewSection
241
+ inputId={input?.id}
242
+ isApproved={input?.isApproved}
243
+ comment={input?.comment}
244
+ handleImgClick={handleImgClick}
245
+ changeImageBtn={changeImageBtn}
246
+ showDivState={showDivStates}
247
+ imageStates={imageStates}
248
+ />
249
+ )}
250
+ <TagAndInput
251
+ key={index + "-" + input?.value + "-" + compare}
252
+ inputId={input.id}
253
+ index={index}
254
+ inputType={"textarea"}
255
+ label={input?.name + (input.required ? "*" : "")}
256
+ value={
257
+ compare
258
+ ? auditInputGroup?.inputs[index]?.value
259
+ : input?.value
260
+ }
261
+ isRequired={input.required}
262
+ disabled={input.id===44186||input.id===44187?false:input?.isApproved}
263
+ maxChar={input.max_chars}
264
+ inputPlaceHolder={input?.placeholder}
265
+ updatedDescriptions={updatedDescriptions}
266
+ setUpdatedDescriptions={setUpdatedDescriptions}
267
+ articleId={articleId}
268
+ version={version}
269
+ dinamicHeight={dinamicHeight}
270
+ description={input?.description}
271
+ showTooltip={true}
272
+ auditClass={
273
+ compare &&
274
+ !isEquals(
275
+ input?.value,
276
+ auditInputGroup?.inputs[index]?.value
277
+ )
278
+ ? "audit-class"
279
+ : ""
280
+ }
281
+ />
282
+ </>
283
+ )
284
+ )}
285
+ </div>
286
+ </Container>
172
287
  )}
173
- {(inputGroup.groupId === "16" && activeRetailer?.retailer?.id === 74) && (
288
+ {inputGroup.groupId === "16" && activeRetailer?.retailer?.id === 74 && (
174
289
  <Container
175
290
  className={
176
291
  activeSection === "Ficha técnica"
@@ -199,7 +314,7 @@ export const InputGroup = ({
199
314
  compare
200
315
  }
201
316
  //disabled={input === 40001}
202
- disabled={false}
317
+ disabled={dataInputs[input]?.isApproved}
203
318
  inputId={dataInputs[input]?.id}
204
319
  version={version}
205
320
  inputType={inputTypeValue(dataInputs[input]?.type)}
@@ -230,39 +345,72 @@ export const InputGroup = ({
230
345
  onChange={setUpdatedBoxData}
231
346
  auditClass={
232
347
  compare &&
233
- !isEquals(dataInputs[input].value, auditInputs[input].value)
348
+ !isEquals(
349
+ dataInputs[input].value,
350
+ auditInputs[input].value
351
+ )
234
352
  ? "audit-class"
235
353
  : ""
236
354
  }
237
355
  />
356
+ {dataInputs[input]?.isApproved === false && (
357
+ <InputReviewSection
358
+ inputId={dataInputs[input]?.id}
359
+ isApproved={dataInputs[input]?.isApproved}
360
+ comment={dataInputs[input]?.comment}
361
+ handleImgClick={handleImgClick}
362
+ changeImageBtn={changeImageBtn}
363
+ showDivState={showDivStates}
364
+ imageStates={imageStates}
365
+ />
366
+ )}
238
367
  </>
239
368
  ) : (
240
- <TagAndInput
241
- key={index + "-" + input?.value + "-" + compare}
242
- inputId={input.id}
243
- index={index}
244
- inputType={"textarea"}
245
- label={input?.name + (input.required ? "*" : "")}
246
- value={
247
- compare ? auditInputGroup?.inputs[index]?.value : input?.value
248
- }
249
- isRequired={input.required}
250
- maxChar={input.max_chars}
251
- inputPlaceHolder={input?.placeholder}
252
- updatedDescriptions={updatedDescriptions}
253
- setUpdatedDescriptions={setUpdatedDescriptions}
254
- articleId={articleId}
255
- version={version}
256
- dinamicHeight={dinamicHeight}
257
- description={input?.description}
258
- showTooltip={true}
259
- auditClass={
260
- compare &&
261
- !isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
262
- ? "audit-class"
263
- : ""
264
- }
265
- />
369
+ <>
370
+ {input?.isApproved === false && (
371
+ <InputReviewSection
372
+ inputId={input?.id}
373
+ isApproved={input?.isApproved}
374
+ comment={input?.comment}
375
+ handleImgClick={handleImgClick}
376
+ changeImageBtn={changeImageBtn}
377
+ showDivState={showDivStates}
378
+ imageStates={imageStates}
379
+ />
380
+ )}
381
+ <TagAndInput
382
+ key={index + "-" + input?.value + "-" + compare}
383
+ inputId={input.id}
384
+ index={index}
385
+ disabled={input?.isApproved}
386
+ inputType={"textarea"}
387
+ label={input?.name + (input.required ? "*" : "")}
388
+ value={
389
+ compare
390
+ ? auditInputGroup?.inputs[index]?.value
391
+ : input?.value
392
+ }
393
+ isRequired={input.required}
394
+ maxChar={input.max_chars}
395
+ inputPlaceHolder={input?.placeholder}
396
+ updatedDescriptions={updatedDescriptions}
397
+ setUpdatedDescriptions={setUpdatedDescriptions}
398
+ articleId={articleId}
399
+ version={version}
400
+ dinamicHeight={dinamicHeight}
401
+ description={input?.description}
402
+ showTooltip={true}
403
+ auditClass={
404
+ compare &&
405
+ !isEquals(
406
+ input?.value,
407
+ auditInputGroup?.inputs[index]?.value
408
+ )
409
+ ? "audit-class"
410
+ : ""
411
+ }
412
+ />
413
+ </>
266
414
  )
267
415
  )}
268
416
  </div>
@@ -33,4 +33,35 @@ export const Container = styled.div`
33
33
  & + * {
34
34
  margin-top: 15px;
35
35
  }
36
+
37
+ .btnReviewState {
38
+ display: "flex";
39
+ flex-direction: "column";
40
+ border: 1px solid lightgray;
41
+ border-radius: 3px;
42
+ z-index: 1000;
43
+ /* position: absolute; */
44
+ }
45
+
46
+ .btnReviewState button {
47
+ border: none;
48
+ background: white;
49
+ border-radius: 3px;
50
+ }
51
+ .btnReviewState button:hover {
52
+ background: lightgray;
53
+ }
54
+ /* #divBtnsReviewdown {
55
+ border-left: 1px solid black;
56
+ border-right: 1px solid black;
57
+ border-bottom: 1px solid black;
58
+ }
59
+ #aceptbtn {
60
+ background: white;
61
+ border: none;
62
+ }
63
+ #rejectbtn {
64
+ background: white;
65
+ border: none;
66
+ } */
36
67
  `;
@@ -0,0 +1,31 @@
1
+ import { InputGroupv2 } from "./index";
2
+
3
+ export default {
4
+ title: "Components/organisms/InputGroupv2",
5
+ component: InputGroupv2,
6
+ argTypes: {
7
+ activeSection: {
8
+ options: [true, false],
9
+ control: { type: "boolean" },
10
+ },
11
+ },
12
+ };
13
+
14
+ const Template = (args) => <InputGroupv2 {...args} />;
15
+
16
+ export const InputGroupDefault = Template.bind({});
17
+ InputGroupDefault.args = {
18
+ InputGroupv2: {
19
+ name: "Información básica del producto",
20
+ inputs: [
21
+ { label: "Item", value: "1234567890", placeholder: "Ingresar valor" },
22
+ { label: "Item", value: "1234567890", placeholder: "Ingresar valor" },
23
+ { label: "Item", value: "1234567890", placeholder: "Ingresar valor" },
24
+ { label: "Item", value: "1234567890", placeholder: "Ingresar valor" },
25
+ { label: "Item", value: "1234567890", placeholder: "Ingresar valor" },
26
+ { label: "Item", value: "1234567890", placeholder: "Ingresar valor" },
27
+ { label: "Item", value: "1234567890", placeholder: "Ingresar valor" },
28
+ { label: "Item", value: "1234567890", placeholder: "Ingresar valor" },
29
+ ],
30
+ },
31
+ };