contentoh-components-library 21.0.39 → 21.0.42

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 (32) hide show
  1. package/dist/components/atoms/GeneralInput/index.js +2 -6
  2. package/dist/components/atoms/GradientPanel/styles.js +1 -1
  3. package/dist/components/atoms/Loading/index.js +5 -3
  4. package/dist/components/atoms/Loading/styles.js +1 -1
  5. package/dist/components/molecules/LoginPasswordStrength/index.js +2 -8
  6. package/dist/components/molecules/RegistrationFirstStep/index.js +78 -135
  7. package/dist/components/molecules/RegistrationFirstStep/styles.js +1 -1
  8. package/dist/components/molecules/RegistrationSecondStep/index.js +42 -110
  9. package/dist/components/molecules/RegistrationThirdStep/index.js +19 -33
  10. package/dist/components/molecules/SignInLogin/styles.js +1 -1
  11. package/dist/components/molecules/TagAndInput/index.js +2 -6
  12. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +115 -9
  13. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +2 -2
  14. package/dist/components/organisms/ChangePassword/index.js +13 -3
  15. package/dist/components/organisms/ChangePassword/styles.js +1 -1
  16. package/package.json +2 -2
  17. package/src/components/atoms/GeneralInput/index.js +0 -4
  18. package/src/components/atoms/GradientPanel/styles.js +1 -0
  19. package/src/components/atoms/Loading/index.js +2 -0
  20. package/src/components/atoms/Loading/styles.js +12 -3
  21. package/src/components/molecules/EmailResetPasswordLogin/index.js +0 -1
  22. package/src/components/molecules/LoginPasswordStrength/index.js +0 -5
  23. package/src/components/molecules/RegistrationFirstStep/index.js +91 -136
  24. package/src/components/molecules/RegistrationFirstStep/styles.js +4 -1
  25. package/src/components/molecules/RegistrationSecondStep/index.js +51 -86
  26. package/src/components/molecules/RegistrationThirdStep/index.js +14 -1
  27. package/src/components/molecules/SignInLogin/styles.js +1 -0
  28. package/src/components/molecules/TagAndInput/index.js +0 -4
  29. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +103 -11
  30. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +2 -4
  31. package/src/components/organisms/ChangePassword/index.js +16 -3
  32. package/src/components/organisms/ChangePassword/styles.js +1 -2
@@ -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",
@@ -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 background: \"white\";\n display: flex;\n height: 100%;\n width: 50%;\n justify-content: center;\n align-items: center;\n label {\n color: red;\n margin-top: 3px;\n margin-left: 15px;\n font-family: ", ";\n font-size: 11px;\n & + * {\n margin-top: 12px;\n }\n }\n\n &.home-login {\n .credenciales {\n & + * {\n margin-top: 30px;\n }\n }\n .user {\n & + * {\n margin-top: 20px;\n }\n }\n .password {\n & + * {\n margin-top: 20px;\n }\n }\n .select {\n display: flex;\n justify-content: space-between;\n .active-right {\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n letter-spacing: -0.015em;\n color: ", ";\n cursor: pointer;\n }\n & + * {\n margin-top: 50px;\n }\n }\n .button-right {\n text-align: right;\n & + * {\n margin-top: 55px;\n }\n }\n .new-login {\n p {\n font-family: ", ";\n text-align: right;\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n color: ", ";\n span {\n color: ", ";\n }\n }\n }\n }\n .main-container {\n max-width: 80%;\n max-height: 80%;\n }\n"])), _variables.FontFamily.Raleway_700, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.GlobalColors.secondary_magenta);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: \"white\";\n display: flex;\n height: 100%;\n width: 50%;\n justify-content: center;\n align-items: center;\n label {\n color: red;\n margin-top: 3px;\n margin-left: 15px;\n font-family: ", ";\n font-size: 11px;\n & + * {\n margin-top: 12px;\n }\n }\n\n &.home-login {\n .credenciales {\n & + * {\n margin-top: 30px;\n }\n }\n .user {\n & + * {\n margin-top: 20px;\n }\n }\n .password {\n & + * {\n margin-top: 20px;\n }\n }\n .select {\n display: flex;\n justify-content: space-between;\n .active-right {\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n letter-spacing: -0.015em;\n color: ", ";\n cursor: pointer;\n }\n & + * {\n margin-top: 50px;\n }\n }\n .button-right {\n text-align: right;\n & + * {\n margin-top: 55px;\n }\n }\n .new-login {\n p {\n font-family: ", ";\n text-align: right;\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n color: ", ";\n cursor: pointer;\n span {\n color: ", ";\n }\n }\n }\n }\n .main-container {\n max-width: 80%;\n max-height: 80%;\n }\n"])), _variables.FontFamily.Raleway_700, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.GlobalColors.secondary_magenta);
19
19
 
