contentoh-components-library 21.0.5 → 21.0.6

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 (84) hide show
  1. package/dist/components/atoms/CharCounter/CharCounter.stories.js +31 -0
  2. package/dist/components/atoms/CharCounter/index.js +22 -0
  3. package/dist/components/atoms/CharCounter/styles.js +20 -0
  4. package/dist/components/atoms/GeneralInput/index.js +69 -48
  5. package/dist/components/atoms/GradientPanel/styles.js +2 -2
  6. package/dist/components/atoms/InputFormatter/index.js +128 -66
  7. package/dist/components/atoms/InputFormatter/styles.js +2 -2
  8. package/dist/components/atoms/ProgressBar/styles.js +1 -1
  9. package/dist/components/atoms/Select/index.js +4 -2
  10. package/dist/components/atoms/Select/style.js +1 -1
  11. package/dist/components/atoms/StatusTag/styles.js +1 -1
  12. package/dist/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +37 -0
  13. package/dist/components/molecules/CarouselImagesLogin/index.js +94 -0
  14. package/dist/components/molecules/CarouselImagesLogin/styles.js +21 -0
  15. package/dist/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +28 -0
  16. package/dist/components/molecules/LoginPasswordStrength/index.js +131 -0
  17. package/dist/components/molecules/LoginPasswordStrength/styles.js +78 -0
  18. package/dist/components/molecules/TagAndInput/index.js +4 -2
  19. package/dist/components/organisms/InputGroup/index.js +9 -7
  20. package/dist/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +38 -0
  21. package/dist/components/pages/ChangePasswordLogin/index.js +131 -0
  22. package/dist/components/pages/ChangePasswordLogin/styles.js +18 -0
  23. package/dist/components/pages/EmailResetPassword/EmailResetPassword.stories.js +37 -0
  24. package/dist/components/pages/EmailResetPassword/index.js +130 -0
  25. package/dist/components/pages/EmailResetPassword/styles.js +20 -0
  26. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  27. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  28. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  29. package/dist/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +38 -0
  30. package/dist/components/pages/RegistrationLoginSecondStep/index.js +176 -0
  31. package/dist/components/pages/RegistrationLoginSecondStep/styles.js +20 -0
  32. package/dist/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +37 -0
  33. package/dist/components/pages/RegistrationLoginThirdStep/index.js +178 -0
  34. package/dist/components/pages/RegistrationLoginThirdStep/styles.js +20 -0
  35. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +14 -36
  36. package/dist/components/pages/RetailerProductEdition/index.js +89 -56
  37. package/dist/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +37 -0
  38. package/dist/components/pages/VerificationCodeResetPassword/index.js +121 -0
  39. package/dist/components/pages/VerificationCodeResetPassword/styles.js +20 -0
  40. package/dist/components/pages/VerificationCodeResetPassword/utils.js +69 -0
  41. package/package.json +2 -2
  42. package/src/assets/images/carouselImagesLogin/login2.svg +117 -0
  43. package/src/assets/images/carouselImagesLogin/login3.svg +147 -0
  44. package/src/assets/images/carouselImagesLogin/loginImage.svg +301 -0
  45. package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
  46. package/src/components/atoms/CharCounter/index.js +13 -0
  47. package/src/components/atoms/CharCounter/styles.js +10 -0
  48. package/src/components/atoms/GeneralInput/index.js +58 -49
  49. package/src/components/atoms/GradientPanel/styles.js +7 -1
  50. package/src/components/atoms/InputFormatter/index.js +103 -46
  51. package/src/components/atoms/InputFormatter/styles.js +6 -0
  52. package/src/components/atoms/ProgressBar/styles.js +2 -1
  53. package/src/components/atoms/Select/index.js +3 -1
  54. package/src/components/atoms/Select/style.js +1 -1
  55. package/src/components/atoms/StatusTag/styles.js +2 -1
  56. package/src/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +17 -0
  57. package/src/components/molecules/CarouselImagesLogin/index.js +68 -0
  58. package/src/components/molecules/CarouselImagesLogin/styles.js +60 -0
  59. package/src/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +8 -0
  60. package/src/components/molecules/LoginPasswordStrength/index.js +89 -0
  61. package/src/components/molecules/LoginPasswordStrength/styles.js +87 -0
  62. package/src/components/molecules/TagAndInput/index.js +2 -0
  63. package/src/components/organisms/InputGroup/index.js +12 -3
  64. package/src/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +18 -0
  65. package/src/components/pages/ChangePasswordLogin/index.js +78 -0
  66. package/src/components/pages/ChangePasswordLogin/styles.js +20 -0
  67. package/src/components/pages/EmailResetPassword/EmailResetPassword.stories.js +17 -0
  68. package/src/components/pages/EmailResetPassword/index.js +77 -0
  69. package/src/components/pages/EmailResetPassword/styles.js +27 -0
  70. package/src/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +17 -0
  71. package/src/components/pages/RegistrationLoginFirstStep/index.js +160 -0
  72. package/src/components/pages/RegistrationLoginFirstStep/styles.js +85 -0
  73. package/src/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +18 -0
  74. package/src/components/pages/RegistrationLoginSecondStep/index.js +111 -0
  75. package/src/components/pages/RegistrationLoginSecondStep/styles.js +64 -0
  76. package/src/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +17 -0
  77. package/src/components/pages/RegistrationLoginThirdStep/index.js +106 -0
  78. package/src/components/pages/RegistrationLoginThirdStep/styles.js +48 -0
  79. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +15 -38
  80. package/src/components/pages/RetailerProductEdition/index.js +67 -15
  81. package/src/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +17 -0
  82. package/src/components/pages/VerificationCodeResetPassword/index.js +92 -0
  83. package/src/components/pages/VerificationCodeResetPassword/styles.js +54 -0
  84. package/src/components/pages/VerificationCodeResetPassword/utils.js +56 -0
