contentoh-components-library 6.0.0 → 7.0.0

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 (145) hide show
  1. package/dist/components/atoms/AsignationOption/index.js +10 -5
  2. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  3. package/dist/components/atoms/AtomList/index.js +5 -3
  4. package/dist/components/atoms/AtomList/styles.js +1 -1
  5. package/dist/components/atoms/Avatar/index.js +4 -2
  6. package/dist/components/atoms/Card/Card.stories.js +22 -0
  7. package/dist/components/atoms/Card/index.js +19 -0
  8. package/dist/components/atoms/Card/styles.js +18 -0
  9. package/dist/components/atoms/CheckBox/index.js +3 -1
  10. package/dist/components/atoms/Commentary/Commentary.stories.js +1 -0
  11. package/dist/components/atoms/Commentary/index.js +15 -0
  12. package/dist/components/atoms/Commentary/styles.js +20 -0
  13. package/dist/components/atoms/CustomerTypeImage/index.js +2 -1
  14. package/dist/components/atoms/EditField/EditField.stories.js +24 -0
  15. package/dist/components/atoms/EditField/index.js +29 -0
  16. package/dist/components/atoms/EditField/styles.js +20 -0
  17. package/dist/components/atoms/GeneralButton/GeneralButton.stories.js +1 -1
  18. package/dist/components/atoms/GeneralButton/index.js +3 -1
  19. package/dist/components/atoms/GeneralButton/styles.js +12 -2
  20. package/dist/components/atoms/GeneralInput/index.js +60 -8
  21. package/dist/components/atoms/GeneralInput/styles.js +4 -1
  22. package/dist/components/atoms/GeneralTextBox/styles.js +1 -1
  23. package/dist/components/atoms/GenericModal/GenericModal.stories.js +171 -0
  24. package/dist/components/atoms/GenericModal/index.js +23 -0
  25. package/dist/components/atoms/GenericModal/styles.js +22 -0
  26. package/dist/components/atoms/GradientPanel/GradientPanel.stories.js +135 -4
  27. package/dist/components/atoms/GradientPanel/index.js +4 -2
  28. package/dist/components/atoms/GradientPanel/styles.js +2 -2
  29. package/dist/components/atoms/Graphic/Graphic.stories.js +30 -0
  30. package/dist/components/atoms/Graphic/index.js +30 -0
  31. package/dist/components/atoms/Graphic/styles.js +18 -0
  32. package/dist/components/atoms/Input/index.js +19 -0
  33. package/dist/components/atoms/Input/style.js +26 -0
  34. package/dist/components/atoms/LabelToInput/index.js +48 -0
  35. package/dist/components/atoms/LabelToInput/style.js +22 -0
  36. package/dist/components/atoms/LoadImageMenu/LoadImageMenu.stories.js +29 -0
  37. package/dist/components/atoms/LoadImageMenu/index.js +74 -0
  38. package/dist/components/atoms/LoadImageMenu/styles.js +20 -0
  39. package/dist/components/atoms/LogoImage/LogoImage.stories.js +22 -0
  40. package/dist/components/atoms/LogoImage/index.js +23 -0
  41. package/dist/components/atoms/LogoImage/styles.js +18 -0
  42. package/dist/components/atoms/MenuNotification/MenuNotification.stories.js +33 -0
  43. package/dist/components/atoms/MenuNotification/index.js +35 -0
  44. package/dist/components/atoms/MenuNotification/styles.js +20 -0
  45. package/dist/components/atoms/MenuProfile/MenuProfile.stories.js +24 -0
  46. package/dist/components/atoms/MenuProfile/index.js +47 -0
  47. package/dist/components/atoms/MenuProfile/styles.js +20 -0
  48. package/dist/components/atoms/Notification/Notification.stories.js +30 -0
  49. package/dist/components/atoms/Notification/index.js +27 -0
  50. package/dist/components/atoms/Notification/styles.js +20 -0
  51. package/dist/components/atoms/Percent/Percent.stories.js +33 -0
  52. package/dist/components/atoms/Percent/index.js +32 -0
  53. package/dist/components/atoms/Percent/styles.js +20 -0
  54. package/dist/components/atoms/PriorityFlag/index.js +1 -1
  55. package/dist/components/atoms/ProductImage/styles.js +1 -1
  56. package/dist/components/atoms/ProgressBar/index.js +2 -2
  57. package/dist/components/atoms/ProgressBar/styles.js +3 -5
  58. package/dist/components/atoms/ScreenHeader/ScreenHeader.stories.js +9 -2
  59. package/dist/components/atoms/ScreenHeader/index.js +5 -3
  60. package/dist/components/atoms/ScreenHeader/styles.js +17 -2
  61. package/dist/components/atoms/Select/index.js +32 -0
  62. package/dist/components/atoms/Select/style.js +32 -0
  63. package/dist/components/atoms/StatusTag/styles.js +1 -1
  64. package/dist/components/atoms/ValidationPanel/index.js +4 -3
  65. package/dist/components/molecules/AddProvidersAndProducts/AddProvidersAndProducts.stories.js +28 -0
  66. package/dist/components/molecules/AddProvidersAndProducts/index.js +36 -0
  67. package/dist/components/molecules/AddProvidersAndProducts/styles.js +20 -0
  68. package/dist/components/molecules/AssignedWork/AssignedWork.stories.js +44 -0
  69. package/dist/components/molecules/AssignedWork/index.js +55 -0
  70. package/dist/components/molecules/AssignedWork/styles.js +20 -0
  71. package/dist/components/molecules/AvatarAndValidation/index.js +17 -7
  72. package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
  73. package/dist/components/molecules/EditionActiveImage/index.js +6 -2
  74. package/dist/components/molecules/FeaturesBar/index.js +21 -2
  75. package/dist/components/molecules/FeaturesBar/styles.js +1 -1
  76. package/dist/components/molecules/GalleryElement/index.js +51 -20
  77. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  78. package/dist/components/molecules/GalleryHeader/GalleryHeader.stories.js +22 -0
  79. package/dist/components/molecules/GalleryHeader/index.js +30 -0
  80. package/dist/components/molecules/GalleryHeader/styles.js +20 -0
  81. package/dist/components/molecules/ImageSelector/index.js +8 -5
  82. package/dist/components/molecules/ParentComponent/ParentComponent.stories.js +25 -0
  83. package/dist/components/molecules/ParentComponent/index.js +67 -0
  84. package/dist/components/molecules/ParentComponent/styles.js +18 -0
  85. package/dist/components/molecules/PayMethod/PayMethod.stories.js +22 -0
  86. package/dist/components/molecules/PayMethod/index.js +61 -0
  87. package/dist/components/molecules/PayMethod/styles.js +20 -0
  88. package/dist/components/molecules/PlanSelection/PlanSelection.stories.js +0 -3
  89. package/dist/components/molecules/PlanSelection/index.js +1 -1
  90. package/dist/components/molecules/PlanSelection/styles.js +1 -1
  91. package/dist/components/molecules/ProductNameHeader/index.js +1 -2
  92. package/dist/components/molecules/ProductNotification/ProductNotification.stories.js +24 -0
  93. package/dist/components/molecules/ProductNotification/index.js +71 -0
  94. package/dist/components/molecules/ProductNotification/styles.js +20 -0
  95. package/dist/components/molecules/ProfileHeader/ProfileHeader.stories.js +30 -0
  96. package/dist/components/molecules/ProfileHeader/index.js +73 -0
  97. package/dist/components/molecules/ProfileHeader/styles.js +20 -0
  98. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +42 -0
  99. package/dist/components/molecules/RetailerSelector/index.js +71 -0
  100. package/dist/components/molecules/RetailerSelector/styles.js +20 -0
  101. package/dist/components/molecules/SidebarNotification/SidebarNotification.stories.js +98 -0
  102. package/dist/components/molecules/SidebarNotification/index.js +105 -0
  103. package/dist/components/molecules/SidebarNotification/styles.js +20 -0
  104. package/dist/components/molecules/StatusAsignationInfo/index.js +51 -12
  105. package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
  106. package/dist/components/molecules/TableHeader/index.js +5 -4
  107. package/dist/components/molecules/TabsMenu/index.js +4 -2
  108. package/dist/components/molecules/TagAndInput/index.js +28 -3
  109. package/dist/components/molecules/TagAndInput/styles.js +1 -1
  110. package/dist/components/organisms/FullProductNameHeader/index.js +32 -8
  111. package/dist/components/organisms/FullTabsMenu/index.js +17 -5
  112. package/dist/components/organisms/FullTabsMenu/styles.js +1 -1
  113. package/dist/components/organisms/Fullplan/FullPlan.stories.js +13 -15
  114. package/dist/components/organisms/Fullplan/index.js +1 -1
  115. package/dist/components/organisms/Fullplan/styles.js +1 -1
  116. package/dist/components/organisms/ImageDataTable/index.js +77 -15
  117. package/dist/components/organisms/ImageDataTable/styles.js +7 -1
  118. package/dist/components/organisms/ImagePreviewer/index.js +6 -19
  119. package/dist/components/organisms/InputGroup/index.js +53 -8
  120. package/dist/components/organisms/InputGroup/styles.js +1 -1
  121. package/dist/components/organisms/ProductImageModal/ProductImageModal.stories.js +122 -120
  122. package/dist/components/organisms/ProductImageModal/index.js +28 -12
  123. package/dist/components/organisms/ProductImageModal/styles.js +1 -1
  124. package/dist/components/pages/CustomerLogin/CustomerLogin.stories.js +95 -0
  125. package/dist/components/pages/CustomerLogin/index.js +29 -0
  126. package/dist/components/pages/CustomerLogin/styles.js +18 -0
  127. package/dist/components/pages/CustomerPayMethod/CustomerPayMethod.stories.js +72 -0
  128. package/dist/components/pages/CustomerPayMethod/index.js +29 -0
  129. package/dist/components/pages/CustomerPayMethod/styles.js +18 -0
  130. package/dist/components/pages/CustomerType/CustomerType.stories.js +16 -5
  131. package/dist/components/pages/CustomerType/styles.js +1 -3
  132. package/dist/components/pages/OnboardPlan/OnboardPlan.stories.js +24 -10
  133. package/dist/components/pages/OnboardPlan/index.js +8 -10
  134. package/dist/components/pages/OnboardPlan/styles.js +1 -1
  135. package/dist/components/pages/RetailerPlan/RetailerPlan.stories.js +59 -0
  136. package/dist/components/pages/RetailerPlan/index.js +31 -0
  137. package/dist/components/pages/RetailerPlan/styles.js +18 -0
  138. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +101 -313
  139. package/dist/components/pages/RetailerProductEdition/index.js +1071 -39
  140. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  141. package/dist/global-files/data.js +219 -0
  142. package/dist/global-files/variables.js +1 -0
  143. package/dist/index.js +7 -2
  144. package/package.json +1 -1
  145. package/src/index.js +2 -1
