@sledge-app/react-instant-search 2.0.69 → 2.0.71
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.
|
@@ -2886,6 +2886,7 @@ const Badge = (props) => {
|
|
|
2886
2886
|
const [isRequiredLogin, setIsRequiredLogin] = React__default.useState(false);
|
|
2887
2887
|
const [data, setData] = React__default.useState({});
|
|
2888
2888
|
const [openFlyoutWishlistWidget, setOpenFlyoutWishlistWidget] = React__default.useState(false);
|
|
2889
|
+
const [shouldMountWidget, setShouldMountWidget] = React__default.useState(false);
|
|
2889
2890
|
const { use_wishlist_flyout } = ((_b = dataSettings == null ? void 0 : dataSettings.display) == null ? void 0 : _b.widget) || {};
|
|
2890
2891
|
const { floating_button_type } = (dataSettings == null ? void 0 : dataSettings.launch_point) || {};
|
|
2891
2892
|
const { alert_login, alert, login_button, header_title: language_header_title, see_all_wishlist } = ((_c = dataSettings == null ? void 0 : dataSettings.languages) == null ? void 0 : _c.widget) || {};
|
|
@@ -2969,6 +2970,10 @@ const Badge = (props) => {
|
|
|
2969
2970
|
triggerRenderWishlistBadge(false);
|
|
2970
2971
|
handleGetWishlistInfo();
|
|
2971
2972
|
}, [valueRenderWishlistBadge, isRenderAppWishlist]);
|
|
2973
|
+
React__default.useEffect(() => {
|
|
2974
|
+
if (openFlyoutWishlistWidget)
|
|
2975
|
+
setShouldMountWidget(true);
|
|
2976
|
+
}, [openFlyoutWishlistWidget]);
|
|
2972
2977
|
const mainClassName = "sledge-wishlist__badge-wrapper";
|
|
2973
2978
|
let productCardsComponent = null;
|
|
2974
2979
|
if (React__default.Children.count(children)) {
|
|
@@ -3099,10 +3104,10 @@ const Badge = (props) => {
|
|
|
3099
3104
|
...sledgeAnonymId && !is_required_login ? {
|
|
3100
3105
|
flyoutInfoContent: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { dangerouslySetInnerHTML: { __html: alert || "Please login to save your wishlist across devices." } })
|
|
3101
3106
|
} : {},
|
|
3102
|
-
content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-flyout-widget__wishlist-content", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Widget.Root, { isFlyout: useWishlistFlyout, children: [
|
|
3107
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-flyout-widget__wishlist-content", children: shouldMountWidget ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Widget.Root, { isFlyout: useWishlistFlyout, dataInfo: data, children: [
|
|
3103
3108
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CustomComponents, { productCard: productCardsComponent }),
|
|
3104
3109
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Widget.List, {})
|
|
3105
|
-
] }) }),
|
|
3110
|
+
] }) : null }),
|
|
3106
3111
|
footer: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-flyout-widget__wishlist-footer", children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: urlWishlistWidget, className: "sledge-flyout-widget__wishlist-see-all-button", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "button", colorType: "success", fullWidth: true, children: see_all_wishlist || "See All Wishlist" }) }) }),
|
|
3107
3112
|
open: openFlyoutWishlistWidget,
|
|
3108
3113
|
setOpen: setOpenFlyoutWishlistWidget,
|
|
@@ -5834,8 +5839,16 @@ const FlyoutSidebar = ({ title, content, footer = null, open, setOpen, position
|
|
|
5834
5839
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__flyout-close-field-wrapper", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "sledge__flyout-close-field", type: "button", onClick: () => setOpen(false), children: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseIcon, { width: 14, height: 14, color: "#393d4e" }) }) })
|
|
5835
5840
|
] }),
|
|
5836
5841
|
flyoutInfoContent ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__flyout-mobile-info", children: flyoutInfoContent }) : null,
|
|
5837
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5838
|
-
|
|
5842
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5843
|
+
"div",
|
|
5844
|
+
{
|
|
5845
|
+
ref: contentContainerRef,
|
|
5846
|
+
className: `sledge__flyout-mobile-content ${showBlurEffect ? "sledge__flyout-mobile-content-blur-effect" : ""}`,
|
|
5847
|
+
style: isLoading ? { display: "none" } : void 0,
|
|
5848
|
+
children: content
|
|
5849
|
+
}
|
|
5850
|
+
),
|
|
5851
|
+
footer ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__flyout-mobile-footer", style: isLoading ? { display: "none" } : void 0, children: footer }) : null
|
|
5839
5852
|
] })
|
|
5840
5853
|
] }),
|
|
5841
5854
|
document.body
|
|
@@ -10773,16 +10786,16 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10773
10786
|
sort = sort.map((item) => {
|
|
10774
10787
|
var _a3;
|
|
10775
10788
|
if (item.includes("featuredSort.")) {
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
collectionAllId: instantSearchSettings == null ? void 0 : instantSearchSettings.collections_all_id
|
|
10780
|
-
});
|
|
10781
|
-
return sortMap[collectionDefaultSortBy];
|
|
10789
|
+
const collectionIdSelected = collectionId || (instantSearchSettings == null ? void 0 : instantSearchSettings.collections_all_id) || "";
|
|
10790
|
+
if (collectionIdSelected && ((_a3 = instantSearchSettings == null ? void 0 : instantSearchSettings.have_merchandising_settings) == null ? void 0 : _a3[collectionIdSelected])) {
|
|
10791
|
+
return `merchandising.${collectionIdSelected}.position:asc`;
|
|
10782
10792
|
} else {
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10793
|
+
if (collectionDefaultSortBy && (instantSearchSettings == null ? void 0 : instantSearchSettings.featured_as_collection_default_sort)) {
|
|
10794
|
+
const sortMap = getSortMap({
|
|
10795
|
+
activeCollectionId: collectionId,
|
|
10796
|
+
collectionAllId: instantSearchSettings == null ? void 0 : instantSearchSettings.collections_all_id
|
|
10797
|
+
});
|
|
10798
|
+
return sortMap[collectionDefaultSortBy];
|
|
10786
10799
|
}
|
|
10787
10800
|
}
|
|
10788
10801
|
}
|