@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.mjs
CHANGED
|
@@ -12903,6 +12903,18 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
12903
12903
|
params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
|
|
12904
12904
|
searchString.value = url.search;
|
|
12905
12905
|
};
|
|
12906
|
+
const getPageUrlWithNewParams = ({
|
|
12907
|
+
params: newParams,
|
|
12908
|
+
paramsToRemove,
|
|
12909
|
+
encode: encode2 = true,
|
|
12910
|
+
searchResultsLink: searchResultsLink2
|
|
12911
|
+
}) => {
|
|
12912
|
+
const url = getPageUrl(searchResultsLink2);
|
|
12913
|
+
paramsToRemove = getRemovableParams(url, optionsStore.getQueryParamName, paramsToRemove);
|
|
12914
|
+
removeParams(url, paramsToRemove);
|
|
12915
|
+
newParams.forEach((p2) => appendParam(url, p2, encode2));
|
|
12916
|
+
return url.search;
|
|
12917
|
+
};
|
|
12906
12918
|
const removeParameters = ({
|
|
12907
12919
|
paramsToRemove,
|
|
12908
12920
|
save = true
|
|
@@ -13040,6 +13052,7 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
13040
13052
|
sortParams,
|
|
13041
13053
|
lastChangedParams,
|
|
13042
13054
|
skipFacetReload,
|
|
13055
|
+
getPageUrlWithNewParams,
|
|
13043
13056
|
add,
|
|
13044
13057
|
removeAllFilters,
|
|
13045
13058
|
removeParameters,
|
|
@@ -25246,7 +25259,16 @@ const extractFromHtmlElementAttribute = (options) => {
|
|
|
25246
25259
|
if (attr === "value" && (element == null ? void 0 : element.value)) {
|
|
25247
25260
|
return element.value;
|
|
25248
25261
|
}
|
|
25249
|
-
|
|
25262
|
+
const attributeValue = element.getAttribute(attr);
|
|
25263
|
+
if (attributeValue === null || attributeValue === void 0) {
|
|
25264
|
+
return options.default;
|
|
25265
|
+
}
|
|
25266
|
+
if (options.regex) {
|
|
25267
|
+
const regex = new RegExp(options.regex);
|
|
25268
|
+
const match = attributeValue.match(regex);
|
|
25269
|
+
return match ? match[1] : options.default;
|
|
25270
|
+
}
|
|
25271
|
+
return attributeValue;
|
|
25250
25272
|
};
|
|
25251
25273
|
const getValueFromPath = (obj, path) => {
|
|
25252
25274
|
return path.split(".").reduce((value, key) => value && value[key] || null, obj);
|
|
@@ -28946,8 +28968,7 @@ const _hoisted_2$u = {
|
|
|
28946
28968
|
key: 0,
|
|
28947
28969
|
class: "lupa-page-number-separator"
|
|
28948
28970
|
};
|
|
28949
|
-
const _hoisted_3$m =
|
|
28950
|
-
const _hoisted_4$e = {
|
|
28971
|
+
const _hoisted_3$m = {
|
|
28951
28972
|
key: 0,
|
|
28952
28973
|
class: "lupa-page-number-separator"
|
|
28953
28974
|
};
|
|
@@ -29014,7 +29035,24 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
29014
29035
|
timeout: (_f = (_e = searchResultOptions.value.scrollToResults) == null ? void 0 : _e.timeout) != null ? _f : 500
|
|
29015
29036
|
};
|
|
29016
29037
|
});
|
|
29017
|
-
const
|
|
29038
|
+
const tagName = computed(() => {
|
|
29039
|
+
return props.options.renderAsLinks ? "a" : "div";
|
|
29040
|
+
});
|
|
29041
|
+
const getPageUrlWithNewParams = (page) => {
|
|
29042
|
+
return paramStore.getPageUrlWithNewParams({
|
|
29043
|
+
params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS.PAGE), value: page.toString() }]
|
|
29044
|
+
});
|
|
29045
|
+
};
|
|
29046
|
+
const getHref = (page) => {
|
|
29047
|
+
if (props.options.renderAsLinks) {
|
|
29048
|
+
return getPageUrlWithNewParams(page);
|
|
29049
|
+
}
|
|
29050
|
+
return null;
|
|
29051
|
+
};
|
|
29052
|
+
const handlePageChange = (e2, page) => {
|
|
29053
|
+
if (e2 && props.options.renderAsLinks) {
|
|
29054
|
+
e2.preventDefault();
|
|
29055
|
+
}
|
|
29018
29056
|
if (page > 0) {
|
|
29019
29057
|
paramStore.appendParams({
|
|
29020
29058
|
params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS.PAGE), value: page.toString() }]
|
|
@@ -29028,46 +29066,78 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
29028
29066
|
}
|
|
29029
29067
|
};
|
|
29030
29068
|
return (_ctx, _cache) => {
|
|
29069
|
+
var _a25;
|
|
29031
29070
|
return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$D, [
|
|
29032
|
-
showBack.value ? (openBlock(),
|
|
29071
|
+
showBack.value ? (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
29033
29072
|
key: 0,
|
|
29034
29073
|
class: normalizeClass(firstPageLabel.value === "<" ? "lupa-page-arrow" : "lupa-show-less"),
|
|
29035
|
-
|
|
29036
|
-
|
|
29074
|
+
href: getHref(_ctx.options.selectedPage - 1),
|
|
29075
|
+
onClick: _cache[0] || (_cache[0] = (e2) => handlePageChange(e2, _ctx.options.selectedPage - 1))
|
|
29076
|
+
}, {
|
|
29077
|
+
default: withCtx(() => [
|
|
29078
|
+
createTextVNode(toDisplayString(firstPageLabel.value), 1)
|
|
29079
|
+
]),
|
|
29080
|
+
_: 1
|
|
29081
|
+
}, 8, ["class", "href"])) : createCommentVNode("", true),
|
|
29037
29082
|
showFirstPage.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
29038
|
-
|
|
29083
|
+
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
29084
|
+
href: getHref(1),
|
|
29039
29085
|
class: "lupa-page-number lupa-page-number-first",
|
|
29040
|
-
onClick: _cache[1] || (_cache[1] = () => handlePageChange(1))
|
|
29041
|
-
},
|
|
29086
|
+
onClick: _cache[1] || (_cache[1] = (e2) => handlePageChange(e2, 1))
|
|
29087
|
+
}, {
|
|
29088
|
+
default: withCtx(() => _cache[4] || (_cache[4] = [
|
|
29089
|
+
createTextVNode(" 1 ")
|
|
29090
|
+
])),
|
|
29091
|
+
_: 1,
|
|
29092
|
+
__: [4]
|
|
29093
|
+
}, 8, ["href"])),
|
|
29042
29094
|
showFirstPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_2$u, "...")) : createCommentVNode("", true)
|
|
29043
29095
|
], 64)) : createCommentVNode("", true),
|
|
29044
29096
|
(openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (page) => {
|
|
29045
|
-
return openBlock(),
|
|
29097
|
+
return openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
29046
29098
|
key: page,
|
|
29047
|
-
|
|
29099
|
+
href: getHref(page),
|
|
29100
|
+
onClick: (e2) => handlePageChange(e2, page),
|
|
29048
29101
|
class: normalizeClass([
|
|
29049
29102
|
"lupa-page-number",
|
|
29050
29103
|
page === _ctx.options.selectedPage ? "lupa-page-number-selected" : ""
|
|
29051
29104
|
]),
|
|
29052
29105
|
"data-cy": "lupa-page-number"
|
|
29053
|
-
},
|
|
29106
|
+
}, {
|
|
29107
|
+
default: withCtx(() => [
|
|
29108
|
+
createTextVNode(toDisplayString(page), 1)
|
|
29109
|
+
]),
|
|
29110
|
+
_: 2
|
|
29111
|
+
}, 1032, ["href", "onClick", "class"]);
|
|
29054
29112
|
}), 128)),
|
|
29055
29113
|
showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
29056
|
-
showLastPageSeparator.value ? (openBlock(), createElementBlock("div",
|
|
29057
|
-
|
|
29114
|
+
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_3$m, "...")) : createCommentVNode("", true),
|
|
29115
|
+
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
29116
|
+
href: getHref((_a25 = lastPage.value) != null ? _a25 : 1),
|
|
29058
29117
|
class: "lupa-page-number lupa-page-number-last",
|
|
29059
|
-
onClick: _cache[2] || (_cache[2] = () => {
|
|
29060
|
-
var
|
|
29061
|
-
return handlePageChange((
|
|
29118
|
+
onClick: _cache[2] || (_cache[2] = (e2) => {
|
|
29119
|
+
var _a26;
|
|
29120
|
+
return handlePageChange(e2, (_a26 = lastPage.value) != null ? _a26 : 1);
|
|
29062
29121
|
})
|
|
29063
|
-
},
|
|
29122
|
+
}, {
|
|
29123
|
+
default: withCtx(() => [
|
|
29124
|
+
createTextVNode(toDisplayString(lastPage.value), 1)
|
|
29125
|
+
]),
|
|
29126
|
+
_: 1
|
|
29127
|
+
}, 8, ["href"]))
|
|
29064
29128
|
], 64)) : createCommentVNode("", true),
|
|
29065
|
-
_ctx.options.selectedPage < _ctx.options.count ? (openBlock(),
|
|
29129
|
+
_ctx.options.selectedPage < _ctx.options.count ? (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
29066
29130
|
key: 3,
|
|
29067
29131
|
class: normalizeClass(lastPageLabel.value === ">" ? "lupa-page-arrow" : "lupa-show-more"),
|
|
29132
|
+
href: getHref(_ctx.options.selectedPage + 1),
|
|
29068
29133
|
"data-cy": "lupa-show-more",
|
|
29069
|
-
onClick: _cache[3] || (_cache[3] = () => handlePageChange(_ctx.options.selectedPage + 1))
|
|
29070
|
-
},
|
|
29134
|
+
onClick: _cache[3] || (_cache[3] = (e2) => handlePageChange(e2, _ctx.options.selectedPage + 1))
|
|
29135
|
+
}, {
|
|
29136
|
+
default: withCtx(() => [
|
|
29137
|
+
createTextVNode(toDisplayString(lastPageLabel.value), 1)
|
|
29138
|
+
]),
|
|
29139
|
+
_: 1
|
|
29140
|
+
}, 8, ["class", "href"])) : createCommentVNode("", true)
|
|
29071
29141
|
])) : createCommentVNode("", true);
|
|
29072
29142
|
};
|
|
29073
29143
|
}
|
|
@@ -29081,7 +29151,7 @@ const _hoisted_3$l = {
|
|
|
29081
29151
|
class: "lupa-select-label",
|
|
29082
29152
|
for: "lupa-page-size-select-dropdown"
|
|
29083
29153
|
};
|
|
29084
|
-
const _hoisted_4$
|
|
29154
|
+
const _hoisted_4$e = ["aria-label"];
|
|
29085
29155
|
const _hoisted_5$a = ["value"];
|
|
29086
29156
|
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
29087
29157
|
__name: "SearchResultsPageSize",
|
|
@@ -29131,7 +29201,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
29131
29201
|
value: option
|
|
29132
29202
|
}, toDisplayString(prefixLabel.value) + toDisplayString(option), 9, _hoisted_5$a);
|
|
29133
29203
|
}), 128))
|
|
29134
|
-
], 40, _hoisted_4$
|
|
29204
|
+
], 40, _hoisted_4$e)
|
|
29135
29205
|
])
|
|
29136
29206
|
]);
|
|
29137
29207
|
};
|
|
@@ -29146,7 +29216,7 @@ const _hoisted_3$k = {
|
|
|
29146
29216
|
class: "lupa-select-label",
|
|
29147
29217
|
for: "lupa-sort-select-dropdown"
|
|
29148
29218
|
};
|
|
29149
|
-
const _hoisted_4$
|
|
29219
|
+
const _hoisted_4$d = ["aria-label"];
|
|
29150
29220
|
const _hoisted_5$9 = ["value"];
|
|
29151
29221
|
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
29152
29222
|
__name: "SearchResultsSort",
|
|
@@ -29217,7 +29287,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
29217
29287
|
value: option.key
|
|
29218
29288
|
}, toDisplayString(option.label), 9, _hoisted_5$9);
|
|
29219
29289
|
}), 128))
|
|
29220
|
-
], 40, _hoisted_4$
|
|
29290
|
+
], 40, _hoisted_4$d), [
|
|
29221
29291
|
[vModelSelect, selectedKey.value]
|
|
29222
29292
|
])
|
|
29223
29293
|
])
|
|
@@ -29231,7 +29301,7 @@ const _hoisted_2$r = {
|
|
|
29231
29301
|
class: "lupa-toolbar-right-title"
|
|
29232
29302
|
};
|
|
29233
29303
|
const _hoisted_3$j = { key: 2 };
|
|
29234
|
-
const _hoisted_4$
|
|
29304
|
+
const _hoisted_4$c = { key: 4 };
|
|
29235
29305
|
const _hoisted_5$8 = { key: 6 };
|
|
29236
29306
|
const _hoisted_6$4 = { class: "lupa-toolbar-right" };
|
|
29237
29307
|
const _hoisted_7$2 = {
|
|
@@ -29301,6 +29371,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
29301
29371
|
}
|
|
29302
29372
|
});
|
|
29303
29373
|
const paginationOptions = computed(() => {
|
|
29374
|
+
var _a25;
|
|
29304
29375
|
const pageSelect = optionsValue.value.pagination.pageSelection;
|
|
29305
29376
|
return {
|
|
29306
29377
|
pageSize: {
|
|
@@ -29311,7 +29382,8 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
29311
29382
|
count: getPageCount(searchResult.value.total, limit.value),
|
|
29312
29383
|
selectedPage: page.value,
|
|
29313
29384
|
display: pageSelect.display,
|
|
29314
|
-
displayMobile: pageSelect.displayMobile
|
|
29385
|
+
displayMobile: pageSelect.displayMobile,
|
|
29386
|
+
renderAsLinks: (_a25 = pageSelect.renderAsLinks) != null ? _a25 : false
|
|
29315
29387
|
},
|
|
29316
29388
|
labels: optionsValue.value.labels
|
|
29317
29389
|
};
|
|
@@ -29359,7 +29431,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
29359
29431
|
label: searchSummaryLabel.value,
|
|
29360
29432
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
29361
29433
|
onClear: handleClearAll
|
|
29362
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$
|
|
29434
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$c)),
|
|
29363
29435
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$I, {
|
|
29364
29436
|
key: 5,
|
|
29365
29437
|
options: paginationOptions.value.pageSelect,
|
|
@@ -29412,7 +29484,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
29412
29484
|
const _hoisted_1$z = ["title", "innerHTML"];
|
|
29413
29485
|
const _hoisted_2$q = ["title"];
|
|
29414
29486
|
const _hoisted_3$i = ["href", "innerHTML"];
|
|
29415
|
-
const _hoisted_4$
|
|
29487
|
+
const _hoisted_4$b = ["title"];
|
|
29416
29488
|
const _hoisted_5$7 = {
|
|
29417
29489
|
key: 0,
|
|
29418
29490
|
class: "lupa-search-results-product-title-text"
|
|
@@ -29480,7 +29552,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
29480
29552
|
class: "lupa-search-results-product-title-text lupa-title-link",
|
|
29481
29553
|
onClick: handleNavigation
|
|
29482
29554
|
}, toDisplayString(title.value), 9, _hoisted_6$3)) : createCommentVNode("", true)
|
|
29483
|
-
], 12, _hoisted_4$
|
|
29555
|
+
], 12, _hoisted_4$b));
|
|
29484
29556
|
};
|
|
29485
29557
|
}
|
|
29486
29558
|
});
|
|
@@ -29523,7 +29595,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
29523
29595
|
const _hoisted_1$x = { id: "lupa-search-results-rating" };
|
|
29524
29596
|
const _hoisted_2$p = { class: "lupa-ratings" };
|
|
29525
29597
|
const _hoisted_3$h = { class: "lupa-ratings-base" };
|
|
29526
|
-
const _hoisted_4$
|
|
29598
|
+
const _hoisted_4$a = ["innerHTML"];
|
|
29527
29599
|
const _hoisted_5$6 = { class: "lupa-rating-wrapper" };
|
|
29528
29600
|
const _hoisted_6$2 = ["innerHTML"];
|
|
29529
29601
|
const _hoisted_7$1 = ["href"];
|
|
@@ -29573,7 +29645,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
29573
29645
|
key: index,
|
|
29574
29646
|
innerHTML: star,
|
|
29575
29647
|
class: "lupa-rating lupa-rating-not-highlighted"
|
|
29576
|
-
}, null, 8, _hoisted_4$
|
|
29648
|
+
}, null, 8, _hoisted_4$a);
|
|
29577
29649
|
}), 128))
|
|
29578
29650
|
]),
|
|
29579
29651
|
createElementVNode("div", _hoisted_5$6, [
|
|
@@ -29666,7 +29738,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
29666
29738
|
const _hoisted_1$v = { class: "lupa-search-results-add-to-cart-wrapper" };
|
|
29667
29739
|
const _hoisted_2$o = { class: "lupa-search-results-product-addtocart" };
|
|
29668
29740
|
const _hoisted_3$g = ["disabled"];
|
|
29669
|
-
const _hoisted_4$
|
|
29741
|
+
const _hoisted_4$9 = ["href"];
|
|
29670
29742
|
const _hoisted_5$5 = ["id", "disabled"];
|
|
29671
29743
|
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
29672
29744
|
__name: "SearchResultsProductAddToCart",
|
|
@@ -29735,7 +29807,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
29735
29807
|
"data-cy": "lupa-add-to-cart",
|
|
29736
29808
|
disabled: !inStockValue.value || loading.value
|
|
29737
29809
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
29738
|
-
createElementVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$
|
|
29810
|
+
createElementVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$9)
|
|
29739
29811
|
], 16, _hoisted_3$g)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
29740
29812
|
key: 1,
|
|
29741
29813
|
id: id.value,
|
|
@@ -29753,7 +29825,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
29753
29825
|
const _hoisted_1$u = ["innerHTML"];
|
|
29754
29826
|
const _hoisted_2$n = { key: 0 };
|
|
29755
29827
|
const _hoisted_3$f = { key: 1 };
|
|
29756
|
-
const _hoisted_4$
|
|
29828
|
+
const _hoisted_4$8 = { class: "lupa-search-box-custom-label" };
|
|
29757
29829
|
const _hoisted_5$4 = { class: "lupa-search-box-custom-text" };
|
|
29758
29830
|
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
29759
29831
|
__name: "SearchResultsProductCustom",
|
|
@@ -29782,7 +29854,11 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
29782
29854
|
var _a25;
|
|
29783
29855
|
return (_a25 = props.options.isHtml) != null ? _a25 : false;
|
|
29784
29856
|
});
|
|
29785
|
-
const handleClick = () => __async(null, null, function* () {
|
|
29857
|
+
const handleClick = (e2) => __async(null, null, function* () {
|
|
29858
|
+
if (e2 && props.options.stopPropagationOnClick) {
|
|
29859
|
+
e2.stopPropagation();
|
|
29860
|
+
e2.preventDefault();
|
|
29861
|
+
}
|
|
29786
29862
|
if (!props.options.action) {
|
|
29787
29863
|
return;
|
|
29788
29864
|
}
|
|
@@ -29798,7 +29874,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
29798
29874
|
class: className.value
|
|
29799
29875
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
29800
29876
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$n, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$f, [
|
|
29801
|
-
createElementVNode("div", _hoisted_4$
|
|
29877
|
+
createElementVNode("div", _hoisted_4$8, toDisplayString(label.value), 1),
|
|
29802
29878
|
createElementVNode("div", _hoisted_5$4, toDisplayString(text.value), 1)
|
|
29803
29879
|
]))
|
|
29804
29880
|
], 16));
|
|
@@ -29825,7 +29901,11 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
29825
29901
|
const className = computed(() => {
|
|
29826
29902
|
return props.options.className;
|
|
29827
29903
|
});
|
|
29828
|
-
const handleClick = () => __async(null, null, function* () {
|
|
29904
|
+
const handleClick = (e2) => __async(null, null, function* () {
|
|
29905
|
+
if (e2 && props.options.stopPropagationOnClick) {
|
|
29906
|
+
e2.stopPropagation();
|
|
29907
|
+
e2.preventDefault();
|
|
29908
|
+
}
|
|
29829
29909
|
if (!props.options.action) {
|
|
29830
29910
|
return;
|
|
29831
29911
|
}
|
|
@@ -29845,7 +29925,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
29845
29925
|
const _hoisted_1$s = { id: "lupa-search-results-rating" };
|
|
29846
29926
|
const _hoisted_2$m = ["innerHTML"];
|
|
29847
29927
|
const _hoisted_3$e = { class: "lupa-ratings" };
|
|
29848
|
-
const _hoisted_4$
|
|
29928
|
+
const _hoisted_4$7 = ["href"];
|
|
29849
29929
|
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
29850
29930
|
__name: "SearchResultsProductSingleStarRating",
|
|
29851
29931
|
props: {
|
|
@@ -29883,7 +29963,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
29883
29963
|
createElementVNode("a", {
|
|
29884
29964
|
href: ratingLink.value,
|
|
29885
29965
|
class: "lupa-total-ratings"
|
|
29886
|
-
}, toDisplayString(totalRatings.value), 9, _hoisted_4$
|
|
29966
|
+
}, toDisplayString(totalRatings.value), 9, _hoisted_4$7)
|
|
29887
29967
|
]);
|
|
29888
29968
|
};
|
|
29889
29969
|
}
|
|
@@ -30240,7 +30320,7 @@ const _hoisted_3$c = {
|
|
|
30240
30320
|
class: "lupa-similar-query-label",
|
|
30241
30321
|
"data-cy": "lupa-similar-query-label"
|
|
30242
30322
|
};
|
|
30243
|
-
const _hoisted_4$
|
|
30323
|
+
const _hoisted_4$6 = ["onClick"];
|
|
30244
30324
|
const _hoisted_5$3 = ["innerHTML"];
|
|
30245
30325
|
const _hoisted_6$1 = { key: 0 };
|
|
30246
30326
|
const _hoisted_7 = {
|
|
@@ -30301,7 +30381,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
30301
30381
|
innerHTML: getSimilarQueryContent(similarQuery.displayQuery)
|
|
30302
30382
|
}, null, 8, _hoisted_5$3),
|
|
30303
30383
|
similarQuery.count ? (openBlock(), createElementBlock("span", _hoisted_6$1, " (" + toDisplayString(similarQuery.count) + ")", 1)) : createCommentVNode("", true)
|
|
30304
|
-
], 8, _hoisted_4$
|
|
30384
|
+
], 8, _hoisted_4$6)
|
|
30305
30385
|
]),
|
|
30306
30386
|
createElementVNode("div", _hoisted_7, [
|
|
30307
30387
|
(openBlock(true), createElementBlock(Fragment, null, renderList(similarQuery.items, (product, index2) => {
|
|
@@ -30633,7 +30713,7 @@ const extractRelatedSource = (source, searchResults, options, activeFilters) =>
|
|
|
30633
30713
|
const _hoisted_1$l = { class: "lupa-related-query-item" };
|
|
30634
30714
|
const _hoisted_2$g = { class: "lupa-related-query-image" };
|
|
30635
30715
|
const _hoisted_3$a = { class: "lupa-related-query-label" };
|
|
30636
|
-
const _hoisted_4$
|
|
30716
|
+
const _hoisted_4$5 = { class: "lupa-related-query-title" };
|
|
30637
30717
|
const _hoisted_5$2 = {
|
|
30638
30718
|
key: 0,
|
|
30639
30719
|
class: "lupa-related-query-count"
|
|
@@ -30745,7 +30825,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
30745
30825
|
}, null, 8, ["item", "options"])) : createCommentVNode("", true)
|
|
30746
30826
|
]),
|
|
30747
30827
|
createElementVNode("div", _hoisted_3$a, [
|
|
30748
|
-
createElementVNode("span", _hoisted_4$
|
|
30828
|
+
createElementVNode("span", _hoisted_4$5, toDisplayString(_ctx.query), 1),
|
|
30749
30829
|
((_a25 = _ctx.options) == null ? void 0 : _a25.showCount) ? (openBlock(), createElementBlock("span", _hoisted_5$2, "(" + toDisplayString(totalItemCount.value) + ")", 1)) : createCommentVNode("", true)
|
|
30750
30830
|
])
|
|
30751
30831
|
]);
|
|
@@ -30972,7 +31052,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
30972
31052
|
const _hoisted_1$h = { class: "lupa-related-query-item" };
|
|
30973
31053
|
const _hoisted_2$d = { class: "lupa-related-query-image" };
|
|
30974
31054
|
const _hoisted_3$7 = { class: "lupa-related-query-label" };
|
|
30975
|
-
const _hoisted_4$
|
|
31055
|
+
const _hoisted_4$4 = { class: "lupa-related-query-title" };
|
|
30976
31056
|
const _hoisted_5$1 = {
|
|
30977
31057
|
key: 0,
|
|
30978
31058
|
class: "lupa-related-query-count"
|
|
@@ -31020,7 +31100,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
31020
31100
|
}, null, 8, ["item", "options"])) : createCommentVNode("", true)
|
|
31021
31101
|
]),
|
|
31022
31102
|
createElementVNode("div", _hoisted_3$7, [
|
|
31023
|
-
createElementVNode("span", _hoisted_4$
|
|
31103
|
+
createElementVNode("span", _hoisted_4$4, toDisplayString(query.value), 1),
|
|
31024
31104
|
((_a25 = _ctx.options) == null ? void 0 : _a25.showCount) ? (openBlock(), createElementBlock("span", _hoisted_5$1, "(" + toDisplayString(totalItemCount.value) + ")", 1)) : createCommentVNode("", true)
|
|
31025
31105
|
])
|
|
31026
31106
|
]);
|
|
@@ -31164,7 +31244,7 @@ const _hoisted_3$5 = {
|
|
|
31164
31244
|
class: "lupa-empty-results",
|
|
31165
31245
|
"data-cy": "lupa-no-results-in-page"
|
|
31166
31246
|
};
|
|
31167
|
-
const _hoisted_4$
|
|
31247
|
+
const _hoisted_4$3 = {
|
|
31168
31248
|
key: 5,
|
|
31169
31249
|
class: "lupa-empty-results",
|
|
31170
31250
|
"data-cy": "lupa-no-results"
|
|
@@ -31385,7 +31465,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
31385
31465
|
location: "bottom",
|
|
31386
31466
|
sdkOptions: _ctx.options.options
|
|
31387
31467
|
}, null, 8, ["options", "sdkOptions"])
|
|
31388
|
-
], 64)) : !unref(loading) && unref(currentQueryText) ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
31468
|
+
], 64)) : !unref(loading) && unref(currentQueryText) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
31389
31469
|
createVNode(_sfc_main$h, {
|
|
31390
31470
|
emptyResultsLabel: (_b25 = _ctx.options.labels) == null ? void 0 : _b25.emptyResults,
|
|
31391
31471
|
currentQueryText: unref(currentQueryText),
|
|
@@ -31421,7 +31501,7 @@ const _hoisted_2$9 = {
|
|
|
31421
31501
|
class: "lupa-category-back"
|
|
31422
31502
|
};
|
|
31423
31503
|
const _hoisted_3$4 = ["href"];
|
|
31424
|
-
const _hoisted_4$
|
|
31504
|
+
const _hoisted_4$2 = {
|
|
31425
31505
|
key: 1,
|
|
31426
31506
|
class: "lupa-child-category-list"
|
|
31427
31507
|
};
|
|
@@ -31481,7 +31561,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
31481
31561
|
onClick: handleNavigationBack
|
|
31482
31562
|
}, toDisplayString(backTitle.value), 9, _hoisted_3$4)
|
|
31483
31563
|
])) : createCommentVNode("", true),
|
|
31484
|
-
hasRelatedCategoryChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
31564
|
+
hasRelatedCategoryChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
31485
31565
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(relatedCategoryChildren), (child) => {
|
|
31486
31566
|
return openBlock(), createBlock(_sfc_main$Z, {
|
|
31487
31567
|
key: getCategoryKey(child),
|
|
@@ -33465,12 +33545,13 @@ const _hoisted_1$9 = {
|
|
|
33465
33545
|
key: 0,
|
|
33466
33546
|
class: "lupa-recommendation-section-title"
|
|
33467
33547
|
};
|
|
33468
|
-
const _hoisted_2$6 =
|
|
33548
|
+
const _hoisted_2$6 = ["href"];
|
|
33549
|
+
const _hoisted_3$3 = {
|
|
33469
33550
|
key: 1,
|
|
33470
33551
|
class: "lupa-recommended-products",
|
|
33471
33552
|
"data-cy": "lupa-recommended-products"
|
|
33472
33553
|
};
|
|
33473
|
-
const
|
|
33554
|
+
const _hoisted_4$1 = {
|
|
33474
33555
|
key: 1,
|
|
33475
33556
|
class: "lupa-products",
|
|
33476
33557
|
"data-cy": "lupa-products"
|
|
@@ -33514,6 +33595,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
33514
33595
|
var _a25, _b25;
|
|
33515
33596
|
return (_b25 = (_a25 = props.options.recommendationLabels) == null ? void 0 : _a25.title) != null ? _b25 : "";
|
|
33516
33597
|
});
|
|
33598
|
+
const hasTitleLink = computed(() => {
|
|
33599
|
+
var _a25;
|
|
33600
|
+
return Boolean((_a25 = props.options.recommendationLabels) == null ? void 0 : _a25.titleLink);
|
|
33601
|
+
});
|
|
33517
33602
|
const hasRecommendations = computed(() => {
|
|
33518
33603
|
return recommendations.value.length > 0;
|
|
33519
33604
|
});
|
|
@@ -33603,6 +33688,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
33603
33688
|
var _a25, _b25;
|
|
33604
33689
|
return (_b25 = (_a25 = carouselOptions.value) == null ? void 0 : _a25.wrapAround) != null ? _b25 : true;
|
|
33605
33690
|
});
|
|
33691
|
+
const recommendationFilters = computed(() => {
|
|
33692
|
+
return __spreadValues({}, processExtractionObject(props.options.recommendationFilters));
|
|
33693
|
+
});
|
|
33606
33694
|
const loadLupaRecommendations = () => __async(null, null, function* () {
|
|
33607
33695
|
var _a25, _b25;
|
|
33608
33696
|
recommendationsType.value = "recommendations_lupasearch";
|
|
@@ -33611,7 +33699,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
33611
33699
|
const result2 = yield LupaSearchSdk.recommend(
|
|
33612
33700
|
props.options.queryKey,
|
|
33613
33701
|
itemId.value,
|
|
33614
|
-
|
|
33702
|
+
recommendationFilters.value,
|
|
33615
33703
|
props.options.options
|
|
33616
33704
|
);
|
|
33617
33705
|
if (!result2.success) {
|
|
@@ -33629,14 +33717,22 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
33629
33717
|
});
|
|
33630
33718
|
__expose({ fetch: fetch2 });
|
|
33631
33719
|
return (_ctx, _cache) => {
|
|
33720
|
+
var _a25;
|
|
33632
33721
|
return openBlock(), createElementBlock("div", {
|
|
33633
33722
|
class: "lupa-search-product-recommendations-wrapper",
|
|
33634
33723
|
ref_key: "rootElement",
|
|
33635
33724
|
ref: rootElement
|
|
33636
33725
|
}, [
|
|
33637
33726
|
hasRecommendations.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
33638
|
-
title.value ? (openBlock(), createElementBlock("h2", _hoisted_1$9,
|
|
33639
|
-
|
|
33727
|
+
title.value ? (openBlock(), createElementBlock("h2", _hoisted_1$9, [
|
|
33728
|
+
!hasTitleLink.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
33729
|
+
createTextVNode(toDisplayString(title.value), 1)
|
|
33730
|
+
], 64)) : (openBlock(), createElementBlock("a", {
|
|
33731
|
+
key: 1,
|
|
33732
|
+
href: (_a25 = _ctx.options.recommendationLabels) == null ? void 0 : _a25.titleLink
|
|
33733
|
+
}, toDisplayString(title.value), 9, _hoisted_2$6))
|
|
33734
|
+
])) : createCommentVNode("", true),
|
|
33735
|
+
!loading.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
33640
33736
|
layoutType.value === "carousel" ? (openBlock(), createBlock(unref(Carousel), mergeProps({ key: 0 }, carouselOptions.value, { "wrap-around": wrapAround.value }), {
|
|
33641
33737
|
addons: withCtx(() => [
|
|
33642
33738
|
createVNode(unref(Navigation))
|
|
@@ -33660,7 +33756,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
33660
33756
|
}), 128))
|
|
33661
33757
|
]),
|
|
33662
33758
|
_: 1
|
|
33663
|
-
}, 16, ["wrap-around"])) : (openBlock(), createElementBlock("div",
|
|
33759
|
+
}, 16, ["wrap-around"])) : (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
33664
33760
|
(openBlock(true), createElementBlock(Fragment, null, renderList(recommendations.value, (product, index) => {
|
|
33665
33761
|
return openBlock(), createBlock(_sfc_main$t, {
|
|
33666
33762
|
style: normalizeStyle(columnSize.value),
|
package/dist/stores/params.d.ts
CHANGED
|
@@ -24,6 +24,15 @@ export declare const useParamsStore: import('pinia').StoreDefinition<"params", P
|
|
|
24
24
|
}>;
|
|
25
25
|
lastChangedParams: Ref<any[], any[]>;
|
|
26
26
|
skipFacetReload: import('vue').ComputedRef<boolean>;
|
|
27
|
+
getPageUrlWithNewParams: ({ params: newParams, paramsToRemove, encode, searchResultsLink }: {
|
|
28
|
+
params: {
|
|
29
|
+
name: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}[];
|
|
32
|
+
paramsToRemove?: "all" | string[];
|
|
33
|
+
encode?: boolean;
|
|
34
|
+
searchResultsLink?: string;
|
|
35
|
+
}) => string;
|
|
27
36
|
add: (newParams: QueryParams, ssr?: SsrOptions) => {
|
|
28
37
|
params: QueryParams;
|
|
29
38
|
};
|
|
@@ -77,6 +86,15 @@ export declare const useParamsStore: import('pinia').StoreDefinition<"params", P
|
|
|
77
86
|
}>;
|
|
78
87
|
lastChangedParams: Ref<any[], any[]>;
|
|
79
88
|
skipFacetReload: import('vue').ComputedRef<boolean>;
|
|
89
|
+
getPageUrlWithNewParams: ({ params: newParams, paramsToRemove, encode, searchResultsLink }: {
|
|
90
|
+
params: {
|
|
91
|
+
name: string;
|
|
92
|
+
value: string;
|
|
93
|
+
}[];
|
|
94
|
+
paramsToRemove?: "all" | string[];
|
|
95
|
+
encode?: boolean;
|
|
96
|
+
searchResultsLink?: string;
|
|
97
|
+
}) => string;
|
|
80
98
|
add: (newParams: QueryParams, ssr?: SsrOptions) => {
|
|
81
99
|
params: QueryParams;
|
|
82
100
|
};
|
|
@@ -130,6 +148,15 @@ export declare const useParamsStore: import('pinia').StoreDefinition<"params", P
|
|
|
130
148
|
}>;
|
|
131
149
|
lastChangedParams: Ref<any[], any[]>;
|
|
132
150
|
skipFacetReload: import('vue').ComputedRef<boolean>;
|
|
151
|
+
getPageUrlWithNewParams: ({ params: newParams, paramsToRemove, encode, searchResultsLink }: {
|
|
152
|
+
params: {
|
|
153
|
+
name: string;
|
|
154
|
+
value: string;
|
|
155
|
+
}[];
|
|
156
|
+
paramsToRemove?: "all" | string[];
|
|
157
|
+
encode?: boolean;
|
|
158
|
+
searchResultsLink?: string;
|
|
159
|
+
}) => string;
|
|
133
160
|
add: (newParams: QueryParams, ssr?: SsrOptions) => {
|
|
134
161
|
params: QueryParams;
|
|
135
162
|
};
|
|
@@ -161,4 +188,4 @@ export declare const useParamsStore: import('pinia').StoreDefinition<"params", P
|
|
|
161
188
|
setDefaultLimit: (newDefaultLimit: number) => number;
|
|
162
189
|
setSearchResultsLink: (newSearchResultsLink: string) => void;
|
|
163
190
|
setSortSettings: ({ selectedSortKey, previousSortKey }: SortCallbackContext) => void;
|
|
164
|
-
}, "add" | "removeAllFilters" | "removeParameters" | "handleNoResultsFlag" | "goToResults" | "appendParams" | "setDefaultLimit" | "setSearchResultsLink" | "setSortSettings">>;
|
|
191
|
+
}, "add" | "getPageUrlWithNewParams" | "removeAllFilters" | "removeParameters" | "handleNoResultsFlag" | "goToResults" | "appendParams" | "setDefaultLimit" | "setSearchResultsLink" | "setSortSettings">>;
|