contentoh-components-library 21.0.40 → 21.0.41

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 (26) hide show
  1. package/dist/components/atoms/GeneralInput/index.js +2 -6
  2. package/dist/components/atoms/Loading/styles.js +1 -1
  3. package/dist/components/molecules/LoginPasswordStrength/index.js +2 -8
  4. package/dist/components/molecules/RegistrationFirstStep/index.js +28 -21
  5. package/dist/components/molecules/RegistrationFirstStep/styles.js +1 -1
  6. package/dist/components/molecules/RegistrationSecondStep/index.js +42 -110
  7. package/dist/components/molecules/RegistrationThirdStep/index.js +19 -33
  8. package/dist/components/molecules/TagAndInput/index.js +2 -6
  9. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +18 -17
  10. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +2 -2
  11. package/dist/components/organisms/ChangePassword/index.js +13 -3
  12. package/dist/components/organisms/ChangePassword/styles.js +1 -1
  13. package/package.json +2 -2
  14. package/src/components/atoms/GeneralInput/index.js +0 -4
  15. package/src/components/atoms/Loading/styles.js +2 -2
  16. package/src/components/molecules/EmailResetPasswordLogin/index.js +0 -1
  17. package/src/components/molecules/LoginPasswordStrength/index.js +0 -5
  18. package/src/components/molecules/RegistrationFirstStep/index.js +38 -32
  19. package/src/components/molecules/RegistrationFirstStep/styles.js +3 -3
  20. package/src/components/molecules/RegistrationSecondStep/index.js +51 -86
  21. package/src/components/molecules/RegistrationThirdStep/index.js +14 -1
  22. package/src/components/molecules/TagAndInput/index.js +0 -4
  23. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +17 -15
  24. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +2 -4
  25. package/src/components/organisms/ChangePassword/index.js +16 -3
  26. package/src/components/organisms/ChangePassword/styles.js +2 -2
