@getlupa/vue 0.11.2 → 0.11.5
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
CHANGED
|
@@ -3739,14 +3739,15 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
3739
3739
|
result,
|
|
3740
3740
|
mode
|
|
3741
3741
|
}) {
|
|
3742
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3742
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3743
3743
|
const enabledForMode = mode === "searchBox" ? isDynamicDataEnabledForSearchBox.value : isDynamicDataEnabledForSearchResults.value;
|
|
3744
3744
|
if (!result || !enabledForMode) {
|
|
3745
3745
|
return;
|
|
3746
3746
|
}
|
|
3747
3747
|
const resultIds = (_b = (_a = result == null ? void 0 : result.items) == null ? void 0 : _a.map((i) => i.id)) != null ? _b : [];
|
|
3748
3748
|
const similarQueryResultIds = (_e = (_d = (_c = result.similarQueries) == null ? void 0 : _c.map((q) => q.items.map((i) => i.id))) == null ? void 0 : _d.flat()) != null ? _e : [];
|
|
3749
|
-
|
|
3749
|
+
const similarResultIds = (_g = (_f = result.similarResults) == null ? void 0 : _f.items.map((i) => i.id)) != null ? _g : [];
|
|
3750
|
+
let requestedIds = [...resultIds, ...similarQueryResultIds, ...similarResultIds];
|
|
3750
3751
|
if (isCacheEnabled.value) {
|
|
3751
3752
|
requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
|
|
3752
3753
|
}
|
|
@@ -3760,7 +3761,7 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
3760
3761
|
if (!(dynamicData == null ? void 0 : dynamicData.handler)) {
|
|
3761
3762
|
return {};
|
|
3762
3763
|
}
|
|
3763
|
-
const dynamicDataResult = (
|
|
3764
|
+
const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
|
|
3764
3765
|
const seed = {};
|
|
3765
3766
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
3766
3767
|
(a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
|
|
@@ -5908,12 +5909,16 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
|
5908
5909
|
var _a, _b;
|
|
5909
5910
|
return (_b = (_a = props.options.labels) == null ? void 0 : _a.itemCount) != null ? _b : "";
|
|
5910
5911
|
});
|
|
5912
|
+
const searchResultsCountLabel = vue.computed(() => {
|
|
5913
|
+
var _a, _b;
|
|
5914
|
+
return (_b = (_a = props.options.labels) == null ? void 0 : _a.searchResultsCount) != null ? _b : "";
|
|
5915
|
+
});
|
|
5911
5916
|
return (_ctx, _cache) => {
|
|
5912
5917
|
return vue.openBlock(), vue.createElementBlock("div", null, [
|
|
5913
5918
|
showSearchTitle.value ? (vue.openBlock(), vue.createElementBlock("h1", _hoisted_1$P, [
|
|
5914
5919
|
vue.createTextVNode(vue.toDisplayString(_ctx.options.labels.searchResults), 1),
|
|
5915
5920
|
queryText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$C, "'" + vue.toDisplayString(queryText.value) + "'", 1)) : vue.createCommentVNode("", true),
|
|
5916
|
-
showProductCount.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$s, "(" + vue.toDisplayString(vue.unref(totalItems)) + ")", 1)) : vue.createCommentVNode("", true)
|
|
5921
|
+
showProductCount.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$s, "(" + vue.toDisplayString(searchResultsCountLabel.value) + vue.toDisplayString(vue.unref(totalItems)) + ")", 1)) : vue.createCommentVNode("", true)
|
|
5917
5922
|
])) : vue.createCommentVNode("", true),
|
|
5918
5923
|
_ctx.showSummary ? (vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
5919
5924
|
key: 1,
|
|
@@ -6239,11 +6244,11 @@ const _hoisted_4$i = ["onClick"];
|
|
|
6239
6244
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
6240
6245
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
6241
6246
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
6242
|
-
const _hoisted_8$
|
|
6247
|
+
const _hoisted_8$2 = {
|
|
6243
6248
|
key: 0,
|
|
6244
6249
|
class: "lupa-term-count"
|
|
6245
6250
|
};
|
|
6246
|
-
const _hoisted_9$
|
|
6251
|
+
const _hoisted_9$2 = { key: 0 };
|
|
6247
6252
|
const _hoisted_10$1 = { key: 1 };
|
|
6248
6253
|
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
6249
6254
|
__name: "TermFacet",
|
|
@@ -6339,7 +6344,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
6339
6344
|
]),
|
|
6340
6345
|
vue.createElementVNode("div", _hoisted_6$8, [
|
|
6341
6346
|
vue.createElementVNode("span", _hoisted_7$6, vue.toDisplayString(item.title), 1),
|
|
6342
|
-
_ctx.options.showDocumentCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$
|
|
6347
|
+
_ctx.options.showDocumentCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$2, "(" + vue.toDisplayString(item.count) + ")", 1)) : vue.createCommentVNode("", true)
|
|
6343
6348
|
])
|
|
6344
6349
|
], 10, _hoisted_4$i);
|
|
6345
6350
|
}), 128))
|
|
@@ -6350,7 +6355,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
6350
6355
|
"data-cy": "lupa-facet-term",
|
|
6351
6356
|
onClick: toggleShowAll
|
|
6352
6357
|
}, [
|
|
6353
|
-
showAll.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$
|
|
6358
|
+
showAll.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$2, vue.toDisplayString(_ctx.options.labels.showLess), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_10$1, vue.toDisplayString(_ctx.options.labels.showAll), 1))
|
|
6354
6359
|
])) : vue.createCommentVNode("", true)
|
|
6355
6360
|
]);
|
|
6356
6361
|
};
|
|
@@ -7348,8 +7353,8 @@ const _hoisted_4$h = {
|
|
|
7348
7353
|
const _hoisted_5$b = { class: "lupa-stats-from" };
|
|
7349
7354
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
7350
7355
|
const _hoisted_7$5 = { key: 0 };
|
|
7351
|
-
const _hoisted_8 = /* @__PURE__ */ vue.createElementVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
7352
|
-
const _hoisted_9 = {
|
|
7356
|
+
const _hoisted_8$1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
7357
|
+
const _hoisted_9$1 = {
|
|
7353
7358
|
key: 0,
|
|
7354
7359
|
class: "lupa-stats-range-label"
|
|
7355
7360
|
};
|
|
@@ -7557,9 +7562,9 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
7557
7562
|
isPrice.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$5, vue.toDisplayString(currency.value), 1)) : vue.createCommentVNode("", true)
|
|
7558
7563
|
])
|
|
7559
7564
|
]),
|
|
7560
|
-
_hoisted_8,
|
|
7565
|
+
_hoisted_8$1,
|
|
7561
7566
|
vue.createElementVNode("div", null, [
|
|
7562
|
-
rangeLabelTo.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, vue.toDisplayString(rangeLabelTo.value), 1)) : vue.createCommentVNode("", true),
|
|
7567
|
+
rangeLabelTo.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, vue.toDisplayString(rangeLabelTo.value), 1)) : vue.createCommentVNode("", true),
|
|
7563
7568
|
vue.createElementVNode("div", _hoisted_10, [
|
|
7564
7569
|
vue.withDirectives(vue.createElementVNode("input", {
|
|
7565
7570
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
@@ -8648,12 +8653,20 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
8648
8653
|
}
|
|
8649
8654
|
});
|
|
8650
8655
|
const _hoisted_1$t = { class: "lupa-toolbar-left" };
|
|
8651
|
-
const _hoisted_2$m = {
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
const
|
|
8656
|
-
const
|
|
8656
|
+
const _hoisted_2$m = {
|
|
8657
|
+
key: 0,
|
|
8658
|
+
class: "lupa-toolbar-right-title"
|
|
8659
|
+
};
|
|
8660
|
+
const _hoisted_3$f = { key: 2 };
|
|
8661
|
+
const _hoisted_4$a = { key: 4 };
|
|
8662
|
+
const _hoisted_5$7 = { key: 6 };
|
|
8663
|
+
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
8664
|
+
const _hoisted_7$3 = {
|
|
8665
|
+
key: 0,
|
|
8666
|
+
class: "lupa-toolbar-right-title"
|
|
8667
|
+
};
|
|
8668
|
+
const _hoisted_8 = { key: 2 };
|
|
8669
|
+
const _hoisted_9 = { key: 4 };
|
|
8657
8670
|
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
8658
8671
|
__name: "SearchResultsToolbar",
|
|
8659
8672
|
props: {
|
|
@@ -8734,6 +8747,14 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
8734
8747
|
const defaultLabel = (_c = (_b = (_a = paginationOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.itemCount) != null ? _c : "";
|
|
8735
8748
|
return !hasAnyFilter.value || !showFilterClear.value ? defaultLabel : (_f = (_e = (_d = paginationOptions.value) == null ? void 0 : _d.labels) == null ? void 0 : _e.filteredItemCount) != null ? _f : defaultLabel;
|
|
8736
8749
|
});
|
|
8750
|
+
const toolbarLeftLabel = vue.computed(() => {
|
|
8751
|
+
var _a;
|
|
8752
|
+
return (_a = optionsValue.value.labels.toolbarLeftLabel) != null ? _a : "";
|
|
8753
|
+
});
|
|
8754
|
+
const toolbarRightLabel = vue.computed(() => {
|
|
8755
|
+
var _a;
|
|
8756
|
+
return (_a = optionsValue.value.labels.toolbarRightLabel) != null ? _a : "";
|
|
8757
|
+
});
|
|
8737
8758
|
const showMobileFilterCount = vue.computed(() => {
|
|
8738
8759
|
var _a, _b, _c;
|
|
8739
8760
|
return Boolean((_c = (_b = (_a = optionsValue.value.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.mobileSidebar) == null ? void 0 : _c.showFilterCount);
|
|
@@ -8754,35 +8775,37 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
8754
8775
|
class: vue.normalizeClass({ "lupa-filter-no-results": !hasResults.value })
|
|
8755
8776
|
}, [
|
|
8756
8777
|
vue.createElementVNode("div", _hoisted_1$t, [
|
|
8757
|
-
|
|
8778
|
+
toolbarLeftLabel.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$m, vue.toDisplayString(toolbarLeftLabel.value), 1)) : vue.createCommentVNode("", true),
|
|
8779
|
+
showLayoutSelection.value ? (vue.openBlock(), vue.createBlock(_sfc_main$B, { key: 1 })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$f)),
|
|
8758
8780
|
showItemSummary.value ? (vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
8759
|
-
key:
|
|
8781
|
+
key: 3,
|
|
8760
8782
|
label: searchSummaryLabel.value,
|
|
8761
8783
|
clearable: vue.unref(hasAnyFilter) && showFilterClear.value,
|
|
8762
8784
|
onClear: handleClearAll
|
|
8763
|
-
}, null, 8, ["label", "clearable"])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
8785
|
+
}, null, 8, ["label", "clearable"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$a)),
|
|
8764
8786
|
displayPageSelect.value ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
|
|
8765
|
-
key:
|
|
8787
|
+
key: 5,
|
|
8766
8788
|
options: paginationOptions.value.pageSelect,
|
|
8767
8789
|
"last-page-label": paginationOptions.value.labels.showMore,
|
|
8768
8790
|
"first-page-label": paginationOptions.value.labels.showLess
|
|
8769
|
-
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
8791
|
+
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$7))
|
|
8770
8792
|
]),
|
|
8771
|
-
vue.createElementVNode("div",
|
|
8793
|
+
vue.createElementVNode("div", _hoisted_6$5, [
|
|
8794
|
+
toolbarRightLabel.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$3, vue.toDisplayString(toolbarRightLabel.value), 1)) : vue.createCommentVNode("", true),
|
|
8772
8795
|
vue.createVNode(_sfc_main$A, {
|
|
8773
8796
|
label: optionsValue.value.labels.mobileFilterButton,
|
|
8774
8797
|
"show-filter-count": showMobileFilterCount.value
|
|
8775
8798
|
}, null, 8, ["label", "show-filter-count"]),
|
|
8776
8799
|
paginationDisplay.value.pageSize ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
|
|
8777
|
-
key:
|
|
8800
|
+
key: 1,
|
|
8778
8801
|
options: paginationOptions.value.pageSize,
|
|
8779
8802
|
label: paginationOptions.value.labels.pageSize
|
|
8780
|
-
}, null, 8, ["options", "label"])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
8803
|
+
}, null, 8, ["options", "label"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8)),
|
|
8781
8804
|
sortOptions.value ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
8782
|
-
key:
|
|
8805
|
+
key: 3,
|
|
8783
8806
|
options: sortOptions.value,
|
|
8784
8807
|
callbacks: callbacks.value
|
|
8785
|
-
}, null, 8, ["options", "callbacks"])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
8808
|
+
}, null, 8, ["options", "callbacks"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_9))
|
|
8786
8809
|
])
|
|
8787
8810
|
], 2);
|
|
8788
8811
|
};
|
|
@@ -9785,7 +9808,7 @@ const _hoisted_2$b = {
|
|
|
9785
9808
|
"data-cy": "lupa-products"
|
|
9786
9809
|
};
|
|
9787
9810
|
const _hoisted_3$6 = {
|
|
9788
|
-
key:
|
|
9811
|
+
key: 1,
|
|
9789
9812
|
class: "lupa-empty-results",
|
|
9790
9813
|
"data-cy": "lupa-no-results-in-page"
|
|
9791
9814
|
};
|
|
@@ -9855,6 +9878,10 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9855
9878
|
var _a;
|
|
9856
9879
|
return currentFilterToolbarVisible.value ? (_a = props.options.filters) == null ? void 0 : _a.currentFilters : void 0;
|
|
9857
9880
|
});
|
|
9881
|
+
const currentFilterPositionDesktop = vue.computed(() => {
|
|
9882
|
+
var _a, _b, _c;
|
|
9883
|
+
return ((_c = (_b = (_a = props.options.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.desktopToolbar) == null ? void 0 : _c.position) || "pageTop";
|
|
9884
|
+
});
|
|
9858
9885
|
const currentFiltersClass = vue.computed(() => {
|
|
9859
9886
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
9860
9887
|
if (!currentFilterToolbarVisible.value) {
|
|
@@ -9916,7 +9943,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9916
9943
|
"pagination-location": "top",
|
|
9917
9944
|
onFilter: filter
|
|
9918
9945
|
}, null, 8, ["options"])) : vue.createCommentVNode("", true),
|
|
9919
|
-
currentFilterOptions.value ? (vue.openBlock(), vue.createBlock(_sfc_main$Q, {
|
|
9946
|
+
currentFilterOptions.value && currentFilterPositionDesktop.value === "pageTop" ? (vue.openBlock(), vue.createBlock(_sfc_main$Q, {
|
|
9920
9947
|
key: 2,
|
|
9921
9948
|
class: vue.normalizeClass(currentFiltersClass.value),
|
|
9922
9949
|
"data-cy": "lupa-search-result-filters-mobile-toolbar",
|
|
@@ -9935,6 +9962,13 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9935
9962
|
options: _ctx.options,
|
|
9936
9963
|
"pagination-location": "top"
|
|
9937
9964
|
}, null, 8, ["options"]),
|
|
9965
|
+
currentFilterOptions.value && currentFilterPositionDesktop.value === "resultsTop" ? (vue.openBlock(), vue.createBlock(_sfc_main$Q, {
|
|
9966
|
+
key: 0,
|
|
9967
|
+
class: vue.normalizeClass(currentFiltersClass.value),
|
|
9968
|
+
"data-cy": "lupa-search-result-filters-mobile-toolbar",
|
|
9969
|
+
options: currentFilterOptions.value,
|
|
9970
|
+
expandable: !desktopFiltersExpanded.value
|
|
9971
|
+
}, null, 8, ["class", "options", "expandable"])) : vue.createCommentVNode("", true),
|
|
9938
9972
|
vue.createElementVNode("div", _hoisted_2$b, [
|
|
9939
9973
|
_ctx.$slots.productCard ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(searchResult).items, (product, index) => {
|
|
9940
9974
|
return vue.renderSlot(_ctx.$slots, "productCard", {
|
|
@@ -10142,12 +10176,12 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
10142
10176
|
queryKey,
|
|
10143
10177
|
results
|
|
10144
10178
|
}) {
|
|
10145
|
-
var _a, _b, _c, _d;
|
|
10179
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10146
10180
|
trackingStore.trackResults({ queryKey, results });
|
|
10147
10181
|
const hasResults2 = Boolean(
|
|
10148
|
-
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options)
|
|
10182
|
+
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options) || ((_d = (_c = results.similarResults) == null ? void 0 : _c.items) == null ? void 0 : _d.length)
|
|
10149
10183
|
);
|
|
10150
|
-
(
|
|
10184
|
+
(_f = (_e = props.options.callbacks) == null ? void 0 : _e.onSearchResults) == null ? void 0 : _f.call(_e, { queryKey, hasResults: hasResults2, params: paramStore.params });
|
|
10151
10185
|
if (!hasResults2) {
|
|
10152
10186
|
return;
|
|
10153
10187
|
}
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -3737,14 +3737,15 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
3737
3737
|
result,
|
|
3738
3738
|
mode
|
|
3739
3739
|
}) {
|
|
3740
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3740
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3741
3741
|
const enabledForMode = mode === "searchBox" ? isDynamicDataEnabledForSearchBox.value : isDynamicDataEnabledForSearchResults.value;
|
|
3742
3742
|
if (!result || !enabledForMode) {
|
|
3743
3743
|
return;
|
|
3744
3744
|
}
|
|
3745
3745
|
const resultIds = (_b = (_a = result == null ? void 0 : result.items) == null ? void 0 : _a.map((i) => i.id)) != null ? _b : [];
|
|
3746
3746
|
const similarQueryResultIds = (_e = (_d = (_c = result.similarQueries) == null ? void 0 : _c.map((q) => q.items.map((i) => i.id))) == null ? void 0 : _d.flat()) != null ? _e : [];
|
|
3747
|
-
|
|
3747
|
+
const similarResultIds = (_g = (_f = result.similarResults) == null ? void 0 : _f.items.map((i) => i.id)) != null ? _g : [];
|
|
3748
|
+
let requestedIds = [...resultIds, ...similarQueryResultIds, ...similarResultIds];
|
|
3748
3749
|
if (isCacheEnabled.value) {
|
|
3749
3750
|
requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
|
|
3750
3751
|
}
|
|
@@ -3758,7 +3759,7 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
3758
3759
|
if (!(dynamicData == null ? void 0 : dynamicData.handler)) {
|
|
3759
3760
|
return {};
|
|
3760
3761
|
}
|
|
3761
|
-
const dynamicDataResult = (
|
|
3762
|
+
const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
|
|
3762
3763
|
const seed = {};
|
|
3763
3764
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
3764
3765
|
(a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
|
|
@@ -5906,12 +5907,16 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
5906
5907
|
var _a, _b;
|
|
5907
5908
|
return (_b = (_a = props.options.labels) == null ? void 0 : _a.itemCount) != null ? _b : "";
|
|
5908
5909
|
});
|
|
5910
|
+
const searchResultsCountLabel = computed(() => {
|
|
5911
|
+
var _a, _b;
|
|
5912
|
+
return (_b = (_a = props.options.labels) == null ? void 0 : _a.searchResultsCount) != null ? _b : "";
|
|
5913
|
+
});
|
|
5909
5914
|
return (_ctx, _cache) => {
|
|
5910
5915
|
return openBlock(), createElementBlock("div", null, [
|
|
5911
5916
|
showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$P, [
|
|
5912
5917
|
createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
|
|
5913
5918
|
queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$C, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
|
|
5914
|
-
showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$s, "(" + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
|
|
5919
|
+
showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$s, "(" + toDisplayString(searchResultsCountLabel.value) + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
|
|
5915
5920
|
])) : createCommentVNode("", true),
|
|
5916
5921
|
_ctx.showSummary ? (openBlock(), createBlock(_sfc_main$T, {
|
|
5917
5922
|
key: 1,
|
|
@@ -6237,11 +6242,11 @@ const _hoisted_4$i = ["onClick"];
|
|
|
6237
6242
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
6238
6243
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
6239
6244
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
6240
|
-
const _hoisted_8$
|
|
6245
|
+
const _hoisted_8$2 = {
|
|
6241
6246
|
key: 0,
|
|
6242
6247
|
class: "lupa-term-count"
|
|
6243
6248
|
};
|
|
6244
|
-
const _hoisted_9$
|
|
6249
|
+
const _hoisted_9$2 = { key: 0 };
|
|
6245
6250
|
const _hoisted_10$1 = { key: 1 };
|
|
6246
6251
|
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
6247
6252
|
__name: "TermFacet",
|
|
@@ -6337,7 +6342,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
6337
6342
|
]),
|
|
6338
6343
|
createElementVNode("div", _hoisted_6$8, [
|
|
6339
6344
|
createElementVNode("span", _hoisted_7$6, toDisplayString(item.title), 1),
|
|
6340
|
-
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$
|
|
6345
|
+
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
6341
6346
|
])
|
|
6342
6347
|
], 10, _hoisted_4$i);
|
|
6343
6348
|
}), 128))
|
|
@@ -6348,7 +6353,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
6348
6353
|
"data-cy": "lupa-facet-term",
|
|
6349
6354
|
onClick: toggleShowAll
|
|
6350
6355
|
}, [
|
|
6351
|
-
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$
|
|
6356
|
+
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$2, toDisplayString(_ctx.options.labels.showLess), 1)) : (openBlock(), createElementBlock("span", _hoisted_10$1, toDisplayString(_ctx.options.labels.showAll), 1))
|
|
6352
6357
|
])) : createCommentVNode("", true)
|
|
6353
6358
|
]);
|
|
6354
6359
|
};
|
|
@@ -7346,8 +7351,8 @@ const _hoisted_4$h = {
|
|
|
7346
7351
|
const _hoisted_5$b = { class: "lupa-stats-from" };
|
|
7347
7352
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
7348
7353
|
const _hoisted_7$5 = { key: 0 };
|
|
7349
|
-
const _hoisted_8 = /* @__PURE__ */ createElementVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
7350
|
-
const _hoisted_9 = {
|
|
7354
|
+
const _hoisted_8$1 = /* @__PURE__ */ createElementVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
7355
|
+
const _hoisted_9$1 = {
|
|
7351
7356
|
key: 0,
|
|
7352
7357
|
class: "lupa-stats-range-label"
|
|
7353
7358
|
};
|
|
@@ -7555,9 +7560,9 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
7555
7560
|
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
|
|
7556
7561
|
])
|
|
7557
7562
|
]),
|
|
7558
|
-
_hoisted_8,
|
|
7563
|
+
_hoisted_8$1,
|
|
7559
7564
|
createElementVNode("div", null, [
|
|
7560
|
-
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
7565
|
+
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
7561
7566
|
createElementVNode("div", _hoisted_10, [
|
|
7562
7567
|
withDirectives(createElementVNode("input", {
|
|
7563
7568
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
@@ -8646,12 +8651,20 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
8646
8651
|
}
|
|
8647
8652
|
});
|
|
8648
8653
|
const _hoisted_1$t = { class: "lupa-toolbar-left" };
|
|
8649
|
-
const _hoisted_2$m = {
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
const
|
|
8654
|
-
const
|
|
8654
|
+
const _hoisted_2$m = {
|
|
8655
|
+
key: 0,
|
|
8656
|
+
class: "lupa-toolbar-right-title"
|
|
8657
|
+
};
|
|
8658
|
+
const _hoisted_3$f = { key: 2 };
|
|
8659
|
+
const _hoisted_4$a = { key: 4 };
|
|
8660
|
+
const _hoisted_5$7 = { key: 6 };
|
|
8661
|
+
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
8662
|
+
const _hoisted_7$3 = {
|
|
8663
|
+
key: 0,
|
|
8664
|
+
class: "lupa-toolbar-right-title"
|
|
8665
|
+
};
|
|
8666
|
+
const _hoisted_8 = { key: 2 };
|
|
8667
|
+
const _hoisted_9 = { key: 4 };
|
|
8655
8668
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
8656
8669
|
__name: "SearchResultsToolbar",
|
|
8657
8670
|
props: {
|
|
@@ -8732,6 +8745,14 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
8732
8745
|
const defaultLabel = (_c = (_b = (_a = paginationOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.itemCount) != null ? _c : "";
|
|
8733
8746
|
return !hasAnyFilter.value || !showFilterClear.value ? defaultLabel : (_f = (_e = (_d = paginationOptions.value) == null ? void 0 : _d.labels) == null ? void 0 : _e.filteredItemCount) != null ? _f : defaultLabel;
|
|
8734
8747
|
});
|
|
8748
|
+
const toolbarLeftLabel = computed(() => {
|
|
8749
|
+
var _a;
|
|
8750
|
+
return (_a = optionsValue.value.labels.toolbarLeftLabel) != null ? _a : "";
|
|
8751
|
+
});
|
|
8752
|
+
const toolbarRightLabel = computed(() => {
|
|
8753
|
+
var _a;
|
|
8754
|
+
return (_a = optionsValue.value.labels.toolbarRightLabel) != null ? _a : "";
|
|
8755
|
+
});
|
|
8735
8756
|
const showMobileFilterCount = computed(() => {
|
|
8736
8757
|
var _a, _b, _c;
|
|
8737
8758
|
return Boolean((_c = (_b = (_a = optionsValue.value.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.mobileSidebar) == null ? void 0 : _c.showFilterCount);
|
|
@@ -8752,35 +8773,37 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
8752
8773
|
class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
|
|
8753
8774
|
}, [
|
|
8754
8775
|
createElementVNode("div", _hoisted_1$t, [
|
|
8755
|
-
|
|
8776
|
+
toolbarLeftLabel.value ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString(toolbarLeftLabel.value), 1)) : createCommentVNode("", true),
|
|
8777
|
+
showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 1 })) : (openBlock(), createElementBlock("div", _hoisted_3$f)),
|
|
8756
8778
|
showItemSummary.value ? (openBlock(), createBlock(_sfc_main$T, {
|
|
8757
|
-
key:
|
|
8779
|
+
key: 3,
|
|
8758
8780
|
label: searchSummaryLabel.value,
|
|
8759
8781
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
8760
8782
|
onClear: handleClearAll
|
|
8761
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div",
|
|
8783
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$a)),
|
|
8762
8784
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$z, {
|
|
8763
|
-
key:
|
|
8785
|
+
key: 5,
|
|
8764
8786
|
options: paginationOptions.value.pageSelect,
|
|
8765
8787
|
"last-page-label": paginationOptions.value.labels.showMore,
|
|
8766
8788
|
"first-page-label": paginationOptions.value.labels.showLess
|
|
8767
|
-
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div",
|
|
8789
|
+
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_5$7))
|
|
8768
8790
|
]),
|
|
8769
|
-
createElementVNode("div",
|
|
8791
|
+
createElementVNode("div", _hoisted_6$5, [
|
|
8792
|
+
toolbarRightLabel.value ? (openBlock(), createElementBlock("div", _hoisted_7$3, toDisplayString(toolbarRightLabel.value), 1)) : createCommentVNode("", true),
|
|
8770
8793
|
createVNode(_sfc_main$A, {
|
|
8771
8794
|
label: optionsValue.value.labels.mobileFilterButton,
|
|
8772
8795
|
"show-filter-count": showMobileFilterCount.value
|
|
8773
8796
|
}, null, 8, ["label", "show-filter-count"]),
|
|
8774
8797
|
paginationDisplay.value.pageSize ? (openBlock(), createBlock(_sfc_main$y, {
|
|
8775
|
-
key:
|
|
8798
|
+
key: 1,
|
|
8776
8799
|
options: paginationOptions.value.pageSize,
|
|
8777
8800
|
label: paginationOptions.value.labels.pageSize
|
|
8778
|
-
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div",
|
|
8801
|
+
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_8)),
|
|
8779
8802
|
sortOptions.value ? (openBlock(), createBlock(_sfc_main$x, {
|
|
8780
|
-
key:
|
|
8803
|
+
key: 3,
|
|
8781
8804
|
options: sortOptions.value,
|
|
8782
8805
|
callbacks: callbacks.value
|
|
8783
|
-
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div",
|
|
8806
|
+
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_9))
|
|
8784
8807
|
])
|
|
8785
8808
|
], 2);
|
|
8786
8809
|
};
|
|
@@ -9783,7 +9806,7 @@ const _hoisted_2$b = {
|
|
|
9783
9806
|
"data-cy": "lupa-products"
|
|
9784
9807
|
};
|
|
9785
9808
|
const _hoisted_3$6 = {
|
|
9786
|
-
key:
|
|
9809
|
+
key: 1,
|
|
9787
9810
|
class: "lupa-empty-results",
|
|
9788
9811
|
"data-cy": "lupa-no-results-in-page"
|
|
9789
9812
|
};
|
|
@@ -9853,6 +9876,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
9853
9876
|
var _a;
|
|
9854
9877
|
return currentFilterToolbarVisible.value ? (_a = props.options.filters) == null ? void 0 : _a.currentFilters : void 0;
|
|
9855
9878
|
});
|
|
9879
|
+
const currentFilterPositionDesktop = computed(() => {
|
|
9880
|
+
var _a, _b, _c;
|
|
9881
|
+
return ((_c = (_b = (_a = props.options.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.desktopToolbar) == null ? void 0 : _c.position) || "pageTop";
|
|
9882
|
+
});
|
|
9856
9883
|
const currentFiltersClass = computed(() => {
|
|
9857
9884
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
9858
9885
|
if (!currentFilterToolbarVisible.value) {
|
|
@@ -9914,7 +9941,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
9914
9941
|
"pagination-location": "top",
|
|
9915
9942
|
onFilter: filter
|
|
9916
9943
|
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
9917
|
-
currentFilterOptions.value ? (openBlock(), createBlock(_sfc_main$Q, {
|
|
9944
|
+
currentFilterOptions.value && currentFilterPositionDesktop.value === "pageTop" ? (openBlock(), createBlock(_sfc_main$Q, {
|
|
9918
9945
|
key: 2,
|
|
9919
9946
|
class: normalizeClass(currentFiltersClass.value),
|
|
9920
9947
|
"data-cy": "lupa-search-result-filters-mobile-toolbar",
|
|
@@ -9933,6 +9960,13 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
9933
9960
|
options: _ctx.options,
|
|
9934
9961
|
"pagination-location": "top"
|
|
9935
9962
|
}, null, 8, ["options"]),
|
|
9963
|
+
currentFilterOptions.value && currentFilterPositionDesktop.value === "resultsTop" ? (openBlock(), createBlock(_sfc_main$Q, {
|
|
9964
|
+
key: 0,
|
|
9965
|
+
class: normalizeClass(currentFiltersClass.value),
|
|
9966
|
+
"data-cy": "lupa-search-result-filters-mobile-toolbar",
|
|
9967
|
+
options: currentFilterOptions.value,
|
|
9968
|
+
expandable: !desktopFiltersExpanded.value
|
|
9969
|
+
}, null, 8, ["class", "options", "expandable"])) : createCommentVNode("", true),
|
|
9936
9970
|
createElementVNode("div", _hoisted_2$b, [
|
|
9937
9971
|
_ctx.$slots.productCard ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(searchResult).items, (product, index) => {
|
|
9938
9972
|
return renderSlot(_ctx.$slots, "productCard", {
|
|
@@ -10140,12 +10174,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
10140
10174
|
queryKey,
|
|
10141
10175
|
results
|
|
10142
10176
|
}) {
|
|
10143
|
-
var _a, _b, _c, _d;
|
|
10177
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10144
10178
|
trackingStore.trackResults({ queryKey, results });
|
|
10145
10179
|
const hasResults2 = Boolean(
|
|
10146
|
-
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options)
|
|
10180
|
+
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options) || ((_d = (_c = results.similarResults) == null ? void 0 : _c.items) == null ? void 0 : _d.length)
|
|
10147
10181
|
);
|
|
10148
|
-
(
|
|
10182
|
+
(_f = (_e = props.options.callbacks) == null ? void 0 : _e.onSearchResults) == null ? void 0 : _f.call(_e, { queryKey, hasResults: hasResults2, params: paramStore.params });
|
|
10149
10183
|
if (!hasResults2) {
|
|
10150
10184
|
return;
|
|
10151
10185
|
}
|
|
@@ -65,6 +65,7 @@ export type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchRe
|
|
|
65
65
|
currency: string;
|
|
66
66
|
priceSeparator?: string;
|
|
67
67
|
searchResults?: string;
|
|
68
|
+
searchResultsCount?: string;
|
|
68
69
|
itemCount: string;
|
|
69
70
|
emptyResults: string;
|
|
70
71
|
mobileFilterButton: string;
|
|
@@ -72,6 +73,8 @@ export type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchRe
|
|
|
72
73
|
outOfStock?: string;
|
|
73
74
|
noItemsInPage?: string;
|
|
74
75
|
backToFirstPage?: string;
|
|
76
|
+
toolbarRightLabel?: string;
|
|
77
|
+
toolbarLeftLabel?: string;
|
|
75
78
|
};
|
|
76
79
|
export type SearchResultsAdditionalPanels = {
|
|
77
80
|
additionalPanels?: SearchResultsAdditionalPanelOptions[];
|
|
@@ -146,6 +149,7 @@ export type ResultCurrentFilterOptions = {
|
|
|
146
149
|
};
|
|
147
150
|
desktopToolbar?: {
|
|
148
151
|
activeFiltersExpanded?: boolean;
|
|
152
|
+
position?: 'pageTop' | 'resultsTop';
|
|
149
153
|
};
|
|
150
154
|
};
|
|
151
155
|
export type FacetStyle = 'sidebar' | 'top-dropdown';
|