@@ -264,7 +264,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
264
264
  activePercentage = _useState26[0],
265
265
  setActivePercentage = _useState26[1];
266
266
 
267
- var _useState27 = (0, _react.useState)({}),
267
+ var _useState27 = (0, _react.useState)(productSelected === null || productSelected === void 0 ? void 0 : productSelected.retailers[0]),
268
268
  _useState28 = (0, _slicedToArray2.default)(_useState27, 2),
269
269
  activeRetailer = _useState28[0],
270
270
  setActiveRetailer = _useState28[1];
@@ -309,7 +309,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
309
309
  comment = _useState44[0],
310
310
  setComment = _useState44[1];
311
311
 
312
- var _useState45 = (0, _react.useState)(0),
312
+ var _useState45 = (0, _react.useState)({
313
+ "Ficha técnica": 0,
314
+ Descripción: 0,
315
+ Imágenes: 0
316
+ }),
313
317
  _useState46 = (0, _slicedToArray2.default)(_useState45, 2),
314
318
  requiredNull = _useState46[0],
315
319
  setRequiredNull = _useState46[1];
@@ -371,7 +375,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
371
375
  services = _context2.sent;
372
376
  //Converts the data inside the datasheets object to array
373
377
  setServices(services);
374
- setActiveRetailer(productSelected === null || productSelected === void 0 ? void 0 : productSelected.retailers[0]);
378
+ getRequired(services); //setActiveRetailer(productSelected?.retailers[0]);
379
+
375
380
  setImages({
376
381
  action: "init",
377
382
  init: services[2]
@@ -590,8 +595,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
590
595
  setActivePercentage(productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$reta3 = productSelected.retailers[0]) === null || _productSelected$reta3 === void 0 ? void 0 : _productSelected$reta3.percentage);
591
596
  }, [percentages]);
592
597
  (0, _react.useEffect)(function () {
593
- var required = {};
594
-
595
598
  if (services.length > 0) {
596
599
  var _services$2, _services$3;
597
600
 
@@ -604,7 +607,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
604
607
  return (service === null || service === void 0 ? void 0 : service.id) === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id);
605
608
  });
606
609
 