@@ -28,9 +28,7 @@ var GeneralInput = function GeneralInput(_ref) {
28
28
  inputsArray = _ref.inputsArray,
29
29
  maxLength = _ref.maxLength,
30
30
  inputSize = _ref.inputSize,
31
- onChange = _ref.onChange,
32
- required = _ref.required,
33
- defaultValue = _ref.defaultValue;
31
+ required = _ref.required;
34
32
 
35
33
  var _useState = (0, _react.useState)({
36
34
  value: inputValue !== null && inputValue !== void 0 ? inputValue : ""
@@ -67,9 +65,7 @@ var GeneralInput = function GeneralInput(_ref) {
67
65
  return onHandleChange(e);
68
66
  },
69
67
  maxLength: maxLength && maxLength,
70
- onChange: onChange,
71
- required: required,
72
- defaultValue: defaultValue
68
+ required: required
73
69
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
74
70
  name: inputName,
75
71
  id: inputId,
@@ -13,6 +13,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
14
  var _templateObject;
15
15
 
16
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n justify-content: center;\n align-items: center;\n height: 100vh;\n width: 50%;\n position: relative;\n img {\n width: 80%;\n position: absolute;\n bottom: 55%;\n left: 10%;\n }\n .loader {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 10%;\n width: 50%;\n position: absolute;\n bottom: 45%;\n left:25%;\n span {\n display: inline-block;\n border-radius: 100%;\n margin-left: 5px;\n opacity: 1;\n }\n .first {\n background-color: #ff75cf;\n }\n .second {\n background-color: #e33aa9;\n }\n .third {\n background-color: #b12d84;\n }\n span:nth-child(1) {\n width: 16px;\n height: 16px;\n animation: opacitychange 1s ease-in-out infinite;\n }\n span:nth-child(2) {\n width: 18px;\n height: 18px;\n\n animation: opacitychange 1s ease-in-out 0.33s infinite;\n }\n span:nth-child(3) {\n width: 20px;\n height: 20px;\n\n animation: opacitychange 1s ease-in-out 0.66s infinite;\n }\n @keyframes opacitychange {\n 0%,\n 100% {\n opacity: 0;\n }\n 60% {\n opacity: 1;\n }\n }\n }\n"])));
16
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n justify-content: center;\n align-items: center;\n height: 100vh;\n width: 50%;\n position: relative;\n img {\n width: 70%;\n position: absolute;\n bottom: 55%;\n left: 10%;\n }\n .loader {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 10%;\n width: 50%;\n position: absolute;\n bottom: 45%;\n left:15%;\n span {\n display: inline-block;\n border-radius: 100%;\n margin-left: 5px;\n opacity: 1;\n }\n .first {\n background-color: #ff75cf;\n }\n .second {\n background-color: #e33aa9;\n }\n .third {\n background-color: #b12d84;\n }\n span:nth-child(1) {\n width: 16px;\n height: 16px;\n animation: opacitychange 1s ease-in-out infinite;\n }\n span:nth-child(2) {\n width: 18px;\n height: 18px;\n\n animation: opacitychange 1s ease-in-out 0.33s infinite;\n }\n span:nth-child(3) {\n width: 20px;\n height: 20px;\n\n animation: opacitychange 1s ease-in-out 0.66s infinite;\n }\n @keyframes opacitychange {\n 0%,\n 100% {\n opacity: 0;\n }\n 60% {\n opacity: 1;\n }\n }\n }\n"])));
17
17
 
18
18
  exports.Container = Container;
@@ -21,7 +21,6 @@ var LoginPasswordStrength = function LoginPasswordStrength(_ref) {
21
21
  var emptyPassword = _ref.emptyPassword,
22
22
  emptyConfirmPassword = _ref.emptyConfirmPassword,
23
23
  matchPasswords = _ref.matchPasswords,
24
- onChange = _ref.onChange,
25
24
  required = _ref.required;
26
25
 
27
26
  var _useState = (0, _react.useState)(0),
@@ -62,9 +61,6 @@ var LoginPasswordStrength = function LoginPasswordStrength(_ref) {
62
61
  });
63
62
  break;
64
63
 
65
- case "confirmPasswordInput":
66
- break;
67
-
68
64
  default:
69
65
  return;
70
66
  }
@@ -77,8 +73,7 @@ var LoginPasswordStrength = function LoginPasswordStrength(_ref) {
77
73
  inputType: "password",
78
74
  inputId: "newPasswordInput",
79
75
  label: "Ingrese su nueva contraseña",
80
- required: required,
81
- onChange: onChange
76
+ required: required
82
77
  }), emptyPassword && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
83
78
  children: "La contrase\xF1a debe ser minimo de 8 caracteres"
84
79
  })]
@@ -123,8 +118,7 @@ var LoginPasswordStrength = function LoginPasswordStrength(_ref) {
123
118
  inputType: "password",
124
119
  inputId: "confirmPasswordInput",
125
120
  label: "Confirme la nueva contraseña",
126
- required: required,
127
- onChange: onChange
121
+ required: required
128
122
  }), emptyConfirmPassword && !emptyPassword && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
129
123
  children: "Confirme la contrase\xF1a"
130
124
  }), !emptyConfirmPassword && !emptyPassword && !matchPasswords && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
@@ -91,7 +91,7 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
91
91
  sessionStorage.getItem("resetPasswordProcess") && sessionStorage.getItem("resetPasswordProcess");
92
92
  }, []);
93
93
 
