@sledge-app/react-instant-search 2.0.35 → 2.0.37
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.
|
@@ -4452,7 +4452,8 @@ const ProductCard = React__default.memo((props) => {
|
|
|
4452
4452
|
isFlyout,
|
|
4453
4453
|
instantSearchSettings,
|
|
4454
4454
|
optionSelectedValue,
|
|
4455
|
-
additionalCardProps
|
|
4455
|
+
additionalCardProps,
|
|
4456
|
+
keyword
|
|
4456
4457
|
} = props;
|
|
4457
4458
|
const {
|
|
4458
4459
|
show_vendor = true,
|
|
@@ -4509,7 +4510,8 @@ const ProductCard = React__default.memo((props) => {
|
|
|
4509
4510
|
const bySplitProducts = (_c = instantSearchSettings == null ? void 0 : instantSearchSettings.split_products) == null ? void 0 : _c.by;
|
|
4510
4511
|
const optionsFiltered = bySplitProducts ? (_g = (_f = (_e = (_d = searchParamsObject == null ? void 0 : searchParamsObject[`options.${bySplitProducts}`]) == null ? void 0 : _d.split) == null ? void 0 : _e.call(_d, ",")) == null ? void 0 : _f.map) == null ? void 0 : _g.call(_f, (item2) => decodeURIComponent(item2)) : [];
|
|
4511
4512
|
const hasOptionsFiltered = (optionsFiltered == null ? void 0 : optionsFiltered.length) ? !((_h = optionsFiltered == null ? void 0 : optionsFiltered.includes) == null ? void 0 : _h.call(optionsFiltered, optionSelectedValue)) : false;
|
|
4512
|
-
|
|
4513
|
+
const isOptionNotContainsKeyword = (keyword == null ? void 0 : keyword.length) ? !(optionSelectedValue == null ? void 0 : optionSelectedValue.length) ? true : !optionSelectedValue.toLowerCase().includes(keyword.toLowerCase()) : false;
|
|
4514
|
+
if (isSplitProducts && (hasOptionsFiltered || isOptionNotContainsKeyword)) {
|
|
4513
4515
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: component }, id);
|
|
4514
4516
|
}
|
|
4515
4517
|
if (CardsComponent) {
|
|
@@ -10556,6 +10558,13 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10556
10558
|
useEffectOnChange(() => {
|
|
10557
10559
|
setSummaryText(summaryTextGenerator(totalSearchResult));
|
|
10558
10560
|
}, [previewSettings]);
|
|
10561
|
+
useEffectOnChange(() => {
|
|
10562
|
+
setClickedOpenFilters(
|
|
10563
|
+
keyOpenFilters({
|
|
10564
|
+
items: allowedFilter
|
|
10565
|
+
})
|
|
10566
|
+
);
|
|
10567
|
+
}, [allowedFilter]);
|
|
10559
10568
|
let dataClickedFacets = handleDataClickedFacets();
|
|
10560
10569
|
let keepCounterFacets = [];
|
|
10561
10570
|
allowedFilter == null ? void 0 : allowedFilter.map((filter) => {
|
|
@@ -10848,7 +10857,8 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10848
10857
|
previewSettings,
|
|
10849
10858
|
instantSearchSettings,
|
|
10850
10859
|
hitsPerPage: hitsPerPageResult,
|
|
10851
|
-
currentPage
|
|
10860
|
+
currentPage,
|
|
10861
|
+
keyword
|
|
10852
10862
|
}
|
|
10853
10863
|
);
|
|
10854
10864
|
const resultEmptyComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(ResultEmpty, { ...props });
|