@@ -22,19 +22,17 @@ exports.FullPlanDefault = FullPlanDefault;
22
22
  FullPlanDefault.args = {
23
23
  title: "Elige el número de proveedores",
24
24
  textGeneral: "Bienvido a nuestra plataforma de cadena, para continuar elige el número de proveedores que tiene tu cadena",
25
- containerData: {
26
- planSelection: [{
27
- number: "300",
28
- name: "Proveedores"
29
- }, {
30
- number: "1500",
31
- name: "Proveedores"
32
- }, {
33
- number: "+3000",
34
- name: "Proveedores"
35
- }, {
36
- number: "Ondemand",
37
- name: "agrega proveedores a tu forma"
38
- }]
39
- }
25
+ containerData: [{
26
+ number: "300",
27
+ name: "Proveedores"
28
+ }, {
29
+ number: "1500",
30
+ name: "Proveedores"
31
+ }, {
32
+ number: "+3000",
33
+ name: "Proveedores"
34
+ }, {
35
+ number: "Ondemand",
36
+ name: "agrega proveedores a tu forma"
37
+ }]
40
38
  };
@@ -40,7 +40,7 @@ var FullPlan = function FullPlan(_ref) {
40
40
  })), /*#__PURE__*/React.createElement("div", {
41
41
  className: "general-text"
42
42
  }, /*#__PURE__*/React.createElement("p", null, textGeneral)), /*#__PURE__*/React.createElement(_PlanSelection.PlanSelection, {
43
- planSelection: containerData.planSelection,
43
+ planSelection: containerData,
44
44
  setbuttonActive: setbuttonActive
45
45
  }), /*#__PURE__*/React.createElement(_GeneralButton.Button, {
46
46
  buttonType: buttonActive ? "general-default-button" : "general-transparent-button",
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n text-align: center;\n\n .title {\n text-align: center;\n font-feature-settings: \"pnum\" on, \"lnum\" on;\n h2 {\n max-width: 350px;\n margin: auto;\n }\n }\n .general-text {\n text-align: center;\n font-feature-settings: \"pnum\" on, \"lnum\" on;\n p {\n color: ", ";\n font-family: ", ";\n font-size: 14px;\n max-width: 390px;\n margin: auto;\n }\n }\n"])), _variables.GlobalColors.s4, _variables.FontFamily.AvenirNext);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n text-align: center;\n height: 100%;\n width: 100%;\n\n .title {\n text-align: center;\n font-feature-settings: \"pnum\" on, \"lnum\" on;\n h2 {\n margin: auto;\n }\n }\n .general-text {\n text-align: center;\n font-feature-settings: \"pnum\" on, \"lnum\" on;\n p {\n color: ", ";\n font-family: ", ";\n font-size: 14px;\n margin: auto;\n }\n }\n"])), _variables.GlobalColors.s4, _variables.FontFamily.AvenirNext);
19
19
 
