Repository URL to install this package:
|
Version:
2.6.18 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const isValidTelephone_1 = tslib_1.__importDefault(require("../../../forms/deps/isValidTelephone"));
const isValidEmail_1 = tslib_1.__importDefault(require("../../../forms/deps/isValidEmail"));
const isValidPassword_1 = tslib_1.__importDefault(require("../../../forms/deps/isValidPassword"));
function blurMiddleware(event, props, state) {
const {
validationType,
doesMatchesUserName
} = props; // onFocus: handleFocus,
// onValidation: handleValidation,
if (validationType !== 'newPassword' && validationType !== 'confirmPassword' && validationType !== 'expirationMonth' && validationType !== 'expirationYear' && validationType !== 'month' && validationType !== 'year') {
state.validateInput();
if (validationType === 'telephone') {
// this.state.value = formatPhoneNumber(this.state.value)
const value = isValidTelephone_1.default(state.value); // this.state.setValue(value)
} else if (validationType === 'email') {
const value = isValidEmail_1.default(state.value); // this.state.setValue(value)
} else if (validationType === 'password') {
// console.log('Inside textbox', this)
const matchValue = doesMatchesUserName ? doesMatchesUserName(state) : false;
const value = !matchValue && isValidPassword_1.default(state.value); // this.state.setValue(value);
}
}
}
exports.blurMiddleware = blurMiddleware; //# sourceMappingURL=blurMiddleware.js.map