@getlupa/client 1.11.1 → 1.11.2
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 +99 -66
- package/dist/lupaSearch.js +99 -66
- package/dist/lupaSearch.mjs +99 -66
- package/dist/lupaSearch.umd.js +99 -66
- package/package.json +2 -2
package/dist/lupaSearch.mjs
CHANGED
|
@@ -7314,7 +7314,7 @@ const DEFAULT_OPTIONS_RESULTS$1 = {
|
|
|
7314
7314
|
top: false,
|
|
7315
7315
|
bottom: true
|
|
7316
7316
|
},
|
|
7317
|
-
sizes: [10, 20, 25
|
|
7317
|
+
sizes: [10, 20, 25]
|
|
7318
7318
|
},
|
|
7319
7319
|
pageSelection: {
|
|
7320
7320
|
position: {
|
|
@@ -7640,38 +7640,39 @@ const unfoldHierarchyFilter = (key, filter) => {
|
|
|
7640
7640
|
const seed = [];
|
|
7641
7641
|
return filter.terms.reduce((a, c2) => [...a, { key, value: c2, type: "hierarchy" }], seed);
|
|
7642
7642
|
};
|
|
7643
|
-
const unfoldRangeFilter = (key, filter) => {
|
|
7643
|
+
const unfoldRangeFilter = (key, filter, price = {}) => {
|
|
7644
|
+
var _a;
|
|
7644
7645
|
const gt = filter.gte || filter.gt;
|
|
7645
7646
|
const lt = filter.lte || filter.lt;
|
|
7646
|
-
if (key.includes(CURRENCY_KEY_INDICATOR)) {
|
|
7647
|
+
if (key.includes(CURRENCY_KEY_INDICATOR) || ((_a = price == null ? void 0 : price.keys) == null ? void 0 : _a.includes(key))) {
|
|
7647
7648
|
return [
|
|
7648
7649
|
{
|
|
7649
7650
|
key,
|
|
7650
|
-
value: formatPriceSummary([gt, lt]),
|
|
7651
|
+
value: formatPriceSummary([gt, lt], price.currency, price.separator),
|
|
7651
7652
|
type: "range"
|
|
7652
7653
|
}
|
|
7653
7654
|
];
|
|
7654
7655
|
}
|
|
7655
7656
|
return [{ key, value: `${gt} - ${lt}`, type: "range" }];
|
|
7656
7657
|
};
|
|
7657
|
-
const unfoldFilter = (key, filter) => {
|
|
7658
|
+
const unfoldFilter = (key, filter, price = {}) => {
|
|
7658
7659
|
if (Array.isArray(filter)) {
|
|
7659
7660
|
return unfoldTermFilter(key, filter);
|
|
7660
7661
|
}
|
|
7661
7662
|
if (filter.gte) {
|
|
7662
|
-
return unfoldRangeFilter(key, filter);
|
|
7663
|
+
return unfoldRangeFilter(key, filter, price);
|
|
7663
7664
|
}
|
|
7664
7665
|
if (filter.terms) {
|
|
7665
7666
|
return unfoldHierarchyFilter(key, filter);
|
|
7666
7667
|
}
|
|
7667
7668
|
return [];
|
|
7668
7669
|
};
|
|
7669
|
-
const unfoldFilters = (filters) => {
|
|
7670
|
+
const unfoldFilters = (filters, price = {}) => {
|
|
7670
7671
|
if (!filters) {
|
|
7671
7672
|
return [];
|
|
7672
7673
|
}
|
|
7673
7674
|
const seed = [];
|
|
7674
|
-
return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2)], seed);
|
|
7675
|
+
return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2, price)], seed);
|
|
7675
7676
|
};
|
|
7676
7677
|
const getLabeledFilters = (filters, facets) => {
|
|
7677
7678
|
return filters.map((f2) => {
|
|
@@ -8444,7 +8445,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
|
|
|
8444
8445
|
};
|
|
8445
8446
|
});
|
|
8446
8447
|
const _hoisted_1$1e = { id: "lupa-search-box-input-container" };
|
|
8447
|
-
const _hoisted_2$
|
|
8448
|
+
const _hoisted_2$Q = { class: "lupa-input-clear" };
|
|
8448
8449
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
8449
8450
|
const _hoisted_4$s = ["value"];
|
|
8450
8451
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
@@ -8534,7 +8535,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
8534
8535
|
__expose({ focus });
|
|
8535
8536
|
return (_ctx, _cache) => {
|
|
8536
8537
|
return openBlock(), createElementBlock("div", _hoisted_1$1e, [
|
|
8537
|
-
createBaseVNode("div", _hoisted_2$
|
|
8538
|
+
createBaseVNode("div", _hoisted_2$Q, [
|
|
8538
8539
|
createBaseVNode("div", {
|
|
8539
8540
|
class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
|
|
8540
8541
|
onClick: clear2
|
|
@@ -8608,7 +8609,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
8608
8609
|
}
|
|
8609
8610
|
});
|
|
8610
8611
|
const _hoisted_1$1d = { class: "lupa-search-box-history-item" };
|
|
8611
|
-
const _hoisted_2$
|
|
8612
|
+
const _hoisted_2$P = { class: "lupa-search-box-history-item-content" };
|
|
8612
8613
|
const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
8613
8614
|
__name: "SearchBoxHistoryItem",
|
|
8614
8615
|
props: {
|
|
@@ -8626,7 +8627,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
8626
8627
|
};
|
|
8627
8628
|
return (_ctx, _cache) => {
|
|
8628
8629
|
return openBlock(), createElementBlock("div", _hoisted_1$1d, [
|
|
8629
|
-
createBaseVNode("div", _hoisted_2$
|
|
8630
|
+
createBaseVNode("div", _hoisted_2$P, [
|
|
8630
8631
|
createBaseVNode("div", {
|
|
8631
8632
|
class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
|
|
8632
8633
|
onClick: click2
|
|
@@ -8716,7 +8717,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
8716
8717
|
}
|
|
8717
8718
|
});
|
|
8718
8719
|
const _hoisted_1$1a = ["innerHTML"];
|
|
8719
|
-
const _hoisted_2$
|
|
8720
|
+
const _hoisted_2$O = {
|
|
8720
8721
|
key: 1,
|
|
8721
8722
|
"data-cy": "lupa-suggestion-value",
|
|
8722
8723
|
class: "lupa-suggestion-value"
|
|
@@ -8770,7 +8771,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
|
8770
8771
|
class: "lupa-suggestion-value",
|
|
8771
8772
|
"data-cy": "lupa-suggestion-value",
|
|
8772
8773
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
8773
|
-
}, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
8774
|
+
}, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$O, toDisplayString(_ctx.suggestion.display), 1)),
|
|
8774
8775
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
|
|
8775
8776
|
createBaseVNode("span", _hoisted_4$r, toDisplayString(facetLabel.value), 1),
|
|
8776
8777
|
createBaseVNode("span", _hoisted_5$g, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
@@ -9162,7 +9163,7 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
|
9162
9163
|
}
|
|
9163
9164
|
});
|
|
9164
9165
|
const _hoisted_1$17 = ["innerHTML"];
|
|
9165
|
-
const _hoisted_2$
|
|
9166
|
+
const _hoisted_2$N = {
|
|
9166
9167
|
key: 1,
|
|
9167
9168
|
class: "lupa-search-box-product-title"
|
|
9168
9169
|
};
|
|
@@ -9186,14 +9187,14 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
9186
9187
|
key: 0,
|
|
9187
9188
|
class: "lupa-search-box-product-title",
|
|
9188
9189
|
innerHTML: title.value
|
|
9189
|
-
}, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
9190
|
+
}, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$N, [
|
|
9190
9191
|
createBaseVNode("strong", null, toDisplayString(title.value), 1)
|
|
9191
9192
|
]));
|
|
9192
9193
|
};
|
|
9193
9194
|
}
|
|
9194
9195
|
});
|
|
9195
9196
|
const _hoisted_1$16 = ["innerHTML"];
|
|
9196
|
-
const _hoisted_2$
|
|
9197
|
+
const _hoisted_2$M = {
|
|
9197
9198
|
key: 1,
|
|
9198
9199
|
class: "lupa-search-box-product-description"
|
|
9199
9200
|
};
|
|
@@ -9217,7 +9218,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
9217
9218
|
key: 0,
|
|
9218
9219
|
class: "lupa-search-box-product-description",
|
|
9219
9220
|
innerHTML: description.value
|
|
9220
|
-
}, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
9221
|
+
}, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$M, toDisplayString(description.value), 1));
|
|
9221
9222
|
};
|
|
9222
9223
|
}
|
|
9223
9224
|
});
|
|
@@ -9270,7 +9271,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
9270
9271
|
}
|
|
9271
9272
|
});
|
|
9272
9273
|
const _hoisted_1$13 = ["innerHTML"];
|
|
9273
|
-
const _hoisted_2$
|
|
9274
|
+
const _hoisted_2$L = { key: 0 };
|
|
9274
9275
|
const _hoisted_3$y = { key: 1 };
|
|
9275
9276
|
const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
|
|
9276
9277
|
const _hoisted_5$f = { class: "lupa-search-box-custom-text" };
|
|
@@ -9304,7 +9305,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
9304
9305
|
key: 1,
|
|
9305
9306
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
9306
9307
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
9307
|
-
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
9308
|
+
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$L, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
|
|
9308
9309
|
createBaseVNode("div", _hoisted_4$q, toDisplayString(label.value), 1),
|
|
9309
9310
|
createBaseVNode("div", _hoisted_5$f, toDisplayString(text.value), 1)
|
|
9310
9311
|
]))
|
|
@@ -9391,13 +9392,33 @@ const useSearchResultStore = defineStore("searchResult", () => {
|
|
|
9391
9392
|
const isMobileSidebarVisible = ref(false);
|
|
9392
9393
|
const optionsStore = useOptionsStore();
|
|
9393
9394
|
const paramsStore = useParamsStore();
|
|
9395
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
9394
9396
|
const facets = computed(() => searchResult.value.facets);
|
|
9395
9397
|
const filters = computed(() => searchResult.value.filters);
|
|
9396
9398
|
const currentQueryText = computed(() => searchResult.value.searchText);
|
|
9397
9399
|
const totalItems = computed(() => searchResult.value.total);
|
|
9398
9400
|
const hasResults = computed(() => totalItems.value > 0);
|
|
9401
|
+
const priceKeys = computed(() => {
|
|
9402
|
+
var _a, _b;
|
|
9403
|
+
return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
|
|
9404
|
+
});
|
|
9405
|
+
const currency = computed(() => {
|
|
9406
|
+
var _a, _b, _c;
|
|
9407
|
+
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currency) != null ? _c : "";
|
|
9408
|
+
});
|
|
9409
|
+
const priceSeparator = computed(() => {
|
|
9410
|
+
var _a, _b, _c;
|
|
9411
|
+
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.priceSeparator) != null ? _c : "";
|
|
9412
|
+
});
|
|
9399
9413
|
const labeledFilters = computed(
|
|
9400
|
-
() => getLabeledFilters(
|
|
9414
|
+
() => getLabeledFilters(
|
|
9415
|
+
unfoldFilters(filters.value, {
|
|
9416
|
+
keys: priceKeys.value,
|
|
9417
|
+
currency: currency.value,
|
|
9418
|
+
separator: priceSeparator.value
|
|
9419
|
+
}),
|
|
9420
|
+
facets.value
|
|
9421
|
+
)
|
|
9401
9422
|
);
|
|
9402
9423
|
const displayFilters = computed(() => {
|
|
9403
9424
|
var _a, _b;
|
|
@@ -9532,7 +9553,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
|
|
|
9532
9553
|
};
|
|
9533
9554
|
});
|
|
9534
9555
|
const _hoisted_1$11 = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
9535
|
-
const _hoisted_2$
|
|
9556
|
+
const _hoisted_2$K = { class: "lupa-search-box-product-addtocart" };
|
|
9536
9557
|
const _hoisted_3$x = ["onClick", "disabled"];
|
|
9537
9558
|
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
9538
9559
|
__name: "SearchBoxProductAddToCart",
|
|
@@ -9562,7 +9583,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
9562
9583
|
});
|
|
9563
9584
|
return (_ctx, _cache) => {
|
|
9564
9585
|
return openBlock(), createElementBlock("div", _hoisted_1$11, [
|
|
9565
|
-
createBaseVNode("div", _hoisted_2$
|
|
9586
|
+
createBaseVNode("div", _hoisted_2$K, [
|
|
9566
9587
|
createBaseVNode("button", {
|
|
9567
9588
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
9568
9589
|
class: normalizeClass(loading.value ? "lupa-add-to-cart-loading" : "lupa-add-to-cart"),
|
|
@@ -9664,7 +9685,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
|
|
|
9664
9685
|
}
|
|
9665
9686
|
}));
|
|
9666
9687
|
const _hoisted_1$$ = { class: "lupa-badge-title" };
|
|
9667
|
-
const _hoisted_2$
|
|
9688
|
+
const _hoisted_2$J = ["src"];
|
|
9668
9689
|
const _hoisted_3$w = { key: 1 };
|
|
9669
9690
|
const _hoisted_4$p = {
|
|
9670
9691
|
key: 0,
|
|
@@ -9707,7 +9728,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
9707
9728
|
image.value ? (openBlock(), createElementBlock("img", {
|
|
9708
9729
|
key: 0,
|
|
9709
9730
|
src: image.value
|
|
9710
|
-
}, null, 8, _hoisted_2$
|
|
9731
|
+
}, null, 8, _hoisted_2$J)) : createCommentVNode("", true),
|
|
9711
9732
|
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$w, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
9712
9733
|
]),
|
|
9713
9734
|
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$p, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
@@ -9806,7 +9827,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
9806
9827
|
}
|
|
9807
9828
|
});
|
|
9808
9829
|
const _hoisted_1$X = { class: "lupa-image-badges" };
|
|
9809
|
-
const _hoisted_2$
|
|
9830
|
+
const _hoisted_2$I = ["src"];
|
|
9810
9831
|
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
9811
9832
|
__name: "ImageBadge",
|
|
9812
9833
|
props: {
|
|
@@ -9835,7 +9856,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9835
9856
|
}, [
|
|
9836
9857
|
createBaseVNode("img", {
|
|
9837
9858
|
src: getImageUrl(item)
|
|
9838
|
-
}, null, 8, _hoisted_2$
|
|
9859
|
+
}, null, 8, _hoisted_2$I)
|
|
9839
9860
|
]);
|
|
9840
9861
|
}), 128))
|
|
9841
9862
|
]);
|
|
@@ -9927,7 +9948,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9927
9948
|
}
|
|
9928
9949
|
}));
|
|
9929
9950
|
const _hoisted_1$V = ["href"];
|
|
9930
|
-
const _hoisted_2$
|
|
9951
|
+
const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
|
|
9931
9952
|
const _hoisted_3$v = { class: "lupa-search-box-product-details-section" };
|
|
9932
9953
|
const _hoisted_4$o = {
|
|
9933
9954
|
key: 0,
|
|
@@ -9992,7 +10013,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
|
|
|
9992
10013
|
"data-cy": "lupa-search-box-product",
|
|
9993
10014
|
onClick: handleClick
|
|
9994
10015
|
}), [
|
|
9995
|
-
createBaseVNode("div", _hoisted_2$
|
|
10016
|
+
createBaseVNode("div", _hoisted_2$H, [
|
|
9996
10017
|
(openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
|
|
9997
10018
|
return openBlock(), createBlock(_sfc_main$15, {
|
|
9998
10019
|
class: "lupa-search-box-product-element",
|
|
@@ -10351,7 +10372,7 @@ const _hoisted_1$T = {
|
|
|
10351
10372
|
key: 0,
|
|
10352
10373
|
id: "lupa-search-box-panel"
|
|
10353
10374
|
};
|
|
10354
|
-
const _hoisted_2$
|
|
10375
|
+
const _hoisted_2$G = ["data-cy"];
|
|
10355
10376
|
const _hoisted_3$u = {
|
|
10356
10377
|
key: 0,
|
|
10357
10378
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
@@ -10559,7 +10580,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
10559
10580
|
key: "0"
|
|
10560
10581
|
} : void 0
|
|
10561
10582
|
]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
10562
|
-
], 10, _hoisted_2$
|
|
10583
|
+
], 10, _hoisted_2$G);
|
|
10563
10584
|
}), 128))
|
|
10564
10585
|
], 4),
|
|
10565
10586
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1i, {
|
|
@@ -10599,7 +10620,7 @@ const unbindSearchTriggers = (triggers = [], event) => {
|
|
|
10599
10620
|
elements.forEach((e) => e == null ? void 0 : e.removeEventListener(BIND_EVENT, event));
|
|
10600
10621
|
};
|
|
10601
10622
|
const _hoisted_1$S = { id: "lupa-search-box" };
|
|
10602
|
-
const _hoisted_2$
|
|
10623
|
+
const _hoisted_2$F = { class: "lupa-search-box-wrapper" };
|
|
10603
10624
|
const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
10604
10625
|
__name: "SearchBox",
|
|
10605
10626
|
props: {
|
|
@@ -10846,7 +10867,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
10846
10867
|
return (_ctx, _cache) => {
|
|
10847
10868
|
var _a2;
|
|
10848
10869
|
return openBlock(), createElementBlock("div", _hoisted_1$S, [
|
|
10849
|
-
createBaseVNode("div", _hoisted_2$
|
|
10870
|
+
createBaseVNode("div", _hoisted_2$F, [
|
|
10850
10871
|
createVNode(_sfc_main$1m, {
|
|
10851
10872
|
options: inputOptions.value,
|
|
10852
10873
|
suggestedValue: suggestedValue.value,
|
|
@@ -10950,7 +10971,7 @@ const _hoisted_1$R = {
|
|
|
10950
10971
|
key: 0,
|
|
10951
10972
|
id: "lupa-search-results-did-you-mean"
|
|
10952
10973
|
};
|
|
10953
|
-
const _hoisted_2$
|
|
10974
|
+
const _hoisted_2$E = {
|
|
10954
10975
|
key: 0,
|
|
10955
10976
|
"data-cy": "suggested-search-text-label"
|
|
10956
10977
|
};
|
|
@@ -10992,7 +11013,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
10992
11013
|
};
|
|
10993
11014
|
return (_ctx, _cache) => {
|
|
10994
11015
|
return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$R, [
|
|
10995
|
-
unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
11016
|
+
unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$E, [
|
|
10996
11017
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.noResultsSuggestion.split(" "), (label, index) => {
|
|
10997
11018
|
return openBlock(), createElementBlock("span", { key: index }, [
|
|
10998
11019
|
createBaseVNode("span", {
|
|
@@ -11021,7 +11042,7 @@ const _hoisted_1$Q = {
|
|
|
11021
11042
|
key: 0,
|
|
11022
11043
|
class: "lupa-search-results-summary"
|
|
11023
11044
|
};
|
|
11024
|
-
const _hoisted_2$
|
|
11045
|
+
const _hoisted_2$D = ["innerHTML"];
|
|
11025
11046
|
const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
11026
11047
|
__name: "SearchResultsSummary",
|
|
11027
11048
|
props: {
|
|
@@ -11038,7 +11059,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
11038
11059
|
});
|
|
11039
11060
|
return (_ctx, _cache) => {
|
|
11040
11061
|
return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
|
|
11041
|
-
createBaseVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$
|
|
11062
|
+
createBaseVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$D),
|
|
11042
11063
|
_ctx.clearable ? (openBlock(), createElementBlock("span", {
|
|
11043
11064
|
key: 0,
|
|
11044
11065
|
class: "lupa-filter-clear",
|
|
@@ -11054,7 +11075,7 @@ const _hoisted_1$P = {
|
|
|
11054
11075
|
class: "lupa-result-page-title",
|
|
11055
11076
|
"data-cy": "lupa-result-page-title"
|
|
11056
11077
|
};
|
|
11057
|
-
const _hoisted_2$
|
|
11078
|
+
const _hoisted_2$C = { key: 0 };
|
|
11058
11079
|
const _hoisted_3$s = {
|
|
11059
11080
|
key: 1,
|
|
11060
11081
|
class: "lupa-results-total-count"
|
|
@@ -11097,7 +11118,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
11097
11118
|
return openBlock(), createElementBlock("div", null, [
|
|
11098
11119
|
showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$P, [
|
|
11099
11120
|
createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
|
|
11100
|
-
queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
11121
|
+
queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$C, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
|
|
11101
11122
|
showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$s, "(" + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
|
|
11102
11123
|
])) : createCommentVNode("", true),
|
|
11103
11124
|
_ctx.showSummary ? (openBlock(), createBlock(_sfc_main$T, {
|
|
@@ -11114,7 +11135,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
11114
11135
|
}
|
|
11115
11136
|
});
|
|
11116
11137
|
const _hoisted_1$O = { class: "lupa-search-result-filter-value" };
|
|
11117
|
-
const _hoisted_2$
|
|
11138
|
+
const _hoisted_2$B = {
|
|
11118
11139
|
class: "lupa-current-filter-label",
|
|
11119
11140
|
"data-cy": "lupa-current-filter-label"
|
|
11120
11141
|
};
|
|
@@ -11139,14 +11160,14 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
11139
11160
|
class: "lupa-current-filter-action",
|
|
11140
11161
|
onClick: handleClick
|
|
11141
11162
|
}, "⨉"),
|
|
11142
|
-
createBaseVNode("div", _hoisted_2$
|
|
11163
|
+
createBaseVNode("div", _hoisted_2$B, toDisplayString(_ctx.filter.label) + ": ", 1),
|
|
11143
11164
|
createBaseVNode("div", _hoisted_3$r, toDisplayString(_ctx.filter.value), 1)
|
|
11144
11165
|
]);
|
|
11145
11166
|
};
|
|
11146
11167
|
}
|
|
11147
11168
|
});
|
|
11148
11169
|
const _hoisted_1$N = { class: "lupa-filter-title-text" };
|
|
11149
|
-
const _hoisted_2$
|
|
11170
|
+
const _hoisted_2$A = {
|
|
11150
11171
|
key: 0,
|
|
11151
11172
|
class: "lupa-filter-count"
|
|
11152
11173
|
};
|
|
@@ -11218,7 +11239,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
11218
11239
|
}, [
|
|
11219
11240
|
createBaseVNode("div", _hoisted_1$N, [
|
|
11220
11241
|
createTextVNode(toDisplayString((_c = (_b = (_a = _ctx.options) == null ? void 0 : _a.labels) == null ? void 0 : _b.title) != null ? _c : "") + " ", 1),
|
|
11221
|
-
_ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
11242
|
+
_ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$A, " (" + toDisplayString(unref(currentFilterCount)) + ") ", 1)) : createCommentVNode("", true)
|
|
11222
11243
|
]),
|
|
11223
11244
|
_ctx.expandable ? (openBlock(), createElementBlock("div", {
|
|
11224
11245
|
key: 0,
|
|
@@ -11292,7 +11313,7 @@ const _hoisted_1$L = {
|
|
|
11292
11313
|
class: "lupa-category-filter",
|
|
11293
11314
|
"data-cy": "lupa-category-filter"
|
|
11294
11315
|
};
|
|
11295
|
-
const _hoisted_2$
|
|
11316
|
+
const _hoisted_2$z = { class: "lupa-category-back" };
|
|
11296
11317
|
const _hoisted_3$p = ["href"];
|
|
11297
11318
|
const _hoisted_4$j = ["href"];
|
|
11298
11319
|
const _hoisted_5$d = { class: "lupa-child-category-list" };
|
|
@@ -11383,7 +11404,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
11383
11404
|
__expose({ fetch: fetch2 });
|
|
11384
11405
|
return (_ctx, _cache) => {
|
|
11385
11406
|
return openBlock(), createElementBlock("div", _hoisted_1$L, [
|
|
11386
|
-
createBaseVNode("div", _hoisted_2$
|
|
11407
|
+
createBaseVNode("div", _hoisted_2$z, [
|
|
11387
11408
|
hasBackButton.value ? (openBlock(), createElementBlock("a", {
|
|
11388
11409
|
key: 0,
|
|
11389
11410
|
"data-cy": "lupa-category-back",
|
|
@@ -11418,7 +11439,7 @@ const _hoisted_1$K = {
|
|
|
11418
11439
|
class: "lupa-search-result-facet-term-values",
|
|
11419
11440
|
"data-cy": "lupa-search-result-facet-term-values"
|
|
11420
11441
|
};
|
|
11421
|
-
const _hoisted_2$
|
|
11442
|
+
const _hoisted_2$y = ["placeholder"];
|
|
11422
11443
|
const _hoisted_3$o = { class: "lupa-terms-list" };
|
|
11423
11444
|
const _hoisted_4$i = ["onClick"];
|
|
11424
11445
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
@@ -11506,7 +11527,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
11506
11527
|
"data-cy": "lupa-term-filter",
|
|
11507
11528
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
|
|
11508
11529
|
placeholder: _ctx.options.labels.facetFilter
|
|
11509
|
-
}, null, 8, _hoisted_2$
|
|
11530
|
+
}, null, 8, _hoisted_2$y)), [
|
|
11510
11531
|
[vModelText, termFilter.value]
|
|
11511
11532
|
]) : createCommentVNode("", true),
|
|
11512
11533
|
createBaseVNode("div", _hoisted_3$o, [
|
|
@@ -12518,7 +12539,7 @@ m.render = function(e, t, r, i, n, o) {
|
|
|
12518
12539
|
return openBlock(), createElementBlock("div", mergeProps(e.sliderProps, { ref: "slider" }), null, 16);
|
|
12519
12540
|
}, m.__file = "src/Slider.vue";
|
|
12520
12541
|
const _hoisted_1$J = { class: "lupa-search-result-facet-stats-values" };
|
|
12521
|
-
const _hoisted_2$
|
|
12542
|
+
const _hoisted_2$x = {
|
|
12522
12543
|
key: 0,
|
|
12523
12544
|
class: "lupa-stats-facet-summary"
|
|
12524
12545
|
};
|
|
@@ -12578,6 +12599,10 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
12578
12599
|
var _a;
|
|
12579
12600
|
return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currency;
|
|
12580
12601
|
});
|
|
12602
|
+
const priceKeys = computed(() => {
|
|
12603
|
+
var _a, _b;
|
|
12604
|
+
return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
|
|
12605
|
+
});
|
|
12581
12606
|
const isSliderVisible = computed(() => {
|
|
12582
12607
|
var _a, _b;
|
|
12583
12608
|
return Boolean((_b = (_a = props.options.stats) == null ? void 0 : _a.slider) != null ? _b : true);
|
|
@@ -12641,8 +12666,8 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
12641
12666
|
}
|
|
12642
12667
|
});
|
|
12643
12668
|
const isPrice = computed(() => {
|
|
12644
|
-
var _a;
|
|
12645
|
-
return (_a = facetValue.value.key) == null ? void 0 :
|
|
12669
|
+
var _a, _b, _c;
|
|
12670
|
+
return ((_b = (_a = facetValue.value) == null ? void 0 : _a.key) == null ? void 0 : _b.includes(CURRENCY_KEY_INDICATOR)) || ((_c = priceKeys.value) == null ? void 0 : _c.includes(facetValue.value.key));
|
|
12646
12671
|
});
|
|
12647
12672
|
const facetMin = computed(() => {
|
|
12648
12673
|
return Math.floor(facetValue.value.min);
|
|
@@ -12715,7 +12740,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
12715
12740
|
};
|
|
12716
12741
|
return (_ctx, _cache) => {
|
|
12717
12742
|
return openBlock(), createElementBlock("div", _hoisted_1$J, [
|
|
12718
|
-
!isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
12743
|
+
!isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$x, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$n, [
|
|
12719
12744
|
createBaseVNode("div", null, [
|
|
12720
12745
|
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$h, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
|
|
12721
12746
|
createBaseVNode("div", _hoisted_5$b, [
|
|
@@ -12782,7 +12807,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
12782
12807
|
}
|
|
12783
12808
|
});
|
|
12784
12809
|
const _hoisted_1$I = { class: "lupa-term-checkbox-wrapper" };
|
|
12785
|
-
const _hoisted_2$
|
|
12810
|
+
const _hoisted_2$w = { class: "lupa-term-checkbox-label" };
|
|
12786
12811
|
const _hoisted_3$m = { class: "lupa-term-label" };
|
|
12787
12812
|
const _hoisted_4$g = {
|
|
12788
12813
|
key: 0,
|
|
@@ -12843,7 +12868,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
12843
12868
|
class: normalizeClass(["lupa-term-checkbox", { checked: isChecked.value }])
|
|
12844
12869
|
}, null, 2)
|
|
12845
12870
|
]),
|
|
12846
|
-
createBaseVNode("div", _hoisted_2$
|
|
12871
|
+
createBaseVNode("div", _hoisted_2$w, [
|
|
12847
12872
|
createBaseVNode("span", _hoisted_3$m, toDisplayString(_ctx.item.title) + toDisplayString(" "), 1),
|
|
12848
12873
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$g, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
|
|
12849
12874
|
])
|
|
@@ -12868,7 +12893,7 @@ const _hoisted_1$H = {
|
|
|
12868
12893
|
class: "lupa-search-result-facet-term-values lupa-search-result-facet-hierarchy-values",
|
|
12869
12894
|
"data-cy": "lupa-search-result-facet-term-values"
|
|
12870
12895
|
};
|
|
12871
|
-
const _hoisted_2$
|
|
12896
|
+
const _hoisted_2$v = { key: 0 };
|
|
12872
12897
|
const _hoisted_3$l = ["placeholder"];
|
|
12873
12898
|
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
12874
12899
|
__name: "HierarchyFacet",
|
|
@@ -12921,7 +12946,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
12921
12946
|
};
|
|
12922
12947
|
return (_ctx, _cache) => {
|
|
12923
12948
|
return openBlock(), createElementBlock("div", _hoisted_1$H, [
|
|
12924
|
-
isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
12949
|
+
isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$v, [
|
|
12925
12950
|
withDirectives(createBaseVNode("input", {
|
|
12926
12951
|
class: "lupa-term-filter",
|
|
12927
12952
|
"data-cy": "lupa-term-filter",
|
|
@@ -12953,7 +12978,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
12953
12978
|
}
|
|
12954
12979
|
});
|
|
12955
12980
|
const _hoisted_1$G = { class: "lupa-facet-label-text" };
|
|
12956
|
-
const _hoisted_2$
|
|
12981
|
+
const _hoisted_2$u = {
|
|
12957
12982
|
key: 0,
|
|
12958
12983
|
class: "lupa-facet-content",
|
|
12959
12984
|
"data-cy": "lupa-facet-content"
|
|
@@ -13082,7 +13107,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
13082
13107
|
class: normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
|
|
13083
13108
|
}, null, 2)
|
|
13084
13109
|
], 2),
|
|
13085
|
-
isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
13110
|
+
isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$u, [
|
|
13086
13111
|
(openBlock(), createBlock(resolveDynamicComponent(facetType.value), {
|
|
13087
13112
|
facet: facet.value,
|
|
13088
13113
|
currentFilters: currentFilters.value[facet.value.key],
|
|
@@ -13101,7 +13126,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
13101
13126
|
}
|
|
13102
13127
|
}));
|
|
13103
13128
|
const _hoisted_1$F = { class: "lupa-search-result-facet-section" };
|
|
13104
|
-
const _hoisted_2$
|
|
13129
|
+
const _hoisted_2$t = {
|
|
13105
13130
|
key: 0,
|
|
13106
13131
|
class: "lupa-facets-title"
|
|
13107
13132
|
};
|
|
@@ -13140,7 +13165,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
13140
13165
|
return (_ctx, _cache) => {
|
|
13141
13166
|
var _a;
|
|
13142
13167
|
return openBlock(), createElementBlock("div", _hoisted_1$F, [
|
|
13143
|
-
_ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
13168
|
+
_ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$t, toDisplayString(_ctx.options.labels.title), 1)) : createCommentVNode("", true),
|
|
13144
13169
|
createBaseVNode("div", {
|
|
13145
13170
|
class: normalizeClass(["lupa-search-result-facet-list", "lupa-" + ((_a = _ctx.facetStyle) != null ? _a : "")])
|
|
13146
13171
|
}, [
|
|
@@ -13187,6 +13212,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
13187
13212
|
}
|
|
13188
13213
|
});
|
|
13189
13214
|
const _hoisted_1$D = { class: "lupa-search-result-facets" };
|
|
13215
|
+
const _hoisted_2$s = { class: "lupa-facets-filter-button-wrapper" };
|
|
13190
13216
|
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
13191
13217
|
__name: "Facets",
|
|
13192
13218
|
props: {
|
|
@@ -13281,11 +13307,13 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
13281
13307
|
onSelect: handleFacetSelect,
|
|
13282
13308
|
onClear: clear2
|
|
13283
13309
|
}, null, 8, ["options", "facets", "currentFilters", "facetStyle", "clearable"])) : createCommentVNode("", true),
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
|
|
13310
|
+
createBaseVNode("div", _hoisted_2$s, [
|
|
13311
|
+
showFilterButton.value ? (openBlock(), createBlock(_sfc_main$H, {
|
|
13312
|
+
key: 0,
|
|
13313
|
+
options: _ctx.options,
|
|
13314
|
+
onFilter: filter
|
|
13315
|
+
}, null, 8, ["options"])) : createCommentVNode("", true)
|
|
13316
|
+
])
|
|
13289
13317
|
]);
|
|
13290
13318
|
};
|
|
13291
13319
|
}
|
|
@@ -14305,7 +14333,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
14305
14333
|
item: {},
|
|
14306
14334
|
options: {}
|
|
14307
14335
|
},
|
|
14308
|
-
|
|
14336
|
+
emits: ["productEvent"],
|
|
14337
|
+
setup(__props, { emit: emit2 }) {
|
|
14309
14338
|
const props = __props;
|
|
14310
14339
|
const text = computed(() => {
|
|
14311
14340
|
return props.options.html(props.item);
|
|
@@ -14317,6 +14346,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
14317
14346
|
if (!props.options.action) {
|
|
14318
14347
|
return;
|
|
14319
14348
|
}
|
|
14349
|
+
if (props.options.reportEventOnClick) {
|
|
14350
|
+
emit2("productEvent", { type: props.options.reportEventOnClick });
|
|
14351
|
+
}
|
|
14320
14352
|
yield props.options.action(props.item);
|
|
14321
14353
|
});
|
|
14322
14354
|
return (_ctx, _cache) => {
|
|
@@ -14629,7 +14661,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
14629
14661
|
key: element.key,
|
|
14630
14662
|
labels: labels.value,
|
|
14631
14663
|
inStock: isInStock.value,
|
|
14632
|
-
link: link.value
|
|
14664
|
+
link: link.value,
|
|
14665
|
+
onProductEvent: handleProductEvent
|
|
14633
14666
|
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
14634
14667
|
}), 128)),
|
|
14635
14668
|
createVNode(_sfc_main$$, {
|