20
20
  exports.Container = Container;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -9,23 +11,83 @@ var _styles = require("./styles");
9
11
 
10
12
  var _TableHeader = require("../../molecules/TableHeader");
11
13
 
12
- var _TableRow = require("../../molecules/TableRow");
14
+ var _styles2 = require("../../molecules/TableRow/styles");
15
+
16
+ var _ScreenHeader = require("../../atoms/ScreenHeader");
17
+
18
+ var _LabelToInput = _interopRequireDefault(require("../../atoms/LabelToInput"));
13
19
 
14
20
  var ImageDataTable = function ImageDataTable(_ref) {
15
- var headerInfo = _ref.headerInfo,
16
- imageData = _ref.imageData,
17
- activeImage = _ref.activeImage;
18
- return /*#__PURE__*/React.createElement(_styles.Container, null, /*#__PURE__*/React.createElement(_TableHeader.TableHeader, {
19
- headerInfo: headerInfo,
20
- activeImage: activeImage
21
- }), imageData === null || imageData === void 0 ? void 0 : imageData.map(function (attribute, index) {
22
- return /*#__PURE__*/React.createElement(_TableRow.TableRow, {
23
- key: index,
24
- feature: attribute.feature,
25
- value: attribute.value,
26
- valueType: index < 2
27
- });
28
- }));
21
+ var _lists$inputs, _lists$inputs$find, _lists$imagePackaging, _lists$imagePackaging2, _lists$imageType, _lists$imageType$find, _lists$attrForImgs$re;
22
+
23
+ var activeImage = _ref.activeImage,
24
+ darkMode = _ref.darkMode,
25
+ lists = _ref.lists,
26
+ retailerSelected = _ref.retailerSelected,
27
+ setImages = _ref.setImages,
28
+ assignationsImages = _ref.assignationsImages,
29
+ imagesStatus = _ref.imagesStatus;
30
+ return /*#__PURE__*/React.createElement(_styles.Container, {
31
+ darkMode: darkMode
32
+ }, /*#__PURE__*/React.createElement(_TableHeader.TableHeader, {
33
+ imagesStatus: imagesStatus,
34
+ activeImage: activeImage,
35
+ assignationsImages: assignationsImages
36
+ }), /*#__PURE__*/React.createElement(_styles2.Container, null, /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
37
+ headerType: "table-row-text",
38
+ text: "Tipo de toma"
39
+ }), /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
40
+ headerType: "table-row-text gray-table-row",
41
+ text: lists === null || lists === void 0 ? void 0 : (_lists$inputs = lists.inputs) === null || _lists$inputs === void 0 ? void 0 : (_lists$inputs$find = _lists$inputs.find(function (f) {
42
+ return f.id === +(activeImage === null || activeImage === void 0 ? void 0 : activeImage.image_id);
43
+ })) === null || _lists$inputs$find === void 0 ? void 0 : _lists$inputs$find.name
44
+ })), /*#__PURE__*/React.createElement(_styles2.Container, null, /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
45
+ headerType: "table-row-text",
46
+ text: "Tipo de empaque"
47
+ }), /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
48
+ headerType: "table-row-text gray-table-row",
49
+ text: lists === null || lists === void 0 ? void 0 : (_lists$imagePackaging = lists.imagePackagingType) === null || _lists$imagePackaging === void 0 ? void 0 : (_lists$imagePackaging2 = _lists$imagePackaging.find(function (f) {
50
+ return f.id === +(activeImage === null || activeImage === void 0 ? void 0 : activeImage.packing_type);
51
+ })) === null || _lists$imagePackaging2 === void 0 ? void 0 : _lists$imagePackaging2.name
52
+ })), /*#__PURE__*/React.createElement(_styles2.Container, null, /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
53
+ headerType: "table-row-text",
54
+ text: "Tipo de imagen"
55
+ }), /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
56
+ headerType: "table-row-text gray-table-row",
57
+ text: lists === null || lists === void 0 ? void 0 : (_lists$imageType = lists.imageType) === null || _lists$imageType === void 0 ? void 0 : (_lists$imageType$find = _lists$imageType.find(function (f) {
58
+ return f.id === +(activeImage === null || activeImage === void 0 ? void 0 : activeImage.image_type);
59
+ })) === null || _lists$imageType$find === void 0 ? void 0 : _lists$imageType$find.name
60
+ })), /*#__PURE__*/React.createElement(_styles2.Container, null, /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
61
+ headerType: "table-row-text",
62
+ text: "Formato"
63
+ }), /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
64
+ headerType: "table-row-text",
65
+ text: activeImage === null || activeImage === void 0 ? void 0 : activeImage.ext
66
+ })), /*#__PURE__*/React.createElement(_styles2.Container, null, /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
67
+ headerType: "table-row-text",
68
+ text: "Tama\xF1o de imagen"
69
+ }), /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
70
+ headerType: "table-row-text",
71
+ text: "".concat(activeImage === null || activeImage === void 0 ? void 0 : activeImage.width, "x").concat(activeImage === null || activeImage === void 0 ? void 0 : activeImage.height, "px")
72
+ })), retailerSelected && (lists === null || lists === void 0 ? void 0 : lists.attrForImgs) && (lists === null || lists === void 0 ? void 0 : (_lists$attrForImgs$re = lists.attrForImgs[retailerSelected]) === null || _lists$attrForImgs$re === void 0 ? void 0 : _lists$attrForImgs$re.map(function (attr, index) {
73
+ return /*#__PURE__*/React.createElement(_styles2.Container, {
74
+ key: "row-" + index
75
+ }, /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
76
+ headerType: "table-row-text",
77
+ text: attr === null || attr === void 0 ? void 0 : attr.name
78
+ }), /*#__PURE__*/React.createElement(_LabelToInput.default, {
79
+ width: "100px",
80
+ defaultValue: attr === null || attr === void 0 ? void 0 : attr.value,
81
+ onChange: function onChange(e) {
82
+ setImages({
83
+ action: "changeAttrValue",
84
+ retailer: retailerSelected,
85
+ index: index,
86
+ value: e.target.value
87
+ });
88
+ }
89
+ }));
90
+ })));
29
91
  };
