@getlupa/client 1.21.3 → 1.22.1
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/lupaSearch.iife.js +153 -57
- package/dist/lupaSearch.js +153 -57
- package/dist/lupaSearch.mjs +153 -57
- package/dist/lupaSearch.umd.js +153 -57
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/lupaSearch.mjs
CHANGED
|
@@ -19171,6 +19171,18 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
19171
19171
|
params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
|
|
19172
19172
|
searchString.value = url.search;
|
|
19173
19173
|
};
|
|
19174
|
+
const getPageUrlWithNewParams = ({
|
|
19175
|
+
params: newParams,
|
|
19176
|
+
paramsToRemove,
|
|
19177
|
+
encode: encode2 = true,
|
|
19178
|
+
searchResultsLink: searchResultsLink2
|
|
19179
|
+
}) => {
|
|
19180
|
+
const url = getPageUrl(searchResultsLink2);
|
|
19181
|
+
paramsToRemove = getRemovableParams(url, optionsStore.getQueryParamName, paramsToRemove);
|
|
19182
|
+
removeParams(url, paramsToRemove);
|
|
19183
|
+
newParams.forEach((p2) => appendParam(url, p2, encode2));
|
|
19184
|
+
return url.search;
|
|
19185
|
+
};
|
|
19174
19186
|
const removeParameters = ({
|
|
19175
19187
|
paramsToRemove,
|
|
19176
19188
|
save = true
|
|
@@ -19308,6 +19320,7 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
19308
19320
|
sortParams,
|
|
19309
19321
|
lastChangedParams,
|
|
19310
19322
|
skipFacetReload,
|
|
19323
|
+
getPageUrlWithNewParams,
|
|
19311
19324
|
add,
|
|
19312
19325
|
removeAllFilters,
|
|
19313
19326
|
removeParameters,
|
|
@@ -31456,7 +31469,16 @@ const extractFromHtmlElementAttribute = (options) => {
|
|
|
31456
31469
|
if (attr === "value" && (element == null ? void 0 : element.value)) {
|
|
31457
31470
|
return element.value;
|
|
31458
31471
|
}
|
|
31459
|
-
|
|
31472
|
+
const attributeValue = element.getAttribute(attr);
|
|
31473
|
+
if (attributeValue === null || attributeValue === void 0) {
|
|
31474
|
+
return options.default;
|
|
31475
|
+
}
|
|
31476
|
+
if (options.regex) {
|
|
31477
|
+
const regex = new RegExp(options.regex);
|
|
31478
|
+
const match = attributeValue.match(regex);
|
|
31479
|
+
return match ? match[1] : options.default;
|
|
31480
|
+
}
|
|
31481
|
+
return attributeValue;
|
|
31460
31482
|
};
|
|
31461
31483
|
const getValueFromPath = (obj, path) => {
|
|
31462
31484
|
return path.split(".").reduce((value, key) => value && value[key] || null, obj);
|
|
@@ -35140,8 +35162,7 @@ const _hoisted_2$u = {
|
|
|
35140
35162
|
key: 0,
|
|
35141
35163
|
class: "lupa-page-number-separator"
|
|
35142
35164
|
};
|
|
35143
|
-
const _hoisted_3$m =
|
|
35144
|
-
const _hoisted_4$e = {
|
|
35165
|
+
const _hoisted_3$m = {
|
|
35145
35166
|
key: 0,
|
|
35146
35167
|
class: "lupa-page-number-separator"
|
|
35147
35168
|
};
|
|
@@ -35208,7 +35229,24 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
35208
35229
|
timeout: (_f = (_e = searchResultOptions.value.scrollToResults) == null ? void 0 : _e.timeout) != null ? _f : 500
|
|
35209
35230
|
};
|
|
35210
35231
|
});
|
|
35211
|
-
const
|
|
35232
|
+
const tagName = computed(() => {
|
|
35233
|
+
return props.options.renderAsLinks ? "a" : "div";
|
|
35234
|
+
});
|
|
35235
|
+
const getPageUrlWithNewParams = (page) => {
|
|
35236
|
+
return paramStore.getPageUrlWithNewParams({
|
|
35237
|
+
params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.PAGE), value: page.toString() }]
|
|
35238
|
+
});
|
|
35239
|
+
};
|
|
35240
|
+
const getHref = (page) => {
|
|
35241
|
+
if (props.options.renderAsLinks) {
|
|
35242
|
+
return getPageUrlWithNewParams(page);
|
|
35243
|
+
}
|
|
35244
|
+
return null;
|
|
35245
|
+
};
|
|
35246
|
+
const handlePageChange = (e2, page) => {
|
|
35247
|
+
if (e2 && props.options.renderAsLinks) {
|
|
35248
|
+
e2.preventDefault();
|
|
35249
|
+
}
|
|
35212
35250
|
if (page > 0) {
|
|
35213
35251
|
paramStore.appendParams({
|
|
35214
35252
|
params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.PAGE), value: page.toString() }]
|
|
@@ -35222,46 +35260,78 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
35222
35260
|
}
|
|
35223
35261
|
};
|
|
35224
35262
|
return (_ctx, _cache) => {
|
|
35263
|
+
var _a25;
|
|
35225
35264
|
return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$D, [
|
|
35226
|
-
showBack.value ? (openBlock(),
|
|
35265
|
+
showBack.value ? (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
35227
35266
|
key: 0,
|
|
35228
35267
|
class: normalizeClass(firstPageLabel.value === "<" ? "lupa-page-arrow" : "lupa-show-less"),
|
|
35229
|
-
|
|
35230
|
-
|
|
35268
|
+
href: getHref(_ctx.options.selectedPage - 1),
|
|
35269
|
+
onClick: _cache[0] || (_cache[0] = (e2) => handlePageChange(e2, _ctx.options.selectedPage - 1))
|
|
35270
|
+
}, {
|
|
35271
|
+
default: withCtx(() => [
|
|
35272
|
+
createTextVNode(toDisplayString(firstPageLabel.value), 1)
|
|
35273
|
+
]),
|
|
35274
|
+
_: 1
|
|
35275
|
+
}, 8, ["class", "href"])) : createCommentVNode("", true),
|
|
35231
35276
|
showFirstPage.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
35232
|
-
|
|
35277
|
+
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
35278
|
+
href: getHref(1),
|
|
35233
35279
|
class: "lupa-page-number lupa-page-number-first",
|
|
35234
|
-
onClick: _cache[1] || (_cache[1] = () => handlePageChange(1))
|
|
35235
|
-
},
|
|
35280
|
+
onClick: _cache[1] || (_cache[1] = (e2) => handlePageChange(e2, 1))
|
|
35281
|
+
}, {
|
|
35282
|
+
default: withCtx(() => _cache[4] || (_cache[4] = [
|
|
35283
|
+
createTextVNode(" 1 ")
|
|
35284
|
+
])),
|
|
35285
|
+
_: 1,
|
|
35286
|
+
__: [4]
|
|
35287
|
+
}, 8, ["href"])),
|
|
35236
35288
|
showFirstPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_2$u, "...")) : createCommentVNode("", true)
|
|
35237
35289
|
], 64)) : createCommentVNode("", true),
|
|
35238
35290
|
(openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (page) => {
|
|
35239
|
-
return openBlock(),
|
|
35291
|
+
return openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
35240
35292
|
key: page,
|
|
35241
|
-
|
|
35293
|
+
href: getHref(page),
|
|
35294
|
+
onClick: (e2) => handlePageChange(e2, page),
|
|
35242
35295
|
class: normalizeClass([
|
|
35243
35296
|
"lupa-page-number",
|
|
35244
35297
|
page === _ctx.options.selectedPage ? "lupa-page-number-selected" : ""
|
|
35245
35298
|
]),
|
|
35246
35299
|
"data-cy": "lupa-page-number"
|
|
35247
|
-
},
|
|
35300
|
+
}, {
|
|
35301
|
+
default: withCtx(() => [
|
|
35302
|
+
createTextVNode(toDisplayString(page), 1)
|
|
35303
|
+
]),
|
|
35304
|
+
_: 2
|
|
35305
|
+
}, 1032, ["href", "onClick", "class"]);
|
|
35248
35306
|
}), 128)),
|
|
35249
35307
|
showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
35250
|
-
showLastPageSeparator.value ? (openBlock(), createElementBlock("div",
|
|
35251
|
-
|
|
35308
|
+
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_3$m, "...")) : createCommentVNode("", true),
|
|
35309
|
+
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
35310
|
+
href: getHref((_a25 = lastPage.value) != null ? _a25 : 1),
|
|
35252
35311
|
class: "lupa-page-number lupa-page-number-last",
|
|
35253
|
-
onClick: _cache[2] || (_cache[2] = () => {
|
|
35254
|
-
var
|
|
35255
|
-
return handlePageChange((
|
|
35312
|
+
onClick: _cache[2] || (_cache[2] = (e2) => {
|
|
35313
|
+
var _a26;
|
|
35314
|
+
return handlePageChange(e2, (_a26 = lastPage.value) != null ? _a26 : 1);
|
|
35256
35315
|
})
|
|
35257
|
-
},
|
|
35316
|
+
}, {
|
|
35317
|
+
default: withCtx(() => [
|
|
35318
|
+
createTextVNode(toDisplayString(lastPage.value), 1)
|
|
35319
|
+
]),
|
|
35320
|
+
_: 1
|
|
35321
|
+
}, 8, ["href"]))
|
|
35258
35322
|
], 64)) : createCommentVNode("", true),
|
|
35259
|
-
_ctx.options.selectedPage < _ctx.options.count ? (openBlock(),
|
|
35323
|
+
_ctx.options.selectedPage < _ctx.options.count ? (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
35260
35324
|
key: 3,
|
|
35261
35325
|
class: normalizeClass(lastPageLabel.value === ">" ? "lupa-page-arrow" : "lupa-show-more"),
|
|
35326
|
+
href: getHref(_ctx.options.selectedPage + 1),
|
|
35262
35327
|
"data-cy": "lupa-show-more",
|
|
35263
|
-
onClick: _cache[3] || (_cache[3] = () => handlePageChange(_ctx.options.selectedPage + 1))
|
|
35264
|
-
},
|
|
35328
|
+
onClick: _cache[3] || (_cache[3] = (e2) => handlePageChange(e2, _ctx.options.selectedPage + 1))
|
|
35329
|
+
}, {
|
|
35330
|
+
default: withCtx(() => [
|
|
35331
|
+
createTextVNode(toDisplayString(lastPageLabel.value), 1)
|
|
35332
|
+
]),
|
|
35333
|
+
_: 1
|
|
35334
|
+
}, 8, ["class", "href"])) : createCommentVNode("", true)
|
|
35265
35335
|
])) : createCommentVNode("", true);
|
|
35266
35336
|
};
|
|
35267
35337
|
}
|
|
@@ -35275,7 +35345,7 @@ const _hoisted_3$l = {
|
|
|
35275
35345
|
class: "lupa-select-label",
|
|
35276
35346
|
for: "lupa-page-size-select-dropdown"
|
|
35277
35347
|
};
|
|
35278
|
-
const _hoisted_4$
|
|
35348
|
+
const _hoisted_4$e = ["aria-label"];
|
|
35279
35349
|
const _hoisted_5$a = ["value"];
|
|
35280
35350
|
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
35281
35351
|
__name: "SearchResultsPageSize",
|
|
@@ -35325,7 +35395,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
35325
35395
|
value: option
|
|
35326
35396
|
}, toDisplayString(prefixLabel.value) + toDisplayString(option), 9, _hoisted_5$a);
|
|
35327
35397
|
}), 128))
|
|
35328
|
-
], 40, _hoisted_4$
|
|
35398
|
+
], 40, _hoisted_4$e)
|
|
35329
35399
|
])
|
|
35330
35400
|
]);
|
|
35331
35401
|
};
|
|
@@ -35340,7 +35410,7 @@ const _hoisted_3$k = {
|
|
|
35340
35410
|
class: "lupa-select-label",
|
|
35341
35411
|
for: "lupa-sort-select-dropdown"
|
|
35342
35412
|
};
|
|
35343
|
-
const _hoisted_4$
|
|
35413
|
+
const _hoisted_4$d = ["aria-label"];
|
|
35344
35414
|
const _hoisted_5$9 = ["value"];
|
|
35345
35415
|
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
35346
35416
|
__name: "SearchResultsSort",
|
|
@@ -35411,7 +35481,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
35411
35481
|
value: option.key
|
|
35412
35482
|
}, toDisplayString(option.label), 9, _hoisted_5$9);
|
|
35413
35483
|
}), 128))
|
|
35414
|
-
], 40, _hoisted_4$
|
|
35484
|
+
], 40, _hoisted_4$d), [
|
|
35415
35485
|
[vModelSelect, selectedKey.value]
|
|
35416
35486
|
])
|
|
35417
35487
|
])
|
|
@@ -35425,7 +35495,7 @@ const _hoisted_2$r = {
|
|
|
35425
35495
|
class: "lupa-toolbar-right-title"
|
|
35426
35496
|
};
|
|
35427
35497
|
const _hoisted_3$j = { key: 2 };
|
|
35428
|
-
const _hoisted_4$
|
|
35498
|
+
const _hoisted_4$c = { key: 4 };
|
|
35429
35499
|
const _hoisted_5$8 = { key: 6 };
|
|
35430
35500
|
const _hoisted_6$4 = { class: "lupa-toolbar-right" };
|
|
35431
35501
|
const _hoisted_7$2 = {
|
|
@@ -35495,6 +35565,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
35495
35565
|
}
|
|
35496
35566
|
});
|
|
35497
35567
|
const paginationOptions = computed(() => {
|
|
35568
|
+
var _a25;
|
|
35498
35569
|
const pageSelect = optionsValue.value.pagination.pageSelection;
|
|
35499
35570
|
return {
|
|
35500
35571
|
pageSize: {
|
|
@@ -35505,7 +35576,8 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
35505
35576
|
count: getPageCount(searchResult.value.total, limit.value),
|
|
35506
35577
|
selectedPage: page.value,
|
|
35507
35578
|
display: pageSelect.display,
|
|
35508
|
-
displayMobile: pageSelect.displayMobile
|
|
35579
|
+
displayMobile: pageSelect.displayMobile,
|
|
35580
|
+
renderAsLinks: (_a25 = pageSelect.renderAsLinks) != null ? _a25 : false
|
|
35509
35581
|
},
|
|
35510
35582
|
labels: optionsValue.value.labels
|
|
35511
35583
|
};
|
|
@@ -35553,7 +35625,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
35553
35625
|
label: searchSummaryLabel.value,
|
|
35554
35626
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
35555
35627
|
onClear: handleClearAll
|
|
35556
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$
|
|
35628
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$c)),
|
|
35557
35629
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$I, {
|
|
35558
35630
|
key: 5,
|
|
35559
35631
|
options: paginationOptions.value.pageSelect,
|
|
@@ -35606,7 +35678,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
35606
35678
|
const _hoisted_1$z = ["title", "innerHTML"];
|
|
35607
35679
|
const _hoisted_2$q = ["title"];
|
|
35608
35680
|
const _hoisted_3$i = ["href", "innerHTML"];
|
|
35609
|
-
const _hoisted_4$
|
|
35681
|
+
const _hoisted_4$b = ["title"];
|
|
35610
35682
|
const _hoisted_5$7 = {
|
|
35611
35683
|
key: 0,
|
|
35612
35684
|
class: "lupa-search-results-product-title-text"
|
|
@@ -35674,7 +35746,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
35674
35746
|
class: "lupa-search-results-product-title-text lupa-title-link",
|
|
35675
35747
|
onClick: handleNavigation
|
|
35676
35748
|
}, toDisplayString(title.value), 9, _hoisted_6$3)) : createCommentVNode("", true)
|
|
35677
|
-
], 12, _hoisted_4$
|
|
35749
|
+
], 12, _hoisted_4$b));
|
|
35678
35750
|
};
|
|
35679
35751
|
}
|
|
35680
35752
|
});
|
|
@@ -35717,7 +35789,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
35717
35789
|
const _hoisted_1$x = { id: "lupa-search-results-rating" };
|
|
35718
35790
|
const _hoisted_2$p = { class: "lupa-ratings" };
|
|
35719
35791
|
const _hoisted_3$h = { class: "lupa-ratings-base" };
|
|
35720
|
-
const _hoisted_4$
|
|
35792
|
+
const _hoisted_4$a = ["innerHTML"];
|
|
35721
35793
|
const _hoisted_5$6 = { class: "lupa-rating-wrapper" };
|
|
35722
35794
|
const _hoisted_6$2 = ["innerHTML"];
|
|
35723
35795
|
const _hoisted_7$1 = ["href"];
|
|
@@ -35767,7 +35839,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
35767
35839
|
key: index,
|
|
35768
35840
|
innerHTML: star,
|
|
35769
35841
|
class: "lupa-rating lupa-rating-not-highlighted"
|
|
35770
|
-
}, null, 8, _hoisted_4$
|
|
35842
|
+
}, null, 8, _hoisted_4$a);
|
|
35771
35843
|
}), 128))
|
|
35772
35844
|
]),
|
|
35773
35845
|
createBaseVNode("div", _hoisted_5$6, [
|
|
@@ -35860,7 +35932,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
35860
35932
|
const _hoisted_1$v = { class: "lupa-search-results-add-to-cart-wrapper" };
|
|
35861
35933
|
const _hoisted_2$o = { class: "lupa-search-results-product-addtocart" };
|
|
35862
35934
|
const _hoisted_3$g = ["disabled"];
|
|
35863
|
-
const _hoisted_4$
|
|
35935
|
+
const _hoisted_4$9 = ["href"];
|
|
35864
35936
|
const _hoisted_5$5 = ["id", "disabled"];
|
|
35865
35937
|
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
35866
35938
|
__name: "SearchResultsProductAddToCart",
|
|
@@ -35929,7 +36001,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
35929
36001
|
"data-cy": "lupa-add-to-cart",
|
|
35930
36002
|
disabled: !inStockValue.value || loading.value
|
|
35931
36003
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
35932
|
-
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$
|
|
36004
|
+
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$9)
|
|
35933
36005
|
], 16, _hoisted_3$g)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
35934
36006
|
key: 1,
|
|
35935
36007
|
id: id.value,
|
|
@@ -35947,7 +36019,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
35947
36019
|
const _hoisted_1$u = ["innerHTML"];
|
|
35948
36020
|
const _hoisted_2$n = { key: 0 };
|
|
35949
36021
|
const _hoisted_3$f = { key: 1 };
|
|
35950
|
-
const _hoisted_4$
|
|
36022
|
+
const _hoisted_4$8 = { class: "lupa-search-box-custom-label" };
|
|
35951
36023
|
const _hoisted_5$4 = { class: "lupa-search-box-custom-text" };
|
|
35952
36024
|
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
35953
36025
|
__name: "SearchResultsProductCustom",
|
|
@@ -35976,7 +36048,11 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
35976
36048
|
var _a25;
|
|
35977
36049
|
return (_a25 = props.options.isHtml) != null ? _a25 : false;
|
|
35978
36050
|
});
|
|
35979
|
-
const handleClick = () => __async2(null, null, function* () {
|
|
36051
|
+
const handleClick = (e2) => __async2(null, null, function* () {
|
|
36052
|
+
if (e2 && props.options.stopPropagationOnClick) {
|
|
36053
|
+
e2.stopPropagation();
|
|
36054
|
+
e2.preventDefault();
|
|
36055
|
+
}
|
|
35980
36056
|
if (!props.options.action) {
|
|
35981
36057
|
return;
|
|
35982
36058
|
}
|
|
@@ -35992,7 +36068,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
35992
36068
|
class: className.value
|
|
35993
36069
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {})), [
|
|
35994
36070
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$n, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$f, [
|
|
35995
|
-
createBaseVNode("div", _hoisted_4$
|
|
36071
|
+
createBaseVNode("div", _hoisted_4$8, toDisplayString(label.value), 1),
|
|
35996
36072
|
createBaseVNode("div", _hoisted_5$4, toDisplayString(text.value), 1)
|
|
35997
36073
|
]))
|
|
35998
36074
|
], 16));
|
|
@@ -36019,7 +36095,11 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
36019
36095
|
const className = computed(() => {
|
|
36020
36096
|
return props.options.className;
|
|
36021
36097
|
});
|
|
36022
|
-
const handleClick = () => __async2(null, null, function* () {
|
|
36098
|
+
const handleClick = (e2) => __async2(null, null, function* () {
|
|
36099
|
+
if (e2 && props.options.stopPropagationOnClick) {
|
|
36100
|
+
e2.stopPropagation();
|
|
36101
|
+
e2.preventDefault();
|
|
36102
|
+
}
|
|
36023
36103
|
if (!props.options.action) {
|
|
36024
36104
|
return;
|
|
36025
36105
|
}
|
|
@@ -36039,7 +36119,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
36039
36119
|
const _hoisted_1$s = { id: "lupa-search-results-rating" };
|
|
36040
36120
|
const _hoisted_2$m = ["innerHTML"];
|
|
36041
36121
|
const _hoisted_3$e = { class: "lupa-ratings" };
|
|
36042
|
-
const _hoisted_4$
|
|
36122
|
+
const _hoisted_4$7 = ["href"];
|
|
36043
36123
|
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
36044
36124
|
__name: "SearchResultsProductSingleStarRating",
|
|
36045
36125
|
props: {
|
|
@@ -36077,7 +36157,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
36077
36157
|
createBaseVNode("a", {
|
|
36078
36158
|
href: ratingLink.value,
|
|
36079
36159
|
class: "lupa-total-ratings"
|
|
36080
|
-
}, toDisplayString(totalRatings.value), 9, _hoisted_4$
|
|
36160
|
+
}, toDisplayString(totalRatings.value), 9, _hoisted_4$7)
|
|
36081
36161
|
]);
|
|
36082
36162
|
};
|
|
36083
36163
|
}
|
|
@@ -36434,7 +36514,7 @@ const _hoisted_3$c = {
|
|
|
36434
36514
|
class: "lupa-similar-query-label",
|
|
36435
36515
|
"data-cy": "lupa-similar-query-label"
|
|
36436
36516
|
};
|
|
36437
|
-
const _hoisted_4$
|
|
36517
|
+
const _hoisted_4$6 = ["onClick"];
|
|
36438
36518
|
const _hoisted_5$3 = ["innerHTML"];
|
|
36439
36519
|
const _hoisted_6$1 = { key: 0 };
|
|
36440
36520
|
const _hoisted_7 = {
|
|
@@ -36495,7 +36575,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
36495
36575
|
innerHTML: getSimilarQueryContent(similarQuery.displayQuery)
|
|
36496
36576
|
}, null, 8, _hoisted_5$3),
|
|
36497
36577
|
similarQuery.count ? (openBlock(), createElementBlock("span", _hoisted_6$1, " (" + toDisplayString(similarQuery.count) + ")", 1)) : createCommentVNode("", true)
|
|
36498
|
-
], 8, _hoisted_4$
|
|
36578
|
+
], 8, _hoisted_4$6)
|
|
36499
36579
|
]),
|
|
36500
36580
|
createBaseVNode("div", _hoisted_7, [
|
|
36501
36581
|
(openBlock(true), createElementBlock(Fragment, null, renderList(similarQuery.items, (product, index2) => {
|
|
@@ -36827,7 +36907,7 @@ const extractRelatedSource = (source, searchResults2, options, activeFilters) =>
|
|
|
36827
36907
|
const _hoisted_1$l = { class: "lupa-related-query-item" };
|
|
36828
36908
|
const _hoisted_2$g = { class: "lupa-related-query-image" };
|
|
36829
36909
|
const _hoisted_3$a = { class: "lupa-related-query-label" };
|
|
36830
|
-
const _hoisted_4$
|
|
36910
|
+
const _hoisted_4$5 = { class: "lupa-related-query-title" };
|
|
36831
36911
|
const _hoisted_5$2 = {
|
|
36832
36912
|
key: 0,
|
|
36833
36913
|
class: "lupa-related-query-count"
|
|
@@ -36939,7 +37019,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
36939
37019
|
}, null, 8, ["item", "options"])) : createCommentVNode("", true)
|
|
36940
37020
|
]),
|
|
36941
37021
|
createBaseVNode("div", _hoisted_3$a, [
|
|
36942
|
-
createBaseVNode("span", _hoisted_4$
|
|
37022
|
+
createBaseVNode("span", _hoisted_4$5, toDisplayString(_ctx.query), 1),
|
|
36943
37023
|
((_a25 = _ctx.options) == null ? void 0 : _a25.showCount) ? (openBlock(), createElementBlock("span", _hoisted_5$2, "(" + toDisplayString(totalItemCount.value) + ")", 1)) : createCommentVNode("", true)
|
|
36944
37024
|
])
|
|
36945
37025
|
]);
|
|
@@ -37166,7 +37246,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
37166
37246
|
const _hoisted_1$h = { class: "lupa-related-query-item" };
|
|
37167
37247
|
const _hoisted_2$d = { class: "lupa-related-query-image" };
|
|
37168
37248
|
const _hoisted_3$7 = { class: "lupa-related-query-label" };
|
|
37169
|
-
const _hoisted_4$
|
|
37249
|
+
const _hoisted_4$4 = { class: "lupa-related-query-title" };
|
|
37170
37250
|
const _hoisted_5$1 = {
|
|
37171
37251
|
key: 0,
|
|
37172
37252
|
class: "lupa-related-query-count"
|
|
@@ -37214,7 +37294,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
37214
37294
|
}, null, 8, ["item", "options"])) : createCommentVNode("", true)
|
|
37215
37295
|
]),
|
|
37216
37296
|
createBaseVNode("div", _hoisted_3$7, [
|
|
37217
|
-
createBaseVNode("span", _hoisted_4$
|
|
37297
|
+
createBaseVNode("span", _hoisted_4$4, toDisplayString(query.value), 1),
|
|
37218
37298
|
((_a25 = _ctx.options) == null ? void 0 : _a25.showCount) ? (openBlock(), createElementBlock("span", _hoisted_5$1, "(" + toDisplayString(totalItemCount.value) + ")", 1)) : createCommentVNode("", true)
|
|
37219
37299
|
])
|
|
37220
37300
|
]);
|
|
@@ -37358,7 +37438,7 @@ const _hoisted_3$5 = {
|
|
|
37358
37438
|
class: "lupa-empty-results",
|
|
37359
37439
|
"data-cy": "lupa-no-results-in-page"
|
|
37360
37440
|
};
|
|
37361
|
-
const _hoisted_4$
|
|
37441
|
+
const _hoisted_4$3 = {
|
|
37362
37442
|
key: 5,
|
|
37363
37443
|
class: "lupa-empty-results",
|
|
37364
37444
|
"data-cy": "lupa-no-results"
|
|
@@ -37579,7 +37659,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
37579
37659
|
location: "bottom",
|
|
37580
37660
|
sdkOptions: _ctx.options.options
|
|
37581
37661
|
}, null, 8, ["options", "sdkOptions"])
|
|
37582
|
-
], 64)) : !unref(loading) && unref(currentQueryText) ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
37662
|
+
], 64)) : !unref(loading) && unref(currentQueryText) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
37583
37663
|
createVNode(_sfc_main$h, {
|
|
37584
37664
|
emptyResultsLabel: (_b25 = _ctx.options.labels) == null ? void 0 : _b25.emptyResults,
|
|
37585
37665
|
currentQueryText: unref(currentQueryText),
|
|
@@ -37615,7 +37695,7 @@ const _hoisted_2$9 = {
|
|
|
37615
37695
|
class: "lupa-category-back"
|
|
37616
37696
|
};
|
|
37617
37697
|
const _hoisted_3$4 = ["href"];
|
|
37618
|
-
const _hoisted_4$
|
|
37698
|
+
const _hoisted_4$2 = {
|
|
37619
37699
|
key: 1,
|
|
37620
37700
|
class: "lupa-child-category-list"
|
|
37621
37701
|
};
|
|
@@ -37675,7 +37755,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
37675
37755
|
onClick: handleNavigationBack
|
|
37676
37756
|
}, toDisplayString(backTitle.value), 9, _hoisted_3$4)
|
|
37677
37757
|
])) : createCommentVNode("", true),
|
|
37678
|
-
hasRelatedCategoryChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
37758
|
+
hasRelatedCategoryChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
37679
37759
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(relatedCategoryChildren), (child) => {
|
|
37680
37760
|
return openBlock(), createBlock(_sfc_main$Z, {
|
|
37681
37761
|
key: getCategoryKey(child),
|
|
@@ -39592,12 +39672,13 @@ const _hoisted_1$9 = {
|
|
|
39592
39672
|
key: 0,
|
|
39593
39673
|
class: "lupa-recommendation-section-title"
|
|
39594
39674
|
};
|
|
39595
|
-
const _hoisted_2$6 =
|
|
39675
|
+
const _hoisted_2$6 = ["href"];
|
|
39676
|
+
const _hoisted_3$3 = {
|
|
39596
39677
|
key: 1,
|
|
39597
39678
|
class: "lupa-recommended-products",
|
|
39598
39679
|
"data-cy": "lupa-recommended-products"
|
|
39599
39680
|
};
|
|
39600
|
-
const
|
|
39681
|
+
const _hoisted_4$1 = {
|
|
39601
39682
|
key: 1,
|
|
39602
39683
|
class: "lupa-products",
|
|
39603
39684
|
"data-cy": "lupa-products"
|
|
@@ -39641,6 +39722,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
39641
39722
|
var _a25, _b25;
|
|
39642
39723
|
return (_b25 = (_a25 = props.options.recommendationLabels) == null ? void 0 : _a25.title) != null ? _b25 : "";
|
|
39643
39724
|
});
|
|
39725
|
+
const hasTitleLink = computed(() => {
|
|
39726
|
+
var _a25;
|
|
39727
|
+
return Boolean((_a25 = props.options.recommendationLabels) == null ? void 0 : _a25.titleLink);
|
|
39728
|
+
});
|
|
39644
39729
|
const hasRecommendations = computed(() => {
|
|
39645
39730
|
return recommendations2.value.length > 0;
|
|
39646
39731
|
});
|
|
@@ -39730,6 +39815,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
39730
39815
|
var _a25, _b25;
|
|
39731
39816
|
return (_b25 = (_a25 = carouselOptions.value) == null ? void 0 : _a25.wrapAround) != null ? _b25 : true;
|
|
39732
39817
|
});
|
|
39818
|
+
const recommendationFilters = computed(() => {
|
|
39819
|
+
return __spreadValues2({}, processExtractionObject(props.options.recommendationFilters));
|
|
39820
|
+
});
|
|
39733
39821
|
const loadLupaRecommendations = () => __async2(null, null, function* () {
|
|
39734
39822
|
var _a25, _b25;
|
|
39735
39823
|
recommendationsType.value = "recommendations_lupasearch";
|
|
@@ -39738,7 +39826,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
39738
39826
|
const result2 = yield LupaSearchSdk.recommend(
|
|
39739
39827
|
props.options.queryKey,
|
|
39740
39828
|
itemId.value,
|
|
39741
|
-
|
|
39829
|
+
recommendationFilters.value,
|
|
39742
39830
|
props.options.options
|
|
39743
39831
|
);
|
|
39744
39832
|
if (!result2.success) {
|
|
@@ -39756,14 +39844,22 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
39756
39844
|
});
|
|
39757
39845
|
__expose({ fetch: fetch2 });
|
|
39758
39846
|
return (_ctx, _cache) => {
|
|
39847
|
+
var _a25;
|
|
39759
39848
|
return openBlock(), createElementBlock("div", {
|
|
39760
39849
|
class: "lupa-search-product-recommendations-wrapper",
|
|
39761
39850
|
ref_key: "rootElement",
|
|
39762
39851
|
ref: rootElement
|
|
39763
39852
|
}, [
|
|
39764
39853
|
hasRecommendations.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
39765
|
-
title.value ? (openBlock(), createElementBlock("h2", _hoisted_1$9,
|
|
39766
|
-
|
|
39854
|
+
title.value ? (openBlock(), createElementBlock("h2", _hoisted_1$9, [
|
|
39855
|
+
!hasTitleLink.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
39856
|
+
createTextVNode(toDisplayString(title.value), 1)
|
|
39857
|
+
], 64)) : (openBlock(), createElementBlock("a", {
|
|
39858
|
+
key: 1,
|
|
39859
|
+
href: (_a25 = _ctx.options.recommendationLabels) == null ? void 0 : _a25.titleLink
|
|
39860
|
+
}, toDisplayString(title.value), 9, _hoisted_2$6))
|
|
39861
|
+
])) : createCommentVNode("", true),
|
|
39862
|
+
!loading.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
39767
39863
|
layoutType.value === "carousel" ? (openBlock(), createBlock(unref(Carousel), mergeProps({ key: 0 }, carouselOptions.value, { "wrap-around": wrapAround.value }), {
|
|
39768
39864
|
addons: withCtx(() => [
|
|
39769
39865
|
createVNode(unref(Navigation))
|
|
@@ -39787,7 +39883,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
39787
39883
|
}), 128))
|
|
39788
39884
|
]),
|
|
39789
39885
|
_: 1
|
|
39790
|
-
}, 16, ["wrap-around"])) : (openBlock(), createElementBlock("div",
|
|
39886
|
+
}, 16, ["wrap-around"])) : (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
39791
39887
|
(openBlock(true), createElementBlock(Fragment, null, renderList(recommendations2.value, (product, index) => {
|
|
39792
39888
|
return openBlock(), createBlock(_sfc_main$t, {
|
|
39793
39889
|
style: normalizeStyle(columnSize.value),
|