607
- setRequiredNull(required);
608
610
  setDatasheets([datagroups, inputs]);
609
611
  setDescriptions(_descriptions);
610
612
  }
@@ -616,7 +618,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
616
618
  var imageInputs = images === null || images === void 0 ? void 0 : (_images$inputs = images.inputs) === null || _images$inputs === void 0 ? void 0 : _images$inputs.map(function (e) {
617
619
  return {
618
620
  value: e === null || e === void 0 ? void 0 : e.id,
619
- name: e === null || e === void 0 ? void 0 : e.name
621
+ name: e === null || e === void 0 ? void 0 : e.name,
622
+ required: e === null || e === void 0 ? void 0 : e.required
620
623
  };
621
624
  });
622
625
  var imageType = images === null || images === void 0 ? void 0 : (_images$imageType = images.imageType) === null || _images$imageType === void 0 ? void 0 : _images$imageType.map(function (e) {
@@ -927,7 +930,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
927
930
  }
928
931
 
929
932
  concept = action ? action : concept;
930
- return productSelected["".concat(concept, "_status")] === "QF" && ((user === null || user === void 0 ? void 0 : user.id_role) === 1 || (user === null || user === void 0 ? void 0 : user.id_role) === 4 || (user === null || user === void 0 ? void 0 : user.id_role) === 5) || productSelected["".concat(concept, "_status")] === "AF" && ((user === null || user === void 0 ? void 0 : user.id_role) === 1 || (user === null || user === void 0 ? void 0 : user.id_role) === 6) || productSelected["".concat(concept, "_status")] === "RP" && ((user === null || user === void 0 ? void 0 : user.id_role) === 1 || (user === null || user === void 0 ? void 0 : user.id_role) === 6);
933
+ return productSelected["".concat(concept, "_status")] === "QF" && (user.id_role === 1 || user.id_role === 4 || user.id_role === 5) || productSelected["".concat(concept, "_status")] === "AF" && (user.id_role === 1 || user.id_role === 6) || productSelected["".concat(concept, "_status")] === "RP" && (user.id_role === 1 || user.id_role === 6);
931
934
  };
932
935
 
933
936
  var getSectionIcon = function getSectionIcon() {
@@ -1040,7 +1043,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1040
1043
 
1041
1044
  case 11:
1042
1045
  evalStatus = "";
1043
- productTemp = (0, _objectSpread2.default)({}, productSelected);
1046
+ productTemp = productSelected;
1044
1047
  evalStatus = productSelected["".concat(concept, "_status")];
1045
1048
  specialistDone = evalStatus === "RF" || evalStatus === "RA" || evalStatus === "IN_PROGRESS";
1046
1049
 
@@ -1048,18 +1051,22 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1048
1051
  setMessage("".concat(activeTab, " enviada a facilitador"));
1049
1052
  getSectionIcon();
1050
1053
  productTemp["".concat(concept, "_status")] = "QF";
1054
+ evalStatus = "QF";
1051
1055
  } else if (evalStatus === "QF") {
1052
1056
  setMessage("Evaluación enviada");
1053
1057
  getSectionIcon();
1054
1058
  productTemp["".concat(concept, "_status")] = "AF";
1059
+ evalStatus = "AF";
1055
1060
  } else if (evalStatus === "AF") {
1056
1061
  setMessage("Evaluación enviada");
1057
1062
  getSectionIcon();
1058
1063
  productTemp["".concat(concept, "_status")] = "AA";
1064
+ evalStatus = "AA";
1059
1065
  } else if (evalStatus === "RP") {
1060
1066
  setMessage("Evaluación enviada");
1061
1067
  getSectionIcon();
1062
1068
  productTemp["".concat(concept, "_status")] = "AA";
1069
+ evalStatus = "AA";
1063
1070
  }
1064
1071
 
1065
1072
  data = {};
@@ -1086,7 +1093,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1086
1093
  });
1087
1094
 
1088
1095
  case 22:
1089
- _context10.next = 37;
1096
+ _context10.next = 36;
1090
1097
  break;
