@getlupa/vue 0.11.1 → 0.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.js +99 -66
- package/dist/lupaSearch.mjs +99 -66
- package/dist/src/components/search-results/products/product-card/elements/custom/SearchResultsProductCustomHtmlElement.vue.d.ts +4 -2
- package/dist/src/types/DocumentElement.d.ts +1 -0
- package/dist/src/types/search-results/SearchResultsProductCardOptions.d.ts +1 -0
- package/dist/src/utils/filter.utils.d.ts +5 -1
- package/package.json +1 -1
package/dist/lupaSearch.js
CHANGED
|
@@ -2092,7 +2092,7 @@ const DEFAULT_OPTIONS_RESULTS = {
|
|
|
2092
2092
|
top: false,
|
|
2093
2093
|
bottom: true
|
|
2094
2094
|
},
|
|
2095
|
-
sizes: [10, 20, 25
|
|
2095
|
+
sizes: [10, 20, 25]
|
|
2096
2096
|
},
|
|
2097
2097
|
pageSelection: {
|
|
2098
2098
|
position: {
|
|
@@ -2418,38 +2418,39 @@ const unfoldHierarchyFilter = (key, filter) => {
|
|
|
2418
2418
|
const seed = [];
|
|
2419
2419
|
return filter.terms.reduce((a, c2) => [...a, { key, value: c2, type: "hierarchy" }], seed);
|
|
2420
2420
|
};
|
|
2421
|
-
const unfoldRangeFilter = (key, filter) => {
|
|
2421
|
+
const unfoldRangeFilter = (key, filter, price = {}) => {
|
|
2422
|
+
var _a;
|
|
2422
2423
|
const gt = filter.gte || filter.gt;
|
|
2423
2424
|
const lt = filter.lte || filter.lt;
|
|
2424
|
-
if (key.includes(CURRENCY_KEY_INDICATOR)) {
|
|
2425
|
+
if (key.includes(CURRENCY_KEY_INDICATOR) || ((_a = price == null ? void 0 : price.keys) == null ? void 0 : _a.includes(key))) {
|
|
2425
2426
|
return [
|
|
2426
2427
|
{
|
|
2427
2428
|
key,
|
|
2428
|
-
value: formatPriceSummary([gt, lt]),
|
|
2429
|
+
value: formatPriceSummary([gt, lt], price.currency, price.separator),
|
|
2429
2430
|
type: "range"
|
|
2430
2431
|
}
|
|
2431
2432
|
];
|
|
2432
2433
|
}
|
|
2433
2434
|
return [{ key, value: `${gt} - ${lt}`, type: "range" }];
|
|
2434
2435
|
};
|
|
2435
|
-
const unfoldFilter = (key, filter) => {
|
|
2436
|
+
const unfoldFilter = (key, filter, price = {}) => {
|
|
2436
2437
|
if (Array.isArray(filter)) {
|
|
2437
2438
|
return unfoldTermFilter(key, filter);
|
|
2438
2439
|
}
|
|
2439
2440
|
if (filter.gte) {
|
|
2440
|
-
return unfoldRangeFilter(key, filter);
|
|
2441
|
+
return unfoldRangeFilter(key, filter, price);
|
|
2441
2442
|
}
|
|
2442
2443
|
if (filter.terms) {
|
|
2443
2444
|
return unfoldHierarchyFilter(key, filter);
|
|
2444
2445
|
}
|
|
2445
2446
|
return [];
|
|
2446
2447
|
};
|
|
2447
|
-
const unfoldFilters = (filters) => {
|
|
2448
|
+
const unfoldFilters = (filters, price = {}) => {
|
|
2448
2449
|
if (!filters) {
|
|
2449
2450
|
return [];
|
|
2450
2451
|
}
|
|
2451
2452
|
const seed = [];
|
|
2452
|
-
return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2)], seed);
|
|
2453
|
+
return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2, price)], seed);
|
|
2453
2454
|
};
|
|
2454
2455
|
const getLabeledFilters = (filters, facets) => {
|
|
2455
2456
|
return filters.map((f2) => {
|
|
@@ -3222,7 +3223,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
|
|
|
3222
3223
|
};
|
|
3223
3224
|
});
|
|
3224
3225
|
const _hoisted_1$1e = { id: "lupa-search-box-input-container" };
|
|
3225
|
-
const _hoisted_2$
|
|
3226
|
+
const _hoisted_2$Q = { class: "lupa-input-clear" };
|
|
3226
3227
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
3227
3228
|
const _hoisted_4$s = ["value"];
|
|
3228
3229
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
@@ -3312,7 +3313,7 @@ const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
|
|
|
3312
3313
|
__expose({ focus });
|
|
3313
3314
|
return (_ctx, _cache) => {
|
|
3314
3315
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1e, [
|
|
3315
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3316
|
+
vue.createElementVNode("div", _hoisted_2$Q, [
|
|
3316
3317
|
vue.createElementVNode("div", {
|
|
3317
3318
|
class: vue.normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
|
|
3318
3319
|
onClick: clear
|
|
@@ -3386,7 +3387,7 @@ const _sfc_main$1l = /* @__PURE__ */ vue.defineComponent({
|
|
|
3386
3387
|
}
|
|
3387
3388
|
});
|
|
3388
3389
|
const _hoisted_1$1d = { class: "lupa-search-box-history-item" };
|
|
3389
|
-
const _hoisted_2$
|
|
3390
|
+
const _hoisted_2$P = { class: "lupa-search-box-history-item-content" };
|
|
3390
3391
|
const _sfc_main$1k = /* @__PURE__ */ vue.defineComponent({
|
|
3391
3392
|
__name: "SearchBoxHistoryItem",
|
|
3392
3393
|
props: {
|
|
@@ -3404,7 +3405,7 @@ const _sfc_main$1k = /* @__PURE__ */ vue.defineComponent({
|
|
|
3404
3405
|
};
|
|
3405
3406
|
return (_ctx, _cache) => {
|
|
3406
3407
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1d, [
|
|
3407
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3408
|
+
vue.createElementVNode("div", _hoisted_2$P, [
|
|
3408
3409
|
vue.createElementVNode("div", {
|
|
3409
3410
|
class: vue.normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
|
|
3410
3411
|
onClick: click2
|
|
@@ -3494,7 +3495,7 @@ const _sfc_main$1i = /* @__PURE__ */ vue.defineComponent({
|
|
|
3494
3495
|
}
|
|
3495
3496
|
});
|
|
3496
3497
|
const _hoisted_1$1a = ["innerHTML"];
|
|
3497
|
-
const _hoisted_2$
|
|
3498
|
+
const _hoisted_2$O = {
|
|
3498
3499
|
key: 1,
|
|
3499
3500
|
"data-cy": "lupa-suggestion-value",
|
|
3500
3501
|
class: "lupa-suggestion-value"
|
|
@@ -3548,7 +3549,7 @@ const _sfc_main$1h = /* @__PURE__ */ vue.defineComponent({
|
|
|
3548
3549
|
class: "lupa-suggestion-value",
|
|
3549
3550
|
"data-cy": "lupa-suggestion-value",
|
|
3550
3551
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
3551
|
-
}, null, 8, _hoisted_1$1a)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
3552
|
+
}, null, 8, _hoisted_1$1a)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$O, vue.toDisplayString(_ctx.suggestion.display), 1)),
|
|
3552
3553
|
_ctx.suggestion.facet ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$z, [
|
|
3553
3554
|
vue.createElementVNode("span", _hoisted_4$r, vue.toDisplayString(facetLabel.value), 1),
|
|
3554
3555
|
vue.createElementVNode("span", _hoisted_5$g, vue.toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
@@ -3940,7 +3941,7 @@ const _sfc_main$1d = /* @__PURE__ */ vue.defineComponent({
|
|
|
3940
3941
|
}
|
|
3941
3942
|
});
|
|
3942
3943
|
const _hoisted_1$17 = ["innerHTML"];
|
|
3943
|
-
const _hoisted_2$
|
|
3944
|
+
const _hoisted_2$N = {
|
|
3944
3945
|
key: 1,
|
|
3945
3946
|
class: "lupa-search-box-product-title"
|
|
3946
3947
|
};
|
|
@@ -3964,14 +3965,14 @@ const _sfc_main$1c = /* @__PURE__ */ vue.defineComponent({
|
|
|
3964
3965
|
key: 0,
|
|
3965
3966
|
class: "lupa-search-box-product-title",
|
|
3966
3967
|
innerHTML: title.value
|
|
3967
|
-
}, null, 8, _hoisted_1$17)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
3968
|
+
}, null, 8, _hoisted_1$17)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$N, [
|
|
3968
3969
|
vue.createElementVNode("strong", null, vue.toDisplayString(title.value), 1)
|
|
3969
3970
|
]));
|
|
3970
3971
|
};
|
|
3971
3972
|
}
|
|
3972
3973
|
});
|
|
3973
3974
|
const _hoisted_1$16 = ["innerHTML"];
|
|
3974
|
-
const _hoisted_2$
|
|
3975
|
+
const _hoisted_2$M = {
|
|
3975
3976
|
key: 1,
|
|
3976
3977
|
class: "lupa-search-box-product-description"
|
|
3977
3978
|
};
|
|
@@ -3995,7 +3996,7 @@ const _sfc_main$1b = /* @__PURE__ */ vue.defineComponent({
|
|
|
3995
3996
|
key: 0,
|
|
3996
3997
|
class: "lupa-search-box-product-description",
|
|
3997
3998
|
innerHTML: description.value
|
|
3998
|
-
}, null, 8, _hoisted_1$16)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
3999
|
+
}, null, 8, _hoisted_1$16)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$M, vue.toDisplayString(description.value), 1));
|
|
3999
4000
|
};
|
|
4000
4001
|
}
|
|
4001
4002
|
});
|
|
@@ -4048,7 +4049,7 @@ const _sfc_main$19 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4048
4049
|
}
|
|
4049
4050
|
});
|
|
4050
4051
|
const _hoisted_1$13 = ["innerHTML"];
|
|
4051
|
-
const _hoisted_2$
|
|
4052
|
+
const _hoisted_2$L = { key: 0 };
|
|
4052
4053
|
const _hoisted_3$y = { key: 1 };
|
|
4053
4054
|
const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
|
|
4054
4055
|
const _hoisted_5$f = { class: "lupa-search-box-custom-text" };
|
|
@@ -4082,7 +4083,7 @@ const _sfc_main$18 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4082
4083
|
key: 1,
|
|
4083
4084
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
4084
4085
|
}, vue.toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
4085
|
-
!label.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
4086
|
+
!label.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$L, vue.toDisplayString(text.value), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$y, [
|
|
4086
4087
|
vue.createElementVNode("div", _hoisted_4$q, vue.toDisplayString(label.value), 1),
|
|
4087
4088
|
vue.createElementVNode("div", _hoisted_5$f, vue.toDisplayString(text.value), 1)
|
|
4088
4089
|
]))
|
|
@@ -4169,13 +4170,33 @@ const useSearchResultStore = defineStore("searchResult", () => {
|
|
|
4169
4170
|
const isMobileSidebarVisible = vue.ref(false);
|
|
4170
4171
|
const optionsStore = useOptionsStore();
|
|
4171
4172
|
const paramsStore = useParamsStore();
|
|
4173
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
4172
4174
|
const facets = vue.computed(() => searchResult.value.facets);
|
|
4173
4175
|
const filters = vue.computed(() => searchResult.value.filters);
|
|
4174
4176
|
const currentQueryText = vue.computed(() => searchResult.value.searchText);
|
|
4175
4177
|
const totalItems = vue.computed(() => searchResult.value.total);
|
|
4176
4178
|
const hasResults = vue.computed(() => totalItems.value > 0);
|
|
4179
|
+
const priceKeys = vue.computed(() => {
|
|
4180
|
+
var _a, _b;
|
|
4181
|
+
return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
|
|
4182
|
+
});
|
|
4183
|
+
const currency = vue.computed(() => {
|
|
4184
|
+
var _a, _b, _c;
|
|
4185
|
+
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currency) != null ? _c : "";
|
|
4186
|
+
});
|
|
4187
|
+
const priceSeparator = vue.computed(() => {
|
|
4188
|
+
var _a, _b, _c;
|
|
4189
|
+
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.priceSeparator) != null ? _c : "";
|
|
4190
|
+
});
|
|
4177
4191
|
const labeledFilters = vue.computed(
|
|
4178
|
-
() => getLabeledFilters(
|
|
4192
|
+
() => getLabeledFilters(
|
|
4193
|
+
unfoldFilters(filters.value, {
|
|
4194
|
+
keys: priceKeys.value,
|
|
4195
|
+
currency: currency.value,
|
|
4196
|
+
separator: priceSeparator.value
|
|
4197
|
+
}),
|
|
4198
|
+
facets.value
|
|
4199
|
+
)
|
|
4179
4200
|
);
|
|
4180
4201
|
const displayFilters = vue.computed(() => {
|
|
4181
4202
|
var _a, _b;
|
|
@@ -4310,7 +4331,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
|
|
|
4310
4331
|
};
|
|
4311
4332
|
});
|
|
4312
4333
|
const _hoisted_1$11 = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
4313
|
-
const _hoisted_2$
|
|
4334
|
+
const _hoisted_2$K = { class: "lupa-search-box-product-addtocart" };
|
|
4314
4335
|
const _hoisted_3$x = ["onClick", "disabled"];
|
|
4315
4336
|
const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
|
|
4316
4337
|
__name: "SearchBoxProductAddToCart",
|
|
@@ -4340,7 +4361,7 @@ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4340
4361
|
});
|
|
4341
4362
|
return (_ctx, _cache) => {
|
|
4342
4363
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$11, [
|
|
4343
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4364
|
+
vue.createElementVNode("div", _hoisted_2$K, [
|
|
4344
4365
|
vue.createElementVNode("button", {
|
|
4345
4366
|
onClick: vue.withModifiers(handleClick, ["stop", "prevent"]),
|
|
4346
4367
|
class: vue.normalizeClass(loading.value ? "lupa-add-to-cart-loading" : "lupa-add-to-cart"),
|
|
@@ -4442,7 +4463,7 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadV
|
|
|
4442
4463
|
}
|
|
4443
4464
|
}));
|
|
4444
4465
|
const _hoisted_1$$ = { class: "lupa-badge-title" };
|
|
4445
|
-
const _hoisted_2$
|
|
4466
|
+
const _hoisted_2$J = ["src"];
|
|
4446
4467
|
const _hoisted_3$w = { key: 1 };
|
|
4447
4468
|
const _hoisted_4$p = {
|
|
4448
4469
|
key: 0,
|
|
@@ -4485,7 +4506,7 @@ const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4485
4506
|
image.value ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
4486
4507
|
key: 0,
|
|
4487
4508
|
src: image.value
|
|
4488
|
-
}, null, 8, _hoisted_2$
|
|
4509
|
+
}, null, 8, _hoisted_2$J)) : vue.createCommentVNode("", true),
|
|
4489
4510
|
hasTitleText.value && showTitle.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$w, vue.toDisplayString(_ctx.badge.titleText), 1)) : vue.createCommentVNode("", true)
|
|
4490
4511
|
]),
|
|
4491
4512
|
hasAdditionalText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$p, vue.toDisplayString(_ctx.badge.additionalText), 1)) : vue.createCommentVNode("", true)
|
|
@@ -4584,7 +4605,7 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4584
4605
|
}
|
|
4585
4606
|
});
|
|
4586
4607
|
const _hoisted_1$X = { class: "lupa-image-badges" };
|
|
4587
|
-
const _hoisted_2$
|
|
4608
|
+
const _hoisted_2$I = ["src"];
|
|
4588
4609
|
const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
|
|
4589
4610
|
__name: "ImageBadge",
|
|
4590
4611
|
props: {
|
|
@@ -4613,7 +4634,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
|
|
|
4613
4634
|
}, [
|
|
4614
4635
|
vue.createElementVNode("img", {
|
|
4615
4636
|
src: getImageUrl(item)
|
|
4616
|
-
}, null, 8, _hoisted_2$
|
|
4637
|
+
}, null, 8, _hoisted_2$I)
|
|
4617
4638
|
]);
|
|
4618
4639
|
}), 128))
|
|
4619
4640
|
]);
|
|
@@ -4705,7 +4726,7 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
4705
4726
|
}
|
|
4706
4727
|
}));
|
|
4707
4728
|
const _hoisted_1$V = ["href"];
|
|
4708
|
-
const _hoisted_2$
|
|
4729
|
+
const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
|
|
4709
4730
|
const _hoisted_3$v = { class: "lupa-search-box-product-details-section" };
|
|
4710
4731
|
const _hoisted_4$o = {
|
|
4711
4732
|
key: 0,
|
|
@@ -4770,7 +4791,7 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
|
|
|
4770
4791
|
"data-cy": "lupa-search-box-product",
|
|
4771
4792
|
onClick: handleClick
|
|
4772
4793
|
}), [
|
|
4773
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4794
|
+
vue.createElementVNode("div", _hoisted_2$H, [
|
|
4774
4795
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(imageElements.value, (element) => {
|
|
4775
4796
|
return vue.openBlock(), vue.createBlock(_sfc_main$15, {
|
|
4776
4797
|
class: "lupa-search-box-product-element",
|
|
@@ -5129,7 +5150,7 @@ const _hoisted_1$T = {
|
|
|
5129
5150
|
key: 0,
|
|
5130
5151
|
id: "lupa-search-box-panel"
|
|
5131
5152
|
};
|
|
5132
|
-
const _hoisted_2$
|
|
5153
|
+
const _hoisted_2$G = ["data-cy"];
|
|
5133
5154
|
const _hoisted_3$u = {
|
|
5134
5155
|
key: 0,
|
|
5135
5156
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
@@ -5337,7 +5358,7 @@ const _sfc_main$W = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
5337
5358
|
key: "0"
|
|
5338
5359
|
} : void 0
|
|
5339
5360
|
]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : vue.createCommentVNode("", true)
|
|
5340
|
-
], 10, _hoisted_2$
|
|
5361
|
+
], 10, _hoisted_2$G);
|
|
5341
5362
|
}), 128))
|
|
5342
5363
|
], 4),
|
|
5343
5364
|
!vue.unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (vue.openBlock(), vue.createBlock(_sfc_main$1i, {
|
|
@@ -5377,7 +5398,7 @@ const unbindSearchTriggers = (triggers = [], event) => {
|
|
|
5377
5398
|
elements.forEach((e) => e == null ? void 0 : e.removeEventListener(BIND_EVENT, event));
|
|
5378
5399
|
};
|
|
5379
5400
|
const _hoisted_1$S = { id: "lupa-search-box" };
|
|
5380
|
-
const _hoisted_2$
|
|
5401
|
+
const _hoisted_2$F = { class: "lupa-search-box-wrapper" };
|
|
5381
5402
|
const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
|
|
5382
5403
|
__name: "SearchBox",
|
|
5383
5404
|
props: {
|
|
@@ -5624,7 +5645,7 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
|
|
|
5624
5645
|
return (_ctx, _cache) => {
|
|
5625
5646
|
var _a2;
|
|
5626
5647
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$S, [
|
|
5627
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5648
|
+
vue.createElementVNode("div", _hoisted_2$F, [
|
|
5628
5649
|
vue.createVNode(_sfc_main$1m, {
|
|
5629
5650
|
options: inputOptions.value,
|
|
5630
5651
|
suggestedValue: suggestedValue.value,
|
|
@@ -5744,7 +5765,7 @@ const _hoisted_1$R = {
|
|
|
5744
5765
|
key: 0,
|
|
5745
5766
|
id: "lupa-search-results-did-you-mean"
|
|
5746
5767
|
};
|
|
5747
|
-
const _hoisted_2$
|
|
5768
|
+
const _hoisted_2$E = {
|
|
5748
5769
|
key: 0,
|
|
5749
5770
|
"data-cy": "suggested-search-text-label"
|
|
5750
5771
|
};
|
|
@@ -5786,7 +5807,7 @@ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
|
|
|
5786
5807
|
};
|
|
5787
5808
|
return (_ctx, _cache) => {
|
|
5788
5809
|
return vue.unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$R, [
|
|
5789
|
-
vue.unref(searchResult).suggestedSearchText ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
5810
|
+
vue.unref(searchResult).suggestedSearchText ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$E, [
|
|
5790
5811
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.labels.noResultsSuggestion.split(" "), (label, index) => {
|
|
5791
5812
|
return vue.openBlock(), vue.createElementBlock("span", { key: index }, [
|
|
5792
5813
|
vue.createElementVNode("span", {
|
|
@@ -5815,7 +5836,7 @@ const _hoisted_1$Q = {
|
|
|
5815
5836
|
key: 0,
|
|
5816
5837
|
class: "lupa-search-results-summary"
|
|
5817
5838
|
};
|
|
5818
|
-
const _hoisted_2$
|
|
5839
|
+
const _hoisted_2$D = ["innerHTML"];
|
|
5819
5840
|
const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
|
|
5820
5841
|
__name: "SearchResultsSummary",
|
|
5821
5842
|
props: {
|
|
@@ -5832,7 +5853,7 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
|
|
|
5832
5853
|
});
|
|
5833
5854
|
return (_ctx, _cache) => {
|
|
5834
5855
|
return vue.unref(totalItems) > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Q, [
|
|
5835
|
-
vue.createElementVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$
|
|
5856
|
+
vue.createElementVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$D),
|
|
5836
5857
|
_ctx.clearable ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
5837
5858
|
key: 0,
|
|
5838
5859
|
class: "lupa-filter-clear",
|
|
@@ -5848,7 +5869,7 @@ const _hoisted_1$P = {
|
|
|
5848
5869
|
class: "lupa-result-page-title",
|
|
5849
5870
|
"data-cy": "lupa-result-page-title"
|
|
5850
5871
|
};
|
|
5851
|
-
const _hoisted_2$
|
|
5872
|
+
const _hoisted_2$C = { key: 0 };
|
|
5852
5873
|
const _hoisted_3$s = {
|
|
5853
5874
|
key: 1,
|
|
5854
5875
|
class: "lupa-results-total-count"
|
|
@@ -5891,7 +5912,7 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
|
5891
5912
|
return vue.openBlock(), vue.createElementBlock("div", null, [
|
|
5892
5913
|
showSearchTitle.value ? (vue.openBlock(), vue.createElementBlock("h1", _hoisted_1$P, [
|
|
5893
5914
|
vue.createTextVNode(vue.toDisplayString(_ctx.options.labels.searchResults), 1),
|
|
5894
|
-
queryText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$
|
|
5915
|
+
queryText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$C, "'" + vue.toDisplayString(queryText.value) + "'", 1)) : vue.createCommentVNode("", true),
|
|
5895
5916
|
showProductCount.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$s, "(" + vue.toDisplayString(vue.unref(totalItems)) + ")", 1)) : vue.createCommentVNode("", true)
|
|
5896
5917
|
])) : vue.createCommentVNode("", true),
|
|
5897
5918
|
_ctx.showSummary ? (vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
@@ -5908,7 +5929,7 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
|
5908
5929
|
}
|
|
5909
5930
|
});
|
|
5910
5931
|
const _hoisted_1$O = { class: "lupa-search-result-filter-value" };
|
|
5911
|
-
const _hoisted_2$
|
|
5932
|
+
const _hoisted_2$B = {
|
|
5912
5933
|
class: "lupa-current-filter-label",
|
|
5913
5934
|
"data-cy": "lupa-current-filter-label"
|
|
5914
5935
|
};
|
|
@@ -5933,14 +5954,14 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
|
5933
5954
|
class: "lupa-current-filter-action",
|
|
5934
5955
|
onClick: handleClick
|
|
5935
5956
|
}, "⨉"),
|
|
5936
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5957
|
+
vue.createElementVNode("div", _hoisted_2$B, vue.toDisplayString(_ctx.filter.label) + ": ", 1),
|
|
5937
5958
|
vue.createElementVNode("div", _hoisted_3$r, vue.toDisplayString(_ctx.filter.value), 1)
|
|
5938
5959
|
]);
|
|
5939
5960
|
};
|
|
5940
5961
|
}
|
|
5941
5962
|
});
|
|
5942
5963
|
const _hoisted_1$N = { class: "lupa-filter-title-text" };
|
|
5943
|
-
const _hoisted_2$
|
|
5964
|
+
const _hoisted_2$A = {
|
|
5944
5965
|
key: 0,
|
|
5945
5966
|
class: "lupa-filter-count"
|
|
5946
5967
|
};
|
|
@@ -6012,7 +6033,7 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
|
|
|
6012
6033
|
}, [
|
|
6013
6034
|
vue.createElementVNode("div", _hoisted_1$N, [
|
|
6014
6035
|
vue.createTextVNode(vue.toDisplayString((_c = (_b = (_a = _ctx.options) == null ? void 0 : _a.labels) == null ? void 0 : _b.title) != null ? _c : "") + " ", 1),
|
|
6015
|
-
_ctx.expandable ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$
|
|
6036
|
+
_ctx.expandable ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$A, " (" + vue.toDisplayString(vue.unref(currentFilterCount)) + ") ", 1)) : vue.createCommentVNode("", true)
|
|
6016
6037
|
]),
|
|
6017
6038
|
_ctx.expandable ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
6018
6039
|
key: 0,
|
|
@@ -6086,7 +6107,7 @@ const _hoisted_1$L = {
|
|
|
6086
6107
|
class: "lupa-category-filter",
|
|
6087
6108
|
"data-cy": "lupa-category-filter"
|
|
6088
6109
|
};
|
|
6089
|
-
const _hoisted_2$
|
|
6110
|
+
const _hoisted_2$z = { class: "lupa-category-back" };
|
|
6090
6111
|
const _hoisted_3$p = ["href"];
|
|
6091
6112
|
const _hoisted_4$j = ["href"];
|
|
6092
6113
|
const _hoisted_5$d = { class: "lupa-child-category-list" };
|
|
@@ -6177,7 +6198,7 @@ const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
|
|
|
6177
6198
|
__expose({ fetch: fetch2 });
|
|
6178
6199
|
return (_ctx, _cache) => {
|
|
6179
6200
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$L, [
|
|
6180
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
6201
|
+
vue.createElementVNode("div", _hoisted_2$z, [
|
|
6181
6202
|
hasBackButton.value ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
6182
6203
|
key: 0,
|
|
6183
6204
|
"data-cy": "lupa-category-back",
|
|
@@ -6212,7 +6233,7 @@ const _hoisted_1$K = {
|
|
|
6212
6233
|
class: "lupa-search-result-facet-term-values",
|
|
6213
6234
|
"data-cy": "lupa-search-result-facet-term-values"
|
|
6214
6235
|
};
|
|
6215
|
-
const _hoisted_2$
|
|
6236
|
+
const _hoisted_2$y = ["placeholder"];
|
|
6216
6237
|
const _hoisted_3$o = { class: "lupa-terms-list" };
|
|
6217
6238
|
const _hoisted_4$i = ["onClick"];
|
|
6218
6239
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
@@ -6300,7 +6321,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
6300
6321
|
"data-cy": "lupa-term-filter",
|
|
6301
6322
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
|
|
6302
6323
|
placeholder: _ctx.options.labels.facetFilter
|
|
6303
|
-
}, null, 8, _hoisted_2$
|
|
6324
|
+
}, null, 8, _hoisted_2$y)), [
|
|
6304
6325
|
[vue.vModelText, termFilter.value]
|
|
6305
6326
|
]) : vue.createCommentVNode("", true),
|
|
6306
6327
|
vue.createElementVNode("div", _hoisted_3$o, [
|
|
@@ -7312,7 +7333,7 @@ m.render = function(e, t, r, i, n, o) {
|
|
|
7312
7333
|
return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps(e.sliderProps, { ref: "slider" }), null, 16);
|
|
7313
7334
|
}, m.__file = "src/Slider.vue";
|
|
7314
7335
|
const _hoisted_1$J = { class: "lupa-search-result-facet-stats-values" };
|
|
7315
|
-
const _hoisted_2$
|
|
7336
|
+
const _hoisted_2$x = {
|
|
7316
7337
|
key: 0,
|
|
7317
7338
|
class: "lupa-stats-facet-summary"
|
|
7318
7339
|
};
|
|
@@ -7372,6 +7393,10 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
7372
7393
|
var _a;
|
|
7373
7394
|
return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currency;
|
|
7374
7395
|
});
|
|
7396
|
+
const priceKeys = vue.computed(() => {
|
|
7397
|
+
var _a, _b;
|
|
7398
|
+
return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
|
|
7399
|
+
});
|
|
7375
7400
|
const isSliderVisible = vue.computed(() => {
|
|
7376
7401
|
var _a, _b;
|
|
7377
7402
|
return Boolean((_b = (_a = props.options.stats) == null ? void 0 : _a.slider) != null ? _b : true);
|
|
@@ -7435,8 +7460,8 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
7435
7460
|
}
|
|
7436
7461
|
});
|
|
7437
7462
|
const isPrice = vue.computed(() => {
|
|
7438
|
-
var _a;
|
|
7439
|
-
return (_a = facetValue.value.key) == null ? void 0 :
|
|
7463
|
+
var _a, _b, _c;
|
|
7464
|
+
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));
|
|
7440
7465
|
});
|
|
7441
7466
|
const facetMin = vue.computed(() => {
|
|
7442
7467
|
return Math.floor(facetValue.value.min);
|
|
@@ -7509,7 +7534,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
7509
7534
|
};
|
|
7510
7535
|
return (_ctx, _cache) => {
|
|
7511
7536
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$J, [
|
|
7512
|
-
!isInputVisible.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
7537
|
+
!isInputVisible.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$x, vue.toDisplayString(statsSummary.value), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$n, [
|
|
7513
7538
|
vue.createElementVNode("div", null, [
|
|
7514
7539
|
rangeLabelFrom.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$h, vue.toDisplayString(rangeLabelFrom.value), 1)) : vue.createCommentVNode("", true),
|
|
7515
7540
|
vue.createElementVNode("div", _hoisted_5$b, [
|
|
@@ -7576,7 +7601,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
7576
7601
|
}
|
|
7577
7602
|
});
|
|
7578
7603
|
const _hoisted_1$I = { class: "lupa-term-checkbox-wrapper" };
|
|
7579
|
-
const _hoisted_2$
|
|
7604
|
+
const _hoisted_2$w = { class: "lupa-term-checkbox-label" };
|
|
7580
7605
|
const _hoisted_3$m = { class: "lupa-term-label" };
|
|
7581
7606
|
const _hoisted_4$g = {
|
|
7582
7607
|
key: 0,
|
|
@@ -7637,7 +7662,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
|
7637
7662
|
class: vue.normalizeClass(["lupa-term-checkbox", { checked: isChecked.value }])
|
|
7638
7663
|
}, null, 2)
|
|
7639
7664
|
]),
|
|
7640
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
7665
|
+
vue.createElementVNode("div", _hoisted_2$w, [
|
|
7641
7666
|
vue.createElementVNode("span", _hoisted_3$m, vue.toDisplayString(_ctx.item.title) + vue.toDisplayString(" "), 1),
|
|
7642
7667
|
_ctx.options.showDocumentCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$g, "(" + vue.toDisplayString(_ctx.item.count) + ")", 1)) : vue.createCommentVNode("", true)
|
|
7643
7668
|
])
|
|
@@ -7662,7 +7687,7 @@ const _hoisted_1$H = {
|
|
|
7662
7687
|
class: "lupa-search-result-facet-term-values lupa-search-result-facet-hierarchy-values",
|
|
7663
7688
|
"data-cy": "lupa-search-result-facet-term-values"
|
|
7664
7689
|
};
|
|
7665
|
-
const _hoisted_2$
|
|
7690
|
+
const _hoisted_2$v = { key: 0 };
|
|
7666
7691
|
const _hoisted_3$l = ["placeholder"];
|
|
7667
7692
|
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
7668
7693
|
__name: "HierarchyFacet",
|
|
@@ -7715,7 +7740,7 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
|
7715
7740
|
};
|
|
7716
7741
|
return (_ctx, _cache) => {
|
|
7717
7742
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$H, [
|
|
7718
|
-
isFilterable.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
7743
|
+
isFilterable.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$v, [
|
|
7719
7744
|
vue.withDirectives(vue.createElementVNode("input", {
|
|
7720
7745
|
class: "lupa-term-filter",
|
|
7721
7746
|
"data-cy": "lupa-term-filter",
|
|
@@ -7747,7 +7772,7 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
|
7747
7772
|
}
|
|
7748
7773
|
});
|
|
7749
7774
|
const _hoisted_1$G = { class: "lupa-facet-label-text" };
|
|
7750
|
-
const _hoisted_2$
|
|
7775
|
+
const _hoisted_2$u = {
|
|
7751
7776
|
key: 0,
|
|
7752
7777
|
class: "lupa-facet-content",
|
|
7753
7778
|
"data-cy": "lupa-facet-content"
|
|
@@ -7876,7 +7901,7 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
7876
7901
|
class: vue.normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
|
|
7877
7902
|
}, null, 2)
|
|
7878
7903
|
], 2),
|
|
7879
|
-
isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
7904
|
+
isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$u, [
|
|
7880
7905
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(facetType.value), {
|
|
7881
7906
|
facet: facet.value,
|
|
7882
7907
|
currentFilters: currentFilters.value[facet.value.key],
|
|
@@ -7895,7 +7920,7 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
|
|
|
7895
7920
|
}
|
|
7896
7921
|
}));
|
|
7897
7922
|
const _hoisted_1$F = { class: "lupa-search-result-facet-section" };
|
|
7898
|
-
const _hoisted_2$
|
|
7923
|
+
const _hoisted_2$t = {
|
|
7899
7924
|
key: 0,
|
|
7900
7925
|
class: "lupa-facets-title"
|
|
7901
7926
|
};
|
|
@@ -7934,7 +7959,7 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
|
7934
7959
|
return (_ctx, _cache) => {
|
|
7935
7960
|
var _a;
|
|
7936
7961
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$F, [
|
|
7937
|
-
_ctx.options.labels.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
7962
|
+
_ctx.options.labels.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$t, vue.toDisplayString(_ctx.options.labels.title), 1)) : vue.createCommentVNode("", true),
|
|
7938
7963
|
vue.createElementVNode("div", {
|
|
7939
7964
|
class: vue.normalizeClass(["lupa-search-result-facet-list", "lupa-" + ((_a = _ctx.facetStyle) != null ? _a : "")])
|
|
7940
7965
|
}, [
|
|
@@ -7981,6 +8006,7 @@ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
|
7981
8006
|
}
|
|
7982
8007
|
});
|
|
7983
8008
|
const _hoisted_1$D = { class: "lupa-search-result-facets" };
|
|
8009
|
+
const _hoisted_2$s = { class: "lupa-facets-filter-button-wrapper" };
|
|
7984
8010
|
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
7985
8011
|
__name: "Facets",
|
|
7986
8012
|
props: {
|
|
@@ -8075,11 +8101,13 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
|
8075
8101
|
onSelect: handleFacetSelect,
|
|
8076
8102
|
onClear: clear
|
|
8077
8103
|
}, null, 8, ["options", "facets", "currentFilters", "facetStyle", "clearable"])) : vue.createCommentVNode("", true),
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8104
|
+
vue.createElementVNode("div", _hoisted_2$s, [
|
|
8105
|
+
showFilterButton.value ? (vue.openBlock(), vue.createBlock(_sfc_main$H, {
|
|
8106
|
+
key: 0,
|
|
8107
|
+
options: _ctx.options,
|
|
8108
|
+
onFilter: filter
|
|
8109
|
+
}, null, 8, ["options"])) : vue.createCommentVNode("", true)
|
|
8110
|
+
])
|
|
8083
8111
|
]);
|
|
8084
8112
|
};
|
|
8085
8113
|
}
|
|
@@ -9099,7 +9127,8 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
9099
9127
|
item: {},
|
|
9100
9128
|
options: {}
|
|
9101
9129
|
},
|
|
9102
|
-
|
|
9130
|
+
emits: ["productEvent"],
|
|
9131
|
+
setup(__props, { emit }) {
|
|
9103
9132
|
const props = __props;
|
|
9104
9133
|
const text = vue.computed(() => {
|
|
9105
9134
|
return props.options.html(props.item);
|
|
@@ -9111,6 +9140,9 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
9111
9140
|
if (!props.options.action) {
|
|
9112
9141
|
return;
|
|
9113
9142
|
}
|
|
9143
|
+
if (props.options.reportEventOnClick) {
|
|
9144
|
+
emit("productEvent", { type: props.options.reportEventOnClick });
|
|
9145
|
+
}
|
|
9114
9146
|
yield props.options.action(props.item);
|
|
9115
9147
|
});
|
|
9116
9148
|
return (_ctx, _cache) => {
|
|
@@ -9423,7 +9455,8 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
9423
9455
|
key: element.key,
|
|
9424
9456
|
labels: labels.value,
|
|
9425
9457
|
inStock: isInStock.value,
|
|
9426
|
-
link: link.value
|
|
9458
|
+
link: link.value,
|
|
9459
|
+
onProductEvent: handleProductEvent
|
|
9427
9460
|
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
9428
9461
|
}), 128)),
|
|
9429
9462
|
vue.createVNode(_sfc_main$$, {
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -2090,7 +2090,7 @@ const DEFAULT_OPTIONS_RESULTS = {
|
|
|
2090
2090
|
top: false,
|
|
2091
2091
|
bottom: true
|
|
2092
2092
|
},
|
|
2093
|
-
sizes: [10, 20, 25
|
|
2093
|
+
sizes: [10, 20, 25]
|
|
2094
2094
|
},
|
|
2095
2095
|
pageSelection: {
|
|
2096
2096
|
position: {
|
|
@@ -2416,38 +2416,39 @@ const unfoldHierarchyFilter = (key, filter) => {
|
|
|
2416
2416
|
const seed = [];
|
|
2417
2417
|
return filter.terms.reduce((a, c2) => [...a, { key, value: c2, type: "hierarchy" }], seed);
|
|
2418
2418
|
};
|
|
2419
|
-
const unfoldRangeFilter = (key, filter) => {
|
|
2419
|
+
const unfoldRangeFilter = (key, filter, price = {}) => {
|
|
2420
|
+
var _a;
|
|
2420
2421
|
const gt = filter.gte || filter.gt;
|
|
2421
2422
|
const lt = filter.lte || filter.lt;
|
|
2422
|
-
if (key.includes(CURRENCY_KEY_INDICATOR)) {
|
|
2423
|
+
if (key.includes(CURRENCY_KEY_INDICATOR) || ((_a = price == null ? void 0 : price.keys) == null ? void 0 : _a.includes(key))) {
|
|
2423
2424
|
return [
|
|
2424
2425
|
{
|
|
2425
2426
|
key,
|
|
2426
|
-
value: formatPriceSummary([gt, lt]),
|
|
2427
|
+
value: formatPriceSummary([gt, lt], price.currency, price.separator),
|
|
2427
2428
|
type: "range"
|
|
2428
2429
|
}
|
|
2429
2430
|
];
|
|
2430
2431
|
}
|
|
2431
2432
|
return [{ key, value: `${gt} - ${lt}`, type: "range" }];
|
|
2432
2433
|
};
|
|
2433
|
-
const unfoldFilter = (key, filter) => {
|
|
2434
|
+
const unfoldFilter = (key, filter, price = {}) => {
|
|
2434
2435
|
if (Array.isArray(filter)) {
|
|
2435
2436
|
return unfoldTermFilter(key, filter);
|
|
2436
2437
|
}
|
|
2437
2438
|
if (filter.gte) {
|
|
2438
|
-
return unfoldRangeFilter(key, filter);
|
|
2439
|
+
return unfoldRangeFilter(key, filter, price);
|
|
2439
2440
|
}
|
|
2440
2441
|
if (filter.terms) {
|
|
2441
2442
|
return unfoldHierarchyFilter(key, filter);
|
|
2442
2443
|
}
|
|
2443
2444
|
return [];
|
|
2444
2445
|
};
|
|
2445
|
-
const unfoldFilters = (filters) => {
|
|
2446
|
+
const unfoldFilters = (filters, price = {}) => {
|
|
2446
2447
|
if (!filters) {
|
|
2447
2448
|
return [];
|
|
2448
2449
|
}
|
|
2449
2450
|
const seed = [];
|
|
2450
|
-
return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2)], seed);
|
|
2451
|
+
return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2, price)], seed);
|
|
2451
2452
|
};
|
|
2452
2453
|
const getLabeledFilters = (filters, facets) => {
|
|
2453
2454
|
return filters.map((f2) => {
|
|
@@ -3220,7 +3221,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
|
|
|
3220
3221
|
};
|
|
3221
3222
|
});
|
|
3222
3223
|
const _hoisted_1$1e = { id: "lupa-search-box-input-container" };
|
|
3223
|
-
const _hoisted_2$
|
|
3224
|
+
const _hoisted_2$Q = { class: "lupa-input-clear" };
|
|
3224
3225
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
3225
3226
|
const _hoisted_4$s = ["value"];
|
|
3226
3227
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
@@ -3310,7 +3311,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
3310
3311
|
__expose({ focus });
|
|
3311
3312
|
return (_ctx, _cache) => {
|
|
3312
3313
|
return openBlock(), createElementBlock("div", _hoisted_1$1e, [
|
|
3313
|
-
createElementVNode("div", _hoisted_2$
|
|
3314
|
+
createElementVNode("div", _hoisted_2$Q, [
|
|
3314
3315
|
createElementVNode("div", {
|
|
3315
3316
|
class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
|
|
3316
3317
|
onClick: clear
|
|
@@ -3384,7 +3385,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
3384
3385
|
}
|
|
3385
3386
|
});
|
|
3386
3387
|
const _hoisted_1$1d = { class: "lupa-search-box-history-item" };
|
|
3387
|
-
const _hoisted_2$
|
|
3388
|
+
const _hoisted_2$P = { class: "lupa-search-box-history-item-content" };
|
|
3388
3389
|
const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
3389
3390
|
__name: "SearchBoxHistoryItem",
|
|
3390
3391
|
props: {
|
|
@@ -3402,7 +3403,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3402
3403
|
};
|
|
3403
3404
|
return (_ctx, _cache) => {
|
|
3404
3405
|
return openBlock(), createElementBlock("div", _hoisted_1$1d, [
|
|
3405
|
-
createElementVNode("div", _hoisted_2$
|
|
3406
|
+
createElementVNode("div", _hoisted_2$P, [
|
|
3406
3407
|
createElementVNode("div", {
|
|
3407
3408
|
class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
|
|
3408
3409
|
onClick: click2
|
|
@@ -3492,7 +3493,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
3492
3493
|
}
|
|
3493
3494
|
});
|
|
3494
3495
|
const _hoisted_1$1a = ["innerHTML"];
|
|
3495
|
-
const _hoisted_2$
|
|
3496
|
+
const _hoisted_2$O = {
|
|
3496
3497
|
key: 1,
|
|
3497
3498
|
"data-cy": "lupa-suggestion-value",
|
|
3498
3499
|
class: "lupa-suggestion-value"
|
|
@@ -3546,7 +3547,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
|
3546
3547
|
class: "lupa-suggestion-value",
|
|
3547
3548
|
"data-cy": "lupa-suggestion-value",
|
|
3548
3549
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
3549
|
-
}, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
3550
|
+
}, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$O, toDisplayString(_ctx.suggestion.display), 1)),
|
|
3550
3551
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
|
|
3551
3552
|
createElementVNode("span", _hoisted_4$r, toDisplayString(facetLabel.value), 1),
|
|
3552
3553
|
createElementVNode("span", _hoisted_5$g, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
@@ -3938,7 +3939,7 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
|
3938
3939
|
}
|
|
3939
3940
|
});
|
|
3940
3941
|
const _hoisted_1$17 = ["innerHTML"];
|
|
3941
|
-
const _hoisted_2$
|
|
3942
|
+
const _hoisted_2$N = {
|
|
3942
3943
|
key: 1,
|
|
3943
3944
|
class: "lupa-search-box-product-title"
|
|
3944
3945
|
};
|
|
@@ -3962,14 +3963,14 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
3962
3963
|
key: 0,
|
|
3963
3964
|
class: "lupa-search-box-product-title",
|
|
3964
3965
|
innerHTML: title.value
|
|
3965
|
-
}, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
3966
|
+
}, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$N, [
|
|
3966
3967
|
createElementVNode("strong", null, toDisplayString(title.value), 1)
|
|
3967
3968
|
]));
|
|
3968
3969
|
};
|
|
3969
3970
|
}
|
|
3970
3971
|
});
|
|
3971
3972
|
const _hoisted_1$16 = ["innerHTML"];
|
|
3972
|
-
const _hoisted_2$
|
|
3973
|
+
const _hoisted_2$M = {
|
|
3973
3974
|
key: 1,
|
|
3974
3975
|
class: "lupa-search-box-product-description"
|
|
3975
3976
|
};
|
|
@@ -3993,7 +3994,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
3993
3994
|
key: 0,
|
|
3994
3995
|
class: "lupa-search-box-product-description",
|
|
3995
3996
|
innerHTML: description.value
|
|
3996
|
-
}, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
3997
|
+
}, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$M, toDisplayString(description.value), 1));
|
|
3997
3998
|
};
|
|
3998
3999
|
}
|
|
3999
4000
|
});
|
|
@@ -4046,7 +4047,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
4046
4047
|
}
|
|
4047
4048
|
});
|
|
4048
4049
|
const _hoisted_1$13 = ["innerHTML"];
|
|
4049
|
-
const _hoisted_2$
|
|
4050
|
+
const _hoisted_2$L = { key: 0 };
|
|
4050
4051
|
const _hoisted_3$y = { key: 1 };
|
|
4051
4052
|
const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
|
|
4052
4053
|
const _hoisted_5$f = { class: "lupa-search-box-custom-text" };
|
|
@@ -4080,7 +4081,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
4080
4081
|
key: 1,
|
|
4081
4082
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
4082
4083
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
4083
|
-
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
4084
|
+
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$L, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
|
|
4084
4085
|
createElementVNode("div", _hoisted_4$q, toDisplayString(label.value), 1),
|
|
4085
4086
|
createElementVNode("div", _hoisted_5$f, toDisplayString(text.value), 1)
|
|
4086
4087
|
]))
|
|
@@ -4167,13 +4168,33 @@ const useSearchResultStore = defineStore("searchResult", () => {
|
|
|
4167
4168
|
const isMobileSidebarVisible = ref(false);
|
|
4168
4169
|
const optionsStore = useOptionsStore();
|
|
4169
4170
|
const paramsStore = useParamsStore();
|
|
4171
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
4170
4172
|
const facets = computed(() => searchResult.value.facets);
|
|
4171
4173
|
const filters = computed(() => searchResult.value.filters);
|
|
4172
4174
|
const currentQueryText = computed(() => searchResult.value.searchText);
|
|
4173
4175
|
const totalItems = computed(() => searchResult.value.total);
|
|
4174
4176
|
const hasResults = computed(() => totalItems.value > 0);
|
|
4177
|
+
const priceKeys = computed(() => {
|
|
4178
|
+
var _a, _b;
|
|
4179
|
+
return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
|
|
4180
|
+
});
|
|
4181
|
+
const currency = computed(() => {
|
|
4182
|
+
var _a, _b, _c;
|
|
4183
|
+
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currency) != null ? _c : "";
|
|
4184
|
+
});
|
|
4185
|
+
const priceSeparator = computed(() => {
|
|
4186
|
+
var _a, _b, _c;
|
|
4187
|
+
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.priceSeparator) != null ? _c : "";
|
|
4188
|
+
});
|
|
4175
4189
|
const labeledFilters = computed(
|
|
4176
|
-
() => getLabeledFilters(
|
|
4190
|
+
() => getLabeledFilters(
|
|
4191
|
+
unfoldFilters(filters.value, {
|
|
4192
|
+
keys: priceKeys.value,
|
|
4193
|
+
currency: currency.value,
|
|
4194
|
+
separator: priceSeparator.value
|
|
4195
|
+
}),
|
|
4196
|
+
facets.value
|
|
4197
|
+
)
|
|
4177
4198
|
);
|
|
4178
4199
|
const displayFilters = computed(() => {
|
|
4179
4200
|
var _a, _b;
|
|
@@ -4308,7 +4329,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
|
|
|
4308
4329
|
};
|
|
4309
4330
|
});
|
|
4310
4331
|
const _hoisted_1$11 = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
4311
|
-
const _hoisted_2$
|
|
4332
|
+
const _hoisted_2$K = { class: "lupa-search-box-product-addtocart" };
|
|
4312
4333
|
const _hoisted_3$x = ["onClick", "disabled"];
|
|
4313
4334
|
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
4314
4335
|
__name: "SearchBoxProductAddToCart",
|
|
@@ -4338,7 +4359,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
4338
4359
|
});
|
|
4339
4360
|
return (_ctx, _cache) => {
|
|
4340
4361
|
return openBlock(), createElementBlock("div", _hoisted_1$11, [
|
|
4341
|
-
createElementVNode("div", _hoisted_2$
|
|
4362
|
+
createElementVNode("div", _hoisted_2$K, [
|
|
4342
4363
|
createElementVNode("button", {
|
|
4343
4364
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
4344
4365
|
class: normalizeClass(loading.value ? "lupa-add-to-cart-loading" : "lupa-add-to-cart"),
|
|
@@ -4440,7 +4461,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValue
|
|
|
4440
4461
|
}
|
|
4441
4462
|
}));
|
|
4442
4463
|
const _hoisted_1$$ = { class: "lupa-badge-title" };
|
|
4443
|
-
const _hoisted_2$
|
|
4464
|
+
const _hoisted_2$J = ["src"];
|
|
4444
4465
|
const _hoisted_3$w = { key: 1 };
|
|
4445
4466
|
const _hoisted_4$p = {
|
|
4446
4467
|
key: 0,
|
|
@@ -4483,7 +4504,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
4483
4504
|
image.value ? (openBlock(), createElementBlock("img", {
|
|
4484
4505
|
key: 0,
|
|
4485
4506
|
src: image.value
|
|
4486
|
-
}, null, 8, _hoisted_2$
|
|
4507
|
+
}, null, 8, _hoisted_2$J)) : createCommentVNode("", true),
|
|
4487
4508
|
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$w, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
4488
4509
|
]),
|
|
4489
4510
|
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$p, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
@@ -4582,7 +4603,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
4582
4603
|
}
|
|
4583
4604
|
});
|
|
4584
4605
|
const _hoisted_1$X = { class: "lupa-image-badges" };
|
|
4585
|
-
const _hoisted_2$
|
|
4606
|
+
const _hoisted_2$I = ["src"];
|
|
4586
4607
|
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
4587
4608
|
__name: "ImageBadge",
|
|
4588
4609
|
props: {
|
|
@@ -4611,7 +4632,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
4611
4632
|
}, [
|
|
4612
4633
|
createElementVNode("img", {
|
|
4613
4634
|
src: getImageUrl(item)
|
|
4614
|
-
}, null, 8, _hoisted_2$
|
|
4635
|
+
}, null, 8, _hoisted_2$I)
|
|
4615
4636
|
]);
|
|
4616
4637
|
}), 128))
|
|
4617
4638
|
]);
|
|
@@ -4703,7 +4724,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
4703
4724
|
}
|
|
4704
4725
|
}));
|
|
4705
4726
|
const _hoisted_1$V = ["href"];
|
|
4706
|
-
const _hoisted_2$
|
|
4727
|
+
const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
|
|
4707
4728
|
const _hoisted_3$v = { class: "lupa-search-box-product-details-section" };
|
|
4708
4729
|
const _hoisted_4$o = {
|
|
4709
4730
|
key: 0,
|
|
@@ -4768,7 +4789,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
|
|
|
4768
4789
|
"data-cy": "lupa-search-box-product",
|
|
4769
4790
|
onClick: handleClick
|
|
4770
4791
|
}), [
|
|
4771
|
-
createElementVNode("div", _hoisted_2$
|
|
4792
|
+
createElementVNode("div", _hoisted_2$H, [
|
|
4772
4793
|
(openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
|
|
4773
4794
|
return openBlock(), createBlock(_sfc_main$15, {
|
|
4774
4795
|
class: "lupa-search-box-product-element",
|
|
@@ -5127,7 +5148,7 @@ const _hoisted_1$T = {
|
|
|
5127
5148
|
key: 0,
|
|
5128
5149
|
id: "lupa-search-box-panel"
|
|
5129
5150
|
};
|
|
5130
|
-
const _hoisted_2$
|
|
5151
|
+
const _hoisted_2$G = ["data-cy"];
|
|
5131
5152
|
const _hoisted_3$u = {
|
|
5132
5153
|
key: 0,
|
|
5133
5154
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
@@ -5335,7 +5356,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
5335
5356
|
key: "0"
|
|
5336
5357
|
} : void 0
|
|
5337
5358
|
]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
5338
|
-
], 10, _hoisted_2$
|
|
5359
|
+
], 10, _hoisted_2$G);
|
|
5339
5360
|
}), 128))
|
|
5340
5361
|
], 4),
|
|
5341
5362
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1i, {
|
|
@@ -5375,7 +5396,7 @@ const unbindSearchTriggers = (triggers = [], event) => {
|
|
|
5375
5396
|
elements.forEach((e) => e == null ? void 0 : e.removeEventListener(BIND_EVENT, event));
|
|
5376
5397
|
};
|
|
5377
5398
|
const _hoisted_1$S = { id: "lupa-search-box" };
|
|
5378
|
-
const _hoisted_2$
|
|
5399
|
+
const _hoisted_2$F = { class: "lupa-search-box-wrapper" };
|
|
5379
5400
|
const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
5380
5401
|
__name: "SearchBox",
|
|
5381
5402
|
props: {
|
|
@@ -5622,7 +5643,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
5622
5643
|
return (_ctx, _cache) => {
|
|
5623
5644
|
var _a2;
|
|
5624
5645
|
return openBlock(), createElementBlock("div", _hoisted_1$S, [
|
|
5625
|
-
createElementVNode("div", _hoisted_2$
|
|
5646
|
+
createElementVNode("div", _hoisted_2$F, [
|
|
5626
5647
|
createVNode(_sfc_main$1m, {
|
|
5627
5648
|
options: inputOptions.value,
|
|
5628
5649
|
suggestedValue: suggestedValue.value,
|
|
@@ -5742,7 +5763,7 @@ const _hoisted_1$R = {
|
|
|
5742
5763
|
key: 0,
|
|
5743
5764
|
id: "lupa-search-results-did-you-mean"
|
|
5744
5765
|
};
|
|
5745
|
-
const _hoisted_2$
|
|
5766
|
+
const _hoisted_2$E = {
|
|
5746
5767
|
key: 0,
|
|
5747
5768
|
"data-cy": "suggested-search-text-label"
|
|
5748
5769
|
};
|
|
@@ -5784,7 +5805,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
5784
5805
|
};
|
|
5785
5806
|
return (_ctx, _cache) => {
|
|
5786
5807
|
return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$R, [
|
|
5787
|
-
unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
5808
|
+
unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$E, [
|
|
5788
5809
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.noResultsSuggestion.split(" "), (label, index) => {
|
|
5789
5810
|
return openBlock(), createElementBlock("span", { key: index }, [
|
|
5790
5811
|
createElementVNode("span", {
|
|
@@ -5813,7 +5834,7 @@ const _hoisted_1$Q = {
|
|
|
5813
5834
|
key: 0,
|
|
5814
5835
|
class: "lupa-search-results-summary"
|
|
5815
5836
|
};
|
|
5816
|
-
const _hoisted_2$
|
|
5837
|
+
const _hoisted_2$D = ["innerHTML"];
|
|
5817
5838
|
const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
5818
5839
|
__name: "SearchResultsSummary",
|
|
5819
5840
|
props: {
|
|
@@ -5830,7 +5851,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
5830
5851
|
});
|
|
5831
5852
|
return (_ctx, _cache) => {
|
|
5832
5853
|
return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
|
|
5833
|
-
createElementVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$
|
|
5854
|
+
createElementVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$D),
|
|
5834
5855
|
_ctx.clearable ? (openBlock(), createElementBlock("span", {
|
|
5835
5856
|
key: 0,
|
|
5836
5857
|
class: "lupa-filter-clear",
|
|
@@ -5846,7 +5867,7 @@ const _hoisted_1$P = {
|
|
|
5846
5867
|
class: "lupa-result-page-title",
|
|
5847
5868
|
"data-cy": "lupa-result-page-title"
|
|
5848
5869
|
};
|
|
5849
|
-
const _hoisted_2$
|
|
5870
|
+
const _hoisted_2$C = { key: 0 };
|
|
5850
5871
|
const _hoisted_3$s = {
|
|
5851
5872
|
key: 1,
|
|
5852
5873
|
class: "lupa-results-total-count"
|
|
@@ -5889,7 +5910,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
5889
5910
|
return openBlock(), createElementBlock("div", null, [
|
|
5890
5911
|
showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$P, [
|
|
5891
5912
|
createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
|
|
5892
|
-
queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
5913
|
+
queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$C, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
|
|
5893
5914
|
showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$s, "(" + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
|
|
5894
5915
|
])) : createCommentVNode("", true),
|
|
5895
5916
|
_ctx.showSummary ? (openBlock(), createBlock(_sfc_main$T, {
|
|
@@ -5906,7 +5927,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
5906
5927
|
}
|
|
5907
5928
|
});
|
|
5908
5929
|
const _hoisted_1$O = { class: "lupa-search-result-filter-value" };
|
|
5909
|
-
const _hoisted_2$
|
|
5930
|
+
const _hoisted_2$B = {
|
|
5910
5931
|
class: "lupa-current-filter-label",
|
|
5911
5932
|
"data-cy": "lupa-current-filter-label"
|
|
5912
5933
|
};
|
|
@@ -5931,14 +5952,14 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
5931
5952
|
class: "lupa-current-filter-action",
|
|
5932
5953
|
onClick: handleClick
|
|
5933
5954
|
}, "⨉"),
|
|
5934
|
-
createElementVNode("div", _hoisted_2$
|
|
5955
|
+
createElementVNode("div", _hoisted_2$B, toDisplayString(_ctx.filter.label) + ": ", 1),
|
|
5935
5956
|
createElementVNode("div", _hoisted_3$r, toDisplayString(_ctx.filter.value), 1)
|
|
5936
5957
|
]);
|
|
5937
5958
|
};
|
|
5938
5959
|
}
|
|
5939
5960
|
});
|
|
5940
5961
|
const _hoisted_1$N = { class: "lupa-filter-title-text" };
|
|
5941
|
-
const _hoisted_2$
|
|
5962
|
+
const _hoisted_2$A = {
|
|
5942
5963
|
key: 0,
|
|
5943
5964
|
class: "lupa-filter-count"
|
|
5944
5965
|
};
|
|
@@ -6010,7 +6031,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
6010
6031
|
}, [
|
|
6011
6032
|
createElementVNode("div", _hoisted_1$N, [
|
|
6012
6033
|
createTextVNode(toDisplayString((_c = (_b = (_a = _ctx.options) == null ? void 0 : _a.labels) == null ? void 0 : _b.title) != null ? _c : "") + " ", 1),
|
|
6013
|
-
_ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
6034
|
+
_ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$A, " (" + toDisplayString(unref(currentFilterCount)) + ") ", 1)) : createCommentVNode("", true)
|
|
6014
6035
|
]),
|
|
6015
6036
|
_ctx.expandable ? (openBlock(), createElementBlock("div", {
|
|
6016
6037
|
key: 0,
|
|
@@ -6084,7 +6105,7 @@ const _hoisted_1$L = {
|
|
|
6084
6105
|
class: "lupa-category-filter",
|
|
6085
6106
|
"data-cy": "lupa-category-filter"
|
|
6086
6107
|
};
|
|
6087
|
-
const _hoisted_2$
|
|
6108
|
+
const _hoisted_2$z = { class: "lupa-category-back" };
|
|
6088
6109
|
const _hoisted_3$p = ["href"];
|
|
6089
6110
|
const _hoisted_4$j = ["href"];
|
|
6090
6111
|
const _hoisted_5$d = { class: "lupa-child-category-list" };
|
|
@@ -6175,7 +6196,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
6175
6196
|
__expose({ fetch: fetch2 });
|
|
6176
6197
|
return (_ctx, _cache) => {
|
|
6177
6198
|
return openBlock(), createElementBlock("div", _hoisted_1$L, [
|
|
6178
|
-
createElementVNode("div", _hoisted_2$
|
|
6199
|
+
createElementVNode("div", _hoisted_2$z, [
|
|
6179
6200
|
hasBackButton.value ? (openBlock(), createElementBlock("a", {
|
|
6180
6201
|
key: 0,
|
|
6181
6202
|
"data-cy": "lupa-category-back",
|
|
@@ -6210,7 +6231,7 @@ const _hoisted_1$K = {
|
|
|
6210
6231
|
class: "lupa-search-result-facet-term-values",
|
|
6211
6232
|
"data-cy": "lupa-search-result-facet-term-values"
|
|
6212
6233
|
};
|
|
6213
|
-
const _hoisted_2$
|
|
6234
|
+
const _hoisted_2$y = ["placeholder"];
|
|
6214
6235
|
const _hoisted_3$o = { class: "lupa-terms-list" };
|
|
6215
6236
|
const _hoisted_4$i = ["onClick"];
|
|
6216
6237
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
@@ -6298,7 +6319,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
6298
6319
|
"data-cy": "lupa-term-filter",
|
|
6299
6320
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
|
|
6300
6321
|
placeholder: _ctx.options.labels.facetFilter
|
|
6301
|
-
}, null, 8, _hoisted_2$
|
|
6322
|
+
}, null, 8, _hoisted_2$y)), [
|
|
6302
6323
|
[vModelText, termFilter.value]
|
|
6303
6324
|
]) : createCommentVNode("", true),
|
|
6304
6325
|
createElementVNode("div", _hoisted_3$o, [
|
|
@@ -7310,7 +7331,7 @@ m.render = function(e, t, r, i, n, o) {
|
|
|
7310
7331
|
return openBlock(), createElementBlock("div", mergeProps(e.sliderProps, { ref: "slider" }), null, 16);
|
|
7311
7332
|
}, m.__file = "src/Slider.vue";
|
|
7312
7333
|
const _hoisted_1$J = { class: "lupa-search-result-facet-stats-values" };
|
|
7313
|
-
const _hoisted_2$
|
|
7334
|
+
const _hoisted_2$x = {
|
|
7314
7335
|
key: 0,
|
|
7315
7336
|
class: "lupa-stats-facet-summary"
|
|
7316
7337
|
};
|
|
@@ -7370,6 +7391,10 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
7370
7391
|
var _a;
|
|
7371
7392
|
return (_a = searchResultOptions.value) == null ? void 0 : _a.labels.currency;
|
|
7372
7393
|
});
|
|
7394
|
+
const priceKeys = computed(() => {
|
|
7395
|
+
var _a, _b;
|
|
7396
|
+
return (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.priceKeys) != null ? _b : [];
|
|
7397
|
+
});
|
|
7373
7398
|
const isSliderVisible = computed(() => {
|
|
7374
7399
|
var _a, _b;
|
|
7375
7400
|
return Boolean((_b = (_a = props.options.stats) == null ? void 0 : _a.slider) != null ? _b : true);
|
|
@@ -7433,8 +7458,8 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
7433
7458
|
}
|
|
7434
7459
|
});
|
|
7435
7460
|
const isPrice = computed(() => {
|
|
7436
|
-
var _a;
|
|
7437
|
-
return (_a = facetValue.value.key) == null ? void 0 :
|
|
7461
|
+
var _a, _b, _c;
|
|
7462
|
+
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));
|
|
7438
7463
|
});
|
|
7439
7464
|
const facetMin = computed(() => {
|
|
7440
7465
|
return Math.floor(facetValue.value.min);
|
|
@@ -7507,7 +7532,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
7507
7532
|
};
|
|
7508
7533
|
return (_ctx, _cache) => {
|
|
7509
7534
|
return openBlock(), createElementBlock("div", _hoisted_1$J, [
|
|
7510
|
-
!isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
7535
|
+
!isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$x, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$n, [
|
|
7511
7536
|
createElementVNode("div", null, [
|
|
7512
7537
|
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$h, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
|
|
7513
7538
|
createElementVNode("div", _hoisted_5$b, [
|
|
@@ -7574,7 +7599,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
7574
7599
|
}
|
|
7575
7600
|
});
|
|
7576
7601
|
const _hoisted_1$I = { class: "lupa-term-checkbox-wrapper" };
|
|
7577
|
-
const _hoisted_2$
|
|
7602
|
+
const _hoisted_2$w = { class: "lupa-term-checkbox-label" };
|
|
7578
7603
|
const _hoisted_3$m = { class: "lupa-term-label" };
|
|
7579
7604
|
const _hoisted_4$g = {
|
|
7580
7605
|
key: 0,
|
|
@@ -7635,7 +7660,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
7635
7660
|
class: normalizeClass(["lupa-term-checkbox", { checked: isChecked.value }])
|
|
7636
7661
|
}, null, 2)
|
|
7637
7662
|
]),
|
|
7638
|
-
createElementVNode("div", _hoisted_2$
|
|
7663
|
+
createElementVNode("div", _hoisted_2$w, [
|
|
7639
7664
|
createElementVNode("span", _hoisted_3$m, toDisplayString(_ctx.item.title) + toDisplayString(" "), 1),
|
|
7640
7665
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$g, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
|
|
7641
7666
|
])
|
|
@@ -7660,7 +7685,7 @@ const _hoisted_1$H = {
|
|
|
7660
7685
|
class: "lupa-search-result-facet-term-values lupa-search-result-facet-hierarchy-values",
|
|
7661
7686
|
"data-cy": "lupa-search-result-facet-term-values"
|
|
7662
7687
|
};
|
|
7663
|
-
const _hoisted_2$
|
|
7688
|
+
const _hoisted_2$v = { key: 0 };
|
|
7664
7689
|
const _hoisted_3$l = ["placeholder"];
|
|
7665
7690
|
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
7666
7691
|
__name: "HierarchyFacet",
|
|
@@ -7713,7 +7738,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
7713
7738
|
};
|
|
7714
7739
|
return (_ctx, _cache) => {
|
|
7715
7740
|
return openBlock(), createElementBlock("div", _hoisted_1$H, [
|
|
7716
|
-
isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
7741
|
+
isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$v, [
|
|
7717
7742
|
withDirectives(createElementVNode("input", {
|
|
7718
7743
|
class: "lupa-term-filter",
|
|
7719
7744
|
"data-cy": "lupa-term-filter",
|
|
@@ -7745,7 +7770,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
7745
7770
|
}
|
|
7746
7771
|
});
|
|
7747
7772
|
const _hoisted_1$G = { class: "lupa-facet-label-text" };
|
|
7748
|
-
const _hoisted_2$
|
|
7773
|
+
const _hoisted_2$u = {
|
|
7749
7774
|
key: 0,
|
|
7750
7775
|
class: "lupa-facet-content",
|
|
7751
7776
|
"data-cy": "lupa-facet-content"
|
|
@@ -7874,7 +7899,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
7874
7899
|
class: normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
|
|
7875
7900
|
}, null, 2)
|
|
7876
7901
|
], 2),
|
|
7877
|
-
isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
7902
|
+
isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$u, [
|
|
7878
7903
|
(openBlock(), createBlock(resolveDynamicComponent(facetType.value), {
|
|
7879
7904
|
facet: facet.value,
|
|
7880
7905
|
currentFilters: currentFilters.value[facet.value.key],
|
|
@@ -7893,7 +7918,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
7893
7918
|
}
|
|
7894
7919
|
}));
|
|
7895
7920
|
const _hoisted_1$F = { class: "lupa-search-result-facet-section" };
|
|
7896
|
-
const _hoisted_2$
|
|
7921
|
+
const _hoisted_2$t = {
|
|
7897
7922
|
key: 0,
|
|
7898
7923
|
class: "lupa-facets-title"
|
|
7899
7924
|
};
|
|
@@ -7932,7 +7957,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
7932
7957
|
return (_ctx, _cache) => {
|
|
7933
7958
|
var _a;
|
|
7934
7959
|
return openBlock(), createElementBlock("div", _hoisted_1$F, [
|
|
7935
|
-
_ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
7960
|
+
_ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$t, toDisplayString(_ctx.options.labels.title), 1)) : createCommentVNode("", true),
|
|
7936
7961
|
createElementVNode("div", {
|
|
7937
7962
|
class: normalizeClass(["lupa-search-result-facet-list", "lupa-" + ((_a = _ctx.facetStyle) != null ? _a : "")])
|
|
7938
7963
|
}, [
|
|
@@ -7979,6 +8004,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
7979
8004
|
}
|
|
7980
8005
|
});
|
|
7981
8006
|
const _hoisted_1$D = { class: "lupa-search-result-facets" };
|
|
8007
|
+
const _hoisted_2$s = { class: "lupa-facets-filter-button-wrapper" };
|
|
7982
8008
|
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
7983
8009
|
__name: "Facets",
|
|
7984
8010
|
props: {
|
|
@@ -8073,11 +8099,13 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
8073
8099
|
onSelect: handleFacetSelect,
|
|
8074
8100
|
onClear: clear
|
|
8075
8101
|
}, null, 8, ["options", "facets", "currentFilters", "facetStyle", "clearable"])) : createCommentVNode("", true),
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8102
|
+
createElementVNode("div", _hoisted_2$s, [
|
|
8103
|
+
showFilterButton.value ? (openBlock(), createBlock(_sfc_main$H, {
|
|
8104
|
+
key: 0,
|
|
8105
|
+
options: _ctx.options,
|
|
8106
|
+
onFilter: filter
|
|
8107
|
+
}, null, 8, ["options"])) : createCommentVNode("", true)
|
|
8108
|
+
])
|
|
8081
8109
|
]);
|
|
8082
8110
|
};
|
|
8083
8111
|
}
|
|
@@ -9097,7 +9125,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
9097
9125
|
item: {},
|
|
9098
9126
|
options: {}
|
|
9099
9127
|
},
|
|
9100
|
-
|
|
9128
|
+
emits: ["productEvent"],
|
|
9129
|
+
setup(__props, { emit }) {
|
|
9101
9130
|
const props = __props;
|
|
9102
9131
|
const text = computed(() => {
|
|
9103
9132
|
return props.options.html(props.item);
|
|
@@ -9109,6 +9138,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
9109
9138
|
if (!props.options.action) {
|
|
9110
9139
|
return;
|
|
9111
9140
|
}
|
|
9141
|
+
if (props.options.reportEventOnClick) {
|
|
9142
|
+
emit("productEvent", { type: props.options.reportEventOnClick });
|
|
9143
|
+
}
|
|
9112
9144
|
yield props.options.action(props.item);
|
|
9113
9145
|
});
|
|
9114
9146
|
return (_ctx, _cache) => {
|
|
@@ -9421,7 +9453,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
9421
9453
|
key: element.key,
|
|
9422
9454
|
labels: labels.value,
|
|
9423
9455
|
inStock: isInStock.value,
|
|
9424
|
-
link: link.value
|
|
9456
|
+
link: link.value,
|
|
9457
|
+
onProductEvent: handleProductEvent
|
|
9425
9458
|
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
9426
9459
|
}), 128)),
|
|
9427
9460
|
createVNode(_sfc_main$$, {
|
|
@@ -10,7 +10,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
10
10
|
type: __PropType<CustomHtmlElement>;
|
|
11
11
|
required: true;
|
|
12
12
|
};
|
|
13
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
13
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "productEvent"[], "productEvent", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
14
|
item: {
|
|
15
15
|
type: __PropType<Document>;
|
|
16
16
|
required: true;
|
|
@@ -19,5 +19,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
19
19
|
type: __PropType<CustomHtmlElement>;
|
|
20
20
|
required: true;
|
|
21
21
|
};
|
|
22
|
-
}
|
|
22
|
+
}>> & {
|
|
23
|
+
onProductEvent?: (...args: any[]) => any;
|
|
24
|
+
}, {}, {}>;
|
|
23
25
|
export default _sfc_main;
|
|
@@ -94,5 +94,6 @@ export type CustomHtmlElement<T = any> = DocumentElementBase<T> & {
|
|
|
94
94
|
html: (document: T) => string;
|
|
95
95
|
className: string;
|
|
96
96
|
action?: (document: T) => Promise<unknown> | undefined;
|
|
97
|
+
reportEventOnClick?: string;
|
|
97
98
|
};
|
|
98
99
|
export type DocumentElement = ImageDocumentElement | TitleDocumentElement | DescriptionDocumentElement | CustomDocumentElement | PriceElement | RegularPriceDocumentElement | RatingElement | SingleStarRatingElement | AddToCartElement | CustomHtmlElement;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { LabeledFilter, UnfoldedFilter } from '../types/search-results/Filters';
|
|
2
2
|
import type { FacetResult, FilterGroup, FilterGroupItemTypeRange, HierarchyTree } from '@getlupa/client-sdk/Types';
|
|
3
3
|
export declare const formatRange: (filter: FilterGroupItemTypeRange) => string;
|
|
4
|
-
export declare const unfoldFilters: (filters?: FilterGroup
|
|
4
|
+
export declare const unfoldFilters: (filters?: FilterGroup, price?: {
|
|
5
|
+
keys?: string[];
|
|
6
|
+
currency?: string;
|
|
7
|
+
separator?: string;
|
|
8
|
+
}) => UnfoldedFilter[];
|
|
5
9
|
export declare const getLabeledFilters: (filters: UnfoldedFilter[], facets?: FacetResult[]) => LabeledFilter[];
|
|
6
10
|
export declare const isFacetKey: (key: string) => boolean;
|
|
7
11
|
export declare const isArrayKey: (key: string) => boolean;
|