@sledge-app/react-instant-search 2.0.29 → 2.0.31
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/components/Facet.d.ts.map +1 -1
- package/dist/components/SearchResultWidget/utils.d.ts +1 -0
- package/dist/components/SearchResultWidget/utils.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 +19 -8
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -185,7 +185,8 @@ const OBJECT_DATA_STRING_KEY = {
|
|
|
185
185
|
ACCEPTED_FILETYPE_MEDIA: "{{ accepted_filetype_media }}",
|
|
186
186
|
MAX_SIZE_MEDIA: "{{ max_size_media }}",
|
|
187
187
|
FILTER_TITLE: "{{ filter_title }}",
|
|
188
|
-
PRICE_MAX_MONEY_FORMAT: "{{ price_max_money_format }}"
|
|
188
|
+
PRICE_MAX_MONEY_FORMAT: "{{ price_max_money_format }}",
|
|
189
|
+
LANGUAGE_REVIEW_PLURAL_SINGULAR: "{{ language_review_plural_singular }}"
|
|
189
190
|
};
|
|
190
191
|
const ELEMENT_ID = {
|
|
191
192
|
PRODUCT_REVIEW: {
|
|
@@ -6661,7 +6662,8 @@ const handleSearchResponse = async (props) => {
|
|
|
6661
6662
|
hierarchicalProductTypeSettings,
|
|
6662
6663
|
hierarchicalCollectionsSettings,
|
|
6663
6664
|
usePublishedFilter,
|
|
6664
|
-
tabs = []
|
|
6665
|
+
tabs = [],
|
|
6666
|
+
instantSearchSettings
|
|
6665
6667
|
} = props;
|
|
6666
6668
|
const isResultForProduct = clickedTabIndexType === "product";
|
|
6667
6669
|
const isTypeCategoryHasPublished = ({ usePublishedFilter: usePublishedFilter2, type }) => Boolean(usePublishedFilter2 && type && ["collection", "page", "article"].includes(type));
|
|
@@ -6719,6 +6721,8 @@ const handleSearchResponse = async (props) => {
|
|
|
6719
6721
|
hitsPerPage: 12,
|
|
6720
6722
|
filter: filterCategory
|
|
6721
6723
|
};
|
|
6724
|
+
if (instantSearchSettings == null ? void 0 : instantSearchSettings.matching_strategy)
|
|
6725
|
+
bodyProductOrCategory.matchingStrategy = instantSearchSettings == null ? void 0 : instantSearchSettings.matching_strategy;
|
|
6722
6726
|
if (isResultForProduct && layoutType === "product-filter") {
|
|
6723
6727
|
response = await search(clickedTabIndexId, bodyProductOrCategory);
|
|
6724
6728
|
} else {
|
|
@@ -6738,6 +6742,9 @@ const handleSearchResponse = async (props) => {
|
|
|
6738
6742
|
attributesToRetrieve: [],
|
|
6739
6743
|
limit: 0,
|
|
6740
6744
|
page: 0,
|
|
6745
|
+
...(instantSearchSettings == null ? void 0 : instantSearchSettings.matching_strategy) ? {
|
|
6746
|
+
matchingStrategy: instantSearchSettings == null ? void 0 : instantSearchSettings.matching_strategy
|
|
6747
|
+
} : {},
|
|
6741
6748
|
...isProductIndex ? {
|
|
6742
6749
|
facets
|
|
6743
6750
|
} : {}
|
|
@@ -7721,7 +7728,7 @@ const Facet = (props) => {
|
|
|
7721
7728
|
...filter_option_text_transform && { textTransform: filter_option_text_transform }
|
|
7722
7729
|
};
|
|
7723
7730
|
let { value, label, display, indexFilter, items, settings: filterSettings } = filter;
|
|
7724
|
-
const { show_search, auto_select_search, hide_filter_list } = filterSettings || {};
|
|
7731
|
+
const { show_search, auto_select_search, hide_filter_list, show_all_children_items } = filterSettings || {};
|
|
7725
7732
|
const show_filter_list_when_search = !hide_filter_list;
|
|
7726
7733
|
if (isFirstLoading)
|
|
7727
7734
|
return null;
|
|
@@ -7847,6 +7854,7 @@ const Facet = (props) => {
|
|
|
7847
7854
|
const isFacetHierarchical = Object.hasOwn(facetValue, "children");
|
|
7848
7855
|
const isHasChildren = isFacetHierarchical && (children == null ? void 0 : children.length);
|
|
7849
7856
|
const isChecked = Boolean(clickedFacets && ((_a3 = clickedFacets[value]) == null ? void 0 : _a3.includes(itemValue)));
|
|
7857
|
+
const isShowAllChildrenItems = show_all_children_items ? isHasChildren : isHasChildren && isChecked;
|
|
7850
7858
|
const { haveNextPage: haveNextPage2, currentItems: currentItems2 } = handleFacetLoadMore({
|
|
7851
7859
|
facetItems: children
|
|
7852
7860
|
});
|
|
@@ -7865,7 +7873,7 @@ const Facet = (props) => {
|
|
|
7865
7873
|
motion.div,
|
|
7866
7874
|
{
|
|
7867
7875
|
initial: false,
|
|
7868
|
-
animate: isChecked ? "open" : "closed",
|
|
7876
|
+
animate: isShowAllChildrenItems ? "open" : isChecked ? "open" : "closed",
|
|
7869
7877
|
variants: ROTATE_FILTER_ARROW_ANIMATION,
|
|
7870
7878
|
className: "sledge-instant-search__result-filter-checkbox-item-level-arrow",
|
|
7871
7879
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronArrowDownIcon, { width: 15, height: 15, color: "#000000" })
|
|
@@ -7899,7 +7907,7 @@ const Facet = (props) => {
|
|
|
7899
7907
|
},
|
|
7900
7908
|
key
|
|
7901
7909
|
),
|
|
7902
|
-
|
|
7910
|
+
isShowAllChildrenItems ? haveNextPage2 ? React__default.cloneElement(
|
|
7903
7911
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7904
7912
|
blockComponentChildren,
|
|
7905
7913
|
loadMoreComponent
|
|
@@ -10415,7 +10423,8 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10415
10423
|
hierarchicalProductTypeSettings,
|
|
10416
10424
|
hierarchicalCollectionsSettings,
|
|
10417
10425
|
usePublishedFilter,
|
|
10418
|
-
tabs
|
|
10426
|
+
tabs,
|
|
10427
|
+
instantSearchSettings
|
|
10419
10428
|
});
|
|
10420
10429
|
}
|
|
10421
10430
|
setHandleSearchResultFirstTime(false);
|
|
@@ -10924,7 +10933,8 @@ const ResultCategory = React__default.memo((props) => {
|
|
|
10924
10933
|
tabs,
|
|
10925
10934
|
initStatesFirstTime,
|
|
10926
10935
|
setInitStatesFirstTime,
|
|
10927
|
-
parentPreviousState
|
|
10936
|
+
parentPreviousState,
|
|
10937
|
+
instantSearchSettings
|
|
10928
10938
|
} = props || {};
|
|
10929
10939
|
const { collectionId, collectionName } = params || {};
|
|
10930
10940
|
const [isFirstLoading, setIsFirstLoading] = React__default.useState(true);
|
|
@@ -11021,7 +11031,8 @@ const ResultCategory = React__default.memo((props) => {
|
|
|
11021
11031
|
hierarchicalProductTypeSettings,
|
|
11022
11032
|
hierarchicalCollectionsSettings,
|
|
11023
11033
|
usePublishedFilter,
|
|
11024
|
-
tabs
|
|
11034
|
+
tabs,
|
|
11035
|
+
instantSearchSettings
|
|
11025
11036
|
});
|
|
11026
11037
|
setInitStatesFirstTime == null ? void 0 : setInitStatesFirstTime(false);
|
|
11027
11038
|
handleSearchResultData({
|