contentoh-components-library 21.0.73 → 21.0.76
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/assets/images/editField/showPassword.png +0 -0
- package/dist/assets/images/sliderToolTip/infoIcon.svg +4 -0
- package/dist/assets/images/sliderToolTip/slide1.svg +5 -0
- package/dist/assets/images/sliderToolTip/slide2.svg +9 -0
- package/dist/assets/images/sliderToolTip/slide3.svg +9 -0
- package/dist/assets/images/sliderToolTip/slide4.svg +9 -0
- package/dist/assets/images/sliderToolTip/slide5.svg +40 -0
- package/dist/assets/images/verticalSideMenuMainPage/closeMenu.svg +4 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconFAQS.svg +12 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconGroup.svg +3 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconLogo.svg +12 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +15 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconProduct.svg +3 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +12 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconTask.svg +10 -0
- package/dist/assets/images/verticalSideMenuMainPage/openMenu.svg +4 -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 +303 -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 +22 -1
|
@@ -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.RegistrationThirdStep = 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 _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
+
|
|
30
|
+
var RegistrationThirdStep = function RegistrationThirdStep(props) {
|
|
31
|
+
var _useState = (0, _react.useState)(false),
|
|
32
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
|
+
emptyCommercialName = _useState2[0],
|
|
34
|
+
setEmptyCommercialName = _useState2[1];
|
|
35
|
+
|
|
36
|
+
var _useState3 = (0, _react.useState)(false),
|
|
37
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
38
|
+
emptyBussinesName = _useState4[0],
|
|
39
|
+
setEmptyBussinesName = _useState4[1];
|
|
40
|
+
|
|
41
|
+
var _useState5 = (0, _react.useState)(false),
|
|
42
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
43
|
+
emptyRFC = _useState6[0],
|
|
44
|
+
setEmptyRFC = _useState6[1];
|
|
45
|
+
|
|
46
|
+
var _useState7 = (0, _react.useState)(false),
|
|
47
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
48
|
+
emptyFiscalAddress = _useState8[0],
|
|
49
|
+
setEmptyFiscalAddress = _useState8[1];
|
|
50
|
+
|
|
51
|
+
var nuevoRegistro = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
|
|
52
|
+
|
|
53
|
+
var validate = function validate(e) {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
var valid = true;
|
|
56
|
+
var commercialName = document.querySelector("#commercialNameInput").value;
|
|
57
|
+
var bussinesName = document.querySelector("#bussinesNameInput").value;
|
|
58
|
+
var RFC = document.querySelector("#rfcInput").value;
|
|
59
|
+
var FiscalAddress = document.querySelector("#fiscalAddressInput").value;
|
|
60
|
+
commercialName === "" ? setEmptyCommercialName(true) : setEmptyCommercialName(false);
|
|
61
|
+
bussinesName === "" ? setEmptyBussinesName(true) : setEmptyBussinesName(false);
|
|
62
|
+
RFC === "" ? setEmptyRFC(true) : setEmptyRFC(false);
|
|
63
|
+
FiscalAddress === "" ? setEmptyFiscalAddress(true) : setEmptyFiscalAddress(false);
|
|
64
|
+
|
|
65
|
+
if (commercialName === "" || bussinesName === "" || RFC === "" || FiscalAddress === "") {
|
|
66
|
+
valid = false;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (valid) {
|
|
70
|
+
nuevoRegistro.commercialName = commercialName;
|
|
71
|
+
nuevoRegistro.companyName = bussinesName;
|
|
72
|
+
nuevoRegistro.rfc = RFC;
|
|
73
|
+
nuevoRegistro.adress = FiscalAddress;
|
|
74
|
+
sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoRegistro));
|
|
75
|
+
props.setPaso(props.paso + 1);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
80
|
+
className: "credenciales",
|
|
81
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
82
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
83
|
+
color: _variables.GlobalColors.s5,
|
|
84
|
+
text: "Ingresa tus credenciales"
|
|
85
|
+
})
|
|
86
|
+
}, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
87
|
+
className: "user",
|
|
88
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
89
|
+
inputType: "text",
|
|
90
|
+
inputId: "commercialNameInput",
|
|
91
|
+
label: "Nombre comercial",
|
|
92
|
+
inputPlaceHolder: "Nombre comercial"
|
|
93
|
+
}), emptyCommercialName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
94
|
+
children: "Ingrese el nombre comercial de la empresa"
|
|
95
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
96
|
+
inputType: "text",
|
|
97
|
+
inputId: "bussinesNameInput",
|
|
98
|
+
label: "Razón social",
|
|
99
|
+
inputPlaceHolder: "Razón social"
|
|
100
|
+
}), emptyBussinesName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
101
|
+
children: "Ingrese la raz\xF3n social de la empresa"
|
|
102
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
103
|
+
inputType: "text",
|
|
104
|
+
inputId: "rfcInput",
|
|
105
|
+
label: "RFC",
|
|
106
|
+
inputPlaceHolder: "RFC"
|
|
107
|
+
}), emptyRFC && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
108
|
+
children: "El RFC es requerido"
|
|
109
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
110
|
+
inputType: "text",
|
|
111
|
+
inputId: "fiscalAddressInput",
|
|
112
|
+
label: "Direccion fiscal",
|
|
113
|
+
inputPlaceHolder: "Dirección fiscal"
|
|
114
|
+
}), emptyFiscalAddress && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
115
|
+
children: "Ingrese la direccion fiscal de la empresa"
|
|
116
|
+
})]
|
|
117
|
+
}, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
118
|
+
className: "button-end",
|
|
119
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
120
|
+
buttonType: "general-default-button",
|
|
121
|
+
label: "Enviar",
|
|
122
|
+
onClick: function onClick(e) {
|
|
123
|
+
return validate(e);
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
}, "4"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
127
|
+
className: "progress-bar",
|
|
128
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
129
|
+
className: "progress-bar-step-check"
|
|
130
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
131
|
+
className: "progress-bar-registration"
|
|
132
|
+
})]
|
|
133
|
+
}, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
134
|
+
text: "Paso 3",
|
|
135
|
+
headerType: "date-header",
|
|
136
|
+
color: _variables.GlobalColors.s4
|
|
137
|
+
}, "6"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
138
|
+
className: "new-login",
|
|
139
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
140
|
+
className: "pre-registro",
|
|
141
|
+
children: ["\xBFYa tienes una cuenta?", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
142
|
+
children: " Inicia Sesi\xF3n"
|
|
143
|
+
})]
|
|
144
|
+
})
|
|
145
|
+
}, "7")];
|
|
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.RegistrationThirdStep = RegistrationThirdStep;
|
|
@@ -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: 100%;\n .user {\n .input-name-header {\n margin-top: 10px;\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-step-check {\n width: 66.66%;\n background-color: ", ";\n }\n .progress-bar-registration {\n background-color: rgb(196, 196, 196);\n width: 33.33%;\n }\n }\n .date-header {\n margin-left: 66.66%;\n .new-login {\n & + * {\n margin-top: 20px;\n }\n }\n }\n"])), _variables.GlobalColors.exported);
|
|
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.SignInLoginDefault = 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/SignInLogin",
|
|
18
|
+
component: _index.SignInLogin
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.SignInLogin, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var SignInLoginDefault = Template.bind({});
|
|
27
|
+
exports.SignInLoginDefault = SignInLoginDefault;
|
|
28
|
+
SignInLoginDefault.args = {};
|
|
@@ -0,0 +1,315 @@
|
|
|
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.SignInLogin = 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 _index = require("../../atoms/LogoImage/index");
|
|
19
|
+
|
|
20
|
+
var _index2 = require("../../atoms/ScreenHeader/index");
|
|
21
|
+
|
|
22
|
+
var _index3 = require("../../atoms/GeneralButton/index");
|
|
23
|
+
|
|
24
|
+
var _index4 = require("../../atoms/CheckBox/index");
|
|
25
|
+
|
|
26
|
+
var _TagAndInput = require("../TagAndInput");
|
|
27
|
+
|
|
28
|
+
var _variables = require("../../../global-files/variables");
|
|
29
|
+
|
|
30
|
+
var _react = require("react");
|
|
31
|
+
|
|
32
|
+
var _LogoLoading = require("../LogoLoading");
|
|
33
|
+
|
|
34
|
+
var _reactRouterDom = require("react-router-dom");
|
|
35
|
+
|
|
36
|
+
var _showPassword = _interopRequireDefault(require("../../../assets/images/editField/showPassword.png"));
|
|
37
|
+
|
|
38
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
39
|
+
|
|
40
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
41
|
+
|
|
42
|
+
var SignInLogin = function SignInLogin(props) {
|
|
43
|
+
var _useState = (0, _react.useState)(false),
|
|
44
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
45
|
+
emptyEmail = _useState2[0],
|
|
46
|
+
setEmptyEmail = _useState2[1];
|
|
47
|
+
|
|
48
|
+
var _useState3 = (0, _react.useState)(false),
|
|
49
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
50
|
+
invalidEmail = _useState4[0],
|
|
51
|
+
setInvalidEmail = _useState4[1];
|
|
52
|
+
|
|
53
|
+
var _useState5 = (0, _react.useState)(false),
|
|
54
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
55
|
+
emptyPassword = _useState6[0],
|
|
56
|
+
setEmptyPassword = _useState6[1];
|
|
57
|
+
|
|
58
|
+
var _useState7 = (0, _react.useState)(true),
|
|
59
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
60
|
+
showErrors = _useState8[0],
|
|
61
|
+
setShowErrors = _useState8[1];
|
|
62
|
+
|
|
63
|
+
var _useState9 = (0, _react.useState)(""),
|
|
64
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
65
|
+
signInError = _useState10[0],
|
|
66
|
+
setSignInError = _useState10[1];
|
|
67
|
+
|
|
68
|
+
var _useState11 = (0, _react.useState)(false),
|
|
69
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
70
|
+
loading = _useState12[0],
|
|
71
|
+
setLoading = _useState12[1];
|
|
72
|
+
|
|
73
|
+
var _useState13 = (0, _react.useState)(false),
|
|
74
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
75
|
+
upgradePlanRedirect = _useState14[0],
|
|
76
|
+
setUpgradePlanRedirect = _useState14[1];
|
|
77
|
+
|
|
78
|
+
var validate = /*#__PURE__*/function () {
|
|
79
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
|
|
80
|
+
var valid, email, password, session, userGroup, response, user, company;
|
|
81
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
82
|
+
while (1) {
|
|
83
|
+
switch (_context.prev = _context.next) {
|
|
84
|
+
case 0:
|
|
85
|
+
setSignInError("");
|
|
86
|
+
setShowErrors(true);
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
valid = true;
|
|
89
|
+
email = document.querySelector("#emailInput").value.trim();
|
|
90
|
+
password = document.querySelector("#passwordInput").value;
|
|
91
|
+
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
92
|
+
|
|
93
|
+
if (email === "") {
|
|
94
|
+
valid = false;
|
|
95
|
+
setEmptyEmail(true);
|
|
96
|
+
} else {
|
|
97
|
+
setEmptyEmail(false);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (password === "") {
|
|
101
|
+
valid = false;
|
|
102
|
+
setEmptyPassword(true);
|
|
103
|
+
} else {
|
|
104
|
+
setEmptyPassword(false);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!valid) {
|
|
108
|
+
_context.next = 32;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
_context.prev = 10;
|
|
113
|
+
setLoading(true);
|
|
114
|
+
_context.next = 14;
|
|
115
|
+
return props.Auth.signIn(email, password);
|
|
116
|
+
|
|
117
|
+
case 14:
|
|
118
|
+
session = _context.sent;
|
|
119
|
+
|
|
120
|
+
if (!(session.challengeName === "NEW_PASSWORD_REQUIRED")) {
|
|
121
|
+
_context.next = 20;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
props.setUser(session);
|
|
126
|
+
props.setPaso(8);
|
|
127
|
+
_context.next = 25;
|
|
128
|
+
break;
|
|
129
|
+
|
|
130
|
+
case 20:
|
|
131
|
+
userGroup = session.signInUserSession.accessToken.payload["cognito:groups"];
|
|
132
|
+
_context.next = 23;
|
|
133
|
+
return _axios.default.get(process.env.REACT_APP_USER_ENDPOINT, {
|
|
134
|
+
headers: {
|
|
135
|
+
Authorization: session.signInUserSession.idToken.jwtToken
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
case 23:
|
|
140
|
+
response = _context.sent;
|
|
141
|
+
|
|
142
|
+
if (userGroup[0] === props.users) {
|
|
143
|
+
sessionStorage.setItem("auth", true);
|
|
144
|
+
sessionStorage.setItem("jwt", session.signInUserSession.idToken.jwtToken);
|
|
145
|
+
user = JSON.parse(response.data.body).data[0];
|
|
146
|
+
company = JSON.parse(response.data.body).data[1];
|
|
147
|
+
caches.keys().then(function (names) {
|
|
148
|
+
names.forEach(function (name) {
|
|
149
|
+
caches.delete(name);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
user.src = "https://".concat(process.env.REACT_APP_IMAGES_PROFILE_BUCKET, ".s3.amazonaws.com/id-").concat(user.id_user, "/").concat(user.id_user, ".png?").concat(new Date().getTime());
|
|
153
|
+
sessionStorage.setItem("user", JSON.stringify(user));
|
|
154
|
+
sessionStorage.setItem("company", JSON.stringify(company));
|
|
155
|
+
setUpgradePlanRedirect(true);
|
|
156
|
+
} else {
|
|
157
|
+
setSignInError("NotAuthorizedException");
|
|
158
|
+
setLoading(false);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
case 25:
|
|
162
|
+
_context.next = 32;
|
|
163
|
+
break;
|
|
164
|
+
|
|
165
|
+
case 27:
|
|
166
|
+
_context.prev = 27;
|
|
167
|
+
_context.t0 = _context["catch"](10);
|
|
168
|
+
console.log(_context.t0.code);
|
|
169
|
+
setLoading(false);
|
|
170
|
+
|
|
171
|
+
if (_context.t0.code === "NotAuthorizedException") {
|
|
172
|
+
setSignInError("NotAuthorizedException");
|
|
173
|
+
} else if (_context.t0.code === "UserNotConfirmedException") {
|
|
174
|
+
sessionStorage.setItem("email", JSON.stringify(email));
|
|
175
|
+
props.setPaso(5);
|
|
176
|
+
} else {
|
|
177
|
+
setSignInError("Error");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
case 32:
|
|
181
|
+
case "end":
|
|
182
|
+
return _context.stop();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}, _callee, null, [[10, 27]]);
|
|
186
|
+
}));
|
|
187
|
+
|
|
188
|
+
return function validate(_x) {
|
|
189
|
+
return _ref.apply(this, arguments);
|
|
190
|
+
};
|
|
191
|
+
}();
|
|
192
|
+
|
|
193
|
+
(0, _react.useEffect)(function () {
|
|
194
|
+
sessionStorage.getItem("resetPasswordProcess") && sessionStorage.removeItem("resetPasswordProcess");
|
|
195
|
+
}, []);
|
|
196
|
+
(0, _react.useEffect)(function () {
|
|
197
|
+
if (upgradePlanRedirect) setLoading(false);
|
|
198
|
+
}, [upgradePlanRedirect]);
|
|
199
|
+
|
|
200
|
+
var closeEye = function closeEye(e) {
|
|
201
|
+
var input = document.getElementById("passwordInput");
|
|
202
|
+
var eye = document.getElementById("Eye");
|
|
203
|
+
|
|
204
|
+
if (input.type === "password") {
|
|
205
|
+
input.type = "text";
|
|
206
|
+
eye.style.opacity = 0.8;
|
|
207
|
+
} else {
|
|
208
|
+
input.type = "password";
|
|
209
|
+
eye.style.opacity = 0.2;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
return loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoLoading.LogoLoading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
214
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
215
|
+
className: "home-login",
|
|
216
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
217
|
+
className: "main-container",
|
|
218
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.LogoImage, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
219
|
+
className: "credenciales",
|
|
220
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.ScreenHeader, {
|
|
221
|
+
fontFamily: _variables.FontFamily.AvenirNext,
|
|
222
|
+
color: _variables.GlobalColors.s5,
|
|
223
|
+
text: "Ingresa tus credenciales"
|
|
224
|
+
})
|
|
225
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
226
|
+
className: "user",
|
|
227
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
228
|
+
inputType: "text",
|
|
229
|
+
label: "Nombre de usuario",
|
|
230
|
+
inputPlaceHolder: "username@contentoh.com",
|
|
231
|
+
inputId: "emailInput"
|
|
232
|
+
})
|
|
233
|
+
}), showErrors && emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
234
|
+
children: "Ingrese su correo"
|
|
235
|
+
}), invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
236
|
+
children: "Ingrese un correo v\xE1lido"
|
|
237
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
238
|
+
className: "password",
|
|
239
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
240
|
+
inputType: "password",
|
|
241
|
+
label: "Contraseña",
|
|
242
|
+
inputPlaceHolder: "Escribe tu contraseña",
|
|
243
|
+
inputId: "passwordInput"
|
|
244
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
245
|
+
src: _showPassword.default,
|
|
246
|
+
alt: "show password",
|
|
247
|
+
className: "icon",
|
|
248
|
+
id: "Eye",
|
|
249
|
+
onClick: function onClick(e) {
|
|
250
|
+
closeEye(e);
|
|
251
|
+
}
|
|
252
|
+
})]
|
|
253
|
+
}), showErrors && emptyPassword && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
254
|
+
children: "Ingrese su contrase\xF1a"
|
|
255
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
256
|
+
className: "select",
|
|
257
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.CheckBox, {
|
|
258
|
+
label: "Mantener sesión activada",
|
|
259
|
+
id: "chk-default",
|
|
260
|
+
className: "active-left"
|
|
261
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
262
|
+
onClick: function onClick() {
|
|
263
|
+
return props.setPaso(10);
|
|
264
|
+
},
|
|
265
|
+
className: "active-right",
|
|
266
|
+
children: "Olvide mi contrase\xF1a"
|
|
267
|
+
})]
|
|
268
|
+
}), showErrors && signInError === "NotAuthorizedException" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
269
|
+
children: "Correo o contrase\xF1a incorrectos"
|
|
270
|
+
}), showErrors && signInError === "Error" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
271
|
+
children: "Ha habido un problema al iniciar sesi\xF3n"
|
|
272
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
273
|
+
className: "button-right",
|
|
274
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Button, {
|
|
275
|
+
buttonType: "general-default-button",
|
|
276
|
+
label: "Iniciar sesión",
|
|
277
|
+
onClick: function onClick(e) {
|
|
278
|
+
return validate(e);
|
|
279
|
+
}
|
|
280
|
+
})
|
|
281
|
+
}), props.registration && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
282
|
+
className: "new-login",
|
|
283
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
284
|
+
className: "pre-registro",
|
|
285
|
+
onClick: function onClick() {
|
|
286
|
+
props.setPaso(1);
|
|
287
|
+
sessionStorage.setItem("nuevoRegistro", JSON.stringify({
|
|
288
|
+
name: "",
|
|
289
|
+
lastName: "",
|
|
290
|
+
email: "",
|
|
291
|
+
position: "",
|
|
292
|
+
country: "",
|
|
293
|
+
phone: "",
|
|
294
|
+
commercialName: "",
|
|
295
|
+
companyName: "",
|
|
296
|
+
rfc: "",
|
|
297
|
+
adress: ""
|
|
298
|
+
}));
|
|
299
|
+
sessionStorage.setItem("countryCode", JSON.stringify("+52"));
|
|
300
|
+
},
|
|
301
|
+
children: ["\xBFA\xFAn no tienes cuenta?", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
302
|
+
children: " Reg\xEDstrate"
|
|
303
|
+
})]
|
|
304
|
+
})
|
|
305
|
+
})]
|
|
306
|
+
})
|
|
307
|
+
}), upgradePlanRedirect && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Redirect, {
|
|
308
|
+
to: {
|
|
309
|
+
pathname: "/dashboard"
|
|
310
|
+
}
|
|
311
|
+
})]
|
|
312
|
+
});
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
exports.SignInLogin = SignInLogin;
|
|
@@ -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 background: \"white\";\n display: flex;\n height: 100vh;\n width: 50%;\n justify-content: center;\n align-items: center;\n label {\n color: red;\n margin-top: 3px;\n margin-left: 15px;\n font-family: ", ";\n font-size: 11px;\n & + * {\n margin-top: 12px;\n }\n }\n\n &.home-login {\n .credenciales {\n & + * {\n margin-top: 30px;\n }\n }\n .user {\n & + * {\n margin-top: 45px;\n }\n }\n .password {\n & + * {\n margin-top: 20px;\n }\n &:hover {\n border: 1px solid ", ";\n }\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n position: relative;\n width: 100%;\n border: 1px solid ", ";\n .input-container {\n h2 {\n position: absolute;\n top: -25px;\n left: 0;\n }\n }\n #passwordInput {\n width: 100%;\n background-color: white;\n position: absolute;\n top: 8px;\n left: 0;\n right: 0;\n bottom: 8px;\n box-sizing: border-box;\n border: none;\n }\n .icon {\n position: absolute;\n height: 60%;\n position: absolute;\n top: 50%;\n right: 8px;\n transform: translateY(-50%);\n opacity: 0.3;\n cursor: pointer;\n }\n .icon:hover {\n opacity: 0.8;\n }\n }\n .select {\n display: flex;\n justify-content: space-between;\n .active-right {\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n letter-spacing: -0.015em;\n color: ", ";\n cursor: pointer;\n }\n & + * {\n margin-top: 50px;\n }\n }\n .button-right {\n text-align: right;\n & + * {\n margin-top: 55px;\n }\n }\n .new-login {\n p {\n font-family: ", ";\n text-align: right;\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n color: ", ";\n cursor: pointer;\n span {\n color: ", ";\n }\n }\n }\n }\n .main-container {\n max-width: 80%;\n max-height: 80%;\n }\n"])), _variables.FontFamily.Raleway_700, _variables.GlobalColors.magenta_s2, _variables.GlobalColors.s2, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.GlobalColors.secondary_magenta);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -30,7 +30,8 @@ var TagAndInput = function TagAndInput(_ref) {
|
|
|
30
30
|
dinamicHeight = _ref.dinamicHeight,
|
|
31
31
|
inputCols = _ref.inputCols,
|
|
32
32
|
inputRows = _ref.inputRows,
|
|
33
|
-
maxChar = _ref.maxChar
|
|
33
|
+
maxChar = _ref.maxChar,
|
|
34
|
+
required = _ref.required;
|
|
34
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
35
36
|
inputType: inputType,
|
|
36
37
|
className: "input-container",
|
|
@@ -53,7 +54,8 @@ var TagAndInput = function TagAndInput(_ref) {
|
|
|
53
54
|
dinamicHeight: dinamicHeight,
|
|
54
55
|
inputCols: inputCols,
|
|
55
56
|
inputRows: inputRows,
|
|
56
|
-
maxChar: maxChar
|
|
57
|
+
maxChar: maxChar,
|
|
58
|
+
required: required
|
|
57
59
|
})]
|
|
58
60
|
}, "generalTagInput-".concat(inputType));
|
|
59
61
|
};
|
|
@@ -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.VerificationCodeResetPasswordLoginDefault = 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/VerificationCodeResetPasswordLogin",
|
|
18
|
+
component: _index.VerificationCodeResetPasswordLogin
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.VerificationCodeResetPasswordLogin, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var VerificationCodeResetPasswordLoginDefault = Template.bind({});
|
|
27
|
+
exports.VerificationCodeResetPasswordLoginDefault = VerificationCodeResetPasswordLoginDefault;
|
|
28
|
+
VerificationCodeResetPasswordLoginDefault.args = {};
|