@movalib/movalib-commons 1.1.67 → 1.1.69
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/src/MovaLogin.js
CHANGED
|
@@ -124,7 +124,7 @@ var MovaLogin = function (_a) {
|
|
|
124
124
|
newForm.email = (0, Tools_1.validateField)(form.email, Validator_1.validateEmail, 'Adresse email invalide');
|
|
125
125
|
}
|
|
126
126
|
if (movaAppType === Enums_1.MovaAppType.INDIVIDUAL) {
|
|
127
|
-
newForm.
|
|
127
|
+
newForm.phoneNumberEmail = (0, Tools_1.validateField)(form.phoneNumberEmail, function (value) { return !!value; }, 'Champ obligatoire');
|
|
128
128
|
}
|
|
129
129
|
newForm.password = (0, Tools_1.validateField)(form.password, function (value) { return !!value; }, 'Champ obligatoire');
|
|
130
130
|
// Validator pour le mot de passe
|
|
@@ -38,6 +38,10 @@ var VehiclePlateField = function (_a) {
|
|
|
38
38
|
}
|
|
39
39
|
}, [error, value, onValidVehiclePlate]);
|
|
40
40
|
var getPlateFormat = function (plate) {
|
|
41
|
+
if (plate === '') {
|
|
42
|
+
// Si la saisie est vide, retournez un format par défaut (nouveau format, par exemple)
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
41
45
|
if (/^[A-Za-z]/.test(plate)) {
|
|
42
46
|
// Commence par une lettre => nouveau format
|
|
43
47
|
return Enums_1.VehiclePlateFormat.FRENCH_NEW;
|
|
@@ -66,6 +70,10 @@ var VehiclePlateField = function (_a) {
|
|
|
66
70
|
handleChangeFrenchOld(inputValue);
|
|
67
71
|
break;
|
|
68
72
|
}
|
|
73
|
+
case undefined: {
|
|
74
|
+
setHelperText('');
|
|
75
|
+
setValue('');
|
|
76
|
+
}
|
|
69
77
|
}
|
|
70
78
|
};
|
|
71
79
|
var validatePlate = function () {
|
package/package.json
CHANGED
package/src/MovaLogin.tsx
CHANGED
|
@@ -99,7 +99,7 @@ const MovaLogin: FunctionComponent<MovaLoginProps> = ({ loading, movaAppType, on
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
if(movaAppType === MovaAppType.INDIVIDUAL){
|
|
102
|
-
newForm.
|
|
102
|
+
newForm.phoneNumberEmail = validateField(form.phoneNumberEmail, value => !!value, 'Champ obligatoire');
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
newForm.password = validateField(form.password, value => !!value, 'Champ obligatoire');
|
|
@@ -30,7 +30,12 @@ const VehiclePlateField: FunctionComponent<VehiclePlateFieldProps> = ({ onValidV
|
|
|
30
30
|
|
|
31
31
|
}, [error, value, onValidVehiclePlate]);
|
|
32
32
|
|
|
33
|
-
const getPlateFormat = (plate: string): VehiclePlateFormat => {
|
|
33
|
+
const getPlateFormat = (plate: string): VehiclePlateFormat | undefined => {
|
|
34
|
+
if (plate === '') {
|
|
35
|
+
// Si la saisie est vide, retournez un format par défaut (nouveau format, par exemple)
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
if (/^[A-Za-z]/.test(plate)) {
|
|
35
40
|
// Commence par une lettre => nouveau format
|
|
36
41
|
return VehiclePlateFormat.FRENCH_NEW;
|
|
@@ -62,6 +67,11 @@ const VehiclePlateField: FunctionComponent<VehiclePlateFieldProps> = ({ onValidV
|
|
|
62
67
|
handleChangeFrenchOld(inputValue);
|
|
63
68
|
break;
|
|
64
69
|
}
|
|
70
|
+
|
|
71
|
+
case undefined: {
|
|
72
|
+
setHelperText('');
|
|
73
|
+
setValue('');
|
|
74
|
+
}
|
|
65
75
|
}
|
|
66
76
|
|
|
67
77
|
};
|