@movalib/movalib-commons 1.1.63 → 1.1.64
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.
|
@@ -30,6 +30,7 @@ var MovaDialog_1 = __importDefault(require("./MovaDialog"));
|
|
|
30
30
|
var logo_large_png_1 = __importDefault(require("./assets/images/logo/logo_large.png"));
|
|
31
31
|
var logo_pro_large_png_1 = __importDefault(require("./assets/images/logo/logo_pro_large.png"));
|
|
32
32
|
var ConfirmationDialog_1 = __importDefault(require("./ConfirmationDialog"));
|
|
33
|
+
var Validator_1 = require("./helpers/Validator");
|
|
33
34
|
var initialFormState = {
|
|
34
35
|
password: { value: '', isValid: true },
|
|
35
36
|
confirmation: { value: '', isValid: true },
|
|
@@ -93,6 +94,10 @@ var AccountValidation = function (_a) {
|
|
|
93
94
|
var fieldName = e.target.name;
|
|
94
95
|
var fieldValue = e.target.value;
|
|
95
96
|
var newField = (_a = {}, _a[fieldName] = { value: fieldValue, isValid: true }, _a);
|
|
97
|
+
if (fieldName == "phoneNumber") {
|
|
98
|
+
if (!(0, Validator_1.validatePhoneNumber)(fieldValue))
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
96
101
|
setValidationForm(__assign(__assign({}, validationForm), newField));
|
|
97
102
|
}
|
|
98
103
|
};
|
|
@@ -141,7 +146,7 @@ var AccountValidation = function (_a) {
|
|
|
141
146
|
var handleOpenResendCode = function () {
|
|
142
147
|
setOpenPhoneNumberInput(true);
|
|
143
148
|
};
|
|
144
|
-
var
|
|
149
|
+
var controlPhoneNumber = function () {
|
|
145
150
|
var _a, _b, _c, _d, _e;
|
|
146
151
|
var newForm = validationForm;
|
|
147
152
|
var newField;
|
|
@@ -160,7 +165,7 @@ var AccountValidation = function (_a) {
|
|
|
160
165
|
};
|
|
161
166
|
var resendCode = function () {
|
|
162
167
|
var _a;
|
|
163
|
-
if (
|
|
168
|
+
if (controlPhoneNumber()) {
|
|
164
169
|
var req = {
|
|
165
170
|
phoneNumber: (_a = validationForm.phoneNumber) === null || _a === void 0 ? void 0 : _a.value
|
|
166
171
|
};
|
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@ import MovaDialog from './MovaDialog';
|
|
|
15
15
|
import LogoLarge from './assets/images/logo/logo_large.png';
|
|
16
16
|
import LogoProLarge from './assets/images/logo/logo_pro_large.png';
|
|
17
17
|
import ConfirmationDialog from './ConfirmationDialog';
|
|
18
|
+
import { validatePhoneNumber } from './helpers/Validator';
|
|
18
19
|
|
|
19
20
|
const initialFormState = {
|
|
20
21
|
password: { value: '', isValid: true },
|
|
@@ -98,6 +99,11 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
|
|
|
98
99
|
const fieldValue: string = e.target.value;
|
|
99
100
|
const newField: MovaFormField = { [fieldName]: { value: fieldValue, isValid: true } };
|
|
100
101
|
|
|
102
|
+
if (fieldName == "phoneNumber"){
|
|
103
|
+
if(!validatePhoneNumber(fieldValue))
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
setValidationForm({ ...validationForm, ...newField});
|
|
102
108
|
}
|
|
103
109
|
}
|
|
@@ -165,7 +171,7 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
|
|
|
165
171
|
setOpenPhoneNumberInput(true);
|
|
166
172
|
}
|
|
167
173
|
|
|
168
|
-
const
|
|
174
|
+
const controlPhoneNumber = ():boolean => {
|
|
169
175
|
|
|
170
176
|
let newForm: MovaValidationForm = validationForm;
|
|
171
177
|
let newField: MovaFormField;
|
|
@@ -187,7 +193,7 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
|
|
|
187
193
|
|
|
188
194
|
const resendCode = () => {
|
|
189
195
|
|
|
190
|
-
if(
|
|
196
|
+
if(controlPhoneNumber()){
|
|
191
197
|
|
|
192
198
|
let req = {
|
|
193
199
|
phoneNumber : validationForm.phoneNumber?.value
|