@movalib/movalib-commons 1.1.68 → 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.
|
@@ -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
|
@@ -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
|
};
|