1091
1098
 
1092
1099
  case 24:
@@ -1123,10 +1130,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1123
1130
  }
1124
1131
  });
1125
1132
 
1126
- setProduct(productTemp);
1127
- setModalSent(true);
1133
+ setProduct(productTemp); //setModalSent(true);
1128
1134
 
1129
- case 37:
1135
+ case 36:
1130
1136
  case "end":
1131
1137
  return _context10.stop();
1132
1138
  }
@@ -1139,7 +1145,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1139
1145
  };
1140
1146
  }();
1141
1147
 
1142
- var userAssigned = function userAssigned(tab, rol) {
1148
+ var _userAssigned = function userAssigned(tab, rol) {
1143
1149
  var concept = "";
1144
1150
 
1145
1151
  switch (tab) {
@@ -1223,32 +1229,57 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1223
1229
  };
1224
1230
  }();
1225
1231
 
1226
- (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
1227
- return _regenerator.default.wrap(function _callee12$(_context12) {
1228
- while (1) {
1229
- switch (_context12.prev = _context12.next) {
1230
- case 0:
1231
- setComment(comments[activeTab]);
1232
+ var getRequired = function getRequired(services) {
1233
+ var _services$4, _services$4$inputs;
1234
+
1235
+ var objetcTemp = requiredNull;
1236
+ var datasheetServicesArray = Object.values(services[0]);
1237
+ var dsInputs = datasheetServicesArray.pop();
1238
+ var descriptionsServicesArray = services[1];
1239
+ var dsInputsRequired = [];
1240
+ var desInputsRequired = 0;
1241
+ datasheetServicesArray.forEach(function (datasheet) {
1242
+ return Object.values(datasheet === null || datasheet === void 0 ? void 0 : datasheet.data).forEach(function (dataGroup) {
1243
+ return dsInputsRequired.push.apply(dsInputsRequired, (0, _toConsumableArray2.default)(dataGroup.inputs.filter(function (input) {
1244
+ return dsInputs[input].required && !dsInputs[input].value;
1245
+ })));
1246
+ });
1247
+ });
1248
+ objetcTemp["Ficha técnica"] = dsInputsRequired.length;
1249
+ descriptionsServicesArray.forEach(function (description) {
1250
+ return description.inputs.forEach(function (input) {
1251
+ return input.required && (!input.value || input.value.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") === "") && desInputsRequired++;
1252
+ });
1253
+ });
1254
+ objetcTemp["Descripción"] = desInputsRequired;
1255
+ var requiredImages = (_services$4 = services[2]) === null || _services$4 === void 0 ? void 0 : (_services$4$inputs = _services$4.inputs) === null || _services$4$inputs === void 0 ? void 0 : _services$4$inputs.filter(function (e) {
1256
+ return e.required;
1257
+ });
1258
+ var requiredCounter = 0;
1259
+ requiredImages.forEach(function (req) {
1260
+ return services[2].values.filter(function (img) {
1261
+ return img.image_id === req.id;
1262
+ }).length === 0 && requiredCounter++;
1263
+ });
1264
+ objetcTemp["Imágenes"] = requiredCounter;
1265
+ setRequiredNull(objetcTemp);
1266
+ };
1232
1267
 
1233
- case 1:
1234
- case "end":
1235
- return _context12.stop();
1236
- }
1237
- }
1238
- }, _callee12);
1239
- })), [activeTab]);
1268
+ (0, _react.useEffect)(function () {
1269
+ setComment(comments[activeTab]);
1270
+ }, [activeTab]);
1240
1271
 
