@sledge-app/react-instant-search 2.0.5 → 2.0.7
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.
|
@@ -4272,7 +4272,8 @@ const ProductCard = React__default.memo((props) => {
|
|
|
4272
4272
|
dataWishlists,
|
|
4273
4273
|
generalDataSettings,
|
|
4274
4274
|
previewSettings,
|
|
4275
|
-
isFlyout
|
|
4275
|
+
isFlyout,
|
|
4276
|
+
additionalCardProps
|
|
4276
4277
|
} = props;
|
|
4277
4278
|
const {
|
|
4278
4279
|
show_vendor = true,
|
|
@@ -4317,6 +4318,7 @@ const ProductCard = React__default.memo((props) => {
|
|
|
4317
4318
|
let isOutOfStock = showOptionOutOfStock ? !Boolean(selectedVariantStock > 0 || selectedVariantInventoryManagement === null || selectedVariantInventoryPolicy === "continue") : false;
|
|
4318
4319
|
let isOnSale = parseFloat(String(compare_at_price)) ? parseFloat(String(compare_at_price)) > parseFloat(String(price)) : false;
|
|
4319
4320
|
const { money_format } = generalDataSettings || {};
|
|
4321
|
+
const { forLoopIndex, forLoopIndexWithPage } = additionalCardProps || {};
|
|
4320
4322
|
let component = null;
|
|
4321
4323
|
if (CardsComponent) {
|
|
4322
4324
|
const CardsProps = {
|
|
@@ -4342,11 +4344,13 @@ const ProductCard = React__default.memo((props) => {
|
|
|
4342
4344
|
},
|
|
4343
4345
|
showPopupComponent,
|
|
4344
4346
|
setShowPopupComponent,
|
|
4345
|
-
sourceApp
|
|
4347
|
+
sourceApp,
|
|
4348
|
+
forLoopIndex,
|
|
4349
|
+
forLoopIndexWithPage
|
|
4346
4350
|
};
|
|
4347
|
-
component = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isComponentJsVersion ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: CardsComponent({ ...CardsProps }) } }) : /* @__PURE__ */ jsxRuntimeExports.jsx(CardsComponent, { ...CardsProps }) });
|
|
4351
|
+
component = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isComponentJsVersion ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-for-loop-index": forLoopIndex, "data-for-loop-index-with-page": forLoopIndexWithPage, dangerouslySetInnerHTML: { __html: CardsComponent({ ...CardsProps }) } }) : /* @__PURE__ */ jsxRuntimeExports.jsx(CardsComponent, { ...CardsProps }) });
|
|
4348
4352
|
} else {
|
|
4349
|
-
component = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isFlyout ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card-flyout", children: [
|
|
4353
|
+
component = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isFlyout ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card-flyout", "data-for-loop-index": forLoopIndex, "data-for-loop-index-with-page": forLoopIndexWithPage, children: [
|
|
4350
4354
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-card-flyout-wishlist-trigger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4351
4355
|
Trigger,
|
|
4352
4356
|
{
|
|
@@ -4437,7 +4441,7 @@ const ProductCard = React__default.memo((props) => {
|
|
|
4437
4441
|
)
|
|
4438
4442
|
] }) : null
|
|
4439
4443
|
] })
|
|
4440
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card", children: [
|
|
4444
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card", "data-for-loop-index": forLoopIndex, "data-for-loop-index-with-page": forLoopIndexWithPage, children: [
|
|
4441
4445
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-content", children: [
|
|
4442
4446
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card-image", children: [
|
|
4443
4447
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -4629,7 +4633,21 @@ const ProductCard = React__default.memo((props) => {
|
|
|
4629
4633
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: component }, id);
|
|
4630
4634
|
});
|
|
4631
4635
|
const ProductGrid = React__default.memo((props) => {
|
|
4632
|
-
const {
|
|
4636
|
+
const {
|
|
4637
|
+
type,
|
|
4638
|
+
className = "",
|
|
4639
|
+
data,
|
|
4640
|
+
setting,
|
|
4641
|
+
sourceApp = null,
|
|
4642
|
+
useSlider = false,
|
|
4643
|
+
isFlyout = false,
|
|
4644
|
+
onAfterAddToCart,
|
|
4645
|
+
onAfterRenderProduct,
|
|
4646
|
+
currentColumnGrid,
|
|
4647
|
+
previewSettings,
|
|
4648
|
+
hitsPerPage,
|
|
4649
|
+
currentPage
|
|
4650
|
+
} = props;
|
|
4633
4651
|
const { redirect_add_to_cart = true } = setting || {};
|
|
4634
4652
|
const [clickedAddToCartId, setClickedAddToCartId] = React__default.useState(null);
|
|
4635
4653
|
const [generalDataSettings, setGeneralDataSettings] = React__default.useState({});
|
|
@@ -4731,6 +4749,10 @@ const ProductGrid = React__default.memo((props) => {
|
|
|
4731
4749
|
handleAddToCart,
|
|
4732
4750
|
clickedAddToCartId,
|
|
4733
4751
|
generalDataSettings,
|
|
4752
|
+
additionalCardProps: {
|
|
4753
|
+
forLoopIndex: index,
|
|
4754
|
+
forLoopIndexWithPage: Number(currentPage) && Number(hitsPerPage) ? index + (Number(currentPage) - 1) * Number(hitsPerPage) : index
|
|
4755
|
+
},
|
|
4734
4756
|
...props
|
|
4735
4757
|
},
|
|
4736
4758
|
`sledge-product-card_${index}`
|
|
@@ -7969,7 +7991,7 @@ const ProductGridPaginationWrapper = (props) => {
|
|
|
7969
7991
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-product-grid-pagination-wrapper", children });
|
|
7970
7992
|
};
|
|
7971
7993
|
const FilterVerticalLayout = (props) => {
|
|
7972
|
-
var _a;
|
|
7994
|
+
var _a, _b;
|
|
7973
7995
|
const {
|
|
7974
7996
|
displaySettings,
|
|
7975
7997
|
allowedFilter,
|
|
@@ -8020,7 +8042,7 @@ const FilterVerticalLayout = (props) => {
|
|
|
8020
8042
|
isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8021
8043
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SummaryTextVertical, { className: "sledge-instant-search__result-summary-text-with-column-grid-selector-wrapper", children: [
|
|
8022
8044
|
summaryText,
|
|
8023
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector })
|
|
8045
|
+
((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null
|
|
8024
8046
|
] }),
|
|
8025
8047
|
(searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8026
8048
|
productGrid,
|
|
@@ -8031,7 +8053,7 @@ const FilterVerticalLayout = (props) => {
|
|
|
8031
8053
|
] }) });
|
|
8032
8054
|
};
|
|
8033
8055
|
const FilterHorizontalLayout = (props) => {
|
|
8034
|
-
var _a;
|
|
8056
|
+
var _a, _b;
|
|
8035
8057
|
const { displaySettings, allowedFilter, isFirstLoading, isLoading, isLoadingProduct, isLoadingSetting, searchResult = [], propsData, hideFilterWhenOneValue, components, skeleton } = props;
|
|
8036
8058
|
const {
|
|
8037
8059
|
filterHorizontal = null,
|
|
@@ -8065,7 +8087,7 @@ const FilterHorizontalLayout = (props) => {
|
|
|
8065
8087
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
|
|
8066
8088
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
|
|
8067
8089
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit }),
|
|
8068
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector })
|
|
8090
|
+
((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null
|
|
8069
8091
|
] })
|
|
8070
8092
|
] }),
|
|
8071
8093
|
isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -8076,7 +8098,7 @@ const FilterHorizontalLayout = (props) => {
|
|
|
8076
8098
|
] });
|
|
8077
8099
|
};
|
|
8078
8100
|
const FilterFlyoutLayout$1 = (props) => {
|
|
8079
|
-
var _a;
|
|
8101
|
+
var _a, _b;
|
|
8080
8102
|
const {
|
|
8081
8103
|
displaySettings,
|
|
8082
8104
|
languageSettings,
|
|
@@ -8145,7 +8167,7 @@ const FilterFlyoutLayout$1 = (props) => {
|
|
|
8145
8167
|
isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8146
8168
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SummaryTextVertical, { className: "sledge-instant-search__result-summary-text-with-column-grid-selector-wrapper", children: [
|
|
8147
8169
|
summaryText,
|
|
8148
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector })
|
|
8170
|
+
((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null
|
|
8149
8171
|
] }),
|
|
8150
8172
|
(searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8151
8173
|
productGrid,
|
|
@@ -8156,7 +8178,7 @@ const FilterFlyoutLayout$1 = (props) => {
|
|
|
8156
8178
|
] });
|
|
8157
8179
|
};
|
|
8158
8180
|
const EnterpriseLayout = (props) => {
|
|
8159
|
-
var _a, _b;
|
|
8181
|
+
var _a, _b, _c;
|
|
8160
8182
|
const {
|
|
8161
8183
|
displaySettings,
|
|
8162
8184
|
allowedFilter,
|
|
@@ -8202,7 +8224,7 @@ const EnterpriseLayout = (props) => {
|
|
|
8202
8224
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FilterIcon, { width: 18, height: 18, color: "#393d4e" })
|
|
8203
8225
|
] }),
|
|
8204
8226
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
|
|
8205
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) })
|
|
8227
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldWrapper, { children: ((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null })
|
|
8206
8228
|
] }),
|
|
8207
8229
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(ResultData, { children: [
|
|
8208
8230
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sledge-instant-search__result-filter-toggle-panel ${"animated"}`, "data-filter-toggle": openFilterToggle ? "open" : "closed", children: filterVertical == null ? void 0 : filterVertical({
|
|
@@ -8217,7 +8239,7 @@ const EnterpriseLayout = (props) => {
|
|
|
8217
8239
|
] }) });
|
|
8218
8240
|
};
|
|
8219
8241
|
const YuvaLayout = (props) => {
|
|
8220
|
-
var _a, _b;
|
|
8242
|
+
var _a, _b, _c;
|
|
8221
8243
|
const {
|
|
8222
8244
|
displaySettings,
|
|
8223
8245
|
allowedFilter,
|
|
@@ -8264,24 +8286,24 @@ const YuvaLayout = (props) => {
|
|
|
8264
8286
|
] }),
|
|
8265
8287
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
|
|
8266
8288
|
summaryText,
|
|
8267
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }),
|
|
8289
|
+
((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null,
|
|
8268
8290
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort })
|
|
8269
8291
|
] })
|
|
8270
8292
|
] }),
|
|
8271
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
8293
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(ResultData, { children: [
|
|
8272
8294
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sledge-instant-search__result-filter-toggle-panel ${""}`, "data-filter-toggle": openFilterToggle ? "open" : "closed", children: filterVertical == null ? void 0 : filterVertical({
|
|
8273
8295
|
filterLayoutType: "standard",
|
|
8274
8296
|
isSkeleton: Boolean(!isAllowedFilterTree && isFirstLoading || isAllowedFilterTree && isLoadingProduct || isLoadingSetting)
|
|
8275
8297
|
}) }),
|
|
8276
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ProductGridPaginationWrapper, { children: (searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8298
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-data-flex", children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProductGridPaginationWrapper, { children: (searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8277
8299
|
productGrid,
|
|
8278
8300
|
pagination
|
|
8279
|
-
] }) : resultEmpty })
|
|
8280
|
-
] })
|
|
8301
|
+
] }) : resultEmpty }) }) })
|
|
8302
|
+
] })
|
|
8281
8303
|
] }) });
|
|
8282
8304
|
};
|
|
8283
8305
|
const ToyoLayout = (props) => {
|
|
8284
|
-
var _a, _b;
|
|
8306
|
+
var _a, _b, _c;
|
|
8285
8307
|
const { displaySettings, allowedFilter, isFirstLoading, isLoading, isLoadingProduct, isLoadingSetting, searchResult = [], propsData, hideFilterWhenOneValue, components, skeleton } = props;
|
|
8286
8308
|
const {
|
|
8287
8309
|
filterHorizontal = null,
|
|
@@ -8316,7 +8338,7 @@ const ToyoLayout = (props) => {
|
|
|
8316
8338
|
sort
|
|
8317
8339
|
}
|
|
8318
8340
|
}) : null,
|
|
8319
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) })
|
|
8341
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldWrapper, { children: ((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null })
|
|
8320
8342
|
] }),
|
|
8321
8343
|
isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8322
8344
|
filterActive == null ? void 0 : filterActive(),
|
|
@@ -8326,7 +8348,7 @@ const ToyoLayout = (props) => {
|
|
|
8326
8348
|
] }) }) });
|
|
8327
8349
|
};
|
|
8328
8350
|
const FilterHorizontalGroupLayout = (props) => {
|
|
8329
|
-
var _a;
|
|
8351
|
+
var _a, _b;
|
|
8330
8352
|
const { displaySettings, allowedFilter, isFirstLoading, isLoading, isLoadingProduct, isLoadingSetting, searchResult = [], propsData, hideFilterWhenOneValue, components, skeleton } = props;
|
|
8331
8353
|
const {
|
|
8332
8354
|
filterHorizontal = null,
|
|
@@ -8361,7 +8383,7 @@ const FilterHorizontalGroupLayout = (props) => {
|
|
|
8361
8383
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
|
|
8362
8384
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
|
|
8363
8385
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit }),
|
|
8364
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector })
|
|
8386
|
+
((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null
|
|
8365
8387
|
] })
|
|
8366
8388
|
] }),
|
|
8367
8389
|
isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -9477,7 +9499,7 @@ const SearchResultWidget = (props) => {
|
|
|
9477
9499
|
] });
|
|
9478
9500
|
};
|
|
9479
9501
|
const ResultProduct = React__default.memo((props) => {
|
|
9480
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
9502
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
9481
9503
|
const {
|
|
9482
9504
|
layoutType,
|
|
9483
9505
|
keyword,
|
|
@@ -9573,10 +9595,11 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9573
9595
|
);
|
|
9574
9596
|
const [triggerClickedFacets, setTriggerClickedFacets] = React__default.useState(false);
|
|
9575
9597
|
const [searchResult, setSearchResult] = React__default.useState(((_d = (_c = (_b = propsData == null ? void 0 : propsData.result) == null ? void 0 : _b.results) == null ? void 0 : _c[0]) == null ? void 0 : _d.hits) || []);
|
|
9598
|
+
const [hitsPerPageResult, setHitsPerPageResult] = React__default.useState(((_g = (_f = (_e = propsData == null ? void 0 : propsData.result) == null ? void 0 : _e.results) == null ? void 0 : _f[0]) == null ? void 0 : _g.hitsPerPage) || 0);
|
|
9576
9599
|
const [searchProcessingTimeMs, setSearchProcessingTimeMs] = React__default.useState(0);
|
|
9577
9600
|
const [currentPage, setCurrentPage] = React__default.useState(Number(searchParams == null ? void 0 : searchParams.get(queryPage)) && !isLoadMore ? Number(searchParams == null ? void 0 : searchParams.get(queryPage)) : 1);
|
|
9578
9601
|
const [totalPage, setTotalPage] = React__default.useState(0);
|
|
9579
|
-
const [totalSearchResult, setTotalSearchResult] = React__default.useState(((
|
|
9602
|
+
const [totalSearchResult, setTotalSearchResult] = React__default.useState(((_j = (_i = (_h = propsData == null ? void 0 : propsData.result) == null ? void 0 : _h.results) == null ? void 0 : _i[0]) == null ? void 0 : _j.totalHits) || 0);
|
|
9580
9603
|
const [handleSearchResultFirstTime, setHandleSearchResultFirstTime] = React__default.useState(true);
|
|
9581
9604
|
const [searchFacetDistribution, setSearchFacetDistribution] = React__default.useState({});
|
|
9582
9605
|
const [isLoadingButtonLoadMore, setIsLoadingButtonLoadMore] = React__default.useState(false);
|
|
@@ -9628,13 +9651,13 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9628
9651
|
};
|
|
9629
9652
|
const [summaryText, setSummaryText] = React__default.useState(propsData ? summaryTextGenerator(totalSearchResult) : null);
|
|
9630
9653
|
const previousState = usePrevious({ clickedLimitId, clickedSortId, clickedFacets, clickedTabIndexId });
|
|
9631
|
-
const { color: filter_title_color, font_size: filter_title_font_size, font_weight: filter_title_font_weight, text_transform: filter_title_text_transform } = ((
|
|
9654
|
+
const { color: filter_title_color, font_size: filter_title_font_size, font_weight: filter_title_font_weight, text_transform: filter_title_text_transform } = ((_k = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _k.title) || {};
|
|
9632
9655
|
const {
|
|
9633
9656
|
color: filter_option_color,
|
|
9634
9657
|
font_size: filter_option_font_size,
|
|
9635
9658
|
font_weight: filter_option_font_weight,
|
|
9636
9659
|
text_transform: filter_option_text_transform
|
|
9637
|
-
} = ((
|
|
9660
|
+
} = ((_l = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _l.option) || {};
|
|
9638
9661
|
const {
|
|
9639
9662
|
text_color: filter_button_text_color,
|
|
9640
9663
|
border_color: filter_button_border_color,
|
|
@@ -9647,7 +9670,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9647
9670
|
font_size: filter_button_font_size,
|
|
9648
9671
|
font_weight: filter_button_font_weight,
|
|
9649
9672
|
text_transform: filter_button_text_transform
|
|
9650
|
-
} = ((
|
|
9673
|
+
} = ((_m = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _m.button) || {};
|
|
9651
9674
|
const filter_title_style = {
|
|
9652
9675
|
...filter_title_color && { color: filter_title_color },
|
|
9653
9676
|
...filter_title_font_size && { fontSize: filter_title_font_size },
|
|
@@ -9834,7 +9857,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9834
9857
|
const result = layoutType === "default" && isFirstTimeOrOnSearch ? (_b2 = resultData == null ? void 0 : resultData.find) == null ? void 0 : _b2.call(resultData, ({ indexUid }) => indexUid.includes(index_product)) : resultData;
|
|
9835
9858
|
if (!result)
|
|
9836
9859
|
return;
|
|
9837
|
-
const { hits, processingTimeMs, totalHits, totalPages, facetDistribution } = result;
|
|
9860
|
+
const { hits, hitsPerPage, processingTimeMs, totalHits, totalPages, facetDistribution } = result;
|
|
9838
9861
|
const updateTabs = () => {
|
|
9839
9862
|
const valueAllowedTabs = objectPresent(previewSettings) ? tabs : allowedTabs;
|
|
9840
9863
|
if (valueAllowedTabs == null ? void 0 : valueAllowedTabs.length) {
|
|
@@ -9891,6 +9914,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9891
9914
|
setIsLoadingButtonLoadMore(false);
|
|
9892
9915
|
setIsReplaceWidgetList == null ? void 0 : setIsReplaceWidgetList(false);
|
|
9893
9916
|
setSearchResult(!(hits == null ? void 0 : hits.length) ? [] : (prevState) => (searchResult == null ? void 0 : searchResult.length) && isLoadMore2 ? [...prevState, ...hits] : hits);
|
|
9917
|
+
setHitsPerPageResult(hitsPerPage);
|
|
9894
9918
|
setSearchProcessingTimeMs(processingTimeMs || 0);
|
|
9895
9919
|
setTotalPage(totalPages);
|
|
9896
9920
|
setTotalSearchResult(totalHits || 0);
|
|
@@ -10201,7 +10225,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10201
10225
|
const paginationComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10202
10226
|
PaginationOrLoadMore,
|
|
10203
10227
|
{
|
|
10204
|
-
type: (
|
|
10228
|
+
type: (_n = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _n.pagination_type,
|
|
10205
10229
|
isLoadMore,
|
|
10206
10230
|
isLoadingButtonLoadMore,
|
|
10207
10231
|
handleLoadMore: () => {
|
|
@@ -10210,7 +10234,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10210
10234
|
setIsReplaceWidgetList == null ? void 0 : setIsReplaceWidgetList(true);
|
|
10211
10235
|
},
|
|
10212
10236
|
buttonLoadMoreText: isLoadingButtonLoadMore ? button_loading || "Loading..." : button_load_more || "Load More",
|
|
10213
|
-
isInfiniteScroll: ((
|
|
10237
|
+
isInfiniteScroll: ((_o = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _o.pagination_type) === "infinite_scroll",
|
|
10214
10238
|
currentPage,
|
|
10215
10239
|
totalPage,
|
|
10216
10240
|
totalResult: totalSearchResult,
|
|
@@ -10219,7 +10243,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10219
10243
|
handlePageChange
|
|
10220
10244
|
}
|
|
10221
10245
|
);
|
|
10222
|
-
const summaryTextComponent = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-data-summary-item", children: ((
|
|
10246
|
+
const summaryTextComponent = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-data-summary-item", children: ((_p = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _p.show_total_products) ? summaryText : null });
|
|
10223
10247
|
const searchFieldComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Search, { placeholder: language_search_form_placeholder == null ? void 0 : language_search_form_placeholder.product, value: keyword, handleChangeSearch: handleChangeKeyword });
|
|
10224
10248
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { placeholder: language_search_form_placeholder == null ? void 0 : language_search_form_placeholder.product, value: keyword, handleChangeSearch: handleChangeKeyword });
|
|
10225
10249
|
const sortComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -10232,7 +10256,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10232
10256
|
overridePlaceholderOnMobile: !mobileShowSelectedSort ? mobile_sort_placeholder || "Sort" : null
|
|
10233
10257
|
}
|
|
10234
10258
|
);
|
|
10235
|
-
const limitComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Limit, { label: language_limit, options: (
|
|
10259
|
+
const limitComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Limit, { label: language_limit, options: (_q = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _q.allowed_limit, clickedOption: clickedLimitId, handleChangeOption: handleChangeLimit });
|
|
10236
10260
|
const productGridComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10237
10261
|
ProductGrid,
|
|
10238
10262
|
{
|
|
@@ -10246,9 +10270,9 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10246
10270
|
};
|
|
10247
10271
|
}),
|
|
10248
10272
|
setting: {
|
|
10249
|
-
show_vendor: (
|
|
10250
|
-
show_sku: (
|
|
10251
|
-
show_price: (
|
|
10273
|
+
show_vendor: (_r = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _r.show_vendor,
|
|
10274
|
+
show_sku: (_s = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _s.show_sku,
|
|
10275
|
+
show_price: (_t = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _t.show_price,
|
|
10252
10276
|
language_button_add_to_cart: language_add_to_cart,
|
|
10253
10277
|
language_button_out_of_stock: languageSettings && languageSettings["out of stock"] ? languageSettings["out of stock"] : ""
|
|
10254
10278
|
},
|
|
@@ -10262,7 +10286,9 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10262
10286
|
dataWishlists: propsData == null ? void 0 : propsData.wishlists,
|
|
10263
10287
|
dataReviews: propsData == null ? void 0 : propsData.reviews,
|
|
10264
10288
|
currentColumnGrid,
|
|
10265
|
-
previewSettings
|
|
10289
|
+
previewSettings,
|
|
10290
|
+
hitsPerPage: hitsPerPageResult,
|
|
10291
|
+
currentPage
|
|
10266
10292
|
}
|
|
10267
10293
|
);
|
|
10268
10294
|
const resultEmptyComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(ResultEmpty, { ...props });
|