30
92
 
31
93
  exports.ImageDataTable = ImageDataTable;
@@ -15,6 +15,12 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 340px;\n padding: 10px;\n border: 1px solid ", ";\n border-radius: 3px;\n"])), _variables.GlobalColors.s2);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 340px;\n padding: 10px;\n border: 1px solid ", ";\n border-radius: 3px;\n\n .input-name-header,\n .table-row-text {\n color: ", ";\n }\n .gray-table-row {\n background-color: ", ";\n }\n"])), _variables.GlobalColors.s2, function (_ref) {
19
+ var darkMode = _ref.darkMode;
20
+ return darkMode && _variables.GlobalColors.s1;
21
+ }, function (_ref2) {
22
+ var darkMode = _ref2.darkMode;
23
+ return darkMode && _variables.GlobalColors.s5;
24
+ });
19
25
 
20
26
  exports.Container = Container;
@@ -1,42 +1,29 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.ImagePreviewer = void 0;
9
7
 
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
-
12
8
  var _styles = require("./styles");
13
9
 
14
10
  var _EditionActiveImage = require("../../molecules/EditionActiveImage");
15
11
 
16
12
  var _ImageSelector = require("../../molecules/ImageSelector");
17
13
 
18
- var _react = require("react");
19
-
20
14
  var ImagePreviewer = function ImagePreviewer(_ref) {
21
15
  var _ref$imagesArray = _ref.imagesArray,
22
16
  imagesArray = _ref$imagesArray === void 0 ? [] : _ref$imagesArray,
23
17
  activeImage = _ref.activeImage,
24
- setActiveImage = _ref.setActiveImage;
25
-
26
- var _useState = (0, _react.useState)(activeImage),
27
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
28
- imageSelected = _useState2[0],
29
- setImageSelected = _useState2[1];
30
-
31
- (0, _react.useEffect)(function () {
32
- setActiveImage && setActiveImage(imageSelected);
33
- }, [imageSelected]);
18
+ setActiveImage = _ref.setActiveImage,
19
+ setShowModal = _ref.setShowModal;
34
20
  return /*#__PURE__*/React.createElement(_styles.Container, null, /*#__PURE__*/React.createElement(_EditionActiveImage.EditionActiveImage, {
35
- img: imageSelected === null || imageSelected === void 0 ? void 0 : imageSelected.img,
36
- altText: imageSelected === null || imageSelected === void 0 ? void 0 : imageSelected.alt
21
+ img: activeImage === null || activeImage === void 0 ? void 0 : activeImage.src,
22
+ altText: activeImage === null || activeImage === void 0 ? void 0 : activeImage.name,
23
+ setShowModal: setShowModal
37
24
  }), /*#__PURE__*/React.createElement(_ImageSelector.ImageSelector, {
38
25
  images: imagesArray,
39
- setActiveImage: setImageSelected
26
+ setActiveImage: setActiveImage
40
27
  }));
41
28
  };