1241
1272
  var commentRevised = /*#__PURE__*/function () {
1242
- var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
1273
+ var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
1243
1274
  var data;
1244
- return _regenerator.default.wrap(function _callee13$(_context13) {
1275
+ return _regenerator.default.wrap(function _callee12$(_context12) {
1245
1276
  while (1) {
1246
- switch (_context13.prev = _context13.next) {
1277
+ switch (_context12.prev = _context12.next) {
1247
1278
  case 0:
1248
1279
  data = {
1249
1280
  commentId: comment.id
1250
1281
  };
1251
- _context13.next = 3;
1282
+ _context12.next = 3;
1252
1283
  return _axios.default.put("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1253
1284
  headers: {
1254
1285
  Authorization: sessionStorage.getItem("jwt")
@@ -1257,47 +1288,47 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1257
1288
 
1258
1289
  case 3:
1259
1290
  setCrossComment(false);
1260
- _context13.next = 6;
1291
+ _context12.next = 6;
1261
1292
  return getComments();
1262
1293
 
1263
1294
  case 6:
1264
1295
  case "end":
1265
- return _context13.stop();
1296
+ return _context12.stop();
1266
1297
  }
1267
1298
  }
1268
- }, _callee13);
1299
+ }, _callee12);
1269
1300
  }));
1270
1301
 
1271
1302
  return function commentRevised() {
1272
- return _ref14.apply(this, arguments);
1303
+ return _ref13.apply(this, arguments);
1273
1304
  };
1274
1305
  }();
1275
1306
 
1276
1307
  var setAssignation = /*#__PURE__*/function () {
1277
- var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
1308
+ var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(assignationType, assignationId) {
1278
1309
  var _product$article3;
1279
1310
 
1280
1311
  var concept, productTemp, data;
1281
- return _regenerator.default.wrap(function _callee14$(_context14) {
1312
+ return _regenerator.default.wrap(function _callee13$(_context13) {
1282
1313
  while (1) {
1283
- switch (_context14.prev = _context14.next) {
1314
+ switch (_context13.prev = _context13.next) {
1284
1315
  case 0:
1285
1316
  concept = "";
1286
- _context14.t0 = activeTab;
1287
- _context14.next = _context14.t0 === "Ficha técnica" ? 4 : _context14.t0 === "Imágenes" ? 6 : 8;
1317
+ _context13.t0 = activeTab;
1318
+ _context13.next = _context13.t0 === "Ficha técnica" ? 4 : _context13.t0 === "Imágenes" ? 6 : 8;
1288
1319
  break;
1289
1320
 
1290
1321
  case 4:
1291
1322
  concept = "datasheet";
1292
- return _context14.abrupt("break", 10);
1323
+ return _context13.abrupt("break", 10);
1293
1324
 
1294
1325
  case 6:
1295
1326
  concept = "images";
1296
- return _context14.abrupt("break", 10);
1327
+ return _context13.abrupt("break", 10);
1297
1328
 
1298
1329
  case 8:
1299
1330
  concept = "description";
1300
- return _context14.abrupt("break", 10);
1331
+ return _context13.abrupt("break", 10);
1301
1332
 
1302
1333
  case 10:
1303
1334
  productTemp = productSelected;
@@ -1322,14 +1353,14 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1322
1353
 
1323
1354
  case 16:
1324
1355
  case "end":
1325
- return _context14.stop();
1356
+ return _context13.stop();
1326
1357
  }
1327
1358
  }
1328
- }, _callee14);
1359
+ }, _callee13);
1329
1360
  }));
1330
1361
 
1331
1362
  return function setAssignation(_x7, _x8) {
1332
- return _ref15.apply(this, arguments);
1363
+ return _ref14.apply(this, arguments);
1333
1364
  };
1334
1365
  }();
1335
1366
 
@@ -1477,7 +1508,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1477
1508
  approveRejectButtons: approveRejectButtons,
1478
1509
  sendToFacilitator: sendToFacilitator,
1479
1510
  auditorAssigned: auditorAssigned,
1480
- userAssigned: userAssigned(activeTab, "facilitator")
1511
+ userAssigned: function userAssigned() {
1512
+ return _userAssigned(activeTab, "facilitator");
1513
+ }
1481
1514
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
1482
1515
  tabsSections: tabsSections,
1483
1516
  status: {
@@ -1558,7 +1591,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1558
1591
  headerType: "input-name-header"
1559
1592
  }))]
1560
1593
  })
