@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.umd.js
CHANGED
|
@@ -18102,6 +18102,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18102
18102
|
return (_b25 = (_a25 = currentResolutionPageSizes.value) == null ? void 0 : _a25[0]) != null ? _b25 : DEFAULT_PAGE_SIZE;
|
|
18103
18103
|
}
|
|
18104
18104
|
);
|
|
18105
|
+
const ariaLabels = computed(() => {
|
|
18106
|
+
var _a25, _b25;
|
|
18107
|
+
return (_b25 = (_a25 = searchResultOptions.value.labels) == null ? void 0 : _a25.aria) != null ? _b25 : {};
|
|
18108
|
+
});
|
|
18105
18109
|
const currentResolutionPageSizes = computed(() => {
|
|
18106
18110
|
var _a25, _b25, _c, _d;
|
|
18107
18111
|
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;
|
|
@@ -18157,6 +18161,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18157
18161
|
defaultSearchResultPageSize,
|
|
18158
18162
|
currentResolutionPageSizes,
|
|
18159
18163
|
productRecommendationOptions,
|
|
18164
|
+
ariaLabels,
|
|
18160
18165
|
setSearchBoxOptions,
|
|
18161
18166
|
setTrackingOptions,
|
|
18162
18167
|
setSearchResultOptions,
|
|
@@ -18640,13 +18645,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18640
18645
|
}
|
|
18641
18646
|
];
|
|
18642
18647
|
}
|
|
18643
|
-
return [{ key, value: `${gt} - ${lt}`, type: "range" }];
|
|
18648
|
+
return [{ key, value: `${gt != null ? gt : "*"} - ${lt != null ? lt : "*"}`, type: "range" }];
|
|
18644
18649
|
};
|
|
18645
18650
|
const unfoldFilter = (key, filter, price = {}) => {
|
|
18646
18651
|
if (Array.isArray(filter)) {
|
|
18647
18652
|
return unfoldTermFilter(key, filter);
|
|
18648
18653
|
}
|
|
18649
|
-
if (filter.gte) {
|
|
18654
|
+
if (filter.gte || filter.lte || filter.gt || filter.lt) {
|
|
18650
18655
|
return unfoldRangeFilter(key, filter, price);
|
|
18651
18656
|
}
|
|
18652
18657
|
if (filter.terms) {
|
|
@@ -18699,8 +18704,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18699
18704
|
}) : void 0;
|
|
18700
18705
|
};
|
|
18701
18706
|
const rangeFilterToString = (rangeFilter, separator) => {
|
|
18707
|
+
var _a25, _b25, _c;
|
|
18702
18708
|
separator = separator || FACET_TERM_RANGE_SEPARATOR;
|
|
18703
|
-
return rangeFilter && Object.keys(rangeFilter).length ? rangeFilter.gte + separator + (rangeFilter.lte || rangeFilter.lt) : "";
|
|
18709
|
+
return rangeFilter && Object.keys(rangeFilter).length ? ((_a25 = rangeFilter.gte) != null ? _a25 : "") + separator + (((_b25 = rangeFilter.lte) != null ? _b25 : "") || ((_c = rangeFilter.lt) != null ? _c : "")) : "";
|
|
18704
18710
|
};
|
|
18705
18711
|
const pick = (obj, keys) => {
|
|
18706
18712
|
const ret = /* @__PURE__ */ Object.create({});
|
|
@@ -18759,14 +18765,15 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18759
18765
|
return (_b25 = (_a25 = searchParams.getAll(key)) == null ? void 0 : _a25.map((v) => decodeURIComponent(v))) != null ? _b25 : [];
|
|
18760
18766
|
}
|
|
18761
18767
|
if (key.startsWith(FACET_PARAMS_TYPE.RANGE)) {
|
|
18768
|
+
const isPrice = key == null ? void 0 : key.includes(CURRENCY_KEY_INDICATOR);
|
|
18762
18769
|
const range2 = searchParams.get(key);
|
|
18763
18770
|
if (!range2) {
|
|
18764
18771
|
return {};
|
|
18765
18772
|
}
|
|
18766
18773
|
const [min, max] = range2.split(FACET_RANGE_SEPARATOR);
|
|
18767
18774
|
return {
|
|
18768
|
-
gte: min,
|
|
18769
|
-
lte: max
|
|
18775
|
+
gte: min || void 0,
|
|
18776
|
+
[isPrice ? "lte" : "lt"]: max || void 0
|
|
18770
18777
|
};
|
|
18771
18778
|
}
|
|
18772
18779
|
if (key.startsWith(FACET_PARAMS_TYPE.HIERARCHY)) {
|
|
@@ -18966,16 +18973,27 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18966
18973
|
paramsToRemove: [getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.PAGE) : QUERY_PARAMS$1.PAGE]
|
|
18967
18974
|
});
|
|
18968
18975
|
};
|
|
18969
|
-
const toggleRangeFilter = (appendParams, facetAction, getQueryParamName, currentFilters) => {
|
|
18976
|
+
const toggleRangeFilter = (appendParams, removeParameters, facetAction, getQueryParamName, currentFilters) => {
|
|
18977
|
+
var _a25, _b25;
|
|
18970
18978
|
const currentFilter = rangeFilterToString(
|
|
18971
18979
|
currentFilters == null ? void 0 : currentFilters[facetAction.key],
|
|
18972
18980
|
FACET_RANGE_SEPARATOR
|
|
18973
18981
|
);
|
|
18974
|
-
let facetValue = facetAction.value.join(FACET_RANGE_SEPARATOR);
|
|
18982
|
+
let facetValue = (_b25 = (_a25 = facetAction == null ? void 0 : facetAction.value) == null ? void 0 : _a25.join(FACET_RANGE_SEPARATOR)) != null ? _b25 : "";
|
|
18975
18983
|
facetValue = currentFilter === facetValue ? "" : facetValue;
|
|
18984
|
+
const paramsToRemove = getQueryParamName ? [getQueryParamName(QUERY_PARAMS$1.PAGE)] : [QUERY_PARAMS$1.PAGE];
|
|
18985
|
+
if (!facetValue) {
|
|
18986
|
+
removeParameters({
|
|
18987
|
+
paramsToRemove: [
|
|
18988
|
+
getFacetParam(facetAction.key, "", FACET_PARAMS_TYPE.RANGE).name,
|
|
18989
|
+
...paramsToRemove
|
|
18990
|
+
]
|
|
18991
|
+
});
|
|
18992
|
+
return;
|
|
18993
|
+
}
|
|
18976
18994
|
appendParams({
|
|
18977
18995
|
params: [getFacetParam(facetAction.key, facetValue, FACET_PARAMS_TYPE.RANGE)],
|
|
18978
|
-
paramsToRemove
|
|
18996
|
+
paramsToRemove,
|
|
18979
18997
|
encode: false
|
|
18980
18998
|
});
|
|
18981
18999
|
};
|
|
@@ -19769,6 +19787,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19769
19787
|
const _hoisted_2$W = { class: "lupa-dialog-content" };
|
|
19770
19788
|
const _hoisted_3$E = { class: "lupa-listening-text" };
|
|
19771
19789
|
const _hoisted_4$u = { class: "lupa-mic-button-wrapper" };
|
|
19790
|
+
const _hoisted_5$l = ["aria-label"];
|
|
19772
19791
|
const _sfc_main$1z = /* @__PURE__ */ defineComponent({
|
|
19773
19792
|
__name: "VoiceSearchDialog",
|
|
19774
19793
|
props: {
|
|
@@ -19872,6 +19891,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19872
19891
|
reset: dialogReset
|
|
19873
19892
|
});
|
|
19874
19893
|
return (_ctx, _cache) => {
|
|
19894
|
+
var _a25, _b25;
|
|
19875
19895
|
return openBlock(), createElementBlock("div", null, [
|
|
19876
19896
|
props.isOpen ? (openBlock(), createElementBlock("div", _hoisted_1$1l, [
|
|
19877
19897
|
createBaseVNode("button", {
|
|
@@ -19883,8 +19903,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19883
19903
|
createBaseVNode("div", _hoisted_4$u, [
|
|
19884
19904
|
createBaseVNode("button", {
|
|
19885
19905
|
class: normalizeClass(["lupa-mic-button", { recording: unref(isRecording) }]),
|
|
19886
|
-
onClick: handleRecordingButtonClick
|
|
19887
|
-
|
|
19906
|
+
onClick: handleRecordingButtonClick,
|
|
19907
|
+
"aria-controls": "voice-search-microphone",
|
|
19908
|
+
"aria-label": ((_b25 = (_a25 = labels.value) == null ? void 0 : _a25.aria) == null ? void 0 : _b25.microphone) || "Toggle microphone"
|
|
19909
|
+
}, null, 10, _hoisted_5$l),
|
|
19888
19910
|
createVNode(_sfc_main$1A, {
|
|
19889
19911
|
ref_key: "voiceSearchProgressBar",
|
|
19890
19912
|
ref: voiceSearchProgressBar,
|
|
@@ -19910,6 +19932,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19910
19932
|
class: "lupa-close-label"
|
|
19911
19933
|
};
|
|
19912
19934
|
const _hoisted_7$5 = { key: 1 };
|
|
19935
|
+
const _hoisted_8$3 = ["aria-label"];
|
|
19913
19936
|
const _sfc_main$1y = /* @__PURE__ */ defineComponent({
|
|
19914
19937
|
__name: "SearchBoxInput",
|
|
19915
19938
|
props: {
|
|
@@ -19965,6 +19988,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19965
19988
|
var _a25;
|
|
19966
19989
|
return (_a25 = labels.value.searchInputAriaLabel) != null ? _a25 : "Search input";
|
|
19967
19990
|
});
|
|
19991
|
+
const voiceSearchAriaLabel = computed(() => {
|
|
19992
|
+
var _a25, _b25, _c, _d;
|
|
19993
|
+
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";
|
|
19994
|
+
});
|
|
19968
19995
|
onMounted(() => {
|
|
19969
19996
|
document.addEventListener("click", handleClickOutsideVoiceDialogOverlay);
|
|
19970
19997
|
});
|
|
@@ -20085,8 +20112,11 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20085
20112
|
isVoiceSearchEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_7$5, [
|
|
20086
20113
|
createBaseVNode("button", {
|
|
20087
20114
|
onClick: openVoiceSearchDialog,
|
|
20088
|
-
class: "lupa-voice-search-button"
|
|
20089
|
-
|
|
20115
|
+
class: "lupa-voice-search-button",
|
|
20116
|
+
"aria-haspopup": "dialog",
|
|
20117
|
+
"aria-controls": "voice-search-dialog",
|
|
20118
|
+
"aria-label": voiceSearchAriaLabel.value
|
|
20119
|
+
}, null, 8, _hoisted_8$3)
|
|
20090
20120
|
])) : createCommentVNode("", true),
|
|
20091
20121
|
isVoiceSearchEnabled.value ? (openBlock(), createBlock(_sfc_main$1z, {
|
|
20092
20122
|
key: 2,
|
|
@@ -30491,6 +30521,13 @@ and ensure you are accounting for this risk.
|
|
|
30491
30521
|
const { addToCartAmount } = storeToRefs(searchResultStore);
|
|
30492
30522
|
const emit2 = __emit;
|
|
30493
30523
|
const loading = ref(false);
|
|
30524
|
+
const addToCartButtonClass = computed(() => {
|
|
30525
|
+
return {
|
|
30526
|
+
[props.options.className]: Boolean(props.options.className),
|
|
30527
|
+
"lupa-add-to-cart-loading": loading.value,
|
|
30528
|
+
"lupa-add-to-cart": !loading.value
|
|
30529
|
+
};
|
|
30530
|
+
});
|
|
30494
30531
|
const label = computed(() => {
|
|
30495
30532
|
return props.options.labels.addToCart;
|
|
30496
30533
|
});
|
|
@@ -30514,7 +30551,7 @@ and ensure you are accounting for this risk.
|
|
|
30514
30551
|
createBaseVNode("div", _hoisted_2$O, [
|
|
30515
30552
|
hasLink.value ? (openBlock(), createElementBlock("button", mergeProps({
|
|
30516
30553
|
key: 0,
|
|
30517
|
-
class:
|
|
30554
|
+
class: addToCartButtonClass.value,
|
|
30518
30555
|
"data-cy": "lupa-add-to-cart",
|
|
30519
30556
|
disabled: !inStockValue.value || loading.value
|
|
30520
30557
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
@@ -30522,7 +30559,7 @@ and ensure you are accounting for this risk.
|
|
|
30522
30559
|
], 16, _hoisted_3$A)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
30523
30560
|
key: 1,
|
|
30524
30561
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
30525
|
-
class:
|
|
30562
|
+
class: addToCartButtonClass.value,
|
|
30526
30563
|
"data-cy": "lupa-add-to-cart",
|
|
30527
30564
|
type: "button",
|
|
30528
30565
|
disabled: !inStockValue.value || loading.value
|
|
@@ -32928,7 +32965,7 @@ and ensure you are accounting for this risk.
|
|
|
32928
32965
|
});
|
|
32929
32966
|
const handleFacetClick = (item) => {
|
|
32930
32967
|
var _a25;
|
|
32931
|
-
const value = isRange.value ? item.
|
|
32968
|
+
const value = isRange.value ? [item.from, item.to] : (_a25 = item.title) == null ? void 0 : _a25.toString();
|
|
32932
32969
|
emit2("select", {
|
|
32933
32970
|
key: facet.value.key,
|
|
32934
32971
|
value,
|
|
@@ -32942,7 +32979,11 @@ and ensure you are accounting for this risk.
|
|
|
32942
32979
|
var _a25, _b25;
|
|
32943
32980
|
let selectedItems = (_a25 = currentFiltersValue.value) != null ? _a25 : [];
|
|
32944
32981
|
selectedItems = isRange.value && selectedItems ? [rangeFilterToString(selectedItems)] : selectedItems;
|
|
32945
|
-
|
|
32982
|
+
if (isRange.value) {
|
|
32983
|
+
return selectedItems == null ? void 0 : selectedItems.includes(rangeFilterToString({ gte: item.from, lt: item.to }));
|
|
32984
|
+
} else {
|
|
32985
|
+
return selectedItems == null ? void 0 : selectedItems.includes((_b25 = item.title) == null ? void 0 : _b25.toString());
|
|
32986
|
+
}
|
|
32946
32987
|
};
|
|
32947
32988
|
const getItemLabel = (item) => {
|
|
32948
32989
|
var _a25;
|
|
@@ -34381,12 +34422,12 @@ and ensure you are accounting for this risk.
|
|
|
34381
34422
|
}), 128)),
|
|
34382
34423
|
itemLimit.value < filteredValues.value.length ? (openBlock(), createElementBlock("div", {
|
|
34383
34424
|
key: 1,
|
|
34384
|
-
class:
|
|
34425
|
+
class: "lupa-facet-term lupa-show-more-facet-results",
|
|
34385
34426
|
"data-cy": "lupa-facet-term",
|
|
34386
34427
|
onClick: handleShowAll
|
|
34387
|
-
}, toDisplayString(_ctx.options.labels.showAll),
|
|
34428
|
+
}, toDisplayString(_ctx.options.labels.showAll), 1)) : showAll.value ? (openBlock(), createElementBlock("div", {
|
|
34388
34429
|
key: 2,
|
|
34389
|
-
class: "lupa-facet-term lupa-show-more-facet-results",
|
|
34430
|
+
class: "lupa-facet-term lupa-show-more-facet-results lupa-show-less-facet-results",
|
|
34390
34431
|
onClick: handleCancelShowAll
|
|
34391
34432
|
}, toDisplayString(_ctx.options.labels.showLess), 1)) : createCommentVNode("", true)
|
|
34392
34433
|
]);
|
|
@@ -34416,7 +34457,7 @@ and ensure you are accounting for this risk.
|
|
|
34416
34457
|
},
|
|
34417
34458
|
emits: ["select", "clear"],
|
|
34418
34459
|
setup(__props, { emit: __emit }) {
|
|
34419
|
-
var _a25, _b25;
|
|
34460
|
+
var _a25, _b25, _c;
|
|
34420
34461
|
const props = __props;
|
|
34421
34462
|
const facet = computed(() => {
|
|
34422
34463
|
var _a26;
|
|
@@ -34428,10 +34469,19 @@ and ensure you are accounting for this risk.
|
|
|
34428
34469
|
});
|
|
34429
34470
|
const searchResultStore = useSearchResultStore();
|
|
34430
34471
|
const optionsStore = useOptionsStore();
|
|
34472
|
+
const screenStore = useScreenStore();
|
|
34431
34473
|
const { currentFilterKeys } = storeToRefs(searchResultStore);
|
|
34432
34474
|
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
34475
|
+
const { isMobileWidth } = storeToRefs(screenStore);
|
|
34433
34476
|
const emit2 = __emit;
|
|
34434
|
-
const
|
|
34477
|
+
const allExpanded = computed(() => {
|
|
34478
|
+
var _a26, _b26, _c2, _d, _e, _f;
|
|
34479
|
+
if (isMobileWidth.value) {
|
|
34480
|
+
return (_c2 = (_b26 = (_a26 = props.options) == null ? void 0 : _a26.expandAll) == null ? void 0 : _b26.mobile) != null ? _c2 : false;
|
|
34481
|
+
}
|
|
34482
|
+
return (_f = (_e = (_d = props.options) == null ? void 0 : _d.expandAll) == null ? void 0 : _e.desktop) != null ? _f : false;
|
|
34483
|
+
});
|
|
34484
|
+
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);
|
|
34435
34485
|
const facetPanel = ref(null);
|
|
34436
34486
|
const facetType = computed(() => {
|
|
34437
34487
|
switch (facet.value.type) {
|
|
@@ -34694,6 +34744,7 @@ and ensure you are accounting for this risk.
|
|
|
34694
34744
|
case "range":
|
|
34695
34745
|
toggleRangeFilter(
|
|
34696
34746
|
paramStore.appendParams,
|
|
34747
|
+
paramStore.removeParameters,
|
|
34697
34748
|
facetAction,
|
|
34698
34749
|
optionsStore.getQueryParamName,
|
|
34699
34750
|
filters.value
|
|
@@ -35224,7 +35275,10 @@ and ensure you are accounting for this risk.
|
|
|
35224
35275
|
"data-cy": "lupa-search-results-page-size"
|
|
35225
35276
|
};
|
|
35226
35277
|
const _hoisted_2$t = { id: "lupa-select" };
|
|
35227
|
-
const _hoisted_3$l = {
|
|
35278
|
+
const _hoisted_3$l = {
|
|
35279
|
+
class: "lupa-select-label",
|
|
35280
|
+
for: "lupa-page-size-select-dropdown"
|
|
35281
|
+
};
|
|
35228
35282
|
const _hoisted_4$d = ["aria-label"];
|
|
35229
35283
|
const _hoisted_5$a = ["value"];
|
|
35230
35284
|
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
@@ -35237,6 +35291,7 @@ and ensure you are accounting for this risk.
|
|
|
35237
35291
|
const props = __props;
|
|
35238
35292
|
const paramsStore = useParamsStore();
|
|
35239
35293
|
const optionsStore = useOptionsStore();
|
|
35294
|
+
const { ariaLabels } = storeToRefs(optionsStore);
|
|
35240
35295
|
const select = ref(null);
|
|
35241
35296
|
const prefixLabel = computed(() => {
|
|
35242
35297
|
var _a25, _b25;
|
|
@@ -35255,12 +35310,14 @@ and ensure you are accounting for this risk.
|
|
|
35255
35310
|
});
|
|
35256
35311
|
};
|
|
35257
35312
|
return (_ctx, _cache) => {
|
|
35313
|
+
var _a25, _b25, _c;
|
|
35258
35314
|
return openBlock(), createElementBlock("div", _hoisted_1$C, [
|
|
35259
35315
|
createBaseVNode("div", _hoisted_2$t, [
|
|
35260
35316
|
createBaseVNode("label", _hoisted_3$l, toDisplayString(label.value), 1),
|
|
35261
35317
|
createBaseVNode("select", {
|
|
35318
|
+
id: "lupa-page-size-select-dropdown",
|
|
35262
35319
|
class: "lupa-select-dropdown",
|
|
35263
|
-
"aria-label": label.value,
|
|
35320
|
+
"aria-label": (_c = (_b25 = (_a25 = unref(ariaLabels)) == null ? void 0 : _a25.pageSizeSelect) != null ? _b25 : label.value) != null ? _c : "Select page size",
|
|
35264
35321
|
"data-cy": "lupa-page-size-select-dropdown",
|
|
35265
35322
|
onChange: handleSelect,
|
|
35266
35323
|
ref_key: "select",
|
|
@@ -35283,7 +35340,10 @@ and ensure you are accounting for this risk.
|
|
|
35283
35340
|
class: "lupa-search-results-sort"
|
|
35284
35341
|
};
|
|
35285
35342
|
const _hoisted_2$s = { id: "lupa-select" };
|
|
35286
|
-
const _hoisted_3$k = {
|
|
35343
|
+
const _hoisted_3$k = {
|
|
35344
|
+
class: "lupa-select-label",
|
|
35345
|
+
for: "lupa-sort-select-dropdown"
|
|
35346
|
+
};
|
|
35287
35347
|
const _hoisted_4$c = ["aria-label"];
|
|
35288
35348
|
const _hoisted_5$9 = ["value"];
|
|
35289
35349
|
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
@@ -35297,6 +35357,7 @@ and ensure you are accounting for this risk.
|
|
|
35297
35357
|
const paramStore = useParamsStore();
|
|
35298
35358
|
const optionStore = useOptionsStore();
|
|
35299
35359
|
const { sort } = storeToRefs(paramStore);
|
|
35360
|
+
const { ariaLabels } = storeToRefs(optionStore);
|
|
35300
35361
|
const selectedKey = ref("");
|
|
35301
35362
|
const previousKey = ref("");
|
|
35302
35363
|
const sortItems = computed(() => {
|
|
@@ -35335,12 +35396,14 @@ and ensure you are accounting for this risk.
|
|
|
35335
35396
|
previousKey.value = selectedKey.value;
|
|
35336
35397
|
};
|
|
35337
35398
|
return (_ctx, _cache) => {
|
|
35399
|
+
var _a25, _b25;
|
|
35338
35400
|
return openBlock(), createElementBlock("div", _hoisted_1$B, [
|
|
35339
35401
|
createBaseVNode("div", _hoisted_2$s, [
|
|
35340
35402
|
createBaseVNode("label", _hoisted_3$k, toDisplayString(_ctx.options.label), 1),
|
|
35341
35403
|
withDirectives(createBaseVNode("select", {
|
|
35404
|
+
id: "lupa-sort-select-dropdown",
|
|
35342
35405
|
class: "lupa-select-dropdown",
|
|
35343
|
-
"aria-label": _ctx.options.label,
|
|
35406
|
+
"aria-label": (_b25 = (_a25 = unref(ariaLabels)) == null ? void 0 : _a25.sortBySelect) != null ? _b25 : _ctx.options.label,
|
|
35344
35407
|
"data-cy": "lupa-sort-select-dropdown",
|
|
35345
35408
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedKey.value = $event),
|
|
35346
35409
|
onChange: handleSelect,
|
|
@@ -35839,6 +35902,13 @@ and ensure you are accounting for this risk.
|
|
|
35839
35902
|
const hasLink = computed(() => {
|
|
35840
35903
|
return Boolean(props.link && props.options.link);
|
|
35841
35904
|
});
|
|
35905
|
+
const addToCartButtonClass = computed(() => {
|
|
35906
|
+
return {
|
|
35907
|
+
[props.options.className]: Boolean(props.options.className),
|
|
35908
|
+
"lupa-add-to-cart-loading": loading.value,
|
|
35909
|
+
"lupa-add-to-cart": !loading.value
|
|
35910
|
+
};
|
|
35911
|
+
});
|
|
35842
35912
|
const handleClick = (e2) => __async2(null, null, function* () {
|
|
35843
35913
|
if (productCardIsClickable.value && !hasLink.value) {
|
|
35844
35914
|
e2.preventDefault();
|
|
@@ -35859,7 +35929,7 @@ and ensure you are accounting for this risk.
|
|
|
35859
35929
|
createBaseVNode("div", _hoisted_2$o, [
|
|
35860
35930
|
hasLink.value ? (openBlock(), createElementBlock("button", mergeProps({
|
|
35861
35931
|
key: 0,
|
|
35862
|
-
class:
|
|
35932
|
+
class: addToCartButtonClass.value,
|
|
35863
35933
|
"data-cy": "lupa-add-to-cart",
|
|
35864
35934
|
disabled: !inStockValue.value || loading.value
|
|
35865
35935
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
@@ -35867,7 +35937,7 @@ and ensure you are accounting for this risk.
|
|
|
35867
35937
|
], 16, _hoisted_3$g)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
35868
35938
|
key: 1,
|
|
35869
35939
|
id: id.value,
|
|
35870
|
-
class:
|
|
35940
|
+
class: addToCartButtonClass.value,
|
|
35871
35941
|
"data-cy": "lupa-add-to-cart",
|
|
35872
35942
|
disabled: !inStockValue.value || loading.value
|
|
35873
35943
|
}, _ctx.dynamicAttributes, {
|
|
@@ -39660,6 +39730,10 @@ and ensure you are accounting for this risk.
|
|
|
39660
39730
|
const itemId = computed(() => {
|
|
39661
39731
|
return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
|
|
39662
39732
|
});
|
|
39733
|
+
const wrapAround = computed(() => {
|
|
39734
|
+
var _a25, _b25;
|
|
39735
|
+
return (_b25 = (_a25 = carouselOptions.value) == null ? void 0 : _a25.wrapAround) != null ? _b25 : true;
|
|
39736
|
+
});
|
|
39663
39737
|
const loadLupaRecommendations = () => __async2(null, null, function* () {
|
|
39664
39738
|
var _a25, _b25;
|
|
39665
39739
|
recommendationsType.value = "recommendations_lupasearch";
|
|
@@ -39694,7 +39768,7 @@ and ensure you are accounting for this risk.
|
|
|
39694
39768
|
hasRecommendations.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
39695
39769
|
title.value ? (openBlock(), createElementBlock("h2", _hoisted_1$9, toDisplayString(title.value), 1)) : createCommentVNode("", true),
|
|
39696
39770
|
!loading.value ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
39697
|
-
layoutType.value === "carousel" ? (openBlock(), createBlock(unref(Carousel), mergeProps({ key: 0 }, carouselOptions.value, { "wrap-around":
|
|
39771
|
+
layoutType.value === "carousel" ? (openBlock(), createBlock(unref(Carousel), mergeProps({ key: 0 }, carouselOptions.value, { "wrap-around": wrapAround.value }), {
|
|
39698
39772
|
addons: withCtx(() => [
|
|
39699
39773
|
createVNode(unref(Navigation))
|
|
39700
39774
|
]),
|
|
@@ -39717,7 +39791,7 @@ and ensure you are accounting for this risk.
|
|
|
39717
39791
|
}), 128))
|
|
39718
39792
|
]),
|
|
39719
39793
|
_: 1
|
|
39720
|
-
}, 16)) : (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
39794
|
+
}, 16, ["wrap-around"])) : (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
39721
39795
|
(openBlock(true), createElementBlock(Fragment, null, renderList(recommendations2.value, (product, index) => {
|
|
39722
39796
|
return openBlock(), createBlock(_sfc_main$t, {
|
|
39723
39797
|
style: normalizeStyle(columnSize.value),
|
|
@@ -46456,8 +46530,7 @@ and ensure you are accounting for this risk.
|
|
|
46456
46530
|
links: {
|
|
46457
46531
|
details: "/{id}"
|
|
46458
46532
|
},
|
|
46459
|
-
elements: []
|
|
46460
|
-
breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
|
|
46533
|
+
elements: []
|
|
46461
46534
|
};
|
|
46462
46535
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
46463
46536
|
__name: "SearchResultsEntry",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getlupa/client",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.3",
|
|
4
4
|
"main": "dist/lupaSearch.js",
|
|
5
5
|
"module": "dist/lupaSearch.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@getlupa/client-sdk": "^1.8.1",
|
|
23
|
-
"@getlupa/vue": "0.21.
|
|
23
|
+
"@getlupa/vue": "0.21.2",
|
|
24
24
|
"@rushstack/eslint-patch": "^1.12.0",
|
|
25
25
|
"@tsconfig/node18": "^18.2.4",
|
|
26
26
|
"@types/jsdom": "^21.1.7",
|