@sledge-app/react-instant-search 1.0.73 → 1.0.74
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/Atoms.d.ts +1 -0
- package/dist/components/SearchResultWidget/Atoms.d.ts.map +1 -1
- 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 +115 -63
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -4467,7 +4467,8 @@ const FacetComponent = (props) => {
|
|
|
4467
4467
|
setValueFilterPriceChange,
|
|
4468
4468
|
separatedFilterItem,
|
|
4469
4469
|
setSeparatedFilterItem,
|
|
4470
|
-
settings
|
|
4470
|
+
settings,
|
|
4471
|
+
scrollElementSelector
|
|
4471
4472
|
} = props;
|
|
4472
4473
|
let aliases = {};
|
|
4473
4474
|
if (filter.value === "hierarchicalProductType")
|
|
@@ -4623,8 +4624,7 @@ const FacetComponent = (props) => {
|
|
|
4623
4624
|
] });
|
|
4624
4625
|
});
|
|
4625
4626
|
};
|
|
4626
|
-
|
|
4627
|
-
let scrollElement = document.querySelector(scrollElementSelector);
|
|
4627
|
+
let scrollElement = document.querySelector(scrollElementSelector || `#filter-component-standard-${stringToSlug(value)} .sledge-instant-search__result-filter-item-list`);
|
|
4628
4628
|
if (isDisplaySlider) {
|
|
4629
4629
|
items = (defaultFacetStats == null ? void 0 : defaultFacetStats[value]) && Object.keys(defaultFacetStats[value]).length ? defaultFacetStats[value] : {};
|
|
4630
4630
|
let defaultValueMin = valueFilterPriceChange[0] || (items == null ? void 0 : items.min);
|
|
@@ -4736,6 +4736,8 @@ const FacetComponent = (props) => {
|
|
|
4736
4736
|
}
|
|
4737
4737
|
) }, index);
|
|
4738
4738
|
}) });
|
|
4739
|
+
} else {
|
|
4740
|
+
blockComponent = /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "sledge-instant-search__result-filter-item-no-result", style: filter_option_style, children: "No result..." });
|
|
4739
4741
|
}
|
|
4740
4742
|
if (haveNextPage) {
|
|
4741
4743
|
blockComponent = React__default.cloneElement(
|
|
@@ -4837,7 +4839,8 @@ const SearchResultWidget = (props) => {
|
|
|
4837
4839
|
const [searchResultFacets, setSearchResultFacets] = React__default.useState({});
|
|
4838
4840
|
const [generalDataSettings, setGeneralDataSettings] = React__default.useState((sledgeSettings == null ? void 0 : sledgeSettings.general) || {});
|
|
4839
4841
|
const [clickedFacets, setClickedFacets] = React__default.useState({});
|
|
4840
|
-
const [
|
|
4842
|
+
const [clickedOpenFilterHorizontalId, setClickedOpenFilterHorizontalId] = React__default.useState(null);
|
|
4843
|
+
const [clickedOpenFilterHorizontalMobileId, setClickedOpenFilterHorizontalMobileId] = React__default.useState(null);
|
|
4841
4844
|
const [separatedFilterItem, setSeparatedFilterItem] = React__default.useState({});
|
|
4842
4845
|
const debouncedKeyword = useDebounce(keyword, 500);
|
|
4843
4846
|
let productCardsComponent = null;
|
|
@@ -5417,13 +5420,15 @@ const SearchResultWidget = (props) => {
|
|
|
5417
5420
|
clickedFacets,
|
|
5418
5421
|
setClickedFacets,
|
|
5419
5422
|
parentPreviousState: previousState,
|
|
5420
|
-
|
|
5421
|
-
|
|
5423
|
+
clickedOpenFilterHorizontalId,
|
|
5424
|
+
setClickedOpenFilterHorizontalId,
|
|
5425
|
+
clickedOpenFilterHorizontalMobileId,
|
|
5426
|
+
setClickedOpenFilterHorizontalMobileId
|
|
5422
5427
|
})
|
|
5423
5428
|
] });
|
|
5424
5429
|
};
|
|
5425
5430
|
const ResultProduct = (props) => {
|
|
5426
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C
|
|
5431
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
|
|
5427
5432
|
const {
|
|
5428
5433
|
layoutType,
|
|
5429
5434
|
keyword,
|
|
@@ -5472,8 +5477,10 @@ const ResultProduct = (props) => {
|
|
|
5472
5477
|
clickedFacets,
|
|
5473
5478
|
setClickedFacets,
|
|
5474
5479
|
parentPreviousState,
|
|
5475
|
-
|
|
5476
|
-
|
|
5480
|
+
clickedOpenFilterHorizontalId,
|
|
5481
|
+
setClickedOpenFilterHorizontalId,
|
|
5482
|
+
clickedOpenFilterHorizontalMobileId,
|
|
5483
|
+
setClickedOpenFilterHorizontalMobileId,
|
|
5477
5484
|
isFirstLoading
|
|
5478
5485
|
} = props || {};
|
|
5479
5486
|
const querySortBy = (query == null ? void 0 : query.sortBy) ? query.sortBy : DEFAULT_QUERY_PARAM.SORT_BY;
|
|
@@ -5619,7 +5626,6 @@ const ResultProduct = (props) => {
|
|
|
5619
5626
|
window.history.pushState(null, "", `${document.location.pathname}?${searchParams2.toString()}`);
|
|
5620
5627
|
};
|
|
5621
5628
|
const handleOpenFilterVertical = (id) => {
|
|
5622
|
-
setClickedOpenFilterId == null ? void 0 : setClickedOpenFilterId(id === clickedOpenFilterId ? "" : id);
|
|
5623
5629
|
let valueClickedOpenFilters = clickedOpenFilters;
|
|
5624
5630
|
if (valueClickedOpenFilters.includes(id)) {
|
|
5625
5631
|
const findIndex = valueClickedOpenFilters.indexOf(id);
|
|
@@ -5835,15 +5841,29 @@ const ResultProduct = (props) => {
|
|
|
5835
5841
|
valueText = (_a2 = String(valueText)) == null ? void 0 : _a2.replaceAll(hierarchical_collections_separator, " > ");
|
|
5836
5842
|
valueText = (_b2 = String(valueText)) == null ? void 0 : _b2.replaceAll("_", " ");
|
|
5837
5843
|
let aliases = {};
|
|
5838
|
-
|
|
5844
|
+
let aliasValue = "";
|
|
5845
|
+
let aliasSeparator = "";
|
|
5846
|
+
if (name === "hierarchicalCollections") {
|
|
5839
5847
|
aliases = settings.collectionAliases || {};
|
|
5840
|
-
|
|
5848
|
+
aliasSeparator = hierarchicalCollectionsSettings.separator;
|
|
5849
|
+
}
|
|
5850
|
+
if (name === "hierarchicalProductType") {
|
|
5841
5851
|
aliases = settings.productTypeAliases || {};
|
|
5852
|
+
aliasSeparator = hierarchicalProductTypeSettings.separator;
|
|
5853
|
+
}
|
|
5854
|
+
if (["hierarchicalCollections", "hierarchicalProductType"].includes(name) && aliasSeparator) {
|
|
5855
|
+
const splitedValues = value.split(aliasSeparator);
|
|
5856
|
+
let newSplitedValues = [];
|
|
5857
|
+
for (const splitedValue of splitedValues) {
|
|
5858
|
+
newSplitedValues.push(aliases[splitedValue.trim()] || splitedValue);
|
|
5859
|
+
}
|
|
5860
|
+
aliasValue = newSplitedValues.join(" > ");
|
|
5861
|
+
}
|
|
5842
5862
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-item-refine-selected", style: filter_option_style, children: [
|
|
5843
5863
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "sledge-instant-search__result-filter-item-title-refine-list", children: [
|
|
5844
5864
|
label,
|
|
5845
5865
|
": ",
|
|
5846
|
-
|
|
5866
|
+
aliasValue || valueText
|
|
5847
5867
|
] }),
|
|
5848
5868
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5849
5869
|
"span",
|
|
@@ -5866,10 +5886,12 @@ const ResultProduct = (props) => {
|
|
|
5866
5886
|
)
|
|
5867
5887
|
] }, index);
|
|
5868
5888
|
};
|
|
5869
|
-
const filterSettings = (
|
|
5889
|
+
const filterSettings = ({
|
|
5890
|
+
filter,
|
|
5891
|
+
scrollElementSelector
|
|
5892
|
+
}) => {
|
|
5870
5893
|
var _a2;
|
|
5871
5894
|
const { value, display, indexFilter } = filter;
|
|
5872
|
-
let isActive = clickedOpenFilterId === value;
|
|
5873
5895
|
let items = display.toLowerCase() === "tree" ? createHierarchicalFacet({
|
|
5874
5896
|
indexValue: value,
|
|
5875
5897
|
filter,
|
|
@@ -5908,7 +5930,8 @@ const ResultProduct = (props) => {
|
|
|
5908
5930
|
valueFilterPriceChange,
|
|
5909
5931
|
setValueFilterPriceChange,
|
|
5910
5932
|
separatedFilterItem,
|
|
5911
|
-
setSeparatedFilterItem
|
|
5933
|
+
setSeparatedFilterItem,
|
|
5934
|
+
scrollElementSelector
|
|
5912
5935
|
}
|
|
5913
5936
|
);
|
|
5914
5937
|
if (display.toLowerCase() === "swatch" && (items == null ? void 0 : items.length))
|
|
@@ -5918,7 +5941,7 @@ const ResultProduct = (props) => {
|
|
|
5918
5941
|
if (((_a2 = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _a2.layout) === "vertical" && (allowedFilter == null ? void 0 : allowedFilter.length) === 1)
|
|
5919
5942
|
classesUlElement == null ? void 0 : classesUlElement.push("sledge-instant-search__result-filter-item-list-just-one");
|
|
5920
5943
|
let isLastIndex = allowedFilter ? (allowedFilter == null ? void 0 : allowedFilter.length) - 1 === indexFilter : false;
|
|
5921
|
-
return {
|
|
5944
|
+
return { isRender, classesUlElement, getFacetComponent, isLastIndex };
|
|
5922
5945
|
};
|
|
5923
5946
|
const filterVerticalSelected = Boolean((dataClickedFacets == null ? void 0 : dataClickedFacets.length) && ((_k = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _k.show_refine_by_block)) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-item", children: [
|
|
5924
5947
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-item-title-refine", children: [
|
|
@@ -5935,10 +5958,11 @@ const ResultProduct = (props) => {
|
|
|
5935
5958
|
});
|
|
5936
5959
|
}) })
|
|
5937
5960
|
] }) : null;
|
|
5938
|
-
const filterVerticalComponents = allowedFilter == null ? void 0 : allowedFilter.map((filter, indexFilter) => {
|
|
5961
|
+
const filterVerticalComponents = ({ filterLayoutType }) => allowedFilter == null ? void 0 : allowedFilter.map((filter, indexFilter) => {
|
|
5939
5962
|
const { value, label } = filter;
|
|
5940
|
-
const
|
|
5941
|
-
|
|
5963
|
+
const filterItemId = `filter-component-${filterLayoutType}-${stringToSlug(value)}`;
|
|
5964
|
+
const { isRender, classesUlElement, getFacetComponent } = filterSettings({ filter, scrollElementSelector: `#${filterItemId} .sledge-instant-search__result-filter-item-list` });
|
|
5965
|
+
return isRender ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-item", id: filterItemId, children: [
|
|
5942
5966
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-item-title", onClick: () => handleOpenFilterVertical(value), children: [
|
|
5943
5967
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sledge-instant-search__result-filter-title", style: filter_title_style, children: label }),
|
|
5944
5968
|
/* @__PURE__ */ jsxRuntimeExports.jsx(motion.div, { initial: false, animate: clickedOpenFilters.includes(value) ? "open" : "closed", variants: ROTATE_FILTER_ARROW_ANIMATION, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronArrowDownIcon, { width: 15, height: 15, color: "#000000" }) })
|
|
@@ -5946,9 +5970,15 @@ const ResultProduct = (props) => {
|
|
|
5946
5970
|
clickedOpenFilters.includes(value) && /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: classesUlElement.join(" "), children: getFacetComponent() })
|
|
5947
5971
|
] }, indexFilter) : null;
|
|
5948
5972
|
});
|
|
5949
|
-
const filterHorizontalComponents = allowedFilter == null ? void 0 : allowedFilter.map((filter, indexFilter) => {
|
|
5973
|
+
const filterHorizontalComponents = ({ deviceType }) => allowedFilter == null ? void 0 : allowedFilter.map((filter, indexFilter) => {
|
|
5950
5974
|
const { value, label } = filter;
|
|
5951
|
-
const
|
|
5975
|
+
const filterItemId = `filter-component-${deviceType}-${stringToSlug(value)}`;
|
|
5976
|
+
const getValueOpenFilterId = deviceType === "mobile" ? clickedOpenFilterHorizontalMobileId : clickedOpenFilterHorizontalId;
|
|
5977
|
+
const isOpenFilterHorizontal = getValueOpenFilterId === value;
|
|
5978
|
+
const { isRender, classesUlElement, getFacetComponent, isLastIndex } = filterSettings({
|
|
5979
|
+
filter,
|
|
5980
|
+
scrollElementSelector: `#${filterItemId} .sledge-instant-search__result-filter-item-list`
|
|
5981
|
+
});
|
|
5952
5982
|
return isRender ? /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5953
5983
|
Popover,
|
|
5954
5984
|
{
|
|
@@ -5956,17 +5986,30 @@ const ResultProduct = (props) => {
|
|
|
5956
5986
|
Button,
|
|
5957
5987
|
{
|
|
5958
5988
|
type: "button",
|
|
5959
|
-
onClick: () =>
|
|
5989
|
+
onClick: () => {
|
|
5990
|
+
if (deviceType === "mobile") {
|
|
5991
|
+
setClickedOpenFilterHorizontalMobileId == null ? void 0 : setClickedOpenFilterHorizontalMobileId(value);
|
|
5992
|
+
} else {
|
|
5993
|
+
setClickedOpenFilterHorizontalId == null ? void 0 : setClickedOpenFilterHorizontalId(value);
|
|
5994
|
+
}
|
|
5995
|
+
},
|
|
5960
5996
|
className: `${isLastIndex ? (allowedFilter == null ? void 0 : allowedFilter.length) % 2 ? "sledge-instant-search__result-filter-trigger-odd" : "sledge-instant-search__result-filter-trigger-even" : ""}`,
|
|
5961
5997
|
children: [
|
|
5962
5998
|
label,
|
|
5963
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(motion.div, { initial: "closed", animate:
|
|
5999
|
+
/* @__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" }) })
|
|
5964
6000
|
]
|
|
5965
6001
|
}
|
|
5966
6002
|
),
|
|
5967
|
-
content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter-horizontal-facet", children:
|
|
5968
|
-
withOpenState:
|
|
5969
|
-
|
|
6003
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter-horizontal-facet", id: filterItemId, children: isOpenFilterHorizontal && /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: classesUlElement.join(" "), children: getFacetComponent() }) }),
|
|
6004
|
+
withOpenState: true,
|
|
6005
|
+
isOpen: isOpenFilterHorizontal,
|
|
6006
|
+
setIsOpen: (open) => {
|
|
6007
|
+
if (deviceType === "mobile") {
|
|
6008
|
+
setClickedOpenFilterHorizontalMobileId == null ? void 0 : setClickedOpenFilterHorizontalMobileId(!open ? "" : value);
|
|
6009
|
+
} else {
|
|
6010
|
+
setClickedOpenFilterHorizontalId == null ? void 0 : setClickedOpenFilterHorizontalId(!open ? "" : value);
|
|
6011
|
+
}
|
|
6012
|
+
},
|
|
5970
6013
|
hideCloseIcon: true,
|
|
5971
6014
|
align: "center",
|
|
5972
6015
|
className: "sledge-instant-search__filter-horizontal-facet-content",
|
|
@@ -5993,28 +6036,31 @@ const ResultProduct = (props) => {
|
|
|
5993
6036
|
isVisibleLoadMore
|
|
5994
6037
|
}
|
|
5995
6038
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(Pagination, { currentPage, totalPage, totalResult: totalSearchResult, onChange: (page) => handlePageChange(page), pageInfo: language_pagination_info });
|
|
5996
|
-
const filterHorizontalBlockComponent = (
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
label,
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6039
|
+
const filterHorizontalBlockComponent = ({ deviceType }) => {
|
|
6040
|
+
var _a2, _b2;
|
|
6041
|
+
return ((_a2 = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _a2.enable_on_search) && (allowedFilter == null ? void 0 : allowedFilter.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isFirstLoading && !propsData ? filterHorizontalSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isLoadingSetting && !propsData ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter-horizontal-loading", children: filterHorizontalSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-horizontal-wrapper", children: [
|
|
6042
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter-horizontal sledge-instant-search__result-filter-horizontal-component", children: filterHorizontalComponents({ deviceType }) }),
|
|
6043
|
+
Boolean((dataClickedFacets == null ? void 0 : dataClickedFacets.length) && ((_b2 = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _b2.show_refine_by_block)) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-filter-horizontal", children: [
|
|
6044
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6045
|
+
"div",
|
|
6046
|
+
{
|
|
6047
|
+
className: "sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all",
|
|
6048
|
+
onClick: handleFilterReset,
|
|
6049
|
+
children: "Clear All"
|
|
6050
|
+
}
|
|
6051
|
+
),
|
|
6052
|
+
dataClickedFacets.map((itemClickedFacet, index) => {
|
|
6053
|
+
const { label, name, value } = itemClickedFacet;
|
|
6054
|
+
return facetBlockSelected({
|
|
6055
|
+
label,
|
|
6056
|
+
name,
|
|
6057
|
+
value,
|
|
6058
|
+
index
|
|
6059
|
+
});
|
|
6060
|
+
})
|
|
6061
|
+
] }) : null
|
|
6062
|
+
] }) }) }) : null;
|
|
6063
|
+
};
|
|
6018
6064
|
const searchInputFieldComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6019
6065
|
SearchInputField,
|
|
6020
6066
|
{
|
|
@@ -6039,35 +6085,41 @@ const ResultProduct = (props) => {
|
|
|
6039
6085
|
case "standard":
|
|
6040
6086
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6041
6087
|
searchInputFieldComponent,
|
|
6042
|
-
filterHorizontalBlockComponent
|
|
6088
|
+
filterHorizontalBlockComponent({ deviceType: "mobile" })
|
|
6043
6089
|
] });
|
|
6044
6090
|
default:
|
|
6045
6091
|
return null;
|
|
6046
6092
|
}
|
|
6047
6093
|
};
|
|
6048
6094
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6049
|
-
((
|
|
6095
|
+
((_m = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _m.mobile_layout) === "flyout" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6050
6096
|
FlyoutSidebar,
|
|
6051
6097
|
{
|
|
6052
6098
|
title: language_filter || "Filter",
|
|
6053
6099
|
content: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6054
6100
|
filterVerticalSelected,
|
|
6055
|
-
((
|
|
6101
|
+
((_o = (_n = filterVerticalComponents({
|
|
6102
|
+
filterLayoutType: "flyout"
|
|
6103
|
+
})) == null ? void 0 : _n.filter((item) => item)) == null ? void 0 : _o.length) ? filterVerticalComponents({
|
|
6104
|
+
filterLayoutType: "flyout"
|
|
6105
|
+
}) : null
|
|
6056
6106
|
] }),
|
|
6057
6107
|
open: openFilterFlyoutMobile,
|
|
6058
6108
|
setOpen: setOpenFilterFlyoutMobile
|
|
6059
6109
|
}
|
|
6060
6110
|
),
|
|
6061
|
-
((
|
|
6062
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-wrapper", "data-filter-layout": (
|
|
6063
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: ((
|
|
6111
|
+
((_p = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _p.enable_on_search) && ((_q = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _q.layout) === "horizontal" && (allowedFilter == null ? void 0 : allowedFilter.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__hide-element-lg-on-mobile", children: filterHorizontalBlockComponent({ deviceType: "desktop" }) }) : null,
|
|
6112
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-wrapper", "data-filter-layout": (_r = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _r.layout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6113
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: ((_s = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _s.enable_on_search) && ((_t = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _t.layout) === "vertical" && !hideFilterWhenOneValue ? !(allowedFilter == null ? void 0 : allowedFilter.find(({ display }) => (display == null ? void 0 : display.toLowerCase()) === "tree")) && isFirstLoading || (allowedFilter == null ? void 0 : allowedFilter.find(({ display }) => (display == null ? void 0 : display.toLowerCase()) === "tree")) && isLoadingProduct ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter sledge__hide-element-lg-on-mobile", children: filterVerticalSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-filter sledge__hide-element-lg-on-mobile", children: isLoadingSetting ? filterVerticalSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6064
6114
|
filterVerticalSelected,
|
|
6065
|
-
filterVerticalComponents
|
|
6115
|
+
filterVerticalComponents({
|
|
6116
|
+
filterLayoutType: "standard"
|
|
6117
|
+
})
|
|
6066
6118
|
] }) }) : null }),
|
|
6067
6119
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-data", children: [
|
|
6068
6120
|
isFirstLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6069
6121
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__hide-element-mobile-on-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-data-keyword", children: [
|
|
6070
|
-
((
|
|
6122
|
+
((_u = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _u.show_total_products) ? summaryTextSkeleton : null,
|
|
6071
6123
|
searchFieldSkeletonComponent,
|
|
6072
6124
|
filterHorizontalSkeletonComponent,
|
|
6073
6125
|
selectOptionSkeletonComponent
|
|
@@ -6077,7 +6129,7 @@ const ResultProduct = (props) => {
|
|
|
6077
6129
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6078
6130
|
"div",
|
|
6079
6131
|
{
|
|
6080
|
-
className: `sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal ${((
|
|
6132
|
+
className: `sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal ${((_v = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _v.layout) === "horizontal" ? "" : "sledge__hide-element-mobile-on-lg"}`,
|
|
6081
6133
|
children: summaryText
|
|
6082
6134
|
}
|
|
6083
6135
|
),
|
|
@@ -6117,7 +6169,7 @@ const ResultProduct = (props) => {
|
|
|
6117
6169
|
language_limit || "Limit",
|
|
6118
6170
|
":"
|
|
6119
6171
|
] }),
|
|
6120
|
-
((
|
|
6172
|
+
((_w = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _w.allowed_limit) && Boolean((_y = (_x = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _x.allowed_limit) == null ? void 0 : _y.length) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6121
6173
|
SelectField,
|
|
6122
6174
|
{
|
|
6123
6175
|
align: "end",
|
|
@@ -6138,7 +6190,7 @@ const ResultProduct = (props) => {
|
|
|
6138
6190
|
productGridSkeleton,
|
|
6139
6191
|
(searchResult == null ? void 0 : searchResult.length) ? paginationComponent : null
|
|
6140
6192
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6141
|
-
((
|
|
6193
|
+
((_z = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _z.layout) === "vertical" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__hide-element-lg-on-mobile", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical", children: summaryText }) }),
|
|
6142
6194
|
(searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6143
6195
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6144
6196
|
ProductGrid,
|
|
@@ -6153,9 +6205,9 @@ const ResultProduct = (props) => {
|
|
|
6153
6205
|
};
|
|
6154
6206
|
}),
|
|
6155
6207
|
setting: {
|
|
6156
|
-
show_vendor: (
|
|
6157
|
-
show_sku: (
|
|
6158
|
-
show_price: (
|
|
6208
|
+
show_vendor: (_A = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _A.show_vendor,
|
|
6209
|
+
show_sku: (_B = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _B.show_sku,
|
|
6210
|
+
show_price: (_C = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _C.show_price,
|
|
6159
6211
|
language_button_add_to_cart: language_add_to_cart,
|
|
6160
6212
|
language_button_out_of_stock: languageSettings && languageSettings["out of stock"] ? languageSettings["out of stock"] : ""
|
|
6161
6213
|
},
|