@getlupa/vue 0.21.2 → 0.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/lupaContainerStyle.css +1 -1
- package/dist/lupaSearch.js +153 -57
- package/dist/lupaSearch.mjs +153 -57
- package/dist/stores/params.d.ts +28 -1
- package/dist/style.css +1 -1
- package/dist/types/DataExtraction.d.ts +1 -0
- package/dist/types/DocumentElement.d.ts +2 -0
- package/dist/types/recommendations/RecommendationsOptions.d.ts +2 -1
- package/dist/types/search-results/PaginationOptions.d.ts +1 -0
- package/dist/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/package.json +1 -1
package/dist/lupaSearch.js
CHANGED
|
@@ -12905,6 +12905,18 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
12905
12905
|
params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
|
|
12906
12906
|
searchString.value = url.search;
|
|
12907
12907
|
};
|
|
12908
|
+
const getPageUrlWithNewParams = ({
|
|
12909
|
+
params: newParams,
|
|
12910
|
+
paramsToRemove,
|
|
12911
|
+
encode: encode2 = true,
|
|
12912
|
+
searchResultsLink: searchResultsLink2
|
|
12913
|
+
}) => {
|
|
12914
|
+
const url = getPageUrl(searchResultsLink2);
|
|
12915
|
+
paramsToRemove = getRemovableParams(url, optionsStore.getQueryParamName, paramsToRemove);
|
|
12916
|
+
removeParams(url, paramsToRemove);
|
|
12917
|
+
newParams.forEach((p2) => appendParam(url, p2, encode2));
|
|
12918
|
+
return url.search;
|
|
12919
|
+
};
|
|
12908
12920
|
const removeParameters = ({
|
|
12909
12921
|
paramsToRemove,
|
|
12910
12922
|
save = true
|
|
@@ -13042,6 +13054,7 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
13042
13054
|
sortParams,
|
|
13043
13055
|
lastChangedParams,
|
|
13044
13056
|
skipFacetReload,
|
|
13057
|
+
getPageUrlWithNewParams,
|
|
13045
13058
|
add,
|
|
13046
13059
|
removeAllFilters,
|
|
13047
13060
|
removeParameters,
|
|
@@ -25248,7 +25261,16 @@ const extractFromHtmlElementAttribute = (options) => {
|
|
|
25248
25261
|
if (attr === "value" && (element == null ? void 0 : element.value)) {
|
|
25249
25262
|
return element.value;
|
|
25250
25263
|
}
|
|
25251
|
-
|
|
25264
|
+
const attributeValue = element.getAttribute(attr);
|
|
25265
|
+
if (attributeValue === null || attributeValue === void 0) {
|
|
25266
|
+
return options.default;
|
|
25267
|
+
}
|
|
25268
|
+
if (options.regex) {
|
|
25269
|
+
const regex = new RegExp(options.regex);
|
|
25270
|
+
const match = attributeValue.match(regex);
|
|
25271
|
+
return match ? match[1] : options.default;
|
|
25272
|
+
}
|
|
25273
|
+
return attributeValue;
|
|
25252
25274
|
};
|
|
25253
25275
|
const getValueFromPath = (obj, path) => {
|
|
25254
25276
|
return path.split(".").reduce((value, key) => value && value[key] || null, obj);
|
|
@@ -28948,8 +28970,7 @@ const _hoisted_2$u = {
|
|
|
28948
28970
|
key: 0,
|
|
28949
28971
|
class: "lupa-page-number-separator"
|
|
28950
28972
|
};
|
|
28951
|
-
const _hoisted_3$m =
|
|
28952
|
-
const _hoisted_4$e = {
|
|
28973
|
+
const _hoisted_3$m = {
|
|
28953
28974
|
key: 0,
|
|
28954
28975
|
class: "lupa-page-number-separator"
|
|
28955
28976
|
};
|
|
@@ -29016,7 +29037,24 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
|
29016
29037
|
timeout: (_f = (_e = searchResultOptions.value.scrollToResults) == null ? void 0 : _e.timeout) != null ? _f : 500
|
|
29017
29038
|
};
|
|
29018
29039
|
});
|
|
29019
|
-
const
|
|
29040
|
+
const tagName = vue.computed(() => {
|
|
29041
|
+
return props.options.renderAsLinks ? "a" : "div";
|
|
29042
|
+
});
|
|
29043
|
+
const getPageUrlWithNewParams = (page) => {
|
|
29044
|
+
return paramStore.getPageUrlWithNewParams({
|
|
29045
|
+
params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS.PAGE), value: page.toString() }]
|
|
29046
|
+
});
|
|
29047
|
+
};
|
|
29048
|
+
const getHref = (page) => {
|
|
29049
|
+
if (props.options.renderAsLinks) {
|
|
29050
|
+
return getPageUrlWithNewParams(page);
|
|
29051
|
+
}
|
|
29052
|
+
return null;
|
|
29053
|
+
};
|
|
29054
|
+
const handlePageChange = (e2, page) => {
|
|
29055
|
+
if (e2 && props.options.renderAsLinks) {
|
|
29056
|
+
e2.preventDefault();
|
|
29057
|
+
}
|
|
29020
29058
|
if (page > 0) {
|
|
29021
29059
|
paramStore.appendParams({
|
|
29022
29060
|
params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS.PAGE), value: page.toString() }]
|
|
@@ -29030,46 +29068,78 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
|
29030
29068
|
}
|
|
29031
29069
|
};
|
|
29032
29070
|
return (_ctx, _cache) => {
|
|
29071
|
+
var _a25;
|
|
29033
29072
|
return showPagination.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$D, [
|
|
29034
|
-
showBack.value ? (vue.openBlock(), vue.
|
|
29073
|
+
showBack.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
29035
29074
|
key: 0,
|
|
29036
29075
|
class: vue.normalizeClass(firstPageLabel.value === "<" ? "lupa-page-arrow" : "lupa-show-less"),
|
|
29037
|
-
|
|
29038
|
-
|
|
29076
|
+
href: getHref(_ctx.options.selectedPage - 1),
|
|
29077
|
+
onClick: _cache[0] || (_cache[0] = (e2) => handlePageChange(e2, _ctx.options.selectedPage - 1))
|
|
29078
|
+
}, {
|
|
29079
|
+
default: vue.withCtx(() => [
|
|
29080
|
+
vue.createTextVNode(vue.toDisplayString(firstPageLabel.value), 1)
|
|
29081
|
+
]),
|
|
29082
|
+
_: 1
|
|
29083
|
+
}, 8, ["class", "href"])) : vue.createCommentVNode("", true),
|
|
29039
29084
|
showFirstPage.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
29040
|
-
vue.
|
|
29085
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
29086
|
+
href: getHref(1),
|
|
29041
29087
|
class: "lupa-page-number lupa-page-number-first",
|
|
29042
|
-
onClick: _cache[1] || (_cache[1] = () => handlePageChange(1))
|
|
29043
|
-
},
|
|
29088
|
+
onClick: _cache[1] || (_cache[1] = (e2) => handlePageChange(e2, 1))
|
|
29089
|
+
}, {
|
|
29090
|
+
default: vue.withCtx(() => _cache[4] || (_cache[4] = [
|
|
29091
|
+
vue.createTextVNode(" 1 ")
|
|
29092
|
+
])),
|
|
29093
|
+
_: 1,
|
|
29094
|
+
__: [4]
|
|
29095
|
+
}, 8, ["href"])),
|
|
29044
29096
|
showFirstPageSeparator.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$u, "...")) : vue.createCommentVNode("", true)
|
|
29045
29097
|
], 64)) : vue.createCommentVNode("", true),
|
|
29046
29098
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(pages.value, (page) => {
|
|
29047
|
-
return vue.openBlock(), vue.
|
|
29099
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
29048
29100
|
key: page,
|
|
29049
|
-
|
|
29101
|
+
href: getHref(page),
|
|
29102
|
+
onClick: (e2) => handlePageChange(e2, page),
|
|
29050
29103
|
class: vue.normalizeClass([
|
|
29051
29104
|
"lupa-page-number",
|
|
29052
29105
|
page === _ctx.options.selectedPage ? "lupa-page-number-selected" : ""
|
|
29053
29106
|
]),
|
|
29054
29107
|
"data-cy": "lupa-page-number"
|
|
29055
|
-
},
|
|
29108
|
+
}, {
|
|
29109
|
+
default: vue.withCtx(() => [
|
|
29110
|
+
vue.createTextVNode(vue.toDisplayString(page), 1)
|
|
29111
|
+
]),
|
|
29112
|
+
_: 2
|
|
29113
|
+
}, 1032, ["href", "onClick", "class"]);
|
|
29056
29114
|
}), 128)),
|
|
29057
29115
|
showLastPage.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
29058
|
-
showLastPageSeparator.value ? (vue.openBlock(), vue.createElementBlock("div",
|
|
29059
|
-
vue.
|
|
29116
|
+
showLastPageSeparator.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$m, "...")) : vue.createCommentVNode("", true),
|
|
29117
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
29118
|
+
href: getHref((_a25 = lastPage.value) != null ? _a25 : 1),
|
|
29060
29119
|
class: "lupa-page-number lupa-page-number-last",
|
|
29061
|
-
onClick: _cache[2] || (_cache[2] = () => {
|
|
29062
|
-
var
|
|
29063
|
-
return handlePageChange((
|
|
29120
|
+
onClick: _cache[2] || (_cache[2] = (e2) => {
|
|
29121
|
+
var _a26;
|
|
29122
|
+
return handlePageChange(e2, (_a26 = lastPage.value) != null ? _a26 : 1);
|
|
29064
29123
|
})
|
|
29065
|
-
},
|
|
29124
|
+
}, {
|
|
29125
|
+
default: vue.withCtx(() => [
|
|
29126
|
+
vue.createTextVNode(vue.toDisplayString(lastPage.value), 1)
|
|
29127
|
+
]),
|
|
29128
|
+
_: 1
|
|
29129
|
+
}, 8, ["href"]))
|
|
29066
29130
|
], 64)) : vue.createCommentVNode("", true),
|
|
29067
|
-
_ctx.options.selectedPage < _ctx.options.count ? (vue.openBlock(), vue.
|
|
29131
|
+
_ctx.options.selectedPage < _ctx.options.count ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
29068
29132
|
key: 3,
|
|
29069
29133
|
class: vue.normalizeClass(lastPageLabel.value === ">" ? "lupa-page-arrow" : "lupa-show-more"),
|
|
29134
|
+
href: getHref(_ctx.options.selectedPage + 1),
|
|
29070
29135
|
"data-cy": "lupa-show-more",
|
|
29071
|
-
onClick: _cache[3] || (_cache[3] = () => handlePageChange(_ctx.options.selectedPage + 1))
|
|
29072
|
-
},
|
|
29136
|
+
onClick: _cache[3] || (_cache[3] = (e2) => handlePageChange(e2, _ctx.options.selectedPage + 1))
|
|
29137
|
+
}, {
|
|
29138
|
+
default: vue.withCtx(() => [
|
|
29139
|
+
vue.createTextVNode(vue.toDisplayString(lastPageLabel.value), 1)
|
|
29140
|
+
]),
|
|
29141
|
+
_: 1
|
|
29142
|
+
}, 8, ["class", "href"])) : vue.createCommentVNode("", true)
|
|
29073
29143
|
])) : vue.createCommentVNode("", true);
|
|
29074
29144
|
};
|
|
29075
29145
|
}
|
|
@@ -29083,7 +29153,7 @@ const _hoisted_3$l = {
|
|
|
29083
29153
|
class: "lupa-select-label",
|
|
29084
29154
|
for: "lupa-page-size-select-dropdown"
|
|
29085
29155
|
};
|
|
29086
|
-
const _hoisted_4$
|
|
29156
|
+
const _hoisted_4$e = ["aria-label"];
|
|
29087
29157
|
const _hoisted_5$a = ["value"];
|
|
29088
29158
|
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
29089
29159
|
__name: "SearchResultsPageSize",
|
|
@@ -29133,7 +29203,7 @@ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
|
29133
29203
|
value: option
|
|
29134
29204
|
}, vue.toDisplayString(prefixLabel.value) + vue.toDisplayString(option), 9, _hoisted_5$a);
|
|
29135
29205
|
}), 128))
|
|
29136
|
-
], 40, _hoisted_4$
|
|
29206
|
+
], 40, _hoisted_4$e)
|
|
29137
29207
|
])
|
|
29138
29208
|
]);
|
|
29139
29209
|
};
|
|
@@ -29148,7 +29218,7 @@ const _hoisted_3$k = {
|
|
|
29148
29218
|
class: "lupa-select-label",
|
|
29149
29219
|
for: "lupa-sort-select-dropdown"
|
|
29150
29220
|
};
|
|
29151
|
-
const _hoisted_4$
|
|
29221
|
+
const _hoisted_4$d = ["aria-label"];
|
|
29152
29222
|
const _hoisted_5$9 = ["value"];
|
|
29153
29223
|
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
29154
29224
|
__name: "SearchResultsSort",
|
|
@@ -29219,7 +29289,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
|
29219
29289
|
value: option.key
|
|
29220
29290
|
}, vue.toDisplayString(option.label), 9, _hoisted_5$9);
|
|
29221
29291
|
}), 128))
|
|
29222
|
-
], 40, _hoisted_4$
|
|
29292
|
+
], 40, _hoisted_4$d), [
|
|
29223
29293
|
[vue.vModelSelect, selectedKey.value]
|
|
29224
29294
|
])
|
|
29225
29295
|
])
|
|
@@ -29233,7 +29303,7 @@ const _hoisted_2$r = {
|
|
|
29233
29303
|
class: "lupa-toolbar-right-title"
|
|
29234
29304
|
};
|
|
29235
29305
|
const _hoisted_3$j = { key: 2 };
|
|
29236
|
-
const _hoisted_4$
|
|
29306
|
+
const _hoisted_4$c = { key: 4 };
|
|
29237
29307
|
const _hoisted_5$8 = { key: 6 };
|
|
29238
29308
|
const _hoisted_6$4 = { class: "lupa-toolbar-right" };
|
|
29239
29309
|
const _hoisted_7$2 = {
|
|
@@ -29303,6 +29373,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
29303
29373
|
}
|
|
29304
29374
|
});
|
|
29305
29375
|
const paginationOptions = vue.computed(() => {
|
|
29376
|
+
var _a25;
|
|
29306
29377
|
const pageSelect = optionsValue.value.pagination.pageSelection;
|
|
29307
29378
|
return {
|
|
29308
29379
|
pageSize: {
|
|
@@ -29313,7 +29384,8 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
29313
29384
|
count: getPageCount(searchResult.value.total, limit.value),
|
|
29314
29385
|
selectedPage: page.value,
|
|
29315
29386
|
display: pageSelect.display,
|
|
29316
|
-
displayMobile: pageSelect.displayMobile
|
|
29387
|
+
displayMobile: pageSelect.displayMobile,
|
|
29388
|
+
renderAsLinks: (_a25 = pageSelect.renderAsLinks) != null ? _a25 : false
|
|
29317
29389
|
},
|
|
29318
29390
|
labels: optionsValue.value.labels
|
|
29319
29391
|
};
|
|
@@ -29361,7 +29433,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
|
29361
29433
|
label: searchSummaryLabel.value,
|
|
29362
29434
|
clearable: vue.unref(hasAnyFilter) && showFilterClear.value,
|
|
29363
29435
|
onClear: handleClearAll
|
|
29364
|
-
}, null, 8, ["label", "clearable"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$
|
|
29436
|
+
}, null, 8, ["label", "clearable"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$c)),
|
|
29365
29437
|
displayPageSelect.value ? (vue.openBlock(), vue.createBlock(_sfc_main$I, {
|
|
29366
29438
|
key: 5,
|
|
29367
29439
|
options: paginationOptions.value.pageSelect,
|
|
@@ -29414,7 +29486,7 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
|
29414
29486
|
const _hoisted_1$z = ["title", "innerHTML"];
|
|
29415
29487
|
const _hoisted_2$q = ["title"];
|
|
29416
29488
|
const _hoisted_3$i = ["href", "innerHTML"];
|
|
29417
|
-
const _hoisted_4$
|
|
29489
|
+
const _hoisted_4$b = ["title"];
|
|
29418
29490
|
const _hoisted_5$7 = {
|
|
29419
29491
|
key: 0,
|
|
29420
29492
|
class: "lupa-search-results-product-title-text"
|
|
@@ -29482,7 +29554,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
|
29482
29554
|
class: "lupa-search-results-product-title-text lupa-title-link",
|
|
29483
29555
|
onClick: handleNavigation
|
|
29484
29556
|
}, vue.toDisplayString(title.value), 9, _hoisted_6$3)) : vue.createCommentVNode("", true)
|
|
29485
|
-
], 12, _hoisted_4$
|
|
29557
|
+
], 12, _hoisted_4$b));
|
|
29486
29558
|
};
|
|
29487
29559
|
}
|
|
29488
29560
|
});
|
|
@@ -29525,7 +29597,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
29525
29597
|
const _hoisted_1$x = { id: "lupa-search-results-rating" };
|
|
29526
29598
|
const _hoisted_2$p = { class: "lupa-ratings" };
|
|
29527
29599
|
const _hoisted_3$h = { class: "lupa-ratings-base" };
|
|
29528
|
-
const _hoisted_4$
|
|
29600
|
+
const _hoisted_4$a = ["innerHTML"];
|
|
29529
29601
|
const _hoisted_5$6 = { class: "lupa-rating-wrapper" };
|
|
29530
29602
|
const _hoisted_6$2 = ["innerHTML"];
|
|
29531
29603
|
const _hoisted_7$1 = ["href"];
|
|
@@ -29575,7 +29647,7 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
|
29575
29647
|
key: index,
|
|
29576
29648
|
innerHTML: star,
|
|
29577
29649
|
class: "lupa-rating lupa-rating-not-highlighted"
|
|
29578
|
-
}, null, 8, _hoisted_4$
|
|
29650
|
+
}, null, 8, _hoisted_4$a);
|
|
29579
29651
|
}), 128))
|
|
29580
29652
|
]),
|
|
29581
29653
|
vue.createElementVNode("div", _hoisted_5$6, [
|
|
@@ -29668,7 +29740,7 @@ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
|
29668
29740
|
const _hoisted_1$v = { class: "lupa-search-results-add-to-cart-wrapper" };
|
|
29669
29741
|
const _hoisted_2$o = { class: "lupa-search-results-product-addtocart" };
|
|
29670
29742
|
const _hoisted_3$g = ["disabled"];
|
|
29671
|
-
const _hoisted_4$
|
|
29743
|
+
const _hoisted_4$9 = ["href"];
|
|
29672
29744
|
const _hoisted_5$5 = ["id", "disabled"];
|
|
29673
29745
|
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
29674
29746
|
__name: "SearchResultsProductAddToCart",
|
|
@@ -29737,7 +29809,7 @@ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
|
29737
29809
|
"data-cy": "lupa-add-to-cart",
|
|
29738
29810
|
disabled: !inStockValue.value || loading.value
|
|
29739
29811
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
29740
|
-
vue.createElementVNode("a", { href: _ctx.link }, vue.toDisplayString(label.value), 9, _hoisted_4$
|
|
29812
|
+
vue.createElementVNode("a", { href: _ctx.link }, vue.toDisplayString(label.value), 9, _hoisted_4$9)
|
|
29741
29813
|
], 16, _hoisted_3$g)) : (vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
|
|
29742
29814
|
key: 1,
|
|
29743
29815
|
id: id.value,
|
|
@@ -29755,7 +29827,7 @@ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
|
29755
29827
|
const _hoisted_1$u = ["innerHTML"];
|
|
29756
29828
|
const _hoisted_2$n = { key: 0 };
|
|
29757
29829
|
const _hoisted_3$f = { key: 1 };
|
|
29758
|
-
const _hoisted_4$
|
|
29830
|
+
const _hoisted_4$8 = { class: "lupa-search-box-custom-label" };
|
|
29759
29831
|
const _hoisted_5$4 = { class: "lupa-search-box-custom-text" };
|
|
29760
29832
|
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
29761
29833
|
__name: "SearchResultsProductCustom",
|
|
@@ -29784,7 +29856,11 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
29784
29856
|
var _a25;
|
|
29785
29857
|
return (_a25 = props.options.isHtml) != null ? _a25 : false;
|
|
29786
29858
|
});
|
|
29787
|
-
const handleClick = () => __async(null, null, function* () {
|
|
29859
|
+
const handleClick = (e2) => __async(null, null, function* () {
|
|
29860
|
+
if (e2 && props.options.stopPropagationOnClick) {
|
|
29861
|
+
e2.stopPropagation();
|
|
29862
|
+
e2.preventDefault();
|
|
29863
|
+
}
|
|
29788
29864
|
if (!props.options.action) {
|
|
29789
29865
|
return;
|
|
29790
29866
|
}
|
|
@@ -29800,7 +29876,7 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
29800
29876
|
class: className.value
|
|
29801
29877
|
}, vue.toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
29802
29878
|
!label.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$n, vue.toDisplayString(text.value), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$f, [
|
|
29803
|
-
vue.createElementVNode("div", _hoisted_4$
|
|
29879
|
+
vue.createElementVNode("div", _hoisted_4$8, vue.toDisplayString(label.value), 1),
|
|
29804
29880
|
vue.createElementVNode("div", _hoisted_5$4, vue.toDisplayString(text.value), 1)
|
|
29805
29881
|
]))
|
|
29806
29882
|
], 16));
|
|
@@ -29827,7 +29903,11 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
29827
29903
|
const className = vue.computed(() => {
|
|
29828
29904
|
return props.options.className;
|
|
29829
29905
|
});
|
|
29830
|
-
const handleClick = () => __async(null, null, function* () {
|
|
29906
|
+
const handleClick = (e2) => __async(null, null, function* () {
|
|
29907
|
+
if (e2 && props.options.stopPropagationOnClick) {
|
|
29908
|
+
e2.stopPropagation();
|
|
29909
|
+
e2.preventDefault();
|
|
29910
|
+
}
|
|
29831
29911
|
if (!props.options.action) {
|
|
29832
29912
|
return;
|
|
29833
29913
|
}
|
|
@@ -29847,7 +29927,7 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
29847
29927
|
const _hoisted_1$s = { id: "lupa-search-results-rating" };
|
|
29848
29928
|
const _hoisted_2$m = ["innerHTML"];
|
|
29849
29929
|
const _hoisted_3$e = { class: "lupa-ratings" };
|
|
29850
|
-
const _hoisted_4$
|
|
29930
|
+
const _hoisted_4$7 = ["href"];
|
|
29851
29931
|
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
29852
29932
|
__name: "SearchResultsProductSingleStarRating",
|
|
29853
29933
|
props: {
|
|
@@ -29885,7 +29965,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
|
29885
29965
|
vue.createElementVNode("a", {
|
|
29886
29966
|
href: ratingLink.value,
|
|
29887
29967
|
class: "lupa-total-ratings"
|
|
29888
|
-
}, vue.toDisplayString(totalRatings.value), 9, _hoisted_4$
|
|
29968
|
+
}, vue.toDisplayString(totalRatings.value), 9, _hoisted_4$7)
|
|
29889
29969
|
]);
|
|
29890
29970
|
};
|
|
29891
29971
|
}
|
|
@@ -30242,7 +30322,7 @@ const _hoisted_3$c = {
|
|
|
30242
30322
|
class: "lupa-similar-query-label",
|
|
30243
30323
|
"data-cy": "lupa-similar-query-label"
|
|
30244
30324
|
};
|
|
30245
|
-
const _hoisted_4$
|
|
30325
|
+
const _hoisted_4$6 = ["onClick"];
|
|
30246
30326
|
const _hoisted_5$3 = ["innerHTML"];
|
|
30247
30327
|
const _hoisted_6$1 = { key: 0 };
|
|
30248
30328
|
const _hoisted_7 = {
|
|
@@ -30303,7 +30383,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
30303
30383
|
innerHTML: getSimilarQueryContent(similarQuery.displayQuery)
|
|
30304
30384
|
}, null, 8, _hoisted_5$3),
|
|
30305
30385
|
similarQuery.count ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$1, " (" + vue.toDisplayString(similarQuery.count) + ")", 1)) : vue.createCommentVNode("", true)
|
|
30306
|
-
], 8, _hoisted_4$
|
|
30386
|
+
], 8, _hoisted_4$6)
|
|
30307
30387
|
]),
|
|
30308
30388
|
vue.createElementVNode("div", _hoisted_7, [
|
|
30309
30389
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(similarQuery.items, (product, index2) => {
|
|
@@ -30635,7 +30715,7 @@ const extractRelatedSource = (source, searchResults, options, activeFilters) =>
|
|
|
30635
30715
|
const _hoisted_1$l = { class: "lupa-related-query-item" };
|
|
30636
30716
|
const _hoisted_2$g = { class: "lupa-related-query-image" };
|
|
30637
30717
|
const _hoisted_3$a = { class: "lupa-related-query-label" };
|
|
30638
|
-
const _hoisted_4$
|
|
30718
|
+
const _hoisted_4$5 = { class: "lupa-related-query-title" };
|
|
30639
30719
|
const _hoisted_5$2 = {
|
|
30640
30720
|
key: 0,
|
|
30641
30721
|
class: "lupa-related-query-count"
|
|
@@ -30747,7 +30827,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
30747
30827
|
}, null, 8, ["item", "options"])) : vue.createCommentVNode("", true)
|
|
30748
30828
|
]),
|
|
30749
30829
|
vue.createElementVNode("div", _hoisted_3$a, [
|
|
30750
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
30830
|
+
vue.createElementVNode("span", _hoisted_4$5, vue.toDisplayString(_ctx.query), 1),
|
|
30751
30831
|
((_a25 = _ctx.options) == null ? void 0 : _a25.showCount) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$2, "(" + vue.toDisplayString(totalItemCount.value) + ")", 1)) : vue.createCommentVNode("", true)
|
|
30752
30832
|
])
|
|
30753
30833
|
]);
|
|
@@ -30974,7 +31054,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
30974
31054
|
const _hoisted_1$h = { class: "lupa-related-query-item" };
|
|
30975
31055
|
const _hoisted_2$d = { class: "lupa-related-query-image" };
|
|
30976
31056
|
const _hoisted_3$7 = { class: "lupa-related-query-label" };
|
|
30977
|
-
const _hoisted_4$
|
|
31057
|
+
const _hoisted_4$4 = { class: "lupa-related-query-title" };
|
|
30978
31058
|
const _hoisted_5$1 = {
|
|
30979
31059
|
key: 0,
|
|
30980
31060
|
class: "lupa-related-query-count"
|
|
@@ -31022,7 +31102,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
|
31022
31102
|
}, null, 8, ["item", "options"])) : vue.createCommentVNode("", true)
|
|
31023
31103
|
]),
|
|
31024
31104
|
vue.createElementVNode("div", _hoisted_3$7, [
|
|
31025
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
31105
|
+
vue.createElementVNode("span", _hoisted_4$4, vue.toDisplayString(query.value), 1),
|
|
31026
31106
|
((_a25 = _ctx.options) == null ? void 0 : _a25.showCount) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$1, "(" + vue.toDisplayString(totalItemCount.value) + ")", 1)) : vue.createCommentVNode("", true)
|
|
31027
31107
|
])
|
|
31028
31108
|
]);
|
|
@@ -31166,7 +31246,7 @@ const _hoisted_3$5 = {
|
|
|
31166
31246
|
class: "lupa-empty-results",
|
|
31167
31247
|
"data-cy": "lupa-no-results-in-page"
|
|
31168
31248
|
};
|
|
31169
|
-
const _hoisted_4$
|
|
31249
|
+
const _hoisted_4$3 = {
|
|
31170
31250
|
key: 5,
|
|
31171
31251
|
class: "lupa-empty-results",
|
|
31172
31252
|
"data-cy": "lupa-no-results"
|
|
@@ -31387,7 +31467,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
31387
31467
|
location: "bottom",
|
|
31388
31468
|
sdkOptions: _ctx.options.options
|
|
31389
31469
|
}, null, 8, ["options", "sdkOptions"])
|
|
31390
|
-
], 64)) : !vue.unref(loading) && vue.unref(currentQueryText) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$
|
|
31470
|
+
], 64)) : !vue.unref(loading) && vue.unref(currentQueryText) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
|
|
31391
31471
|
vue.createVNode(_sfc_main$h, {
|
|
31392
31472
|
emptyResultsLabel: (_b25 = _ctx.options.labels) == null ? void 0 : _b25.emptyResults,
|
|
31393
31473
|
currentQueryText: vue.unref(currentQueryText),
|
|
@@ -31423,7 +31503,7 @@ const _hoisted_2$9 = {
|
|
|
31423
31503
|
class: "lupa-category-back"
|
|
31424
31504
|
};
|
|
31425
31505
|
const _hoisted_3$4 = ["href"];
|
|
31426
|
-
const _hoisted_4$
|
|
31506
|
+
const _hoisted_4$2 = {
|
|
31427
31507
|
key: 1,
|
|
31428
31508
|
class: "lupa-child-category-list"
|
|
31429
31509
|
};
|
|
@@ -31483,7 +31563,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
31483
31563
|
onClick: handleNavigationBack
|
|
31484
31564
|
}, vue.toDisplayString(backTitle.value), 9, _hoisted_3$4)
|
|
31485
31565
|
])) : vue.createCommentVNode("", true),
|
|
31486
|
-
hasRelatedCategoryChildren.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$
|
|
31566
|
+
hasRelatedCategoryChildren.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [
|
|
31487
31567
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(relatedCategoryChildren), (child) => {
|
|
31488
31568
|
return vue.openBlock(), vue.createBlock(_sfc_main$Z, {
|
|
31489
31569
|
key: getCategoryKey(child),
|
|
@@ -33467,12 +33547,13 @@ const _hoisted_1$9 = {
|
|
|
33467
33547
|
key: 0,
|
|
33468
33548
|
class: "lupa-recommendation-section-title"
|
|
33469
33549
|
};
|
|
33470
|
-
const _hoisted_2$6 =
|
|
33550
|
+
const _hoisted_2$6 = ["href"];
|
|
33551
|
+
const _hoisted_3$3 = {
|
|
33471
33552
|
key: 1,
|
|
33472
33553
|
class: "lupa-recommended-products",
|
|
33473
33554
|
"data-cy": "lupa-recommended-products"
|
|
33474
33555
|
};
|
|
33475
|
-
const
|
|
33556
|
+
const _hoisted_4$1 = {
|
|
33476
33557
|
key: 1,
|
|
33477
33558
|
class: "lupa-products",
|
|
33478
33559
|
"data-cy": "lupa-products"
|
|
@@ -33516,6 +33597,10 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
33516
33597
|
var _a25, _b25;
|
|
33517
33598
|
return (_b25 = (_a25 = props.options.recommendationLabels) == null ? void 0 : _a25.title) != null ? _b25 : "";
|
|
33518
33599
|
});
|
|
33600
|
+
const hasTitleLink = vue.computed(() => {
|
|
33601
|
+
var _a25;
|
|
33602
|
+
return Boolean((_a25 = props.options.recommendationLabels) == null ? void 0 : _a25.titleLink);
|
|
33603
|
+
});
|
|
33519
33604
|
const hasRecommendations = vue.computed(() => {
|
|
33520
33605
|
return recommendations.value.length > 0;
|
|
33521
33606
|
});
|
|
@@ -33605,6 +33690,9 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
33605
33690
|
var _a25, _b25;
|
|
33606
33691
|
return (_b25 = (_a25 = carouselOptions.value) == null ? void 0 : _a25.wrapAround) != null ? _b25 : true;
|
|
33607
33692
|
});
|
|
33693
|
+
const recommendationFilters = vue.computed(() => {
|
|
33694
|
+
return __spreadValues({}, processExtractionObject(props.options.recommendationFilters));
|
|
33695
|
+
});
|
|
33608
33696
|
const loadLupaRecommendations = () => __async(null, null, function* () {
|
|
33609
33697
|
var _a25, _b25;
|
|
33610
33698
|
recommendationsType.value = "recommendations_lupasearch";
|
|
@@ -33613,7 +33701,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
33613
33701
|
const result2 = yield LupaSearchSdk.recommend(
|
|
33614
33702
|
props.options.queryKey,
|
|
33615
33703
|
itemId.value,
|
|
33616
|
-
|
|
33704
|
+
recommendationFilters.value,
|
|
33617
33705
|
props.options.options
|
|
33618
33706
|
);
|
|
33619
33707
|
if (!result2.success) {
|
|
@@ -33631,14 +33719,22 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
33631
33719
|
});
|
|
33632
33720
|
__expose({ fetch: fetch2 });
|
|
33633
33721
|
return (_ctx, _cache) => {
|
|
33722
|
+
var _a25;
|
|
33634
33723
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
33635
33724
|
class: "lupa-search-product-recommendations-wrapper",
|
|
33636
33725
|
ref_key: "rootElement",
|
|
33637
33726
|
ref: rootElement
|
|
33638
33727
|
}, [
|
|
33639
33728
|
hasRecommendations.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
33640
|
-
title.value ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_1$9,
|
|
33641
|
-
|
|
33729
|
+
title.value ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_1$9, [
|
|
33730
|
+
!hasTitleLink.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
33731
|
+
vue.createTextVNode(vue.toDisplayString(title.value), 1)
|
|
33732
|
+
], 64)) : (vue.openBlock(), vue.createElementBlock("a", {
|
|
33733
|
+
key: 1,
|
|
33734
|
+
href: (_a25 = _ctx.options.recommendationLabels) == null ? void 0 : _a25.titleLink
|
|
33735
|
+
}, vue.toDisplayString(title.value), 9, _hoisted_2$6))
|
|
33736
|
+
])) : vue.createCommentVNode("", true),
|
|
33737
|
+
!loading.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
|
|
33642
33738
|
layoutType.value === "carousel" ? (vue.openBlock(), vue.createBlock(vue.unref(Carousel), vue.mergeProps({ key: 0 }, carouselOptions.value, { "wrap-around": wrapAround.value }), {
|
|
33643
33739
|
addons: vue.withCtx(() => [
|
|
33644
33740
|
vue.createVNode(vue.unref(Navigation))
|
|
@@ -33662,7 +33758,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
33662
33758
|
}), 128))
|
|
33663
33759
|
]),
|
|
33664
33760
|
_: 1
|
|
33665
|
-
}, 16, ["wrap-around"])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
33761
|
+
}, 16, ["wrap-around"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
|
|
33666
33762
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(recommendations.value, (product, index) => {
|
|
33667
33763
|
return vue.openBlock(), vue.createBlock(_sfc_main$t, {
|
|
33668
33764
|
style: vue.normalizeStyle(columnSize.value),
|