@pelcro/react-pelcro-js 4.0.0-alpha.81 → 4.0.0-alpha.82
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 +97 -16
- package/dist/index.esm.js +97 -16
- package/dist/pelcro.css +93 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -26858,7 +26858,7 @@ function PaymentMethodView({
|
|
|
26858
26858
|
showApplePayButton,
|
|
26859
26859
|
order
|
|
26860
26860
|
}) {
|
|
26861
|
-
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3
|
|
26861
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
26862
26862
|
|
|
26863
26863
|
const {
|
|
26864
26864
|
t
|
|
@@ -26872,15 +26872,7 @@ function PaymentMethodView({
|
|
|
26872
26872
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
26873
26873
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
26874
26874
|
className: "plc-flex plc-flex-col plc-items-center plc-mt-4 plc-px-8 md:plc-px-0 pelcro-payment-block"
|
|
26875
|
-
},
|
|
26876
|
-
className: "plc-w-full plc-p-2 plc-mb-4 plc-font-semibold plc-text-center plc-text-gray-900 plc-bg-gray-100 plc-border plc-border-gray-200"
|
|
26877
|
-
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
26878
|
-
className: "plc-text-gray-600"
|
|
26879
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
26880
|
-
className: "plc-tracking-wider plc-uppercase"
|
|
26881
|
-
}, t("labels.amount")), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
26882
|
-
className: "plc-text-xl plc-font-semibold plc-text-primary-600"
|
|
26883
|
-
}, (_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
26875
|
+
}, cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
26884
26876
|
className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50 pelcro-stripe-compliance"
|
|
26885
26877
|
}, /*#__PURE__*/React__default['default'].createElement(SvgLock, {
|
|
26886
26878
|
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
@@ -33054,21 +33046,109 @@ const OrderCreateContainer = props => /*#__PURE__*/React__default['default'].cre
|
|
|
33054
33046
|
className: "pelcro-order-create-container"
|
|
33055
33047
|
}, props));
|
|
33056
33048
|
|
|
33049
|
+
const OrderCreateSummary = ({
|
|
33050
|
+
order
|
|
33051
|
+
}) => {
|
|
33052
|
+
var _calcAndFormatItemsTo, _order$;
|
|
33053
|
+
|
|
33054
|
+
const items = (order === null || order === void 0 ? void 0 : order.length) > 1 ? order : [order];
|
|
33055
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33056
|
+
className: "plc-px-8 md:plc-px-0"
|
|
33057
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33058
|
+
className: "plc-mx-auto plc-w-full"
|
|
33059
|
+
}, /*#__PURE__*/React__default['default'].createElement("h2", {
|
|
33060
|
+
className: "plc-font-semibold"
|
|
33061
|
+
}, "Order summary"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33062
|
+
className: "plc-flow-root plc-mt-4"
|
|
33063
|
+
}, /*#__PURE__*/React__default['default'].createElement("ul", {
|
|
33064
|
+
role: "list",
|
|
33065
|
+
className: "plc-divide-y plc-divide-gray-200 plc-overflow-y-auto plc-max-h-checkout"
|
|
33066
|
+
}, items.map(item => {
|
|
33067
|
+
return /*#__PURE__*/React__default['default'].createElement("li", {
|
|
33068
|
+
key: item === null || item === void 0 ? void 0 : item.id,
|
|
33069
|
+
className: "plc-flex plc-space-x-6 plc-py-6"
|
|
33070
|
+
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
33071
|
+
alt: "order item image",
|
|
33072
|
+
src: item === null || item === void 0 ? void 0 : item.image,
|
|
33073
|
+
className: "plc-h-24 plc-w-24 plc-flex-none plc-rounded-md plc-bg-gray-100 plc-object-cover plc-object-center"
|
|
33074
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33075
|
+
className: "plc-flex-auto"
|
|
33076
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33077
|
+
className: "plc-space-y-1 sm:plc-flex sm:plc-items-start sm:plc-justify-between sm:plc-space-x-6"
|
|
33078
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33079
|
+
className: "plc-flex-auto plc-space-y-1 plc-text-sm plc-font-medium"
|
|
33080
|
+
}, /*#__PURE__*/React__default['default'].createElement("h3", {
|
|
33081
|
+
className: "plc-text-gray-900"
|
|
33082
|
+
}, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33083
|
+
className: "plc-hidden plc-text-gray-500 sm:plc-block"
|
|
33084
|
+
}, "quantity: ", item === null || item === void 0 ? void 0 : item.quantity)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33085
|
+
className: "plc-flex plc-flex-none plc-space-x-4"
|
|
33086
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33087
|
+
className: "plc-text-gray-900"
|
|
33088
|
+
}, item && calcAndFormatItemsTotal([item], item === null || item === void 0 ? void 0 : item.currency))))));
|
|
33089
|
+
})))), /*#__PURE__*/React__default['default'].createElement("dl", {
|
|
33090
|
+
className: "plc-mt-6 plc-space-y-6 plc-text-sm plc-font-medium plc-text-gray-500"
|
|
33091
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33092
|
+
className: "plc-flex plc-justify-between plc-border-t plc-border-gray-200 plc-pt-6 plc-text-gray-900"
|
|
33093
|
+
}, /*#__PURE__*/React__default['default'].createElement("dt", {
|
|
33094
|
+
className: "plc-text-base"
|
|
33095
|
+
}, "Total"), /*#__PURE__*/React__default['default'].createElement("dd", {
|
|
33096
|
+
className: "plc-text-base"
|
|
33097
|
+
}, order && ((_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage()))))));
|
|
33098
|
+
};
|
|
33099
|
+
|
|
33057
33100
|
const OrderCreateView = props => {
|
|
33058
|
-
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
33101
|
+
var _window$Pelcro, _window$Pelcro$uiSett, _window$Pelcro$user$r, _window, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro$user$r2, _window2, _window2$Pelcro, _window2$Pelcro$user, _addresses$find, _addresses$find2;
|
|
33059
33102
|
|
|
33060
|
-
useTranslation("payment");
|
|
33061
33103
|
const {
|
|
33062
|
-
|
|
33104
|
+
t
|
|
33105
|
+
} = useTranslation("checkoutForm");
|
|
33106
|
+
const {
|
|
33107
|
+
order,
|
|
33108
|
+
selectedAddressId
|
|
33063
33109
|
} = usePelcro();
|
|
33064
33110
|
const skipPayment = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.skipPaymentForFreePlans;
|
|
33065
33111
|
const showOrderButton = skipPayment && ((order === null || order === void 0 ? void 0 : order.price) === 0 || (order === null || order === void 0 ? void 0 : order.length) > 0 && order.every(item => (item === null || item === void 0 ? void 0 : item.price) === 0));
|
|
33112
|
+
const {
|
|
33113
|
+
addresses
|
|
33114
|
+
} = (_window$Pelcro$user$r = (_window = window) === null || _window === void 0 ? void 0 : (_window$Pelcro2 = _window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.read()) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
33115
|
+
const user = (_window$Pelcro$user$r2 = (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$Pelcro = _window2.Pelcro) === null || _window2$Pelcro === void 0 ? void 0 : (_window2$Pelcro$user = _window2$Pelcro.user) === null || _window2$Pelcro$user === void 0 ? void 0 : _window2$Pelcro$user.read()) !== null && _window$Pelcro$user$r2 !== void 0 ? _window$Pelcro$user$r2 : [];
|
|
33116
|
+
const address = selectedAddressId ? (_addresses$find = addresses === null || addresses === void 0 ? void 0 : addresses.find(address => address.id == selectedAddressId)) !== null && _addresses$find !== void 0 ? _addresses$find : null : (_addresses$find2 = addresses === null || addresses === void 0 ? void 0 : addresses.find(address => address.type == "shipping" && address.is_default)) !== null && _addresses$find2 !== void 0 ? _addresses$find2 : null;
|
|
33066
33117
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33067
|
-
id: "pelcro-order-create-view"
|
|
33068
|
-
|
|
33118
|
+
id: "pelcro-order-create-view",
|
|
33119
|
+
className: "plc-grid plc-grid-cols-1 md:plc-grid-cols-2 plc-gap-20"
|
|
33120
|
+
}, /*#__PURE__*/React__default['default'].createElement(OrderCreateSummary, {
|
|
33121
|
+
order: order
|
|
33122
|
+
}), /*#__PURE__*/React__default['default'].createElement("form", {
|
|
33069
33123
|
action: "javascript:void(0);",
|
|
33070
33124
|
className: "plc-mt-2 pelcro-form"
|
|
33071
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
33125
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33126
|
+
className: "plc-flex plc-flex-row plc-justify-between plc-px-8 md:plc-px-0"
|
|
33127
|
+
}, address && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33128
|
+
className: "pelcro-select-address-radio plc-order-2",
|
|
33129
|
+
id: `pelcro-address-select-${address === null || address === void 0 ? void 0 : address.id}`,
|
|
33130
|
+
name: "address"
|
|
33131
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33132
|
+
className: "pelcro-address-name plc-font-semibold"
|
|
33133
|
+
}, t("labels.shippingAddress")), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33134
|
+
className: "pelcro-address-company"
|
|
33135
|
+
}, address === null || address === void 0 ? void 0 : address.company), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33136
|
+
className: "pelcro-address-name plc-text-sm plc-mt-1"
|
|
33137
|
+
}, address === null || address === void 0 ? void 0 : address.first_name, " ", address === null || address === void 0 ? void 0 : address.last_name), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33138
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
33139
|
+
}, address === null || address === void 0 ? void 0 : address.line1), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33140
|
+
className: "pelcro-address-country plc-text-sm"
|
|
33141
|
+
}, address === null || address === void 0 ? void 0 : address.city, ", ", address === null || address === void 0 ? void 0 : address.state, " ", address === null || address === void 0 ? void 0 : address.postal_code, ", ", address === null || address === void 0 ? void 0 : address.country))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33142
|
+
className: "pelcro-select-address-radio plc-order-2",
|
|
33143
|
+
id: `pelcro-address-select-${address === null || address === void 0 ? void 0 : address.id}`,
|
|
33144
|
+
name: "address"
|
|
33145
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33146
|
+
className: "pelcro-address-name plc-font-semibold"
|
|
33147
|
+
}, t("labels.contactDetails")), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33148
|
+
className: "pelcro-address-name plc-text-sm plc-mt-1"
|
|
33149
|
+
}, user.email), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
33150
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
33151
|
+
}, address === null || address === void 0 ? void 0 : address.phone))), /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, Object.assign({
|
|
33072
33152
|
type: "orderCreate",
|
|
33073
33153
|
showCoupon: true,
|
|
33074
33154
|
showExternalPaymentMethods: false,
|
|
@@ -33099,6 +33179,7 @@ const OrderCreateModal = ({
|
|
|
33099
33179
|
|
|
33100
33180
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
33101
33181
|
id: "pelcro-order-create-modal",
|
|
33182
|
+
className: "plc-max-w-7xl",
|
|
33102
33183
|
onDisplay: onDisplay,
|
|
33103
33184
|
onClose: onClose
|
|
33104
33185
|
}, /*#__PURE__*/React__default['default'].createElement(ModalHeader, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
package/dist/index.esm.js
CHANGED
|
@@ -26828,7 +26828,7 @@ function PaymentMethodView({
|
|
|
26828
26828
|
showApplePayButton,
|
|
26829
26829
|
order
|
|
26830
26830
|
}) {
|
|
26831
|
-
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3
|
|
26831
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
26832
26832
|
|
|
26833
26833
|
const {
|
|
26834
26834
|
t
|
|
@@ -26842,15 +26842,7 @@ function PaymentMethodView({
|
|
|
26842
26842
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
26843
26843
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
26844
26844
|
className: "plc-flex plc-flex-col plc-items-center plc-mt-4 plc-px-8 md:plc-px-0 pelcro-payment-block"
|
|
26845
|
-
},
|
|
26846
|
-
className: "plc-w-full plc-p-2 plc-mb-4 plc-font-semibold plc-text-center plc-text-gray-900 plc-bg-gray-100 plc-border plc-border-gray-200"
|
|
26847
|
-
}, /*#__PURE__*/React__default.createElement("p", {
|
|
26848
|
-
className: "plc-text-gray-600"
|
|
26849
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
26850
|
-
className: "plc-tracking-wider plc-uppercase"
|
|
26851
|
-
}, t("labels.amount")), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
|
|
26852
|
-
className: "plc-text-xl plc-font-semibold plc-text-primary-600"
|
|
26853
|
-
}, (_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default.createElement("div", {
|
|
26845
|
+
}, cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default.createElement("div", {
|
|
26854
26846
|
className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50 pelcro-stripe-compliance"
|
|
26855
26847
|
}, /*#__PURE__*/React__default.createElement(SvgLock, {
|
|
26856
26848
|
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
@@ -33024,21 +33016,109 @@ const OrderCreateContainer = props => /*#__PURE__*/React__default.createElement(
|
|
|
33024
33016
|
className: "pelcro-order-create-container"
|
|
33025
33017
|
}, props));
|
|
33026
33018
|
|
|
33019
|
+
const OrderCreateSummary = ({
|
|
33020
|
+
order
|
|
33021
|
+
}) => {
|
|
33022
|
+
var _calcAndFormatItemsTo, _order$;
|
|
33023
|
+
|
|
33024
|
+
const items = (order === null || order === void 0 ? void 0 : order.length) > 1 ? order : [order];
|
|
33025
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
33026
|
+
className: "plc-px-8 md:plc-px-0"
|
|
33027
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
33028
|
+
className: "plc-mx-auto plc-w-full"
|
|
33029
|
+
}, /*#__PURE__*/React__default.createElement("h2", {
|
|
33030
|
+
className: "plc-font-semibold"
|
|
33031
|
+
}, "Order summary"), /*#__PURE__*/React__default.createElement("div", {
|
|
33032
|
+
className: "plc-flow-root plc-mt-4"
|
|
33033
|
+
}, /*#__PURE__*/React__default.createElement("ul", {
|
|
33034
|
+
role: "list",
|
|
33035
|
+
className: "plc-divide-y plc-divide-gray-200 plc-overflow-y-auto plc-max-h-checkout"
|
|
33036
|
+
}, items.map(item => {
|
|
33037
|
+
return /*#__PURE__*/React__default.createElement("li", {
|
|
33038
|
+
key: item === null || item === void 0 ? void 0 : item.id,
|
|
33039
|
+
className: "plc-flex plc-space-x-6 plc-py-6"
|
|
33040
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
33041
|
+
alt: "order item image",
|
|
33042
|
+
src: item === null || item === void 0 ? void 0 : item.image,
|
|
33043
|
+
className: "plc-h-24 plc-w-24 plc-flex-none plc-rounded-md plc-bg-gray-100 plc-object-cover plc-object-center"
|
|
33044
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
33045
|
+
className: "plc-flex-auto"
|
|
33046
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
33047
|
+
className: "plc-space-y-1 sm:plc-flex sm:plc-items-start sm:plc-justify-between sm:plc-space-x-6"
|
|
33048
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
33049
|
+
className: "plc-flex-auto plc-space-y-1 plc-text-sm plc-font-medium"
|
|
33050
|
+
}, /*#__PURE__*/React__default.createElement("h3", {
|
|
33051
|
+
className: "plc-text-gray-900"
|
|
33052
|
+
}, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default.createElement("p", {
|
|
33053
|
+
className: "plc-hidden plc-text-gray-500 sm:plc-block"
|
|
33054
|
+
}, "quantity: ", item === null || item === void 0 ? void 0 : item.quantity)), /*#__PURE__*/React__default.createElement("div", {
|
|
33055
|
+
className: "plc-flex plc-flex-none plc-space-x-4"
|
|
33056
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
33057
|
+
className: "plc-text-gray-900"
|
|
33058
|
+
}, item && calcAndFormatItemsTotal([item], item === null || item === void 0 ? void 0 : item.currency))))));
|
|
33059
|
+
})))), /*#__PURE__*/React__default.createElement("dl", {
|
|
33060
|
+
className: "plc-mt-6 plc-space-y-6 plc-text-sm plc-font-medium plc-text-gray-500"
|
|
33061
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
33062
|
+
className: "plc-flex plc-justify-between plc-border-t plc-border-gray-200 plc-pt-6 plc-text-gray-900"
|
|
33063
|
+
}, /*#__PURE__*/React__default.createElement("dt", {
|
|
33064
|
+
className: "plc-text-base"
|
|
33065
|
+
}, "Total"), /*#__PURE__*/React__default.createElement("dd", {
|
|
33066
|
+
className: "plc-text-base"
|
|
33067
|
+
}, order && ((_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage()))))));
|
|
33068
|
+
};
|
|
33069
|
+
|
|
33027
33070
|
const OrderCreateView = props => {
|
|
33028
|
-
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
33071
|
+
var _window$Pelcro, _window$Pelcro$uiSett, _window$Pelcro$user$r, _window, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro$user$r2, _window2, _window2$Pelcro, _window2$Pelcro$user, _addresses$find, _addresses$find2;
|
|
33029
33072
|
|
|
33030
|
-
useTranslation("payment");
|
|
33031
33073
|
const {
|
|
33032
|
-
|
|
33074
|
+
t
|
|
33075
|
+
} = useTranslation("checkoutForm");
|
|
33076
|
+
const {
|
|
33077
|
+
order,
|
|
33078
|
+
selectedAddressId
|
|
33033
33079
|
} = usePelcro();
|
|
33034
33080
|
const skipPayment = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.skipPaymentForFreePlans;
|
|
33035
33081
|
const showOrderButton = skipPayment && ((order === null || order === void 0 ? void 0 : order.price) === 0 || (order === null || order === void 0 ? void 0 : order.length) > 0 && order.every(item => (item === null || item === void 0 ? void 0 : item.price) === 0));
|
|
33082
|
+
const {
|
|
33083
|
+
addresses
|
|
33084
|
+
} = (_window$Pelcro$user$r = (_window = window) === null || _window === void 0 ? void 0 : (_window$Pelcro2 = _window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.read()) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
33085
|
+
const user = (_window$Pelcro$user$r2 = (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$Pelcro = _window2.Pelcro) === null || _window2$Pelcro === void 0 ? void 0 : (_window2$Pelcro$user = _window2$Pelcro.user) === null || _window2$Pelcro$user === void 0 ? void 0 : _window2$Pelcro$user.read()) !== null && _window$Pelcro$user$r2 !== void 0 ? _window$Pelcro$user$r2 : [];
|
|
33086
|
+
const address = selectedAddressId ? (_addresses$find = addresses === null || addresses === void 0 ? void 0 : addresses.find(address => address.id == selectedAddressId)) !== null && _addresses$find !== void 0 ? _addresses$find : null : (_addresses$find2 = addresses === null || addresses === void 0 ? void 0 : addresses.find(address => address.type == "shipping" && address.is_default)) !== null && _addresses$find2 !== void 0 ? _addresses$find2 : null;
|
|
33036
33087
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
33037
|
-
id: "pelcro-order-create-view"
|
|
33038
|
-
|
|
33088
|
+
id: "pelcro-order-create-view",
|
|
33089
|
+
className: "plc-grid plc-grid-cols-1 md:plc-grid-cols-2 plc-gap-20"
|
|
33090
|
+
}, /*#__PURE__*/React__default.createElement(OrderCreateSummary, {
|
|
33091
|
+
order: order
|
|
33092
|
+
}), /*#__PURE__*/React__default.createElement("form", {
|
|
33039
33093
|
action: "javascript:void(0);",
|
|
33040
33094
|
className: "plc-mt-2 pelcro-form"
|
|
33041
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
33095
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
33096
|
+
className: "plc-flex plc-flex-row plc-justify-between plc-px-8 md:plc-px-0"
|
|
33097
|
+
}, address && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
33098
|
+
className: "pelcro-select-address-radio plc-order-2",
|
|
33099
|
+
id: `pelcro-address-select-${address === null || address === void 0 ? void 0 : address.id}`,
|
|
33100
|
+
name: "address"
|
|
33101
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
33102
|
+
className: "pelcro-address-name plc-font-semibold"
|
|
33103
|
+
}, t("labels.shippingAddress")), /*#__PURE__*/React__default.createElement("p", {
|
|
33104
|
+
className: "pelcro-address-company"
|
|
33105
|
+
}, address === null || address === void 0 ? void 0 : address.company), /*#__PURE__*/React__default.createElement("p", {
|
|
33106
|
+
className: "pelcro-address-name plc-text-sm plc-mt-1"
|
|
33107
|
+
}, address === null || address === void 0 ? void 0 : address.first_name, " ", address === null || address === void 0 ? void 0 : address.last_name), /*#__PURE__*/React__default.createElement("p", {
|
|
33108
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
33109
|
+
}, address === null || address === void 0 ? void 0 : address.line1), /*#__PURE__*/React__default.createElement("p", {
|
|
33110
|
+
className: "pelcro-address-country plc-text-sm"
|
|
33111
|
+
}, address === null || address === void 0 ? void 0 : address.city, ", ", address === null || address === void 0 ? void 0 : address.state, " ", address === null || address === void 0 ? void 0 : address.postal_code, ", ", address === null || address === void 0 ? void 0 : address.country))), /*#__PURE__*/React__default.createElement("div", {
|
|
33112
|
+
className: "pelcro-select-address-radio plc-order-2",
|
|
33113
|
+
id: `pelcro-address-select-${address === null || address === void 0 ? void 0 : address.id}`,
|
|
33114
|
+
name: "address"
|
|
33115
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
33116
|
+
className: "pelcro-address-name plc-font-semibold"
|
|
33117
|
+
}, t("labels.contactDetails")), /*#__PURE__*/React__default.createElement("p", {
|
|
33118
|
+
className: "pelcro-address-name plc-text-sm plc-mt-1"
|
|
33119
|
+
}, user.email), /*#__PURE__*/React__default.createElement("p", {
|
|
33120
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
33121
|
+
}, address === null || address === void 0 ? void 0 : address.phone))), /*#__PURE__*/React__default.createElement(PaymentMethodView, Object.assign({
|
|
33042
33122
|
type: "orderCreate",
|
|
33043
33123
|
showCoupon: true,
|
|
33044
33124
|
showExternalPaymentMethods: false,
|
|
@@ -33069,6 +33149,7 @@ const OrderCreateModal = ({
|
|
|
33069
33149
|
|
|
33070
33150
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
33071
33151
|
id: "pelcro-order-create-modal",
|
|
33152
|
+
className: "plc-max-w-7xl",
|
|
33072
33153
|
onDisplay: onDisplay,
|
|
33073
33154
|
onClose: onClose
|
|
33074
33155
|
}, /*#__PURE__*/React__default.createElement(ModalHeader, null, /*#__PURE__*/React__default.createElement("div", {
|
package/dist/pelcro.css
CHANGED
|
@@ -2326,6 +2326,10 @@ apple-pay-button {
|
|
|
2326
2326
|
display: inline-flex;
|
|
2327
2327
|
}
|
|
2328
2328
|
|
|
2329
|
+
.pelcro-root .plc-flow-root{
|
|
2330
|
+
display: flow-root;
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2329
2333
|
.pelcro-root .plc-grid{
|
|
2330
2334
|
display: grid;
|
|
2331
2335
|
}
|
|
@@ -2382,6 +2386,10 @@ apple-pay-button {
|
|
|
2382
2386
|
height: 5rem;
|
|
2383
2387
|
}
|
|
2384
2388
|
|
|
2389
|
+
.pelcro-root .plc-h-24{
|
|
2390
|
+
height: 6rem;
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2385
2393
|
.pelcro-root .plc-h-28{
|
|
2386
2394
|
height: 7rem;
|
|
2387
2395
|
}
|
|
@@ -2422,6 +2430,10 @@ apple-pay-button {
|
|
|
2422
2430
|
max-height: 20rem;
|
|
2423
2431
|
}
|
|
2424
2432
|
|
|
2433
|
+
.pelcro-root .plc-max-h-checkout{
|
|
2434
|
+
max-height: 35rem;
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2425
2437
|
.pelcro-root .plc-max-h-full{
|
|
2426
2438
|
max-height: 100%;
|
|
2427
2439
|
}
|
|
@@ -2578,6 +2590,10 @@ apple-pay-button {
|
|
|
2578
2590
|
max-width: 48rem;
|
|
2579
2591
|
}
|
|
2580
2592
|
|
|
2593
|
+
.pelcro-root .plc-max-w-7xl{
|
|
2594
|
+
max-width: 80rem;
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2581
2597
|
.pelcro-root .plc-max-w-50\%{
|
|
2582
2598
|
max-width: 50%;
|
|
2583
2599
|
}
|
|
@@ -2590,6 +2606,14 @@ apple-pay-button {
|
|
|
2590
2606
|
flex: 1 1 0%;
|
|
2591
2607
|
}
|
|
2592
2608
|
|
|
2609
|
+
.pelcro-root .plc-flex-auto{
|
|
2610
|
+
flex: 1 1 auto;
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
.pelcro-root .plc-flex-none{
|
|
2614
|
+
flex: none;
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2593
2617
|
.pelcro-root .plc-flex-shrink-0{
|
|
2594
2618
|
flex-shrink: 0;
|
|
2595
2619
|
}
|
|
@@ -2805,6 +2829,10 @@ apple-pay-button {
|
|
|
2805
2829
|
gap: 1rem;
|
|
2806
2830
|
}
|
|
2807
2831
|
|
|
2832
|
+
.pelcro-root .plc-gap-20{
|
|
2833
|
+
gap: 5rem;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2808
2836
|
.pelcro-root .plc-gap-x-3{
|
|
2809
2837
|
column-gap: 0.75rem;
|
|
2810
2838
|
}
|
|
@@ -2835,6 +2863,24 @@ apple-pay-button {
|
|
|
2835
2863
|
margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse)));
|
|
2836
2864
|
}
|
|
2837
2865
|
|
|
2866
|
+
.pelcro-root .plc-space-x-4 > :not([hidden]) ~ :not([hidden]){
|
|
2867
|
+
--tw-space-x-reverse: 0;
|
|
2868
|
+
margin-right: calc(1rem * var(--tw-space-x-reverse));
|
|
2869
|
+
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
.pelcro-root .plc-space-x-6 > :not([hidden]) ~ :not([hidden]){
|
|
2873
|
+
--tw-space-x-reverse: 0;
|
|
2874
|
+
margin-right: calc(1.5rem * var(--tw-space-x-reverse));
|
|
2875
|
+
margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
.pelcro-root .plc-space-y-1 > :not([hidden]) ~ :not([hidden]){
|
|
2879
|
+
--tw-space-y-reverse: 0;
|
|
2880
|
+
margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
|
|
2881
|
+
margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2838
2884
|
.pelcro-root .plc-space-y-2 > :not([hidden]) ~ :not([hidden]){
|
|
2839
2885
|
--tw-space-y-reverse: 0;
|
|
2840
2886
|
margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
|
|
@@ -2853,6 +2899,23 @@ apple-pay-button {
|
|
|
2853
2899
|
margin-bottom: calc(1rem * var(--tw-space-y-reverse));
|
|
2854
2900
|
}
|
|
2855
2901
|
|
|
2902
|
+
.pelcro-root .plc-space-y-6 > :not([hidden]) ~ :not([hidden]){
|
|
2903
|
+
--tw-space-y-reverse: 0;
|
|
2904
|
+
margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));
|
|
2905
|
+
margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2908
|
+
.pelcro-root .plc-divide-y > :not([hidden]) ~ :not([hidden]){
|
|
2909
|
+
--tw-divide-y-reverse: 0;
|
|
2910
|
+
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
|
2911
|
+
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
.pelcro-root .plc-divide-gray-200 > :not([hidden]) ~ :not([hidden]){
|
|
2915
|
+
--tw-divide-opacity: 1;
|
|
2916
|
+
border-color: rgba(229, 231, 235, var(--tw-divide-opacity));
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2856
2919
|
.pelcro-root .plc-overflow-auto{
|
|
2857
2920
|
overflow: auto;
|
|
2858
2921
|
}
|
|
@@ -3200,6 +3263,10 @@ apple-pay-button {
|
|
|
3200
3263
|
object-fit: contain;
|
|
3201
3264
|
}
|
|
3202
3265
|
|
|
3266
|
+
.pelcro-root .plc-object-cover{
|
|
3267
|
+
object-fit: cover;
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3203
3270
|
.pelcro-root .plc-object-center{
|
|
3204
3271
|
object-position: center;
|
|
3205
3272
|
}
|
|
@@ -3305,6 +3372,10 @@ apple-pay-button {
|
|
|
3305
3372
|
padding-top: 1.25rem;
|
|
3306
3373
|
}
|
|
3307
3374
|
|
|
3375
|
+
.pelcro-root .plc-pt-6{
|
|
3376
|
+
padding-top: 1.5rem;
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3308
3379
|
.pelcro-root .plc-pr-1{
|
|
3309
3380
|
padding-right: 0.25rem;
|
|
3310
3381
|
}
|
|
@@ -3792,6 +3863,10 @@ apple-pay-button {
|
|
|
3792
3863
|
margin-left: 2rem;
|
|
3793
3864
|
}
|
|
3794
3865
|
|
|
3866
|
+
.pelcro-root .sm\:plc-block{
|
|
3867
|
+
display: block;
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3795
3870
|
.pelcro-root .sm\:plc-flex{
|
|
3796
3871
|
display: flex;
|
|
3797
3872
|
}
|
|
@@ -3824,12 +3899,26 @@ apple-pay-button {
|
|
|
3824
3899
|
flex-direction: row;
|
|
3825
3900
|
}
|
|
3826
3901
|
|
|
3902
|
+
.pelcro-root .sm\:plc-items-start{
|
|
3903
|
+
align-items: flex-start;
|
|
3904
|
+
}
|
|
3905
|
+
|
|
3906
|
+
.pelcro-root .sm\:plc-justify-between{
|
|
3907
|
+
justify-content: space-between;
|
|
3908
|
+
}
|
|
3909
|
+
|
|
3827
3910
|
.pelcro-root .sm\:plc-space-x-2 > :not([hidden]) ~ :not([hidden]){
|
|
3828
3911
|
--tw-space-x-reverse: 0;
|
|
3829
3912
|
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
|
|
3830
3913
|
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
3831
3914
|
}
|
|
3832
3915
|
|
|
3916
|
+
.pelcro-root .sm\:plc-space-x-6 > :not([hidden]) ~ :not([hidden]){
|
|
3917
|
+
--tw-space-x-reverse: 0;
|
|
3918
|
+
margin-right: calc(1.5rem * var(--tw-space-x-reverse));
|
|
3919
|
+
margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
3920
|
+
}
|
|
3921
|
+
|
|
3833
3922
|
.pelcro-root .sm\:plc-space-y-0 > :not([hidden]) ~ :not([hidden]){
|
|
3834
3923
|
--tw-space-y-reverse: 0;
|
|
3835
3924
|
margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
|
|
@@ -3918,6 +4007,10 @@ apple-pay-button {
|
|
|
3918
4007
|
max-width: 80%;
|
|
3919
4008
|
}
|
|
3920
4009
|
|
|
4010
|
+
.pelcro-root .md\:plc-grid-cols-2{
|
|
4011
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
4012
|
+
}
|
|
4013
|
+
|
|
3921
4014
|
.pelcro-root .md\:plc-flex-row{
|
|
3922
4015
|
flex-direction: row;
|
|
3923
4016
|
}
|