@sledge-app/react-instant-search 0.0.37 → 0.0.39

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.
@@ -2188,7 +2188,7 @@ const SkeletonLoading = {
2188
2188
  BlogGrid: SkeletonBlogGrid
2189
2189
  };
2190
2190
  const SearchIconWidget = (props) => {
2191
- const { size = "sm", children, showPopup, onAfterAddToCart, onAfterAddWishlist, onAfterRemoveWishlist, onAfterRenderProduct } = props || {};
2191
+ const { size = "sm", children, onAfterAddToCart, onAfterAddWishlist, onAfterRemoveWishlist, onAfterRenderProduct } = props || {};
2192
2192
  let productCardsComponent = null;
2193
2193
  let suggestionKeywordListsComponent = null;
2194
2194
  let otherIndexListsComponent = null;
@@ -2241,7 +2241,7 @@ const SearchIconWidget = (props) => {
2241
2241
  }, [isRenderApp]);
2242
2242
  const handleShowWidget = () => {
2243
2243
  if (typeof window !== "undefined" && window.sledgeInstantSearchIconWidgetPopup)
2244
- window.sledgeInstantSearchIconWidgetPopup(
2244
+ window.sledgeInstantSearchIconWidgetPopup({
2245
2245
  onAfterAddToCart,
2246
2246
  onAfterAddWishlist,
2247
2247
  onAfterRemoveWishlist,
@@ -2250,9 +2250,8 @@ const SearchIconWidget = (props) => {
2250
2250
  productCardsComponent,
2251
2251
  suggestionKeywordListsComponent,
2252
2252
  otherIndexListsComponent,
2253
- searchViewMoreResultComponent,
2254
- showPopup
2255
- );
2253
+ searchViewMoreResultComponent
2254
+ });
2256
2255
  };
2257
2256
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sledge-instant-search__icon-widget", onClick: handleShowWidget, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SearchIcon, { ...sizing, color: "currentColor" }) });
2258
2257
  };
@@ -2411,16 +2410,26 @@ const SearchIconWidgetPopup = () => {
2411
2410
  };
2412
2411
  React__default.useEffect(() => {
2413
2412
  if (typeof window !== "undefined") {
2414
- window.sledgeInstantSearchIconWidgetPopup = (onAfterAddToCart = () => {
2415
- }, onAfterAddWishlist = () => {
2416
- }, onAfterRemoveWishlist = () => {
2417
- }, onAfterRenderProduct = () => {
2418
- }, separateJsVersionComponent = null, productCardsComponent = () => {
2419
- }, suggestionKeywordListsComponent = () => {
2420
- }, otherIndexListsComponent = () => {
2421
- }, searchViewMoreResultComponent = () => {
2422
- }, showPopup) => {
2423
- setShowInfo(showPopup ? showPopup : true);
2413
+ window.sledgeInstantSearchIconWidgetPopup = ({
2414
+ onAfterAddToCart = () => {
2415
+ },
2416
+ onAfterAddWishlist = () => {
2417
+ },
2418
+ onAfterRemoveWishlist = () => {
2419
+ },
2420
+ onAfterRenderProduct = () => {
2421
+ },
2422
+ separateJsVersionComponent = null,
2423
+ productCardsComponent = () => {
2424
+ },
2425
+ suggestionKeywordListsComponent = () => {
2426
+ },
2427
+ otherIndexListsComponent = () => {
2428
+ },
2429
+ searchViewMoreResultComponent = () => {
2430
+ }
2431
+ }) => {
2432
+ setShowInfo(true);
2424
2433
  setHandleFunctions({
2425
2434
  onAfterAddToCart,
2426
2435
  onAfterAddWishlist,
@@ -2692,9 +2701,7 @@ const SearchResultWidget = (props) => {
2692
2701
  if (!response)
2693
2702
  return;
2694
2703
  const { results } = response;
2695
- setTimeout(() => {
2696
- setIsFirstLoading(false);
2697
- }, 1300);
2704
+ setIsFirstLoading(false);
2698
2705
  setIsLoadingSetting(false);
2699
2706
  setIsLoading(false);
2700
2707
  if (type === "totalDataPerIndex") {
@@ -3607,7 +3614,7 @@ const ResultProduct = (props) => {
3607
3614
  });
3608
3615
  const paginationComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Pagination, { currentPage, totalPage, totalResult: totalSearchResult, onChange: (page) => handlePageChange(page) });
3609
3616
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
3610
- ((_f = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _f.enable_on_search) && ((_g = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _g.layout) === "horizontal" ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isFirstLoading ? filterHorizontalSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isLoadingSetting ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter-horizontal-loading", children: filterHorizontalSkeleton }) : filterHorizontalComponents.every((currentValue) => !currentValue) ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-horizontal-wrapper", children: [
3617
+ ((_f = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _f.enable_on_search) && ((_g = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _g.layout) === "horizontal" ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isFirstLoading ? filterHorizontalSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isLoadingSetting ? null : filterHorizontalComponents.every((currentValue) => !currentValue) ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-horizontal-wrapper", children: [
3611
3618
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter-horizontal", children: filterHorizontalComponents }),
3612
3619
  Boolean((dataClickedFacets == null ? void 0 : dataClickedFacets.length) && ((_h = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _h.show_refine_by_block)) ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: Boolean(dataClickedFacets.every((currentValue) => !currentValue)) ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-horizontal", children: [
3613
3620
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -3630,7 +3637,7 @@ const ResultProduct = (props) => {
3630
3637
  ] }) }) : null
3631
3638
  ] }) }) }) : null,
3632
3639
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-wrapper", "data-filter-layout": (_i = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _i.layout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
3633
- ((_j = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _j.enable_on_search) && ((_k = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _k.layout) === "vertical" ? isFirstLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter", children: filterVerticalSkeleton }) : filterVerticalComponents.every((currentValue) => !currentValue) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter", children: isLoadingSetting ? filterVerticalSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
3640
+ ((_j = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _j.enable_on_search) && ((_k = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _k.layout) === "vertical" ? isFirstLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter", children: filterVerticalSkeleton }) : filterVerticalComponents.every((currentValue) => !currentValue) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter", children: isLoadingSetting ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
3634
3641
  Boolean((dataClickedFacets == null ? void 0 : dataClickedFacets.length) && ((_l = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _l.show_refine_by_block)) ? Boolean(dataClickedFacets.every((currentValue) => !currentValue)) ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-item", children: [
3635
3642
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-item-title-refine", children: [
3636
3643
  /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { className: "sledge-instant-search__result-filter-item-title-refine-heading", children: "Filter" }),