@sledge-app/react-instant-search 2.0.6 → 2.0.8
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/layouts/DesktopLayout.d.ts.map +1 -1
- package/dist/components/SearchResultWidget/layouts/Elements.d.ts +1 -0
- package/dist/components/SearchResultWidget/layouts/Elements.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 +143 -62
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -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}`
|
|
@@ -7949,8 +7971,8 @@ const SummaryTextVertical = (props) => {
|
|
|
7949
7971
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical ${className}`, children });
|
|
7950
7972
|
};
|
|
7951
7973
|
const RenderLayout = (props) => {
|
|
7952
|
-
const { children, device, layout = "" } = props;
|
|
7953
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__render-layout", "data-render-device": device, "data-render-layout": layout, children });
|
|
7974
|
+
const { children, device, layout = "", additionalProps = {} } = props;
|
|
7975
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__render-layout", "data-render-device": device, "data-render-layout": layout, ...additionalProps, children });
|
|
7954
7976
|
};
|
|
7955
7977
|
const FilterHorizontalBlockMobile = (props) => {
|
|
7956
7978
|
const { children } = props;
|
|
@@ -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, _b;
|
|
7994
|
+
var _a, _b, _c;
|
|
7973
7995
|
const {
|
|
7974
7996
|
displaySettings,
|
|
7975
7997
|
allowedFilter,
|
|
@@ -8011,7 +8033,7 @@ const FilterVerticalLayout = (props) => {
|
|
|
8011
8033
|
}) : null,
|
|
8012
8034
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(ResultData, { children: [
|
|
8013
8035
|
isFirstLoading ? searchAndSelectOptionSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsxs(ResultDataKeyword, { children: [
|
|
8014
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SearchFieldDesktop, { children: searchField }),
|
|
8036
|
+
((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.hide_search_bar) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SearchFieldDesktop, { children: searchField }),
|
|
8015
8037
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
|
|
8016
8038
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
|
|
8017
8039
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit })
|
|
@@ -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
|
-
((
|
|
8045
|
+
((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.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,8 +8053,21 @@ const FilterVerticalLayout = (props) => {
|
|
|
8031
8053
|
] }) });
|
|
8032
8054
|
};
|
|
8033
8055
|
const FilterHorizontalLayout = (props) => {
|
|
8034
|
-
var _a, _b;
|
|
8035
|
-
const {
|
|
8056
|
+
var _a, _b, _c;
|
|
8057
|
+
const {
|
|
8058
|
+
displaySettings,
|
|
8059
|
+
allowedFilter,
|
|
8060
|
+
isFirstLoading,
|
|
8061
|
+
isLoading,
|
|
8062
|
+
isLoadingProduct,
|
|
8063
|
+
isLoadingSetting,
|
|
8064
|
+
searchResult = [],
|
|
8065
|
+
propsData,
|
|
8066
|
+
hideFilterWhenOneValue,
|
|
8067
|
+
components,
|
|
8068
|
+
skeleton,
|
|
8069
|
+
handleSearchResultFirstTime
|
|
8070
|
+
} = props;
|
|
8036
8071
|
const {
|
|
8037
8072
|
filterHorizontal = null,
|
|
8038
8073
|
summaryText = null,
|
|
@@ -8056,16 +8091,16 @@ const FilterHorizontalLayout = (props) => {
|
|
|
8056
8091
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8057
8092
|
isShowFilter ? filterHorizontal == null ? void 0 : filterHorizontal({
|
|
8058
8093
|
deviceType: "desktop",
|
|
8059
|
-
isSkeleton: Boolean(isFirstLoading && !propsData || isLoadingSetting && !propsData)
|
|
8094
|
+
isSkeleton: Boolean(handleSearchResultFirstTime || isFirstLoading && !propsData || isLoadingSetting && !propsData)
|
|
8060
8095
|
}) : null,
|
|
8061
8096
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ResultWrapper, { displaySettings, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ResultData, { children: [
|
|
8062
8097
|
isFirstLoading ? searchAndSelectOptionSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsxs(ResultDataKeyword, { children: [
|
|
8063
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SummaryTextHorizontal, { children: summaryText }),
|
|
8064
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SearchFieldDesktop, { children: searchField }),
|
|
8098
|
+
handleSearchResultFirstTime ? summaryTextSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsx(SummaryTextHorizontal, { children: summaryText }),
|
|
8099
|
+
((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.hide_search_bar) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SearchFieldDesktop, { children: searchField }),
|
|
8065
8100
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
|
|
8066
8101
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
|
|
8067
8102
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit }),
|
|
8068
|
-
((
|
|
8103
|
+
((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null
|
|
8069
8104
|
] })
|
|
8070
8105
|
] }),
|
|
8071
8106
|
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 +8111,7 @@ const FilterHorizontalLayout = (props) => {
|
|
|
8076
8111
|
] });
|
|
8077
8112
|
};
|
|
8078
8113
|
const FilterFlyoutLayout$1 = (props) => {
|
|
8079
|
-
var _a, _b;
|
|
8114
|
+
var _a, _b, _c;
|
|
8080
8115
|
const {
|
|
8081
8116
|
displaySettings,
|
|
8082
8117
|
languageSettings,
|
|
@@ -8135,7 +8170,7 @@ const FilterFlyoutLayout$1 = (props) => {
|
|
|
8135
8170
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: language_filter || "Filter" }),
|
|
8136
8171
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FilterIcon, { width: 18, height: 18, color: "#393d4e" })
|
|
8137
8172
|
] }),
|
|
8138
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SearchFieldDesktop, { children: searchField })
|
|
8173
|
+
((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.hide_search_bar) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SearchFieldDesktop, { children: searchField })
|
|
8139
8174
|
] }),
|
|
8140
8175
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
|
|
8141
8176
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
|
|
@@ -8145,7 +8180,7 @@ const FilterFlyoutLayout$1 = (props) => {
|
|
|
8145
8180
|
isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8146
8181
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SummaryTextVertical, { className: "sledge-instant-search__result-summary-text-with-column-grid-selector-wrapper", children: [
|
|
8147
8182
|
summaryText,
|
|
8148
|
-
((
|
|
8183
|
+
((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null
|
|
8149
8184
|
] }),
|
|
8150
8185
|
(searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8151
8186
|
productGrid,
|
|
@@ -8156,7 +8191,7 @@ const FilterFlyoutLayout$1 = (props) => {
|
|
|
8156
8191
|
] });
|
|
8157
8192
|
};
|
|
8158
8193
|
const EnterpriseLayout = (props) => {
|
|
8159
|
-
var _a, _b, _c;
|
|
8194
|
+
var _a, _b, _c, _d;
|
|
8160
8195
|
const {
|
|
8161
8196
|
displaySettings,
|
|
8162
8197
|
allowedFilter,
|
|
@@ -8202,7 +8237,8 @@ const EnterpriseLayout = (props) => {
|
|
|
8202
8237
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FilterIcon, { width: 18, height: 18, color: "#393d4e" })
|
|
8203
8238
|
] }),
|
|
8204
8239
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
|
|
8205
|
-
|
|
8240
|
+
((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.hide_search_bar) ? null : searchField,
|
|
8241
|
+
((_d = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _d.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) }) : null
|
|
8206
8242
|
] }),
|
|
8207
8243
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(ResultData, { children: [
|
|
8208
8244
|
/* @__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 +8253,7 @@ const EnterpriseLayout = (props) => {
|
|
|
8217
8253
|
] }) });
|
|
8218
8254
|
};
|
|
8219
8255
|
const YuvaLayout = (props) => {
|
|
8220
|
-
var _a, _b, _c;
|
|
8256
|
+
var _a, _b, _c, _d;
|
|
8221
8257
|
const {
|
|
8222
8258
|
displaySettings,
|
|
8223
8259
|
allowedFilter,
|
|
@@ -8232,7 +8268,8 @@ const YuvaLayout = (props) => {
|
|
|
8232
8268
|
languageSettings,
|
|
8233
8269
|
openFilterToggle = false,
|
|
8234
8270
|
setOpenFilterToggle = () => {
|
|
8235
|
-
}
|
|
8271
|
+
},
|
|
8272
|
+
handleSearchResultFirstTime
|
|
8236
8273
|
} = props;
|
|
8237
8274
|
const { filter: language_filter } = languageSettings || {};
|
|
8238
8275
|
const {
|
|
@@ -8262,9 +8299,10 @@ const YuvaLayout = (props) => {
|
|
|
8262
8299
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: language_filter || "Filter" }),
|
|
8263
8300
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FilterIcon, { width: 18, height: 18, color: "#393d4e" })
|
|
8264
8301
|
] }),
|
|
8302
|
+
((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.hide_search_bar) ? null : searchField,
|
|
8265
8303
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
|
|
8266
|
-
summaryText,
|
|
8267
|
-
((
|
|
8304
|
+
handleSearchResultFirstTime ? summaryTextSkeleton : summaryText,
|
|
8305
|
+
((_d = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _d.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null,
|
|
8268
8306
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort })
|
|
8269
8307
|
] })
|
|
8270
8308
|
] }),
|
|
@@ -8281,8 +8319,21 @@ const YuvaLayout = (props) => {
|
|
|
8281
8319
|
] }) });
|
|
8282
8320
|
};
|
|
8283
8321
|
const ToyoLayout = (props) => {
|
|
8284
|
-
var _a, _b, _c;
|
|
8285
|
-
const {
|
|
8322
|
+
var _a, _b, _c, _d;
|
|
8323
|
+
const {
|
|
8324
|
+
displaySettings,
|
|
8325
|
+
allowedFilter,
|
|
8326
|
+
isFirstLoading,
|
|
8327
|
+
isLoading,
|
|
8328
|
+
isLoadingProduct,
|
|
8329
|
+
isLoadingSetting,
|
|
8330
|
+
searchResult = [],
|
|
8331
|
+
propsData,
|
|
8332
|
+
hideFilterWhenOneValue,
|
|
8333
|
+
components,
|
|
8334
|
+
skeleton,
|
|
8335
|
+
handleSearchResultFirstTime
|
|
8336
|
+
} = props;
|
|
8286
8337
|
const {
|
|
8287
8338
|
filterHorizontal = null,
|
|
8288
8339
|
filterActive = null,
|
|
@@ -8305,18 +8356,21 @@ const ToyoLayout = (props) => {
|
|
|
8305
8356
|
} = skeleton || {};
|
|
8306
8357
|
const isShowFilter = ((_a = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _a.enable_on_search) && ((_b = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _b.layout) === "toyo" && !hideFilterWhenOneValue;
|
|
8307
8358
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResultWrapper, { displaySettings, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ResultData, { children: [
|
|
8308
|
-
isFirstLoading ? searchAndSelectOptionSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8359
|
+
isFirstLoading ? searchAndSelectOptionSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8360
|
+
((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.hide_search_bar) ? null : searchField,
|
|
8361
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(ResultDataKeyword, { children: [
|
|
8362
|
+
handleSearchResultFirstTime ? summaryTextSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsx(SummaryTextHorizontal, { children: summaryText }),
|
|
8363
|
+
isShowFilter ? filterHorizontal == null ? void 0 : filterHorizontal({
|
|
8364
|
+
deviceType: "desktop",
|
|
8365
|
+
isSkeleton: Boolean(handleSearchResultFirstTime || isFirstLoading && !propsData || isLoadingSetting && !propsData),
|
|
8366
|
+
isHorizontalGroup: true,
|
|
8367
|
+
showOnlyItems: true,
|
|
8368
|
+
components: {
|
|
8369
|
+
sort
|
|
8370
|
+
}
|
|
8371
|
+
}) : null,
|
|
8372
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldWrapper, { children: ((_d = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _d.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null })
|
|
8373
|
+
] })
|
|
8320
8374
|
] }),
|
|
8321
8375
|
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
8376
|
filterActive == null ? void 0 : filterActive(),
|
|
@@ -8326,8 +8380,21 @@ const ToyoLayout = (props) => {
|
|
|
8326
8380
|
] }) }) });
|
|
8327
8381
|
};
|
|
8328
8382
|
const FilterHorizontalGroupLayout = (props) => {
|
|
8329
|
-
var _a, _b;
|
|
8330
|
-
const {
|
|
8383
|
+
var _a, _b, _c;
|
|
8384
|
+
const {
|
|
8385
|
+
displaySettings,
|
|
8386
|
+
allowedFilter,
|
|
8387
|
+
isFirstLoading,
|
|
8388
|
+
isLoading,
|
|
8389
|
+
isLoadingProduct,
|
|
8390
|
+
isLoadingSetting,
|
|
8391
|
+
searchResult = [],
|
|
8392
|
+
propsData,
|
|
8393
|
+
hideFilterWhenOneValue,
|
|
8394
|
+
components,
|
|
8395
|
+
skeleton,
|
|
8396
|
+
handleSearchResultFirstTime
|
|
8397
|
+
} = props;
|
|
8331
8398
|
const {
|
|
8332
8399
|
filterHorizontal = null,
|
|
8333
8400
|
summaryText = null,
|
|
@@ -8351,17 +8418,17 @@ const FilterHorizontalGroupLayout = (props) => {
|
|
|
8351
8418
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8352
8419
|
isShowFilter ? filterHorizontal == null ? void 0 : filterHorizontal({
|
|
8353
8420
|
deviceType: "desktop",
|
|
8354
|
-
isSkeleton: Boolean(isFirstLoading && !propsData || isLoadingSetting && !propsData),
|
|
8421
|
+
isSkeleton: Boolean(handleSearchResultFirstTime || isFirstLoading && !propsData || isLoadingSetting && !propsData),
|
|
8355
8422
|
isHorizontalGroup: true
|
|
8356
8423
|
}) : null,
|
|
8357
8424
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ResultWrapper, { displaySettings, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ResultData, { children: [
|
|
8358
8425
|
isFirstLoading ? searchAndSelectOptionSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsxs(ResultDataKeyword, { children: [
|
|
8359
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SummaryTextHorizontal, { children: summaryText }),
|
|
8360
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SearchFieldDesktop, { children: searchField }),
|
|
8426
|
+
handleSearchResultFirstTime ? summaryTextSkeleton : /* @__PURE__ */ jsxRuntimeExports.jsx(SummaryTextHorizontal, { children: summaryText }),
|
|
8427
|
+
((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.hide_search_bar) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SearchFieldDesktop, { children: searchField }),
|
|
8361
8428
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
|
|
8362
8429
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
|
|
8363
8430
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit }),
|
|
8364
|
-
((
|
|
8431
|
+
((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null
|
|
8365
8432
|
] })
|
|
8366
8433
|
] }),
|
|
8367
8434
|
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: [
|
|
@@ -8372,7 +8439,7 @@ const FilterHorizontalGroupLayout = (props) => {
|
|
|
8372
8439
|
] });
|
|
8373
8440
|
};
|
|
8374
8441
|
const DesktopLayout = (props) => {
|
|
8375
|
-
var _a;
|
|
8442
|
+
var _a, _b;
|
|
8376
8443
|
const { displaySettings } = props;
|
|
8377
8444
|
const renderLayout = () => {
|
|
8378
8445
|
var _a2;
|
|
@@ -8395,7 +8462,17 @@ const DesktopLayout = (props) => {
|
|
|
8395
8462
|
return null;
|
|
8396
8463
|
}
|
|
8397
8464
|
};
|
|
8398
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8465
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8466
|
+
RenderLayout,
|
|
8467
|
+
{
|
|
8468
|
+
device: "desktop",
|
|
8469
|
+
layout: (_a = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _a.layout,
|
|
8470
|
+
additionalProps: {
|
|
8471
|
+
"data-hide-search-bar": (_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.hide_search_bar
|
|
8472
|
+
},
|
|
8473
|
+
children: renderLayout()
|
|
8474
|
+
}
|
|
8475
|
+
);
|
|
8399
8476
|
};
|
|
8400
8477
|
const FilterFlyoutLayout = (props) => {
|
|
8401
8478
|
var _a;
|
|
@@ -9477,7 +9554,7 @@ const SearchResultWidget = (props) => {
|
|
|
9477
9554
|
] });
|
|
9478
9555
|
};
|
|
9479
9556
|
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;
|
|
9557
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
9481
9558
|
const {
|
|
9482
9559
|
layoutType,
|
|
9483
9560
|
keyword,
|
|
@@ -9573,10 +9650,11 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9573
9650
|
);
|
|
9574
9651
|
const [triggerClickedFacets, setTriggerClickedFacets] = React__default.useState(false);
|
|
9575
9652
|
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) || []);
|
|
9653
|
+
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
9654
|
const [searchProcessingTimeMs, setSearchProcessingTimeMs] = React__default.useState(0);
|
|
9577
9655
|
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
9656
|
const [totalPage, setTotalPage] = React__default.useState(0);
|
|
9579
|
-
const [totalSearchResult, setTotalSearchResult] = React__default.useState(((
|
|
9657
|
+
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
9658
|
const [handleSearchResultFirstTime, setHandleSearchResultFirstTime] = React__default.useState(true);
|
|
9581
9659
|
const [searchFacetDistribution, setSearchFacetDistribution] = React__default.useState({});
|
|
9582
9660
|
const [isLoadingButtonLoadMore, setIsLoadingButtonLoadMore] = React__default.useState(false);
|
|
@@ -9628,13 +9706,13 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9628
9706
|
};
|
|
9629
9707
|
const [summaryText, setSummaryText] = React__default.useState(propsData ? summaryTextGenerator(totalSearchResult) : null);
|
|
9630
9708
|
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 } = ((
|
|
9709
|
+
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
9710
|
const {
|
|
9633
9711
|
color: filter_option_color,
|
|
9634
9712
|
font_size: filter_option_font_size,
|
|
9635
9713
|
font_weight: filter_option_font_weight,
|
|
9636
9714
|
text_transform: filter_option_text_transform
|
|
9637
|
-
} = ((
|
|
9715
|
+
} = ((_l = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _l.option) || {};
|
|
9638
9716
|
const {
|
|
9639
9717
|
text_color: filter_button_text_color,
|
|
9640
9718
|
border_color: filter_button_border_color,
|
|
@@ -9647,7 +9725,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9647
9725
|
font_size: filter_button_font_size,
|
|
9648
9726
|
font_weight: filter_button_font_weight,
|
|
9649
9727
|
text_transform: filter_button_text_transform
|
|
9650
|
-
} = ((
|
|
9728
|
+
} = ((_m = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _m.button) || {};
|
|
9651
9729
|
const filter_title_style = {
|
|
9652
9730
|
...filter_title_color && { color: filter_title_color },
|
|
9653
9731
|
...filter_title_font_size && { fontSize: filter_title_font_size },
|
|
@@ -9834,7 +9912,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9834
9912
|
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
9913
|
if (!result)
|
|
9836
9914
|
return;
|
|
9837
|
-
const { hits, processingTimeMs, totalHits, totalPages, facetDistribution } = result;
|
|
9915
|
+
const { hits, hitsPerPage, processingTimeMs, totalHits, totalPages, facetDistribution } = result;
|
|
9838
9916
|
const updateTabs = () => {
|
|
9839
9917
|
const valueAllowedTabs = objectPresent(previewSettings) ? tabs : allowedTabs;
|
|
9840
9918
|
if (valueAllowedTabs == null ? void 0 : valueAllowedTabs.length) {
|
|
@@ -9891,6 +9969,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
9891
9969
|
setIsLoadingButtonLoadMore(false);
|
|
9892
9970
|
setIsReplaceWidgetList == null ? void 0 : setIsReplaceWidgetList(false);
|
|
9893
9971
|
setSearchResult(!(hits == null ? void 0 : hits.length) ? [] : (prevState) => (searchResult == null ? void 0 : searchResult.length) && isLoadMore2 ? [...prevState, ...hits] : hits);
|
|
9972
|
+
setHitsPerPageResult(hitsPerPage);
|
|
9894
9973
|
setSearchProcessingTimeMs(processingTimeMs || 0);
|
|
9895
9974
|
setTotalPage(totalPages);
|
|
9896
9975
|
setTotalSearchResult(totalHits || 0);
|
|
@@ -10201,7 +10280,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10201
10280
|
const paginationComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10202
10281
|
PaginationOrLoadMore,
|
|
10203
10282
|
{
|
|
10204
|
-
type: (
|
|
10283
|
+
type: (_n = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _n.pagination_type,
|
|
10205
10284
|
isLoadMore,
|
|
10206
10285
|
isLoadingButtonLoadMore,
|
|
10207
10286
|
handleLoadMore: () => {
|
|
@@ -10210,7 +10289,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10210
10289
|
setIsReplaceWidgetList == null ? void 0 : setIsReplaceWidgetList(true);
|
|
10211
10290
|
},
|
|
10212
10291
|
buttonLoadMoreText: isLoadingButtonLoadMore ? button_loading || "Loading..." : button_load_more || "Load More",
|
|
10213
|
-
isInfiniteScroll: ((
|
|
10292
|
+
isInfiniteScroll: ((_o = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _o.pagination_type) === "infinite_scroll",
|
|
10214
10293
|
currentPage,
|
|
10215
10294
|
totalPage,
|
|
10216
10295
|
totalResult: totalSearchResult,
|
|
@@ -10219,7 +10298,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10219
10298
|
handlePageChange
|
|
10220
10299
|
}
|
|
10221
10300
|
);
|
|
10222
|
-
const summaryTextComponent = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-data-summary-item", children: ((
|
|
10301
|
+
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
10302
|
const searchFieldComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Search, { placeholder: language_search_form_placeholder == null ? void 0 : language_search_form_placeholder.product, value: keyword, handleChangeSearch: handleChangeKeyword });
|
|
10224
10303
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { placeholder: language_search_form_placeholder == null ? void 0 : language_search_form_placeholder.product, value: keyword, handleChangeSearch: handleChangeKeyword });
|
|
10225
10304
|
const sortComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -10232,7 +10311,7 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10232
10311
|
overridePlaceholderOnMobile: !mobileShowSelectedSort ? mobile_sort_placeholder || "Sort" : null
|
|
10233
10312
|
}
|
|
10234
10313
|
);
|
|
10235
|
-
const limitComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Limit, { label: language_limit, options: (
|
|
10314
|
+
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
10315
|
const productGridComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10237
10316
|
ProductGrid,
|
|
10238
10317
|
{
|
|
@@ -10246,9 +10325,9 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10246
10325
|
};
|
|
10247
10326
|
}),
|
|
10248
10327
|
setting: {
|
|
10249
|
-
show_vendor: (
|
|
10250
|
-
show_sku: (
|
|
10251
|
-
show_price: (
|
|
10328
|
+
show_vendor: (_r = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _r.show_vendor,
|
|
10329
|
+
show_sku: (_s = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _s.show_sku,
|
|
10330
|
+
show_price: (_t = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _t.show_price,
|
|
10252
10331
|
language_button_add_to_cart: language_add_to_cart,
|
|
10253
10332
|
language_button_out_of_stock: languageSettings && languageSettings["out of stock"] ? languageSettings["out of stock"] : ""
|
|
10254
10333
|
},
|
|
@@ -10262,7 +10341,9 @@ const ResultProduct = React__default.memo((props) => {
|
|
|
10262
10341
|
dataWishlists: propsData == null ? void 0 : propsData.wishlists,
|
|
10263
10342
|
dataReviews: propsData == null ? void 0 : propsData.reviews,
|
|
10264
10343
|
currentColumnGrid,
|
|
10265
|
-
previewSettings
|
|
10344
|
+
previewSettings,
|
|
10345
|
+
hitsPerPage: hitsPerPageResult,
|
|
10346
|
+
currentPage
|
|
10266
10347
|
}
|
|
10267
10348
|
);
|
|
10268
10349
|
const resultEmptyComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(ResultEmpty, { ...props });
|