Repository URL to install this package:
|
Version:
2.8.4 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const exotic_1 = require("exotic");
const Empty_1 = require("../../../../atoms/Empty");
const PaymentCard_1 = require("../PaymentCard");
const styled_1 = require("./styled");
function defaultRenderHeaderView(props, state) {
const {
paymentCardDetails,
onRemovePaymentConfirm,
onRemovePaymentCancel
} = props,
remainingProps = tslib_1.__rest(props, ["paymentCardDetails", "onRemovePaymentConfirm", "onRemovePaymentCancel"]);
const paymentCardProps = Object.seal(Object.assign({}, paymentCardDetails, {
state,
onRemovePaymentConfirm,
onRemovePaymentCancel
}));
return react_1.default.createElement(PaymentCard_1.PaymentCard, Object.assign({
state: state
}, paymentCardProps, remainingProps));
}
exports.defaultRenderHeaderView = defaultRenderHeaderView;
function defaultRenderExpandableView(props, state) {
const {
paymentCardDetails,
editPaymentConfig,
onPaymentCancel,
onPaymentSubmit
} = props,
remainingProps = tslib_1.__rest(props, ["paymentCardDetails", "editPaymentConfig", "onPaymentCancel", "onPaymentSubmit"]);
const {
formConfig
} = paymentCardDetails,
remainingDetails = tslib_1.__rest(paymentCardDetails, ["formConfig"]);
const handlePaymentCancel = event => {
if (exotic_1.isFunction(onPaymentCancel)) {
onPaymentCancel(event);
}
state.handleToggle();
};
const handlePaymentSubmit = args => {
if (exotic_1.isFunction(onPaymentSubmit)) {
onPaymentSubmit(args);
}
state.handleToggle();
};
return react_1.default.createElement(styled_1.BillingAddressForm, Object.assign({
isEditPayment: true,
item: formConfig,
hasSubmitValidation: true,
onPaymentSubmit: handlePaymentSubmit,
onPaymentCancel: handlePaymentCancel
}, editPaymentConfig, remainingProps, remainingDetails));
}
exports.defaultRenderExpandableView = defaultRenderExpandableView;
function defaultRenderFooterView() {
return react_1.default.createElement(Empty_1.Empty, null);
}
exports.defaultRenderFooterView = defaultRenderFooterView; //# sourceMappingURL=renderProps.js.map