@getlupa/client 1.17.4 → 1.17.6
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 +72 -39
- package/dist/lupaSearch.js +72 -39
- package/dist/lupaSearch.mjs +72 -39
- package/dist/lupaSearch.umd.js +72 -39
- package/package.json +4 -3
package/dist/lupaSearch.iife.js
CHANGED
|
@@ -7863,6 +7863,14 @@ var __async = (__this, __arguments, generator) => {
|
|
|
7863
7863
|
}
|
|
7864
7864
|
return `< ${formatPrice(max, currency, separator, currencyTemplate)}`;
|
|
7865
7865
|
};
|
|
7866
|
+
const getTranslatedFacetKey = (facet, translations) => {
|
|
7867
|
+
var _a, _b;
|
|
7868
|
+
return (_b = (_a = translations == null ? void 0 : translations.keyTranslations) == null ? void 0 : _a[facet.key]) != null ? _b : facet.label;
|
|
7869
|
+
};
|
|
7870
|
+
const getTranslatedFacetValue = (facet, value, translations) => {
|
|
7871
|
+
var _a, _b, _c;
|
|
7872
|
+
return (_c = (_b = (_a = translations == null ? void 0 : translations.valueTranslations) == null ? void 0 : _a[facet.key]) == null ? void 0 : _b[value == null ? void 0 : value.title]) != null ? _c : value.title;
|
|
7873
|
+
};
|
|
7866
7874
|
const formatRange = (filter2) => {
|
|
7867
7875
|
var _a, _b;
|
|
7868
7876
|
const lt = (_a = filter2.lt) != null ? _a : filter2.lte;
|
|
@@ -7922,11 +7930,12 @@ var __async = (__this, __arguments, generator) => {
|
|
|
7922
7930
|
const seed = [];
|
|
7923
7931
|
return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2, price)], seed);
|
|
7924
7932
|
};
|
|
7925
|
-
const getLabeledFilters = (filters, facets2) => {
|
|
7933
|
+
const getLabeledFilters = (filters, facets2, translations) => {
|
|
7926
7934
|
return filters.map((f2) => {
|
|
7927
|
-
var _a, _b;
|
|
7935
|
+
var _a, _b, _c, _d;
|
|
7928
7936
|
return __spreadProps2(__spreadValues2({}, f2), {
|
|
7929
|
-
label: (
|
|
7937
|
+
label: (_d = (_c = (_a = translations == null ? void 0 : translations.keyTranslations) == null ? void 0 : _a[f2.key]) != null ? _c : (_b = facets2 == null ? void 0 : facets2.find((ft) => ft.key === f2.key)) == null ? void 0 : _b.label) != null ? _d : capitalize$1(f2.key),
|
|
7938
|
+
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations)
|
|
7930
7939
|
});
|
|
7931
7940
|
});
|
|
7932
7941
|
};
|
|
@@ -14279,7 +14288,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14279
14288
|
};
|
|
14280
14289
|
});
|
|
14281
14290
|
const _hoisted_1$1i = { id: "lupa-search-box-input-container" };
|
|
14282
|
-
const _hoisted_2$
|
|
14291
|
+
const _hoisted_2$T = { class: "lupa-input-clear" };
|
|
14283
14292
|
const _hoisted_3$C = { id: "lupa-search-box-input" };
|
|
14284
14293
|
const _hoisted_4$s = ["value"];
|
|
14285
14294
|
const _hoisted_5$j = ["aria-label", "placeholder"];
|
|
@@ -14376,7 +14385,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14376
14385
|
__expose({ focus });
|
|
14377
14386
|
return (_ctx, _cache) => {
|
|
14378
14387
|
return openBlock(), createElementBlock("div", _hoisted_1$1i, [
|
|
14379
|
-
createBaseVNode("div", _hoisted_2$
|
|
14388
|
+
createBaseVNode("div", _hoisted_2$T, [
|
|
14380
14389
|
createBaseVNode("div", {
|
|
14381
14390
|
class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
|
|
14382
14391
|
onClick: clear2
|
|
@@ -14459,7 +14468,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14459
14468
|
}
|
|
14460
14469
|
});
|
|
14461
14470
|
const _hoisted_1$1h = { class: "lupa-search-box-history-item" };
|
|
14462
|
-
const _hoisted_2$
|
|
14471
|
+
const _hoisted_2$S = { class: "lupa-search-box-history-item-content" };
|
|
14463
14472
|
const _sfc_main$1t = /* @__PURE__ */ defineComponent({
|
|
14464
14473
|
__name: "SearchBoxHistoryItem",
|
|
14465
14474
|
props: {
|
|
@@ -14477,7 +14486,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14477
14486
|
};
|
|
14478
14487
|
return (_ctx, _cache) => {
|
|
14479
14488
|
return openBlock(), createElementBlock("div", _hoisted_1$1h, [
|
|
14480
|
-
createBaseVNode("div", _hoisted_2$
|
|
14489
|
+
createBaseVNode("div", _hoisted_2$S, [
|
|
14481
14490
|
createBaseVNode("div", {
|
|
14482
14491
|
class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
|
|
14483
14492
|
onClick: click2
|
|
@@ -14604,7 +14613,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14604
14613
|
return gridTemplate.join(" ");
|
|
14605
14614
|
};
|
|
14606
14615
|
const _hoisted_1$1e = ["innerHTML"];
|
|
14607
|
-
const _hoisted_2$
|
|
14616
|
+
const _hoisted_2$R = {
|
|
14608
14617
|
key: 1,
|
|
14609
14618
|
"data-cy": "lupa-suggestion-value",
|
|
14610
14619
|
class: "lupa-suggestion-value"
|
|
@@ -14658,7 +14667,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14658
14667
|
class: "lupa-suggestion-value",
|
|
14659
14668
|
"data-cy": "lupa-suggestion-value",
|
|
14660
14669
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
14661
|
-
}, null, 8, _hoisted_1$1e)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
14670
|
+
}, null, 8, _hoisted_1$1e)) : (openBlock(), createElementBlock("div", _hoisted_2$R, toDisplayString(_ctx.suggestion.display), 1)),
|
|
14662
14671
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$B, [
|
|
14663
14672
|
createBaseVNode("span", _hoisted_4$r, toDisplayString(facetLabel.value), 1),
|
|
14664
14673
|
createBaseVNode("span", _hoisted_5$i, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
@@ -23797,6 +23806,11 @@ and ensure you are accounting for this risk.
|
|
|
23797
23806
|
case "exists": {
|
|
23798
23807
|
return fields == null ? void 0 : fields.every((field) => getFieldValue(doc2, field) !== void 0);
|
|
23799
23808
|
}
|
|
23809
|
+
case "notExists": {
|
|
23810
|
+
return fields == null ? void 0 : fields.every(
|
|
23811
|
+
(field) => getFieldValue(doc2, field) === void 0 || getFieldValue(doc2, field) === null
|
|
23812
|
+
);
|
|
23813
|
+
}
|
|
23800
23814
|
case "equals": {
|
|
23801
23815
|
if (fields.length < 2)
|
|
23802
23816
|
return false;
|
|
@@ -23853,7 +23867,7 @@ and ensure you are accounting for this risk.
|
|
|
23853
23867
|
}
|
|
23854
23868
|
};
|
|
23855
23869
|
const _hoisted_1$1c = ["src"];
|
|
23856
|
-
const _hoisted_2$
|
|
23870
|
+
const _hoisted_2$Q = ["src"];
|
|
23857
23871
|
const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
23858
23872
|
__name: "ProductImage",
|
|
23859
23873
|
props: {
|
|
@@ -24004,7 +24018,7 @@ and ensure you are accounting for this risk.
|
|
|
24004
24018
|
class: ["lupa-images-main-image", { [_ctx.imageClass]: true }],
|
|
24005
24019
|
style: styleOverride.value,
|
|
24006
24020
|
src: finalMainImageUrl.value
|
|
24007
|
-
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_2$
|
|
24021
|
+
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_2$Q))
|
|
24008
24022
|
], 38);
|
|
24009
24023
|
};
|
|
24010
24024
|
}
|
|
@@ -24027,7 +24041,7 @@ and ensure you are accounting for this risk.
|
|
|
24027
24041
|
}
|
|
24028
24042
|
});
|
|
24029
24043
|
const _hoisted_1$1b = ["innerHTML"];
|
|
24030
|
-
const _hoisted_2$
|
|
24044
|
+
const _hoisted_2$P = {
|
|
24031
24045
|
key: 1,
|
|
24032
24046
|
class: "lupa-search-box-product-title"
|
|
24033
24047
|
};
|
|
@@ -24054,14 +24068,14 @@ and ensure you are accounting for this risk.
|
|
|
24054
24068
|
key: 0,
|
|
24055
24069
|
class: "lupa-search-box-product-title",
|
|
24056
24070
|
innerHTML: sanitizedTitle.value
|
|
24057
|
-
}, null, 8, _hoisted_1$1b)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
24071
|
+
}, null, 8, _hoisted_1$1b)) : (openBlock(), createElementBlock("div", _hoisted_2$P, [
|
|
24058
24072
|
createBaseVNode("strong", null, toDisplayString(title.value), 1)
|
|
24059
24073
|
]));
|
|
24060
24074
|
};
|
|
24061
24075
|
}
|
|
24062
24076
|
});
|
|
24063
24077
|
const _hoisted_1$1a = ["innerHTML"];
|
|
24064
|
-
const _hoisted_2$
|
|
24078
|
+
const _hoisted_2$O = {
|
|
24065
24079
|
key: 1,
|
|
24066
24080
|
class: "lupa-search-box-product-description"
|
|
24067
24081
|
};
|
|
@@ -24088,7 +24102,7 @@ and ensure you are accounting for this risk.
|
|
|
24088
24102
|
key: 0,
|
|
24089
24103
|
class: "lupa-search-box-product-description",
|
|
24090
24104
|
innerHTML: sanitizedDescription.value
|
|
24091
|
-
}, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
24105
|
+
}, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$O, toDisplayString(description.value), 1));
|
|
24092
24106
|
};
|
|
24093
24107
|
}
|
|
24094
24108
|
});
|
|
@@ -24147,7 +24161,7 @@ and ensure you are accounting for this risk.
|
|
|
24147
24161
|
}
|
|
24148
24162
|
});
|
|
24149
24163
|
const _hoisted_1$18 = ["innerHTML"];
|
|
24150
|
-
const _hoisted_2$
|
|
24164
|
+
const _hoisted_2$N = { key: 0 };
|
|
24151
24165
|
const _hoisted_3$A = { key: 1 };
|
|
24152
24166
|
const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
|
|
24153
24167
|
const _hoisted_5$h = { class: "lupa-search-box-custom-text" };
|
|
@@ -24181,7 +24195,7 @@ and ensure you are accounting for this risk.
|
|
|
24181
24195
|
key: 1,
|
|
24182
24196
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
24183
24197
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
24184
|
-
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
24198
|
+
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$A, [
|
|
24185
24199
|
createBaseVNode("div", _hoisted_4$q, toDisplayString(label.value), 1),
|
|
24186
24200
|
createBaseVNode("div", _hoisted_5$h, toDisplayString(text.value), 1)
|
|
24187
24201
|
]))
|
|
@@ -24304,6 +24318,10 @@ and ensure you are accounting for this risk.
|
|
|
24304
24318
|
var _a, _b, _c;
|
|
24305
24319
|
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currencyTemplate) != null ? _c : "";
|
|
24306
24320
|
});
|
|
24321
|
+
const filterTranslations = computed(() => {
|
|
24322
|
+
var _a, _b, _c;
|
|
24323
|
+
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.filters) == null ? void 0 : _b.translations) != null ? _c : {};
|
|
24324
|
+
});
|
|
24307
24325
|
const labeledFilters = computed(
|
|
24308
24326
|
() => getLabeledFilters(
|
|
24309
24327
|
unfoldFilters(filters.value, {
|
|
@@ -24312,7 +24330,8 @@ and ensure you are accounting for this risk.
|
|
|
24312
24330
|
separator: priceSeparator.value,
|
|
24313
24331
|
currencyTemplate: currencyTemplate.value
|
|
24314
24332
|
}),
|
|
24315
|
-
facets2.value
|
|
24333
|
+
facets2.value,
|
|
24334
|
+
filterTranslations.value
|
|
24316
24335
|
)
|
|
24317
24336
|
);
|
|
24318
24337
|
const displayFilters = computed(() => {
|
|
@@ -24495,7 +24514,7 @@ and ensure you are accounting for this risk.
|
|
|
24495
24514
|
};
|
|
24496
24515
|
});
|
|
24497
24516
|
const _hoisted_1$16 = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
24498
|
-
const _hoisted_2$
|
|
24517
|
+
const _hoisted_2$M = { class: "lupa-search-box-product-addtocart" };
|
|
24499
24518
|
const _hoisted_3$z = ["onClick", "disabled"];
|
|
24500
24519
|
const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
24501
24520
|
__name: "SearchBoxProductAddToCart",
|
|
@@ -24532,7 +24551,7 @@ and ensure you are accounting for this risk.
|
|
|
24532
24551
|
});
|
|
24533
24552
|
return (_ctx, _cache) => {
|
|
24534
24553
|
return openBlock(), createElementBlock("div", _hoisted_1$16, [
|
|
24535
|
-
createBaseVNode("div", _hoisted_2$
|
|
24554
|
+
createBaseVNode("div", _hoisted_2$M, [
|
|
24536
24555
|
createBaseVNode("button", mergeProps({
|
|
24537
24556
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
24538
24557
|
class: loading.value ? "lupa-add-to-cart-loading" : "lupa-add-to-cart",
|
|
@@ -24646,7 +24665,7 @@ and ensure you are accounting for this risk.
|
|
|
24646
24665
|
}
|
|
24647
24666
|
}));
|
|
24648
24667
|
const _hoisted_1$14 = { class: "lupa-badge-title" };
|
|
24649
|
-
const _hoisted_2$
|
|
24668
|
+
const _hoisted_2$L = ["src"];
|
|
24650
24669
|
const _hoisted_3$y = { key: 1 };
|
|
24651
24670
|
const _hoisted_4$p = {
|
|
24652
24671
|
key: 0,
|
|
@@ -24689,7 +24708,7 @@ and ensure you are accounting for this risk.
|
|
|
24689
24708
|
image.value ? (openBlock(), createElementBlock("img", {
|
|
24690
24709
|
key: 0,
|
|
24691
24710
|
src: image.value
|
|
24692
|
-
}, null, 8, _hoisted_2$
|
|
24711
|
+
}, null, 8, _hoisted_2$L)) : createCommentVNode("", true),
|
|
24693
24712
|
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$y, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
24694
24713
|
]),
|
|
24695
24714
|
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$p, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
@@ -24789,7 +24808,7 @@ and ensure you are accounting for this risk.
|
|
|
24789
24808
|
}
|
|
24790
24809
|
});
|
|
24791
24810
|
const _hoisted_1$10 = { class: "lupa-image-badges" };
|
|
24792
|
-
const _hoisted_2$
|
|
24811
|
+
const _hoisted_2$K = ["src"];
|
|
24793
24812
|
const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
24794
24813
|
__name: "ImageBadge",
|
|
24795
24814
|
props: {
|
|
@@ -24818,7 +24837,7 @@ and ensure you are accounting for this risk.
|
|
|
24818
24837
|
}, [
|
|
24819
24838
|
createBaseVNode("img", {
|
|
24820
24839
|
src: getImageUrl(item)
|
|
24821
|
-
}, null, 8, _hoisted_2$
|
|
24840
|
+
}, null, 8, _hoisted_2$K)
|
|
24822
24841
|
]);
|
|
24823
24842
|
}), 128))
|
|
24824
24843
|
]);
|
|
@@ -24977,7 +24996,7 @@ and ensure you are accounting for this risk.
|
|
|
24977
24996
|
}
|
|
24978
24997
|
}));
|
|
24979
24998
|
const _hoisted_1$_ = ["href"];
|
|
24980
|
-
const _hoisted_2$
|
|
24999
|
+
const _hoisted_2$J = { class: "lupa-search-box-product-details-section" };
|
|
24981
25000
|
const _hoisted_3$x = {
|
|
24982
25001
|
key: 0,
|
|
24983
25002
|
class: "lupa-search-box-product-add-to-cart-section"
|
|
@@ -25078,7 +25097,7 @@ and ensure you are accounting for this risk.
|
|
|
25078
25097
|
}, null, 8, ["item", "element", "labels", "link"]);
|
|
25079
25098
|
}), 128))
|
|
25080
25099
|
], 4),
|
|
25081
|
-
createBaseVNode("div", _hoisted_2$
|
|
25100
|
+
createBaseVNode("div", _hoisted_2$J, [
|
|
25082
25101
|
(openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
|
|
25083
25102
|
var _a;
|
|
25084
25103
|
return openBlock(), createBlock(_sfc_main$1e, {
|
|
@@ -25284,7 +25303,7 @@ and ensure you are accounting for this risk.
|
|
|
25284
25303
|
}
|
|
25285
25304
|
});
|
|
25286
25305
|
const _hoisted_1$Y = { class: "lupa-search-box-documents-go-to-results-wrapper" };
|
|
25287
|
-
const _hoisted_2$
|
|
25306
|
+
const _hoisted_2$I = { key: 0 };
|
|
25288
25307
|
const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
25289
25308
|
__name: "SearchBoxProductsGoToResultsButton",
|
|
25290
25309
|
props: {
|
|
@@ -25321,7 +25340,7 @@ and ensure you are accounting for this risk.
|
|
|
25321
25340
|
onClick: goToResults
|
|
25322
25341
|
}, [
|
|
25323
25342
|
createTextVNode(toDisplayString(goToResultsLabel.value) + " ", 1),
|
|
25324
|
-
totalCount.value ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
25343
|
+
totalCount.value ? (openBlock(), createElementBlock("span", _hoisted_2$I, " " + toDisplayString(totalCount.value), 1)) : createCommentVNode("", true)
|
|
25325
25344
|
])
|
|
25326
25345
|
]);
|
|
25327
25346
|
};
|
|
@@ -25589,7 +25608,7 @@ and ensure you are accounting for this risk.
|
|
|
25589
25608
|
key: 0,
|
|
25590
25609
|
id: "lupa-search-box-panel"
|
|
25591
25610
|
};
|
|
25592
|
-
const _hoisted_2$
|
|
25611
|
+
const _hoisted_2$H = ["data-cy"];
|
|
25593
25612
|
const _hoisted_3$w = {
|
|
25594
25613
|
key: 0,
|
|
25595
25614
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
@@ -25809,7 +25828,7 @@ and ensure you are accounting for this risk.
|
|
|
25809
25828
|
key: "0"
|
|
25810
25829
|
} : void 0
|
|
25811
25830
|
]), 1064, ["panel", "search-box-options", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
25812
|
-
], 14, _hoisted_2$
|
|
25831
|
+
], 14, _hoisted_2$H);
|
|
25813
25832
|
}), 128))
|
|
25814
25833
|
], 4),
|
|
25815
25834
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1r, {
|
|
@@ -25848,8 +25867,7 @@ and ensure you are accounting for this risk.
|
|
|
25848
25867
|
const elements = getElements(triggers);
|
|
25849
25868
|
elements.forEach((e2) => e2 == null ? void 0 : e2.removeEventListener(BIND_EVENT, event));
|
|
25850
25869
|
};
|
|
25851
|
-
const _hoisted_1$W = {
|
|
25852
|
-
const _hoisted_2$H = { class: "lupa-search-box-wrapper" };
|
|
25870
|
+
const _hoisted_1$W = { class: "lupa-search-box-wrapper" };
|
|
25853
25871
|
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
25854
25872
|
__name: "SearchBox",
|
|
25855
25873
|
props: {
|
|
@@ -26160,8 +26178,11 @@ and ensure you are accounting for this risk.
|
|
|
26160
26178
|
};
|
|
26161
26179
|
return (_ctx, _cache) => {
|
|
26162
26180
|
var _a2;
|
|
26163
|
-
return openBlock(), createElementBlock("div",
|
|
26164
|
-
|
|
26181
|
+
return openBlock(), createElementBlock("div", {
|
|
26182
|
+
id: "lupa-search-box",
|
|
26183
|
+
class: normalizeClass({ "lupa-search-box-opened": opened.value })
|
|
26184
|
+
}, [
|
|
26185
|
+
createBaseVNode("div", _hoisted_1$W, [
|
|
26165
26186
|
createVNode(_sfc_main$1v, {
|
|
26166
26187
|
options: inputOptions.value,
|
|
26167
26188
|
suggestedValue: suggestedValue.value,
|
|
@@ -26196,7 +26217,7 @@ and ensure you are accounting for this risk.
|
|
|
26196
26217
|
} : void 0
|
|
26197
26218
|
]), 1032, ["options", "inputValue", "isSearchContainer", "focused"])) : createCommentVNode("", true)
|
|
26198
26219
|
])
|
|
26199
|
-
]);
|
|
26220
|
+
], 2);
|
|
26200
26221
|
};
|
|
26201
26222
|
}
|
|
26202
26223
|
});
|
|
@@ -26790,6 +26811,8 @@ and ensure you are accounting for this risk.
|
|
|
26790
26811
|
setup(__props, { emit: emit2 }) {
|
|
26791
26812
|
const props = __props;
|
|
26792
26813
|
const searchResultStore = useSearchResultStore();
|
|
26814
|
+
const optionsStore = useOptionsStore();
|
|
26815
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
26793
26816
|
const facet = computed(() => {
|
|
26794
26817
|
var _a;
|
|
26795
26818
|
return (_a = props.facet) != null ? _a : { type: "terms", items: [], key: "" };
|
|
@@ -26849,6 +26872,10 @@ and ensure you are accounting for this risk.
|
|
|
26849
26872
|
selectedItems = isRange.value && selectedItems ? [rangeFilterToString(selectedItems)] : selectedItems;
|
|
26850
26873
|
return selectedItems == null ? void 0 : selectedItems.includes((_b = item.title) == null ? void 0 : _b.toString());
|
|
26851
26874
|
};
|
|
26875
|
+
const getItemLabel = (item) => {
|
|
26876
|
+
var _a;
|
|
26877
|
+
return getTranslatedFacetValue(props.facet, item, (_a = searchResultOptions.value.filters) == null ? void 0 : _a.translations);
|
|
26878
|
+
};
|
|
26852
26879
|
return (_ctx, _cache) => {
|
|
26853
26880
|
return openBlock(), createElementBlock("div", _hoisted_1$O, [
|
|
26854
26881
|
isFilterable.value ? withDirectives((openBlock(), createElementBlock("input", {
|
|
@@ -26874,7 +26901,7 @@ and ensure you are accounting for this risk.
|
|
|
26874
26901
|
}, null, 2)
|
|
26875
26902
|
]),
|
|
26876
26903
|
createBaseVNode("div", _hoisted_6$8, [
|
|
26877
|
-
createBaseVNode("span", _hoisted_7$6, toDisplayString(item
|
|
26904
|
+
createBaseVNode("span", _hoisted_7$6, toDisplayString(getItemLabel(item)), 1),
|
|
26878
26905
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
26879
26906
|
])
|
|
26880
26907
|
], 10, _hoisted_4$j);
|
|
@@ -28358,7 +28385,9 @@ and ensure you are accounting for this risk.
|
|
|
28358
28385
|
return (_a2 = props.currentFilters) != null ? _a2 : {};
|
|
28359
28386
|
});
|
|
28360
28387
|
const searchResultStore = useSearchResultStore();
|
|
28388
|
+
const optionsStore = useOptionsStore();
|
|
28361
28389
|
const { currentFilterKeys } = storeToRefs(searchResultStore);
|
|
28390
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
28362
28391
|
const isOpen = ref((_b = (_a = props.options.expand) == null ? void 0 : _a.includes(props.facet.key)) != null ? _b : false);
|
|
28363
28392
|
const facetPanel = ref(null);
|
|
28364
28393
|
const facetType = computed(() => {
|
|
@@ -28397,6 +28426,10 @@ and ensure you are accounting for this risk.
|
|
|
28397
28426
|
const facetKeyClass = computed(() => {
|
|
28398
28427
|
return `lupa-facet-${facet.value.key}`;
|
|
28399
28428
|
});
|
|
28429
|
+
const facetLabel = computed(() => {
|
|
28430
|
+
var _a2;
|
|
28431
|
+
return getTranslatedFacetKey(props.facet, (_a2 = searchResultOptions.value.filters) == null ? void 0 : _a2.translations);
|
|
28432
|
+
});
|
|
28400
28433
|
onMounted(() => {
|
|
28401
28434
|
var _a2;
|
|
28402
28435
|
if (((_a2 = props.options.style) == null ? void 0 : _a2.type) === "top-dropdown") {
|
|
@@ -28452,7 +28485,7 @@ and ensure you are accounting for this risk.
|
|
|
28452
28485
|
"data-cy": "lupa-search-result-facet-label",
|
|
28453
28486
|
onClick: toggleFacet
|
|
28454
28487
|
}, [
|
|
28455
|
-
createBaseVNode("div", _hoisted_1$K, toDisplayString(
|
|
28488
|
+
createBaseVNode("div", _hoisted_1$K, toDisplayString(facetLabel.value), 1),
|
|
28456
28489
|
createBaseVNode("div", {
|
|
28457
28490
|
class: normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
|
|
28458
28491
|
}, null, 2)
|
|
@@ -28954,10 +28987,10 @@ and ensure you are accounting for this risk.
|
|
|
28954
28987
|
const activeLabel = computed(() => props.labels.mobileFilterButtonActive);
|
|
28955
28988
|
const openLabel = computed(() => props.labels.mobileFilterButtonOpen);
|
|
28956
28989
|
const label = computed(() => {
|
|
28957
|
-
if (isSidebarVisible.value) {
|
|
28990
|
+
if (isSidebarVisible.value && openLabel.value) {
|
|
28958
28991
|
return openLabel.value;
|
|
28959
28992
|
}
|
|
28960
|
-
if (hasActiveFilters.value) {
|
|
28993
|
+
if (hasActiveFilters.value && activeLabel.value) {
|
|
28961
28994
|
return activeLabel.value;
|
|
28962
28995
|
}
|
|
28963
28996
|
return defaultLabel.value;
|