contentoh-components-library 15.0.0 → 16.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 (54) hide show
  1. package/dist/components/atoms/CheckBox/index.js +4 -2
  2. package/dist/components/atoms/GeneralButton/styles.js +4 -2
  3. package/dist/components/atoms/GeneralInput/index.js +14 -27
  4. package/dist/components/atoms/GenericModal/index.js +4 -2
  5. package/dist/components/atoms/GenericModal/styles.js +1 -1
  6. package/dist/components/atoms/Input/index.js +1 -1
  7. package/dist/components/atoms/Input/style.js +4 -4
  8. package/dist/components/atoms/InputFormatter/Wysiwyg.stories.js +30 -0
  9. package/dist/components/atoms/InputFormatter/index.js +119 -0
  10. package/dist/components/atoms/InputFormatter/styles.js +33 -0
  11. package/dist/components/atoms/LabelToInput/style.js +3 -3
  12. package/dist/components/atoms/ProductPercentCard/Percent.stories.js +41 -0
  13. package/dist/components/atoms/ProductPercentCard/index.js +45 -0
  14. package/dist/components/atoms/ProductPercentCard/styles.js +20 -0
  15. package/dist/components/molecules/GalleryElement/index.js +24 -2
  16. package/dist/components/molecules/GalleryHeader/index.js +19 -2
  17. package/dist/components/molecules/StatusAsignationInfo/index.js +12 -27
  18. package/dist/components/molecules/TableHeader/index.js +4 -2
  19. package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
  20. package/dist/components/organisms/FullTabsMenu/index.js +8 -8
  21. package/dist/components/organisms/ImageDataTable/index.js +4 -2
  22. package/dist/components/organisms/ProductImageModal/index.js +2 -3
  23. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -14
  24. package/dist/components/pages/RetailerProductEdition/index.js +330 -169
  25. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  26. package/package.json +5 -1
  27. package/src/assets/images/generalButton/downloadIcon.svg +3 -0
  28. package/src/components/atoms/CheckBox/index.js +8 -2
  29. package/src/components/atoms/GeneralButton/styles.js +14 -0
  30. package/src/components/atoms/GeneralInput/index.js +12 -29
  31. package/src/components/atoms/GenericModal/index.js +2 -2
  32. package/src/components/atoms/GenericModal/styles.js +1 -0
  33. package/src/components/atoms/Input/index.js +2 -1
  34. package/src/components/atoms/Input/style.js +9 -5
  35. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +12 -0
  36. package/src/components/atoms/InputFormatter/index.js +76 -0
  37. package/src/components/atoms/InputFormatter/styles.js +34 -0
  38. package/src/components/atoms/LabelToInput/style.js +10 -2
  39. package/src/components/atoms/ProductPercentCard/Percent.stories.js +41 -0
  40. package/src/components/atoms/ProductPercentCard/index.js +23 -0
  41. package/src/components/atoms/{Percent → ProductPercentCard}/styles.js +11 -7
  42. package/src/components/molecules/GalleryElement/index.js +18 -1
  43. package/src/components/molecules/GalleryHeader/index.js +8 -2
  44. package/src/components/molecules/StatusAsignationInfo/index.js +12 -24
  45. package/src/components/molecules/TableHeader/index.js +2 -0
  46. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  47. package/src/components/organisms/FullTabsMenu/index.js +6 -6
  48. package/src/components/organisms/ImageDataTable/index.js +2 -0
  49. package/src/components/organisms/ProductImageModal/index.js +8 -2
  50. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -14
  51. package/src/components/pages/RetailerProductEdition/index.js +252 -90
  52. package/src/components/pages/RetailerProductEdition/styles.js +11 -3
  53. package/src/components/atoms/Percent/Percent.stories.js +0 -38
  54. package/src/components/atoms/Percent/index.js +0 -15
