@sledge-app/react-instant-search 2.0.2 → 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.
@@ -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 = "";
@@ -2519,7 +2519,7 @@ const WidgetRoot = (props) => {
2519
2519
  }
2520
2520
  };
2521
2521
  const handleSetWishlistData = async (isLoadMore = false, init = false) => {
2522
- var _a2, _b2, _c2, _d;
2522
+ var _a2, _b2, _c2;
2523
2523
  const searchParams = new URLSearchParams(document.location.search);
2524
2524
  const getShareId = (params == null ? void 0 : params.shareId) ? params.shareId : (searchParams == null ? void 0 : searchParams.get(queryShareId)) || "";
2525
2525
  setIsLoading(isRefreshWidgetList ? true : !isLoadMore);
@@ -2530,7 +2530,6 @@ const WidgetRoot = (props) => {
2530
2530
  let response;
2531
2531
  let run = false;
2532
2532
  let valueWishlistData;
2533
- let valueWishlistSort;
2534
2533
  let valueTotalPage = 0;
2535
2534
  let queryParam = {
2536
2535
  page: isLoadMore ? currentPage : 1,
@@ -2549,11 +2548,9 @@ const WidgetRoot = (props) => {
2549
2548
  response = await getWishlist(queryParam);
2550
2549
  run = ((_a2 = response == null ? void 0 : response.status) == null ? void 0 : _a2.code) === 200 || false;
2551
2550
  valueWishlistData = !((_b2 = response.data) == null ? void 0 : _b2.length) ? [] : (prevState) => (wishlistData == null ? void 0 : wishlistData.length) && isLoadMore ? [...prevState, ...response.data] : response.data;
2552
- valueWishlistSort = !((_c2 = response.sorts) == null ? void 0 : _c2.length) ? [] : response.sorts;
2553
- 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;
2554
2552
  if (run) {
2555
2553
  setWishlistData(valueWishlistData);
2556
- setWishlistSort(valueWishlistSort);
2557
2554
  setTotalPage(valueTotalPage);
2558
2555
  setIsLoading(false);
2559
2556
  setIsRefreshWidgetList(false);
@@ -2600,7 +2597,9 @@ const WidgetRoot = (props) => {
2600
2597
  responseGeneral = generalPreviewSettings || JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING) || null);
2601
2598
  if (!response)
2602
2599
  return;
2600
+ const { sorts } = response == null ? void 0 : response.display;
2603
2601
  setDataSettings(response);
2602
+ setWishlistSort(sorts);
2604
2603
  if (responseGeneral)
2605
2604
  setGeneralDataSettings(responseGeneral);
2606
2605
  };
@@ -7090,6 +7089,7 @@ const FilterItem = (props) => {
7090
7089
  filter,
7091
7090
  filterSettings,
7092
7091
  indexFilter,
7092
+ filterTitleStyle,
7093
7093
  deviceType,
7094
7094
  clickedOpenFilterHorizontalId,
7095
7095
  setClickedOpenFilterHorizontalId,
@@ -7127,6 +7127,7 @@ const FilterItem = (props) => {
7127
7127
  }
7128
7128
  },
7129
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,
7130
7131
  children: [
7131
7132
  label,
7132
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" }) })
@@ -7197,6 +7198,7 @@ const FilterHorizontal = (props) => {
7197
7198
  const {
7198
7199
  items = [],
7199
7200
  filterSettings = null,
7201
+ filterTitleStyle = {},
7200
7202
  deviceType = "desktop",
7201
7203
  clickedOpenFilterHorizontalId,
7202
7204
  setClickedOpenFilterHorizontalId,
@@ -7236,6 +7238,7 @@ const FilterHorizontal = (props) => {
7236
7238
  filter,
7237
7239
  filterSettings,
7238
7240
  indexFilter,
7241
+ filterTitleStyle,
7239
7242
  deviceType,
7240
7243
  clickedOpenFilterHorizontalId,
7241
7244
  setClickedOpenFilterHorizontalId,
@@ -10008,6 +10011,9 @@ const ResultProduct = React__default.memo((props) => {
10008
10011
  });
10009
10012
  }
10010
10013
  }, [isReplaceWidgetList, clickedTabIndexId]);
10014
+ useEffectOnChange(() => {
10015
+ setSummaryText(summaryTextGenerator(totalSearchResult));
10016
+ }, [previewSettings]);
10011
10017
  let dataClickedFacets = handleDataClickedFacets();
10012
10018
  let keepCounterFacets = [];
10013
10019
  allowedFilter == null ? void 0 : allowedFilter.map((filter) => {
@@ -10143,6 +10149,7 @@ const ResultProduct = React__default.memo((props) => {
10143
10149
  const defaultProps = {
10144
10150
  items: allowedFilter,
10145
10151
  filterSettings,
10152
+ filterTitleStyle: filter_title_style,
10146
10153
  clickedOpenFilterHorizontalId,
10147
10154
  setClickedOpenFilterHorizontalId,
10148
10155
  clickedOpenFilterHorizontalMobileId,