1561
- }), (userAssigned(activeTab, "especialist" || "facilitator") || auditorAssigned()) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1594
+ }), (_userAssigned(activeTab, "especialist" || "facilitator") || auditorAssigned()) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1562
1595
  className: "commentary-box",
1563
1596
  children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1564
1597
  className: "commentary",
@@ -1586,24 +1619,24 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1586
1619
  reviewed: crossComment
1587
1620
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1588
1621
  buttonType: "circular-button accept-button",
1589
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
1590
- return _regenerator.default.wrap(function _callee15$(_context15) {
1622
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
1623
+ return _regenerator.default.wrap(function _callee14$(_context14) {
1591
1624
  while (1) {
1592
- switch (_context15.prev = _context15.next) {
1625
+ switch (_context14.prev = _context14.next) {
1593
1626
  case 0:
1594
1627
  setCrossComment(true);
1595
1628
  commentRevised();
1596
1629
 
1597
1630
  case 2:
1598
1631
  case "end":
1599
- return _context15.stop();
1632
+ return _context14.stop();
1600
1633
  }
1601
1634
  }
1602
- }, _callee15);
1635
+ }, _callee14);
1603
1636
  }))
1604
1637
  })]
1605
1638
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1606
- buttonType: !requiredNull[activeTab] === 0 || !approveRejectButtons() || !evaluationComplete(activeTab) ? "general-button-disabled" : "general-green-button",
1639
+ buttonType: !approveRejectButtons() || requiredNull[activeTab] !== 0 || !evaluationComplete(activeTab) ? "general-button-disabled" : "general-green-button",
1607
1640
  label: "Enviar evaluación",
1608
1641
  onClick: function onClick() {
1609
1642
  return sendToFacilitator();
@@ -1621,11 +1654,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1621
1654
  componentsArray: componentsArray.length > 0 ? componentsArray : [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
1622
1655
  src: _genericModalCheck.default,
1623
1656
  alt: "success icon"
1624
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1657
+ }, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1625
1658
  headerType: "retailer-name-header",
1626
1659
  text: message,
1627
1660
  color: "white"
1628
- }, "1")],
1661
+ }, "2")],
1629
1662
  onClick: function onClick() {
1630
1663
  return setMessage("");
1631
1664
  }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = exports.VerificationCodeResetPasswordDefault = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