20
20
  exports.Container = Container;
@@ -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
  };
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.VerificationCodeResetPasswordLogin = void 0;
9
9
 
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
13
+
10
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
15
 
12
16
  var _styles = require("./styles");
@@ -29,18 +33,92 @@ var _utils = require("./utils");
29
33
 
30
34
  var _jsxRuntime = require("react/jsx-runtime");
31
35
 
32
- var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordLogin() {
36
+ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordLogin(props) {
33
37
  var _useState = (0, _react.useState)(false),
34
38
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
35
- emptyVerificationCode = _useState2[0],
36
- setEmptyVerificationCode = _useState2[1];
39
+ resend = _useState2[0],
40
+ setResend = _useState2[1];
37
41
 
38
- var _useState3 = (0, _react.useState)(),
42
+ var _useState3 = (0, _react.useState)(""),
39
43
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
40
- inputCodeVerificationAll = _useState4[0],
41
- setInputCodeVerificationAll = _useState4[1];
44
+ awsError = _useState4[0],
45
+ setAwsError = _useState4[1];
46
+
47
+ var _useState5 = (0, _react.useState)(false),
48
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
49
+ emptyVerificationCode = _useState6[0],
50
+ setEmptyVerificationCode = _useState6[1];
51
+
52
+ var _useState7 = (0, _react.useState)(document.querySelectorAll("[id^='verificationCodeInput']")),
53
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
54
+ inputCodeVerificationAll = _useState8[0],
55
+ setInputCodeVerificationAll = _useState8[1];
42
56
 
43
57
  var inputPositions = [1, 2, 3, 4, 5, 6];
58
+ (0, _react.useEffect)(function () {
59
+ props.confirmationError !== "" && setEmptyVerificationCode(false);
60
+ }, [props.confirmationError]);
61
+
62
+ var checkCode = function checkCode(e, flag) {
63
+ var valid = true;
64
+ e.preventDefault();
65
+ var code = "";
66
+
67
+ if (awsError === "" && !flag) {
68
+ inputPositions.map(function (position) {
69
+ return code = code + document.querySelector("#verificationCodeInput".concat(position)).value;
70
+ });
71
+
72
+ if (sessionStorage.getItem("resetError")) {
73
+ JSON.parse(sessionStorage.getItem("confirmationCode")) === code && (valid = false);
74
+ }
75
+
76
+ sessionStorage.setItem("confirmationCode", JSON.stringify(code));
77
+ valid && !sessionStorage.getItem("resetPasswordProcess") && props.setPaso(6);
78
+ valid && sessionStorage.getItem("resetPasswordProcess") && props.setPaso(8);
79
+ }
80
+ };
81
+
82
+ var validateResend = /*#__PURE__*/function () {
83
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
84
+ var email;
85
+ return _regenerator.default.wrap(function _callee$(_context) {
86
+ while (1) {
87
+ switch (_context.prev = _context.next) {
88
+ case 0:
89
+ e.preventDefault();
90
+ email = JSON.parse(sessionStorage.getItem("email"));
91
+ _context.prev = 2;
92
+ _context.next = 5;
93
+ return props.Auth.forgotPassword(email);
94
+
95
+ case 5:
96
+ sessionStorage.setItem("email", JSON.stringify(email));
97
+ sessionStorage.setItem("resetPasswordProcess", JSON.stringify("true"));
98
+ props.setPaso(5);
99
+ setResend(true);
100
+ _context.next = 15;
101
+ break;
102
+
103
+ case 11:
104
+ _context.prev = 11;
105
+ _context.t0 = _context["catch"](2);
106
+ setAwsError(_context.t0.code);
107
+ console.log(_context.t0.message);
108
+
109
+ case 15:
110
+ case "end":
111
+ return _context.stop();
112
+ }
113
+ }
114
+ }, _callee, null, [[2, 11]]);
115
+ }));
116
+
117
+ return function validateResend(_x) {
118
+ return _ref.apply(this, arguments);
119
+ };
120
+ }();
121
+
44
122
  (0, _react.useEffect)(function () {
45
123
  setInputCodeVerificationAll(document.querySelectorAll("[id^='verificationCodeInput']"));
46
124
  }, []);