94
- var validateForm = function validateForm(evt) {
94
+ var validate = function validate(evt) {
95
95
  var valid = true;
96
96
  evt.preventDefault();
97
97
  var name = document.querySelector("#nameInput").value;
@@ -100,21 +100,31 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
100
100
  var job = document.querySelector("#jobInput").value;
101
101
  var phone = document.querySelector("#phoneInput").value;
102
102
  var country = document.querySelector("#countrySelect").value;
103
- var countryCode = document.querySelector("#countryCodeSelect").value;
104
103
  name === "" ? setEmptyName(true) : setEmptyName(false);
105
104
  lastName === "" ? setEmptyLastName(true) : setEmptyLastName(false);
106
105
  email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
107
106
  job === "" ? setEmptyJob(true) : setEmptyJob(false);
108
107
  phone === "" ? setEmptyPhone(true) : setEmptyPhone(false);
109
108
  !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
110
- country === "" || country === "+ tu país" ? setEmptyCountry(true) : setEmptyCountry(false);
109
+ var invalidPhone = true;
110
+ country === "value" ? setEmptyCountry(true) : setEmptyCountry(false);
111
111
  Array.from(phone).forEach(function (digit, i) {
112
- phone.charCodeAt(i) < 48 ? setPhoneFormatError(true) : setPhoneFormatError(false);
113
- phone.charCodeAt(i) > 57 ? setPhoneFormatError(true) : setPhoneFormatError(false);
112
+ phone.charCodeAt(i) < 48 ? setPhoneFormatError(true) : invalidPhone = false;
113
+ phone.charCodeAt(i) > 57 ? setPhoneFormatError(true) : invalidPhone = false;
114
114
  });
115
+
116
+ if (name === "" || lastName === "" || email === "" || job === "" || phone === "" || country === "value" || !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) || invalidPhone) {
117
+ valid = false;
118
+ } else valid = true;
119
+
120
+ return valid;
121
+ };
122
+
123
+ var validateForm = function validateForm(evt, valid) {
124
+ evt.preventDefault();
115
125
  var nuevoUsuario = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
116
126
 
117
- if (!emptyName || !emptyLastName || !emptyEmail || !emptyJob || !emptyPhone || !emptyCountry || !invalidEmail || !phoneFormatError) {
127
+ if (valid) {
118
128
  sessionStorage.setItem("countryCode", JSON.stringify(countryCode));
119
129
  nuevoUsuario.name = name;
120
130
  nuevoUsuario.lastName = lastName;
@@ -127,10 +137,6 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
127
137
  return props.paso + 1;
128
138
  });
129
139
  regError && valid && props.setPaso(4);
130
- console.log("rediring");
131
- } else {
132
- valid = false;
133
- console.log("code");
134
140
  }
135
141
  };
136
142
 
@@ -230,35 +236,35 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
230
236
  className: "country-options",
231
237
  id: "countrySelect",
232
238
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
233
- value: "value1",
239
+ value: "value",
234
240
  selected: true,
235
241
  children: "Selecciona tu pa\xEDs"
236
242
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
237
- value: "value2",
243
+ value: "Argentina",
238
244
  children: "Argentina"
239
245
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
240
- value: "value3",
246
+ value: "Colombia",
241
247
  children: "Colombia"
242
248
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
243
- value: "value2",
249
+ value: "Ecuador",
244
250
  children: "Ecuador"
245
251
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
246
- value: "value3",
252
+ value: "El Salvador",
247
253
  children: "El Salvador"
248
254
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
249
- value: "value2",
255
+ value: "Honduras",
250
256
  children: "Honduras"
251
257
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
252
- value: "value3",
258
+ value: "M\xE9xico",
253
259
  children: "M\xE9xico"
254
260
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
255
- value: "value2",
261
+ value: "Panam\xE1",
256
262
  children: "Panam\xE1"
257
263
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
258
- value: "value3",
264
+ value: "Per\xFA",
259
265
  children: "Per\xFA"
260
266
  })]
261
- }), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
267
+ }), emptyCountry && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
262
268
  children: "Seleccione su pa\xEDs"
263
269
  })]
264
270
  }, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -267,7 +273,8 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
267
273
  buttonType: "general-default-button",
268
274
  label: "Enviar",
269
275
  onClick: function onClick(e) {
270
- return validateForm(e);
276
+ var flag = validate(e);
277
+ validateForm(e, flag);
271
278
  }
272
279
  })
