contentoh-components-library 21.0.40 → 21.0.43
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.
- package/dist/components/atoms/GeneralInput/index.js +2 -6
- package/dist/components/atoms/Loading/styles.js +1 -1
- package/dist/components/molecules/LoginPasswordStrength/index.js +2 -8
- package/dist/components/molecules/RegistrationFirstStep/index.js +35 -27
- package/dist/components/molecules/RegistrationFirstStep/styles.js +1 -1
- package/dist/components/molecules/RegistrationSecondStep/index.js +42 -110
- package/dist/components/molecules/RegistrationThirdStep/index.js +19 -33
- package/dist/components/molecules/TagAndInput/index.js +2 -6
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +18 -17
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +2 -2
- package/dist/components/organisms/ChangePassword/index.js +13 -3
- package/dist/components/organisms/ChangePassword/styles.js +1 -1
- package/package.json +2 -2
- package/src/components/atoms/GeneralInput/index.js +0 -4
- package/src/components/atoms/Loading/styles.js +2 -2
- package/src/components/molecules/EmailResetPasswordLogin/index.js +0 -1
- package/src/components/molecules/LoginPasswordStrength/index.js +0 -5
- package/src/components/molecules/RegistrationFirstStep/index.js +46 -39
- package/src/components/molecules/RegistrationFirstStep/styles.js +3 -3
- package/src/components/molecules/RegistrationSecondStep/index.js +51 -86
- package/src/components/molecules/RegistrationThirdStep/index.js +14 -1
- package/src/components/molecules/TagAndInput/index.js +0 -4
- package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +17 -15
- package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +2 -4
- package/src/components/organisms/ChangePassword/index.js +16 -3
- package/src/components/organisms/ChangePassword/styles.js +2 -3
|
@@ -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
|
-
|
|
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
|
-
|
|
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:
|
|
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: 60%;\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:10%;\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", {
|
|
@@ -75,6 +75,13 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
|
|
|
75
75
|
regError = _useState18[0],
|
|
76
76
|
setRegError = _useState18[1];
|
|
77
77
|
|
|
78
|
+
var name = document.querySelector("#nameInput").value;
|
|
79
|
+
var lastName = document.querySelector("#lastNameInput").value;
|
|
80
|
+
var email = document.querySelector("#emailInput").value;
|
|
81
|
+
var job = document.querySelector("#jobInput").value;
|
|
82
|
+
var phone = document.querySelector("#phoneInput").value;
|
|
83
|
+
var country = document.querySelector("#countrySelect").value;
|
|
84
|
+
var countryCode = document.querySelector("#countryCodeSelect").value;
|
|
78
85
|
(0, _react.useEffect)(function () {
|
|
79
86
|
JSON.parse(sessionStorage.getItem("nuevoRegistro")).name === "" && sessionStorage.removeItem("registrationError");
|
|
80
87
|
sessionStorage.getItem("registrationError") && setRegError(true);
|
|
@@ -91,30 +98,34 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
|
|
|
91
98
|
sessionStorage.getItem("resetPasswordProcess") && sessionStorage.getItem("resetPasswordProcess");
|
|
92
99
|
}, []);
|
|
93
100
|
|
|
94
|
-
var
|
|
101
|
+
var validate = function validate(evt) {
|
|
95
102
|
var valid = true;
|
|
96
103
|
evt.preventDefault();
|
|
97
|
-
var name = document.querySelector("#nameInput").value;
|
|
98
|
-
var lastName = document.querySelector("#lastNameInput").value;
|
|
99
|
-
var email = document.querySelector("#emailInput").value;
|
|
100
|
-
var job = document.querySelector("#jobInput").value;
|
|
101
|
-
var phone = document.querySelector("#phoneInput").value;
|
|
102
|
-
var country = document.querySelector("#countrySelect").value;
|
|
103
|
-
var countryCode = document.querySelector("#countryCodeSelect").value;
|
|
104
104
|
name === "" ? setEmptyName(true) : setEmptyName(false);
|
|
105
105
|
lastName === "" ? setEmptyLastName(true) : setEmptyLastName(false);
|
|
106
106
|
email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
|
|
107
107
|
job === "" ? setEmptyJob(true) : setEmptyJob(false);
|
|
108
108
|
phone === "" ? setEmptyPhone(true) : setEmptyPhone(false);
|
|
109
109
|
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
110
|
-
|
|
110
|
+
var invalidPhone = true;
|
|
111
|
+
country === "value" ? setEmptyCountry(true) : setEmptyCountry(false);
|
|
111
112
|
Array.from(phone).forEach(function (digit, i) {
|
|
112
|
-
phone.charCodeAt(i) < 48 ? setPhoneFormatError(true) :
|
|
113
|
-
phone.charCodeAt(i) > 57 ? setPhoneFormatError(true) :
|
|
113
|
+
phone.charCodeAt(i) < 48 ? setPhoneFormatError(true) : invalidPhone = false;
|
|
114
|
+
phone.charCodeAt(i) > 57 ? setPhoneFormatError(true) : invalidPhone = false;
|
|
114
115
|
});
|
|
116
|
+
|
|
117
|
+
if (name === "" || lastName === "" || email === "" || job === "" || phone === "" || country === "value" || !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) || invalidPhone) {
|
|
118
|
+
valid = false;
|
|
119
|
+
} else valid = true;
|
|
120
|
+
|
|
121
|
+
return valid;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
var validateForm = function validateForm(evt, valid) {
|
|
125
|
+
evt.preventDefault();
|
|
115
126
|
var nuevoUsuario = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
|
|
116
127
|
|
|
117
|
-
if (
|
|
128
|
+
if (valid) {
|
|
118
129
|
sessionStorage.setItem("countryCode", JSON.stringify(countryCode));
|
|
119
130
|
nuevoUsuario.name = name;
|
|
120
131
|
nuevoUsuario.lastName = lastName;
|
|
@@ -127,10 +138,6 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
|
|
|
127
138
|
return props.paso + 1;
|
|
128
139
|
});
|
|
129
140
|
regError && valid && props.setPaso(4);
|
|
130
|
-
console.log("rediring");
|
|
131
|
-
} else {
|
|
132
|
-
valid = false;
|
|
133
|
-
console.log("code");
|
|
134
141
|
}
|
|
135
142
|
};
|
|
136
143
|
|
|
@@ -230,35 +237,35 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
|
|
|
230
237
|
className: "country-options",
|
|
231
238
|
id: "countrySelect",
|
|
232
239
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
233
|
-
value: "
|
|
240
|
+
value: "value",
|
|
234
241
|
selected: true,
|
|
235
242
|
children: "Selecciona tu pa\xEDs"
|
|
236
243
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
237
|
-
value: "
|
|
244
|
+
value: "Argentina",
|
|
238
245
|
children: "Argentina"
|
|
239
246
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
240
|
-
value: "
|
|
247
|
+
value: "Colombia",
|
|
241
248
|
children: "Colombia"
|
|
242
249
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
243
|
-
value: "
|
|
250
|
+
value: "Ecuador",
|
|
244
251
|
children: "Ecuador"
|
|
245
252
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
246
|
-
value: "
|
|
253
|
+
value: "El Salvador",
|
|
247
254
|
children: "El Salvador"
|
|
248
255
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
249
|
-
value: "
|
|
256
|
+
value: "Honduras",
|
|
250
257
|
children: "Honduras"
|
|
251
258
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
252
|
-
value: "
|
|
259
|
+
value: "M\xE9xico",
|
|
253
260
|
children: "M\xE9xico"
|
|
254
261
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
255
|
-
value: "
|
|
262
|
+
value: "Panam\xE1",
|
|
256
263
|
children: "Panam\xE1"
|
|
257
264
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
258
|
-
value: "
|
|
265
|
+
value: "Per\xFA",
|
|
259
266
|
children: "Per\xFA"
|
|
260
267
|
})]
|
|
261
|
-
}),
|
|
268
|
+
}), emptyCountry && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
262
269
|
children: "Seleccione su pa\xEDs"
|
|
263
270
|
})]
|
|
264
271
|
}, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -267,7 +274,8 @@ var RegistrationFirstStep = function RegistrationFirstStep(props) {
|
|
|
267
274
|
buttonType: "general-default-button",
|
|
268
275
|
label: "Enviar",
|
|
269
276
|
onClick: function onClick(e) {
|
|
270
|
-
|
|
277
|
+
var flag = validate(e);
|
|
278
|
+
validateForm(e, flag);
|
|
271
279
|
}
|
|
272
280
|
})
|
|
273
281
|
}, "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
|
|
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)(
|
|
31
|
+
var _useState = (0, _react.useState)(false),
|
|
32
32
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
44
|
-
|
|
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
|
-
|
|
49
|
-
|
|
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
|
-
|
|
54
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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 === "" && !
|
|
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();
|
|
90
|
-
|
|
91
|
-
_context.prev =
|
|
92
|
-
_context.next =
|
|
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
|
|
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 =
|
|
100
|
+
_context.next = 15;
|
|
101
101
|
break;
|
|
102
102
|
|
|
103
|
-
case
|
|
104
|
-
_context.prev =
|
|
105
|
-
_context.t0 = _context["catch"](
|
|
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
|
|
109
|
+
case 15:
|
|
110
110
|
case "end":
|
|
111
111
|
return _context.stop();
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
}, _callee, null, [[
|
|
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
|
|
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
|
|
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
|
|
66
|
+
return contInputEmpty !== inputsArray.length;
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
exports.validate = validate;
|