@pelcro/react-pelcro-js 3.2.0-beta.31 → 3.2.0-beta.32
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 +7 -7
- package/dist/index.esm.js +7 -7
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7063,10 +7063,10 @@ class PelcroActions {
|
|
|
7063
7063
|
if (!itemToAdd) {
|
|
7064
7064
|
console.error("invalid item SKU id");
|
|
7065
7065
|
return false;
|
|
7066
|
-
} //Dispatch PelcroElementsCartItemAdded
|
|
7066
|
+
} //Dispatch PelcroElementsCartItemAdded when an item added successfully to the cart
|
|
7067
7067
|
|
|
7068
7068
|
|
|
7069
|
-
document.dispatchEvent(cartItemAdded(
|
|
7069
|
+
document.dispatchEvent(cartItemAdded(itemToAdd));
|
|
7070
7070
|
const {
|
|
7071
7071
|
cartItems
|
|
7072
7072
|
} = this.get();
|
|
@@ -20662,7 +20662,7 @@ const CartModal = ({
|
|
|
20662
20662
|
CartModal.viewId = "cart";
|
|
20663
20663
|
|
|
20664
20664
|
const ShopSelectProductButton = ({
|
|
20665
|
-
|
|
20665
|
+
itemId,
|
|
20666
20666
|
onClick,
|
|
20667
20667
|
...otherProps
|
|
20668
20668
|
}) => {
|
|
@@ -20678,7 +20678,7 @@ const ShopSelectProductButton = ({
|
|
|
20678
20678
|
const handleClick = () => {
|
|
20679
20679
|
setDisabled(true);
|
|
20680
20680
|
setTextContent(t("buttons.added"));
|
|
20681
|
-
addToCart(
|
|
20681
|
+
addToCart(itemId);
|
|
20682
20682
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
20683
20683
|
setTimeout(() => {
|
|
20684
20684
|
setDisabled(false);
|
|
@@ -20687,8 +20687,8 @@ const ShopSelectProductButton = ({
|
|
|
20687
20687
|
};
|
|
20688
20688
|
|
|
20689
20689
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
20690
|
-
"data-sku-id":
|
|
20691
|
-
id: `pelcro-shop-select-${
|
|
20690
|
+
"data-sku-id": itemId,
|
|
20691
|
+
id: `pelcro-shop-select-${itemId}`,
|
|
20692
20692
|
onClick: handleClick,
|
|
20693
20693
|
disabled: disabled
|
|
20694
20694
|
}, otherProps), textContent);
|
|
@@ -20732,7 +20732,7 @@ const ShopView = () => {
|
|
|
20732
20732
|
}, item.name), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
20733
20733
|
className: "plc-font-bold pelcro-shop-product-description"
|
|
20734
20734
|
}, item.description), /*#__PURE__*/React__default['default'].createElement(ShopSelectProductButton, {
|
|
20735
|
-
|
|
20735
|
+
itemId: item.id,
|
|
20736
20736
|
className: "plc-mt-2"
|
|
20737
20737
|
}), /*#__PURE__*/React__default['default'].createElement(ShopPurchaseButton, {
|
|
20738
20738
|
itemId: item.id,
|
package/dist/index.esm.js
CHANGED
|
@@ -7033,10 +7033,10 @@ class PelcroActions {
|
|
|
7033
7033
|
if (!itemToAdd) {
|
|
7034
7034
|
console.error("invalid item SKU id");
|
|
7035
7035
|
return false;
|
|
7036
|
-
} //Dispatch PelcroElementsCartItemAdded
|
|
7036
|
+
} //Dispatch PelcroElementsCartItemAdded when an item added successfully to the cart
|
|
7037
7037
|
|
|
7038
7038
|
|
|
7039
|
-
document.dispatchEvent(cartItemAdded(
|
|
7039
|
+
document.dispatchEvent(cartItemAdded(itemToAdd));
|
|
7040
7040
|
const {
|
|
7041
7041
|
cartItems
|
|
7042
7042
|
} = this.get();
|
|
@@ -20632,7 +20632,7 @@ const CartModal = ({
|
|
|
20632
20632
|
CartModal.viewId = "cart";
|
|
20633
20633
|
|
|
20634
20634
|
const ShopSelectProductButton = ({
|
|
20635
|
-
|
|
20635
|
+
itemId,
|
|
20636
20636
|
onClick,
|
|
20637
20637
|
...otherProps
|
|
20638
20638
|
}) => {
|
|
@@ -20648,7 +20648,7 @@ const ShopSelectProductButton = ({
|
|
|
20648
20648
|
const handleClick = () => {
|
|
20649
20649
|
setDisabled(true);
|
|
20650
20650
|
setTextContent(t("buttons.added"));
|
|
20651
|
-
addToCart(
|
|
20651
|
+
addToCart(itemId);
|
|
20652
20652
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
20653
20653
|
setTimeout(() => {
|
|
20654
20654
|
setDisabled(false);
|
|
@@ -20657,8 +20657,8 @@ const ShopSelectProductButton = ({
|
|
|
20657
20657
|
};
|
|
20658
20658
|
|
|
20659
20659
|
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
20660
|
-
"data-sku-id":
|
|
20661
|
-
id: `pelcro-shop-select-${
|
|
20660
|
+
"data-sku-id": itemId,
|
|
20661
|
+
id: `pelcro-shop-select-${itemId}`,
|
|
20662
20662
|
onClick: handleClick,
|
|
20663
20663
|
disabled: disabled
|
|
20664
20664
|
}, otherProps), textContent);
|
|
@@ -20702,7 +20702,7 @@ const ShopView = () => {
|
|
|
20702
20702
|
}, item.name), /*#__PURE__*/React__default.createElement("p", {
|
|
20703
20703
|
className: "plc-font-bold pelcro-shop-product-description"
|
|
20704
20704
|
}, item.description), /*#__PURE__*/React__default.createElement(ShopSelectProductButton, {
|
|
20705
|
-
|
|
20705
|
+
itemId: item.id,
|
|
20706
20706
|
className: "plc-mt-2"
|
|
20707
20707
|
}), /*#__PURE__*/React__default.createElement(ShopPurchaseButton, {
|
|
20708
20708
|
itemId: item.id,
|