@sledge-app/react-instant-search 2.0.1 → 2.0.3
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/SearchResultWidget/SearchResultWidget.d.ts.map +1 -1
- package/dist/components/SearchResultWidget/components/FilterHorizontal.d.ts +1 -0
- package/dist/components/SearchResultWidget/components/FilterHorizontal.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 +129 -94
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1094,7 +1094,7 @@ const Pagination = (props) => {
|
|
|
1094
1094
|
};
|
|
1095
1095
|
React__default.useEffect(() => {
|
|
1096
1096
|
handlePageInfo();
|
|
1097
|
-
}, []);
|
|
1097
|
+
}, [pageInfoProp]);
|
|
1098
1098
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__pagination", "data-pagination-type": type, children: renderPaginationLayout() });
|
|
1099
1099
|
};
|
|
1100
1100
|
const RadioGroup$1 = "";
|
|
@@ -1737,14 +1737,18 @@ const addToCartTrigger$2 = async (data) => {
|
|
|
1737
1737
|
return;
|
|
1738
1738
|
});
|
|
1739
1739
|
};
|
|
1740
|
-
const wishlistInfo = async ({
|
|
1740
|
+
const wishlistInfo = async ({
|
|
1741
|
+
callback,
|
|
1742
|
+
wishlistPreviewSettings,
|
|
1743
|
+
generalPreviewSettings
|
|
1744
|
+
}) => {
|
|
1741
1745
|
var _a, _b;
|
|
1742
1746
|
let response;
|
|
1743
1747
|
let run = false;
|
|
1744
1748
|
let valueTotalWishlist;
|
|
1745
1749
|
let valueProxyUrl;
|
|
1746
1750
|
let queryParam = {
|
|
1747
|
-
...wishlistPreviewSettings ? {
|
|
1751
|
+
...wishlistPreviewSettings && (generalPreviewSettings == null ? void 0 : generalPreviewSettings.use_dummy_data) ? {
|
|
1748
1752
|
is_preview: true
|
|
1749
1753
|
} : {}
|
|
1750
1754
|
};
|
|
@@ -1818,10 +1822,9 @@ const BadgeCounter = (props) => {
|
|
|
1818
1822
|
const contentTotalWishlist = isFirstLoading ? defaultTotalWishlist : isLoading || isRequiredLogin ? 0 : `${isMaximizeTotalWishlist ? "99+" : totalWishlist}` || 0;
|
|
1819
1823
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "data-wishlist-counter": contentTotalWishlist, children: contentTotalWishlist });
|
|
1820
1824
|
};
|
|
1821
|
-
const WidgetHeaderClearTrigger = ({ buttonText, shareId, dataSettings, isFirstLoading }) => {
|
|
1822
|
-
var _a, _b, _c, _d
|
|
1825
|
+
const WidgetHeaderClearTrigger = ({ buttonText, shareId, dataSettings, isFirstLoading, previewSettings }) => {
|
|
1826
|
+
var _a, _b, _c, _d;
|
|
1823
1827
|
const { sledgeAnonymId } = React__default.useContext(SledgeContext);
|
|
1824
|
-
const { is_required_login } = ((_a = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a.global) || {};
|
|
1825
1828
|
const {
|
|
1826
1829
|
text_color: display_button_clear_all_text_color,
|
|
1827
1830
|
border_color: display_button_clear_all_border_color,
|
|
@@ -1834,9 +1837,9 @@ const WidgetHeaderClearTrigger = ({ buttonText, shareId, dataSettings, isFirstLo
|
|
|
1834
1837
|
font_size: display_button_clear_all_font_size,
|
|
1835
1838
|
font_weight: display_button_clear_all_font_weight,
|
|
1836
1839
|
text_transform: display_button_clear_all_text_transform
|
|
1837
|
-
} = ((
|
|
1838
|
-
const { title_confirm_clear_all_wishlist, text_confirm_clear_all_wishlist, button_submit_confirm_clear_all_wishlist, button_cancel_confirm_clear_all_wishlist } = ((
|
|
1839
|
-
const { button_clear_all } = ((
|
|
1840
|
+
} = ((_b = (_a = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a.widget) == null ? void 0 : _b.button_clear_all) || {};
|
|
1841
|
+
const { title_confirm_clear_all_wishlist, text_confirm_clear_all_wishlist, button_submit_confirm_clear_all_wishlist, button_cancel_confirm_clear_all_wishlist } = ((_c = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _c.popup) || {};
|
|
1842
|
+
const { button_clear_all } = ((_d = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _d.widget) || {};
|
|
1840
1843
|
const [isRequiredLogin, setIsRequiredLogin] = React__default.useState(false);
|
|
1841
1844
|
const display_button_clear_all_style = {
|
|
1842
1845
|
...display_button_clear_all_text_color && { color: display_button_clear_all_text_color },
|
|
@@ -1852,25 +1855,41 @@ const WidgetHeaderClearTrigger = ({ buttonText, shareId, dataSettings, isFirstLo
|
|
|
1852
1855
|
...display_button_clear_all_text_transform && { textTransform: display_button_clear_all_text_transform }
|
|
1853
1856
|
};
|
|
1854
1857
|
React__default.useEffect(() => {
|
|
1858
|
+
var _a2;
|
|
1859
|
+
const { is_required_login } = ((_a2 = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a2.global) || {};
|
|
1855
1860
|
setIsRequiredLogin(sledgeAnonymId && is_required_login);
|
|
1856
|
-
}, [sledgeAnonymId]);
|
|
1857
|
-
const handleClick = () => {
|
|
1861
|
+
}, [sledgeAnonymId, dataSettings]);
|
|
1862
|
+
const handleClick = (props) => {
|
|
1858
1863
|
if (typeof window !== "undefined" && window.sledgeConfirmationPopup)
|
|
1859
1864
|
window.sledgeConfirmationPopup({
|
|
1860
1865
|
title: title_confirm_clear_all_wishlist,
|
|
1861
1866
|
message: text_confirm_clear_all_wishlist,
|
|
1862
1867
|
textSubmit: button_submit_confirm_clear_all_wishlist,
|
|
1868
|
+
textCancel: button_cancel_confirm_clear_all_wishlist,
|
|
1863
1869
|
buttonSubmitType: "danger",
|
|
1864
|
-
onSubmit: window.sledgeWishlistWidgetClearList || {}
|
|
1870
|
+
onSubmit: window.sledgeWishlistWidgetClearList || {},
|
|
1871
|
+
...props || {}
|
|
1865
1872
|
});
|
|
1866
1873
|
};
|
|
1874
|
+
useEffectOnChange(() => {
|
|
1875
|
+
handleClick({ isPreviewSettings: true });
|
|
1876
|
+
}, [previewSettings]);
|
|
1867
1877
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !isRequiredLogin && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !shareId && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isFirstLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(SkeletonLoading.Item, { width: "132px", height: "46px", color: "lighten", rounded: "md" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-wishlist__widget-header-item sledge-wishlist__widget-header-clear-all-trigger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "button", colorType: "danger", onClick: handleClick, style: display_button_clear_all_style, children: buttonText ? buttonText : button_clear_all || "Clear Wishlist" }) }) }) }) });
|
|
1868
1878
|
};
|
|
1869
|
-
const WidgetHeaderShareTrigger = ({
|
|
1870
|
-
|
|
1879
|
+
const WidgetHeaderShareTrigger = ({
|
|
1880
|
+
wishlistData,
|
|
1881
|
+
buttonText,
|
|
1882
|
+
showShareTrigger,
|
|
1883
|
+
shareLink,
|
|
1884
|
+
shareId,
|
|
1885
|
+
dataSettings,
|
|
1886
|
+
isFirstLoading,
|
|
1887
|
+
triggerBadge,
|
|
1888
|
+
previewSettings
|
|
1889
|
+
}) => {
|
|
1890
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1871
1891
|
const { triggerRenderMultipleComponent, sledgeAnonymId, isJsVersion } = React__default.useContext(SledgeContext);
|
|
1872
1892
|
const { trigger: triggerRenderWishlistBadge } = ((_a = triggerRenderMultipleComponent == null ? void 0 : triggerRenderMultipleComponent.wishlist) == null ? void 0 : _a.badge) || {};
|
|
1873
|
-
const { is_required_login } = ((_b = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _b.global) || {};
|
|
1874
1893
|
const {
|
|
1875
1894
|
text_color: display_button_share_text_color,
|
|
1876
1895
|
border_color: display_button_share_border_color,
|
|
@@ -1883,11 +1902,11 @@ const WidgetHeaderShareTrigger = ({ wishlistData, buttonText, showShareTrigger,
|
|
|
1883
1902
|
font_size: display_button_share_font_size,
|
|
1884
1903
|
font_weight: display_button_share_font_weight,
|
|
1885
1904
|
text_transform: display_button_share_text_transform
|
|
1886
|
-
} = ((
|
|
1887
|
-
const { title_share_wishlist, title_confirm_add_to_your_wishlist, text_confirm_add_to_your_wishlist, button_confirm_add_to_your_wishlist } = ((
|
|
1888
|
-
const { button_share, button_add_to_your_wishlist } = ((
|
|
1889
|
-
const { show: show_notification, location: location_notification } = ((
|
|
1890
|
-
const { title_added_all_to_wishlist, text_added_all_to_wishlist, title_fail_add_to_wishlist, text_fail_add_to_wishlist } = ((
|
|
1905
|
+
} = ((_c = (_b = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _b.widget) == null ? void 0 : _c.button_share) || {};
|
|
1906
|
+
const { title_share_wishlist, title_confirm_add_to_your_wishlist, text_confirm_add_to_your_wishlist, button_confirm_add_to_your_wishlist } = ((_d = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _d.popup) || {};
|
|
1907
|
+
const { button_share, button_add_to_your_wishlist } = ((_e = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _e.widget) || {};
|
|
1908
|
+
const { show: show_notification, location: location_notification } = ((_f = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _f.notification) || {};
|
|
1909
|
+
const { title_added_all_to_wishlist, text_added_all_to_wishlist, title_fail_add_to_wishlist, text_fail_add_to_wishlist } = ((_g = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _g.notification) || {};
|
|
1891
1910
|
const [isRequiredLogin, setIsRequiredLogin] = React__default.useState(false);
|
|
1892
1911
|
const display_button_share_style = {
|
|
1893
1912
|
...display_button_share_text_color && { color: display_button_share_text_color },
|
|
@@ -1985,7 +2004,7 @@ const WidgetHeaderShareTrigger = ({ wishlistData, buttonText, showShareTrigger,
|
|
|
1985
2004
|
});
|
|
1986
2005
|
}
|
|
1987
2006
|
};
|
|
1988
|
-
const handleClick = async () => {
|
|
2007
|
+
const handleClick = async (props) => {
|
|
1989
2008
|
let getMessage = text_confirm_add_to_your_wishlist;
|
|
1990
2009
|
if (getMessage)
|
|
1991
2010
|
getMessage = getMessage.replaceAll(OBJECT_DATA_STRING_KEY.TOTAL_WISHLIST, wishlistData.length);
|
|
@@ -1995,7 +2014,8 @@ const WidgetHeaderShareTrigger = ({ wishlistData, buttonText, showShareTrigger,
|
|
|
1995
2014
|
message: getMessage || `This action cannot be undone. This will adding <strong>${wishlistData.length}</strong> item to your wishlist page.`,
|
|
1996
2015
|
textSubmit: button_confirm_add_to_your_wishlist || "Add to your wishlist",
|
|
1997
2016
|
buttonSubmitType: "info",
|
|
1998
|
-
onSubmit: handleBulkAddWishlist || {}
|
|
2017
|
+
onSubmit: handleBulkAddWishlist || {},
|
|
2018
|
+
...props || {}
|
|
1999
2019
|
});
|
|
2000
2020
|
} else {
|
|
2001
2021
|
if (typeof window !== "undefined" && window.sledgeInfoPopup) {
|
|
@@ -2006,14 +2026,20 @@ const WidgetHeaderShareTrigger = ({ wishlistData, buttonText, showShareTrigger,
|
|
|
2006
2026
|
${clipboardIcon}
|
|
2007
2027
|
</div>
|
|
2008
2028
|
<div class="sledge-wishlist__widget-box-copy-content">${shareLink}</div>
|
|
2009
|
-
</div>` : ""
|
|
2029
|
+
</div>` : "",
|
|
2030
|
+
...props || {}
|
|
2010
2031
|
});
|
|
2011
2032
|
}
|
|
2012
2033
|
}
|
|
2013
2034
|
};
|
|
2014
2035
|
React__default.useEffect(() => {
|
|
2036
|
+
var _a2;
|
|
2037
|
+
const { is_required_login } = ((_a2 = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a2.global) || {};
|
|
2015
2038
|
setIsRequiredLogin(sledgeAnonymId && is_required_login);
|
|
2016
|
-
}, [sledgeAnonymId]);
|
|
2039
|
+
}, [sledgeAnonymId, dataSettings]);
|
|
2040
|
+
useEffectOnChange(() => {
|
|
2041
|
+
handleClick({ isPreviewSettings: true });
|
|
2042
|
+
}, [previewSettings]);
|
|
2017
2043
|
watchElement({
|
|
2018
2044
|
selector: ".sledge-wishlist__widget-box-copy",
|
|
2019
2045
|
init: handleCopyShareLink
|
|
@@ -2037,10 +2063,9 @@ const WidgetHeaderShareTrigger = ({ wishlistData, buttonText, showShareTrigger,
|
|
|
2037
2063
|
) }) }) }) });
|
|
2038
2064
|
};
|
|
2039
2065
|
const WidgetHeaderSearchForm = ({ setIsLoading, setKeyword, keyword, placeholder, dataSettings }) => {
|
|
2040
|
-
var _a
|
|
2066
|
+
var _a;
|
|
2041
2067
|
const { sledgeAnonymId } = React__default.useContext(SledgeContext);
|
|
2042
|
-
const {
|
|
2043
|
-
const { search_form_placeholder } = ((_b = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _b.widget) || {};
|
|
2068
|
+
const { search_form_placeholder } = ((_a = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _a.widget) || {};
|
|
2044
2069
|
const [isRequiredLogin, setIsRequiredLogin] = React__default.useState(false);
|
|
2045
2070
|
const searchFieldRef = React__default.useRef(null);
|
|
2046
2071
|
const handleResetField = () => {
|
|
@@ -2053,8 +2078,10 @@ const WidgetHeaderSearchForm = ({ setIsLoading, setKeyword, keyword, placeholder
|
|
|
2053
2078
|
setKeyword && setKeyword(value);
|
|
2054
2079
|
};
|
|
2055
2080
|
React__default.useEffect(() => {
|
|
2081
|
+
var _a2;
|
|
2082
|
+
const { is_required_login } = ((_a2 = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a2.global) || {};
|
|
2056
2083
|
setIsRequiredLogin(sledgeAnonymId && is_required_login);
|
|
2057
|
-
}, [sledgeAnonymId]);
|
|
2084
|
+
}, [sledgeAnonymId, dataSettings]);
|
|
2058
2085
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !isRequiredLogin && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2059
2086
|
SearchInputField,
|
|
2060
2087
|
{
|
|
@@ -2088,17 +2115,17 @@ const WidgetHeaderTitle = ({ text, dataSettings }) => {
|
|
|
2088
2115
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-wishlist__widget-header-item", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { style: display_header_title_style, children: text ? text : language_header_title || "My Wishlist" }) });
|
|
2089
2116
|
};
|
|
2090
2117
|
const WidgetHeaderLimit = ({ limitOptions, selectedLimit, setSelectedLimit, setIsRefreshWidgetList, dataSettings }) => {
|
|
2091
|
-
var _a;
|
|
2092
2118
|
const { sledgeAnonymId } = React__default.useContext(SledgeContext);
|
|
2093
|
-
const { is_required_login } = ((_a = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a.global) || {};
|
|
2094
2119
|
const [isRequiredLogin, setIsRequiredLogin] = React__default.useState(false);
|
|
2095
2120
|
const handleChangeLimit = (value) => {
|
|
2096
2121
|
setSelectedLimit && setSelectedLimit(value);
|
|
2097
2122
|
setIsRefreshWidgetList && setIsRefreshWidgetList(true);
|
|
2098
2123
|
};
|
|
2099
2124
|
React__default.useEffect(() => {
|
|
2125
|
+
var _a;
|
|
2126
|
+
const { is_required_login } = ((_a = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a.global) || {};
|
|
2100
2127
|
setIsRequiredLogin(sledgeAnonymId && is_required_login);
|
|
2101
|
-
}, [sledgeAnonymId]);
|
|
2128
|
+
}, [sledgeAnonymId, dataSettings]);
|
|
2102
2129
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !isRequiredLogin ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: limitOptions && Boolean(limitOptions == null ? void 0 : limitOptions.length) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-wishlist__widget-header-item sledge-wishlist__widget-header-limit-option", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2103
2130
|
SelectField,
|
|
2104
2131
|
{
|
|
@@ -2115,9 +2142,7 @@ const WidgetHeaderLimit = ({ limitOptions, selectedLimit, setSelectedLimit, setI
|
|
|
2115
2142
|
) }) }) : null });
|
|
2116
2143
|
};
|
|
2117
2144
|
const WidgetHeaderSort$1 = ({ wishlistSort, selectedSort, setSelectedSort, setIsRefreshWidgetList, dataSettings, generalDataSettings }) => {
|
|
2118
|
-
var _a;
|
|
2119
2145
|
const { sledgeAnonymId } = React__default.useContext(SledgeContext);
|
|
2120
|
-
const { is_required_login } = ((_a = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a.global) || {};
|
|
2121
2146
|
const { sort_placeholder } = (generalDataSettings == null ? void 0 : generalDataSettings.languages) || {};
|
|
2122
2147
|
const [isRequiredLogin, setIsRequiredLogin] = React__default.useState(false);
|
|
2123
2148
|
const handleChangeSort = (value) => {
|
|
@@ -2125,8 +2150,10 @@ const WidgetHeaderSort$1 = ({ wishlistSort, selectedSort, setSelectedSort, setIs
|
|
|
2125
2150
|
setIsRefreshWidgetList && setIsRefreshWidgetList(true);
|
|
2126
2151
|
};
|
|
2127
2152
|
React__default.useEffect(() => {
|
|
2153
|
+
var _a;
|
|
2154
|
+
const { is_required_login } = ((_a = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a.global) || {};
|
|
2128
2155
|
setIsRequiredLogin(sledgeAnonymId && is_required_login);
|
|
2129
|
-
}, [sledgeAnonymId]);
|
|
2156
|
+
}, [sledgeAnonymId, dataSettings]);
|
|
2130
2157
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !isRequiredLogin ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: wishlistSort && Boolean(wishlistSort == null ? void 0 : wishlistSort.length) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-wishlist__widget-header-item sledge-wishlist__widget-header-sort-option", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2131
2158
|
SelectField,
|
|
2132
2159
|
{
|
|
@@ -2200,26 +2227,26 @@ WidgetHeader$1.Sort = WidgetHeaderSort$1;
|
|
|
2200
2227
|
WidgetHeader$1.Limit = WidgetHeaderLimit;
|
|
2201
2228
|
const defaultGridType = "large";
|
|
2202
2229
|
const WidgetList = (props) => {
|
|
2203
|
-
var _a;
|
|
2204
2230
|
const { sledgeAnonymId } = React__default.useContext(SledgeContext);
|
|
2205
2231
|
const { isLoading, wishlistData, dataSettings, gridType = defaultGridType, isFlyout } = props || {};
|
|
2206
|
-
const { is_required_login } = ((_a = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a.global) || {};
|
|
2207
2232
|
const [isRequiredLogin, setIsRequiredLogin] = React__default.useState(false);
|
|
2208
2233
|
React__default.useEffect(() => {
|
|
2234
|
+
var _a;
|
|
2235
|
+
const { is_required_login } = ((_a = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a.global) || {};
|
|
2209
2236
|
setIsRequiredLogin(sledgeAnonymId && is_required_login);
|
|
2210
|
-
}, [sledgeAnonymId]);
|
|
2237
|
+
}, [sledgeAnonymId, dataSettings]);
|
|
2211
2238
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid, { count: 8, type: gridType, isFlyout }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-wishlist__widget-product-wrapper", children: !(wishlistData == null ? void 0 : wishlistData.length) || isRequiredLogin ? /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetListEmpty, { ...props, isRequiredLogin }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ProductWrapper, { ...props }) }) });
|
|
2212
2239
|
};
|
|
2213
2240
|
const WidgetListEmpty = (props) => {
|
|
2214
|
-
var _a;
|
|
2215
2241
|
const { onSearch, keyword, dataSettings, isRequiredLogin } = props || {};
|
|
2216
|
-
const { title_no_result, text_no_result, title_search_no_result, text_search_no_result, login_button, continue_shopping, alert, alert_login } = ((_a = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _a.widget) || {};
|
|
2217
2242
|
const [title, setTitle] = React__default.useState("");
|
|
2218
2243
|
const [description, setDescription] = React__default.useState("");
|
|
2219
2244
|
const [showButton, setShowButton] = React__default.useState(false);
|
|
2220
2245
|
const [textButton, setTextButton] = React__default.useState("");
|
|
2221
2246
|
const [urlButton, setUrlButton] = React__default.useState("");
|
|
2222
2247
|
React__default.useEffect(() => {
|
|
2248
|
+
var _a;
|
|
2249
|
+
const { title_no_result, text_no_result, title_search_no_result, text_search_no_result, login_button, continue_shopping, alert, alert_login } = ((_a = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _a.widget) || {};
|
|
2223
2250
|
if (isRequiredLogin) {
|
|
2224
2251
|
setTitle(alert_login || "Login required!");
|
|
2225
2252
|
setDescription(alert || "Please login to save your wishlist across devices.");
|
|
@@ -2235,7 +2262,7 @@ const WidgetListEmpty = (props) => {
|
|
|
2235
2262
|
setUrlButton("/");
|
|
2236
2263
|
}
|
|
2237
2264
|
}
|
|
2238
|
-
}, [onSearch, dataSettings]);
|
|
2265
|
+
}, [onSearch, isRequiredLogin, dataSettings]);
|
|
2239
2266
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-wishlist__widget-product-empty", children: [
|
|
2240
2267
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-wishlist__widget-product-empty-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeartIcon, { width: 32, height: 32, type: "outline", color: "#000000" }) }),
|
|
2241
2268
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-wishlist__widget-product-empty-title", dangerouslySetInnerHTML: { __html: title } }),
|
|
@@ -2492,7 +2519,7 @@ const WidgetRoot = (props) => {
|
|
|
2492
2519
|
}
|
|
2493
2520
|
};
|
|
2494
2521
|
const handleSetWishlistData = async (isLoadMore = false, init = false) => {
|
|
2495
|
-
var _a2, _b2, _c2
|
|
2522
|
+
var _a2, _b2, _c2;
|
|
2496
2523
|
const searchParams = new URLSearchParams(document.location.search);
|
|
2497
2524
|
const getShareId = (params == null ? void 0 : params.shareId) ? params.shareId : (searchParams == null ? void 0 : searchParams.get(queryShareId)) || "";
|
|
2498
2525
|
setIsLoading(isRefreshWidgetList ? true : !isLoadMore);
|
|
@@ -2503,7 +2530,6 @@ const WidgetRoot = (props) => {
|
|
|
2503
2530
|
let response;
|
|
2504
2531
|
let run = false;
|
|
2505
2532
|
let valueWishlistData;
|
|
2506
|
-
let valueWishlistSort;
|
|
2507
2533
|
let valueTotalPage = 0;
|
|
2508
2534
|
let queryParam = {
|
|
2509
2535
|
page: isLoadMore ? currentPage : 1,
|
|
@@ -2512,7 +2538,7 @@ const WidgetRoot = (props) => {
|
|
|
2512
2538
|
keyword,
|
|
2513
2539
|
shareId: getShareId,
|
|
2514
2540
|
locale: isJsVersion ? selectedLocaleJs() : locale,
|
|
2515
|
-
...wishlistPreviewSettings ? {
|
|
2541
|
+
...wishlistPreviewSettings && (generalPreviewSettings == null ? void 0 : generalPreviewSettings.use_dummy_data) ? {
|
|
2516
2542
|
is_preview: true
|
|
2517
2543
|
} : {}
|
|
2518
2544
|
};
|
|
@@ -2522,11 +2548,9 @@ const WidgetRoot = (props) => {
|
|
|
2522
2548
|
response = await getWishlist(queryParam);
|
|
2523
2549
|
run = ((_a2 = response == null ? void 0 : response.status) == null ? void 0 : _a2.code) === 200 || false;
|
|
2524
2550
|
valueWishlistData = !((_b2 = response.data) == null ? void 0 : _b2.length) ? [] : (prevState) => (wishlistData == null ? void 0 : wishlistData.length) && isLoadMore ? [...prevState, ...response.data] : response.data;
|
|
2525
|
-
|
|
2526
|
-
valueTotalPage = ((_d = response == null ? void 0 : response.page) == null ? void 0 : _d.total_page) || 1;
|
|
2551
|
+
valueTotalPage = ((_c2 = response == null ? void 0 : response.page) == null ? void 0 : _c2.total_page) || 1;
|
|
2527
2552
|
if (run) {
|
|
2528
2553
|
setWishlistData(valueWishlistData);
|
|
2529
|
-
setWishlistSort(valueWishlistSort);
|
|
2530
2554
|
setTotalPage(valueTotalPage);
|
|
2531
2555
|
setIsLoading(false);
|
|
2532
2556
|
setIsRefreshWidgetList(false);
|
|
@@ -2544,7 +2568,7 @@ const WidgetRoot = (props) => {
|
|
|
2544
2568
|
let valueShareLink;
|
|
2545
2569
|
let valueShareId;
|
|
2546
2570
|
let queryParam = {
|
|
2547
|
-
...wishlistPreviewSettings ? {
|
|
2571
|
+
...wishlistPreviewSettings && (generalPreviewSettings == null ? void 0 : generalPreviewSettings.use_dummy_data) ? {
|
|
2548
2572
|
is_preview: true
|
|
2549
2573
|
} : {}
|
|
2550
2574
|
};
|
|
@@ -2573,7 +2597,9 @@ const WidgetRoot = (props) => {
|
|
|
2573
2597
|
responseGeneral = generalPreviewSettings || JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING) || null);
|
|
2574
2598
|
if (!response)
|
|
2575
2599
|
return;
|
|
2600
|
+
const { sorts } = response == null ? void 0 : response.display;
|
|
2576
2601
|
setDataSettings(response);
|
|
2602
|
+
setWishlistSort(sorts);
|
|
2577
2603
|
if (responseGeneral)
|
|
2578
2604
|
setGeneralDataSettings(responseGeneral);
|
|
2579
2605
|
};
|
|
@@ -2745,7 +2771,8 @@ const Badge = (props) => {
|
|
|
2745
2771
|
setData(valueData);
|
|
2746
2772
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_KEY.WISHLIST_BADGE_COUNTER, valueTotalWishlist);
|
|
2747
2773
|
},
|
|
2748
|
-
wishlistPreviewSettings
|
|
2774
|
+
wishlistPreviewSettings,
|
|
2775
|
+
generalPreviewSettings
|
|
2749
2776
|
});
|
|
2750
2777
|
};
|
|
2751
2778
|
const handleSettings = async (LOCAL_STORAGE_WISHLIST_SETTING) => {
|
|
@@ -3183,7 +3210,7 @@ const Trigger = (props) => {
|
|
|
3183
3210
|
const handleCheckWishlist = async () => {
|
|
3184
3211
|
let response;
|
|
3185
3212
|
let queryParam = {
|
|
3186
|
-
...wishlistPreviewSettings ? {
|
|
3213
|
+
...wishlistPreviewSettings && (generalPreviewSettings == null ? void 0 : generalPreviewSettings.use_dummy_data) ? {
|
|
3187
3214
|
is_preview: true
|
|
3188
3215
|
} : {}
|
|
3189
3216
|
};
|
|
@@ -3218,20 +3245,11 @@ const Trigger = (props) => {
|
|
|
3218
3245
|
handleConfirmationPopup();
|
|
3219
3246
|
return;
|
|
3220
3247
|
}
|
|
3221
|
-
let resAddWishlist =
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
productVendor: "",
|
|
3227
|
-
productSku: "",
|
|
3228
|
-
productVariantName: "",
|
|
3229
|
-
productLink: "",
|
|
3230
|
-
productImage: "",
|
|
3231
|
-
productCurrency: "",
|
|
3232
|
-
productPrice: ""
|
|
3233
|
-
} : params
|
|
3234
|
-
);
|
|
3248
|
+
let resAddWishlist = wishlistPreviewSettings ? {
|
|
3249
|
+
status: {
|
|
3250
|
+
code: 200
|
|
3251
|
+
}
|
|
3252
|
+
} : await addWishlist(params);
|
|
3235
3253
|
const { status, data } = resAddWishlist || {};
|
|
3236
3254
|
const { code } = status || {};
|
|
3237
3255
|
const { product } = data || {};
|
|
@@ -3259,7 +3277,8 @@ const Trigger = (props) => {
|
|
|
3259
3277
|
if (window.sledgeWishlistButtonDetailUpdate)
|
|
3260
3278
|
window.sledgeWishlistButtonDetailUpdate();
|
|
3261
3279
|
}
|
|
3262
|
-
|
|
3280
|
+
if (!wishlistPreviewSettings)
|
|
3281
|
+
handleCheckWishlist();
|
|
3263
3282
|
if (!isWishlist) {
|
|
3264
3283
|
handleFunctions.onAfterAddWishlist && handleFunctions.onAfterAddWishlist("success");
|
|
3265
3284
|
} else {
|
|
@@ -3434,7 +3453,7 @@ const Rating = (props) => {
|
|
|
3434
3453
|
const { isRenderApp, triggerRenderMultipleComponent } = React__default.useContext(SledgeContext);
|
|
3435
3454
|
const { productReview: isRenderAppProductReview } = isRenderApp || {};
|
|
3436
3455
|
const { value: valueRenderProductReviewRating, trigger: triggerRenderProductReviewRating } = ((_a = triggerRenderMultipleComponent == null ? void 0 : triggerRenderMultipleComponent.productReview) == null ? void 0 : _a.rating) || {};
|
|
3437
|
-
const { productReviewPreviewSettings, previewSettings } = usePreviewSettings({
|
|
3456
|
+
const { generalPreviewSettings, productReviewPreviewSettings, previewSettings } = usePreviewSettings({
|
|
3438
3457
|
defaultSettings: previewSettingsProp,
|
|
3439
3458
|
nestedProperty: "sledge.productReview.rating.preview"
|
|
3440
3459
|
});
|
|
@@ -3472,7 +3491,7 @@ const Rating = (props) => {
|
|
|
3472
3491
|
let valueTotalReview = 0;
|
|
3473
3492
|
let valueAverageReview;
|
|
3474
3493
|
let queryParam = {
|
|
3475
|
-
...productReviewPreviewSettings ? {
|
|
3494
|
+
...productReviewPreviewSettings && (generalPreviewSettings == null ? void 0 : generalPreviewSettings.use_dummy_data) ? {
|
|
3476
3495
|
is_preview: true
|
|
3477
3496
|
} : {}
|
|
3478
3497
|
};
|
|
@@ -3737,7 +3756,7 @@ const WidgetHeaderSummary = (props) => {
|
|
|
3737
3756
|
var _a, _b, _c, _d, _e;
|
|
3738
3757
|
const { isRenderApp } = React__default.useContext(SledgeContext);
|
|
3739
3758
|
const { productReview: isRenderAppProductReview } = isRenderApp || {};
|
|
3740
|
-
const { params, dataSettings, summaryData, sledgeSettings, productReviewPreviewSettings } = props;
|
|
3759
|
+
const { params, dataSettings, summaryData, sledgeSettings, generalPreviewSettings, productReviewPreviewSettings } = props;
|
|
3741
3760
|
const { productId } = params || {};
|
|
3742
3761
|
const { fill_color: display_summary_bar_fill_color, outline_color: display_summary_bar_outline_color } = ((_b = (_a = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _a.widget) == null ? void 0 : _b.summary_bar) || {};
|
|
3743
3762
|
const { fill_color = "#23BC45", outline_color = "#8D9196" } = ((_c = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _c.rating) || {};
|
|
@@ -3769,7 +3788,7 @@ const WidgetHeaderSummary = (props) => {
|
|
|
3769
3788
|
let valueRatingList;
|
|
3770
3789
|
let valueAverageReview;
|
|
3771
3790
|
let queryParam = {
|
|
3772
|
-
...productReviewPreviewSettings ? {
|
|
3791
|
+
...productReviewPreviewSettings && (generalPreviewSettings == null ? void 0 : generalPreviewSettings.use_dummy_data) ? {
|
|
3773
3792
|
is_preview: true
|
|
3774
3793
|
} : {}
|
|
3775
3794
|
};
|
|
@@ -4651,7 +4670,7 @@ const ProductGrid = React__default.memo((props) => {
|
|
|
4651
4670
|
setClickedAddToCartId(null);
|
|
4652
4671
|
onAfterAddToCart && onAfterAddToCart("success");
|
|
4653
4672
|
if (redirect_add_to_cart) {
|
|
4654
|
-
window.location.href = "/cart";
|
|
4673
|
+
window.location.href = (generalDataSettings == null ? void 0 : generalDataSettings.cart_url) || "/cart";
|
|
4655
4674
|
} else {
|
|
4656
4675
|
window.sledgeToastNotification({
|
|
4657
4676
|
title: "Cart added",
|
|
@@ -6766,7 +6785,7 @@ const FilterSelected$2 = (props) => {
|
|
|
6766
6785
|
handleFilterChange,
|
|
6767
6786
|
allowedFilterSlider
|
|
6768
6787
|
} = props;
|
|
6769
|
-
const { language_filter, language_clear_filter } = languageSettings || {};
|
|
6788
|
+
const { filter: language_filter, clear_filter: language_clear_filter } = languageSettings || {};
|
|
6770
6789
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: Boolean((items == null ? void 0 : items.length) && ((_a = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _a.show_refine_by_block)) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-item", children: [
|
|
6771
6790
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-item-title-refine", children: [
|
|
6772
6791
|
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { className: "sledge-instant-search__result-filter-item-title-refine-heading", children: language_filter || "Filter" }),
|
|
@@ -7070,6 +7089,7 @@ const FilterItem = (props) => {
|
|
|
7070
7089
|
filter,
|
|
7071
7090
|
filterSettings,
|
|
7072
7091
|
indexFilter,
|
|
7092
|
+
filterTitleStyle,
|
|
7073
7093
|
deviceType,
|
|
7074
7094
|
clickedOpenFilterHorizontalId,
|
|
7075
7095
|
setClickedOpenFilterHorizontalId,
|
|
@@ -7107,6 +7127,7 @@ const FilterItem = (props) => {
|
|
|
7107
7127
|
}
|
|
7108
7128
|
},
|
|
7109
7129
|
className: isHorizontalGroup ? "sledge-instant-search__result-filter-trigger-horizontal-group" : `${isLastIndex ? (allowedFilter == null ? void 0 : allowedFilter.length) % 2 ? "sledge-instant-search__result-filter-trigger-odd" : "sledge-instant-search__result-filter-trigger-even" : ""}`,
|
|
7130
|
+
style: filterTitleStyle,
|
|
7110
7131
|
children: [
|
|
7111
7132
|
label,
|
|
7112
7133
|
/* @__PURE__ */ jsxRuntimeExports.jsx(motion.div, { initial: "closed", animate: isOpenFilterHorizontal ? "open" : "closed", variants: ROTATE_FILTER_ARROW_ANIMATION, className: "sort-trigger-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronArrowDownIcon, { width: 20, height: 20, color: "#000000" }) })
|
|
@@ -7147,7 +7168,7 @@ const FilterSelected$1 = (props) => {
|
|
|
7147
7168
|
handleFilterChange,
|
|
7148
7169
|
allowedFilterSlider
|
|
7149
7170
|
} = props;
|
|
7150
|
-
const { language_clear_filter } = languageSettings || {};
|
|
7171
|
+
const { clear_filter: language_clear_filter } = languageSettings || {};
|
|
7151
7172
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: Boolean((items == null ? void 0 : items.length) && ((_a = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _a.show_refine_by_block)) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-horizontal", children: [
|
|
7152
7173
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all", onClick: handleFilterReset, children: language_clear_filter || "Clear All" }),
|
|
7153
7174
|
items.map((item, index) => {
|
|
@@ -7177,6 +7198,7 @@ const FilterHorizontal = (props) => {
|
|
|
7177
7198
|
const {
|
|
7178
7199
|
items = [],
|
|
7179
7200
|
filterSettings = null,
|
|
7201
|
+
filterTitleStyle = {},
|
|
7180
7202
|
deviceType = "desktop",
|
|
7181
7203
|
clickedOpenFilterHorizontalId,
|
|
7182
7204
|
setClickedOpenFilterHorizontalId,
|
|
@@ -7216,6 +7238,7 @@ const FilterHorizontal = (props) => {
|
|
|
7216
7238
|
filter,
|
|
7217
7239
|
filterSettings,
|
|
7218
7240
|
indexFilter,
|
|
7241
|
+
filterTitleStyle,
|
|
7219
7242
|
deviceType,
|
|
7220
7243
|
clickedOpenFilterHorizontalId,
|
|
7221
7244
|
setClickedOpenFilterHorizontalId,
|
|
@@ -7264,7 +7287,7 @@ const FilterSelected = (props) => {
|
|
|
7264
7287
|
handleFilterChange,
|
|
7265
7288
|
allowedFilterSlider
|
|
7266
7289
|
} = props;
|
|
7267
|
-
const { language_clear_filter } = languageSettings || {};
|
|
7290
|
+
const { clear_filter: language_clear_filter } = languageSettings || {};
|
|
7268
7291
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: Boolean((items == null ? void 0 : items.length) && ((_a = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _a.show_refine_by_block)) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-horizontal sledge-instant-search__result-filter-active", children: [
|
|
7269
7292
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all", onClick: handleFilterReset, children: language_clear_filter || "Clear All" }),
|
|
7270
7293
|
items.map((item, index) => {
|
|
@@ -8982,11 +9005,13 @@ const SearchResultWidget = (props) => {
|
|
|
8982
9005
|
setUsePublishedFilter(use_published_filter);
|
|
8983
9006
|
setShowOutOfStock(show_out_of_stock);
|
|
8984
9007
|
setTabs(tabs2);
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
9008
|
+
if (!clickedTabIndexId) {
|
|
9009
|
+
getFirstIndex = (_b2 = tabs2 == null ? void 0 : tabs2.find) == null ? void 0 : _b2.call(tabs2, ({ index }) => index.includes(index_product));
|
|
9010
|
+
if (Object.keys(getFirstIndex).length) {
|
|
9011
|
+
setClickedTabIndexId(getFirstIndex.index);
|
|
9012
|
+
setClickedTabIndexName(getFirstIndex.name);
|
|
9013
|
+
setClickedTabIndexType(getFirstIndex.type);
|
|
9014
|
+
}
|
|
8990
9015
|
}
|
|
8991
9016
|
setIsLoadingSetting(false);
|
|
8992
9017
|
if (isPreviewSettings) {
|
|
@@ -9005,16 +9030,14 @@ const SearchResultWidget = (props) => {
|
|
|
9005
9030
|
}
|
|
9006
9031
|
}
|
|
9007
9032
|
setAllowedTabs(
|
|
9008
|
-
(_g2 = (_f2 = (_e2 =
|
|
9033
|
+
(_g2 = (_f2 = (_e2 = tabs2 == null ? void 0 : tabs2.map) == null ? void 0 : _e2.call(tabs2, (allowedTab) => {
|
|
9009
9034
|
var _a3, _b3;
|
|
9010
|
-
const {
|
|
9011
|
-
|
|
9012
|
-
return;
|
|
9013
|
-
const newName = ((_b3 = (_a3 = tabs2 == null ? void 0 : tabs2.find) == null ? void 0 : _a3.call(tabs2, (tab) => (tab == null ? void 0 : tab.type) === type)) == null ? void 0 : _b3.name) || name;
|
|
9035
|
+
const { type } = allowedTab;
|
|
9036
|
+
const total = ((_b3 = (_a3 = allowedTabs == null ? void 0 : allowedTabs.find) == null ? void 0 : _a3.call(allowedTabs, (tab) => (tab == null ? void 0 : tab.type) === type)) == null ? void 0 : _b3.total) || 0;
|
|
9014
9037
|
return {
|
|
9015
9038
|
...allowedTab,
|
|
9016
9039
|
...{
|
|
9017
|
-
|
|
9040
|
+
total
|
|
9018
9041
|
}
|
|
9019
9042
|
};
|
|
9020
9043
|
})) == null ? void 0 : _f2.filter) == null ? void 0 : _g2.call(_f2, (item) => item)
|
|
@@ -9329,17 +9352,22 @@ const SearchResultWidget = (props) => {
|
|
|
9329
9352
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", {}),
|
|
9330
9353
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "The products and collections will become visible in the widgets once indexing is complete." })
|
|
9331
9354
|
] }) : null;
|
|
9355
|
+
const tabItems = instantSearchPreviewSettings ? (_y = (_x = (_w = tabs == null ? void 0 : tabs.map) == null ? void 0 : _w.call(tabs, (allowedTab) => {
|
|
9356
|
+
var _a2, _b2;
|
|
9357
|
+
const { type } = allowedTab;
|
|
9358
|
+
const total = ((_b2 = (_a2 = allowedTabs == null ? void 0 : allowedTabs.find) == null ? void 0 : _a2.call(allowedTabs, (tab) => (tab == null ? void 0 : tab.type) === type)) == null ? void 0 : _b2.total) || 0;
|
|
9359
|
+
if (!(activeTabs == null ? void 0 : activeTabs[type]))
|
|
9360
|
+
return;
|
|
9361
|
+
return {
|
|
9362
|
+
...allowedTab,
|
|
9363
|
+
...{
|
|
9364
|
+
total
|
|
9365
|
+
}
|
|
9366
|
+
};
|
|
9367
|
+
})) == null ? void 0 : _x.filter) == null ? void 0 : _y.call(_x, (item) => item) : allowedTabs;
|
|
9332
9368
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-container", ref: searchResultContainerRef, style: containerStyle, children: [
|
|
9333
9369
|
alertFirstSyncComponent,
|
|
9334
|
-
isFirstLoading ? tabSkeleton : layoutType === "default" && (allowedTabs == null ? void 0 : allowedTabs.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9335
|
-
Tab,
|
|
9336
|
-
{
|
|
9337
|
-
items: instantSearchPreviewSettings ? (_y = (_x = (_w = allowedTabs == null ? void 0 : allowedTabs.map) == null ? void 0 : _w.call(allowedTabs, (allowedTab) => (activeTabs == null ? void 0 : activeTabs[allowedTab == null ? void 0 : allowedTab.type]) ? allowedTab : null)) == null ? void 0 : _x.filter) == null ? void 0 : _y.call(_x, (item) => item) : allowedTabs,
|
|
9338
|
-
layoutType,
|
|
9339
|
-
clickedTabIndexId,
|
|
9340
|
-
handleChangeTab: handleChangeTabIndex
|
|
9341
|
-
}
|
|
9342
|
-
) : tabSkeleton,
|
|
9370
|
+
isFirstLoading ? tabSkeleton : layoutType === "default" && (allowedTabs == null ? void 0 : allowedTabs.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { items: tabItems, layoutType, clickedTabIndexId, handleChangeTab: handleChangeTabIndex }) : tabSkeleton,
|
|
9343
9371
|
isFirstLoading && (layoutType == null ? void 0 : layoutType.length) && !propsData ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
9344
9372
|
mobileFilterWithSearchAndSelectOptionSkeleton,
|
|
9345
9373
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__hide-element-lg-on-mobile", children: filterHorizontalSkeleton }),
|
|
@@ -9806,9 +9834,10 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9806
9834
|
return;
|
|
9807
9835
|
const { hits, processingTimeMs, totalHits, totalPages, facetDistribution } = result;
|
|
9808
9836
|
const updateTabs = () => {
|
|
9809
|
-
|
|
9837
|
+
const valueAllowedTabs = objectPresent(previewSettings) ? tabs : allowedTabs;
|
|
9838
|
+
if (valueAllowedTabs == null ? void 0 : valueAllowedTabs.length) {
|
|
9810
9839
|
setAllowedTabs == null ? void 0 : setAllowedTabs(
|
|
9811
|
-
|
|
9840
|
+
valueAllowedTabs.map((tab) => {
|
|
9812
9841
|
var _a3, _b3, _c2;
|
|
9813
9842
|
const { index, total } = tab;
|
|
9814
9843
|
let isCurrentIndex = index.includes(clickedTabIndexId);
|
|
@@ -9827,6 +9856,8 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9827
9856
|
);
|
|
9828
9857
|
}
|
|
9829
9858
|
};
|
|
9859
|
+
if (objectPresent(previewSettings))
|
|
9860
|
+
updateTabs();
|
|
9830
9861
|
if (isFirstTimeOrOnSearch || isNoneFacetSelected) {
|
|
9831
9862
|
handleSetInitStates == null ? void 0 : handleSetInitStates({
|
|
9832
9863
|
results: resultData,
|
|
@@ -9980,6 +10011,9 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9980
10011
|
});
|
|
9981
10012
|
}
|
|
9982
10013
|
}, [isReplaceWidgetList, clickedTabIndexId]);
|
|
10014
|
+
useEffectOnChange(() => {
|
|
10015
|
+
setSummaryText(summaryTextGenerator(totalSearchResult));
|
|
10016
|
+
}, [previewSettings]);
|
|
9983
10017
|
let dataClickedFacets = handleDataClickedFacets();
|
|
9984
10018
|
let keepCounterFacets = [];
|
|
9985
10019
|
allowedFilter == null ? void 0 : allowedFilter.map((filter) => {
|
|
@@ -10115,6 +10149,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10115
10149
|
const defaultProps = {
|
|
10116
10150
|
items: allowedFilter,
|
|
10117
10151
|
filterSettings,
|
|
10152
|
+
filterTitleStyle: filter_title_style,
|
|
10118
10153
|
clickedOpenFilterHorizontalId,
|
|
10119
10154
|
setClickedOpenFilterHorizontalId,
|
|
10120
10155
|
clickedOpenFilterHorizontalMobileId,
|