@sledge-app/react-instant-search 0.0.47 → 0.0.49
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 +1 -2
- package/dist/components/ProductFilterWidget/ProductFilterWidget.d.ts.map +1 -1
- package/dist/components/SearchResultWidget/SearchResultWidget.d.ts +1 -2
- package/dist/components/SearchResultWidget/SearchResultWidget.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 +18 -18
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import { j as jsxRuntimeExports, $ as $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,
|
|
|
2
2
|
import React__default, { createElement } from "react";
|
|
3
3
|
import { SledgeContext } from "@sledge-app/core";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
const ProductFilterWidget =
|
|
5
|
+
const ProductFilterWidget = (props) => {
|
|
6
6
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(SearchResultWidget, { layoutType: "product-filter", ...props });
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
const API_URL = "https://sledge-api-preprod.offstack.io";
|
|
9
9
|
const INSTANT_SEARCH_ENGINE_URL = "https://instant-search-engine.offstack.io";
|
|
10
10
|
const LOCAL_STORAGE_KEY = {
|
|
@@ -629,7 +629,7 @@ const addToCartTrigger$1 = async (data) => {
|
|
|
629
629
|
};
|
|
630
630
|
const ButtonDetail = "";
|
|
631
631
|
const Trigger$1 = "";
|
|
632
|
-
const Trigger =
|
|
632
|
+
const Trigger = (props) => {
|
|
633
633
|
var _a, _b, _c;
|
|
634
634
|
const { data, forceActive = false, hidden = false, onAfterAddWishlist, onAfterRemoveWishlist } = props;
|
|
635
635
|
const { productId, productVariantId } = data || {};
|
|
@@ -733,7 +733,7 @@ const Trigger = React__default.memo((props) => {
|
|
|
733
733
|
setIsLoading(false);
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
|
-
React__default.
|
|
736
|
+
React__default.useMemo(() => {
|
|
737
737
|
if (!(isRenderApp == null ? void 0 : isRenderApp.wishlist))
|
|
738
738
|
return;
|
|
739
739
|
if (typeof window !== "undefined") {
|
|
@@ -779,7 +779,7 @@ const Trigger = React__default.memo((props) => {
|
|
|
779
779
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeartIcon, { width: 16.67, height: 15.83, type: typeIcon, color: colorIcon })
|
|
780
780
|
}
|
|
781
781
|
) }) });
|
|
782
|
-
}
|
|
782
|
+
};
|
|
783
783
|
const Widget$1 = "";
|
|
784
784
|
const WidgetHeaderClearTrigger = ({ buttonText, shareId, dataSettings, isFirstLoading }) => {
|
|
785
785
|
var _a, _b, _c, _d, _e;
|
|
@@ -1170,7 +1170,7 @@ const getReviewInfo = async (id) => {
|
|
|
1170
1170
|
return;
|
|
1171
1171
|
});
|
|
1172
1172
|
};
|
|
1173
|
-
const Rating =
|
|
1173
|
+
const Rating = (props) => {
|
|
1174
1174
|
var _a;
|
|
1175
1175
|
const { value, size = "md", data, withSkeletonLoading = true, isScrollToElementWidget = true } = props;
|
|
1176
1176
|
const { productId } = data || {};
|
|
@@ -1302,7 +1302,7 @@ const Rating = React__default.memo((props) => {
|
|
|
1302
1302
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {})
|
|
1303
1303
|
] })
|
|
1304
1304
|
] }) });
|
|
1305
|
-
}
|
|
1305
|
+
};
|
|
1306
1306
|
const Widget = "";
|
|
1307
1307
|
const WidgetHeaderAddTrigger = ({ isFirstLoading, text, dataSettings, data, onAfterAddReview }) => {
|
|
1308
1308
|
var _a, _b, _c;
|
|
@@ -2241,7 +2241,7 @@ const SearchIconWidget = (props) => {
|
|
|
2241
2241
|
width: 0,
|
|
2242
2242
|
height: 0
|
|
2243
2243
|
});
|
|
2244
|
-
React__default.
|
|
2244
|
+
React__default.useMemo(() => {
|
|
2245
2245
|
if (!(isRenderApp == null ? void 0 : isRenderApp.instantSearch))
|
|
2246
2246
|
return;
|
|
2247
2247
|
if (size === "xs") {
|
|
@@ -2640,7 +2640,7 @@ const SearchIconWidgetPopup = () => {
|
|
|
2640
2640
|
] }) });
|
|
2641
2641
|
};
|
|
2642
2642
|
const SearchResultWidget$1 = "";
|
|
2643
|
-
const SearchResultWidget =
|
|
2643
|
+
const SearchResultWidget = (props) => {
|
|
2644
2644
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2645
2645
|
const { isRenderApp, isJsVersion } = React__default.useContext(SledgeContext);
|
|
2646
2646
|
const { layoutType = "default", query, data, children, onAfterAddToCart, onAfterAddWishlist, onAfterRemoveWishlist, onAfterRenderProduct } = props;
|
|
@@ -2803,7 +2803,7 @@ const SearchResultWidget = React__default.memo((props) => {
|
|
|
2803
2803
|
await handleInitStates(data2, "totalDataPerIndex");
|
|
2804
2804
|
}
|
|
2805
2805
|
};
|
|
2806
|
-
React__default.
|
|
2806
|
+
React__default.useMemo(() => {
|
|
2807
2807
|
if (!(isRenderApp == null ? void 0 : isRenderApp.instantSearch))
|
|
2808
2808
|
return;
|
|
2809
2809
|
const searchParams = new URLSearchParams(document.location.search);
|
|
@@ -3132,8 +3132,8 @@ const SearchResultWidget = React__default.memo((props) => {
|
|
|
3132
3132
|
searchResultContainerRef
|
|
3133
3133
|
})
|
|
3134
3134
|
] });
|
|
3135
|
-
}
|
|
3136
|
-
const ResultProduct =
|
|
3135
|
+
};
|
|
3136
|
+
const ResultProduct = (props) => {
|
|
3137
3137
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
3138
3138
|
const {
|
|
3139
3139
|
keyword,
|
|
@@ -3780,8 +3780,8 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
3780
3780
|
] })
|
|
3781
3781
|
] }) })
|
|
3782
3782
|
] });
|
|
3783
|
-
}
|
|
3784
|
-
const ResultCategory =
|
|
3783
|
+
};
|
|
3784
|
+
const ResultCategory = (props) => {
|
|
3785
3785
|
var _a, _b, _c, _d;
|
|
3786
3786
|
const { keyword, clickedTabIndexId, clickedTabIndexName, setKeyword, searchResultContainerRef } = props || {};
|
|
3787
3787
|
const [isFirstLoading, setIsFirstLoading] = React__default.useState(true);
|
|
@@ -3901,8 +3901,8 @@ const ResultCategory = React__default.memo((props) => {
|
|
|
3901
3901
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Pagination, { currentPage, totalPage, totalResult: totalSearchResult, onChange: (page) => handlePageChange(page) })
|
|
3902
3902
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ResultEmpty, {})
|
|
3903
3903
|
] }) }) });
|
|
3904
|
-
}
|
|
3905
|
-
const ResultEmpty =
|
|
3904
|
+
};
|
|
3905
|
+
const ResultEmpty = (props) => {
|
|
3906
3906
|
const [title, setTitle] = React__default.useState("");
|
|
3907
3907
|
const [description, setDescription] = React__default.useState("");
|
|
3908
3908
|
React__default.useEffect(() => {
|
|
@@ -3913,7 +3913,7 @@ const ResultEmpty = React__default.memo((props) => {
|
|
|
3913
3913
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-empty-title", dangerouslySetInnerHTML: { __html: title } }),
|
|
3914
3914
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-empty-description", dangerouslySetInnerHTML: { __html: description } })
|
|
3915
3915
|
] });
|
|
3916
|
-
}
|
|
3916
|
+
};
|
|
3917
3917
|
const SearchWidget$1 = "";
|
|
3918
3918
|
const SearchWidget = (props) => {
|
|
3919
3919
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
@@ -4032,7 +4032,7 @@ const SearchWidget = (props) => {
|
|
|
4032
4032
|
await handleMultiSearch(data);
|
|
4033
4033
|
}
|
|
4034
4034
|
};
|
|
4035
|
-
React__default.
|
|
4035
|
+
React__default.useMemo(() => {
|
|
4036
4036
|
if (!(isRenderApp == null ? void 0 : isRenderApp.instantSearch))
|
|
4037
4037
|
return;
|
|
4038
4038
|
handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || "");
|