+
12
+ var _index = require("./index");
13
+
14
+ var _loginImage = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/loginImage.svg"));
15
+
16
+ var _login = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login2.svg"));
17
+
18
+ var _login2 = _interopRequireDefault(require("../../../assets/images/carouselImagesLogin/login3.svg"));
19
+
20
+ var _jsxRuntime = require("react/jsx-runtime");
21
+
22
+ var _default = {
23
+ title: "Components/pages/VerificationCodeResetPassword",
24
+ component: _index.VerificationCodeResetPassword
25
+ };
26
+ exports.default = _default;
27
+
28
+ var Template = function Template(args) {
29
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.VerificationCodeResetPassword, (0, _objectSpread2.default)({}, args));
30
+ };
31
+
32
+ var VerificationCodeResetPasswordDefault = Template.bind({});
33
+ exports.VerificationCodeResetPasswordDefault = VerificationCodeResetPasswordDefault;
34
+ VerificationCodeResetPasswordDefault.args = {
35
+ imageArrayCarousel: [_loginImage.default, _login.default, _login2.default],
36
+ textCarousel: "Elige la plataforma que conecta proovedores y retailers"
37
+ };
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.VerificationCodeResetPassword = void 0;
9
+
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
+
12
+ var _styles = require("./styles");
13
+
14
+ var _GradientPanel = require("../../atoms/GradientPanel");
15
+
16
+ var _CarouselImagesLogin = require("../../molecules/CarouselImagesLogin");
17
+
18
+ var _react = require("react");
19
+
20
+ var _LogoImage = require("../../atoms/LogoImage");
21
+
22
+ var _ScreenHeader = require("../../atoms/ScreenHeader");
23
+
24
+ var _variables = require("../../../global-files/variables");
25
+
26
+ var _GeneralInput = require("../../atoms/GeneralInput");
27
+
28
+ var _GeneralButton = require("../../atoms/GeneralButton");
29
+
30
+ var _utils = require("./utils");
31
+
32
+ var _jsxRuntime = require("react/jsx-runtime");
33
+
34
+ var VerificationCodeResetPassword = function VerificationCodeResetPassword(_ref) {
35
+ var _ref$imageArrayCarous = _ref.imageArrayCarousel,
36
+ imageArrayCarousel = _ref$imageArrayCarous === void 0 ? [] : _ref$imageArrayCarous,
37
+ textCarousel = _ref.textCarousel,
38
+ backogroundColorCarousel = _ref.backogroundColorCarousel;
39
+
40
+ var _useState = (0, _react.useState)(false),
41
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
42
+ emptyVerificationCode = _useState2[0],
43
+ setEmptyVerificationCode = _useState2[1];
44
+
45
+ var _useState3 = (0, _react.useState)(),
46
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
47
+ inputCodeVerificationAll = _useState4[0],
48
+ setInputCodeVerificationAll = _useState4[1];
49
+
50
+ var inputPositions = [1, 2, 3, 4, 5, 6];
51
+ (0, _react.useEffect)(function () {
52
+ setInputCodeVerificationAll(document.querySelectorAll("[id^='verificationCodeInput']"));
53
+ }, []);
54
+ var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
55
+ className: "credenciales",
56
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
57
+ fontFamily: _variables.FontFamily.AvenirNext,
58
+ color: _variables.GlobalColors.s5,
59
+ text: "Ingresa tus credenciales"
60
+ })
61
+ }, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
62
+ className: "user",
63
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
64
+ text: "Ingresa el código de verificación enviado a:",
65
+ headerType: "input-name-header"
66
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
67
+ className: "verification-code",
68
+ children: inputPositions.map(function (position) {
69
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralInput.GeneralInput, {
70
+ inputId: "verificationCodeInput".concat(position),
71
+ inputType: "text",
72
+ inputPlaceholder: "X",
73
+ validateInput: _utils.validateInput,
74
+ inputsArray: inputCodeVerificationAll,
75
+ position: position,
76
+ maxLength: "1"
77
+ });
78
+ })
79
+ }), emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
80
+ children: "Ingrese su c\xF3digo de verificaci\xF3n"
81
+ })]
82
+ }, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
83
+ className: "resend-code",
84
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
85
+ children: "Reenviar c\xF3digo de verificaci\xF3n"
86
+ })
87
+ }, "4"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
88
+ className: "button-center",
89
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
90
+ buttonType: "general-default-button",
91
+ label: "Enviar",
92
+ onClick: function onClick(e) {
93
+ return (0, _utils.validate)(inputCodeVerificationAll, setEmptyVerificationCode);
94
+ }
95
+ })
96
+ }, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
97
+ className: "reset-password",
98
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
99
+ children: "Regresar..."
100
+ })
101
+ }, "6")];
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
103
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
104
+ className: "home-retailer",
105
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselImagesLogin.CarouselImagesLogin, {
106
+ panelImg: imageArrayCarousel,
107
+ panelText: textCarousel,
108
+ panelColor: backogroundColorCarousel
109
+ })
110
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
111
+ className: "home-login-retailer",
112
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
113
+ componentsArray: loginRight,
114
+ panelType: "home-login",
115
+ panelColor: _variables.GlobalColors.white
116
+ })
117
+ })]
118
+ });
119
+ };
120
+
121
+ exports.VerificationCodeResetPassword = VerificationCodeResetPassword;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Container = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
11
+
12
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
+
14
+ var _variables = require("../../../global-files/variables");
15
+
16
+ var _templateObject;
17
+
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 100%;\n height: 100vh;\n .button-center {\n text-align: center;\n .general-default-button {\n width: 160px;\n }\n }\n .reset-password {\n text-align: center;\n margin: 15px !important;\n color: ", ";\n cursor: pointer;\n font-weight: bold;\n font-family: ", ";\n font-size: 13px;\n }\n .resend-code {\n margin-top: 8px !important;\n color: ", ";\n font-family: ", ";\n font-size: 11px;\n text-decoration: underline rgb(228, 81, 172);\n cursor: pointer;\n & + * {\n margin-top: 30px;\n }\n }\n .verification-code {\n display: flex;\n text-align: center;\n margin: auto;\n margin-top: 10px;\n input[type=\"number\"]::-webkit-inner-spin-button,\n input[type=\"number\"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n input {\n \n width: 70%;\n text-align: center;\n }\n }\n .home-login-retailer,\n .home-retailer {\n width: 50%;\n }\n"])), _variables.GlobalColors.secondary_magenta, _variables.FontFamily.Raleway, _variables.GlobalColors.magenta_s2, _variables.FontFamily.AvenirNext);
19
+
20
+ exports.Container = Container;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateInput = exports.validate = void 0;
7
+
8
+ /**
9
+ *
10
+ * @param {event} e event received triggered by verification code input
11
+ * @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
12
+ * @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
13
+ */
14
+ var validateInput = function validateInput(e, index, inputsArray) {
15
+ var isValid = false;
16
+ var inputNotEmpty = e.target.value.length > 0;
17
+
18
+ if (inputNotEmpty) {
19
+ if (validateInputNumber(e) !== null) {
20
+ isValid = true;
21
+ nextInputFocus(inputsArray, index++);
22
+ }
23
+ }
24
+
25
+ return isValid ? e.target.value : "";
26
+ };
27
+ /**
28
+ *
29
+ * @param {event} e event received triggered by verification code input
30
+ * @returns {boolean} if digit is a number
31
+ */
32
+
33
+
34
+ exports.validateInput = validateInput;
35
+
36
+ var validateInputNumber = function validateInputNumber(e) {
37
+ return (e.target.value || String.fromCharCode(e.keyCode)).match(/[0-9]{1}/);
38
+ };
39
+ /**
40
+ *
41
+ * @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
42
+ * @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
43
+ * changes focus to next input if digit typed is a number and there wasn't any before
44
+ */
45
+
46
+
47
+ var nextInputFocus = function nextInputFocus(inputsArray, index) {
48
+ var _inputsArray$index;
49
+
50
+ var button = document.getElementsByClassName("general-default-button");
51
+ inputsArray !== null && inputsArray !== void 0 && inputsArray.length && index === (inputsArray === null || inputsArray === void 0 ? void 0 : inputsArray.length) ? button[0].focus() : (_inputsArray$index = inputsArray[index]) === null || _inputsArray$index === void 0 ? void 0 : _inputsArray$index.focus();
52
+ };
53
+ /**
54
+ *
55
+ * @param {array<html nodes>} inputsArray array which contains every VC digit input (used to check if there's any empty)
56
+ * @param {function} setEmptyVerificationCode function to update flag which handles if there's an empty char
57
+ * updates emptyVerificationFlag from father component
58
+ */
59
+
60
+
61
+ var validate = function validate(inputsArray, setEmptyVerificationCode) {
62
+ var contInputEmpty = 0;
63
+ inputsArray.forEach(function (element) {
64
+ element.value === "" ? 0 : contInputEmpty++;
65
+ });
66
+ contInputEmpty === inputsArray.length ? setEmptyVerificationCode(false) : setEmptyVerificationCode(true);
67
+ };
68
+
69
+ exports.validate = validate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.0.5",
3
+ "version": "21.0.6",
4
4
  "dependencies": {
5
5
  "@babel/runtime": "^7.17.2",
6
6
  "@storybook/addon-postcss": "^2.0.0",
@@ -27,7 +27,7 @@
27
27
  "web-vitals": "^1.0.1"
28
28
  },
29
29
  "scripts": {
30
- "start": "start-storybook -p 6006",
30
+ "start": "start-storybook -p 6006",
31
31
  "build": "cross-env BABEL_ENV=production babel src -d dist",
32
32
  "chromatic": "npx chromatic --project-token=d7bb0c8ba831"
33
33
  },