42
29
 
@@ -16,21 +16,66 @@ var InputGroup = function InputGroup(_ref) {
16
16
 
17
17
  var _ref$inputGroup = _ref.inputGroup,
18
18
  inputGroup = _ref$inputGroup === void 0 ? {} : _ref$inputGroup,
19
- activeSection = _ref.activeSection;
19
+ activeSection = _ref.activeSection,
20
+ _ref$dataInputs = _ref.dataInputs,
21
+ dataInputs = _ref$dataInputs === void 0 ? {} : _ref$dataInputs,
22
+ updatedDescriptions = _ref.updatedDescriptions,
23
+ setUpdatedDescriptions = _ref.setUpdatedDescriptions,
24
+ updatedDatasheets = _ref.updatedDatasheets,
25
+ setUpdatedDatasheets = _ref.setUpdatedDatasheets,
26
+ articleId = _ref.articleId,
27
+ version = _ref.version,
28
+ dinamicHeight = _ref.dinamicHeight;
29
+
30
+ var inputTypeValue = function inputTypeValue(type) {
31
+ switch (type) {
32
+ case "Booleano":
33
+ return "checkbox";
34
+
35
+ case "Numérico":
36
+ return "number";
37
+
38
+ default:
39
+ return "text";
40
+ }
41
+ };
42
+
20
43
  return /*#__PURE__*/React.createElement(_styles.Container, {
21
44
  className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout"
22
45
  }, /*#__PURE__*/React.createElement(_ScreenHeader.ScreenHeader, {
23
46
  headerType: "retailer-name-header",
24
- text: inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.name
47
+ text: inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup
25
48
  }), /*#__PURE__*/React.createElement("div", {
26
49
  className: "inputs-container"
27
50
  }, inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs = inputGroup.inputs) === null || _inputGroup$inputs === void 0 ? void 0 : _inputGroup$inputs.map(function (input, index) {
28
- return /*#__PURE__*/React.createElement(_TagAndInput.TagAndInput, {
29
- key: index,
30
- inputType: activeSection === "Ficha técnica" ? "text" : "textarea",
31
- label: input.label,
32
- value: input.value,
33
- inputPlaceHolder: input.placeholder
51
+ var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6;
52
+
53
+ return activeSection === "Ficha técnica" ? /*#__PURE__*/React.createElement(_TagAndInput.TagAndInput, {
54
+ key: index + "-" + ((_dataInputs$input = dataInputs[input]) === null || _dataInputs$input === void 0 ? void 0 : _dataInputs$input.value),
55
+ inputId: (_dataInputs$input2 = dataInputs[input]) === null || _dataInputs$input2 === void 0 ? void 0 : _dataInputs$input2.id,
56
+ version: version,
57
+ inputType: inputTypeValue((_dataInputs$input3 = dataInputs[input]) === null || _dataInputs$input3 === void 0 ? void 0 : _dataInputs$input3.type),
58
+ label: (_dataInputs$input4 = dataInputs[input]) === null || _dataInputs$input4 === void 0 ? void 0 : _dataInputs$input4.name,
59
+ value: (_dataInputs$input5 = dataInputs[input]) === null || _dataInputs$input5 === void 0 ? void 0 : _dataInputs$input5.value,
60
+ inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
61
+ articleId: articleId,
62
+ isRequired: (_dataInputs$input6 = dataInputs[input]) === null || _dataInputs$input6 === void 0 ? void 0 : _dataInputs$input6.required,
63
+ updatedDatasheets: updatedDatasheets,
64
+ setUpdatedDatasheets: setUpdatedDatasheets
65
+ }) : /*#__PURE__*/React.createElement(_TagAndInput.TagAndInput, {
66
+ key: index + "-" + (input === null || input === void 0 ? void 0 : input.value),
67
+ inputId: input === null || input === void 0 ? void 0 : input.id,
68
+ index: index,
69
+ inputType: "textarea",
70
+ label: input === null || input === void 0 ? void 0 : input.name,
71
+ value: input === null || input === void 0 ? void 0 : input.value,
72
+ isRequired: input.required,
73
+ inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
74
+ updatedDescriptions: updatedDescriptions,
75
+ setUpdatedDescriptions: setUpdatedDescriptions,
76
+ articleId: articleId,
77
+ version: version,
78
+ dinamicHeight: dinamicHeight
34
79
  });
35
80
  })));
36
81
  };
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n border-radius: 6px;\n padding: 10px;\n width: 100%;\n\n .retailer-name-header {\n & + * {\n margin-top: 10px;\n }\n }\n &.datasheets-layout {\n padding-right: 0;\n\n .inputs-container {\n display: flex;\n flex-wrap: wrap;\n\n .input-container {\n flex: 1 1 20%;\n margin-right: 10px;\n min-width: 227px;\n }\n }\n }\n\n & + * {\n margin-top: 15px;\n }\n"])), _variables.GlobalColors.s2);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n border-radius: 6px;\n padding: 10px;\n width: 100%;\n\n .retailer-name-header {\n & + * {\n margin-top: 10px;\n }\n }\n &.datasheets-layout {\n padding-right: 0;\n\n .inputs-container {\n display: flex;\n flex-wrap: wrap;\n\n .input-container {\n flex: 1 1 20%;\n margin-right: 10px;\n min-width: 227px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n }\n }\n\n & + * {\n margin-top: 15px;\n }\n"])), _variables.GlobalColors.s2);
19
19
 