273
280
  }, "4"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -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 display: flex;\n width: 50%;\n height: 100vh;\n .user {\n .name-registration-user {\n display: flex;\n justify-content: space-between;\n input {\n width: 160px;\n }\n }\n .input-name-header {\n margin-bottom: 4px;\n margin-top: 12px;\n }\n .phone-registration-user {\n display: flex;\n justify-content: space-between;\n .phone-options {\n width: 80px;\n }\n input {\n width: 100%;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .country-options,\n .phone-options {\n width: 100%;\n border: 1px solid ", ";\n font-family: ", ";\n color: ", ";\n font-weight: normal;\n font-size: 12px;\n line-height: 15px;\n padding: 10px;\n outline: none;\n border-radius: 2px;\n resize: none;\n &:focus {\n border: 1px solid ", ";\n }\n }\n }\n .button-end {\n text-align: end;\n .general-default-button {\n width: 160px;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .progress-bar {\n width: 100%;\n height: 8px;\n display: flex;\n justify-content: space-between;\n .progress-bar-first-step {\n width: 33.33%;\n background-color: rgb(196, 196, 196);\n }\n .progress-bar-registration {\n background-color: rgb(226, 226, 226);\n width: 66.66%;\n }\n }\n .date-header {\n .new-login {\n & + * {\n margin-top: 20px;\n p {\n cursor: pointer;\n }\n }\n }\n }\n"])), _variables.GlobalColors.s2, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.GlobalColors.magenta_s2);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 50%;\n height: 100vh;\n .user {\n .name-registration-user {\n display: flex;\n justify-content: space-between;\n input {\n width: 160px;\n }\n }\n .input-name-header {\n margin-bottom: 4px;\n margin-top: 12px;\n }\n .phone-registration-user {\n display: flex;\n justify-content: space-between;\n .phone-options {\n width: 80px;\n }\n input {\n width: 100%;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .country-options,\n .phone-options {\n width: 100%;\n border: 1px solid ", ";\n font-family: ", ";\n color: ", ";\n font-weight: normal;\n font-size: 12px;\n line-height: 15px;\n padding: 10px;\n outline: none;\n border-radius: 2px;\n resize: none;\n &:focus {\n border: 1px solid ", ";\n }\n }\n }\n .button-end {\n text-align: end;\n .general-default-button {\n width: 160px;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .progress-bar {\n width: 100%;\n height: 8px;\n display: flex;\n justify-content: space-between;\n .progress-bar-first-step {\n width: 33.33%;\n background-color: rgb(196, 196, 196);\n }\n .progress-bar-registration {\n background-color: rgb(226, 226, 226);\n width: 66.66%;\n }\n }\n .date-header {\n .new-login {\n & + * {\n margin-top: 20px;\n }\n }\n }\n .pre-registro {\n cursor: pointer;\n }\n"])), _variables.GlobalColors.s2, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.GlobalColors.magenta_s2);
19
19
 
20
20
  exports.Container = Container;
@@ -28,134 +28,60 @@ var _LogoImage = require("../../atoms/LogoImage");
28
28
  var _jsxRuntime = require("react/jsx-runtime");
29
29
 