@@ -34,26 +34,23 @@ var StatusAsignationInfo = function StatusAsignationInfo(_ref) {
34
34
  status = _ref$status === void 0 ? "-" : _ref$status,
35
35
  imagesSection = _ref.imagesSection,
36
36
  setImageLayout = _ref.setImageLayout,
37
- asignationsList = _ref.asignationsList,
38
37
  _ref$percent = _ref.percent,
39
38
  percent = _ref$percent === void 0 ? 0 : _ref$percent,
40
- activeTab = _ref.activeTab,
41
- deleteImages = _ref.deleteImages,
42
- saveDatasheets = _ref.saveDatasheets,
43
- saveDescriptions = _ref.saveDescriptions,
44
- updateImages = _ref.updateImages,
45
39
  assignationsImages = _ref.assignationsImages,
46
40
  setAssignation = _ref.setAssignation,
47
41
  isRetailer = _ref.isRetailer,
42
+ downloadImages = _ref.downloadImages,
43
+ askToDeleteImages = _ref.askToDeleteImages,
48
44
  _ref$id = _ref.id,
49
- id = _ref$id === void 0 ? "default-id" : _ref$id;
45
+ id = _ref$id === void 0 ? "default-id" : _ref$id,
46
+ onClickSave = _ref.onClickSave;
50
47
 
51
48
  var _useState = (0, _react.useState)(false),
52
49
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
53
50
  showAsignationPanel = _useState2[0],
54
51
  setShowAsignationPanel = _useState2[1];
55
52
 
56
- var _useState3 = (0, _react.useState)(true),
53
+ var _useState3 = (0, _react.useState)(false),
57
54
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
58
55
  layout = _useState4[0],
59
56
  setLayout = _useState4[1];
@@ -79,30 +76,18 @@ var StatusAsignationInfo = function StatusAsignationInfo(_ref) {
79
76
  id: id,
80
77
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
81
78
  buttonType: "circular-button save-button",
82
- onClick: function onClick() {
83
- switch (activeTab) {
84
- case "Descripción":
85
- saveDescriptions && saveDescriptions();
86
- break;
87
-
88
- case "Ficha técnica":
89
- saveDatasheets && saveDatasheets();
90
- break;
91
-
92
- case "Imágenes":
93
- updateImages && updateImages();
94
- break;
95
-
96
- default:
97
- break;
98
- }
99
- }
79
+ onClick: onClickSave
100
80
  }), imagesSection && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
101
81
  className: "images-buttons",
102
82
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
103
83
  buttonType: "circular-button delete-button",
104
84
  onClick: function onClick() {
105
- deleteImages && deleteImages();
85
+ askToDeleteImages && askToDeleteImages();
86
+ }
87
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
88
+ buttonType: "circular-button download-button",
89
+ onClick: function onClick() {
90
+ downloadImages();
106
91
  }
107
92
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
108
93
  buttonType: layout ? "grid-layout" : "row-layout",
@@ -20,7 +20,8 @@ var TableHeader = function TableHeader(_ref) {
20
20
  activeImage = _ref.activeImage,
21
21
  assignationsImages = _ref.assignationsImages,
22
22
  setAssignation = _ref.setAssignation,
23
- isRetailer = _ref.isRetailer;
23
+ isRetailer = _ref.isRetailer,
24
+ onClickSave = _ref.onClickSave;
24
25
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
25
26
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
26
27
  text: activeImage === null || activeImage === void 0 ? void 0 : activeImage.name,
@@ -30,7 +31,8 @@ var TableHeader = function TableHeader(_ref) {
30
31
  status: imagesStatus,
31
32
  assignationsImages: assignationsImages,
32
33
  setAssignation: setAssignation,
33
- isRetailer: isRetailer
34
+ isRetailer: isRetailer,
35
+ onClickSave: onClickSave
34
36
  })]
35
37
  });
36
38
  };
@@ -30,7 +30,7 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
30
30
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductNameHeader.ProductNameHeader, {
31
31
  productName: headerData === null || headerData === void 0 ? void 0 : (_headerData$article = headerData.article) === null || _headerData$article === void 0 ? void 0 : _headerData$article.name,
32
32
  statusType: headerData === null || headerData === void 0 ? void 0 : headerData.status,
33
- percent: percent,
33
+ percent: percent === null || percent === void 0 ? void 0 : percent.toFixed(0),
34
34
  priority: headerData === null || headerData === void 0 ? void 0 : headerData.prio,
35
35
  date: new Date(headerData === null || headerData === void 0 ? void 0 : (_headerData$article2 = headerData.article) === null || _headerData$article2 === void 0 ? void 0 : _headerData$article2.timestamp).toLocaleDateString()
36
36
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -26,12 +26,12 @@ var FullTabsMenu = function FullTabsMenu(_ref) {
26
26
  activeTab = _ref.activeTab,
27
27
  setActiveTab = _ref.setActiveTab,
28
28
  setImageLayout = _ref.setImageLayout,
29
- saveDatasheets = _ref.saveDatasheets,
30
- saveDescriptions = _ref.saveDescriptions,
31
- updateImages = _ref.updateImages,
32
29
  assig = _ref.assig,
33
30
  setAssignation = _ref.setAssignation,
34
- isRetailer = _ref.isRetailer;
31
+ isRetailer = _ref.isRetailer,
32
+ downloadImages = _ref.downloadImages,
33
+ askToDeleteImages = _ref.askToDeleteImages,
34
+ onClickSave = _ref.onClickSave;
35
35
 
36
36
  var _useState = (0, _react.useState)(false),
37
37
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -48,12 +48,12 @@ var FullTabsMenu = function FullTabsMenu(_ref) {
48
48
  activeTab: activeTab,
49
49
  setImageLayout: setImageLayout,
50
50
  imagesSection: imagesSection,
51
- saveDatasheets: saveDatasheets,
52
- saveDescriptions: saveDescriptions,
53
- updateImages: updateImages,
54
51
  assignationsImages: assig,
55
52
  setAssignation: setAssignation,
56
- isRetailer: isRetailer
53
+ isRetailer: isRetailer,
54
+ downloadImages: downloadImages,
55
+ onClickSave: onClickSave,
56
+ askToDeleteImages: askToDeleteImages
57
57
  })]