20
20
  exports.Container = Container;
@@ -21,125 +21,127 @@ var ProductImageModalDefault = Template.bind({});
21
21
  exports.ProductImageModalDefault = ProductImageModalDefault;
22
22
  ProductImageModalDefault.args = {
23
23
  headerInfo: {},
24
- imagesArray: [{
25
- img: "https://image.shutterstock.com/image-illustration/3d-render-generic-drug-pills-260nw-709112806.jpg",
26
- alt: "img",
27
- name: "Hero",
28
- data: [{
29
- feature: "Tamaño de imagen",
30
- value: "1000x10000"
31
- }, {
32
- feature: "Formato",
33
- value: "jpg"
34
- }, {
35
- feature: "Resolución",
36
- value: "300dpi"
37
- }, {
38
- feature: "Tipo de imagen",
39
- value: "Tipo de imagen"
40
- }, {
41
- feature: "Identificador",
42
- value: "F261"
43
- }]
44
- }, {
45
- img: "https://www.muycomputer.com/wp-content/uploads/2020/12/google.png",
46
- alt: "img",
47
- name: "Hero2",
48
- data: [{
49
- feature: "Tamaño de imagen",
50
- value: "1000x10000"
51
- }, {
52
- feature: "Formato",
53
- value: "jpg"
54
- }, {
55
- feature: "Resolución",
56
- value: "300dpi"
57
- }, {
58
- feature: "Tipo de imagen",
59
- value: "Tipo de imagen"
60
- }, {
61
- feature: "Identificador",
62
- value: "F261"
63
- }]
64
- }, {
65
- img: "https://www.ionos.es/digitalguide/fileadmin/DigitalGuide/Teaser/bildergalerie-online-t.jpg",
66
- alt: "img",
67
- name: "Hero3",
68
- data: [{
69
- feature: "Tamaño de imagen",
70
- value: "1000x10000"
71
- }, {
72
- feature: "Formato",
73
- value: "jpg"
74
- }, {
75
- feature: "Resolución",
76
- value: "300dpi"
77
- }, {
78
- feature: "Tipo de imagen",
79
- value: "Tipo de imagen"
80
- }, {
81
- feature: "Identificador",
82
- value: "F261"
83
- }]
84
- }, {
85
- img: "https://i.pinimg.com/originals/d0/b9/28/d0b928df15d3a3bf1905865a8fedb257.jpg",
86
- alt: "img",
87
- name: "Hero4",
88
- data: [{
89
- feature: "Tamaño de imagen",
90
- value: "1000x10000"
91
- }, {
92
- feature: "Formato",
93
- value: "jpg"
94
- }, {
95
- feature: "Resolución",
96
- value: "300dpi"
97
- }, {
98
- feature: "Tipo de imagen",
99
- value: "Tipo de imagen"
100
- }, {
101
- feature: "Identificador",
102
- value: "F261"
103
- }]
104
- }, {
105
- img: "https://memegenerator.net/img/images/72798198.jpg",
106
- alt: "img",
107
- name: "Hero5",
108
- data: [{
109
- feature: "Tamaño de imagen",
110
- value: "1000x10000"
111
- }, {
112
- feature: "Formato",
113
- value: "jpg"
114
- }, {
115
- feature: "Resolución",
116
- value: "300dpi"
117
- }, {
118
- feature: "Tipo de imagen",
119
- value: "Tipo de imagen"
120
- }, {
121
- feature: "Identificador",
122
- value: "F261"
123
- }]
124
- }, {
125
- img: "http://www.dumpaday.com/wp-content/uploads/2016/02/funny-pictures-621.jpg",
126
- alt: "img",
127
- name: "Hero6",
128
- data: [{
129
- feature: "Tamaño de imagen",
130
- value: "1000x10000"
131
- }, {
132
- feature: "Formato",
133
- value: "jpg"
134
- }, {
135
- feature: "Resolución",
136
- value: "300dpi"
137
- }, {
138
- feature: "Tipo de imagen",
139
- value: "Tipo de imagen"
140
- }, {
141
- feature: "Identificador",
142
- value: "F261"
24
+ images: {
25
+ values: [{
26
+ img: "https://image.shutterstock.com/image-illustration/3d-render-generic-drug-pills-260nw-709112806.jpg",
27
+ alt: "img",
28
+ name: "Hero",
29
+ data: [{
30
+ feature: "Tamaño de imagen",
31
+ value: "1000x10000"
32
+ }, {
33
+ feature: "Formato",
34
+ value: "jpg"
35
+ }, {
36
+ feature: "Resolución",
37
+ value: "300dpi"
38
+ }, {
39
+ feature: "Tipo de imagen",
40
+ value: "Tipo de imagen"
41
+ }, {
42
+ feature: "Identificador",
43
+ value: "F261"
44
+ }]
45
+ }, {
46
+ img: "https://www.muycomputer.com/wp-content/uploads/2020/12/google.png",
47
+ alt: "img",
48
+ name: "Hero2",
49
+ data: [{
50
+ feature: "Tamaño de imagen",
51
+ value: "1000x10000"
52
+ }, {
53
+ feature: "Formato",
54
+ value: "jpg"
55
+ }, {
56
+ feature: "Resolución",
57
+ value: "300dpi"
58
+ }, {
59
+ feature: "Tipo de imagen",
60
+ value: "Tipo de imagen"
61
+ }, {
62
+ feature: "Identificador",
63
+ value: "F261"
64
+ }]
65
+ }, {
66
+ img: "https://www.ionos.es/digitalguide/fileadmin/DigitalGuide/Teaser/bildergalerie-online-t.jpg",
67
+ alt: "img",
68
+ name: "Hero3",
69
+ data: [{
70
+ feature: "Tamaño de imagen",
71
+ value: "1000x10000"
72
+ }, {
73
+ feature: "Formato",
74
+ value: "jpg"
75
+ }, {
76
+ feature: "Resolución",
77
+ value: "300dpi"
78
+ }, {
79
+ feature: "Tipo de imagen",
80
+ value: "Tipo de imagen"
81
+ }, {
82
+ feature: "Identificador",
83
+ value: "F261"
84
+ }]
85
+ }, {
86
+ img: "https://i.pinimg.com/originals/d0/b9/28/d0b928df15d3a3bf1905865a8fedb257.jpg",
87
+ alt: "img",
88
+ name: "Hero4",
89
+ data: [{
90
+ feature: "Tamaño de imagen",
91
+ value: "1000x10000"
92
+ }, {
93
+ feature: "Formato",
94
+ value: "jpg"
95
+ }, {
96
+ feature: "Resolución",
97
+ value: "300dpi"
98
+ }, {
99
+ feature: "Tipo de imagen",
100
+ value: "Tipo de imagen"
101
+ }, {
102
+ feature: "Identificador",
103
+ value: "F261"
104
+ }]
105
+ }, {
106
+ img: "https://memegenerator.net/img/images/72798198.jpg",
107
+ alt: "img",
108
+ name: "Hero5",
109
+ data: [{
110
+ feature: "Tamaño de imagen",
111
+ value: "1000x10000"
112
+ }, {
113
+ feature: "Formato",
114
+ value: "jpg"
115
+ }, {
116
+ feature: "Resolución",
117
+ value: "300dpi"
118
+ }, {
119
+ feature: "Tipo de imagen",
120
+ value: "Tipo de imagen"
121
+ }, {
122
+ feature: "Identificador",
123
+ value: "F261"
124
+ }]
125
+ }, {
126
+ img: "http://www.dumpaday.com/wp-content/uploads/2016/02/funny-pictures-621.jpg",
127
+ alt: "img",
128
+ name: "Hero6",
129
+ data: [{
130
+ feature: "Tamaño de imagen",
131
+ value: "1000x10000"
132
+ }, {
133
+ feature: "Formato",
134
+ value: "jpg"
135
+ }, {
136
+ feature: "Resolución",
137
+ value: "300dpi"
138
+ }, {
139
+ feature: "Tipo de imagen",
140
+ value: "Tipo de imagen"
141
+ }, {
142
+ feature: "Identificador",
143
+ value: "F261"
144
+ }]
143
145
  }]
144
- }]
146
+ }
145
147
  };
@@ -23,13 +23,20 @@ var _ValidationPanel = require("../../atoms/ValidationPanel");
23
23
 
24
24
  var _GeneralButton = require("../../atoms/GeneralButton");
25
25
 
26
+ var _data = require("../../../global-files/data");
27
+
26
28
  var ProductImageModal = function ProductImageModal(_ref) {
27
- var _ref$imagesArray = _ref.imagesArray,
28
- imagesArray = _ref$imagesArray === void 0 ? [] : _ref$imagesArray,
29
+ var _images$values$active, _images$values$active2, _images$values$active3;
30
+
31
+ var _ref$images = _ref.images,
32
+ images = _ref$images === void 0 ? [] : _ref$images,
29
33
  headerInfo = _ref.headerInfo,
30
- validation = _ref.validation;
34
+ validation = _ref.validation,
35
+ setShowModal = _ref.setShowModal,
36
+ sendToFacilitator = _ref.sendToFacilitator,
37
+ approveRejectButtons = _ref.approveRejectButtons;
31
38
 
32
- var _useState = (0, _react.useState)(imagesArray.length > 0 && imagesArray[0]),
39
+ var _useState = (0, _react.useState)(0),
33
40
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
34
41
  activeImage = _useState2[0],
35
42
  setActiveImage = _useState2[1];
@@ -56,13 +63,16 @@ var ProductImageModal = function ProductImageModal(_ref) {
56
63
  document.addEventListener("click", closeValidationPanel, false);
57
64
  }
58
65
  }, [showValidationPanel]);
66
+ (0, _react.useEffect)(function () {
67
+ console.log(images === null || images === void 0 ? void 0 : images.values[activeImage]);
68
+ }, [activeImage]);
59
69
  return /*#__PURE__*/React.createElement(_styles.Container, null, /*#__PURE__*/React.createElement("div", {
60
70
  className: "modal-container"
61
71
  }, /*#__PURE__*/React.createElement("div", {
62
72
  className: "modal-image-container"
63
73
  }, /*#__PURE__*/React.createElement(_ProductImage.ProductImage, {
64
- img: activeImage === null || activeImage === void 0 ? void 0 : activeImage.img,
65
- altText: activeImage === null || activeImage === void 0 ? void 0 : activeImage.name,
74
+ img: images === null || images === void 0 ? void 0 : (_images$values$active = images.values[activeImage]) === null || _images$values$active === void 0 ? void 0 : _images$values$active.src,
75
+ altText: images === null || images === void 0 ? void 0 : (_images$values$active2 = images.values[activeImage]) === null || _images$values$active2 === void 0 ? void 0 : _images$values$active2.name,
66
76
  imageType: "expanded-modal-image"
67
77
  })), /*#__PURE__*/React.createElement("div", {
68
78
  className: "modal-data-container"
@@ -70,23 +80,29 @@ var ProductImageModal = function ProductImageModal(_ref) {
70
80
  className: "validation-and-table-container"
71
81
  }, /*#__PURE__*/React.createElement("div", {
72
82
  className: "validation-panel"
73
- }, /*#__PURE__*/React.createElement(_GeneralButton.Button, {
83
+ }, approveRejectButtons("images") && /*#__PURE__*/React.createElement(_GeneralButton.Button, {
74
84
  buttonType: "circular-button ".concat(buttonType),
75
85
  onClick: function onClick() {
76
86
  return setShowValidationPanel(true);
77
87
  }
78
88
  }), /*#__PURE__*/React.createElement(_GeneralButton.Button, {
79
- buttonType: "close-button"
89
+ buttonType: "close-button",
90
+ onClick: function onClick() {
91
+ setShowModal(false);
92
+ }
80
93
  }), showValidationPanel && /*#__PURE__*/React.createElement(_ValidationPanel.ValidationPanel, {
81
94
  id: "validation-panel",
82
95
  setOptionClicked: setButtonType,
83
- setShowValidationPanel: setShowValidationPanel
96
+ setShowValidationPanel: setShowValidationPanel,
97
+ sendToFacilitator: sendToFacilitator
84
98
  })), /*#__PURE__*/React.createElement(_ImageDataTable.ImageDataTable, {
85
- imageData: activeImage.data,
99
+ imageData: images === null || images === void 0 ? void 0 : (_images$values$active3 = images.values[activeImage]) === null || _images$values$active3 === void 0 ? void 0 : _images$values$active3.data,
86
100
  headerInfo: headerInfo,
87
- activeImage: activeImage
101
+ activeImage: images === null || images === void 0 ? void 0 : images.values[activeImage],
102
+ darkMode: true,
103
+ lists: images
88
104
  })), /*#__PURE__*/React.createElement(_ImageSelector.ImageSelector, {
89
- images: imagesArray,
105
+ images: images,
90
106
  setActiveImage: setActiveImage,
91
107
  modalSelector: true
92
108
  }))));