@sledge-app/react-instant-search 0.0.13 → 0.0.14
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/components/ProductFilterWidget/ProductFilterWidget.d.ts +0 -1
- package/dist/components/ProductFilterWidget/ProductFilterWidget.d.ts.map +1 -1
- package/dist/components/ProductFilterWidget/ProductFilterWidgetInitSelector.d.ts.map +1 -1
- package/dist/components/SearchIconWidget/SearchIconWidget.d.ts +0 -1
- package/dist/components/SearchIconWidget/SearchIconWidget.d.ts.map +1 -1
- package/dist/components/SearchIconWidget/SearchIconWidgetInitSelector.d.ts.map +1 -1
- package/dist/components/SearchIconWidget/SearchIconWidgetPopup.d.ts +1 -1
- package/dist/components/SearchIconWidget/SearchIconWidgetPopup.d.ts.map +1 -1
- package/dist/components/SearchResultWidget/SearchResultWidget.d.ts +0 -1
- package/dist/components/SearchResultWidget/SearchResultWidget.d.ts.map +1 -1
- package/dist/components/SearchResultWidget/SearchResultWidgetInitSelector.d.ts.map +1 -1
- package/dist/components/SearchWidget/SearchWidget.d.ts +0 -1
- package/dist/components/SearchWidget/SearchWidget.d.ts.map +1 -1
- package/dist/components/SearchWidget/SearchWidgetInitSelector.d.ts.map +1 -1
- package/dist/sledge-react-instant-search.cjs +1 -1
- package/dist/sledge-react-instant-search.cjs.map +1 -1
- package/dist/sledge-react-instant-search.js +57 -89
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,20 +16,6 @@ const LOCAL_STORAGE_KEY = {
|
|
|
16
16
|
INSTANT_SEARCH_SETTING: "sledge-instant-search-setting"
|
|
17
17
|
};
|
|
18
18
|
const SEARCH_RESULT_URL = "/pages/search-result";
|
|
19
|
-
const OBJECT_DATA_STRING_KEY = {
|
|
20
|
-
STORE: {
|
|
21
|
-
NAME: "{{ shop.name }}"
|
|
22
|
-
},
|
|
23
|
-
PRODUCT: {
|
|
24
|
-
TITLE: "{ product_title }",
|
|
25
|
-
VARIANT_TITLE: "{ product_variant_title }",
|
|
26
|
-
IMAGE: "{ product_image }",
|
|
27
|
-
CURRENCY: "{ product_currency }",
|
|
28
|
-
PRICE: "{ product_price }",
|
|
29
|
-
VENDOR: "{ product_vendor }",
|
|
30
|
-
SKU: "{ product_sku }"
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
19
|
const sanitizeDataId = (id) => {
|
|
34
20
|
if (!id)
|
|
35
21
|
return "";
|
|
@@ -41,12 +27,6 @@ const sanitizeDataId = (id) => {
|
|
|
41
27
|
return getId;
|
|
42
28
|
}
|
|
43
29
|
};
|
|
44
|
-
const replaceString = (str, find, replace) => {
|
|
45
|
-
for (var i = 0; i < find.length; i++) {
|
|
46
|
-
str = str.replace(new RegExp(find[i], "gi"), replace[i]);
|
|
47
|
-
}
|
|
48
|
-
return str;
|
|
49
|
-
};
|
|
50
30
|
const SearchIconWidget$1 = "";
|
|
51
31
|
const root = "";
|
|
52
32
|
const Loading = "";
|
|
@@ -1644,16 +1624,16 @@ const addToCartTrigger = async (data) => {
|
|
|
1644
1624
|
return;
|
|
1645
1625
|
});
|
|
1646
1626
|
};
|
|
1647
|
-
const
|
|
1627
|
+
const ProductCardComponent = ({
|
|
1648
1628
|
data,
|
|
1649
1629
|
setting,
|
|
1650
|
-
customProductCard,
|
|
1651
1630
|
showOptionOutOfStock = false,
|
|
1652
1631
|
triggerPropAdditional,
|
|
1653
1632
|
sourceApp = null,
|
|
1654
1633
|
onAfterAddToCart,
|
|
1655
1634
|
onAfterAddWishlist,
|
|
1656
|
-
onAfterRemoveWishlist
|
|
1635
|
+
onAfterRemoveWishlist,
|
|
1636
|
+
children
|
|
1657
1637
|
}) => {
|
|
1658
1638
|
const {
|
|
1659
1639
|
show_vendor = true,
|
|
@@ -1666,15 +1646,6 @@ const ProductCards = ({
|
|
|
1666
1646
|
display_price_style = {},
|
|
1667
1647
|
display_button_add_to_cart_style = {}
|
|
1668
1648
|
} = setting || {};
|
|
1669
|
-
let {
|
|
1670
|
-
image: productCardImage = false,
|
|
1671
|
-
outStock: productCardOutStock = "",
|
|
1672
|
-
title: productCardTitle = "",
|
|
1673
|
-
price: productCardPrice = "",
|
|
1674
|
-
text: productCardText = "",
|
|
1675
|
-
rating: productCardRating = false,
|
|
1676
|
-
buttonAddToCart: productCardButtonAddToCart = ""
|
|
1677
|
-
} = customProductCard || {};
|
|
1678
1649
|
const [clickedAddToCartId, setClickedAddToCartId] = React__default.useState(null);
|
|
1679
1650
|
const handleAddToCart = async (data2) => {
|
|
1680
1651
|
var _a;
|
|
@@ -1730,38 +1701,11 @@ const ProductCards = ({
|
|
|
1730
1701
|
const { id: variant_id = "", title: variant_title = "", price = "", sku = "" } = (variants == null ? void 0 : variants.length) ? variants[0] : {};
|
|
1731
1702
|
let totalStock = ((_a = variants == null ? void 0 : variants.map(({ inventory_quantity }) => inventory_quantity)) == null ? void 0 : _a.reduce((a, b) => a + b, 0)) || 0;
|
|
1732
1703
|
let isLoadingAddToCart = clickedAddToCartId == variant_id;
|
|
1733
|
-
let isOutOfStock = !totalStock && showOptionOutOfStock
|
|
1734
|
-
if (customProductCard && Object.keys(customProductCard).length) {
|
|
1735
|
-
productCardTitle = productCardTitle ? replaceString(productCardTitle, [OBJECT_DATA_STRING_KEY.PRODUCT.TITLE], [title]) : productCardTitle;
|
|
1736
|
-
productCardPrice = productCardPrice ? replaceString(productCardPrice, [OBJECT_DATA_STRING_KEY.PRODUCT.CURRENCY, OBJECT_DATA_STRING_KEY.PRODUCT.PRICE], [currency, price]) : productCardPrice;
|
|
1737
|
-
productCardText = productCardText ? replaceString(
|
|
1738
|
-
productCardText,
|
|
1739
|
-
[OBJECT_DATA_STRING_KEY.PRODUCT.VARIANT_TITLE, OBJECT_DATA_STRING_KEY.PRODUCT.VENDOR, OBJECT_DATA_STRING_KEY.PRODUCT.SKU],
|
|
1740
|
-
[variant_title, vendor, sku]
|
|
1741
|
-
) : productCardText;
|
|
1742
|
-
} else {
|
|
1743
|
-
productCardImage = true;
|
|
1744
|
-
productCardOutStock = "Sold out";
|
|
1745
|
-
productCardTitle = title;
|
|
1746
|
-
productCardPrice = `${currency}${price}`;
|
|
1747
|
-
productCardText = `
|
|
1748
|
-
<div>${variant_title}</div>
|
|
1749
|
-
<div>Vendor: ${vendor} | SKU: ${sku}</div>`;
|
|
1750
|
-
productCardRating = true;
|
|
1751
|
-
productCardButtonAddToCart = `
|
|
1752
|
-
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1753
|
-
<path
|
|
1754
|
-
fill-rule="evenodd"
|
|
1755
|
-
clip-rule="evenodd"
|
|
1756
|
-
d="M8.83562 1.50023C10.796 1.50023 12.4155 2.99397 12.6152 4.90442L12.6709 4.90507C13.7584 4.90507 15.0806 5.62732 15.5269 7.65307L16.1186 12.2333C16.3309 13.7116 16.0654 14.8973 15.3281 15.7478C14.5946 16.5938 13.4336 17.0416 11.9704 17.0416H5.7094C4.10215 17.0416 2.9824 16.6478 2.28565 15.8386C1.5859 15.0271 1.3519 13.8098 1.5904 12.2213L2.1724 7.70182C2.5549 5.62957 3.95365 4.90507 5.03665 4.90507C5.13014 4.04293 5.51889 3.22275 6.13562 2.60797C6.84437 1.90372 7.82162 1.50023 8.81987 1.50023H8.83562ZM12.6709 6.03007H5.03665C4.7059 6.03007 3.6004 6.16357 3.28315 7.87657L2.70415 12.3766C2.5159 13.6388 2.6614 14.5523 3.13765 15.1051C3.6079 15.6511 4.4494 15.9166 5.7094 15.9166H11.9704C12.7564 15.9166 13.8296 15.7598 14.4776 15.0113C14.9921 14.4181 15.1691 13.5346 15.0041 12.3848L14.4199 7.84582C14.1709 6.72757 13.5139 6.03007 12.6709 6.03007ZM11.023 8.11815C11.3335 8.11815 11.6027 8.37015 11.6027 8.68065C11.6027 8.99115 11.368 9.24315 11.0575 9.24315H11.023C10.7125 9.24315 10.4605 8.99115 10.4605 8.68065C10.4605 8.37015 10.7125 8.11815 11.023 8.11815ZM6.65042 8.11815C6.96092 8.11815 7.23017 8.37015 7.23017 8.68065C7.23017 8.99115 6.99467 9.24315 6.68417 9.24315H6.65042C6.33992 9.24315 6.08792 8.99115 6.08792 8.68065C6.08792 8.37015 6.33992 8.11815 6.65042 8.11815ZM8.83337 2.62522H8.82212C8.11637 2.62522 7.42862 2.90947 6.92987 3.40522C6.5236 3.80967 6.25789 4.34137 6.17193 4.90472L11.4814 4.90493C11.2887 3.61626 10.1743 2.62522 8.83337 2.62522Z"
|
|
1757
|
-
fill="#393D4E"
|
|
1758
|
-
></path></svg
|
|
1759
|
-
><span>Add To Cart</span>`;
|
|
1760
|
-
}
|
|
1704
|
+
let isOutOfStock = !totalStock && showOptionOutOfStock;
|
|
1761
1705
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card", children: [
|
|
1762
1706
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-content", children: [
|
|
1763
1707
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card-image", children: [
|
|
1764
|
-
|
|
1708
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1765
1709
|
"a",
|
|
1766
1710
|
{
|
|
1767
1711
|
href: url,
|
|
@@ -1792,25 +1736,36 @@ const ProductCards = ({
|
|
|
1792
1736
|
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: (image == null ? void 0 : image.src) || "", alt: "sledge-product-card-image", loading: "lazy", onError: (event) => event.currentTarget.src = `${API_URL}/img/blank-image.png` })
|
|
1793
1737
|
]
|
|
1794
1738
|
}
|
|
1795
|
-
)
|
|
1796
|
-
isOutOfStock ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-card-out-of-stock",
|
|
1739
|
+
),
|
|
1740
|
+
isOutOfStock ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-card-out-of-stock", children: "Sold out" }) : null
|
|
1797
1741
|
] }),
|
|
1798
1742
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card-desc", children: [
|
|
1799
1743
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card-title", children: [
|
|
1800
|
-
|
|
1744
|
+
title ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1801
1745
|
"a",
|
|
1802
1746
|
{
|
|
1803
1747
|
href: url,
|
|
1804
1748
|
onClick: () => sourceApp === "instant-search" && productClickTrigger({
|
|
1805
1749
|
productId: id
|
|
1806
1750
|
}),
|
|
1807
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { style: display_product_name_style,
|
|
1751
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { style: display_product_name_style, children: title })
|
|
1808
1752
|
}
|
|
1809
|
-
)
|
|
1810
|
-
show_price
|
|
1753
|
+
) : null,
|
|
1754
|
+
show_price ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-card-price", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { style: display_price_style, children: [
|
|
1755
|
+
currency,
|
|
1756
|
+
price
|
|
1757
|
+
] }) }) : null
|
|
1758
|
+
] }),
|
|
1759
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card-text", children: [
|
|
1760
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: variant_title }),
|
|
1761
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
1762
|
+
"Vendor: ",
|
|
1763
|
+
vendor,
|
|
1764
|
+
" | SKU: ",
|
|
1765
|
+
sku
|
|
1766
|
+
] })
|
|
1811
1767
|
] }),
|
|
1812
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-card-
|
|
1813
|
-
productCardRating ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-card-rating", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1768
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-card-rating", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1814
1769
|
Rating,
|
|
1815
1770
|
{
|
|
1816
1771
|
data: {
|
|
@@ -1819,10 +1774,10 @@ const ProductCards = ({
|
|
|
1819
1774
|
size: "xs",
|
|
1820
1775
|
withSkeletonLoading: false
|
|
1821
1776
|
}
|
|
1822
|
-
) })
|
|
1777
|
+
) })
|
|
1823
1778
|
] })
|
|
1824
1779
|
] }),
|
|
1825
|
-
show_add_to_cart
|
|
1780
|
+
show_add_to_cart ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-button-wrapper", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1826
1781
|
Button,
|
|
1827
1782
|
{
|
|
1828
1783
|
type: "button",
|
|
@@ -1833,7 +1788,6 @@ const ProductCards = ({
|
|
|
1833
1788
|
cursor: "wait"
|
|
1834
1789
|
}
|
|
1835
1790
|
},
|
|
1836
|
-
dangerouslySetInnerHTML: { __html: isLoadingAddToCart ? "Adding..." : isOutOfStock ? "Sold out" : productCardButtonAddToCart },
|
|
1837
1791
|
...isLoadingAddToCart || isOutOfStock ? {
|
|
1838
1792
|
disabled: true
|
|
1839
1793
|
} : {
|
|
@@ -1841,17 +1795,40 @@ const ProductCards = ({
|
|
|
1841
1795
|
id: variant_id,
|
|
1842
1796
|
quantity: 1
|
|
1843
1797
|
})
|
|
1844
|
-
}
|
|
1798
|
+
},
|
|
1799
|
+
children: isLoadingAddToCart ? "Adding..." : isOutOfStock ? "Sold out" : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1800
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1801
|
+
"path",
|
|
1802
|
+
{
|
|
1803
|
+
fillRule: "evenodd",
|
|
1804
|
+
clipRule: "evenodd",
|
|
1805
|
+
d: "M8.83562 1.50023C10.796 1.50023 12.4155 2.99397 12.6152 4.90442L12.6709 4.90507C13.7584 4.90507 15.0806 5.62732 15.5269 7.65307L16.1186 12.2333C16.3309 13.7116 16.0654 14.8973 15.3281 15.7478C14.5946 16.5938 13.4336 17.0416 11.9704 17.0416H5.7094C4.10215 17.0416 2.9824 16.6478 2.28565 15.8386C1.5859 15.0271 1.3519 13.8098 1.5904 12.2213L2.1724 7.70182C2.5549 5.62957 3.95365 4.90507 5.03665 4.90507C5.13014 4.04293 5.51889 3.22275 6.13562 2.60797C6.84437 1.90372 7.82162 1.50023 8.81987 1.50023H8.83562ZM12.6709 6.03007H5.03665C4.7059 6.03007 3.6004 6.16357 3.28315 7.87657L2.70415 12.3766C2.5159 13.6388 2.6614 14.5523 3.13765 15.1051C3.6079 15.6511 4.4494 15.9166 5.7094 15.9166H11.9704C12.7564 15.9166 13.8296 15.7598 14.4776 15.0113C14.9921 14.4181 15.1691 13.5346 15.0041 12.3848L14.4199 7.84582C14.1709 6.72757 13.5139 6.03007 12.6709 6.03007ZM11.023 8.11815C11.3335 8.11815 11.6027 8.37015 11.6027 8.68065C11.6027 8.99115 11.368 9.24315 11.0575 9.24315H11.023C10.7125 9.24315 10.4605 8.99115 10.4605 8.68065C10.4605 8.37015 10.7125 8.11815 11.023 8.11815ZM6.65042 8.11815C6.96092 8.11815 7.23017 8.37015 7.23017 8.68065C7.23017 8.99115 6.99467 9.24315 6.68417 9.24315H6.65042C6.33992 9.24315 6.08792 8.99115 6.08792 8.68065C6.08792 8.37015 6.33992 8.11815 6.65042 8.11815ZM8.83337 2.62522H8.82212C8.11637 2.62522 7.42862 2.90947 6.92987 3.40522C6.5236 3.80967 6.25789 4.34137 6.17193 4.90472L11.4814 4.90493C11.2887 3.61626 10.1743 2.62522 8.83337 2.62522Z",
|
|
1806
|
+
fill: "#393D4E"
|
|
1807
|
+
}
|
|
1808
|
+
) }),
|
|
1809
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Add To Cart" })
|
|
1810
|
+
] })
|
|
1845
1811
|
}
|
|
1846
1812
|
) }) : null
|
|
1847
1813
|
] }, index);
|
|
1848
1814
|
}) });
|
|
1849
1815
|
};
|
|
1850
|
-
const
|
|
1816
|
+
const ProductCards = ({ component, ...otherProps }) => {
|
|
1817
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: component && React__default.isValidElement(component) ? React__default.cloneElement(component, { ...otherProps }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ProductCardComponent, { ...otherProps }) });
|
|
1818
|
+
};
|
|
1819
|
+
const ProductGrid = ({ type, className = "", cards, onAfterRenderProduct, ...otherProps }) => {
|
|
1851
1820
|
React__default.useEffect(() => {
|
|
1852
1821
|
onAfterRenderProduct && onAfterRenderProduct("success");
|
|
1853
1822
|
}, []);
|
|
1854
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sledge__product-grid ${className}`, "data-grid-type": type, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1823
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sledge__product-grid ${className}`, "data-grid-type": type, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1824
|
+
ProductCards,
|
|
1825
|
+
{
|
|
1826
|
+
...cards ? {
|
|
1827
|
+
component: cards
|
|
1828
|
+
} : {},
|
|
1829
|
+
...otherProps
|
|
1830
|
+
}
|
|
1831
|
+
) });
|
|
1855
1832
|
};
|
|
1856
1833
|
const TextAreaField = "";
|
|
1857
1834
|
const InputField = "";
|
|
@@ -2195,7 +2172,7 @@ const SkeletonLoading = {
|
|
|
2195
2172
|
BlogGrid: SkeletonBlogGrid
|
|
2196
2173
|
};
|
|
2197
2174
|
const SearchIconWidget = (props) => {
|
|
2198
|
-
const { size = "sm",
|
|
2175
|
+
const { size = "sm", onAfterAddToCart, onAfterAddWishlist, onAfterRemoveWishlist, onAfterRenderProduct } = props || {};
|
|
2199
2176
|
const { isRenderApp } = React__default.useContext(SledgeContext);
|
|
2200
2177
|
const [sizing, setSizing] = React__default.useState({
|
|
2201
2178
|
width: 0,
|
|
@@ -2223,7 +2200,7 @@ const SearchIconWidget = (props) => {
|
|
|
2223
2200
|
}, [isRenderApp]);
|
|
2224
2201
|
const handleShowWidget = () => {
|
|
2225
2202
|
if (typeof window !== "undefined" && window.sledgeInstantSearchIconWidgetPopup)
|
|
2226
|
-
window.sledgeInstantSearchIconWidgetPopup(
|
|
2203
|
+
window.sledgeInstantSearchIconWidgetPopup(onAfterAddToCart, onAfterAddWishlist, onAfterRemoveWishlist, onAfterRenderProduct);
|
|
2227
2204
|
};
|
|
2228
2205
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sledge-instant-search__icon-widget", onClick: handleShowWidget, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SearchIcon, { ...sizing, color: "currentColor" }) });
|
|
2229
2206
|
};
|
|
@@ -2251,7 +2228,6 @@ const SearchIconWidgetPopup = () => {
|
|
|
2251
2228
|
onAfterRenderProduct: (state) => {
|
|
2252
2229
|
}
|
|
2253
2230
|
});
|
|
2254
|
-
const [customProductCard, setCustomProductCard] = React__default.useState({});
|
|
2255
2231
|
const searchFieldRef = React__default.useRef(null);
|
|
2256
2232
|
const previousState = usePrevious({ keyword });
|
|
2257
2233
|
const handleMultiSearch = async (data, onSearch = false) => {
|
|
@@ -2335,7 +2311,7 @@ const SearchIconWidgetPopup = () => {
|
|
|
2335
2311
|
};
|
|
2336
2312
|
React__default.useEffect(() => {
|
|
2337
2313
|
if (typeof window !== "undefined") {
|
|
2338
|
-
window.sledgeInstantSearchIconWidgetPopup = (
|
|
2314
|
+
window.sledgeInstantSearchIconWidgetPopup = (onAfterAddToCart = () => {
|
|
2339
2315
|
}, onAfterAddWishlist = () => {
|
|
2340
2316
|
}, onAfterRemoveWishlist = () => {
|
|
2341
2317
|
}, onAfterRenderProduct = () => {
|
|
@@ -2347,7 +2323,6 @@ const SearchIconWidgetPopup = () => {
|
|
|
2347
2323
|
onAfterRemoveWishlist,
|
|
2348
2324
|
onAfterRenderProduct
|
|
2349
2325
|
});
|
|
2350
|
-
setCustomProductCard(customProductCard2);
|
|
2351
2326
|
setTimeout(() => {
|
|
2352
2327
|
if (searchFieldRef == null ? void 0 : searchFieldRef.current) {
|
|
2353
2328
|
searchFieldRef.current.focus();
|
|
@@ -2487,7 +2462,6 @@ const SearchIconWidgetPopup = () => {
|
|
|
2487
2462
|
show_sku: (_h = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _h.show_sku,
|
|
2488
2463
|
show_price: (_i = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _i.show_price
|
|
2489
2464
|
},
|
|
2490
|
-
customProductCard,
|
|
2491
2465
|
showOptionOutOfStock: true,
|
|
2492
2466
|
onAfterAddToCart: handleFunctions.onAfterAddToCart,
|
|
2493
2467
|
onAfterAddWishlist: handleFunctions.onAfterAddWishlist,
|
|
@@ -2528,7 +2502,6 @@ const SearchIconWidgetPopup = () => {
|
|
|
2528
2502
|
show_sku: (_p = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _p.show_sku,
|
|
2529
2503
|
show_price: (_q = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _q.show_price
|
|
2530
2504
|
},
|
|
2531
|
-
customProductCard,
|
|
2532
2505
|
showOptionOutOfStock: true,
|
|
2533
2506
|
onAfterAddToCart: handleFunctions.onAfterAddToCart,
|
|
2534
2507
|
onAfterAddWishlist: handleFunctions.onAfterAddWishlist,
|
|
@@ -2549,7 +2522,7 @@ const SearchIconWidgetPopup = () => {
|
|
|
2549
2522
|
const SearchResultWidget$1 = "";
|
|
2550
2523
|
const SearchResultWidget = (props) => {
|
|
2551
2524
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2552
|
-
const { layoutType = "default", query, data,
|
|
2525
|
+
const { layoutType = "default", query, data, onAfterAddToCart, onAfterAddWishlist, onAfterRemoveWishlist, onAfterRenderProduct } = props;
|
|
2553
2526
|
const { keyword: queryKeyword = "" } = query || {};
|
|
2554
2527
|
const { collectionId } = data || {};
|
|
2555
2528
|
const { isRenderApp } = React__default.useContext(SledgeContext);
|
|
@@ -3017,7 +2990,6 @@ const SearchResultWidget = (props) => {
|
|
|
3017
2990
|
defaultSort,
|
|
3018
2991
|
showOutOfStock,
|
|
3019
2992
|
data,
|
|
3020
|
-
customProductCard,
|
|
3021
2993
|
onAfterAddToCart,
|
|
3022
2994
|
onAfterAddWishlist,
|
|
3023
2995
|
onAfterRemoveWishlist,
|
|
@@ -3052,7 +3024,6 @@ const ResultProduct = (props) => {
|
|
|
3052
3024
|
filterVerticalSkeleton,
|
|
3053
3025
|
productGridSkeleton,
|
|
3054
3026
|
searchAndSelectOptionSkeleton,
|
|
3055
|
-
customProductCard,
|
|
3056
3027
|
onAfterAddToCart,
|
|
3057
3028
|
onAfterAddWishlist,
|
|
3058
3029
|
onAfterRemoveWishlist,
|
|
@@ -3620,7 +3591,6 @@ const ResultProduct = (props) => {
|
|
|
3620
3591
|
show_sku: (_s = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _s.show_sku,
|
|
3621
3592
|
show_price: (_t = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _t.show_price
|
|
3622
3593
|
},
|
|
3623
|
-
customProductCard,
|
|
3624
3594
|
showOptionOutOfStock: true,
|
|
3625
3595
|
onAfterAddToCart,
|
|
3626
3596
|
onAfterAddWishlist,
|
|
@@ -3768,7 +3738,7 @@ const ResultEmpty = (props) => {
|
|
|
3768
3738
|
const SearchWidget$1 = "";
|
|
3769
3739
|
const SearchWidget = (props) => {
|
|
3770
3740
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
3771
|
-
const { width = "400px",
|
|
3741
|
+
const { width = "400px", onAfterAddToCart, onAfterAddWishlist, onAfterRemoveWishlist, onAfterRenderProduct } = props;
|
|
3772
3742
|
const { isRenderApp } = React__default.useContext(SledgeContext);
|
|
3773
3743
|
const [isLoading, setIsLoading] = React__default.useState(true);
|
|
3774
3744
|
const [keyword, setKeyword] = React__default.useState("");
|
|
@@ -3995,7 +3965,6 @@ const SearchWidget = (props) => {
|
|
|
3995
3965
|
show_sku: (_g = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _g.show_sku,
|
|
3996
3966
|
show_price: (_h = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _h.show_price
|
|
3997
3967
|
},
|
|
3998
|
-
customProductCard,
|
|
3999
3968
|
showOptionOutOfStock: true,
|
|
4000
3969
|
onAfterAddToCart,
|
|
4001
3970
|
onAfterAddWishlist,
|
|
@@ -4037,7 +4006,6 @@ const SearchWidget = (props) => {
|
|
|
4037
4006
|
show_sku: (_o = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _o.show_sku,
|
|
4038
4007
|
show_price: (_p = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _p.show_price
|
|
4039
4008
|
},
|
|
4040
|
-
customProductCard,
|
|
4041
4009
|
showOptionOutOfStock: true,
|
|
4042
4010
|
onAfterAddToCart,
|
|
4043
4011
|
onAfterAddWishlist,
|