58
58
  });
59
59
  };
@@ -30,7 +30,8 @@ var ImageDataTable = function ImageDataTable(_ref) {
30
30
  assignationsImages = _ref.assignationsImages,
31
31
  imagesStatus = _ref.imagesStatus,
32
32
  setAssignation = _ref.setAssignation,
33
- isRetailer = _ref.isRetailer;
33
+ isRetailer = _ref.isRetailer,
34
+ onClickSave = _ref.onClickSave;
34
35
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
35
36
  darkMode: darkMode,
36
37
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TableHeader.TableHeader, {
@@ -38,7 +39,8 @@ var ImageDataTable = function ImageDataTable(_ref) {
38
39
  activeImage: activeImage,
39
40
  assignationsImages: assignationsImages,
40
41
  setAssignation: setAssignation,
41
- isRetailer: isRetailer
42
+ isRetailer: isRetailer,
43
+ onClickSave: onClickSave
42
44
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles2.Container, {
43
45
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
44
46
  headerType: "table-row-text",
@@ -23,8 +23,6 @@ var _ValidationPanel = require("../../atoms/ValidationPanel");
23
23
 
24
24
  var _GeneralButton = require("../../atoms/GeneralButton");
25
25
 
26
- var _data = require("../../../global-files/data");
27
-
28
26
  var _jsxRuntime = require("react/jsx-runtime");
29
27
 
30
28
  var ProductImageModal = function ProductImageModal(_ref) {
@@ -60,6 +58,7 @@ var ProductImageModal = function ProductImageModal(_ref) {
60
58
  }
61
59
  };
62
60
 
61
+ console.log(images === null || images === void 0 ? void 0 : images.values[activeImage]);
63
62
  (0, _react.useEffect)(function () {
64
63
  if (showValidationPanel) {
65
64
  document.addEventListener("click", closeValidationPanel, false);
@@ -71,7 +70,7 @@ var ProductImageModal = function ProductImageModal(_ref) {
71
70
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
72
71
  className: "modal-image-container",
73
72
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImage.ProductImage, {
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,
73
+ img: "https://" + process.env.REACT_APP_IMAGES_BUCKET + ".s3.amazonaws.com/" + (images === null || images === void 0 ? void 0 : (_images$values$active = images.values[activeImage]) === null || _images$values$active === void 0 ? void 0 : _images$values$active.srcDB),
75
74
  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,
76
75
  imageType: "expanded-modal-image"
77
76
  })
@@ -98,9 +98,9 @@ RetailerProductEditionDefault.args = {
98
98
  company_name: "COMPANY DEV",
99
99
  country: "Colombia",
100
100
  id_order: 101,
101
- id_datasheet_especialist: 54,
101
+ id_datasheet_especialist: 36,
102
102
  id_datasheet_facilitator: 52,
103
- id_description_especialist: 54,
103
+ id_description_especialist: 36,
104
104
  id_description_facilitator: 52,
105
105
  id_images_especialist: 55,
106
106
  id_images_facilitator: 53,
@@ -125,17 +125,7 @@ RetailerProductEditionDefault.args = {
125
125
  active: 1
126
126
  }],
127
127
  country: "Colombia",
128
- modal: false,
129
- modalCadenas: false,
130
- totalCadenas: false,
131
- modalAsig1: false,
132
- modalFD: false,
133
- modalAsig2: false,
134
- modalAsig3: false,
135
- modalAsig4: false,
136
- modalAsig5: false,
137
- modalFI: false,
138
- modalQA: false
128
+ upc: "7491989462"
139
129
  },
140
130
  user: {
141
131
  id_user: 30,
@@ -167,6 +157,6 @@ RetailerProductEditionDefault.args = {
167
157
  products_limit: "3",
168
158
  type: "PyMES"
169
159
  },
170
- src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1647395550234"
160
+ src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1649434410216"
171
161
  }
172
162
  };