30
30
  var RegistrationSecondStep = function RegistrationSecondStep(props) {
31
- var _useState = (0, _react.useState)(0),
31
+ var _useState = (0, _react.useState)(false),
32
32
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
33
- passwordStrength = _useState2[0],
34
- setPasswordStrenght = _useState2[1];
33
+ privacyCheck = _useState2[0],
34
+ setPrivacyCheck = _useState2[1];
35
35
 
36
- var _useState3 = (0, _react.useState)(""),
36
+ var _useState3 = (0, _react.useState)(false),
37
37
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
38
- passwordFinal = _useState4[0],
39
- setPasswordFinal = _useState4[1];
38
+ termsCheck = _useState4[0],
39
+ setTermsCheck = _useState4[1];
40
40
 
41
- var _useState5 = (0, _react.useState)(""),
41
+ var _useState5 = (0, _react.useState)(false),
42
42
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
43
- repeatedPassword = _useState6[0],
44
- setRepeatedPassword = _useState6[1];
43
+ emptyPassword = _useState6[0],
44
+ setEmptyPassword = _useState6[1];
45
45
 
46
46
  var _useState7 = (0, _react.useState)(false),
47
47
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
48
- passwordMatches = _useState8[0],
49
- setPasswordMatches = _useState8[1];
48
+ emptyConfirmPassword = _useState8[0],
49
+ setEmptyConfirmPassword = _useState8[1];
50
50
 
51
51
  var _useState9 = (0, _react.useState)(true),
52
52
  _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
53
- passwordToShort = _useState10[0],
54
- setPasswordToShort = _useState10[1];
55
-
56
- var _useState11 = (0, _react.useState)(false),
57
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
58
- showErrors = _useState12[0],
59
- setShowErrors = _useState12[1];
60
-
61
- var _useState13 = (0, _react.useState)(false),
62
- _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
63
- privacyCheck = _useState14[0],
64
- setPrivacyCheck = _useState14[1];
65
-
66
- var _useState15 = (0, _react.useState)(false),
67
- _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
68
- termsCheck = _useState16[0],
69
- setTermsCheck = _useState16[1];
70
-
71
- var _useState17 = (0, _react.useState)(false),
72
- _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
73
- emptyPassword = _useState18[0],
74
- setEmptyPassword = _useState18[1];
75
-
76
- var _useState19 = (0, _react.useState)(false),
77
- _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
78
- emptyConfirmPassword = _useState20[0],
79
- setEmptyConfirmPassword = _useState20[1];
80
-
81
- var _useState21 = (0, _react.useState)(true),
82
- _useState22 = (0, _slicedToArray2.default)(_useState21, 2),
83
- matchPasswords = _useState22[0],
84
- setMatchPasswords = _useState22[1];
53
+ matchPasswords = _useState10[0],
54
+ setMatchPasswords = _useState10[1];
85
55
 
86
56
  var nuevoUsuario = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
87
- var upperCaseLetters = /[A-Z]/g;
88
- var numbers = /[0-9]/g;
89
- var specialChar = /['!','@','#','$','%','^','&','*']/g; // on passwordFinal update
90
57
 
91
- (0, _react.useEffect)(function () {
92
- passwordFinal === repeatedPassword ? setPasswordMatches(true) : setPasswordMatches(false);
93
- passwordFinal.length < 8 ? setPasswordToShort(true) : setPasswordToShort(false);
94
- }, [passwordFinal, repeatedPassword]); // on repeatedPassword update
58
+ var validateForm = function validateForm(evt, valid) {
59
+ evt.preventDefault();
60
+ var password = document.querySelector("#newPasswordInput").value;
95
61
 
96
- (0, _react.useEffect)(function () {
97
- passwordFinal === repeatedPassword ? setPasswordMatches(true) : setPasswordMatches(false);
98
- repeatedPassword === "" ? setEmptyConfirmPassword(true) : setEmptyConfirmPassword(false);
99
- }, [passwordFinal, repeatedPassword]);
62
+ if (valid) {
63
+ !termsCheck && (valid = false);
64
+ !privacyCheck && (valid = false);
65
+ nuevoUsuario.password = password;
66
+ sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoUsuario));
67
+ valid && props.setPaso(3);
68
+ }
69
+ };
100
70
 
101
- var updateInfo = function updateInfo(e, newValue) {
71
+ var validate = function validate(e) {
102
72
  e.preventDefault();
73
+ var valid = true;
103
74
  var password = document.querySelector("#newPasswordInput").value;
104
75
  password.length < 8 ? setEmptyPassword(true) : setEmptyPassword(false);
105
76
  var confirmPassword = document.querySelector("#confirmPasswordInput").value;
106
77
  confirmPassword === "" ? setEmptyConfirmPassword(true) : setEmptyConfirmPassword(false);
78
+ password === confirmPassword ? setMatchPasswords(true) : setMatchPasswords(false);
107
79
 
108
- if (password === confirmPassword) {
109
- setMatchPasswords(true);
110
- } else {
111
- setMatchPasswords(false);
112
- }
113
-
114
- switch (e.target.id) {
115
- case "passwordInput":
116
- setPasswordStrenght(0);
117
-
118
- if (newValue.length > 8) {
119
- setPasswordStrenght(function (passwordStrenght) {
120
- return passwordStrenght + 1;
121
- });
122
- } //Verificar si la contraseña contiene mayuscula, numeros y un caracter especial
123
-
124
-
125
- newValue.match(upperCaseLetters) && setPasswordStrenght(function (passwordStrenght) {
126
- return passwordStrenght + 1;
127
- });
128
- newValue.match(numbers) && setPasswordStrenght(function (passwordStrenght) {
129
- return passwordStrenght + 1;
130
- });
131
- newValue.match(specialChar) && setPasswordStrenght(function (passwordStrenght) {
132
- return passwordStrenght + 1;
133
- }); //Actualizar value de la contraseña y guardar en sessionStorage
134
-
135
- setPasswordFinal(newValue);
136
- nuevoUsuario.password = newValue;
137
- sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoUsuario));
138
- break;
139
-
140
- case "confirmPasswordInput":
141
- setRepeatedPassword(newValue);
142
- break;
143
-
144
- default:
145
- return;
80
+ if (password.length < 8 || confirmPassword === "" || password !== confirmPassword) {
81
+ valid = false;
146
82
  }
147
- };
148
83
 