@@ -53,8 +131,11 @@ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordL
53
131
  })
54
132
  }, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
55
133
  className: "user",
56
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
57
- text: "Ingresa el código de verificación enviado a:",
134
+ children: [sessionStorage.getItem("email") && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
135
+ text: "Ingrese el c\xF3digo de verificaci\xF3n enviado a: ".concat(JSON.parse(sessionStorage.getItem("email"))),
136
+ headerType: "input-name-header"
137
+ }), !sessionStorage.getItem("email") && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
138
+ text: "Ingrese c\xF3digo de verificaci\xF3n enviado a: ".concat(JSON.parse(sessionStorage.getItem("nuevoRegistro")).email),
58
139
  headerType: "input-name-header"
59
140
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
60
141
  className: "verification-code",
@@ -71,10 +152,30 @@ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordL
71
152
  })
72
153
  }), emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
73
154
  children: "Ingrese su c\xF3digo de verificaci\xF3n"
155
+ }), sessionStorage.getItem("resetError") && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
156
+ children: "C\xF3digo de verifiaci\xF3n incorrecto"
157
+ }), props.confirmationError === "LimitExceededException" && !emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
158
+ children: "Haz realizado demasiados intentos, intentalo m\xE1s tarde"
159
+ }), props.confirmationError === "CodeMismatchException" && !emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
160
+ children: "C\xF3digo de verificaci\xF3n incorrecto"
161
+ }), props.confirmationError === "ExpiredCodeException" && !emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
162
+ children: "El c\xF3digo ingresado est\xE1 expirado"
163
+ }), props.confirmationError === "InternalErrorException" && !emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
164
+ children: "Algo sali\xF3 mal, porfavor vuelva a intentarlo"
165
+ }), awsError === "LimitExceededException" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
166
+ children: "Haz realizado demasiados intentos, intentalo m\xE1s tarde"
167
+ }), awsError === "InternalErrorException" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
168
+ children: "Algo sali\xF3 mal, porfavor vuelva a intentarlo"
169
+ }), resend && awsError === "" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
170
+ className: "resendTrue",
171
+ children: "Se reenvi\xF3 el c\xF3digo de verificaci\xF3n correctamente"
74
172
  })]
75
173
  }, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
76
174
  className: "resend-code",
77
175
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
176
+ onClick: function onClick(e) {
177
+ return validateResend(e);
178
+ },
78
179
  children: "Reenviar c\xF3digo de verificaci\xF3n"
79
180
  })
80
181
  }, "4"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -83,12 +184,17 @@ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordL
83
184
  buttonType: "general-default-button",
84
185
  label: "Enviar",
85
186
  onClick: function onClick(e) {
86
- return (0, _utils.validate)(inputCodeVerificationAll, setEmptyVerificationCode);
187
+ var flag = (0, _utils.validate)(inputCodeVerificationAll);
188
+ checkCode(e, flag);
189
+ setEmptyVerificationCode(flag);
87
190
  }
