contentoh-components-library 21.0.4 → 21.0.7
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/CharCounter/CharCounter.stories.js +31 -0
- package/dist/components/atoms/CharCounter/index.js +22 -0
- package/dist/components/atoms/CharCounter/styles.js +20 -0
- package/dist/components/atoms/GeneralInput/index.js +78 -49
- package/dist/components/atoms/GeneralInput/styles.js +4 -1
- package/dist/components/atoms/GradientPanel/styles.js +2 -2
- package/dist/components/atoms/InputFormatter/index.js +132 -66
- package/dist/components/atoms/InputFormatter/styles.js +2 -2
- package/dist/components/atoms/ProgressBar/styles.js +1 -1
- package/dist/components/atoms/Select/index.js +4 -2
- package/dist/components/atoms/Select/style.js +1 -1
- package/dist/components/atoms/StatusTag/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +37 -0
- package/dist/components/molecules/CarouselImagesLogin/index.js +94 -0
- package/dist/components/molecules/CarouselImagesLogin/styles.js +21 -0
- package/dist/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +28 -0
- package/dist/components/molecules/LoginPasswordStrength/index.js +131 -0
- package/dist/components/molecules/LoginPasswordStrength/styles.js +78 -0
- package/dist/components/molecules/TagAndInput/index.js +4 -2
- package/dist/components/organisms/InputGroup/index.js +13 -11
- package/dist/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +38 -0
- package/dist/components/pages/ChangePasswordLogin/index.js +131 -0
- package/dist/components/pages/ChangePasswordLogin/styles.js +18 -0
- package/dist/components/pages/EmailResetPassword/EmailResetPassword.stories.js +37 -0
- package/dist/components/pages/EmailResetPassword/index.js +130 -0
- package/dist/components/pages/EmailResetPassword/styles.js +20 -0
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/dist/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +38 -0
- package/dist/components/pages/RegistrationLoginSecondStep/index.js +176 -0
- package/dist/components/pages/RegistrationLoginSecondStep/styles.js +20 -0
- package/dist/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginThirdStep/index.js +178 -0
- package/dist/components/pages/RegistrationLoginThirdStep/styles.js +20 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +18 -28
- package/dist/components/pages/RetailerProductEdition/index.js +105 -66
- package/dist/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +37 -0
- package/dist/components/pages/VerificationCodeResetPassword/index.js +121 -0
- package/dist/components/pages/VerificationCodeResetPassword/styles.js +20 -0
- package/dist/components/pages/VerificationCodeResetPassword/utils.js +69 -0
- package/package.json +2 -2
- package/src/assets/images/carouselImagesLogin/login2.svg +117 -0
- package/src/assets/images/carouselImagesLogin/login3.svg +147 -0
- package/src/assets/images/carouselImagesLogin/loginImage.svg +301 -0
- package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
- package/src/components/atoms/CharCounter/index.js +13 -0
- package/src/components/atoms/CharCounter/styles.js +10 -0
- package/src/components/atoms/GeneralInput/index.js +74 -50
- package/src/components/atoms/GeneralInput/styles.js +9 -0
- package/src/components/atoms/GradientPanel/styles.js +7 -1
- package/src/components/atoms/InputFormatter/index.js +109 -46
- package/src/components/atoms/InputFormatter/styles.js +6 -0
- package/src/components/atoms/ProgressBar/styles.js +2 -1
- package/src/components/atoms/Select/index.js +3 -1
- package/src/components/atoms/Select/style.js +1 -2
- package/src/components/atoms/StatusTag/styles.js +2 -1
- package/src/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +17 -0
- package/src/components/molecules/CarouselImagesLogin/index.js +68 -0
- package/src/components/molecules/CarouselImagesLogin/styles.js +60 -0
- package/src/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +8 -0
- package/src/components/molecules/LoginPasswordStrength/index.js +89 -0
- package/src/components/molecules/LoginPasswordStrength/styles.js +87 -0
- package/src/components/molecules/TagAndInput/index.js +2 -0
- package/src/components/organisms/InputGroup/index.js +25 -8
- package/src/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +18 -0
- package/src/components/pages/ChangePasswordLogin/index.js +78 -0
- package/src/components/pages/ChangePasswordLogin/styles.js +20 -0
- package/src/components/pages/EmailResetPassword/EmailResetPassword.stories.js +17 -0
- package/src/components/pages/EmailResetPassword/index.js +77 -0
- package/src/components/pages/EmailResetPassword/styles.js +27 -0
- package/src/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +17 -0
- package/src/components/pages/RegistrationLoginFirstStep/index.js +160 -0
- package/src/components/pages/RegistrationLoginFirstStep/styles.js +85 -0
- package/src/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +18 -0
- package/src/components/pages/RegistrationLoginSecondStep/index.js +111 -0
- package/src/components/pages/RegistrationLoginSecondStep/styles.js +64 -0
- package/src/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +17 -0
- package/src/components/pages/RegistrationLoginThirdStep/index.js +106 -0
- package/src/components/pages/RegistrationLoginThirdStep/styles.js +48 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +18 -29
- package/src/components/pages/RetailerProductEdition/index.js +84 -22
- package/src/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +17 -0
- package/src/components/pages/VerificationCodeResetPassword/index.js +92 -0
- package/src/components/pages/VerificationCodeResetPassword/styles.js +54 -0
- package/src/components/pages/VerificationCodeResetPassword/utils.js +56 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {event} e event received triggered by verification code input
|
|
4
|
+
* @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
|
|
5
|
+
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
|
|
6
|
+
*/
|
|
7
|
+
export const validateInput = (e, index, inputsArray) => {
|
|
8
|
+
let isValid = false;
|
|
9
|
+
const inputNotEmpty = e.target.value.length > 0;
|
|
10
|
+
if (inputNotEmpty) {
|
|
11
|
+
if (validateInputNumber(e) !== null) {
|
|
12
|
+
isValid = true;
|
|
13
|
+
nextInputFocus(inputsArray, index++);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return isValid ? e.target.value : "";
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param {event} e event received triggered by verification code input
|
|
22
|
+
* @returns {boolean} if digit is a number
|
|
23
|
+
*/
|
|
24
|
+
const validateInputNumber = (e) => {
|
|
25
|
+
return (e.target.value || String.fromCharCode(e.keyCode)).match(/[0-9]{1}/);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
|
|
31
|
+
* @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
|
|
32
|
+
* changes focus to next input if digit typed is a number and there wasn't any before
|
|
33
|
+
*/
|
|
34
|
+
const nextInputFocus = (inputsArray, index) => {
|
|
35
|
+
const button = document.getElementsByClassName("general-default-button");
|
|
36
|
+
|
|
37
|
+
inputsArray?.length && index === inputsArray?.length
|
|
38
|
+
? button[0].focus()
|
|
39
|
+
: inputsArray[index]?.focus();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param {array<html nodes>} inputsArray array which contains every VC digit input (used to check if there's any empty)
|
|
45
|
+
* @param {function} setEmptyVerificationCode function to update flag which handles if there's an empty char
|
|
46
|
+
* updates emptyVerificationFlag from father component
|
|
47
|
+
*/
|
|
48
|
+
export const validate = (inputsArray, setEmptyVerificationCode) => {
|
|
49
|
+
let contInputEmpty = 0;
|
|
50
|
+
inputsArray.forEach((element) => {
|
|
51
|
+
element.value === "" ? 0 : contInputEmpty++;
|
|
52
|
+
});
|
|
53
|
+
contInputEmpty === inputsArray.length
|
|
54
|
+
? setEmptyVerificationCode(false)
|
|
55
|
+
: setEmptyVerificationCode(true);
|
|
56
|
+
};
|