@sledge-app/react-instant-search 1.0.96 → 1.0.97
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/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 +17 -13
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/package.json +1 -1
|
@@ -5354,19 +5354,23 @@ const SearchResultWidget = (props) => {
|
|
|
5354
5354
|
queries: getTabs.map((tab) => {
|
|
5355
5355
|
const { index } = tab;
|
|
5356
5356
|
let isSetFilter = false;
|
|
5357
|
-
let getFacets =
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
if (collections == null ? void 0 : collections.includes(
|
|
5357
|
+
let getFacets = [];
|
|
5358
|
+
if (!isSetFilter)
|
|
5359
|
+
filters == null ? void 0 : filters.map((filter) => {
|
|
5360
|
+
const { active, collections, items } = filter;
|
|
5361
|
+
if (!active)
|
|
5362
|
+
return;
|
|
5363
|
+
const newItems = items == null ? void 0 : items.map(({ value, ...otherItem }) => (otherItem == null ? void 0 : otherItem.display) === "tree" ? HIERARCHICAL_FACET_OBJECT_ALIASES[value] : value);
|
|
5364
|
+
if (collectionId && (collections == null ? void 0 : collections.includes(String(collectionId)))) {
|
|
5365
5365
|
isSetFilter = true;
|
|
5366
|
-
|
|
5366
|
+
getFacets = newItems;
|
|
5367
|
+
} else {
|
|
5368
|
+
if (collections == null ? void 0 : collections.includes("all")) {
|
|
5369
|
+
isSetFilter = true;
|
|
5370
|
+
getFacets = newItems;
|
|
5371
|
+
}
|
|
5367
5372
|
}
|
|
5368
|
-
}
|
|
5369
|
-
}) : [];
|
|
5373
|
+
});
|
|
5370
5374
|
let isProductIndex = index.includes(index_product);
|
|
5371
5375
|
let isHasProductFacets = isProductIndex && getFacets.length;
|
|
5372
5376
|
let additionalFilter = [];
|
|
@@ -5377,12 +5381,12 @@ const SearchResultWidget = (props) => {
|
|
|
5377
5381
|
if (collectionId)
|
|
5378
5382
|
additionalFilter.push(`'collections.id' = '${collectionId}'`);
|
|
5379
5383
|
if (isHasProductFacets)
|
|
5380
|
-
setFacets(getFacets
|
|
5384
|
+
setFacets(getFacets);
|
|
5381
5385
|
return {
|
|
5382
5386
|
indexUid: index,
|
|
5383
5387
|
q: keyword || "",
|
|
5384
5388
|
hitsPerPage: 1,
|
|
5385
|
-
facets: isHasProductFacets ? getFacets
|
|
5389
|
+
facets: isHasProductFacets ? getFacets : [],
|
|
5386
5390
|
filter: isProductIndex ? [...new Set(additionalFilter.concat(DEFAULT_QUERY_PRODUCT_MEILISEARCH))].join(" AND ") : "",
|
|
5387
5391
|
attributesToRetrieve: [],
|
|
5388
5392
|
limit: 0,
|