contentoh-components-library 21.0.74 → 21.0.75
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/.env.development +4 -2
- package/.env.production +4 -2
- package/CHANGELOG.md +39 -0
- package/dist/components/atoms/GeneralInput/index.js +4 -3
- package/dist/components/atoms/GradientPanel/styles.js +1 -1
- package/dist/components/atoms/Loading/Loading.stories.js +28 -0
- package/dist/components/atoms/Loading/index.js +1 -0
- package/dist/components/atoms/LogoImage/index.js +1 -0
- package/dist/components/atoms/SliderToolTip/SliderToolTip.stories.js +47 -0
- package/dist/components/atoms/SliderToolTip/index.js +200 -0
- package/dist/components/atoms/SliderToolTip/styles.js +24 -0
- package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +28 -0
- package/dist/components/atoms/VerticalSideMenuMainPage/index.js +99 -0
- package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +24 -0
- package/dist/components/molecules/CarouselImagesLogin/index.js +40 -42
- package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +28 -0
- package/dist/components/molecules/EmailResetPasswordLogin/index.js +153 -0
- package/dist/components/molecules/EmailResetPasswordLogin/styles.js +20 -0
- package/dist/components/molecules/LoginPasswordStrength/index.js +9 -9
- package/dist/components/molecules/LoginPasswordStrength/styles.js +1 -1
- package/dist/components/molecules/LogoLoading/Loading.stories.js +28 -0
- package/dist/components/molecules/LogoLoading/index.js +22 -0
- package/dist/components/molecules/LogoLoading/styles.js +18 -0
- package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +28 -0
- package/dist/components/molecules/RegistrationFirstStep/index.js +308 -0
- package/dist/components/molecules/RegistrationFirstStep/styles.js +20 -0
- package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +28 -0
- package/dist/components/molecules/RegistrationSecondStep/index.js +173 -0
- package/dist/components/molecules/RegistrationSecondStep/styles.js +20 -0
- package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +28 -0
- package/dist/components/molecules/RegistrationThirdStep/index.js +155 -0
- package/dist/components/molecules/RegistrationThirdStep/styles.js +20 -0
- package/dist/components/molecules/SignInLogin/SignInLogin.stories.js +28 -0
- package/dist/components/molecules/SignInLogin/index.js +315 -0
- package/dist/components/molecules/SignInLogin/styles.js +20 -0
- package/dist/components/molecules/TagAndInput/index.js +4 -2
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +28 -0
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +211 -0
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +20 -0
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +69 -0
- package/dist/components/organisms/ChangePassword/ChangePassword.stories.js +28 -0
- package/dist/components/organisms/ChangePassword/index.js +124 -0
- package/dist/components/organisms/ChangePassword/styles.js +18 -0
- package/dist/index.js +290 -30
- package/package.json +12 -4
- package/src/assets/images/editField/showPassword.png +0 -0
- package/src/assets/images/sliderToolTip/infoIcon.svg +4 -0
- package/src/assets/images/sliderToolTip/slide1.svg +5 -0
- package/src/assets/images/sliderToolTip/slide2.svg +9 -0
- package/src/assets/images/sliderToolTip/slide3.svg +9 -0
- package/src/assets/images/sliderToolTip/slide4.svg +9 -0
- package/src/assets/images/sliderToolTip/slide5.svg +40 -0
- package/src/assets/images/verticalSideMenuMainPage/closeMenu.svg +4 -0
- package/src/assets/images/verticalSideMenuMainPage/iconFAQS.svg +12 -0
- package/src/assets/images/verticalSideMenuMainPage/iconGroup.svg +3 -0
- package/src/assets/images/verticalSideMenuMainPage/iconLogo.svg +12 -0
- package/src/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +15 -0
- package/src/assets/images/verticalSideMenuMainPage/iconProduct.svg +3 -0
- package/src/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +12 -0
- package/src/assets/images/verticalSideMenuMainPage/iconTask.svg +10 -0
- package/src/assets/images/verticalSideMenuMainPage/openMenu.svg +4 -0
- package/src/components/atoms/GeneralInput/index.js +3 -2
- package/src/components/atoms/GradientPanel/styles.js +1 -0
- package/src/components/atoms/Loading/Loading.stories.js +10 -0
- package/src/components/atoms/Loading/index.js +3 -2
- package/src/components/atoms/LogoImage/index.js +1 -1
- package/src/components/atoms/SliderToolTip/SliderToolTip.stories.js +23 -0
- package/src/components/atoms/SliderToolTip/index.js +182 -0
- package/src/components/atoms/SliderToolTip/styles.js +168 -0
- package/src/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +12 -0
- package/src/components/atoms/VerticalSideMenuMainPage/index.js +55 -0
- package/src/components/atoms/VerticalSideMenuMainPage/styles.js +45 -0
- package/src/components/molecules/CarouselImagesLogin/index.js +34 -37
- package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +11 -0
- package/src/components/molecules/EmailResetPasswordLogin/index.js +85 -0
- package/src/components/molecules/EmailResetPasswordLogin/styles.js +23 -0
- package/src/components/molecules/LoginPasswordStrength/index.js +11 -6
- package/src/components/molecules/LoginPasswordStrength/styles.js +5 -1
- package/src/components/molecules/LogoLoading/Loading.stories.js +10 -0
- package/src/components/molecules/LogoLoading/index.js +12 -0
- package/src/components/molecules/LogoLoading/styles.js +16 -0
- package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +11 -0
- package/src/components/molecules/RegistrationFirstStep/index.js +227 -0
- package/src/components/molecules/RegistrationFirstStep/styles.js +87 -0
- package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +11 -0
- package/src/components/molecules/RegistrationSecondStep/index.js +136 -0
- package/src/components/molecules/RegistrationSecondStep/styles.js +64 -0
- package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +11 -0
- package/src/components/molecules/RegistrationThirdStep/index.js +130 -0
- package/src/components/molecules/RegistrationThirdStep/styles.js +44 -0
- package/src/components/molecules/SignInLogin/SignInLogin.stories.js +11 -0
- package/src/components/molecules/SignInLogin/index.js +226 -0
- package/src/components/molecules/SignInLogin/styles.js +120 -0
- package/src/components/molecules/TagAndInput/index.js +2 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +11 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +171 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +54 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +54 -0
- package/src/components/organisms/ChangePassword/ChangePassword.stories.js +11 -0
- package/src/components/organisms/ChangePassword/index.js +77 -0
- package/src/components/organisms/ChangePassword/styles.js +13 -0
- package/src/index.js +21 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.VerificationCodeResetPasswordLogin = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
var _GradientPanel = require("../../atoms/GradientPanel");
|
|
19
|
+
|
|
20
|
+
var _react = require("react");
|
|
21
|
+
|
|
22
|
+
var _LogoImage = require("../../atoms/LogoImage");
|
|
23
|
+
|
|
24
|
+
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
25
|
+
|
|
26
|
+
var _variables = require("../../../global-files/variables");
|
|
27
|
+
|
|
28
|
+
var _GeneralInput = require("../../atoms/GeneralInput");
|
|
29
|
+
|
|
30
|
+
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
31
|
+
|
|
32
|
+
var _utils = require("./utils");
|
|
33
|
+
|
|
34
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
|
+
|
|
36
|
+
var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordLogin(props) {
|
|
37
|
+
var _useState = (0, _react.useState)(false),
|
|
38
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
39
|
+
resend = _useState2[0],
|
|
40
|
+
setResend = _useState2[1];
|
|
41
|
+
|
|
42
|
+
var _useState3 = (0, _react.useState)(""),
|
|
43
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
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];
|
|
56
|
+
|
|
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
|
+
setEmptyVerificationCode(false);
|
|
100
|
+
setResend(true);
|
|
101
|
+
_context.next = 16;
|
|
102
|
+
break;
|
|
103
|
+
|
|
104
|
+
case 12:
|
|
105
|
+
_context.prev = 12;
|
|
106
|
+
_context.t0 = _context["catch"](2);
|
|
107
|
+
setAwsError(_context.t0.code);
|
|
108
|
+
console.log(_context.t0.message);
|
|
109
|
+
|
|
110
|
+
case 16:
|
|
111
|
+
case "end":
|
|
112
|
+
return _context.stop();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}, _callee, null, [[2, 12]]);
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
return function validateResend(_x) {
|
|
119
|
+
return _ref.apply(this, arguments);
|
|
120
|
+
};
|
|
121
|
+
}();
|
|
122
|
+
|
|
123
|
+
(0, _react.useEffect)(function () {
|
|
124
|
+
setInputCodeVerificationAll(document.querySelectorAll("[id^='verificationCodeInput']"));
|
|
125
|
+
}, []);
|
|
126
|
+
var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
127
|
+
className: "credenciales",
|
|
128
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
129
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
130
|
+
color: _variables.GlobalColors.s5,
|
|
131
|
+
text: "Ingresa tus credenciales"
|
|
132
|
+
})
|
|
133
|
+
}, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
134
|
+
className: "user",
|
|
135
|
+
children: [sessionStorage.getItem("email") && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
136
|
+
text: "Ingrese el c\xF3digo de verificaci\xF3n enviado a: ".concat(JSON.parse(sessionStorage.getItem("email"))),
|
|
137
|
+
headerType: "input-name-header"
|
|
138
|
+
}), !sessionStorage.getItem("email") && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
139
|
+
text: "Ingrese c\xF3digo de verificaci\xF3n enviado a: ".concat(JSON.parse(sessionStorage.getItem("nuevoRegistro")).email),
|
|
140
|
+
headerType: "input-name-header"
|
|
141
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
142
|
+
className: "verification-code",
|
|
143
|
+
children: inputPositions.map(function (position) {
|
|
144
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralInput.GeneralInput, {
|
|
145
|
+
inputId: "verificationCodeInput".concat(position),
|
|
146
|
+
inputType: "text",
|
|
147
|
+
inputPlaceholder: "X",
|
|
148
|
+
validateInput: _utils.validateInput,
|
|
149
|
+
inputsArray: inputCodeVerificationAll,
|
|
150
|
+
position: position,
|
|
151
|
+
maxLength: "1"
|
|
152
|
+
});
|
|
153
|
+
})
|
|
154
|
+
}), emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
155
|
+
children: "Ingrese su c\xF3digo de verificaci\xF3n"
|
|
156
|
+
}), sessionStorage.getItem("resetError") && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
157
|
+
children: "C\xF3digo de verifiaci\xF3n incorrecto"
|
|
158
|
+
}), props.confirmationError === "LimitExceededException" && !emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
159
|
+
children: "Haz realizado demasiados intentos, intentalo m\xE1s tarde"
|
|
160
|
+
}), props.confirmationError === "CodeMismatchException" && !emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
161
|
+
children: "C\xF3digo de verificaci\xF3n incorrecto"
|
|
162
|
+
}), props.confirmationError === "ExpiredCodeException" && !emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
163
|
+
children: "El c\xF3digo ingresado est\xE1 expirado"
|
|
164
|
+
}), props.confirmationError === "InternalErrorException" && !emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
165
|
+
children: "Algo sali\xF3 mal, porfavor vuelva a intentarlo"
|
|
166
|
+
}), awsError === "LimitExceededException" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
167
|
+
children: "Haz realizado demasiados intentos, intentalo m\xE1s tarde"
|
|
168
|
+
}), awsError === "InternalErrorException" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
169
|
+
children: "Algo sali\xF3 mal, porfavor vuelva a intentarlo"
|
|
170
|
+
}), resend && awsError === "" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
171
|
+
className: "resendTrue",
|
|
172
|
+
children: "Se reenvi\xF3 el c\xF3digo de verificaci\xF3n correctamente"
|
|
173
|
+
})]
|
|
174
|
+
}, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
175
|
+
className: "resend-code",
|
|
176
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
177
|
+
onClick: function onClick(e) {
|
|
178
|
+
return validateResend(e);
|
|
179
|
+
},
|
|
180
|
+
children: "Reenviar c\xF3digo de verificaci\xF3n"
|
|
181
|
+
})
|
|
182
|
+
}, "4"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
183
|
+
className: "button-center",
|
|
184
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
185
|
+
buttonType: "general-default-button",
|
|
186
|
+
label: "Enviar",
|
|
187
|
+
onClick: function onClick(e) {
|
|
188
|
+
var flag = (0, _utils.validate)(inputCodeVerificationAll);
|
|
189
|
+
checkCode(e, flag);
|
|
190
|
+
setEmptyVerificationCode(flag);
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
}, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
194
|
+
className: "reset-password",
|
|
195
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
196
|
+
onClick: function onClick() {
|
|
197
|
+
return props.setPaso(10);
|
|
198
|
+
},
|
|
199
|
+
children: "Regresar..."
|
|
200
|
+
})
|
|
201
|
+
}, "6")];
|
|
202
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
203
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
|
|
204
|
+
componentsArray: loginRight,
|
|
205
|
+
panelType: "home-login",
|
|
206
|
+
panelColor: _variables.GlobalColors.white
|
|
207
|
+
})
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
exports.VerificationCodeResetPasswordLogin = VerificationCodeResetPasswordLogin;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n height: 100vh;\n width: 50%;\n align-items: center;\n justify-content: center;\n .button-center {\n text-align: center;\n .general-default-button {\n width: 160px;\n }\n }\n .reset-password {\n text-align: center;\n margin: 15px !important;\n color: ", ";\n cursor: pointer;\n font-weight: bold;\n font-family: ", ";\n font-size: 13px;\n }\n .resend-code {\n margin-top: 8px !important;\n color: ", ";\n font-family: ", ";\n font-size: 11px;\n text-decoration: underline rgb(228, 81, 172);\n cursor: pointer;\n & + * {\n margin-top: 30px;\n }\n }\n .verification-code {\n display: flex;\n text-align: center;\n margin: auto;\n margin-top: 10px;\n input[type=\"number\"]::-webkit-inner-spin-button,\n input[type=\"number\"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n input {\n width: 70%;\n text-align: center;\n }\n }\n .resendTrue{\n color: ", ";\n }\n"])), _variables.GlobalColors.secondary_magenta, _variables.FontFamily.Raleway, _variables.GlobalColors.magenta_s2, _variables.FontFamily.AvenirNext, _variables.GlobalColors.exported);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateInput = exports.validate = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {event} e event received triggered by verification code input
|
|
11
|
+
* @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
|
|
12
|
+
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
|
|
13
|
+
*/
|
|
14
|
+
var validateInput = function validateInput(e, index, inputsArray) {
|
|
15
|
+
var isValid = false;
|
|
16
|
+
var inputNotEmpty = e.target.value.length > 0;
|
|
17
|
+
|
|
18
|
+
if (inputNotEmpty) {
|
|
19
|
+
if (validateInputNumber(e) !== null) {
|
|
20
|
+
isValid = true;
|
|
21
|
+
nextInputFocus(inputsArray, index++);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return isValid ? e.target.value : "";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param {event} e event received triggered by verification code input
|
|
30
|
+
* @returns {boolean} if digit is a number
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
exports.validateInput = validateInput;
|
|
35
|
+
|
|
36
|
+
var validateInputNumber = function validateInputNumber(e) {
|
|
37
|
+
return (e.target.value || String.fromCharCode(e.keyCode)).match(/[0-9]{1}/);
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
|
|
42
|
+
* @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
|
|
43
|
+
* changes focus to next input if digit typed is a number and there wasn't any before
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
var nextInputFocus = function nextInputFocus(inputsArray, index) {
|
|
48
|
+
var _inputsArray$index;
|
|
49
|
+
|
|
50
|
+
var button = document.getElementsByClassName("general-default-button");
|
|
51
|
+
inputsArray !== null && inputsArray !== void 0 && inputsArray.length && index === (inputsArray === null || inputsArray === void 0 ? void 0 : inputsArray.length) ? button[0].focus() : (_inputsArray$index = inputsArray[index]) === null || _inputsArray$index === void 0 ? void 0 : _inputsArray$index.focus();
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to check if there's any empty)
|
|
56
|
+
* @param {function} setEmptyVerificationCode function to update flag which handles if there's an empty char
|
|
57
|
+
* updates emptyVerificationFlag from father component
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
var validate = function validate(inputsArray) {
|
|
62
|
+
var contInputEmpty = 0;
|
|
63
|
+
inputsArray.forEach(function (element) {
|
|
64
|
+
element.value === "" ? 0 : contInputEmpty++;
|
|
65
|
+
});
|
|
66
|
+
return contInputEmpty !== inputsArray.length;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.validate = validate;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.ChangePasswordDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/organisms/ChangePassword",
|
|
18
|
+
component: _index.ChangePassword
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ChangePassword, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var ChangePasswordDefault = Template.bind({});
|
|
27
|
+
exports.ChangePasswordDefault = ChangePasswordDefault;
|
|
28
|
+
ChangePasswordDefault.args = {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ChangePassword = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
var _LoginPasswordStrength = require("../../molecules/LoginPasswordStrength");
|
|
19
|
+
|
|
20
|
+
var _react = require("react");
|
|
21
|
+
|
|
22
|
+
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
23
|
+
|
|
24
|
+
var _LogoImage = require("../../atoms/LogoImage");
|
|
25
|
+
|
|
26
|
+
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
27
|
+
|
|
28
|
+
var _variables = require("../../../global-files/variables");
|
|
29
|
+
|
|
30
|
+
var _GradientPanel = require("../../atoms/GradientPanel");
|
|
31
|
+
|
|
32
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
|
+
|
|
34
|
+
var ChangePassword = function ChangePassword(props) {
|
|
35
|
+
var _useState = (0, _react.useState)(false),
|
|
36
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
|
+
emptyPassword = _useState2[0],
|
|
38
|
+
setEmptyPassword = _useState2[1];
|
|
39
|
+
|
|
40
|
+
var _useState3 = (0, _react.useState)(false),
|
|
41
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
42
|
+
emptyConfirmPassword = _useState4[0],
|
|
43
|
+
setEmptyConfirmPassword = _useState4[1];
|
|
44
|
+
|
|
45
|
+
var _useState5 = (0, _react.useState)(true),
|
|
46
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
47
|
+
matchPasswords = _useState6[0],
|
|
48
|
+
setMatchPasswords = _useState6[1];
|
|
49
|
+
|
|
50
|
+
var validate = /*#__PURE__*/function () {
|
|
51
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
|
|
52
|
+
var password, confirmPassword, valid;
|
|
53
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
54
|
+
while (1) {
|
|
55
|
+
switch (_context.prev = _context.next) {
|
|
56
|
+
case 0:
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
password = document.querySelector("#newPasswordInput").value;
|
|
59
|
+
password.length < 8 ? setEmptyPassword(true) : setEmptyPassword(false);
|
|
60
|
+
confirmPassword = document.querySelector("#confirmPasswordInput").value;
|
|
61
|
+
confirmPassword === "" ? setEmptyConfirmPassword(true) : setEmptyConfirmPassword(false);
|
|
62
|
+
|
|
63
|
+
if (password === confirmPassword) {
|
|
64
|
+
setMatchPasswords(true);
|
|
65
|
+
} else {
|
|
66
|
+
setMatchPasswords(false);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
valid = true;
|
|
70
|
+
|
|
71
|
+
if (password.length < 8 || confirmPassword === "" || password !== confirmPassword) {
|
|
72
|
+
valid = false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (valid) {
|
|
76
|
+
sessionStorage.setItem("newPassword", JSON.stringify(password));
|
|
77
|
+
!sessionStorage.getItem("resetPasswordProcess") ? props.setPaso(9) : props.setPaso(11);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
case 9:
|
|
81
|
+
case "end":
|
|
82
|
+
return _context.stop();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, _callee);
|
|
86
|
+
}));
|
|
87
|
+
|
|
88
|
+
return function validate(_x) {
|
|
89
|
+
return _ref.apply(this, arguments);
|
|
90
|
+
};
|
|
91
|
+
}();
|
|
92
|
+
|
|
93
|
+
var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
94
|
+
className: "credenciales",
|
|
95
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
96
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
97
|
+
color: _variables.GlobalColors.s5,
|
|
98
|
+
text: "Ingresa tus credenciales"
|
|
99
|
+
})
|
|
100
|
+
}, "2"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoginPasswordStrength.LoginPasswordStrength, {
|
|
101
|
+
emptyPassword: emptyPassword,
|
|
102
|
+
emptyConfirmPassword: emptyConfirmPassword,
|
|
103
|
+
matchPasswords: matchPasswords,
|
|
104
|
+
textTittle: "Ingresa tus credenciales"
|
|
105
|
+
}, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
106
|
+
className: "button-center",
|
|
107
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
108
|
+
buttonType: "general-default-button",
|
|
109
|
+
label: "Enviar",
|
|
110
|
+
onClick: function onClick(e) {
|
|
111
|
+
return validate(e);
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
}, "4")];
|
|
115
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
116
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
|
|
117
|
+
panelColor: _variables.GlobalColors.white,
|
|
118
|
+
componentsArray: loginRight,
|
|
119
|
+
panelType: "home-login"
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
exports.ChangePassword = ChangePassword;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _templateObject;
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 50%;\n height: 100vh;\n .button-center {\n display: flex;\n justify-content: center;\n .general-default-button {\n width: 160px;\n }\n }\n"])));
|
|
17
|
+
|
|
18
|
+
exports.Container = Container;
|