@pelcro/react-pelcro-js 3.23.0-beta.1 → 3.23.0-beta.2
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.
- package/dist/index.cjs.js +9 -6
- package/dist/index.esm.js +9 -6
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -19621,12 +19621,12 @@ const CheckoutForm = () => {
|
|
|
19621
19621
|
className: "plc-w-6/12 plc-pr-4"
|
|
19622
19622
|
}, /*#__PURE__*/React__default['default'].createElement(MonthSelect, {
|
|
19623
19623
|
store: store$k,
|
|
19624
|
-
placeholder: "Exp Month"
|
|
19624
|
+
placeholder: "Exp Month *"
|
|
19625
19625
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19626
19626
|
className: "plc-w-6/12"
|
|
19627
19627
|
}, /*#__PURE__*/React__default['default'].createElement(YearSelect, {
|
|
19628
19628
|
store: store$k,
|
|
19629
|
-
placeholder: "Exp Year"
|
|
19629
|
+
placeholder: "Exp Year *"
|
|
19630
19630
|
}))));
|
|
19631
19631
|
}
|
|
19632
19632
|
if (cardProcessor === "stripe") {
|
|
@@ -19689,7 +19689,7 @@ const DiscountedPrice = props => {
|
|
|
19689
19689
|
};
|
|
19690
19690
|
|
|
19691
19691
|
const SubmitPaymentMethod = _ref => {
|
|
19692
|
-
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r;
|
|
19692
|
+
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
19693
19693
|
let {
|
|
19694
19694
|
onClick,
|
|
19695
19695
|
...otherProps
|
|
@@ -19715,13 +19715,16 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19715
19715
|
phone,
|
|
19716
19716
|
disableSubmit,
|
|
19717
19717
|
isLoading,
|
|
19718
|
-
updatedPrice
|
|
19718
|
+
updatedPrice,
|
|
19719
|
+
month,
|
|
19720
|
+
year
|
|
19719
19721
|
}
|
|
19720
19722
|
} = React.useContext(store$k);
|
|
19721
19723
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
19722
19724
|
const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
|
|
19723
19725
|
const priceFormatted = (plan === null || plan === void 0 ? void 0 : plan.type) === "donation" && (selectedDonationAmount || customDonationAmount) ? getFormattedPriceByLocal(selectedDonationAmount ? selectedDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity2 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity2 !== void 0 ? _plan$quantity2 : 1) : customDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity3 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity3 !== void 0 ? _plan$quantity3 : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage()) : getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
19724
19726
|
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
19727
|
+
const supportsCybersource = Boolean((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.cybersource_gateway_settings);
|
|
19725
19728
|
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
19726
19729
|
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
19727
19730
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
@@ -19730,9 +19733,9 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19730
19733
|
if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
|
|
19731
19734
|
setDisabled(disableSubmit);
|
|
19732
19735
|
} else {
|
|
19733
|
-
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError);
|
|
19736
|
+
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError || supportsCybersource && !(month !== null && month !== void 0 && month.length) || supportsCybersource && !(year !== null && year !== void 0 && year.length));
|
|
19734
19737
|
}
|
|
19735
|
-
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError]);
|
|
19738
|
+
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError, month, year]);
|
|
19736
19739
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
19737
19740
|
role: "submit",
|
|
19738
19741
|
className: "plc-w-full plc-py-3",
|
package/dist/index.esm.js
CHANGED
|
@@ -19591,12 +19591,12 @@ const CheckoutForm = () => {
|
|
|
19591
19591
|
className: "plc-w-6/12 plc-pr-4"
|
|
19592
19592
|
}, /*#__PURE__*/React__default.createElement(MonthSelect, {
|
|
19593
19593
|
store: store$k,
|
|
19594
|
-
placeholder: "Exp Month"
|
|
19594
|
+
placeholder: "Exp Month *"
|
|
19595
19595
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
19596
19596
|
className: "plc-w-6/12"
|
|
19597
19597
|
}, /*#__PURE__*/React__default.createElement(YearSelect, {
|
|
19598
19598
|
store: store$k,
|
|
19599
|
-
placeholder: "Exp Year"
|
|
19599
|
+
placeholder: "Exp Year *"
|
|
19600
19600
|
}))));
|
|
19601
19601
|
}
|
|
19602
19602
|
if (cardProcessor === "stripe") {
|
|
@@ -19659,7 +19659,7 @@ const DiscountedPrice = props => {
|
|
|
19659
19659
|
};
|
|
19660
19660
|
|
|
19661
19661
|
const SubmitPaymentMethod = _ref => {
|
|
19662
|
-
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r;
|
|
19662
|
+
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
19663
19663
|
let {
|
|
19664
19664
|
onClick,
|
|
19665
19665
|
...otherProps
|
|
@@ -19685,13 +19685,16 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19685
19685
|
phone,
|
|
19686
19686
|
disableSubmit,
|
|
19687
19687
|
isLoading,
|
|
19688
|
-
updatedPrice
|
|
19688
|
+
updatedPrice,
|
|
19689
|
+
month,
|
|
19690
|
+
year
|
|
19689
19691
|
}
|
|
19690
19692
|
} = useContext(store$k);
|
|
19691
19693
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
19692
19694
|
const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
|
|
19693
19695
|
const priceFormatted = (plan === null || plan === void 0 ? void 0 : plan.type) === "donation" && (selectedDonationAmount || customDonationAmount) ? getFormattedPriceByLocal(selectedDonationAmount ? selectedDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity2 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity2 !== void 0 ? _plan$quantity2 : 1) : customDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity3 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity3 !== void 0 ? _plan$quantity3 : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage()) : getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
19694
19696
|
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
19697
|
+
const supportsCybersource = Boolean((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.cybersource_gateway_settings);
|
|
19695
19698
|
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
19696
19699
|
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
19697
19700
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
@@ -19700,9 +19703,9 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19700
19703
|
if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
|
|
19701
19704
|
setDisabled(disableSubmit);
|
|
19702
19705
|
} else {
|
|
19703
|
-
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError);
|
|
19706
|
+
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError || supportsCybersource && !(month !== null && month !== void 0 && month.length) || supportsCybersource && !(year !== null && year !== void 0 && year.length));
|
|
19704
19707
|
}
|
|
19705
|
-
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError]);
|
|
19708
|
+
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError, month, year]);
|
|
19706
19709
|
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
19707
19710
|
role: "submit",
|
|
19708
19711
|
className: "plc-w-full plc-py-3",
|