contentoh-components-library 21.0.26 → 21.0.29
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/Loading/Loading.stories.js +28 -0
- package/dist/components/atoms/Loading/index.js +27 -0
- package/dist/components/atoms/Loading/styles.js +18 -0
- package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +28 -0
- package/dist/components/molecules/EmailResetPasswordLogin/index.js +155 -0
- package/dist/components/molecules/EmailResetPasswordLogin/styles.js +20 -0
- package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +28 -0
- package/dist/components/molecules/RegistrationFirstStep/index.js +336 -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 +156 -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 +161 -0
- package/dist/components/molecules/RegistrationThirdStep/styles.js +20 -0
- package/dist/components/molecules/SignInLogin/index.js +217 -67
- package/dist/components/molecules/SignInLogin/styles.js +1 -1
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +28 -0
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +104 -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 +113 -0
- package/dist/components/organisms/ChangePassword/styles.js +18 -0
- package/dist/index.js +138 -47
- package/package.json +5 -2
- package/src/components/atoms/Loading/Loading.stories.js +10 -0
- package/src/components/atoms/Loading/index.js +13 -0
- package/src/components/atoms/Loading/styles.js +57 -0
- package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +11 -0
- package/src/components/molecules/EmailResetPasswordLogin/index.js +86 -0
- package/src/components/molecules/EmailResetPasswordLogin/styles.js +23 -0
- package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +11 -0
- package/src/components/molecules/RegistrationFirstStep/index.js +242 -0
- package/src/components/molecules/RegistrationFirstStep/styles.js +81 -0
- package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +11 -0
- package/src/components/molecules/RegistrationSecondStep/index.js +97 -0
- package/src/components/molecules/RegistrationSecondStep/styles.js +59 -0
- package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +11 -0
- package/src/components/molecules/RegistrationThirdStep/index.js +109 -0
- package/src/components/molecules/RegistrationThirdStep/styles.js +44 -0
- package/src/components/molecules/SignInLogin/index.js +181 -55
- package/src/components/molecules/SignInLogin/styles.js +1 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +11 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +78 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +49 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +56 -0
- package/src/components/organisms/ChangePassword/ChangePassword.stories.js +11 -0
- package/src/components/organisms/ChangePassword/index.js +63 -0
- package/src/components/organisms/ChangePassword/styles.js +16 -0
- package/src/index.js +7 -0
|
@@ -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.LoadingDefault = 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/atoms/Loading",
|
|
18
|
+
component: _index.Loading
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Loading, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var LoadingDefault = Template.bind({});
|
|
27
|
+
exports.LoadingDefault = LoadingDefault;
|
|
28
|
+
LoadingDefault.args = {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Loading = void 0;
|
|
7
|
+
|
|
8
|
+
var _styles = require("./styles");
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
var Loading = function Loading() {
|
|
13
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
14
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
15
|
+
className: "loader",
|
|
16
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
17
|
+
className: "first"
|
|
18
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
19
|
+
className: "second"
|
|
20
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
21
|
+
className: "third"
|
|
22
|
+
})]
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.Loading = Loading;
|
|
@@ -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 display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n .loader {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\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
|
+
|
|
18
|
+
exports.Container = Container;
|
|
@@ -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.EmailResetPasswordLoginDefault = 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/molecules/EmailResetPasswordLogin",
|
|
18
|
+
component: _index.EmailResetPasswordLogin
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.EmailResetPasswordLogin, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var EmailResetPasswordLoginDefault = Template.bind({});
|
|
27
|
+
exports.EmailResetPasswordLoginDefault = EmailResetPasswordLoginDefault;
|
|
28
|
+
EmailResetPasswordLoginDefault.args = {};
|
|
@@ -0,0 +1,155 @@
|
|
|
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.EmailResetPasswordLogin = 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 _TagAndInput = require("../../molecules/TagAndInput");
|
|
29
|
+
|
|
30
|
+
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
31
|
+
|
|
32
|
+
var _awsAmplify = require("aws-amplify");
|
|
33
|
+
|
|
34
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
|
+
|
|
36
|
+
var EmailResetPasswordLogin = function EmailResetPasswordLogin(props) {
|
|
37
|
+
var _useState = (0, _react.useState)(false),
|
|
38
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
39
|
+
emptyEmail = _useState2[0],
|
|
40
|
+
setEmptyEmail = _useState2[1];
|
|
41
|
+
|
|
42
|
+
var _useState3 = (0, _react.useState)(false),
|
|
43
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
44
|
+
invalidEmail = _useState4[0],
|
|
45
|
+
setInvalidEmail = _useState4[1];
|
|
46
|
+
|
|
47
|
+
var _useState5 = (0, _react.useState)(false),
|
|
48
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
49
|
+
showErrors = _useState6[0],
|
|
50
|
+
setShowErrors = _useState6[1];
|
|
51
|
+
|
|
52
|
+
var _useState7 = (0, _react.useState)(""),
|
|
53
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
54
|
+
awsError = _useState8[0],
|
|
55
|
+
setAwsError = _useState8[1];
|
|
56
|
+
|
|
57
|
+
var validate = /*#__PURE__*/function () {
|
|
58
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
|
|
59
|
+
var valid, email;
|
|
60
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
61
|
+
while (1) {
|
|
62
|
+
switch (_context.prev = _context.next) {
|
|
63
|
+
case 0:
|
|
64
|
+
valid = true;
|
|
65
|
+
setShowErrors(true);
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
email = document.querySelector("#emailInput").value;
|
|
68
|
+
email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
|
|
69
|
+
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
70
|
+
emptyEmail && (valid = false);
|
|
71
|
+
invalidEmail && (valid = false);
|
|
72
|
+
|
|
73
|
+
if (!valid) {
|
|
74
|
+
_context.next = 20;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_context.prev = 9;
|
|
79
|
+
_context.next = 12;
|
|
80
|
+
return _awsAmplify.Auth.forgotPassword(email);
|
|
81
|
+
|
|
82
|
+
case 12:
|
|
83
|
+
sessionStorage.setItem("email", JSON.stringify(email));
|
|
84
|
+
sessionStorage.setItem("resetPasswordProcess", JSON.stringify("true"));
|
|
85
|
+
props.setPaso(5);
|
|
86
|
+
_context.next = 20;
|
|
87
|
+
break;
|
|
88
|
+
|
|
89
|
+
case 17:
|
|
90
|
+
_context.prev = 17;
|
|
91
|
+
_context.t0 = _context["catch"](9);
|
|
92
|
+
setAwsError(_context.t0.code);
|
|
93
|
+
|
|
94
|
+
case 20:
|
|
95
|
+
case "end":
|
|
96
|
+
return _context.stop();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, _callee, null, [[9, 17]]);
|
|
100
|
+
}));
|
|
101
|
+
|
|
102
|
+
return function validate(_x) {
|
|
103
|
+
return _ref.apply(this, arguments);
|
|
104
|
+
};
|
|
105
|
+
}();
|
|
106
|
+
|
|
107
|
+
var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
108
|
+
className: "credenciales",
|
|
109
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
110
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
111
|
+
color: _variables.GlobalColors.s5,
|
|
112
|
+
text: "Ingresa tus credenciales"
|
|
113
|
+
})
|
|
114
|
+
}, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
115
|
+
className: "user",
|
|
116
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
117
|
+
inputType: "text",
|
|
118
|
+
inputId: "emailInput",
|
|
119
|
+
label: "Nombre de usuario",
|
|
120
|
+
inputPlaceHolder: "username@contentoh.com"
|
|
121
|
+
}), showErrors && emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
122
|
+
children: "Ingrese su correo"
|
|
123
|
+
}), showErrors && invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
124
|
+
children: "Ingrese un correo valido"
|
|
125
|
+
}), showErrors && awsError === "LimitExceededException" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
126
|
+
children: "Has cambiado la contrase\xF1a recientemente, intenta despues"
|
|
127
|
+
})]
|
|
128
|
+
}, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
129
|
+
className: "button-center",
|
|
130
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
131
|
+
buttonType: "general-default-button",
|
|
132
|
+
label: "Enviar",
|
|
133
|
+
onClick: function onClick(e) {
|
|
134
|
+
return validate(e);
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
}, "4"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
138
|
+
className: "back-login",
|
|
139
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
140
|
+
onClick: function onClick() {
|
|
141
|
+
return props.setPaso(7);
|
|
142
|
+
},
|
|
143
|
+
children: "Regresar..."
|
|
144
|
+
})
|
|
145
|
+
}, "5")];
|
|
146
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
147
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
|
|
148
|
+
componentsArray: loginRight,
|
|
149
|
+
panelType: "home-login",
|
|
150
|
+
panelColor: _variables.GlobalColors.white
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
exports.EmailResetPasswordLogin = EmailResetPasswordLogin;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 50%;\n height: 100vh;\n .button-center {\n text-align: center;\n .general-default-button {\n width: 160px;\n }\n }\n .back-login {\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"])), _variables.GlobalColors.secondary_magenta, _variables.FontFamily.Raleway);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -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.RegistrationFirstStepDefault = 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/molecules/RegistrationFirstStep",
|
|
18
|
+
component: _index.RegistrationFirstStep
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.RegistrationFirstStep, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var RegistrationFirstStepDefault = Template.bind({});
|
|
27
|
+
exports.RegistrationFirstStepDefault = RegistrationFirstStepDefault;
|
|
28
|
+
RegistrationFirstStepDefault.args = {};
|
|
@@ -0,0 +1,336 @@
|
|
|
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.RegistrationFirstStep = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
|
|
14
|
+
var _GradientPanel = require("../../atoms/GradientPanel");
|
|
15
|
+
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
|
|
18
|
+
var _LogoImage = require("../../atoms/LogoImage");
|
|
19
|
+
|
|
20
|
+
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
21
|
+
|
|
22
|
+
var _variables = require("../../../global-files/variables");
|
|
23
|
+
|
|
24
|
+
var _TagAndInput = require("../../molecules/TagAndInput");
|
|
25
|
+
|
|
26
|
+
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
27
|
+
|
|
28
|
+
var _GeneralInput = require("../../atoms/GeneralInput");
|
|
29
|
+
|
|
30
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
|
+
|
|
32
|
+
var RegistrationFirstStep = function RegistrationFirstStep(props) {
|
|
33
|
+
var _useState = (0, _react.useState)(false),
|
|
34
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
|
+
emptyName = _useState2[0],
|
|
36
|
+
setEmptyName = _useState2[1];
|
|
37
|
+
|
|
38
|
+
var _useState3 = (0, _react.useState)(false),
|
|
39
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
40
|
+
emptyLastName = _useState4[0],
|
|
41
|
+
setEmptyLastName = _useState4[1];
|
|
42
|
+
|
|
43
|
+
var _useState5 = (0, _react.useState)(false),
|
|
44
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
45
|
+
emptyEmail = _useState6[0],
|
|
46
|
+
setEmptyEmail = _useState6[1];
|
|
47
|
+
|
|
48
|
+
var _useState7 = (0, _react.useState)(false),
|
|
49
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
50
|
+
emptyJob = _useState8[0],
|
|
51
|
+
setEmptyJob = _useState8[1];
|
|
52
|
+
|
|
53
|
+
var _useState9 = (0, _react.useState)(false),
|
|
54
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
55
|
+
emptyPhone = _useState10[0],
|
|
56
|
+
setEmptyPhone = _useState10[1];
|
|
57
|
+
|
|
58
|
+
var _useState11 = (0, _react.useState)(true),
|
|
59
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
60
|
+
emptyCountry = _useState12[0],
|
|
61
|
+
setEmptyCountry = _useState12[1];
|
|
62
|
+
|
|
63
|
+
var _useState13 = (0, _react.useState)(false),
|
|
64
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
65
|
+
showErrors = _useState14[0],
|
|
66
|
+
setShowErrors = _useState14[1];
|
|
67
|
+
|
|
68
|
+
var _useState15 = (0, _react.useState)(false),
|
|
69
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
70
|
+
regError = _useState16[0],
|
|
71
|
+
setRegError = _useState16[1];
|
|
72
|
+
|
|
73
|
+
var _useState17 = (0, _react.useState)(false),
|
|
74
|
+
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
75
|
+
phoneFormatError = _useState18[0],
|
|
76
|
+
setPhoneFormatError = _useState18[1];
|
|
77
|
+
|
|
78
|
+
var _useState19 = (0, _react.useState)(false),
|
|
79
|
+
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
80
|
+
emailFormatError = _useState20[0],
|
|
81
|
+
setEmailFormatError = _useState20[1];
|
|
82
|
+
|
|
83
|
+
(0, _react.useEffect)(function () {
|
|
84
|
+
JSON.parse(sessionStorage.getItem("nuevoRegistro")).name === "" && sessionStorage.removeItem("registrationError");
|
|
85
|
+
sessionStorage.getItem("registrationError") && setRegError(true);
|
|
86
|
+
|
|
87
|
+
if (sessionStorage.getItem("registrationError")) {
|
|
88
|
+
setEmptyName(false);
|
|
89
|
+
setEmptyLastName(false);
|
|
90
|
+
setEmptyEmail(false);
|
|
91
|
+
setEmptyJob(false);
|
|
92
|
+
setEmptyCountry(false);
|
|
93
|
+
setEmptyPhone(false);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
sessionStorage.getItem("resetPasswordProcess") && sessionStorage.getItem("resetPasswordProcess");
|
|
97
|
+
}, []);
|
|
98
|
+
var paisesEsp = ["Argentina", "Colombia", "Costa Rica", "Ecuador", "El Salvador", "Honduras", "México", "Panamá", "Perú"];
|
|
99
|
+
|
|
100
|
+
var updateInfo = function updateInfo(e, newValue) {
|
|
101
|
+
var nuevoUsuario = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
|
|
102
|
+
|
|
103
|
+
switch (e.target.id) {
|
|
104
|
+
case "nameInput":
|
|
105
|
+
nuevoUsuario.name = newValue;
|
|
106
|
+
newValue === "" ? setEmptyName(true) : setEmptyName(false);
|
|
107
|
+
break;
|
|
108
|
+
|
|
109
|
+
case "lastNameInput":
|
|
110
|
+
nuevoUsuario.lastName = newValue;
|
|
111
|
+
newValue === "" ? setEmptyLastName(true) : setEmptyLastName(false);
|
|
112
|
+
break;
|
|
113
|
+
|
|
114
|
+
case "emailInput":
|
|
115
|
+
nuevoUsuario.email = newValue;
|
|
116
|
+
newValue === "" ? setEmptyEmail(true) : setEmptyEmail(false);
|
|
117
|
+
|
|
118
|
+
if (!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(newValue)) {
|
|
119
|
+
setEmailFormatError(true);
|
|
120
|
+
} else {
|
|
121
|
+
setEmailFormatError(false);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
break;
|
|
125
|
+
|
|
126
|
+
case "jobInput":
|
|
127
|
+
nuevoUsuario.position = newValue;
|
|
128
|
+
newValue === "" ? setEmptyJob(true) : setEmptyJob(false);
|
|
129
|
+
break;
|
|
130
|
+
|
|
131
|
+
case "phoneInput":
|
|
132
|
+
Array.from(newValue).forEach(function (digit, i) {
|
|
133
|
+
newValue.charCodeAt(i) < 48 ? setPhoneFormatError(true) : setPhoneFormatError(false);
|
|
134
|
+
newValue.charCodeAt(i) > 57 ? setPhoneFormatError(true) : setPhoneFormatError(false);
|
|
135
|
+
});
|
|
136
|
+
nuevoUsuario.phone = "".concat(JSON.parse(sessionStorage.getItem("countryCodeSelect"))).concat(newValue);
|
|
137
|
+
newValue === "" ? setEmptyPhone(true) : setEmptyPhone(false);
|
|
138
|
+
break;
|
|
139
|
+
|
|
140
|
+
case "countrySelect":
|
|
141
|
+
nuevoUsuario.country = newValue;
|
|
142
|
+
newValue === "" || newValue === "Selecciona tu país" ? setEmptyCountry(true) : setEmptyCountry(false);
|
|
143
|
+
break;
|
|
144
|
+
|
|
145
|
+
case "countryCodeSelect":
|
|
146
|
+
sessionStorage.setItem("countryCode", JSON.stringify(newValue));
|
|
147
|
+
nuevoUsuario.phone = "".concat(JSON.parse(sessionStorage.getItem("countryCode"))).concat(document.querySelector("#phoneInput").value);
|
|
148
|
+
break;
|
|
149
|
+
|
|
150
|
+
default:
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoUsuario));
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
var validateForm = function validateForm(evt) {
|
|
158
|
+
var valid = true;
|
|
159
|
+
evt.preventDefault();
|
|
160
|
+
setShowErrors(true);
|
|
161
|
+
emptyName && (valid = false);
|
|
162
|
+
emptyLastName && (valid = false);
|
|
163
|
+
emptyEmail && (valid = false);
|
|
164
|
+
emptyJob && (valid = false);
|
|
165
|
+
emptyPhone && (valid = false);
|
|
166
|
+
emptyCountry && (valid = false);
|
|
167
|
+
phoneFormatError && (valid = false);
|
|
168
|
+
emailFormatError && (valid = false);
|
|
169
|
+
!regError && valid && props.setPaso(function (paso) {
|
|
170
|
+
return props.paso + 1;
|
|
171
|
+
});
|
|
172
|
+
regError && valid && props.setPaso(4);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
176
|
+
className: "credenciales",
|
|
177
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
178
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
179
|
+
color: _variables.GlobalColors.s5,
|
|
180
|
+
text: "Ingresa tus credenciales"
|
|
181
|
+
})
|
|
182
|
+
}, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
183
|
+
className: "user",
|
|
184
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
185
|
+
className: "name-registration-user",
|
|
186
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
187
|
+
inputType: "text",
|
|
188
|
+
inputId: "nameInput",
|
|
189
|
+
label: "Nombre",
|
|
190
|
+
inputPlaceHolder: "Nombre",
|
|
191
|
+
defaultValue: JSON.parse(sessionStorage.getItem("nuevoRegistro")).name,
|
|
192
|
+
required: true,
|
|
193
|
+
onInput: function onInput(e) {
|
|
194
|
+
return updateInfo(e, e.target.value);
|
|
195
|
+
}
|
|
196
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
197
|
+
inputType: "text",
|
|
198
|
+
inputId: "lastNameInput",
|
|
199
|
+
label: "Apellido",
|
|
200
|
+
inputPlaceHolder: "Apellido"
|
|
201
|
+
})]
|
|
202
|
+
}), emptyName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
203
|
+
children: "Ingrese su nombre"
|
|
204
|
+
}), emptyLastName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
205
|
+
children: "Ingrese sus apellidos"
|
|
206
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
207
|
+
inputType: "text",
|
|
208
|
+
inputId: "emailInput",
|
|
209
|
+
label: "Correo electrónico",
|
|
210
|
+
inputPlaceHolder: "username@contentoh.com"
|
|
211
|
+
}), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
212
|
+
children: "Ingrese su correo"
|
|
213
|
+
}), invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
214
|
+
children: "Ingrese un correo v\xE1lido"
|
|
215
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
216
|
+
inputType: "text",
|
|
217
|
+
inputId: "jobInput",
|
|
218
|
+
label: "Puesto laboral",
|
|
219
|
+
inputPlaceHolder: "Puesto dentro de la empresa"
|
|
220
|
+
}), emptyJob && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
221
|
+
children: "Ingrese su puesto"
|
|
222
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
223
|
+
text: "Teléfono",
|
|
224
|
+
headerType: "input-name-header"
|
|
225
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
226
|
+
className: "phone-registration-user",
|
|
227
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
228
|
+
name: "select",
|
|
229
|
+
className: "phone-options",
|
|
230
|
+
id: "countryCodeSelect",
|
|
231
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
232
|
+
children: "+52"
|
|
233
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
234
|
+
children: "+54"
|
|
235
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
236
|
+
children: "+57"
|
|
237
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
238
|
+
children: "+506"
|
|
239
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
240
|
+
children: "+593"
|
|
241
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
242
|
+
children: "+503"
|
|
243
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
244
|
+
children: "+504"
|
|
245
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
246
|
+
children: "+507"
|
|
247
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
248
|
+
children: "+51"
|
|
249
|
+
})]
|
|
250
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralInput.GeneralInput, {
|
|
251
|
+
inputId: "phoneInput",
|
|
252
|
+
inputType: "text",
|
|
253
|
+
inputPlaceholder: "Teléfono"
|
|
254
|
+
})]
|
|
255
|
+
}), emptyPhone && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
256
|
+
children: "Ingrese su n\xFAmero de tel\xE9fono"
|
|
257
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
258
|
+
text: "País",
|
|
259
|
+
headerType: "input-name-header"
|
|
260
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
261
|
+
name: "select",
|
|
262
|
+
className: "country-options",
|
|
263
|
+
id: "countrySelect",
|
|
264
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
265
|
+
value: "value1",
|
|
266
|
+
selected: true,
|
|
267
|
+
children: "Selecciona tu pa\xEDs"
|
|
268
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
269
|
+
value: "value2",
|
|
270
|
+
children: "Argentina"
|
|
271
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
272
|
+
value: "value3",
|
|
273
|
+
children: "Colombia"
|
|
274
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
275
|
+
value: "value2",
|
|
276
|
+
children: "Ecuador"
|
|
277
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
278
|
+
value: "value3",
|
|
279
|
+
children: "El Salvador"
|
|
280
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
281
|
+
value: "value2",
|
|
282
|
+
children: "Honduras"
|
|
283
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
284
|
+
value: "value3",
|
|
285
|
+
children: "M\xE9xico"
|
|
286
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
287
|
+
value: "value2",
|
|
288
|
+
children: "Panam\xE1"
|
|
289
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
290
|
+
value: "value3",
|
|
291
|
+
children: "Per\xFA"
|
|
292
|
+
})]
|
|
293
|
+
}), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
294
|
+
children: "Seleccione su pa\xEDs"
|
|
295
|
+
})]
|
|
296
|
+
}, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
297
|
+
className: "button-end",
|
|
298
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
299
|
+
buttonType: "general-default-button",
|
|
300
|
+
label: "Enviar",
|
|
301
|
+
onClick: function onClick(e) {
|
|
302
|
+
return validate(e);
|
|
303
|
+
}
|
|
304
|
+
})
|
|
305
|
+
}, "4"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
306
|
+
className: "progress-bar",
|
|
307
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
308
|
+
className: "progress-bar-first-step"
|
|
309
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
310
|
+
className: "progress-bar-registration"
|
|
311
|
+
})]
|
|
312
|
+
}, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
313
|
+
text: "Paso 1",
|
|
314
|
+
headerType: "date-header",
|
|
315
|
+
color: _variables.GlobalColors.s4
|
|
316
|
+
}, "6"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
317
|
+
className: "new-login",
|
|
318
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
319
|
+
className: "pre-registro",
|
|
320
|
+
children: ["\xBFYa tienes una cuenta?", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
321
|
+
children: " Inicia Sesi\xF3n"
|
|
322
|
+
})]
|
|
323
|
+
})
|
|
324
|
+
}, "7")];
|
|
325
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
326
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
327
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
|
|
328
|
+
componentsArray: loginRight,
|
|
329
|
+
panelType: "home-login",
|
|
330
|
+
panelColor: _variables.GlobalColors.white
|
|
331
|
+
})
|
|
332
|
+
})
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
exports.RegistrationFirstStep = RegistrationFirstStep;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 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"])), _variables.GlobalColors.s2, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.GlobalColors.magenta_s2);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|