149
- var validateForm = function validateForm(evt) {
150
- evt.preventDefault();
151
- setShowErrors(true);
152
- var valid = true;
153
- passwordToShort && (valid = false);
154
- emptyConfirmPassword && (valid = false);
155
- !passwordMatches && (valid = false);
156
- !termsCheck && (valid = false);
157
- !privacyCheck && (valid = false);
158
- valid && props.setPaso(3);
84
+ return valid;
159
85
  };
160
86
 
161
87
  var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -170,9 +96,6 @@ var RegistrationSecondStep = function RegistrationSecondStep(props) {
170
96
  emptyConfirmPassword: emptyConfirmPassword,
171
97
  matchPasswords: matchPasswords,
172
98
  textTittle: "Ingresa tus credenciales",
173
- onChange: function onChange(e) {
174
- return updateInfo(e, e.target.value);
175
- },
176
99
  required: "required"
177
100
  }, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
178
101
  className: "label-terms",
@@ -180,7 +103,10 @@ var RegistrationSecondStep = function RegistrationSecondStep(props) {
180
103
  }, "4"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
181
104
  className: "checkbox-terms",
182
105
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
183
- type: "checkbox"
106
+ type: "checkbox",
107
+ onClick: function onClick(e) {
108
+ return setTermsCheck(e.target.checked);
109
+ }
184
110
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
185
111
  text: "Conoce nuestros termnios y condiciones de cada uno de nuestros servicios. Si tienes algunda duda o comentario escríbenos.",
186
112
  headerType: "date-header"
@@ -191,10 +117,15 @@ var RegistrationSecondStep = function RegistrationSecondStep(props) {
191
117
  }, "6"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
192
118
  className: "checkbox-terms",
193
119
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
194
- type: "checkbox"
120
+ type: "checkbox",
121
+ onClick: function onClick(e) {
122
+ return setPrivacyCheck(e.target.checked);
123
+ }
195
124
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
196
125
  text: "Todos los datos estan protegidos.",
197
126
  headerType: "date-header"
127
+ }), !termsCheck && !!privacyCheck && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
128
+ children: "Seleccione los terminos y condiciones y el Aviso de privacidad"
198
129
  })]
199
130
  }, "7"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
200
131
  className: "button-end",
@@ -202,7 +133,8 @@ var RegistrationSecondStep = function RegistrationSecondStep(props) {
202
133
  buttonType: "general-default-button",
203
134
  label: "Enviar",
204
135
  onClick: function onClick(e) {
205
- return validate(e);
136
+ var flag = validate(e);
137
+ validateForm(e, flag);
206
138
  }
207
139
  })
208
140
  }, "8"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -7,10 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.RegistrationThirdStep = void 0;
9
9
 
10
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
-
12
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
13
-
14
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
15
11
 
16
12
  var _styles = require("./styles");