88
191
  })
89
192
  }, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
90
193
  className: "reset-password",
91
194
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
195
+ onClick: function onClick() {
196
+ return props.setPaso(10);
197
+ },
92
198
  children: "Regresar..."
93
199
  })
94
200
  }, "6")];
@@ -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
  }
@@ -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 display: flex;\n width: 50%;\n height: 100vh;\n .button-center {\n text-align: center;\n position: absolute;\n bottom: 5%;\n left: calc(75% - 80px);\n .general-default-button {\n width: 160px;\n }\n }\n"])));
16
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 50%;\n height: 100vh;\n .button-center {\n position: absolute;\n bottom: 5%;\n left: 75%;\n .general-default-button {\n width: 160px;\n }\n }\n"])));
17
17
 
18
18
  exports.Container = Container;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.0.39",
3
+ "version": "21.0.42",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -77,7 +77,7 @@
77
77
  "auto": "^10.36.5",
78
78
  "babel-loader": "^8.2.3",
79
79
  "chromatic": "^6.3.3",
80
- "contentoh-components-library": "^21.0.26",
80
+ "contentoh-components-library": "^21.0.40",
81
81
  "cross-env": "^7.0.3",
82
82
  "storybook-css-modules-preset": "^1.1.1"
83
83
  },
@@ -14,9 +14,7 @@ export const GeneralInput = ({
14
14
  inputsArray,
15
15
  maxLength,
16
16
  inputSize,
17
- onChange,
18
17
  required,
19
- defaultValue,
20
18
  }) => {
21
19
  const [textValue, setTextValue] = useState({ value: inputValue ?? "" });
22
20
 
@@ -45,9 +43,7 @@ export const GeneralInput = ({
45
43
  value={textValue.value}
46
44
  onInput={(e) => onHandleChange(e)}
47
45
  maxLength={maxLength && maxLength}
48
- onChange={onChange}
49
46
  required={required}
50
- defaultValue={defaultValue}
51
47
  />
52
48
  ) : (
53
49
  <textarea
@@ -37,6 +37,7 @@ export const Container = styled.div`
37
37
  }
38
38
 
39
39
  &.home-login {
40
+ width: 100%;
40
41
  .credenciales {
41
42
  & + * {
42
43
  margin-top: 30px;
@@ -1,8 +1,10 @@
1
1
  import { Container } from "./styles";
2
+ import { LogoImage } from "../LogoImage";
2
3
 
3
4
  export const Loading = () => {
4
5
  return (
5
6
  <Container >
7
+ <LogoImage/>
6
8
  <div className="loader">
7
9
  <span className="first"></span>
8
10
  <span className="second"></span>
@@ -1,17 +1,26 @@
1
1
  import styled from "styled-components";
2
2
 
3
3
  export const Container = styled.div`
4
- display: flex;
5
4
  justify-content: center;
6
5
  align-items: center;
7
- height: 100%;
6
+ height: 100vh;
8
7
  width: 50%;
8
+ position: relative;
9
+ img {
10
+ width: 60%;
11
+ position: absolute;
12
+ bottom: 55%;
13
+ left: 10%;
14
+ }
9
15
  .loader {
10
16
  display: flex;
11
17
  justify-content: center;
12
18
  align-items: center;
13
- height: 100%;
19
+ height: 10%;
14
20
  width: 50%;
21
+ position: absolute;
22
+ bottom: 45%;
23
+ left:10%;
15
24
  span {
16
25
  display: inline-block;
17
26
  border-radius: 100%;
@@ -26,7 +26,6 @@ export const EmailResetPasswordLogin = (props) => {
26
26
  : setInvalidEmail(false);
27
27
  emptyEmail && (valid = false);
28
28
  invalidEmail && (valid = false);
29
-
30
29
  if (valid) {
31
30
  try {
32
31
  await props.Auth.forgotPassword(email);