@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.umd.js
CHANGED
|
@@ -7865,6 +7865,14 @@ var __async = (__this, __arguments, generator) => {
|
|
|
7865
7865
|
}
|
|
7866
7866
|
return `< ${formatPrice(max, currency, separator, currencyTemplate)}`;
|
|
7867
7867
|
};
|
|
7868
|
+
const getTranslatedFacetKey = (facet, translations) => {
|
|
7869
|
+
var _a, _b;
|
|
7870
|
+
return (_b = (_a = translations == null ? void 0 : translations.keyTranslations) == null ? void 0 : _a[facet.key]) != null ? _b : facet.label;
|
|
7871
|
+
};
|
|
7872
|
+
const getTranslatedFacetValue = (facet, value, translations) => {
|
|
7873
|
+
var _a, _b, _c;
|
|
7874
|
+
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;
|
|
7875
|
+
};
|
|
7868
7876
|
const formatRange = (filter2) => {
|
|
7869
7877
|
var _a, _b;
|
|
7870
7878
|
const lt = (_a = filter2.lt) != null ? _a : filter2.lte;
|
|
@@ -7924,11 +7932,12 @@ var __async = (__this, __arguments, generator) => {
|
|
|
7924
7932
|
const seed = [];
|
|
7925
7933
|
return Object.entries(filters).reduce((a, c2) => [...a, ...unfoldFilter(...c2, price)], seed);
|
|
7926
7934
|
};
|
|
7927
|
-
const getLabeledFilters = (filters, facets2) => {
|
|
7935
|
+
const getLabeledFilters = (filters, facets2, translations) => {
|
|
7928
7936
|
return filters.map((f2) => {
|
|
7929
|
-
var _a, _b;
|
|
7937
|
+
var _a, _b, _c, _d;
|
|
7930
7938
|
return __spreadProps2(__spreadValues2({}, f2), {
|
|
7931
|
-
label: (
|
|
7939
|
+
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),
|
|
7940
|
+
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations)
|
|
7932
7941
|
});
|
|
7933
7942
|
});
|
|
7934
7943
|
};
|
|
@@ -14281,7 +14290,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14281
14290
|
};
|
|
14282
14291
|
});
|
|
14283
14292
|
const _hoisted_1$1i = { id: "lupa-search-box-input-container" };
|
|
14284
|
-
const _hoisted_2$
|
|
14293
|
+
const _hoisted_2$T = { class: "lupa-input-clear" };
|
|
14285
14294
|
const _hoisted_3$C = { id: "lupa-search-box-input" };
|
|
14286
14295
|
const _hoisted_4$s = ["value"];
|
|
14287
14296
|
const _hoisted_5$j = ["aria-label", "placeholder"];
|
|
@@ -14378,7 +14387,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14378
14387
|
__expose({ focus });
|
|
14379
14388
|
return (_ctx, _cache) => {
|
|
14380
14389
|
return openBlock(), createElementBlock("div", _hoisted_1$1i, [
|
|
14381
|
-
createBaseVNode("div", _hoisted_2$
|
|
14390
|
+
createBaseVNode("div", _hoisted_2$T, [
|
|
14382
14391
|
createBaseVNode("div", {
|
|
14383
14392
|
class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
|
|
14384
14393
|
onClick: clear2
|
|
@@ -14461,7 +14470,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14461
14470
|
}
|
|
14462
14471
|
});
|
|
14463
14472
|
const _hoisted_1$1h = { class: "lupa-search-box-history-item" };
|
|
14464
|
-
const _hoisted_2$
|
|
14473
|
+
const _hoisted_2$S = { class: "lupa-search-box-history-item-content" };
|
|
14465
14474
|
const _sfc_main$1t = /* @__PURE__ */ defineComponent({
|
|
14466
14475
|
__name: "SearchBoxHistoryItem",
|
|
14467
14476
|
props: {
|
|
@@ -14479,7 +14488,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14479
14488
|
};
|
|
14480
14489
|
return (_ctx, _cache) => {
|
|
14481
14490
|
return openBlock(), createElementBlock("div", _hoisted_1$1h, [
|
|
14482
|
-
createBaseVNode("div", _hoisted_2$
|
|
14491
|
+
createBaseVNode("div", _hoisted_2$S, [
|
|
14483
14492
|
createBaseVNode("div", {
|
|
14484
14493
|
class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
|
|
14485
14494
|
onClick: click2
|
|
@@ -14606,7 +14615,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14606
14615
|
return gridTemplate.join(" ");
|
|
14607
14616
|
};
|
|
14608
14617
|
const _hoisted_1$1e = ["innerHTML"];
|
|
14609
|
-
const _hoisted_2$
|
|
14618
|
+
const _hoisted_2$R = {
|
|
14610
14619
|
key: 1,
|
|
14611
14620
|
"data-cy": "lupa-suggestion-value",
|
|
14612
14621
|
class: "lupa-suggestion-value"
|
|
@@ -14660,7 +14669,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14660
14669
|
class: "lupa-suggestion-value",
|
|
14661
14670
|
"data-cy": "lupa-suggestion-value",
|
|
14662
14671
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
14663
|
-
}, null, 8, _hoisted_1$1e)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
14672
|
+
}, null, 8, _hoisted_1$1e)) : (openBlock(), createElementBlock("div", _hoisted_2$R, toDisplayString(_ctx.suggestion.display), 1)),
|
|
14664
14673
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$B, [
|
|
14665
14674
|
createBaseVNode("span", _hoisted_4$r, toDisplayString(facetLabel.value), 1),
|
|
14666
14675
|
createBaseVNode("span", _hoisted_5$i, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
@@ -23799,6 +23808,11 @@ and ensure you are accounting for this risk.
|
|
|
23799
23808
|
case "exists": {
|
|
23800
23809
|
return fields == null ? void 0 : fields.every((field) => getFieldValue(doc2, field) !== void 0);
|
|
23801
23810
|
}
|
|
23811
|
+
case "notExists": {
|
|
23812
|
+
return fields == null ? void 0 : fields.every(
|
|
23813
|
+
(field) => getFieldValue(doc2, field) === void 0 || getFieldValue(doc2, field) === null
|
|
23814
|
+
);
|
|
23815
|
+
}
|
|
23802
23816
|
case "equals": {
|
|
23803
23817
|
if (fields.length < 2)
|
|
23804
23818
|
return false;
|
|
@@ -23855,7 +23869,7 @@ and ensure you are accounting for this risk.
|
|
|
23855
23869
|
}
|
|
23856
23870
|
};
|
|
23857
23871
|
const _hoisted_1$1c = ["src"];
|
|
23858
|
-
const _hoisted_2$
|
|
23872
|
+
const _hoisted_2$Q = ["src"];
|
|
23859
23873
|
const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
23860
23874
|
__name: "ProductImage",
|
|
23861
23875
|
props: {
|
|
@@ -24006,7 +24020,7 @@ and ensure you are accounting for this risk.
|
|
|
24006
24020
|
class: ["lupa-images-main-image", { [_ctx.imageClass]: true }],
|
|
24007
24021
|
style: styleOverride.value,
|
|
24008
24022
|
src: finalMainImageUrl.value
|
|
24009
|
-
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_2$
|
|
24023
|
+
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_2$Q))
|
|
24010
24024
|
], 38);
|
|
24011
24025
|
};
|
|
24012
24026
|
}
|
|
@@ -24029,7 +24043,7 @@ and ensure you are accounting for this risk.
|
|
|
24029
24043
|
}
|
|
24030
24044
|
});
|
|
24031
24045
|
const _hoisted_1$1b = ["innerHTML"];
|
|
24032
|
-
const _hoisted_2$
|
|
24046
|
+
const _hoisted_2$P = {
|
|
24033
24047
|
key: 1,
|
|
24034
24048
|
class: "lupa-search-box-product-title"
|
|
24035
24049
|
};
|
|
@@ -24056,14 +24070,14 @@ and ensure you are accounting for this risk.
|
|
|
24056
24070
|
key: 0,
|
|
24057
24071
|
class: "lupa-search-box-product-title",
|
|
24058
24072
|
innerHTML: sanitizedTitle.value
|
|
24059
|
-
}, null, 8, _hoisted_1$1b)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
24073
|
+
}, null, 8, _hoisted_1$1b)) : (openBlock(), createElementBlock("div", _hoisted_2$P, [
|
|
24060
24074
|
createBaseVNode("strong", null, toDisplayString(title.value), 1)
|
|
24061
24075
|
]));
|
|
24062
24076
|
};
|
|
24063
24077
|
}
|
|
24064
24078
|
});
|
|
24065
24079
|
const _hoisted_1$1a = ["innerHTML"];
|
|
24066
|
-
const _hoisted_2$
|
|
24080
|
+
const _hoisted_2$O = {
|
|
24067
24081
|
key: 1,
|
|
24068
24082
|
class: "lupa-search-box-product-description"
|
|
24069
24083
|
};
|
|
@@ -24090,7 +24104,7 @@ and ensure you are accounting for this risk.
|
|
|
24090
24104
|
key: 0,
|
|
24091
24105
|
class: "lupa-search-box-product-description",
|
|
24092
24106
|
innerHTML: sanitizedDescription.value
|
|
24093
|
-
}, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
24107
|
+
}, null, 8, _hoisted_1$1a)) : (openBlock(), createElementBlock("div", _hoisted_2$O, toDisplayString(description.value), 1));
|
|
24094
24108
|
};
|
|
24095
24109
|
}
|
|
24096
24110
|
});
|
|
@@ -24149,7 +24163,7 @@ and ensure you are accounting for this risk.
|
|
|
24149
24163
|
}
|
|
24150
24164
|
});
|
|
24151
24165
|
const _hoisted_1$18 = ["innerHTML"];
|
|
24152
|
-
const _hoisted_2$
|
|
24166
|
+
const _hoisted_2$N = { key: 0 };
|
|
24153
24167
|
const _hoisted_3$A = { key: 1 };
|
|
24154
24168
|
const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
|
|
24155
24169
|
const _hoisted_5$h = { class: "lupa-search-box-custom-text" };
|
|
@@ -24183,7 +24197,7 @@ and ensure you are accounting for this risk.
|
|
|
24183
24197
|
key: 1,
|
|
24184
24198
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
24185
24199
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
24186
|
-
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
24200
|
+
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$A, [
|
|
24187
24201
|
createBaseVNode("div", _hoisted_4$q, toDisplayString(label.value), 1),
|
|
24188
24202
|
createBaseVNode("div", _hoisted_5$h, toDisplayString(text.value), 1)
|
|
24189
24203
|
]))
|
|
@@ -24306,6 +24320,10 @@ and ensure you are accounting for this risk.
|
|
|
24306
24320
|
var _a, _b, _c;
|
|
24307
24321
|
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.currencyTemplate) != null ? _c : "";
|
|
24308
24322
|
});
|
|
24323
|
+
const filterTranslations = computed(() => {
|
|
24324
|
+
var _a, _b, _c;
|
|
24325
|
+
return (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.filters) == null ? void 0 : _b.translations) != null ? _c : {};
|
|
24326
|
+
});
|
|
24309
24327
|
const labeledFilters = computed(
|
|
24310
24328
|
() => getLabeledFilters(
|
|
24311
24329
|
unfoldFilters(filters.value, {
|
|
@@ -24314,7 +24332,8 @@ and ensure you are accounting for this risk.
|
|
|
24314
24332
|
separator: priceSeparator.value,
|
|
24315
24333
|
currencyTemplate: currencyTemplate.value
|
|
24316
24334
|
}),
|
|
24317
|
-
facets2.value
|
|
24335
|
+
facets2.value,
|
|
24336
|
+
filterTranslations.value
|
|
24318
24337
|
)
|
|
24319
24338
|
);
|
|
24320
24339
|
const displayFilters = computed(() => {
|
|
@@ -24497,7 +24516,7 @@ and ensure you are accounting for this risk.
|
|
|
24497
24516
|
};
|
|
24498
24517
|
});
|
|
24499
24518
|
const _hoisted_1$16 = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
24500
|
-
const _hoisted_2$
|
|
24519
|
+
const _hoisted_2$M = { class: "lupa-search-box-product-addtocart" };
|
|
24501
24520
|
const _hoisted_3$z = ["onClick", "disabled"];
|
|
24502
24521
|
const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
24503
24522
|
__name: "SearchBoxProductAddToCart",
|
|
@@ -24534,7 +24553,7 @@ and ensure you are accounting for this risk.
|
|
|
24534
24553
|
});
|
|
24535
24554
|
return (_ctx, _cache) => {
|
|
24536
24555
|
return openBlock(), createElementBlock("div", _hoisted_1$16, [
|
|
24537
|
-
createBaseVNode("div", _hoisted_2$
|
|
24556
|
+
createBaseVNode("div", _hoisted_2$M, [
|
|
24538
24557
|
createBaseVNode("button", mergeProps({
|
|
24539
24558
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
24540
24559
|
class: loading.value ? "lupa-add-to-cart-loading" : "lupa-add-to-cart",
|
|
@@ -24648,7 +24667,7 @@ and ensure you are accounting for this risk.
|
|
|
24648
24667
|
}
|
|
24649
24668
|
}));
|
|
24650
24669
|
const _hoisted_1$14 = { class: "lupa-badge-title" };
|
|
24651
|
-
const _hoisted_2$
|
|
24670
|
+
const _hoisted_2$L = ["src"];
|
|
24652
24671
|
const _hoisted_3$y = { key: 1 };
|
|
24653
24672
|
const _hoisted_4$p = {
|
|
24654
24673
|
key: 0,
|
|
@@ -24691,7 +24710,7 @@ and ensure you are accounting for this risk.
|
|
|
24691
24710
|
image.value ? (openBlock(), createElementBlock("img", {
|
|
24692
24711
|
key: 0,
|
|
24693
24712
|
src: image.value
|
|
24694
|
-
}, null, 8, _hoisted_2$
|
|
24713
|
+
}, null, 8, _hoisted_2$L)) : createCommentVNode("", true),
|
|
24695
24714
|
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$y, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
24696
24715
|
]),
|
|
24697
24716
|
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$p, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
@@ -24791,7 +24810,7 @@ and ensure you are accounting for this risk.
|
|
|
24791
24810
|
}
|
|
24792
24811
|
});
|
|
24793
24812
|
const _hoisted_1$10 = { class: "lupa-image-badges" };
|
|
24794
|
-
const _hoisted_2$
|
|
24813
|
+
const _hoisted_2$K = ["src"];
|
|
24795
24814
|
const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
24796
24815
|
__name: "ImageBadge",
|
|
24797
24816
|
props: {
|
|
@@ -24820,7 +24839,7 @@ and ensure you are accounting for this risk.
|
|
|
24820
24839
|
}, [
|
|
24821
24840
|
createBaseVNode("img", {
|
|
24822
24841
|
src: getImageUrl(item)
|
|
24823
|
-
}, null, 8, _hoisted_2$
|
|
24842
|
+
}, null, 8, _hoisted_2$K)
|
|
24824
24843
|
]);
|
|
24825
24844
|
}), 128))
|
|
24826
24845
|
]);
|
|
@@ -24979,7 +24998,7 @@ and ensure you are accounting for this risk.
|
|
|
24979
24998
|
}
|
|
24980
24999
|
}));
|
|
24981
25000
|
const _hoisted_1$_ = ["href"];
|
|
24982
|
-
const _hoisted_2$
|
|
25001
|
+
const _hoisted_2$J = { class: "lupa-search-box-product-details-section" };
|
|
24983
25002
|
const _hoisted_3$x = {
|
|
24984
25003
|
key: 0,
|
|
24985
25004
|
class: "lupa-search-box-product-add-to-cart-section"
|
|
@@ -25080,7 +25099,7 @@ and ensure you are accounting for this risk.
|
|
|
25080
25099
|
}, null, 8, ["item", "element", "labels", "link"]);
|
|
25081
25100
|
}), 128))
|
|
25082
25101
|
], 4),
|
|
25083
|
-
createBaseVNode("div", _hoisted_2$
|
|
25102
|
+
createBaseVNode("div", _hoisted_2$J, [
|
|
25084
25103
|
(openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
|
|
25085
25104
|
var _a;
|
|
25086
25105
|
return openBlock(), createBlock(_sfc_main$1e, {
|
|
@@ -25286,7 +25305,7 @@ and ensure you are accounting for this risk.
|
|
|
25286
25305
|
}
|
|
25287
25306
|
});
|
|
25288
25307
|
const _hoisted_1$Y = { class: "lupa-search-box-documents-go-to-results-wrapper" };
|
|
25289
|
-
const _hoisted_2$
|
|
25308
|
+
const _hoisted_2$I = { key: 0 };
|
|
25290
25309
|
const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
25291
25310
|
__name: "SearchBoxProductsGoToResultsButton",
|
|
25292
25311
|
props: {
|
|
@@ -25323,7 +25342,7 @@ and ensure you are accounting for this risk.
|
|
|
25323
25342
|
onClick: goToResults
|
|
25324
25343
|
}, [
|
|
25325
25344
|
createTextVNode(toDisplayString(goToResultsLabel.value) + " ", 1),
|
|
25326
|
-
totalCount.value ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
25345
|
+
totalCount.value ? (openBlock(), createElementBlock("span", _hoisted_2$I, " " + toDisplayString(totalCount.value), 1)) : createCommentVNode("", true)
|
|
25327
25346
|
])
|
|
25328
25347
|
]);
|
|
25329
25348
|
};
|
|
@@ -25591,7 +25610,7 @@ and ensure you are accounting for this risk.
|
|
|
25591
25610
|
key: 0,
|
|
25592
25611
|
id: "lupa-search-box-panel"
|
|
25593
25612
|
};
|
|
25594
|
-
const _hoisted_2$
|
|
25613
|
+
const _hoisted_2$H = ["data-cy"];
|
|
25595
25614
|
const _hoisted_3$w = {
|
|
25596
25615
|
key: 0,
|
|
25597
25616
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
@@ -25811,7 +25830,7 @@ and ensure you are accounting for this risk.
|
|
|
25811
25830
|
key: "0"
|
|
25812
25831
|
} : void 0
|
|
25813
25832
|
]), 1064, ["panel", "search-box-options", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
25814
|
-
], 14, _hoisted_2$
|
|
25833
|
+
], 14, _hoisted_2$H);
|
|
25815
25834
|
}), 128))
|
|
25816
25835
|
], 4),
|
|
25817
25836
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1r, {
|
|
@@ -25850,8 +25869,7 @@ and ensure you are accounting for this risk.
|
|
|
25850
25869
|
const elements = getElements(triggers);
|
|
25851
25870
|
elements.forEach((e2) => e2 == null ? void 0 : e2.removeEventListener(BIND_EVENT, event));
|
|
25852
25871
|
};
|
|
25853
|
-
const _hoisted_1$W = {
|
|
25854
|
-
const _hoisted_2$H = { class: "lupa-search-box-wrapper" };
|
|
25872
|
+
const _hoisted_1$W = { class: "lupa-search-box-wrapper" };
|
|
25855
25873
|
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
25856
25874
|
__name: "SearchBox",
|
|
25857
25875
|
props: {
|
|
@@ -26162,8 +26180,11 @@ and ensure you are accounting for this risk.
|
|
|
26162
26180
|
};
|
|
26163
26181
|
return (_ctx, _cache) => {
|
|
26164
26182
|
var _a2;
|
|
26165
|
-
return openBlock(), createElementBlock("div",
|
|
26166
|
-
|
|
26183
|
+
return openBlock(), createElementBlock("div", {
|
|
26184
|
+
id: "lupa-search-box",
|
|
26185
|
+
class: normalizeClass({ "lupa-search-box-opened": opened.value })
|
|
26186
|
+
}, [
|
|
26187
|
+
createBaseVNode("div", _hoisted_1$W, [
|
|
26167
26188
|
createVNode(_sfc_main$1v, {
|
|
26168
26189
|
options: inputOptions.value,
|
|
26169
26190
|
suggestedValue: suggestedValue.value,
|
|
@@ -26198,7 +26219,7 @@ and ensure you are accounting for this risk.
|
|
|
26198
26219
|
} : void 0
|
|
26199
26220
|
]), 1032, ["options", "inputValue", "isSearchContainer", "focused"])) : createCommentVNode("", true)
|
|
26200
26221
|
])
|
|
26201
|
-
]);
|
|
26222
|
+
], 2);
|
|
26202
26223
|
};
|
|
26203
26224
|
}
|
|
26204
26225
|
});
|
|
@@ -26792,6 +26813,8 @@ and ensure you are accounting for this risk.
|
|
|
26792
26813
|
setup(__props, { emit: emit2 }) {
|
|
26793
26814
|
const props = __props;
|
|
26794
26815
|
const searchResultStore = useSearchResultStore();
|
|
26816
|
+
const optionsStore = useOptionsStore();
|
|
26817
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
26795
26818
|
const facet = computed(() => {
|
|
26796
26819
|
var _a;
|
|
26797
26820
|
return (_a = props.facet) != null ? _a : { type: "terms", items: [], key: "" };
|
|
@@ -26851,6 +26874,10 @@ and ensure you are accounting for this risk.
|
|
|
26851
26874
|
selectedItems = isRange.value && selectedItems ? [rangeFilterToString(selectedItems)] : selectedItems;
|
|
26852
26875
|
return selectedItems == null ? void 0 : selectedItems.includes((_b = item.title) == null ? void 0 : _b.toString());
|
|
26853
26876
|
};
|
|
26877
|
+
const getItemLabel = (item) => {
|
|
26878
|
+
var _a;
|
|
26879
|
+
return getTranslatedFacetValue(props.facet, item, (_a = searchResultOptions.value.filters) == null ? void 0 : _a.translations);
|
|
26880
|
+
};
|
|
26854
26881
|
return (_ctx, _cache) => {
|
|
26855
26882
|
return openBlock(), createElementBlock("div", _hoisted_1$O, [
|
|
26856
26883
|
isFilterable.value ? withDirectives((openBlock(), createElementBlock("input", {
|
|
@@ -26876,7 +26903,7 @@ and ensure you are accounting for this risk.
|
|
|
26876
26903
|
}, null, 2)
|
|
26877
26904
|
]),
|
|
26878
26905
|
createBaseVNode("div", _hoisted_6$8, [
|
|
26879
|
-
createBaseVNode("span", _hoisted_7$6, toDisplayString(item
|
|
26906
|
+
createBaseVNode("span", _hoisted_7$6, toDisplayString(getItemLabel(item)), 1),
|
|
26880
26907
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
26881
26908
|
])
|
|
26882
26909
|
], 10, _hoisted_4$j);
|
|
@@ -28360,7 +28387,9 @@ and ensure you are accounting for this risk.
|
|
|
28360
28387
|
return (_a2 = props.currentFilters) != null ? _a2 : {};
|
|
28361
28388
|
});
|
|
28362
28389
|
const searchResultStore = useSearchResultStore();
|
|
28390
|
+
const optionsStore = useOptionsStore();
|
|
28363
28391
|
const { currentFilterKeys } = storeToRefs(searchResultStore);
|
|
28392
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
28364
28393
|
const isOpen = ref((_b = (_a = props.options.expand) == null ? void 0 : _a.includes(props.facet.key)) != null ? _b : false);
|
|
28365
28394
|
const facetPanel = ref(null);
|
|
28366
28395
|
const facetType = computed(() => {
|
|
@@ -28399,6 +28428,10 @@ and ensure you are accounting for this risk.
|
|
|
28399
28428
|
const facetKeyClass = computed(() => {
|
|
28400
28429
|
return `lupa-facet-${facet.value.key}`;
|
|
28401
28430
|
});
|
|
28431
|
+
const facetLabel = computed(() => {
|
|
28432
|
+
var _a2;
|
|
28433
|
+
return getTranslatedFacetKey(props.facet, (_a2 = searchResultOptions.value.filters) == null ? void 0 : _a2.translations);
|
|
28434
|
+
});
|
|
28402
28435
|
onMounted(() => {
|
|
28403
28436
|
var _a2;
|
|
28404
28437
|
if (((_a2 = props.options.style) == null ? void 0 : _a2.type) === "top-dropdown") {
|
|
@@ -28454,7 +28487,7 @@ and ensure you are accounting for this risk.
|
|
|
28454
28487
|
"data-cy": "lupa-search-result-facet-label",
|
|
28455
28488
|
onClick: toggleFacet
|
|
28456
28489
|
}, [
|
|
28457
|
-
createBaseVNode("div", _hoisted_1$K, toDisplayString(
|
|
28490
|
+
createBaseVNode("div", _hoisted_1$K, toDisplayString(facetLabel.value), 1),
|
|
28458
28491
|
createBaseVNode("div", {
|
|
28459
28492
|
class: normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
|
|
28460
28493
|
}, null, 2)
|
|
@@ -28956,10 +28989,10 @@ and ensure you are accounting for this risk.
|
|
|
28956
28989
|
const activeLabel = computed(() => props.labels.mobileFilterButtonActive);
|
|
28957
28990
|
const openLabel = computed(() => props.labels.mobileFilterButtonOpen);
|
|
28958
28991
|
const label = computed(() => {
|
|
28959
|
-
if (isSidebarVisible.value) {
|
|
28992
|
+
if (isSidebarVisible.value && openLabel.value) {
|
|
28960
28993
|
return openLabel.value;
|
|
28961
28994
|
}
|
|
28962
|
-
if (hasActiveFilters.value) {
|
|
28995
|
+
if (hasActiveFilters.value && activeLabel.value) {
|
|
28963
28996
|
return activeLabel.value;
|
|
28964
28997
|
}
|
|
28965
28998
|
return defaultLabel.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getlupa/client",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.6",
|
|
4
4
|
"main": "dist/lupaSearch.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@getlupa/client-sdk": "^1.3.4",
|
|
23
|
-
"@getlupa/vue": "0.17.
|
|
23
|
+
"@getlupa/vue": "0.17.6",
|
|
24
24
|
"@rushstack/eslint-patch": "^1.3.2",
|
|
25
25
|
"@tsconfig/node18": "^2.0.1",
|
|
26
26
|
"@types/jsdom": "^21.1.1",
|
|
@@ -50,5 +50,6 @@
|
|
|
50
50
|
"vitest": "^0.32.0",
|
|
51
51
|
"vue": "^3.3.4",
|
|
52
52
|
"vue-tsc": "^1.6.5"
|
|
53
|
-
}
|
|
53
|
+
},
|
|
54
|
+
"packageManager": "yarn@1.22.19"
|
|
54
55
|
}
|