@@ -52,35 +48,25 @@ var RegistrationThirdStep = function RegistrationThirdStep() {
52
48
  emptyFiscalAddress = _useState8[0],
53
49
  setEmptyFiscalAddress = _useState8[1];
54
50
 
55
- var validate = /*#__PURE__*/function () {
56
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
57
- var commercialName, bussinesName, RFC, FiscalAddress;
58
- return _regenerator.default.wrap(function _callee$(_context) {
59
- while (1) {
60
- switch (_context.prev = _context.next) {
61
- case 0:
62
- e.preventDefault();
63
- commercialName = document.querySelector("#commercialNameInput").value;
64
- bussinesName = document.querySelector("#bussinesNameInput").value;
65
- RFC = document.querySelector("#rfcInput").value;
66
- FiscalAddress = document.querySelector("#fiscalAddressInput").value;
67
- commercialName === "" ? setEmptyCommercialName(true) : setEmptyCommercialName(false);
68
- bussinesName === "" ? setEmptyBussinesName(true) : setEmptyBussinesName(false);
69
- RFC === "" ? setEmptyRFC(true) : setEmptyRFC(false);
70
- FiscalAddress === "" ? setEmptyFiscalAddress(true) : setEmptyFiscalAddress(false);
71
-
72
- case 9:
73
- case "end":
74
- return _context.stop();
75
- }
76
- }
77
- }, _callee);
78
- }));
79
-
80
- return function validate(_x) {
81
- return _ref.apply(this, arguments);
82
- };
83
- }();
51
+ var validate = function validate(e) {
52
+ e.preventDefault();
53
+ var valid = true;
54
+ var commercialName = document.querySelector("#commercialNameInput").value;
55
+ var bussinesName = document.querySelector("#bussinesNameInput").value;
56
+ var RFC = document.querySelector("#rfcInput").value;
57
+ var FiscalAddress = document.querySelector("#fiscalAddressInput").value;
58
+ commercialName === "" ? setEmptyCommercialName(true) : setEmptyCommercialName(false);
59
+ bussinesName === "" ? setEmptyBussinesName(true) : setEmptyBussinesName(false);
60
+ RFC === "" ? setEmptyRFC(true) : setEmptyRFC(false);
61
+ FiscalAddress === "" ? setEmptyFiscalAddress(true) : setEmptyFiscalAddress(false);
62
+
63
+ if (commercialName === "" || bussinesName === "" || RFC === "" || FiscalAddress === "") {
64
+ valid = false;
65
+ }
66
+
67
+ valid && sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoRegistro));
68
+ valid && props.setPaso(props.paso + 1);
69
+ };
84
70
 
85
71
  var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
86
72
  className: "credenciales",
@@ -19,9 +19,7 @@ var TagAndInput = function TagAndInput(_ref) {
19
19
  value = _ref.value,
20
20
  inputPlaceHolder = _ref.inputPlaceHolder,
21
21
  inputId = _ref.inputId,
22
- required = _ref.required,
23
- onChange = _ref.onChange,
24
- defaultValue = _ref.defaultValue;
22
+ required = _ref.required;
25
23
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
26
24
  inputType: inputType,
27
25
  className: "input-container",
@@ -33,9 +31,7 @@ var TagAndInput = function TagAndInput(_ref) {
33
31
  inputType: inputType,
34
32
  inputValue: value,
35
33
  inputPlaceholder: inputPlaceHolder,
36
- required: required,
37
- onChange: onChange,
38
- defaultValue: defaultValue
34
+ required: required
39
35
  })]
40
36
  }, "generalTagInput-".concat(inputType));
41
37
  };
@@ -49,7 +49,7 @@ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordL
49
49
  emptyVerificationCode = _useState6[0],
50
50
  setEmptyVerificationCode = _useState6[1];
51
51
 
52
- var _useState7 = (0, _react.useState)(),
52
+ var _useState7 = (0, _react.useState)(document.querySelectorAll("[id^='verificationCodeInput']")),
53
53
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
54
54
  inputCodeVerificationAll = _useState8[0],
55
55
  setInputCodeVerificationAll = _useState8[1];
@@ -59,12 +59,12 @@ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordL
59
59
  props.confirmationError !== "" && setEmptyVerificationCode(false);
60
60
  }, [props.confirmationError]);
61
61
 
