@getlupa/client 1.21.0 → 1.21.3
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/constants/searchResults.const.d.ts +0 -7
- package/dist/lupaSearch.iife.js +104 -31
- package/dist/lupaSearch.js +104 -31
- package/dist/lupaSearch.mjs +104 -31
- package/dist/lupaSearch.umd.js +104 -31
- package/package.json +2 -2
package/dist/lupaSearch.mjs
CHANGED
|
@@ -18098,6 +18098,10 @@ const useOptionsStore = /* @__PURE__ */ defineStore("options", () => {
|
|
|
18098
18098
|
return (_b25 = (_a25 = currentResolutionPageSizes.value) == null ? void 0 : _a25[0]) != null ? _b25 : DEFAULT_PAGE_SIZE;
|
|
18099
18099
|
}
|
|
18100
18100
|
);
|
|
18101
|
+
const ariaLabels = computed(() => {
|
|
18102
|
+
var _a25, _b25;
|
|
18103
|
+
return (_b25 = (_a25 = searchResultOptions.value.labels) == null ? void 0 : _a25.aria) != null ? _b25 : {};
|
|
18104
|
+
});
|
|
18101
18105
|
const currentResolutionPageSizes = computed(() => {
|
|
18102
18106
|
var _a25, _b25, _c, _d;
|
|
18103
18107
|
const pageSizes = (_d = (_c = (_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.pagination) == null ? void 0 : _b25.sizeSelection) == null ? void 0 : _c.sizes) != null ? _d : DEFAULT_PAGE_SIZE_SELECTION;
|
|
@@ -18153,6 +18157,7 @@ const useOptionsStore = /* @__PURE__ */ defineStore("options", () => {
|
|
|
18153
18157
|
defaultSearchResultPageSize,
|
|
18154
18158
|
currentResolutionPageSizes,
|
|
18155
18159
|
productRecommendationOptions,
|
|
18160
|
+
ariaLabels,
|
|
18156
18161
|
setSearchBoxOptions,
|
|
18157
18162
|
setTrackingOptions,
|
|
18158
18163
|
setSearchResultOptions,
|
|
@@ -18636,13 +18641,13 @@ const unfoldRangeFilter = (key, filter, price = {}) => {
|
|
|
18636
18641
|
}
|
|
18637
18642
|
];
|
|
18638
18643
|
}
|
|
18639
|
-
return [{ key, value: `${gt} - ${lt}`, type: "range" }];
|
|
18644
|
+
return [{ key, value: `${gt != null ? gt : "*"} - ${lt != null ? lt : "*"}`, type: "range" }];
|
|
18640
18645
|
};
|
|
18641
18646
|
const unfoldFilter = (key, filter, price = {}) => {
|
|
18642
18647
|
if (Array.isArray(filter)) {
|
|
18643
18648
|
return unfoldTermFilter(key, filter);
|
|
18644
18649
|
}
|
|
18645
|
-
if (filter.gte) {
|
|
18650
|
+
if (filter.gte || filter.lte || filter.gt || filter.lt) {
|
|
18646
18651
|
return unfoldRangeFilter(key, filter, price);
|
|
18647
18652
|
}
|
|
18648
18653
|
if (filter.terms) {
|
|
@@ -18695,8 +18700,9 @@ const recursiveFilterItem = (item, query = "") => {
|
|
|
18695
18700
|
}) : void 0;
|
|
18696
18701
|
};
|
|
18697
18702
|
const rangeFilterToString = (rangeFilter, separator) => {
|
|
18703
|
+
var _a25, _b25, _c;
|
|
18698
18704
|
separator = separator || FACET_TERM_RANGE_SEPARATOR;
|
|
18699
|
-
return rangeFilter && Object.keys(rangeFilter).length ? rangeFilter.gte + separator + (rangeFilter.lte || rangeFilter.lt) : "";
|
|
18705
|
+
return rangeFilter && Object.keys(rangeFilter).length ? ((_a25 = rangeFilter.gte) != null ? _a25 : "") + separator + (((_b25 = rangeFilter.lte) != null ? _b25 : "") || ((_c = rangeFilter.lt) != null ? _c : "")) : "";
|
|
18700
18706
|
};
|
|
18701
18707
|
const pick = (obj, keys) => {
|
|
18702
18708
|
const ret = /* @__PURE__ */ Object.create({});
|
|
@@ -18755,14 +18761,15 @@ const parseFacetKey = (key, searchParams) => {
|
|
|
18755
18761
|
return (_b25 = (_a25 = searchParams.getAll(key)) == null ? void 0 : _a25.map((v) => decodeURIComponent(v))) != null ? _b25 : [];
|
|
18756
18762
|
}
|
|
18757
18763
|
if (key.startsWith(FACET_PARAMS_TYPE.RANGE)) {
|
|
18764
|
+
const isPrice = key == null ? void 0 : key.includes(CURRENCY_KEY_INDICATOR);
|
|
18758
18765
|
const range2 = searchParams.get(key);
|
|
18759
18766
|
if (!range2) {
|
|
18760
18767
|
return {};
|
|
18761
18768
|
}
|
|
18762
18769
|
const [min, max] = range2.split(FACET_RANGE_SEPARATOR);
|
|
18763
18770
|
return {
|
|
18764
|
-
gte: min,
|
|
18765
|
-
lte: max
|
|
18771
|
+
gte: min || void 0,
|
|
18772
|
+
[isPrice ? "lte" : "lt"]: max || void 0
|
|
18766
18773
|
};
|
|
18767
18774
|
}
|
|
18768
18775
|
if (key.startsWith(FACET_PARAMS_TYPE.HIERARCHY)) {
|
|
@@ -18962,16 +18969,27 @@ const toggleHierarchyFilter = (appendParams, facetAction, getQueryParamName, cur
|
|
|
18962
18969
|
paramsToRemove: [getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.PAGE) : QUERY_PARAMS$1.PAGE]
|
|
18963
18970
|
});
|
|
18964
18971
|
};
|
|
18965
|
-
const toggleRangeFilter = (appendParams, facetAction, getQueryParamName, currentFilters) => {
|
|
18972
|
+
const toggleRangeFilter = (appendParams, removeParameters, facetAction, getQueryParamName, currentFilters) => {
|
|
18973
|
+
var _a25, _b25;
|
|
18966
18974
|
const currentFilter = rangeFilterToString(
|
|
18967
18975
|
currentFilters == null ? void 0 : currentFilters[facetAction.key],
|
|
18968
18976
|
FACET_RANGE_SEPARATOR
|
|
18969
18977
|
);
|
|
18970
|
-
let facetValue = facetAction.value.join(FACET_RANGE_SEPARATOR);
|
|
18978
|
+
let facetValue = (_b25 = (_a25 = facetAction == null ? void 0 : facetAction.value) == null ? void 0 : _a25.join(FACET_RANGE_SEPARATOR)) != null ? _b25 : "";
|
|
18971
18979
|
facetValue = currentFilter === facetValue ? "" : facetValue;
|
|
18980
|
+
const paramsToRemove = getQueryParamName ? [getQueryParamName(QUERY_PARAMS$1.PAGE)] : [QUERY_PARAMS$1.PAGE];
|
|
18981
|
+
if (!facetValue) {
|
|
18982
|
+
removeParameters({
|
|
18983
|
+
paramsToRemove: [
|
|
18984
|
+
getFacetParam(facetAction.key, "", FACET_PARAMS_TYPE.RANGE).name,
|
|
18985
|
+
...paramsToRemove
|
|
18986
|
+
]
|
|
18987
|
+
});
|
|
18988
|
+
return;
|
|
18989
|
+
}
|
|
18972
18990
|
appendParams({
|
|
18973
18991
|
params: [getFacetParam(facetAction.key, facetValue, FACET_PARAMS_TYPE.RANGE)],
|
|
18974
|
-
paramsToRemove
|
|
18992
|
+
paramsToRemove,
|
|
18975
18993
|
encode: false
|
|
18976
18994
|
});
|
|
18977
18995
|
};
|
|
@@ -19765,6 +19783,7 @@ const _hoisted_1$1l = {
|
|
|
19765
19783
|
const _hoisted_2$W = { class: "lupa-dialog-content" };
|
|
19766
19784
|
const _hoisted_3$E = { class: "lupa-listening-text" };
|
|
19767
19785
|
const _hoisted_4$u = { class: "lupa-mic-button-wrapper" };
|
|
19786
|
+
const _hoisted_5$l = ["aria-label"];
|
|
19768
19787
|
const _sfc_main$1z = /* @__PURE__ */ defineComponent({
|
|
19769
19788
|
__name: "VoiceSearchDialog",
|
|
19770
19789
|
props: {
|
|
@@ -19868,6 +19887,7 @@ const _sfc_main$1z = /* @__PURE__ */ defineComponent({
|
|
|
19868
19887
|
reset: dialogReset
|
|
19869
19888
|
});
|
|
19870
19889
|
return (_ctx, _cache) => {
|
|
19890
|
+
var _a25, _b25;
|
|
19871
19891
|
return openBlock(), createElementBlock("div", null, [
|
|
19872
19892
|
props.isOpen ? (openBlock(), createElementBlock("div", _hoisted_1$1l, [
|
|
19873
19893
|
createBaseVNode("button", {
|
|
@@ -19879,8 +19899,10 @@ const _sfc_main$1z = /* @__PURE__ */ defineComponent({
|
|
|
19879
19899
|
createBaseVNode("div", _hoisted_4$u, [
|
|
19880
19900
|
createBaseVNode("button", {
|
|
19881
19901
|
class: normalizeClass(["lupa-mic-button", { recording: unref(isRecording) }]),
|
|
19882
|
-
onClick: handleRecordingButtonClick
|
|
19883
|
-
|
|
19902
|
+
onClick: handleRecordingButtonClick,
|
|
19903
|
+
"aria-controls": "voice-search-microphone",
|
|
19904
|
+
"aria-label": ((_b25 = (_a25 = labels.value) == null ? void 0 : _a25.aria) == null ? void 0 : _b25.microphone) || "Toggle microphone"
|
|
19905
|
+
}, null, 10, _hoisted_5$l),
|
|
19884
19906
|
createVNode(_sfc_main$1A, {
|
|
19885
19907
|
ref_key: "voiceSearchProgressBar",
|
|
19886
19908
|
ref: voiceSearchProgressBar,
|
|
@@ -19906,6 +19928,7 @@ const _hoisted_6$8 = {
|
|
|
19906
19928
|
class: "lupa-close-label"
|
|
19907
19929
|
};
|
|
19908
19930
|
const _hoisted_7$5 = { key: 1 };
|
|
19931
|
+
const _hoisted_8$3 = ["aria-label"];
|
|
19909
19932
|
const _sfc_main$1y = /* @__PURE__ */ defineComponent({
|
|
19910
19933
|
__name: "SearchBoxInput",
|
|
19911
19934
|
props: {
|
|
@@ -19961,6 +19984,10 @@ const _sfc_main$1y = /* @__PURE__ */ defineComponent({
|
|
|
19961
19984
|
var _a25;
|
|
19962
19985
|
return (_a25 = labels.value.searchInputAriaLabel) != null ? _a25 : "Search input";
|
|
19963
19986
|
});
|
|
19987
|
+
const voiceSearchAriaLabel = computed(() => {
|
|
19988
|
+
var _a25, _b25, _c, _d;
|
|
19989
|
+
return (_d = (_c = (_b25 = (_a25 = props.options.voiceSearch) == null ? void 0 : _a25.labels) == null ? void 0 : _b25.aria) == null ? void 0 : _c.openDialog) != null ? _d : "Open voice search dialog";
|
|
19990
|
+
});
|
|
19964
19991
|
onMounted(() => {
|
|
19965
19992
|
document.addEventListener("click", handleClickOutsideVoiceDialogOverlay);
|
|
19966
19993
|
});
|
|
@@ -20081,8 +20108,11 @@ const _sfc_main$1y = /* @__PURE__ */ defineComponent({
|
|
|
20081
20108
|
isVoiceSearchEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_7$5, [
|
|
20082
20109
|
createBaseVNode("button", {
|
|
20083
20110
|
onClick: openVoiceSearchDialog,
|
|
20084
|
-
class: "lupa-voice-search-button"
|
|
20085
|
-
|
|
20111
|
+
class: "lupa-voice-search-button",
|
|
20112
|
+
"aria-haspopup": "dialog",
|
|
20113
|
+
"aria-controls": "voice-search-dialog",
|
|
20114
|
+
"aria-label": voiceSearchAriaLabel.value
|
|
20115
|
+
}, null, 8, _hoisted_8$3)
|
|
20086
20116
|
])) : createCommentVNode("", true),
|
|
20087
20117
|
isVoiceSearchEnabled.value ? (openBlock(), createBlock(_sfc_main$1z, {
|
|
20088
20118
|
key: 2,
|
|
@@ -30487,6 +30517,13 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
30487
30517
|
const { addToCartAmount } = storeToRefs(searchResultStore);
|
|
30488
30518
|
const emit2 = __emit;
|
|
30489
30519
|
const loading = ref(false);
|
|
30520
|
+
const addToCartButtonClass = computed(() => {
|
|
30521
|
+
return {
|
|
30522
|
+
[props.options.className]: Boolean(props.options.className),
|
|
30523
|
+
"lupa-add-to-cart-loading": loading.value,
|
|
30524
|
+
"lupa-add-to-cart": !loading.value
|
|
30525
|
+
};
|
|
30526
|
+
});
|
|
30490
30527
|
const label = computed(() => {
|
|
30491
30528
|
return props.options.labels.addToCart;
|
|
30492
30529
|
});
|
|
@@ -30510,7 +30547,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
30510
30547
|
createBaseVNode("div", _hoisted_2$O, [
|
|
30511
30548
|
hasLink.value ? (openBlock(), createElementBlock("button", mergeProps({
|
|
30512
30549
|
key: 0,
|
|
30513
|
-
class:
|
|
30550
|
+
class: addToCartButtonClass.value,
|
|
30514
30551
|
"data-cy": "lupa-add-to-cart",
|
|
30515
30552
|
disabled: !inStockValue.value || loading.value
|
|
30516
30553
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
@@ -30518,7 +30555,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
30518
30555
|
], 16, _hoisted_3$A)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
30519
30556
|
key: 1,
|
|
30520
30557
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
30521
|
-
class:
|
|
30558
|
+
class: addToCartButtonClass.value,
|
|
30522
30559
|
"data-cy": "lupa-add-to-cart",
|
|
30523
30560
|
type: "button",
|
|
30524
30561
|
disabled: !inStockValue.value || loading.value
|
|
@@ -32924,7 +32961,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
32924
32961
|
});
|
|
32925
32962
|
const handleFacetClick = (item) => {
|
|
32926
32963
|
var _a25;
|
|
32927
|
-
const value = isRange.value ? item.
|
|
32964
|
+
const value = isRange.value ? [item.from, item.to] : (_a25 = item.title) == null ? void 0 : _a25.toString();
|
|
32928
32965
|
emit2("select", {
|
|
32929
32966
|
key: facet.value.key,
|
|
32930
32967
|
value,
|
|
@@ -32938,7 +32975,11 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
32938
32975
|
var _a25, _b25;
|
|
32939
32976
|
let selectedItems = (_a25 = currentFiltersValue.value) != null ? _a25 : [];
|
|
32940
32977
|
selectedItems = isRange.value && selectedItems ? [rangeFilterToString(selectedItems)] : selectedItems;
|
|
32941
|
-
|
|
32978
|
+
if (isRange.value) {
|
|
32979
|
+
return selectedItems == null ? void 0 : selectedItems.includes(rangeFilterToString({ gte: item.from, lt: item.to }));
|
|
32980
|
+
} else {
|
|
32981
|
+
return selectedItems == null ? void 0 : selectedItems.includes((_b25 = item.title) == null ? void 0 : _b25.toString());
|
|
32982
|
+
}
|
|
32942
32983
|
};
|
|
32943
32984
|
const getItemLabel = (item) => {
|
|
32944
32985
|
var _a25;
|
|
@@ -34377,12 +34418,12 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
34377
34418
|
}), 128)),
|
|
34378
34419
|
itemLimit.value < filteredValues.value.length ? (openBlock(), createElementBlock("div", {
|
|
34379
34420
|
key: 1,
|
|
34380
|
-
class:
|
|
34421
|
+
class: "lupa-facet-term lupa-show-more-facet-results",
|
|
34381
34422
|
"data-cy": "lupa-facet-term",
|
|
34382
34423
|
onClick: handleShowAll
|
|
34383
|
-
}, toDisplayString(_ctx.options.labels.showAll),
|
|
34424
|
+
}, toDisplayString(_ctx.options.labels.showAll), 1)) : showAll.value ? (openBlock(), createElementBlock("div", {
|
|
34384
34425
|
key: 2,
|
|
34385
|
-
class: "lupa-facet-term lupa-show-more-facet-results",
|
|
34426
|
+
class: "lupa-facet-term lupa-show-more-facet-results lupa-show-less-facet-results",
|
|
34386
34427
|
onClick: handleCancelShowAll
|
|
34387
34428
|
}, toDisplayString(_ctx.options.labels.showLess), 1)) : createCommentVNode("", true)
|
|
34388
34429
|
]);
|
|
@@ -34412,7 +34453,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
34412
34453
|
},
|
|
34413
34454
|
emits: ["select", "clear"],
|
|
34414
34455
|
setup(__props, { emit: __emit }) {
|
|
34415
|
-
var _a25, _b25;
|
|
34456
|
+
var _a25, _b25, _c;
|
|
34416
34457
|
const props = __props;
|
|
34417
34458
|
const facet = computed(() => {
|
|
34418
34459
|
var _a26;
|
|
@@ -34424,10 +34465,19 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
34424
34465
|
});
|
|
34425
34466
|
const searchResultStore = useSearchResultStore();
|
|
34426
34467
|
const optionsStore = useOptionsStore();
|
|
34468
|
+
const screenStore = useScreenStore();
|
|
34427
34469
|
const { currentFilterKeys } = storeToRefs(searchResultStore);
|
|
34428
34470
|
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
34471
|
+
const { isMobileWidth } = storeToRefs(screenStore);
|
|
34429
34472
|
const emit2 = __emit;
|
|
34430
|
-
const
|
|
34473
|
+
const allExpanded = computed(() => {
|
|
34474
|
+
var _a26, _b26, _c2, _d, _e, _f;
|
|
34475
|
+
if (isMobileWidth.value) {
|
|
34476
|
+
return (_c2 = (_b26 = (_a26 = props.options) == null ? void 0 : _a26.expandAll) == null ? void 0 : _b26.mobile) != null ? _c2 : false;
|
|
34477
|
+
}
|
|
34478
|
+
return (_f = (_e = (_d = props.options) == null ? void 0 : _d.expandAll) == null ? void 0 : _e.desktop) != null ? _f : false;
|
|
34479
|
+
});
|
|
34480
|
+
const isOpen = ref((_c = ((_b25 = (_a25 = props.options) == null ? void 0 : _a25.expand) == null ? void 0 : _b25.includes(props.facet.key)) || allExpanded.value) != null ? _c : false);
|
|
34431
34481
|
const facetPanel = ref(null);
|
|
34432
34482
|
const facetType = computed(() => {
|
|
34433
34483
|
switch (facet.value.type) {
|
|
@@ -34690,6 +34740,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
34690
34740
|
case "range":
|
|
34691
34741
|
toggleRangeFilter(
|
|
34692
34742
|
paramStore.appendParams,
|
|
34743
|
+
paramStore.removeParameters,
|
|
34693
34744
|
facetAction,
|
|
34694
34745
|
optionsStore.getQueryParamName,
|
|
34695
34746
|
filters.value
|
|
@@ -35220,7 +35271,10 @@ const _hoisted_1$C = {
|
|
|
35220
35271
|
"data-cy": "lupa-search-results-page-size"
|
|
35221
35272
|
};
|
|
35222
35273
|
const _hoisted_2$t = { id: "lupa-select" };
|
|
35223
|
-
const _hoisted_3$l = {
|
|
35274
|
+
const _hoisted_3$l = {
|
|
35275
|
+
class: "lupa-select-label",
|
|
35276
|
+
for: "lupa-page-size-select-dropdown"
|
|
35277
|
+
};
|
|
35224
35278
|
const _hoisted_4$d = ["aria-label"];
|
|
35225
35279
|
const _hoisted_5$a = ["value"];
|
|
35226
35280
|
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
@@ -35233,6 +35287,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
35233
35287
|
const props = __props;
|
|
35234
35288
|
const paramsStore = useParamsStore();
|
|
35235
35289
|
const optionsStore = useOptionsStore();
|
|
35290
|
+
const { ariaLabels } = storeToRefs(optionsStore);
|
|
35236
35291
|
const select = ref(null);
|
|
35237
35292
|
const prefixLabel = computed(() => {
|
|
35238
35293
|
var _a25, _b25;
|
|
@@ -35251,12 +35306,14 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
35251
35306
|
});
|
|
35252
35307
|
};
|
|
35253
35308
|
return (_ctx, _cache) => {
|
|
35309
|
+
var _a25, _b25, _c;
|
|
35254
35310
|
return openBlock(), createElementBlock("div", _hoisted_1$C, [
|
|
35255
35311
|
createBaseVNode("div", _hoisted_2$t, [
|
|
35256
35312
|
createBaseVNode("label", _hoisted_3$l, toDisplayString(label.value), 1),
|
|
35257
35313
|
createBaseVNode("select", {
|
|
35314
|
+
id: "lupa-page-size-select-dropdown",
|
|
35258
35315
|
class: "lupa-select-dropdown",
|
|
35259
|
-
"aria-label": label.value,
|
|
35316
|
+
"aria-label": (_c = (_b25 = (_a25 = unref(ariaLabels)) == null ? void 0 : _a25.pageSizeSelect) != null ? _b25 : label.value) != null ? _c : "Select page size",
|
|
35260
35317
|
"data-cy": "lupa-page-size-select-dropdown",
|
|
35261
35318
|
onChange: handleSelect,
|
|
35262
35319
|
ref_key: "select",
|
|
@@ -35279,7 +35336,10 @@ const _hoisted_1$B = {
|
|
|
35279
35336
|
class: "lupa-search-results-sort"
|
|
35280
35337
|
};
|
|
35281
35338
|
const _hoisted_2$s = { id: "lupa-select" };
|
|
35282
|
-
const _hoisted_3$k = {
|
|
35339
|
+
const _hoisted_3$k = {
|
|
35340
|
+
class: "lupa-select-label",
|
|
35341
|
+
for: "lupa-sort-select-dropdown"
|
|
35342
|
+
};
|
|
35283
35343
|
const _hoisted_4$c = ["aria-label"];
|
|
35284
35344
|
const _hoisted_5$9 = ["value"];
|
|
35285
35345
|
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
@@ -35293,6 +35353,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
35293
35353
|
const paramStore = useParamsStore();
|
|
35294
35354
|
const optionStore = useOptionsStore();
|
|
35295
35355
|
const { sort } = storeToRefs(paramStore);
|
|
35356
|
+
const { ariaLabels } = storeToRefs(optionStore);
|
|
35296
35357
|
const selectedKey = ref("");
|
|
35297
35358
|
const previousKey = ref("");
|
|
35298
35359
|
const sortItems = computed(() => {
|
|
@@ -35331,12 +35392,14 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
35331
35392
|
previousKey.value = selectedKey.value;
|
|
35332
35393
|
};
|
|
35333
35394
|
return (_ctx, _cache) => {
|
|
35395
|
+
var _a25, _b25;
|
|
35334
35396
|
return openBlock(), createElementBlock("div", _hoisted_1$B, [
|
|
35335
35397
|
createBaseVNode("div", _hoisted_2$s, [
|
|
35336
35398
|
createBaseVNode("label", _hoisted_3$k, toDisplayString(_ctx.options.label), 1),
|
|
35337
35399
|
withDirectives(createBaseVNode("select", {
|
|
35400
|
+
id: "lupa-sort-select-dropdown",
|
|
35338
35401
|
class: "lupa-select-dropdown",
|
|
35339
|
-
"aria-label": _ctx.options.label,
|
|
35402
|
+
"aria-label": (_b25 = (_a25 = unref(ariaLabels)) == null ? void 0 : _a25.sortBySelect) != null ? _b25 : _ctx.options.label,
|
|
35340
35403
|
"data-cy": "lupa-sort-select-dropdown",
|
|
35341
35404
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedKey.value = $event),
|
|
35342
35405
|
onChange: handleSelect,
|
|
@@ -35835,6 +35898,13 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
35835
35898
|
const hasLink = computed(() => {
|
|
35836
35899
|
return Boolean(props.link && props.options.link);
|
|
35837
35900
|
});
|
|
35901
|
+
const addToCartButtonClass = computed(() => {
|
|
35902
|
+
return {
|
|
35903
|
+
[props.options.className]: Boolean(props.options.className),
|
|
35904
|
+
"lupa-add-to-cart-loading": loading.value,
|
|
35905
|
+
"lupa-add-to-cart": !loading.value
|
|
35906
|
+
};
|
|
35907
|
+
});
|
|
35838
35908
|
const handleClick = (e2) => __async2(null, null, function* () {
|
|
35839
35909
|
if (productCardIsClickable.value && !hasLink.value) {
|
|
35840
35910
|
e2.preventDefault();
|
|
@@ -35855,7 +35925,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
35855
35925
|
createBaseVNode("div", _hoisted_2$o, [
|
|
35856
35926
|
hasLink.value ? (openBlock(), createElementBlock("button", mergeProps({
|
|
35857
35927
|
key: 0,
|
|
35858
|
-
class:
|
|
35928
|
+
class: addToCartButtonClass.value,
|
|
35859
35929
|
"data-cy": "lupa-add-to-cart",
|
|
35860
35930
|
disabled: !inStockValue.value || loading.value
|
|
35861
35931
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
@@ -35863,7 +35933,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
35863
35933
|
], 16, _hoisted_3$g)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
35864
35934
|
key: 1,
|
|
35865
35935
|
id: id.value,
|
|
35866
|
-
class:
|
|
35936
|
+
class: addToCartButtonClass.value,
|
|
35867
35937
|
"data-cy": "lupa-add-to-cart",
|
|
35868
35938
|
disabled: !inStockValue.value || loading.value
|
|
35869
35939
|
}, _ctx.dynamicAttributes, {
|
|
@@ -39656,6 +39726,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
39656
39726
|
const itemId = computed(() => {
|
|
39657
39727
|
return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
|
|
39658
39728
|
});
|
|
39729
|
+
const wrapAround = computed(() => {
|
|
39730
|
+
var _a25, _b25;
|
|
39731
|
+
return (_b25 = (_a25 = carouselOptions.value) == null ? void 0 : _a25.wrapAround) != null ? _b25 : true;
|
|
39732
|
+
});
|
|
39659
39733
|
const loadLupaRecommendations = () => __async2(null, null, function* () {
|
|
39660
39734
|
var _a25, _b25;
|
|
39661
39735
|
recommendationsType.value = "recommendations_lupasearch";
|
|
@@ -39690,7 +39764,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
39690
39764
|
hasRecommendations.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
39691
39765
|
title.value ? (openBlock(), createElementBlock("h2", _hoisted_1$9, toDisplayString(title.value), 1)) : createCommentVNode("", true),
|
|
39692
39766
|
!loading.value ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
39693
|
-
layoutType.value === "carousel" ? (openBlock(), createBlock(unref(Carousel), mergeProps({ key: 0 }, carouselOptions.value, { "wrap-around":
|
|
39767
|
+
layoutType.value === "carousel" ? (openBlock(), createBlock(unref(Carousel), mergeProps({ key: 0 }, carouselOptions.value, { "wrap-around": wrapAround.value }), {
|
|
39694
39768
|
addons: withCtx(() => [
|
|
39695
39769
|
createVNode(unref(Navigation))
|
|
39696
39770
|
]),
|
|
@@ -39713,7 +39787,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
39713
39787
|
}), 128))
|
|
39714
39788
|
]),
|
|
39715
39789
|
_: 1
|
|
39716
|
-
}, 16)) : (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
39790
|
+
}, 16, ["wrap-around"])) : (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
39717
39791
|
(openBlock(true), createElementBlock(Fragment, null, renderList(recommendations2.value, (product, index) => {
|
|
39718
39792
|
return openBlock(), createBlock(_sfc_main$t, {
|
|
39719
39793
|
style: normalizeStyle(columnSize.value),
|
|
@@ -46452,8 +46526,7 @@ const DEFAULT_OPTIONS_RESULTS = {
|
|
|
46452
46526
|
links: {
|
|
46453
46527
|
details: "/{id}"
|
|
46454
46528
|
},
|
|
46455
|
-
elements: []
|
|
46456
|
-
breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
|
|
46529
|
+
elements: []
|
|
46457
46530
|
};
|
|
46458
46531
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
46459
46532
|
__name: "SearchResultsEntry",
|