Repository URL to install this package:
|
Version:
2.7.6 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const mobx_1 = require("xmobx/mobx");
const exotic_1 = require("exotic");
class ShippingAddressFormState {
constructor() {
this.shippingAddress = {};
this.handleShippingAddressFormBlur = () => {
const {
validateForm,
state,
props
} = this.shippingAddress;
const {
onFormBlur,
hasBlurValidation
} = props;
if (hasBlurValidation === true) {
const isValidForm = validateForm();
if (isValidForm === true && exotic_1.isFunction(onFormBlur)) {
console.log('[Shipping Address] onBlur serialized data', state.toSerialized());
onFormBlur({
props,
state
});
}
}
};
}
setShippingAddressForm(form) {
this.shippingAddress = form;
console.log('[Shipping Address] setShippingAddressForm()', this);
}
}
tslib_1.__decorate([mobx_1.observable], ShippingAddressFormState.prototype, "shippingAddress", void 0);
tslib_1.__decorate([mobx_1.action], ShippingAddressFormState.prototype, "setShippingAddressForm", null);
tslib_1.__decorate([mobx_1.action.bound], ShippingAddressFormState.prototype, "handleShippingAddressFormBlur", void 0); // Object Creation
const shippingAddressFormState = new ShippingAddressFormState();
exports.shippingAddressFormState = shippingAddressFormState;
exports.default = shippingAddressFormState; //# sourceMappingURL=state.js.map