62
- var checkCode = function checkCode(e) {
62
+ var checkCode = function checkCode(e, flag) {
63
63
  var valid = true;
64
64
  e.preventDefault();
65
65
  var code = "";
66
66
 
67
- if (awsError === "" && !emptyVerificationCode) {
67
+ if (awsError === "" && !flag) {
68
68
  inputPositions.map(function (position) {
69
69
  return code = code + document.querySelector("#verificationCodeInput".concat(position)).value;
70
70
  });
@@ -74,7 +74,6 @@ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordL
74
74
  }
75
75
 
76
76
  sessionStorage.setItem("confirmationCode", JSON.stringify(code));
77
- setEmptyVerificationCode(false);
78
77
  valid && !sessionStorage.getItem("resetPasswordProcess") && props.setPaso(6);
79
78
  valid && sessionStorage.getItem("resetPasswordProcess") && props.setPaso(8);
80
79
  }
@@ -82,36 +81,37 @@ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordL
82
81
 
83
82
  var validateResend = /*#__PURE__*/function () {
84
83
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
84
+ var email;
85
85
  return _regenerator.default.wrap(function _callee$(_context) {
86
86
  while (1) {
87
87
  switch (_context.prev = _context.next) {
88
88
  case 0:
89
- e.preventDefault(); //const email = JSON.parse(sessionStorage.getItem("email"));
90
-
91
- _context.prev = 1;
92
- _context.next = 4;
89
+ e.preventDefault();
90
+ email = JSON.parse(sessionStorage.getItem("email"));
91
+ _context.prev = 2;
92
+ _context.next = 5;
93
93
  return props.Auth.forgotPassword(email);
94
94
 
95
- case 4:
95
+ case 5:
96
96
  sessionStorage.setItem("email", JSON.stringify(email));
97
97
  sessionStorage.setItem("resetPasswordProcess", JSON.stringify("true"));
98
98
  props.setPaso(5);
99
99
  setResend(true);
100
- _context.next = 14;
100
+ _context.next = 15;
101
101
  break;
102
102
 
103
- case 10:
104
- _context.prev = 10;
105
- _context.t0 = _context["catch"](1);
103
+ case 11:
104
+ _context.prev = 11;
105
+ _context.t0 = _context["catch"](2);
106
106
  setAwsError(_context.t0.code);
107
107
  console.log(_context.t0.message);
108
108
 
109
- case 14:
109
+ case 15:
110
110
  case "end":
111
111
  return _context.stop();
112
112
  }
113
113
  }
114
- }, _callee, null, [[1, 10]]);
114
+ }, _callee, null, [[2, 11]]);
115
115
  }));
116
116
 
117
117
  return function validateResend(_x) {
@@ -184,8 +184,9 @@ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordL
184
184
  buttonType: "general-default-button",
185
185
  label: "Enviar",
186
186
  onClick: function onClick(e) {
187
- (0, _utils.validate)(inputCodeVerificationAll, setEmptyVerificationCode);
188
- checkCode(e);
187
+ var flag = (0, _utils.validate)(inputCodeVerificationAll);
188
+ checkCode(e, flag);
189
+ setEmptyVerificationCode(flag);
189
190
  }
190
191
  })
191
192
  }, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -58,12 +58,12 @@ var nextInputFocus = function nextInputFocus(inputsArray, index) {
58
58
  */
59
59
 
60
60
 
61
- var validate = function validate(inputsArray, setEmptyVerificationCode) {
61
+ var validate = function validate(inputsArray) {
62
62
  var contInputEmpty = 0;
63
63
  inputsArray.forEach(function (element) {
64
64
  element.value === "" ? 0 : contInputEmpty++;
65
65
  });
66
- contInputEmpty === inputsArray.length ? setEmptyVerificationCode(false) : setEmptyVerificationCode(true);
66
+ return contInputEmpty !== inputsArray.length;
67
67
  };
68
68
 
69
69
  exports.validate = validate;
@@ -31,7 +31,7 @@ var _GradientPanel = require("../../atoms/GradientPanel");
31
31
 
32
32
  var _jsxRuntime = require("react/jsx-runtime");
33
33
 
34
- var ChangePassword = function ChangePassword() {
34
+ var ChangePassword = function ChangePassword(props) {
35
35
  var _useState = (0, _react.useState)(false),
36
36
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
37
37
  emptyPassword = _useState2[0],
@@ -49,7 +49,7 @@ var ChangePassword = function ChangePassword() {
49
49
 
50
50
  var validate = /*#__PURE__*/function () {
51
51
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
52
- var password, confirmPassword;
52
+ var password, confirmPassword, valid;
53
53
  return _regenerator.default.wrap(function _callee$(_context) {
54
54
  while (1) {
55
55
  switch (_context.prev = _context.next) {
@@ -66,7 +66,17 @@ var ChangePassword = function ChangePassword() {
66
66
  setMatchPasswords(false);
67
67
  }
68
68
 
69
- case 6:
69
+ valid = true;
70
+ emptyPassword && (valid = false);
71
+ emptyConfirmPassword && (valid = false);
72
+ !matchPasswords && (valid = false);
73
+
74
+ if (valid) {
75
+ sessionStorage.setItem("newPassword", JSON.stringify(password));
76
+ !sessionStorage.getItem("resetPasswordProcess") ? props.setPaso(9) : props.setPaso(11);
77
+ }
78
+
79
+ case 11:
70
80
  case "end":
71
81
  return _context.stop();
72
82
  }