@getlupa/client 1.9.5 → 1.10.1
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 +668 -582
- package/dist/lupaSearch.js +668 -582
- package/dist/lupaSearch.mjs +668 -582
- package/dist/lupaSearch.umd.js +668 -582
- package/package.json +2 -2
package/dist/lupaSearch.umd.js
CHANGED
|
@@ -6894,6 +6894,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
6894
6894
|
const setInitialFilters = ({ initialFilters: initialFilters2 }) => {
|
|
6895
6895
|
searchResultInitialFilters.value = initialFilters2;
|
|
6896
6896
|
};
|
|
6897
|
+
const getQueryParamName = (param) => {
|
|
6898
|
+
var _a;
|
|
6899
|
+
const nameMap = searchBoxOptions.value.queryParameterNames;
|
|
6900
|
+
return (_a = nameMap == null ? void 0 : nameMap[param]) != null ? _a : param;
|
|
6901
|
+
};
|
|
6897
6902
|
return {
|
|
6898
6903
|
searchBoxOptions,
|
|
6899
6904
|
searchResultOptions,
|
|
@@ -6908,7 +6913,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
6908
6913
|
setSearchBoxOptions,
|
|
6909
6914
|
setTrackingOptions,
|
|
6910
6915
|
setSearchResultOptions,
|
|
6911
|
-
setInitialFilters
|
|
6916
|
+
setInitialFilters,
|
|
6917
|
+
getQueryParamName
|
|
6912
6918
|
};
|
|
6913
6919
|
});
|
|
6914
6920
|
var DocumentElementType = /* @__PURE__ */ ((DocumentElementType2) => {
|
|
@@ -7161,9 +7167,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7161
7167
|
return void 0;
|
|
7162
7168
|
}
|
|
7163
7169
|
};
|
|
7164
|
-
const parseRegularKeys = (regularKeys, searchParams) => {
|
|
7170
|
+
const parseRegularKeys = (regularKeys, searchParams, getQueryParamName) => {
|
|
7165
7171
|
const params = /* @__PURE__ */ Object.create({});
|
|
7166
|
-
const keys = reverseKeyValue(
|
|
7172
|
+
const keys = reverseKeyValue({
|
|
7173
|
+
QUERY: getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.QUERY) : QUERY_PARAMS$1.QUERY,
|
|
7174
|
+
LIMIT: getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.LIMIT) : QUERY_PARAMS$1.LIMIT,
|
|
7175
|
+
PAGE: getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.PAGE) : QUERY_PARAMS$1.PAGE,
|
|
7176
|
+
SORT: getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.SORT) : QUERY_PARAMS$1.SORT
|
|
7177
|
+
});
|
|
7167
7178
|
for (const key of regularKeys) {
|
|
7168
7179
|
const rawKey = keys[key] || key;
|
|
7169
7180
|
params[rawKey] = parseParam(key, searchParams);
|
|
@@ -7205,16 +7216,17 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7205
7216
|
}
|
|
7206
7217
|
return params;
|
|
7207
7218
|
};
|
|
7208
|
-
const parseParams = (searchParams) => {
|
|
7219
|
+
const parseParams = (getQueryParamName, searchParams) => {
|
|
7209
7220
|
const params = /* @__PURE__ */ Object.create({});
|
|
7210
7221
|
if (!searchParams)
|
|
7211
7222
|
return params;
|
|
7212
7223
|
const paramKeys = Array.from(searchParams.keys());
|
|
7213
7224
|
const facetKeys = paramKeys.filter((k) => isFacetKey(k));
|
|
7214
7225
|
const regularKeys = paramKeys.filter((k) => !isFacetKey(k));
|
|
7215
|
-
|
|
7226
|
+
const r = __spreadValues2(__spreadValues2({
|
|
7216
7227
|
[QUERY_PARAMS_PARSED.QUERY]: ""
|
|
7217
|
-
}, parseRegularKeys(regularKeys, searchParams)), parseFacetKeys(facetKeys, searchParams));
|
|
7228
|
+
}, parseRegularKeys(regularKeys, searchParams, getQueryParamName)), parseFacetKeys(facetKeys, searchParams));
|
|
7229
|
+
return r;
|
|
7218
7230
|
};
|
|
7219
7231
|
const appendParam = (url, { name, value }, encode = true) => {
|
|
7220
7232
|
if (Array.isArray(value)) {
|
|
@@ -7235,10 +7247,16 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7235
7247
|
url.searchParams.delete(param.name);
|
|
7236
7248
|
param.value.forEach((v) => url.searchParams.append(param.name, encodeParam(v)));
|
|
7237
7249
|
};
|
|
7238
|
-
const getRemovableParams = (url, paramsToRemove) => {
|
|
7250
|
+
const getRemovableParams = (url, getQueryParamName, paramsToRemove) => {
|
|
7239
7251
|
if (paramsToRemove === "all") {
|
|
7252
|
+
const params = {
|
|
7253
|
+
QUERY: getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.QUERY) : QUERY_PARAMS$1.QUERY,
|
|
7254
|
+
LIMIT: getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.LIMIT) : QUERY_PARAMS$1.LIMIT,
|
|
7255
|
+
PAGE: getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.PAGE) : QUERY_PARAMS$1.PAGE,
|
|
7256
|
+
SORT: getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.SORT) : QUERY_PARAMS$1.SORT
|
|
7257
|
+
};
|
|
7240
7258
|
return [
|
|
7241
|
-
...Object.values(
|
|
7259
|
+
...Object.values(params),
|
|
7242
7260
|
...Array.from(url.searchParams.keys()).filter((k) => isFacetKey(k))
|
|
7243
7261
|
];
|
|
7244
7262
|
}
|
|
@@ -7269,12 +7287,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7269
7287
|
}
|
|
7270
7288
|
return link;
|
|
7271
7289
|
};
|
|
7272
|
-
const generateResultLink = (link, searchText, facet) => {
|
|
7290
|
+
const generateResultLink = (link, getQueryParamName, searchText, facet) => {
|
|
7273
7291
|
if (!searchText) {
|
|
7274
7292
|
return link;
|
|
7275
7293
|
}
|
|
7276
7294
|
const facetParam = facet ? `&${FACET_PARAMS_TYPE.TERMS}${encodeParam(facet.key)}=${encodeParam(facet.title)}` : "";
|
|
7277
|
-
const queryParam = `?${QUERY_PARAMS$1.QUERY}=${encodeParam(searchText)}`;
|
|
7295
|
+
const queryParam = `?${getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.QUERY) : QUERY_PARAMS$1.QUERY}=${encodeParam(searchText)}`;
|
|
7278
7296
|
return `${link}${queryParam}${facetParam}`;
|
|
7279
7297
|
};
|
|
7280
7298
|
const getRelativePath = (link) => {
|
|
@@ -7303,8 +7321,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7303
7321
|
event == null ? void 0 : event.preventDefault();
|
|
7304
7322
|
emitRoutingEvent(link);
|
|
7305
7323
|
};
|
|
7306
|
-
const redirectToResultsPage = (link, searchText, facet, routingBehavior = "direct-link") => {
|
|
7307
|
-
const url = generateResultLink(link, searchText, facet);
|
|
7324
|
+
const redirectToResultsPage = (link, searchText, getQueryParamName, facet, routingBehavior = "direct-link") => {
|
|
7325
|
+
const url = generateResultLink(link, getQueryParamName, searchText, facet);
|
|
7308
7326
|
if (routingBehavior === "event") {
|
|
7309
7327
|
emitRoutingEvent(url);
|
|
7310
7328
|
} else {
|
|
@@ -7329,15 +7347,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7329
7347
|
value
|
|
7330
7348
|
};
|
|
7331
7349
|
};
|
|
7332
|
-
const toggleTermFilter = (appendParams, facetAction, currentFilters) => {
|
|
7350
|
+
const toggleTermFilter = (appendParams, facetAction, getQueryParamName, currentFilters) => {
|
|
7333
7351
|
const currentFilter = currentFilters == null ? void 0 : currentFilters[facetAction.key];
|
|
7334
7352
|
const newParams = toggleTermParam(currentFilter, facetAction.value);
|
|
7335
7353
|
appendParams({
|
|
7336
7354
|
params: [getFacetParam(facetAction.key, newParams)],
|
|
7337
|
-
paramsToRemove: [QUERY_PARAMS$1.PAGE]
|
|
7355
|
+
paramsToRemove: [getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.PAGE) : QUERY_PARAMS$1.PAGE]
|
|
7338
7356
|
});
|
|
7339
7357
|
};
|
|
7340
|
-
const toggleHierarchyFilter = (appendParams, facetAction, currentFilters, removeAllLevels = false) => {
|
|
7358
|
+
const toggleHierarchyFilter = (appendParams, facetAction, getQueryParamName, currentFilters, removeAllLevels = false) => {
|
|
7341
7359
|
var _a;
|
|
7342
7360
|
const currentFilter = currentFilters == null ? void 0 : currentFilters[facetAction.key];
|
|
7343
7361
|
const newParams = toggleHierarchyParam(
|
|
@@ -7347,10 +7365,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7347
7365
|
);
|
|
7348
7366
|
appendParams({
|
|
7349
7367
|
params: [getFacetParam(facetAction.key, newParams, FACET_PARAMS_TYPE.HIERARCHY)],
|
|
7350
|
-
paramsToRemove: [QUERY_PARAMS$1.PAGE]
|
|
7368
|
+
paramsToRemove: [getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.PAGE) : QUERY_PARAMS$1.PAGE]
|
|
7351
7369
|
});
|
|
7352
7370
|
};
|
|
7353
|
-
const toggleRangeFilter = (appendParams, facetAction, currentFilters) => {
|
|
7371
|
+
const toggleRangeFilter = (appendParams, facetAction, getQueryParamName, currentFilters) => {
|
|
7354
7372
|
const currentFilter = rangeFilterToString(
|
|
7355
7373
|
currentFilters == null ? void 0 : currentFilters[facetAction.key],
|
|
7356
7374
|
FACET_RANGE_SEPARATOR
|
|
@@ -7359,7 +7377,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7359
7377
|
facetValue = currentFilter === facetValue ? "" : facetValue;
|
|
7360
7378
|
appendParams({
|
|
7361
7379
|
params: [getFacetParam(facetAction.key, facetValue, FACET_PARAMS_TYPE.RANGE)],
|
|
7362
|
-
paramsToRemove: [QUERY_PARAMS$1.PAGE],
|
|
7380
|
+
paramsToRemove: [getQueryParamName ? getQueryParamName(QUERY_PARAMS$1.PAGE) : QUERY_PARAMS$1.PAGE],
|
|
7363
7381
|
encode: false
|
|
7364
7382
|
});
|
|
7365
7383
|
};
|
|
@@ -7488,7 +7506,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7488
7506
|
const navigate = (url) => {
|
|
7489
7507
|
var _a, _b, _c;
|
|
7490
7508
|
window.history.pushState("", "Append params", url.pathname + url.search);
|
|
7491
|
-
const params2 = parseParams(url.searchParams);
|
|
7509
|
+
const params2 = parseParams(optionsStore.getQueryParamName, url.searchParams);
|
|
7492
7510
|
(_c = (_b = (_a = optionsStore == null ? void 0 : optionsStore.searchBoxOptions) == null ? void 0 : _a.callbacks) == null ? void 0 : _b.onSearchResultsNavigate) == null ? void 0 : _c.call(_b, {
|
|
7493
7511
|
params: params2
|
|
7494
7512
|
});
|
|
@@ -7506,7 +7524,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7506
7524
|
const paramsToRemove = Array.from(url.searchParams.keys()).filter(isFacetKey);
|
|
7507
7525
|
removeParams(url, paramsToRemove);
|
|
7508
7526
|
navigate(url);
|
|
7509
|
-
params.value = parseParams(url.searchParams);
|
|
7527
|
+
params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
|
|
7510
7528
|
searchString.value = url.search;
|
|
7511
7529
|
};
|
|
7512
7530
|
const removeParameters = ({
|
|
@@ -7514,13 +7532,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7514
7532
|
save = true
|
|
7515
7533
|
}) => {
|
|
7516
7534
|
const url = getPageUrl();
|
|
7517
|
-
paramsToRemove = getRemovableParams(url, paramsToRemove);
|
|
7535
|
+
paramsToRemove = getRemovableParams(url, optionsStore.getQueryParamName, paramsToRemove);
|
|
7518
7536
|
removeParams(url, paramsToRemove);
|
|
7519
7537
|
navigate(url);
|
|
7520
7538
|
if (!save) {
|
|
7521
7539
|
return;
|
|
7522
7540
|
}
|
|
7523
|
-
params.value = parseParams(url.searchParams);
|
|
7541
|
+
params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
|
|
7524
7542
|
searchString.value = url.search;
|
|
7525
7543
|
};
|
|
7526
7544
|
const handleNoResultsFlag = ({
|
|
@@ -7562,13 +7580,22 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7562
7580
|
})
|
|
7563
7581
|
] : [];
|
|
7564
7582
|
appendParams({
|
|
7565
|
-
params: [
|
|
7583
|
+
params: [
|
|
7584
|
+
{ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.QUERY), value: searchText },
|
|
7585
|
+
...facetParam
|
|
7586
|
+
],
|
|
7566
7587
|
paramsToRemove: "all",
|
|
7567
7588
|
searchResultsLink: searchResultsLink.value
|
|
7568
7589
|
});
|
|
7569
7590
|
} else {
|
|
7570
7591
|
const routing = (_a = optionsStore.boxRoutingBehavior) != null ? _a : "direct-link";
|
|
7571
|
-
redirectToResultsPage(
|
|
7592
|
+
redirectToResultsPage(
|
|
7593
|
+
searchResultsLink.value,
|
|
7594
|
+
searchText,
|
|
7595
|
+
optionsStore.getQueryParamName,
|
|
7596
|
+
facet,
|
|
7597
|
+
routing
|
|
7598
|
+
);
|
|
7572
7599
|
}
|
|
7573
7600
|
};
|
|
7574
7601
|
const appendParams = ({
|
|
@@ -7582,14 +7609,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7582
7609
|
return { params: params.value };
|
|
7583
7610
|
}
|
|
7584
7611
|
const url = getPageUrl(searchResultsLink2);
|
|
7585
|
-
paramsToRemove = getRemovableParams(url, paramsToRemove);
|
|
7612
|
+
paramsToRemove = getRemovableParams(url, optionsStore.getQueryParamName, paramsToRemove);
|
|
7586
7613
|
removeParams(url, paramsToRemove);
|
|
7587
7614
|
newParams.forEach((p2) => appendParam(url, p2, encode));
|
|
7588
7615
|
navigate(url);
|
|
7589
7616
|
if (!save) {
|
|
7590
7617
|
return;
|
|
7591
7618
|
}
|
|
7592
|
-
params.value = parseParams(url.searchParams);
|
|
7619
|
+
params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
|
|
7593
7620
|
searchString.value = url.search;
|
|
7594
7621
|
};
|
|
7595
7622
|
const setDefaultLimit = (newDefaultLimit) => {
|
|
@@ -7840,7 +7867,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7840
7867
|
resetHighlightIndex
|
|
7841
7868
|
};
|
|
7842
7869
|
});
|
|
7843
|
-
const _hoisted_1$
|
|
7870
|
+
const _hoisted_1$1d = { id: "lupa-search-box-input-container" };
|
|
7844
7871
|
const _hoisted_2$P = { class: "lupa-input-clear" };
|
|
7845
7872
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
7846
7873
|
const _hoisted_4$s = ["value"];
|
|
@@ -7930,7 +7957,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7930
7957
|
};
|
|
7931
7958
|
__expose({ focus });
|
|
7932
7959
|
return (_ctx, _cache) => {
|
|
7933
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
7960
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1d, [
|
|
7934
7961
|
createBaseVNode("div", _hoisted_2$P, [
|
|
7935
7962
|
createBaseVNode("div", {
|
|
7936
7963
|
class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
|
|
@@ -8004,7 +8031,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8004
8031
|
};
|
|
8005
8032
|
}
|
|
8006
8033
|
});
|
|
8007
|
-
const _hoisted_1$
|
|
8034
|
+
const _hoisted_1$1c = { class: "lupa-search-box-history-item" };
|
|
8008
8035
|
const _hoisted_2$O = { class: "lupa-search-box-history-item-content" };
|
|
8009
8036
|
const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
8010
8037
|
__name: "SearchBoxHistoryItem",
|
|
@@ -8022,7 +8049,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8022
8049
|
emit2("click", { query: props.item });
|
|
8023
8050
|
};
|
|
8024
8051
|
return (_ctx, _cache) => {
|
|
8025
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8052
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1c, [
|
|
8026
8053
|
createBaseVNode("div", _hoisted_2$O, [
|
|
8027
8054
|
createBaseVNode("div", {
|
|
8028
8055
|
class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
|
|
@@ -8037,7 +8064,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8037
8064
|
};
|
|
8038
8065
|
}
|
|
8039
8066
|
});
|
|
8040
|
-
const _hoisted_1$
|
|
8067
|
+
const _hoisted_1$1b = {
|
|
8041
8068
|
key: 0,
|
|
8042
8069
|
class: "lupa-search-box-history-panel"
|
|
8043
8070
|
};
|
|
@@ -8082,7 +8109,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8082
8109
|
}
|
|
8083
8110
|
};
|
|
8084
8111
|
return (_ctx, _cache) => {
|
|
8085
|
-
return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
8112
|
+
return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1b, [
|
|
8086
8113
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(history), (item, index) => {
|
|
8087
8114
|
return openBlock(), createBlock(_sfc_main$1j, {
|
|
8088
8115
|
key: item,
|
|
@@ -8100,7 +8127,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8100
8127
|
};
|
|
8101
8128
|
}
|
|
8102
8129
|
});
|
|
8103
|
-
const _hoisted_1$
|
|
8130
|
+
const _hoisted_1$1a = { class: "lupa-search-box-no-results" };
|
|
8104
8131
|
const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
8105
8132
|
__name: "SearchBoxNoResults",
|
|
8106
8133
|
props: {
|
|
@@ -8108,11 +8135,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8108
8135
|
},
|
|
8109
8136
|
setup(__props) {
|
|
8110
8137
|
return (_ctx, _cache) => {
|
|
8111
|
-
return openBlock(), createElementBlock("p", _hoisted_1$
|
|
8138
|
+
return openBlock(), createElementBlock("p", _hoisted_1$1a, toDisplayString(_ctx.labels.noResults), 1);
|
|
8112
8139
|
};
|
|
8113
8140
|
}
|
|
8114
8141
|
});
|
|
8115
|
-
const _hoisted_1$
|
|
8142
|
+
const _hoisted_1$19 = ["innerHTML"];
|
|
8116
8143
|
const _hoisted_2$N = {
|
|
8117
8144
|
key: 1,
|
|
8118
8145
|
"data-cy": "lupa-suggestion-value",
|
|
@@ -8167,7 +8194,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8167
8194
|
class: "lupa-suggestion-value",
|
|
8168
8195
|
"data-cy": "lupa-suggestion-value",
|
|
8169
8196
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
8170
|
-
}, null, 8, _hoisted_1$
|
|
8197
|
+
}, null, 8, _hoisted_1$19)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(_ctx.suggestion.display), 1)),
|
|
8171
8198
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
|
|
8172
8199
|
createBaseVNode("span", _hoisted_4$r, toDisplayString(facetLabel.value), 1),
|
|
8173
8200
|
createBaseVNode("span", _hoisted_5$g, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
@@ -8176,7 +8203,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8176
8203
|
};
|
|
8177
8204
|
}
|
|
8178
8205
|
});
|
|
8179
|
-
const _hoisted_1$
|
|
8206
|
+
const _hoisted_1$18 = {
|
|
8180
8207
|
id: "lupa-search-box-suggestions",
|
|
8181
8208
|
"data-cy": "lupa-search-box-suggestions"
|
|
8182
8209
|
};
|
|
@@ -8240,7 +8267,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8240
8267
|
});
|
|
8241
8268
|
});
|
|
8242
8269
|
return (_ctx, _cache) => {
|
|
8243
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8270
|
+
return openBlock(), createElementBlock("div", _hoisted_1$18, [
|
|
8244
8271
|
(openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
|
|
8245
8272
|
return openBlock(), createBlock(_sfc_main$1g, {
|
|
8246
8273
|
key: getSuggestionKey(item),
|
|
@@ -8324,8 +8351,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8324
8351
|
const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
8325
8352
|
const loading = ref(false);
|
|
8326
8353
|
const dynamicDataIdMap = ref({});
|
|
8354
|
+
const loadingIds = ref({});
|
|
8327
8355
|
const optionsStore = useOptionsStore();
|
|
8328
|
-
|
|
8356
|
+
computed(() => Object.keys(dynamicDataIdMap.value));
|
|
8329
8357
|
const searchResultOptions = computed(() => optionsStore.searchResultOptions);
|
|
8330
8358
|
const searchBoxOptions = computed(() => optionsStore.searchBoxOptions);
|
|
8331
8359
|
const dynamicSearchResultData = computed(() => {
|
|
@@ -8365,11 +8393,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8365
8393
|
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 : [];
|
|
8366
8394
|
let requestedIds = [...resultIds, ...similarQueryResultIds];
|
|
8367
8395
|
if (isCacheEnabled.value) {
|
|
8368
|
-
requestedIds = requestedIds.filter((i) => !
|
|
8396
|
+
requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
|
|
8369
8397
|
}
|
|
8370
8398
|
if (!requestedIds.length) {
|
|
8371
8399
|
return;
|
|
8372
8400
|
}
|
|
8401
|
+
loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps2(__spreadValues2({}, a), { [c2]: true }), {});
|
|
8373
8402
|
loading.value = true;
|
|
8374
8403
|
try {
|
|
8375
8404
|
const dynamicData = dynamicSearchResultData.value || dynamicSearchBoxData.value;
|
|
@@ -8379,15 +8408,16 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8379
8408
|
const dynamicDataResult = (_f = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _f : [];
|
|
8380
8409
|
const seed = {};
|
|
8381
8410
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
8382
|
-
(a, c2) => __spreadProps2(__spreadValues2({}, a), { [c2.id]: c2 }),
|
|
8411
|
+
(a, c2) => __spreadProps2(__spreadValues2({}, a), { [`${c2.id}`]: c2 }),
|
|
8383
8412
|
seed
|
|
8384
8413
|
);
|
|
8385
8414
|
dynamicDataIdMap.value = __spreadValues2(__spreadValues2({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
|
|
8386
8415
|
} finally {
|
|
8387
8416
|
loading.value = false;
|
|
8417
|
+
loadingIds.value = {};
|
|
8388
8418
|
}
|
|
8389
8419
|
});
|
|
8390
|
-
return { dynamicDataIdMap, loading, enhanceSearchResultsWithDynamicData };
|
|
8420
|
+
return { dynamicDataIdMap, loading, loadingIds, enhanceSearchResultsWithDynamicData };
|
|
8391
8421
|
});
|
|
8392
8422
|
const joinUrlParts = (...parts) => {
|
|
8393
8423
|
var _a, _b, _c;
|
|
@@ -8396,7 +8426,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8396
8426
|
}
|
|
8397
8427
|
return (_c = (_b = (_a = parts == null ? void 0 : parts.map((part) => part.replace(/(^\/+|\/+$)/g, ""))) == null ? void 0 : _a.filter((part) => part !== "")) == null ? void 0 : _b.join("/")) != null ? _c : "";
|
|
8398
8428
|
};
|
|
8399
|
-
const _hoisted_1$
|
|
8429
|
+
const _hoisted_1$17 = ["src"];
|
|
8400
8430
|
const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
8401
8431
|
__name: "ProductImage",
|
|
8402
8432
|
props: {
|
|
@@ -8450,7 +8480,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8450
8480
|
createBaseVNode("img", mergeProps({
|
|
8451
8481
|
class: (_b = _ctx.imageClass) != null ? _b : "",
|
|
8452
8482
|
src: finalUrl.value
|
|
8453
|
-
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_1$
|
|
8483
|
+
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_1$17)
|
|
8454
8484
|
], 2);
|
|
8455
8485
|
};
|
|
8456
8486
|
}
|
|
@@ -8472,7 +8502,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8472
8502
|
};
|
|
8473
8503
|
}
|
|
8474
8504
|
});
|
|
8475
|
-
const _hoisted_1$
|
|
8505
|
+
const _hoisted_1$16 = ["innerHTML"];
|
|
8476
8506
|
const _hoisted_2$M = {
|
|
8477
8507
|
key: 1,
|
|
8478
8508
|
class: "lupa-search-box-product-title"
|
|
@@ -8497,13 +8527,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8497
8527
|
key: 0,
|
|
8498
8528
|
class: "lupa-search-box-product-title",
|
|
8499
8529
|
innerHTML: title.value
|
|
8500
|
-
}, null, 8, _hoisted_1$
|
|
8530
|
+
}, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$M, [
|
|
8501
8531
|
createBaseVNode("strong", null, toDisplayString(title.value), 1)
|
|
8502
8532
|
]));
|
|
8503
8533
|
};
|
|
8504
8534
|
}
|
|
8505
8535
|
});
|
|
8506
|
-
const _hoisted_1$
|
|
8536
|
+
const _hoisted_1$15 = ["innerHTML"];
|
|
8507
8537
|
const _hoisted_2$L = {
|
|
8508
8538
|
key: 1,
|
|
8509
8539
|
class: "lupa-search-box-product-description"
|
|
@@ -8528,11 +8558,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8528
8558
|
key: 0,
|
|
8529
8559
|
class: "lupa-search-box-product-description",
|
|
8530
8560
|
innerHTML: description.value
|
|
8531
|
-
}, null, 8, _hoisted_1$
|
|
8561
|
+
}, null, 8, _hoisted_1$15)) : (openBlock(), createElementBlock("div", _hoisted_2$L, toDisplayString(description.value), 1));
|
|
8532
8562
|
};
|
|
8533
8563
|
}
|
|
8534
8564
|
});
|
|
8535
|
-
const _hoisted_1$
|
|
8565
|
+
const _hoisted_1$14 = { class: "lupa-search-box-product-price" };
|
|
8536
8566
|
const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
8537
8567
|
__name: "SearchBoxProductPrice",
|
|
8538
8568
|
props: {
|
|
@@ -8551,13 +8581,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8551
8581
|
);
|
|
8552
8582
|
});
|
|
8553
8583
|
return (_ctx, _cache) => {
|
|
8554
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8584
|
+
return openBlock(), createElementBlock("div", _hoisted_1$14, [
|
|
8555
8585
|
createBaseVNode("strong", null, toDisplayString(price.value), 1)
|
|
8556
8586
|
]);
|
|
8557
8587
|
};
|
|
8558
8588
|
}
|
|
8559
8589
|
});
|
|
8560
|
-
const _hoisted_1$
|
|
8590
|
+
const _hoisted_1$13 = { class: "lupa-search-box-product-regular-price" };
|
|
8561
8591
|
const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
8562
8592
|
__name: "SearchBoxProductRegularPrice",
|
|
8563
8593
|
props: {
|
|
@@ -8576,11 +8606,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8576
8606
|
);
|
|
8577
8607
|
});
|
|
8578
8608
|
return (_ctx, _cache) => {
|
|
8579
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8609
|
+
return openBlock(), createElementBlock("div", _hoisted_1$13, toDisplayString(price.value), 1);
|
|
8580
8610
|
};
|
|
8581
8611
|
}
|
|
8582
8612
|
});
|
|
8583
|
-
const _hoisted_1$
|
|
8613
|
+
const _hoisted_1$12 = ["innerHTML"];
|
|
8584
8614
|
const _hoisted_2$K = { key: 0 };
|
|
8585
8615
|
const _hoisted_3$y = { key: 1 };
|
|
8586
8616
|
const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
|
|
@@ -8611,7 +8641,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8611
8641
|
key: 0,
|
|
8612
8642
|
class: [className.value, "lupa-search-box-product-custom"],
|
|
8613
8643
|
innerHTML: text.value
|
|
8614
|
-
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$
|
|
8644
|
+
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$12)) : (openBlock(), createElementBlock("div", mergeProps({
|
|
8615
8645
|
key: 1,
|
|
8616
8646
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
8617
8647
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
@@ -8623,7 +8653,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8623
8653
|
};
|
|
8624
8654
|
}
|
|
8625
8655
|
});
|
|
8626
|
-
const _hoisted_1$
|
|
8656
|
+
const _hoisted_1$11 = ["innerHTML"];
|
|
8627
8657
|
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
8628
8658
|
__name: "SearchBoxProductCustomHtml",
|
|
8629
8659
|
props: {
|
|
@@ -8644,7 +8674,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8644
8674
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
8645
8675
|
class: className.value,
|
|
8646
8676
|
innerHTML: text.value
|
|
8647
|
-
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$
|
|
8677
|
+
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$11);
|
|
8648
8678
|
};
|
|
8649
8679
|
}
|
|
8650
8680
|
});
|
|
@@ -8838,7 +8868,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8838
8868
|
setLoading
|
|
8839
8869
|
};
|
|
8840
8870
|
});
|
|
8841
|
-
const _hoisted_1
|
|
8871
|
+
const _hoisted_1$10 = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
8842
8872
|
const _hoisted_2$J = { class: "lupa-search-box-product-addtocart" };
|
|
8843
8873
|
const _hoisted_3$x = ["onClick", "disabled"];
|
|
8844
8874
|
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
@@ -8868,7 +8898,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8868
8898
|
loading.value = false;
|
|
8869
8899
|
});
|
|
8870
8900
|
return (_ctx, _cache) => {
|
|
8871
|
-
return openBlock(), createElementBlock("div", _hoisted_1
|
|
8901
|
+
return openBlock(), createElementBlock("div", _hoisted_1$10, [
|
|
8872
8902
|
createBaseVNode("div", _hoisted_2$J, [
|
|
8873
8903
|
createBaseVNode("button", {
|
|
8874
8904
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
@@ -8882,6 +8912,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8882
8912
|
};
|
|
8883
8913
|
}
|
|
8884
8914
|
});
|
|
8915
|
+
const _hoisted_1$$ = {
|
|
8916
|
+
key: 1,
|
|
8917
|
+
class: "lupa-search-box-element-badge-wrapper"
|
|
8918
|
+
};
|
|
8885
8919
|
const __default__$4 = {
|
|
8886
8920
|
components: {
|
|
8887
8921
|
SearchBoxProductImage: _sfc_main$1c,
|
|
@@ -8905,7 +8939,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8905
8939
|
setup(__props) {
|
|
8906
8940
|
const props = __props;
|
|
8907
8941
|
const dynamicDataStore = useDynamicDataStore();
|
|
8908
|
-
const { loading, dynamicDataIdMap } = storeToRefs(dynamicDataStore);
|
|
8942
|
+
const { loading, loadingIds, dynamicDataIdMap } = storeToRefs(dynamicDataStore);
|
|
8909
8943
|
const elementComponent = computed(() => {
|
|
8910
8944
|
switch (props.element.type) {
|
|
8911
8945
|
case DocumentElementType.IMAGE:
|
|
@@ -8930,9 +8964,6 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8930
8964
|
const displayElement = computed(() => {
|
|
8931
8965
|
return props.element.display ? props.element.display(props.item) : true;
|
|
8932
8966
|
});
|
|
8933
|
-
const isLoadingDynamicData = computed(() => {
|
|
8934
|
-
return Boolean(props.element.dynamic && loading.value);
|
|
8935
|
-
});
|
|
8936
8967
|
const enhancedItem = computed(() => {
|
|
8937
8968
|
var _a, _b, _c, _d;
|
|
8938
8969
|
if (!((_a = props.item) == null ? void 0 : _a.id)) {
|
|
@@ -8941,26 +8972,295 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8941
8972
|
const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
|
|
8942
8973
|
return __spreadValues2(__spreadValues2({}, props.item), enhancementData);
|
|
8943
8974
|
});
|
|
8975
|
+
const isLoadingDynamicData = (id) => {
|
|
8976
|
+
return Boolean(props.element.dynamic && id && loading.value && (loadingIds == null ? void 0 : loadingIds.value[id]));
|
|
8977
|
+
};
|
|
8944
8978
|
return (_ctx, _cache) => {
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8979
|
+
var _a, _b;
|
|
8980
|
+
return !_ctx.$slots.badges ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
8981
|
+
displayElement.value ? (openBlock(), createBlock(resolveDynamicComponent(elementComponent.value), {
|
|
8982
|
+
key: 0,
|
|
8983
|
+
item: enhancedItem.value,
|
|
8984
|
+
options: _ctx.element,
|
|
8985
|
+
labels: _ctx.labels,
|
|
8986
|
+
class: normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData((_a = _ctx.item) == null ? void 0 : _a.id) }),
|
|
8987
|
+
inStock: _ctx.isInStock
|
|
8988
|
+
}, null, 8, ["item", "options", "labels", "class", "inStock"])) : createCommentVNode("", true)
|
|
8989
|
+
], 64)) : (openBlock(), createElementBlock("div", _hoisted_1$$, [
|
|
8990
|
+
displayElement.value ? (openBlock(), createBlock(resolveDynamicComponent(elementComponent.value), {
|
|
8991
|
+
key: 0,
|
|
8992
|
+
item: enhancedItem.value,
|
|
8993
|
+
options: _ctx.element,
|
|
8994
|
+
labels: _ctx.labels,
|
|
8995
|
+
class: normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData((_b = _ctx.item) == null ? void 0 : _b.id) }),
|
|
8996
|
+
inStock: _ctx.isInStock
|
|
8997
|
+
}, null, 8, ["item", "options", "labels", "class", "inStock"])) : createCommentVNode("", true),
|
|
8998
|
+
renderSlot(_ctx.$slots, "badges")
|
|
8999
|
+
]));
|
|
8953
9000
|
};
|
|
8954
9001
|
}
|
|
8955
9002
|
}));
|
|
8956
|
-
const _hoisted_1$_ =
|
|
8957
|
-
const _hoisted_2$I =
|
|
8958
|
-
const _hoisted_3$w = {
|
|
9003
|
+
const _hoisted_1$_ = { class: "lupa-badge-title" };
|
|
9004
|
+
const _hoisted_2$I = ["src"];
|
|
9005
|
+
const _hoisted_3$w = { key: 1 };
|
|
8959
9006
|
const _hoisted_4$p = {
|
|
8960
9007
|
key: 0,
|
|
8961
|
-
class: "lupa-
|
|
9008
|
+
class: "lupa-badge-full-text"
|
|
8962
9009
|
};
|
|
8963
9010
|
const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
9011
|
+
__name: "SearchResultGeneratedBadge",
|
|
9012
|
+
props: {
|
|
9013
|
+
options: {},
|
|
9014
|
+
badge: {}
|
|
9015
|
+
},
|
|
9016
|
+
setup(__props) {
|
|
9017
|
+
const props = __props;
|
|
9018
|
+
const image = computed(() => {
|
|
9019
|
+
var _a, _b, _c;
|
|
9020
|
+
return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.image) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : "";
|
|
9021
|
+
});
|
|
9022
|
+
const showTitle = computed(() => {
|
|
9023
|
+
var _a, _b, _c;
|
|
9024
|
+
return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.showTitle) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : true;
|
|
9025
|
+
});
|
|
9026
|
+
const hasAdditionalText = computed(() => {
|
|
9027
|
+
var _a, _b;
|
|
9028
|
+
return Boolean((_a = props.badge) == null ? void 0 : _a.additionalText) && typeof ((_b = props.badge) == null ? void 0 : _b.additionalText) === "string";
|
|
9029
|
+
});
|
|
9030
|
+
const hasTitleText = computed(() => {
|
|
9031
|
+
var _a, _b;
|
|
9032
|
+
return Boolean((_a = props.badge) == null ? void 0 : _a.titleText) && typeof ((_b = props.badge) == null ? void 0 : _b.titleText) === "string";
|
|
9033
|
+
});
|
|
9034
|
+
const customClassName = computed(() => {
|
|
9035
|
+
var _a, _b, _c;
|
|
9036
|
+
return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.customClass) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : "";
|
|
9037
|
+
});
|
|
9038
|
+
return (_ctx, _cache) => {
|
|
9039
|
+
return openBlock(), createElementBlock("div", {
|
|
9040
|
+
class: normalizeClass(["lupa-dynamic-badge", customClassName.value]),
|
|
9041
|
+
style: normalizeStyle({ background: _ctx.badge.backgroundColor, color: _ctx.badge.color })
|
|
9042
|
+
}, [
|
|
9043
|
+
createBaseVNode("span", _hoisted_1$_, [
|
|
9044
|
+
image.value ? (openBlock(), createElementBlock("img", {
|
|
9045
|
+
key: 0,
|
|
9046
|
+
src: image.value
|
|
9047
|
+
}, null, 8, _hoisted_2$I)) : createCommentVNode("", true),
|
|
9048
|
+
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$w, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
9049
|
+
]),
|
|
9050
|
+
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$p, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
9051
|
+
], 6);
|
|
9052
|
+
};
|
|
9053
|
+
}
|
|
9054
|
+
});
|
|
9055
|
+
const _hoisted_1$Z = { class: "lupa-generated-badges" };
|
|
9056
|
+
const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
9057
|
+
__name: "SearchResultGeneratedBadges",
|
|
9058
|
+
props: {
|
|
9059
|
+
options: {}
|
|
9060
|
+
},
|
|
9061
|
+
setup(__props) {
|
|
9062
|
+
const props = __props;
|
|
9063
|
+
const badgeField = computed(() => {
|
|
9064
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9065
|
+
const fieldHasBadges = ((_a = props.options.generate) == null ? void 0 : _a.key) && ((_d = props.options.product) == null ? void 0 : _d[(_c = (_b = props.options.generate) == null ? void 0 : _b.key) != null ? _c : ""]) && Array.isArray(props.options.product[(_f = (_e = props.options.generate) == null ? void 0 : _e.key) != null ? _f : ""]);
|
|
9066
|
+
return fieldHasBadges ? props.options.product[(_h = (_g = props.options.generate) == null ? void 0 : _g.key) != null ? _h : ""] : [];
|
|
9067
|
+
});
|
|
9068
|
+
const keyMap = computed(() => {
|
|
9069
|
+
var _a, _b;
|
|
9070
|
+
return (_b = (_a = props.options.generate) == null ? void 0 : _a.keyMap) != null ? _b : {};
|
|
9071
|
+
});
|
|
9072
|
+
const badges = computed(() => {
|
|
9073
|
+
return badgeField.value.filter((f2) => Boolean(f2)).map((f2) => ({
|
|
9074
|
+
backgroundColor: keyMap.value.backgroundColor ? f2[keyMap.value.backgroundColor] : void 0,
|
|
9075
|
+
color: keyMap.value.color ? f2[keyMap.value.color] : void 0,
|
|
9076
|
+
titleText: keyMap.value.titleText ? f2[keyMap.value.titleText] : void 0,
|
|
9077
|
+
additionalText: keyMap.value.additionalText ? f2[keyMap.value.additionalText] : void 0,
|
|
9078
|
+
id: keyMap.value.id ? f2[keyMap.value.id] : void 0
|
|
9079
|
+
})).filter((b) => Boolean(b.id));
|
|
9080
|
+
});
|
|
9081
|
+
return (_ctx, _cache) => {
|
|
9082
|
+
return openBlock(), createElementBlock("div", _hoisted_1$Z, [
|
|
9083
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(badges.value, (badge) => {
|
|
9084
|
+
return openBlock(), createBlock(_sfc_main$13, {
|
|
9085
|
+
key: badge.id,
|
|
9086
|
+
badge,
|
|
9087
|
+
options: _ctx.options
|
|
9088
|
+
}, null, 8, ["badge", "options"]);
|
|
9089
|
+
}), 128))
|
|
9090
|
+
]);
|
|
9091
|
+
};
|
|
9092
|
+
}
|
|
9093
|
+
});
|
|
9094
|
+
const _hoisted_1$Y = ["innerHTML"];
|
|
9095
|
+
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
9096
|
+
__name: "CustomBadge",
|
|
9097
|
+
props: {
|
|
9098
|
+
badge: {}
|
|
9099
|
+
},
|
|
9100
|
+
setup(__props) {
|
|
9101
|
+
const props = __props;
|
|
9102
|
+
const text = computed(() => {
|
|
9103
|
+
var _a, _b, _c;
|
|
9104
|
+
return (_c = (_b = props.badge).html) == null ? void 0 : _c.call(_b, (_a = props.badge.product) != null ? _a : {});
|
|
9105
|
+
});
|
|
9106
|
+
const className = computed(() => {
|
|
9107
|
+
var _a;
|
|
9108
|
+
return (_a = props.badge.className) != null ? _a : "";
|
|
9109
|
+
});
|
|
9110
|
+
return (_ctx, _cache) => {
|
|
9111
|
+
return openBlock(), createElementBlock("div", {
|
|
9112
|
+
class: normalizeClass(className.value),
|
|
9113
|
+
innerHTML: text.value
|
|
9114
|
+
}, null, 10, _hoisted_1$Y);
|
|
9115
|
+
};
|
|
9116
|
+
}
|
|
9117
|
+
});
|
|
9118
|
+
const _hoisted_1$X = { class: "lupa-text-badges" };
|
|
9119
|
+
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
9120
|
+
__name: "TextBadge",
|
|
9121
|
+
props: {
|
|
9122
|
+
badge: {}
|
|
9123
|
+
},
|
|
9124
|
+
setup(__props) {
|
|
9125
|
+
const props = __props;
|
|
9126
|
+
const badges = computed(() => {
|
|
9127
|
+
var _a, _b;
|
|
9128
|
+
return (_b = (_a = props.badge) == null ? void 0 : _a.value) != null ? _b : [];
|
|
9129
|
+
});
|
|
9130
|
+
const displayBadges = computed(() => {
|
|
9131
|
+
return badges.value.slice(0, props.badge.maxItems);
|
|
9132
|
+
});
|
|
9133
|
+
return (_ctx, _cache) => {
|
|
9134
|
+
return openBlock(), createElementBlock("div", _hoisted_1$X, [
|
|
9135
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
|
|
9136
|
+
return openBlock(), createElementBlock("div", {
|
|
9137
|
+
class: "lupa-badge lupa-text-badge",
|
|
9138
|
+
key: item
|
|
9139
|
+
}, toDisplayString(_ctx.badge.prefix) + toDisplayString(item), 1);
|
|
9140
|
+
}), 128))
|
|
9141
|
+
]);
|
|
9142
|
+
};
|
|
9143
|
+
}
|
|
9144
|
+
});
|
|
9145
|
+
const _hoisted_1$W = { class: "lupa-image-badges" };
|
|
9146
|
+
const _hoisted_2$H = ["src"];
|
|
9147
|
+
const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
9148
|
+
__name: "ImageBadge",
|
|
9149
|
+
props: {
|
|
9150
|
+
badge: {}
|
|
9151
|
+
},
|
|
9152
|
+
setup(__props) {
|
|
9153
|
+
const props = __props;
|
|
9154
|
+
const badges = computed(() => {
|
|
9155
|
+
return props.badge.value;
|
|
9156
|
+
});
|
|
9157
|
+
const displayBadges = computed(() => {
|
|
9158
|
+
return badges.value.slice(0, props.badge.maxItems);
|
|
9159
|
+
});
|
|
9160
|
+
const getImageUrl = (src) => {
|
|
9161
|
+
if (!props.badge.rootImageUrl) {
|
|
9162
|
+
return src;
|
|
9163
|
+
}
|
|
9164
|
+
return `${props.badge.rootImageUrl}${src}`;
|
|
9165
|
+
};
|
|
9166
|
+
return (_ctx, _cache) => {
|
|
9167
|
+
return openBlock(), createElementBlock("div", _hoisted_1$W, [
|
|
9168
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
|
|
9169
|
+
return openBlock(), createElementBlock("div", {
|
|
9170
|
+
class: "lupa-badge lupa-image-badge",
|
|
9171
|
+
key: item
|
|
9172
|
+
}, [
|
|
9173
|
+
createBaseVNode("img", {
|
|
9174
|
+
src: getImageUrl(item)
|
|
9175
|
+
}, null, 8, _hoisted_2$H)
|
|
9176
|
+
]);
|
|
9177
|
+
}), 128))
|
|
9178
|
+
]);
|
|
9179
|
+
};
|
|
9180
|
+
}
|
|
9181
|
+
});
|
|
9182
|
+
const _hoisted_1$V = { id: "lupa-search-results-badges" };
|
|
9183
|
+
const __default__$3 = {
|
|
9184
|
+
components: {
|
|
9185
|
+
CustomBadge: _sfc_main$11,
|
|
9186
|
+
TextBadge: _sfc_main$10,
|
|
9187
|
+
ImageBadge: _sfc_main$$
|
|
9188
|
+
}
|
|
9189
|
+
};
|
|
9190
|
+
const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$3), {
|
|
9191
|
+
__name: "SearchResultsBadgeWrapper",
|
|
9192
|
+
props: {
|
|
9193
|
+
position: {},
|
|
9194
|
+
options: {}
|
|
9195
|
+
},
|
|
9196
|
+
setup(__props) {
|
|
9197
|
+
const props = __props;
|
|
9198
|
+
const positionValue = computed(() => {
|
|
9199
|
+
var _a;
|
|
9200
|
+
return (_a = props.position) != null ? _a : "card";
|
|
9201
|
+
});
|
|
9202
|
+
const anchorPosition = computed(() => {
|
|
9203
|
+
return props.options.anchor;
|
|
9204
|
+
});
|
|
9205
|
+
const badges = computed(() => {
|
|
9206
|
+
if (!props.options.elements) {
|
|
9207
|
+
return [];
|
|
9208
|
+
}
|
|
9209
|
+
return props.options.elements.filter((e) => {
|
|
9210
|
+
var _a;
|
|
9211
|
+
return !e.display || e.display((_a = props.options.product) != null ? _a : {});
|
|
9212
|
+
}).map((x) => {
|
|
9213
|
+
var _a;
|
|
9214
|
+
return __spreadProps2(__spreadValues2({}, x), {
|
|
9215
|
+
value: ((_a = props.options.product) == null ? void 0 : _a[x.key]) || "badge",
|
|
9216
|
+
product: props.options.product
|
|
9217
|
+
});
|
|
9218
|
+
});
|
|
9219
|
+
});
|
|
9220
|
+
const displayBadges = computed(() => {
|
|
9221
|
+
return positionValue.value === "card" ? badges.value.filter((b) => !b.position || b.position === "card") : badges.value.filter((b) => b.position === "image");
|
|
9222
|
+
});
|
|
9223
|
+
const getBadgeComponent = (type) => {
|
|
9224
|
+
switch (type) {
|
|
9225
|
+
case BadgeType.TEXT:
|
|
9226
|
+
return "TextBadge";
|
|
9227
|
+
case BadgeType.IMAGE:
|
|
9228
|
+
return "ImageBadge";
|
|
9229
|
+
case BadgeType.CUSTOM_HTML:
|
|
9230
|
+
return "CustomBadge";
|
|
9231
|
+
default:
|
|
9232
|
+
return "CustomBadge";
|
|
9233
|
+
}
|
|
9234
|
+
};
|
|
9235
|
+
return (_ctx, _cache) => {
|
|
9236
|
+
return openBlock(), createElementBlock("div", _hoisted_1$V, [
|
|
9237
|
+
createBaseVNode("div", {
|
|
9238
|
+
id: "lupa-badges",
|
|
9239
|
+
class: normalizeClass(anchorPosition.value)
|
|
9240
|
+
}, [
|
|
9241
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (badge, index) => {
|
|
9242
|
+
return openBlock(), createBlock(resolveDynamicComponent(getBadgeComponent(badge.type)), {
|
|
9243
|
+
key: index,
|
|
9244
|
+
badge
|
|
9245
|
+
}, null, 8, ["badge"]);
|
|
9246
|
+
}), 128)),
|
|
9247
|
+
positionValue.value === "card" ? (openBlock(), createBlock(_sfc_main$12, {
|
|
9248
|
+
key: 0,
|
|
9249
|
+
options: _ctx.options
|
|
9250
|
+
}, null, 8, ["options"])) : createCommentVNode("", true)
|
|
9251
|
+
], 2)
|
|
9252
|
+
]);
|
|
9253
|
+
};
|
|
9254
|
+
}
|
|
9255
|
+
}));
|
|
9256
|
+
const _hoisted_1$U = ["href"];
|
|
9257
|
+
const _hoisted_2$G = { class: "lupa-search-box-product-image-section" };
|
|
9258
|
+
const _hoisted_3$v = { class: "lupa-search-box-product-details-section" };
|
|
9259
|
+
const _hoisted_4$o = {
|
|
9260
|
+
key: 0,
|
|
9261
|
+
class: "lupa-search-box-product-add-to-cart-section"
|
|
9262
|
+
};
|
|
9263
|
+
const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
8964
9264
|
__name: "SearchBoxProduct",
|
|
8965
9265
|
props: {
|
|
8966
9266
|
item: {},
|
|
@@ -8977,6 +9277,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8977
9277
|
var _a, _b;
|
|
8978
9278
|
return generateLink((_b = (_a = props.panelOptions.links) == null ? void 0 : _a.details) != null ? _b : "", props.item);
|
|
8979
9279
|
});
|
|
9280
|
+
const badgeOptions = computed(() => {
|
|
9281
|
+
return __spreadProps2(__spreadValues2({}, props.panelOptions.badges), { product: props.item });
|
|
9282
|
+
});
|
|
8980
9283
|
const imageElements = computed(() => {
|
|
8981
9284
|
var _a, _b;
|
|
8982
9285
|
return (_b = (_a = props.panelOptions.elements) == null ? void 0 : _a.filter((e) => e.type === DocumentElementType.IMAGE)) != null ? _b : [];
|
|
@@ -9016,7 +9319,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9016
9319
|
"data-cy": "lupa-search-box-product",
|
|
9017
9320
|
onClick: handleClick
|
|
9018
9321
|
}), [
|
|
9019
|
-
createBaseVNode("div", _hoisted_2$
|
|
9322
|
+
createBaseVNode("div", _hoisted_2$G, [
|
|
9020
9323
|
(openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
|
|
9021
9324
|
return openBlock(), createBlock(_sfc_main$14, {
|
|
9022
9325
|
class: "lupa-search-box-product-element",
|
|
@@ -9028,19 +9331,31 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9028
9331
|
}, null, 8, ["item", "element", "labels", "link"]);
|
|
9029
9332
|
}), 128))
|
|
9030
9333
|
]),
|
|
9031
|
-
createBaseVNode("div", _hoisted_3$
|
|
9334
|
+
createBaseVNode("div", _hoisted_3$v, [
|
|
9032
9335
|
(openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
|
|
9336
|
+
var _a;
|
|
9033
9337
|
return openBlock(), createBlock(_sfc_main$14, {
|
|
9338
|
+
key: element.key,
|
|
9034
9339
|
class: "lupa-search-box-product-element",
|
|
9035
9340
|
item: _ctx.item,
|
|
9036
9341
|
element,
|
|
9037
|
-
key: element.key,
|
|
9038
9342
|
labels: _ctx.labels,
|
|
9039
9343
|
link: link.value
|
|
9040
|
-
},
|
|
9344
|
+
}, createSlots({ _: 2 }, [
|
|
9345
|
+
badgeOptions.value && ((_a = badgeOptions.value) == null ? void 0 : _a.anchorElementKey) === element.key ? {
|
|
9346
|
+
name: "badges",
|
|
9347
|
+
fn: withCtx(() => [
|
|
9348
|
+
createVNode(_sfc_main$_, {
|
|
9349
|
+
options: badgeOptions.value,
|
|
9350
|
+
position: "card"
|
|
9351
|
+
}, null, 8, ["options"])
|
|
9352
|
+
]),
|
|
9353
|
+
key: "0"
|
|
9354
|
+
} : void 0
|
|
9355
|
+
]), 1032, ["item", "element", "labels", "link"]);
|
|
9041
9356
|
}), 128))
|
|
9042
9357
|
]),
|
|
9043
|
-
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
9358
|
+
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$o, [
|
|
9044
9359
|
createVNode(_sfc_main$14, {
|
|
9045
9360
|
class: "lupa-search-box-product-element",
|
|
9046
9361
|
item: _ctx.item,
|
|
@@ -9050,7 +9365,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9050
9365
|
isInStock: isInStock.value
|
|
9051
9366
|
}, null, 8, ["item", "element", "labels", "link", "isInStock"])
|
|
9052
9367
|
])) : createCommentVNode("", true)
|
|
9053
|
-
], 16, _hoisted_1$
|
|
9368
|
+
], 16, _hoisted_1$U);
|
|
9054
9369
|
};
|
|
9055
9370
|
}
|
|
9056
9371
|
});
|
|
@@ -9111,8 +9426,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9111
9426
|
};
|
|
9112
9427
|
return { trackSearch, trackResults, trackEvent };
|
|
9113
9428
|
});
|
|
9114
|
-
const _hoisted_1$
|
|
9115
|
-
const _sfc_main$
|
|
9429
|
+
const _hoisted_1$T = { id: "lupa-search-box-products" };
|
|
9430
|
+
const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
9116
9431
|
__name: "SearchBoxProducts",
|
|
9117
9432
|
props: {
|
|
9118
9433
|
items: {},
|
|
@@ -9173,7 +9488,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9173
9488
|
handleRoutingEvent(link, event, boxRoutingBehavior.value === "event");
|
|
9174
9489
|
};
|
|
9175
9490
|
return (_ctx, _cache) => {
|
|
9176
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
9491
|
+
return openBlock(), createElementBlock("div", _hoisted_1$T, [
|
|
9177
9492
|
_ctx.$slots.productCard ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.items, (item, index) => {
|
|
9178
9493
|
return renderSlot(_ctx.$slots, "productCard", {
|
|
9179
9494
|
key: index,
|
|
@@ -9185,7 +9500,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9185
9500
|
itemClicked: handleProductClick
|
|
9186
9501
|
});
|
|
9187
9502
|
}), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.items, (item, index) => {
|
|
9188
|
-
return openBlock(), createBlock(_sfc_main$
|
|
9503
|
+
return openBlock(), createBlock(_sfc_main$Z, {
|
|
9189
9504
|
key: index,
|
|
9190
9505
|
item,
|
|
9191
9506
|
panelOptions: _ctx.panelOptions,
|
|
@@ -9199,7 +9514,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9199
9514
|
};
|
|
9200
9515
|
}
|
|
9201
9516
|
});
|
|
9202
|
-
const _sfc_main$
|
|
9517
|
+
const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
9203
9518
|
__name: "SearchBoxProductsWrapper",
|
|
9204
9519
|
props: {
|
|
9205
9520
|
panel: {},
|
|
@@ -9251,7 +9566,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9251
9566
|
const getItemsDebounced = debounce$1(getItems, props.debounce);
|
|
9252
9567
|
return (_ctx, _cache) => {
|
|
9253
9568
|
var _a, _b;
|
|
9254
|
-
return openBlock(), createBlock(_sfc_main$
|
|
9569
|
+
return openBlock(), createBlock(_sfc_main$Y, {
|
|
9255
9570
|
items: (_b = (_a = searchResult.value) == null ? void 0 : _a.items) != null ? _b : [],
|
|
9256
9571
|
panelOptions: _ctx.panel,
|
|
9257
9572
|
labels: _ctx.labels,
|
|
@@ -9269,7 +9584,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9269
9584
|
};
|
|
9270
9585
|
}
|
|
9271
9586
|
});
|
|
9272
|
-
const _sfc_main$
|
|
9587
|
+
const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
9273
9588
|
__name: "SearchBoxRelatedSourceWrapper",
|
|
9274
9589
|
props: {
|
|
9275
9590
|
panel: {},
|
|
@@ -9341,7 +9656,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9341
9656
|
});
|
|
9342
9657
|
return (_ctx, _cache) => {
|
|
9343
9658
|
var _a, _b;
|
|
9344
|
-
return openBlock(), createBlock(_sfc_main$
|
|
9659
|
+
return openBlock(), createBlock(_sfc_main$Y, {
|
|
9345
9660
|
items: (_b = (_a = searchResult.value) == null ? void 0 : _a.items) != null ? _b : [],
|
|
9346
9661
|
panelOptions: documentPanelOptions.value,
|
|
9347
9662
|
labels: _ctx.labels,
|
|
@@ -9359,16 +9674,16 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9359
9674
|
};
|
|
9360
9675
|
}
|
|
9361
9676
|
});
|
|
9362
|
-
const _hoisted_1$
|
|
9677
|
+
const _hoisted_1$S = {
|
|
9363
9678
|
key: 0,
|
|
9364
9679
|
id: "lupa-search-box-panel"
|
|
9365
9680
|
};
|
|
9366
|
-
const _hoisted_2$
|
|
9367
|
-
const _hoisted_3$
|
|
9681
|
+
const _hoisted_2$F = ["data-cy"];
|
|
9682
|
+
const _hoisted_3$u = {
|
|
9368
9683
|
key: 0,
|
|
9369
9684
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
9370
9685
|
};
|
|
9371
|
-
const _hoisted_4$
|
|
9686
|
+
const _hoisted_4$n = {
|
|
9372
9687
|
key: 1,
|
|
9373
9688
|
class: "lupa-panel-title"
|
|
9374
9689
|
};
|
|
@@ -9376,14 +9691,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9376
9691
|
key: 1,
|
|
9377
9692
|
id: "lupa-search-box-panel"
|
|
9378
9693
|
};
|
|
9379
|
-
const __default__$
|
|
9694
|
+
const __default__$2 = {
|
|
9380
9695
|
components: {
|
|
9381
9696
|
SearchBoxSuggestionsWrapper: _sfc_main$1e,
|
|
9382
|
-
SearchBoxProductsWrapper: _sfc_main$
|
|
9383
|
-
SearchBoxRelatedSourceWrapper: _sfc_main$
|
|
9697
|
+
SearchBoxProductsWrapper: _sfc_main$X,
|
|
9698
|
+
SearchBoxRelatedSourceWrapper: _sfc_main$W
|
|
9384
9699
|
}
|
|
9385
9700
|
};
|
|
9386
|
-
const _sfc_main
|
|
9701
|
+
const _sfc_main$V = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$2), {
|
|
9387
9702
|
__name: "SearchBoxMainPanel",
|
|
9388
9703
|
props: {
|
|
9389
9704
|
options: {},
|
|
@@ -9529,7 +9844,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9529
9844
|
ref_key: "panelContainer",
|
|
9530
9845
|
ref: panelContainer
|
|
9531
9846
|
}, [
|
|
9532
|
-
displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
9847
|
+
displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$S, [
|
|
9533
9848
|
labels.value.closePanel ? (openBlock(), createElementBlock("a", {
|
|
9534
9849
|
key: 0,
|
|
9535
9850
|
class: "lupa-search-box-close-panel",
|
|
@@ -9550,8 +9865,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9550
9865
|
]),
|
|
9551
9866
|
"data-cy": "lupa-panel-" + panel.type + "-index"
|
|
9552
9867
|
}, [
|
|
9553
|
-
((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
9554
|
-
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
9868
|
+
((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$u, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
|
|
9869
|
+
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$n, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
|
|
9555
9870
|
panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
|
|
9556
9871
|
key: 2,
|
|
9557
9872
|
panel,
|
|
@@ -9571,7 +9886,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9571
9886
|
key: "0"
|
|
9572
9887
|
} : void 0
|
|
9573
9888
|
]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
9574
|
-
], 10, _hoisted_2$
|
|
9889
|
+
], 10, _hoisted_2$F);
|
|
9575
9890
|
}), 128))
|
|
9576
9891
|
], 4),
|
|
9577
9892
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1h, {
|
|
@@ -9610,9 +9925,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9610
9925
|
const elements = getElements(triggers);
|
|
9611
9926
|
elements.forEach((e) => e == null ? void 0 : e.removeEventListener(BIND_EVENT, event));
|
|
9612
9927
|
};
|
|
9613
|
-
const _hoisted_1$
|
|
9614
|
-
const _hoisted_2$
|
|
9615
|
-
const _sfc_main$
|
|
9928
|
+
const _hoisted_1$R = { id: "lupa-search-box" };
|
|
9929
|
+
const _hoisted_2$E = { class: "lupa-search-box-wrapper" };
|
|
9930
|
+
const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
9616
9931
|
__name: "SearchBox",
|
|
9617
9932
|
props: {
|
|
9618
9933
|
options: {},
|
|
@@ -9857,8 +10172,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9857
10172
|
};
|
|
9858
10173
|
return (_ctx, _cache) => {
|
|
9859
10174
|
var _a2;
|
|
9860
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
9861
|
-
createBaseVNode("div", _hoisted_2$
|
|
10175
|
+
return openBlock(), createElementBlock("div", _hoisted_1$R, [
|
|
10176
|
+
createBaseVNode("div", _hoisted_2$E, [
|
|
9862
10177
|
createVNode(_sfc_main$1l, {
|
|
9863
10178
|
options: inputOptions.value,
|
|
9864
10179
|
suggestedValue: suggestedValue.value,
|
|
@@ -9870,7 +10185,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9870
10185
|
onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
|
|
9871
10186
|
onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
9872
10187
|
}, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
|
|
9873
|
-
opened.value || _ctx.isSearchContainer ? (openBlock(), createBlock(_sfc_main
|
|
10188
|
+
opened.value || _ctx.isSearchContainer ? (openBlock(), createBlock(_sfc_main$V, {
|
|
9874
10189
|
key: 0,
|
|
9875
10190
|
options: panelOptions.value,
|
|
9876
10191
|
inputValue: inputValue.value,
|
|
@@ -9958,20 +10273,20 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9958
10273
|
}
|
|
9959
10274
|
return searchParams;
|
|
9960
10275
|
};
|
|
9961
|
-
const _hoisted_1$
|
|
10276
|
+
const _hoisted_1$Q = {
|
|
9962
10277
|
key: 0,
|
|
9963
10278
|
id: "lupa-search-results-did-you-mean"
|
|
9964
10279
|
};
|
|
9965
|
-
const _hoisted_2$
|
|
10280
|
+
const _hoisted_2$D = {
|
|
9966
10281
|
key: 0,
|
|
9967
10282
|
"data-cy": "suggested-search-text-label"
|
|
9968
10283
|
};
|
|
9969
|
-
const _hoisted_3$
|
|
10284
|
+
const _hoisted_3$t = {
|
|
9970
10285
|
key: 1,
|
|
9971
10286
|
"data-cy": "did-you-mean-label"
|
|
9972
10287
|
};
|
|
9973
|
-
const _hoisted_4$
|
|
9974
|
-
const _sfc_main$
|
|
10288
|
+
const _hoisted_4$m = { key: 1 };
|
|
10289
|
+
const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
9975
10290
|
__name: "SearchResultsDidYouMean",
|
|
9976
10291
|
props: {
|
|
9977
10292
|
labels: {}
|
|
@@ -10003,8 +10318,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10003
10318
|
paramStore.goToResults({ searchText, facet });
|
|
10004
10319
|
};
|
|
10005
10320
|
return (_ctx, _cache) => {
|
|
10006
|
-
return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
10007
|
-
unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
10321
|
+
return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
|
|
10322
|
+
unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$D, [
|
|
10008
10323
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.noResultsSuggestion.split(" "), (label, index) => {
|
|
10009
10324
|
return openBlock(), createElementBlock("span", { key: index }, [
|
|
10010
10325
|
createBaseVNode("span", {
|
|
@@ -10013,7 +10328,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10013
10328
|
]);
|
|
10014
10329
|
}), 128))
|
|
10015
10330
|
])) : createCommentVNode("", true),
|
|
10016
|
-
didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
10331
|
+
didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$t, [
|
|
10017
10332
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.didYouMean.split(" "), (label, index) => {
|
|
10018
10333
|
return openBlock(), createElementBlock("span", { key: index }, [
|
|
10019
10334
|
label.includes("{1}") ? (openBlock(), createElementBlock("span", {
|
|
@@ -10021,7 +10336,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10021
10336
|
class: "lupa-did-you-mean lupa-highlighted-search-text",
|
|
10022
10337
|
"data-cy": "did-you-mean-value",
|
|
10023
10338
|
onClick: _cache[0] || (_cache[0] = ($event) => goToResults({ searchText: didYouMeanValue.value }))
|
|
10024
|
-
}, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$
|
|
10339
|
+
}, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$m, toDisplayString(label) + " ", 1))
|
|
10025
10340
|
]);
|
|
10026
10341
|
}), 128))
|
|
10027
10342
|
])) : createCommentVNode("", true)
|
|
@@ -10029,12 +10344,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10029
10344
|
};
|
|
10030
10345
|
}
|
|
10031
10346
|
});
|
|
10032
|
-
const _hoisted_1$
|
|
10347
|
+
const _hoisted_1$P = {
|
|
10033
10348
|
key: 0,
|
|
10034
10349
|
class: "lupa-search-results-summary"
|
|
10035
10350
|
};
|
|
10036
|
-
const _hoisted_2$
|
|
10037
|
-
const _sfc_main$
|
|
10351
|
+
const _hoisted_2$C = ["innerHTML"];
|
|
10352
|
+
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
10038
10353
|
__name: "SearchResultsSummary",
|
|
10039
10354
|
props: {
|
|
10040
10355
|
label: {},
|
|
@@ -10049,8 +10364,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10049
10364
|
return addParamsToLabel(props.label, range, `<span>${totalItems.value}</span>`);
|
|
10050
10365
|
});
|
|
10051
10366
|
return (_ctx, _cache) => {
|
|
10052
|
-
return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
10053
|
-
createBaseVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$
|
|
10367
|
+
return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$P, [
|
|
10368
|
+
createBaseVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$C),
|
|
10054
10369
|
_ctx.clearable ? (openBlock(), createElementBlock("span", {
|
|
10055
10370
|
key: 0,
|
|
10056
10371
|
class: "lupa-filter-clear",
|
|
@@ -10061,18 +10376,18 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10061
10376
|
};
|
|
10062
10377
|
}
|
|
10063
10378
|
});
|
|
10064
|
-
const _hoisted_1$
|
|
10379
|
+
const _hoisted_1$O = {
|
|
10065
10380
|
key: 0,
|
|
10066
10381
|
class: "lupa-result-page-title",
|
|
10067
10382
|
"data-cy": "lupa-result-page-title"
|
|
10068
10383
|
};
|
|
10069
|
-
const _hoisted_2$
|
|
10070
|
-
const _hoisted_3$
|
|
10384
|
+
const _hoisted_2$B = { key: 0 };
|
|
10385
|
+
const _hoisted_3$s = {
|
|
10071
10386
|
key: 1,
|
|
10072
10387
|
class: "lupa-results-total-count"
|
|
10073
10388
|
};
|
|
10074
|
-
const _hoisted_4$
|
|
10075
|
-
const _sfc_main$
|
|
10389
|
+
const _hoisted_4$l = ["innerHTML"];
|
|
10390
|
+
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
10076
10391
|
__name: "SearchResultsTitle",
|
|
10077
10392
|
props: {
|
|
10078
10393
|
options: {},
|
|
@@ -10107,12 +10422,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10107
10422
|
});
|
|
10108
10423
|
return (_ctx, _cache) => {
|
|
10109
10424
|
return openBlock(), createElementBlock("div", null, [
|
|
10110
|
-
showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$
|
|
10425
|
+
showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$O, [
|
|
10111
10426
|
createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
|
|
10112
|
-
queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
10113
|
-
showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
10427
|
+
queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$B, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
|
|
10428
|
+
showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$s, "(" + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
|
|
10114
10429
|
])) : createCommentVNode("", true),
|
|
10115
|
-
_ctx.showSummary ? (openBlock(), createBlock(_sfc_main$
|
|
10430
|
+
_ctx.showSummary ? (openBlock(), createBlock(_sfc_main$S, {
|
|
10116
10431
|
key: 1,
|
|
10117
10432
|
label: summaryLabel.value
|
|
10118
10433
|
}, null, 8, ["label"])) : createCommentVNode("", true),
|
|
@@ -10120,21 +10435,21 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10120
10435
|
key: 2,
|
|
10121
10436
|
class: "lupa-result-page-description-top",
|
|
10122
10437
|
innerHTML: descriptionTop.value
|
|
10123
|
-
}, null, 8, _hoisted_4$
|
|
10438
|
+
}, null, 8, _hoisted_4$l)) : createCommentVNode("", true)
|
|
10124
10439
|
]);
|
|
10125
10440
|
};
|
|
10126
10441
|
}
|
|
10127
10442
|
});
|
|
10128
|
-
const _hoisted_1$
|
|
10129
|
-
const _hoisted_2$
|
|
10443
|
+
const _hoisted_1$N = { class: "lupa-search-result-filter-value" };
|
|
10444
|
+
const _hoisted_2$A = {
|
|
10130
10445
|
class: "lupa-current-filter-label",
|
|
10131
10446
|
"data-cy": "lupa-current-filter-label"
|
|
10132
10447
|
};
|
|
10133
|
-
const _hoisted_3$
|
|
10448
|
+
const _hoisted_3$r = {
|
|
10134
10449
|
class: "lupa-current-filter-value",
|
|
10135
10450
|
"data-cy": "lupa-current-filter-value"
|
|
10136
10451
|
};
|
|
10137
|
-
const _sfc_main$
|
|
10452
|
+
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
10138
10453
|
__name: "CurrentFilterDisplay",
|
|
10139
10454
|
props: {
|
|
10140
10455
|
filter: {}
|
|
@@ -10146,28 +10461,28 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10146
10461
|
emit2("remove", { filter: props.filter });
|
|
10147
10462
|
};
|
|
10148
10463
|
return (_ctx, _cache) => {
|
|
10149
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
10464
|
+
return openBlock(), createElementBlock("div", _hoisted_1$N, [
|
|
10150
10465
|
createBaseVNode("div", {
|
|
10151
10466
|
class: "lupa-current-filter-action",
|
|
10152
10467
|
onClick: handleClick
|
|
10153
10468
|
}, "⨉"),
|
|
10154
|
-
createBaseVNode("div", _hoisted_2$
|
|
10155
|
-
createBaseVNode("div", _hoisted_3$
|
|
10469
|
+
createBaseVNode("div", _hoisted_2$A, toDisplayString(_ctx.filter.label) + ": ", 1),
|
|
10470
|
+
createBaseVNode("div", _hoisted_3$r, toDisplayString(_ctx.filter.value), 1)
|
|
10156
10471
|
]);
|
|
10157
10472
|
};
|
|
10158
10473
|
}
|
|
10159
10474
|
});
|
|
10160
|
-
const _hoisted_1$
|
|
10161
|
-
const _hoisted_2$
|
|
10475
|
+
const _hoisted_1$M = { class: "lupa-filter-title-text" };
|
|
10476
|
+
const _hoisted_2$z = {
|
|
10162
10477
|
key: 0,
|
|
10163
10478
|
class: "lupa-filter-count"
|
|
10164
10479
|
};
|
|
10165
|
-
const _hoisted_3$
|
|
10480
|
+
const _hoisted_3$q = {
|
|
10166
10481
|
key: 0,
|
|
10167
10482
|
class: "filter-values"
|
|
10168
10483
|
};
|
|
10169
|
-
const _hoisted_4$
|
|
10170
|
-
const _sfc_main$
|
|
10484
|
+
const _hoisted_4$k = { class: "lupa-current-filter-list" };
|
|
10485
|
+
const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
10171
10486
|
__name: "CurrentFilters",
|
|
10172
10487
|
props: {
|
|
10173
10488
|
options: {},
|
|
@@ -10176,6 +10491,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10176
10491
|
setup(__props) {
|
|
10177
10492
|
const isOpen = ref(false);
|
|
10178
10493
|
const paramsStore = useParamsStore();
|
|
10494
|
+
const optionStore = useOptionsStore();
|
|
10179
10495
|
const searchResultStore = useSearchResultStore();
|
|
10180
10496
|
const { filters, displayFilters, currentFilterCount } = storeToRefs(searchResultStore);
|
|
10181
10497
|
const currentFilters = computed(() => filters.value);
|
|
@@ -10193,6 +10509,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10193
10509
|
// TODO: Fix any
|
|
10194
10510
|
paramsStore.appendParams,
|
|
10195
10511
|
{ type: "terms", value: filter.value, key: filter.key },
|
|
10512
|
+
optionStore.getQueryParamName,
|
|
10196
10513
|
currentFilters.value
|
|
10197
10514
|
);
|
|
10198
10515
|
break;
|
|
@@ -10200,13 +10517,17 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10200
10517
|
toggleHierarchyFilter(
|
|
10201
10518
|
paramsStore.appendParams,
|
|
10202
10519
|
{ type: "hierarchy", value: filter.value, key: filter.key },
|
|
10520
|
+
optionStore.getQueryParamName,
|
|
10203
10521
|
currentFilters.value,
|
|
10204
10522
|
true
|
|
10205
10523
|
);
|
|
10206
10524
|
break;
|
|
10207
10525
|
case "range":
|
|
10208
10526
|
paramsStore.removeParameters({
|
|
10209
|
-
paramsToRemove: [
|
|
10527
|
+
paramsToRemove: [
|
|
10528
|
+
optionStore.getQueryParamName(QUERY_PARAMS$1.PAGE),
|
|
10529
|
+
`${FACET_PARAMS_TYPE.RANGE}${filter.key}`
|
|
10530
|
+
]
|
|
10210
10531
|
});
|
|
10211
10532
|
break;
|
|
10212
10533
|
}
|
|
@@ -10222,19 +10543,19 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10222
10543
|
class: "lupa-current-filter-title",
|
|
10223
10544
|
onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
|
|
10224
10545
|
}, [
|
|
10225
|
-
createBaseVNode("div", _hoisted_1$
|
|
10546
|
+
createBaseVNode("div", _hoisted_1$M, [
|
|
10226
10547
|
createTextVNode(toDisplayString((_c = (_b = (_a = _ctx.options) == null ? void 0 : _a.labels) == null ? void 0 : _b.title) != null ? _c : "") + " ", 1),
|
|
10227
|
-
_ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
10548
|
+
_ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$z, " (" + toDisplayString(unref(currentFilterCount)) + ") ", 1)) : createCommentVNode("", true)
|
|
10228
10549
|
]),
|
|
10229
10550
|
_ctx.expandable ? (openBlock(), createElementBlock("div", {
|
|
10230
10551
|
key: 0,
|
|
10231
10552
|
class: normalizeClass(["lupa-filter-title-caret", isOpen.value && "open"])
|
|
10232
10553
|
}, null, 2)) : createCommentVNode("", true)
|
|
10233
10554
|
]),
|
|
10234
|
-
!_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
10235
|
-
createBaseVNode("div", _hoisted_4$
|
|
10555
|
+
!_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$q, [
|
|
10556
|
+
createBaseVNode("div", _hoisted_4$k, [
|
|
10236
10557
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(displayFilters), (filter) => {
|
|
10237
|
-
return openBlock(), createBlock(_sfc_main$
|
|
10558
|
+
return openBlock(), createBlock(_sfc_main$Q, {
|
|
10238
10559
|
key: filter.key + "_" + filter.value,
|
|
10239
10560
|
filter,
|
|
10240
10561
|
onRemove: handleRemove
|
|
@@ -10251,8 +10572,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10251
10572
|
};
|
|
10252
10573
|
}
|
|
10253
10574
|
});
|
|
10254
|
-
const _hoisted_1$
|
|
10255
|
-
const _sfc_main$
|
|
10575
|
+
const _hoisted_1$L = ["href"];
|
|
10576
|
+
const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
10256
10577
|
__name: "CategoryFilterItem",
|
|
10257
10578
|
props: {
|
|
10258
10579
|
options: {},
|
|
@@ -10289,20 +10610,20 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10289
10610
|
"data-cy": "lupa-child-category-item",
|
|
10290
10611
|
href: urlLink.value,
|
|
10291
10612
|
onClick: handleNavigation
|
|
10292
|
-
}, toDisplayString(title.value), 9, _hoisted_1$
|
|
10613
|
+
}, toDisplayString(title.value), 9, _hoisted_1$L)
|
|
10293
10614
|
], 2);
|
|
10294
10615
|
};
|
|
10295
10616
|
}
|
|
10296
10617
|
});
|
|
10297
|
-
const _hoisted_1$
|
|
10618
|
+
const _hoisted_1$K = {
|
|
10298
10619
|
class: "lupa-category-filter",
|
|
10299
10620
|
"data-cy": "lupa-category-filter"
|
|
10300
10621
|
};
|
|
10301
|
-
const _hoisted_2$
|
|
10302
|
-
const _hoisted_3$
|
|
10303
|
-
const _hoisted_4$
|
|
10622
|
+
const _hoisted_2$y = { class: "lupa-category-back" };
|
|
10623
|
+
const _hoisted_3$p = ["href"];
|
|
10624
|
+
const _hoisted_4$j = ["href"];
|
|
10304
10625
|
const _hoisted_5$d = { class: "lupa-child-category-list" };
|
|
10305
|
-
const _sfc_main$
|
|
10626
|
+
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
10306
10627
|
__name: "CategoryFilter",
|
|
10307
10628
|
props: {
|
|
10308
10629
|
options: {}
|
|
@@ -10388,14 +10709,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10388
10709
|
};
|
|
10389
10710
|
__expose({ fetch: fetch2 });
|
|
10390
10711
|
return (_ctx, _cache) => {
|
|
10391
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
10392
|
-
createBaseVNode("div", _hoisted_2$
|
|
10712
|
+
return openBlock(), createElementBlock("div", _hoisted_1$K, [
|
|
10713
|
+
createBaseVNode("div", _hoisted_2$y, [
|
|
10393
10714
|
hasBackButton.value ? (openBlock(), createElementBlock("a", {
|
|
10394
10715
|
key: 0,
|
|
10395
10716
|
"data-cy": "lupa-category-back",
|
|
10396
10717
|
href: backUrlLink.value,
|
|
10397
10718
|
onClick: handleNavigationBack
|
|
10398
|
-
}, toDisplayString(backTitle.value), 9, _hoisted_3$
|
|
10719
|
+
}, toDisplayString(backTitle.value), 9, _hoisted_3$p)) : createCommentVNode("", true)
|
|
10399
10720
|
]),
|
|
10400
10721
|
createBaseVNode("div", {
|
|
10401
10722
|
class: normalizeClass(["lupa-current-category", { "lupa-current-category-active": isActive }])
|
|
@@ -10405,11 +10726,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10405
10726
|
href: parentUrlLink.value,
|
|
10406
10727
|
class: normalizeClass({ "lupa-title-category": !hasBackButton.value }),
|
|
10407
10728
|
onClick: handleNavigationParent
|
|
10408
|
-
}, toDisplayString(parentTitle.value), 11, _hoisted_4$
|
|
10729
|
+
}, toDisplayString(parentTitle.value), 11, _hoisted_4$j)
|
|
10409
10730
|
], 2),
|
|
10410
10731
|
createBaseVNode("div", _hoisted_5$d, [
|
|
10411
10732
|
(openBlock(true), createElementBlock(Fragment, null, renderList(categoryChildren.value, (child) => {
|
|
10412
|
-
return openBlock(), createBlock(_sfc_main$
|
|
10733
|
+
return openBlock(), createBlock(_sfc_main$O, {
|
|
10413
10734
|
key: getCategoryKey(child),
|
|
10414
10735
|
item: child,
|
|
10415
10736
|
options: _ctx.options
|
|
@@ -10420,13 +10741,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10420
10741
|
};
|
|
10421
10742
|
}
|
|
10422
10743
|
});
|
|
10423
|
-
const _hoisted_1$
|
|
10744
|
+
const _hoisted_1$J = {
|
|
10424
10745
|
class: "lupa-search-result-facet-term-values",
|
|
10425
10746
|
"data-cy": "lupa-search-result-facet-term-values"
|
|
10426
10747
|
};
|
|
10427
|
-
const _hoisted_2$
|
|
10428
|
-
const _hoisted_3$
|
|
10429
|
-
const _hoisted_4$
|
|
10748
|
+
const _hoisted_2$x = ["placeholder"];
|
|
10749
|
+
const _hoisted_3$o = { class: "lupa-terms-list" };
|
|
10750
|
+
const _hoisted_4$i = ["onClick"];
|
|
10430
10751
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
10431
10752
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
10432
10753
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
@@ -10436,7 +10757,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10436
10757
|
};
|
|
10437
10758
|
const _hoisted_9$1 = { key: 0 };
|
|
10438
10759
|
const _hoisted_10$1 = { key: 1 };
|
|
10439
|
-
const _sfc_main$
|
|
10760
|
+
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
10440
10761
|
__name: "TermFacet",
|
|
10441
10762
|
props: {
|
|
10442
10763
|
options: {},
|
|
@@ -10505,17 +10826,17 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10505
10826
|
return selectedItems == null ? void 0 : selectedItems.includes((_b = item.title) == null ? void 0 : _b.toString());
|
|
10506
10827
|
};
|
|
10507
10828
|
return (_ctx, _cache) => {
|
|
10508
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
10829
|
+
return openBlock(), createElementBlock("div", _hoisted_1$J, [
|
|
10509
10830
|
isFilterable.value ? withDirectives((openBlock(), createElementBlock("input", {
|
|
10510
10831
|
key: 0,
|
|
10511
10832
|
class: "lupa-term-filter",
|
|
10512
10833
|
"data-cy": "lupa-term-filter",
|
|
10513
10834
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
|
|
10514
10835
|
placeholder: _ctx.options.labels.facetFilter
|
|
10515
|
-
}, null, 8, _hoisted_2$
|
|
10836
|
+
}, null, 8, _hoisted_2$x)), [
|
|
10516
10837
|
[vModelText, termFilter.value]
|
|
10517
10838
|
]) : createCommentVNode("", true),
|
|
10518
|
-
createBaseVNode("div", _hoisted_3$
|
|
10839
|
+
createBaseVNode("div", _hoisted_3$o, [
|
|
10519
10840
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayValues.value, (item) => {
|
|
10520
10841
|
return openBlock(), createElementBlock("div", {
|
|
10521
10842
|
class: normalizeClass(["lupa-facet-term", { checked: isChecked(item) }]),
|
|
@@ -10532,7 +10853,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10532
10853
|
createBaseVNode("span", _hoisted_7$6, toDisplayString(item.title), 1),
|
|
10533
10854
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$1, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
10534
10855
|
])
|
|
10535
|
-
], 10, _hoisted_4$
|
|
10856
|
+
], 10, _hoisted_4$i);
|
|
10536
10857
|
}), 128))
|
|
10537
10858
|
]),
|
|
10538
10859
|
displayShowMore.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -11523,16 +11844,16 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11523
11844
|
m.render = function(e, t, r, i, n, o) {
|
|
11524
11845
|
return openBlock(), createElementBlock("div", mergeProps(e.sliderProps, { ref: "slider" }), null, 16);
|
|
11525
11846
|
}, m.__file = "src/Slider.vue";
|
|
11526
|
-
const _hoisted_1$
|
|
11527
|
-
const _hoisted_2$
|
|
11847
|
+
const _hoisted_1$I = { class: "lupa-search-result-facet-stats-values" };
|
|
11848
|
+
const _hoisted_2$w = {
|
|
11528
11849
|
key: 0,
|
|
11529
11850
|
class: "lupa-stats-facet-summary"
|
|
11530
11851
|
};
|
|
11531
|
-
const _hoisted_3$
|
|
11852
|
+
const _hoisted_3$n = {
|
|
11532
11853
|
key: 1,
|
|
11533
11854
|
class: "lupa-stats-facet-summary-input"
|
|
11534
11855
|
};
|
|
11535
|
-
const _hoisted_4$
|
|
11856
|
+
const _hoisted_4$h = {
|
|
11536
11857
|
key: 0,
|
|
11537
11858
|
class: "lupa-stats-range-label"
|
|
11538
11859
|
};
|
|
@@ -11551,7 +11872,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11551
11872
|
key: 2,
|
|
11552
11873
|
class: "lupa-stats-slider-wrapper"
|
|
11553
11874
|
};
|
|
11554
|
-
const _sfc_main$
|
|
11875
|
+
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
11555
11876
|
__name: "StatsFacet",
|
|
11556
11877
|
props: {
|
|
11557
11878
|
options: {},
|
|
@@ -11720,10 +12041,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11720
12041
|
innerSliderRange.value = value;
|
|
11721
12042
|
};
|
|
11722
12043
|
return (_ctx, _cache) => {
|
|
11723
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
11724
|
-
!isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
12044
|
+
return openBlock(), createElementBlock("div", _hoisted_1$I, [
|
|
12045
|
+
!isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$w, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$n, [
|
|
11725
12046
|
createBaseVNode("div", null, [
|
|
11726
|
-
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
12047
|
+
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$h, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
|
|
11727
12048
|
createBaseVNode("div", _hoisted_5$b, [
|
|
11728
12049
|
withDirectives(createBaseVNode("input", {
|
|
11729
12050
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
|
|
@@ -11787,10 +12108,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11787
12108
|
};
|
|
11788
12109
|
}
|
|
11789
12110
|
});
|
|
11790
|
-
const _hoisted_1$
|
|
11791
|
-
const _hoisted_2$
|
|
11792
|
-
const _hoisted_3$
|
|
11793
|
-
const _hoisted_4$
|
|
12111
|
+
const _hoisted_1$H = { class: "lupa-term-checkbox-wrapper" };
|
|
12112
|
+
const _hoisted_2$v = { class: "lupa-term-checkbox-label" };
|
|
12113
|
+
const _hoisted_3$m = { class: "lupa-term-label" };
|
|
12114
|
+
const _hoisted_4$g = {
|
|
11794
12115
|
key: 0,
|
|
11795
12116
|
class: "lupa-term-count"
|
|
11796
12117
|
};
|
|
@@ -11798,7 +12119,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11798
12119
|
key: 0,
|
|
11799
12120
|
class: "lupa-facet-level"
|
|
11800
12121
|
};
|
|
11801
|
-
const _sfc_main$
|
|
12122
|
+
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
11802
12123
|
__name: "HierarchyFacetLevel",
|
|
11803
12124
|
props: {
|
|
11804
12125
|
options: {},
|
|
@@ -11844,14 +12165,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11844
12165
|
"data-cy": "lupa-facet-term",
|
|
11845
12166
|
onClick: _cache[0] || (_cache[0] = ($event) => handleFacetClick(_ctx.item))
|
|
11846
12167
|
}, [
|
|
11847
|
-
createBaseVNode("div", _hoisted_1$
|
|
12168
|
+
createBaseVNode("div", _hoisted_1$H, [
|
|
11848
12169
|
createBaseVNode("span", {
|
|
11849
12170
|
class: normalizeClass(["lupa-term-checkbox", { checked: isChecked.value }])
|
|
11850
12171
|
}, null, 2)
|
|
11851
12172
|
]),
|
|
11852
|
-
createBaseVNode("div", _hoisted_2$
|
|
11853
|
-
createBaseVNode("span", _hoisted_3$
|
|
11854
|
-
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
12173
|
+
createBaseVNode("div", _hoisted_2$v, [
|
|
12174
|
+
createBaseVNode("span", _hoisted_3$m, toDisplayString(_ctx.item.title) + toDisplayString(" "), 1),
|
|
12175
|
+
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$g, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
|
|
11855
12176
|
])
|
|
11856
12177
|
]),
|
|
11857
12178
|
showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_5$a, [
|
|
@@ -11870,13 +12191,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11870
12191
|
};
|
|
11871
12192
|
}
|
|
11872
12193
|
});
|
|
11873
|
-
const _hoisted_1$
|
|
12194
|
+
const _hoisted_1$G = {
|
|
11874
12195
|
class: "lupa-search-result-facet-term-values lupa-search-result-facet-hierarchy-values",
|
|
11875
12196
|
"data-cy": "lupa-search-result-facet-term-values"
|
|
11876
12197
|
};
|
|
11877
|
-
const _hoisted_2$
|
|
11878
|
-
const _hoisted_3$
|
|
11879
|
-
const _sfc_main$
|
|
12198
|
+
const _hoisted_2$u = { key: 0 };
|
|
12199
|
+
const _hoisted_3$l = ["placeholder"];
|
|
12200
|
+
const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
11880
12201
|
__name: "HierarchyFacet",
|
|
11881
12202
|
props: {
|
|
11882
12203
|
options: {},
|
|
@@ -11926,19 +12247,19 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11926
12247
|
showAll.value = true;
|
|
11927
12248
|
};
|
|
11928
12249
|
return (_ctx, _cache) => {
|
|
11929
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
11930
|
-
isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
12250
|
+
return openBlock(), createElementBlock("div", _hoisted_1$G, [
|
|
12251
|
+
isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$u, [
|
|
11931
12252
|
withDirectives(createBaseVNode("input", {
|
|
11932
12253
|
class: "lupa-term-filter",
|
|
11933
12254
|
"data-cy": "lupa-term-filter",
|
|
11934
12255
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
|
|
11935
12256
|
placeholder: _ctx.options.labels.facetFilter
|
|
11936
|
-
}, null, 8, _hoisted_3$
|
|
12257
|
+
}, null, 8, _hoisted_3$l), [
|
|
11937
12258
|
[vModelText, termFilter.value]
|
|
11938
12259
|
])
|
|
11939
12260
|
])) : createCommentVNode("", true),
|
|
11940
12261
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayValues.value, (item) => {
|
|
11941
|
-
return openBlock(), createBlock(_sfc_main$
|
|
12262
|
+
return openBlock(), createBlock(_sfc_main$K, {
|
|
11942
12263
|
key: item.title,
|
|
11943
12264
|
options: _ctx.options,
|
|
11944
12265
|
item,
|
|
@@ -11958,20 +12279,20 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11958
12279
|
};
|
|
11959
12280
|
}
|
|
11960
12281
|
});
|
|
11961
|
-
const _hoisted_1$
|
|
11962
|
-
const _hoisted_2$
|
|
12282
|
+
const _hoisted_1$F = { class: "lupa-facet-label-text" };
|
|
12283
|
+
const _hoisted_2$t = {
|
|
11963
12284
|
key: 0,
|
|
11964
12285
|
class: "lupa-facet-content",
|
|
11965
12286
|
"data-cy": "lupa-facet-content"
|
|
11966
12287
|
};
|
|
11967
|
-
const __default__$
|
|
12288
|
+
const __default__$1 = {
|
|
11968
12289
|
components: {
|
|
11969
|
-
TermFacet: _sfc_main$
|
|
11970
|
-
StatsFacet: _sfc_main$
|
|
11971
|
-
HierarchyFacet: _sfc_main$
|
|
12290
|
+
TermFacet: _sfc_main$M,
|
|
12291
|
+
StatsFacet: _sfc_main$L,
|
|
12292
|
+
HierarchyFacet: _sfc_main$J
|
|
11972
12293
|
}
|
|
11973
12294
|
};
|
|
11974
|
-
const _sfc_main$
|
|
12295
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$1), {
|
|
11975
12296
|
__name: "FacetDisplay",
|
|
11976
12297
|
props: {
|
|
11977
12298
|
options: {},
|
|
@@ -12083,12 +12404,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12083
12404
|
"data-cy": "lupa-search-result-facet-label",
|
|
12084
12405
|
onClick: toggleFacet
|
|
12085
12406
|
}, [
|
|
12086
|
-
createBaseVNode("div", _hoisted_1$
|
|
12407
|
+
createBaseVNode("div", _hoisted_1$F, toDisplayString(facet.value.label), 1),
|
|
12087
12408
|
createBaseVNode("div", {
|
|
12088
12409
|
class: normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
|
|
12089
12410
|
}, null, 2)
|
|
12090
12411
|
], 2),
|
|
12091
|
-
isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
12412
|
+
isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$t, [
|
|
12092
12413
|
(openBlock(), createBlock(resolveDynamicComponent(facetType.value), {
|
|
12093
12414
|
facet: facet.value,
|
|
12094
12415
|
currentFilters: currentFilters.value[facet.value.key],
|
|
@@ -12106,12 +12427,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12106
12427
|
};
|
|
12107
12428
|
}
|
|
12108
12429
|
}));
|
|
12109
|
-
const _hoisted_1$
|
|
12110
|
-
const _hoisted_2$
|
|
12430
|
+
const _hoisted_1$E = { class: "lupa-search-result-facet-section" };
|
|
12431
|
+
const _hoisted_2$s = {
|
|
12111
12432
|
key: 0,
|
|
12112
12433
|
class: "lupa-facets-title"
|
|
12113
12434
|
};
|
|
12114
|
-
const _sfc_main$
|
|
12435
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
12115
12436
|
__name: "FacetList",
|
|
12116
12437
|
props: {
|
|
12117
12438
|
options: {},
|
|
@@ -12145,14 +12466,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12145
12466
|
};
|
|
12146
12467
|
return (_ctx, _cache) => {
|
|
12147
12468
|
var _a;
|
|
12148
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
12149
|
-
_ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
12469
|
+
return openBlock(), createElementBlock("div", _hoisted_1$E, [
|
|
12470
|
+
_ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$s, toDisplayString(_ctx.options.labels.title), 1)) : createCommentVNode("", true),
|
|
12150
12471
|
createBaseVNode("div", {
|
|
12151
12472
|
class: normalizeClass(["lupa-search-result-facet-list", "lupa-" + ((_a = _ctx.facetStyle) != null ? _a : "")])
|
|
12152
12473
|
}, [
|
|
12153
12474
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayFacets.value, (facet) => {
|
|
12154
12475
|
var _a2;
|
|
12155
|
-
return openBlock(), createBlock(_sfc_main$
|
|
12476
|
+
return openBlock(), createBlock(_sfc_main$I, {
|
|
12156
12477
|
key: facet.key,
|
|
12157
12478
|
facet,
|
|
12158
12479
|
currentFilters: currentFiltersValue.value,
|
|
@@ -12167,8 +12488,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12167
12488
|
};
|
|
12168
12489
|
}
|
|
12169
12490
|
});
|
|
12170
|
-
const _hoisted_1$
|
|
12171
|
-
const _sfc_main$
|
|
12491
|
+
const _hoisted_1$D = { class: "lupa-search-result-facets" };
|
|
12492
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
12172
12493
|
__name: "Facets",
|
|
12173
12494
|
props: {
|
|
12174
12495
|
options: {},
|
|
@@ -12208,13 +12529,28 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12208
12529
|
const handleFacetSelect = (facetAction) => {
|
|
12209
12530
|
switch (facetAction.type) {
|
|
12210
12531
|
case "terms":
|
|
12211
|
-
toggleTermFilter(
|
|
12532
|
+
toggleTermFilter(
|
|
12533
|
+
paramStore.appendParams,
|
|
12534
|
+
facetAction,
|
|
12535
|
+
optionsStore.getQueryParamName,
|
|
12536
|
+
filters.value
|
|
12537
|
+
);
|
|
12212
12538
|
break;
|
|
12213
12539
|
case "range":
|
|
12214
|
-
toggleRangeFilter(
|
|
12540
|
+
toggleRangeFilter(
|
|
12541
|
+
paramStore.appendParams,
|
|
12542
|
+
facetAction,
|
|
12543
|
+
optionsStore.getQueryParamName,
|
|
12544
|
+
filters.value
|
|
12545
|
+
);
|
|
12215
12546
|
break;
|
|
12216
12547
|
case "hierarchy":
|
|
12217
|
-
toggleHierarchyFilter(
|
|
12548
|
+
toggleHierarchyFilter(
|
|
12549
|
+
paramStore.appendParams,
|
|
12550
|
+
facetAction,
|
|
12551
|
+
optionsStore.getQueryParamName,
|
|
12552
|
+
filters.value
|
|
12553
|
+
);
|
|
12218
12554
|
break;
|
|
12219
12555
|
}
|
|
12220
12556
|
if (scrollToResultsOptions.value.enabled) {
|
|
@@ -12229,8 +12565,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12229
12565
|
paramStore.removeParameters({ paramsToRemove: [param] });
|
|
12230
12566
|
};
|
|
12231
12567
|
return (_ctx, _cache) => {
|
|
12232
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
12233
|
-
regularFacets.value ? (openBlock(), createBlock(_sfc_main$
|
|
12568
|
+
return openBlock(), createElementBlock("div", _hoisted_1$D, [
|
|
12569
|
+
regularFacets.value ? (openBlock(), createBlock(_sfc_main$H, {
|
|
12234
12570
|
key: 0,
|
|
12235
12571
|
options: _ctx.options,
|
|
12236
12572
|
facets: regularFacets.value,
|
|
@@ -12244,11 +12580,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12244
12580
|
};
|
|
12245
12581
|
}
|
|
12246
12582
|
});
|
|
12247
|
-
const _hoisted_1$
|
|
12583
|
+
const _hoisted_1$C = {
|
|
12248
12584
|
id: "lupa-search-result-filters",
|
|
12249
12585
|
class: "lupa-search-result-filters"
|
|
12250
12586
|
};
|
|
12251
|
-
const _sfc_main$
|
|
12587
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
12252
12588
|
__name: "SearchResultsFilters",
|
|
12253
12589
|
props: {
|
|
12254
12590
|
options: {},
|
|
@@ -12277,19 +12613,19 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12277
12613
|
__expose({ fetch: fetch2 });
|
|
12278
12614
|
return (_ctx, _cache) => {
|
|
12279
12615
|
var _a;
|
|
12280
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
12281
|
-
showCurrentFilters.value ? (openBlock(), createBlock(_sfc_main$
|
|
12616
|
+
return openBlock(), createElementBlock("div", _hoisted_1$C, [
|
|
12617
|
+
showCurrentFilters.value ? (openBlock(), createBlock(_sfc_main$P, {
|
|
12282
12618
|
key: 0,
|
|
12283
12619
|
options: _ctx.options.currentFilters,
|
|
12284
12620
|
expandable: (_a = _ctx.expandable) != null ? _a : false
|
|
12285
12621
|
}, null, 8, ["options", "expandable"])) : createCommentVNode("", true),
|
|
12286
|
-
_ctx.options.categories ? (openBlock(), createBlock(_sfc_main$
|
|
12622
|
+
_ctx.options.categories ? (openBlock(), createBlock(_sfc_main$N, {
|
|
12287
12623
|
key: 1,
|
|
12288
12624
|
options: _ctx.options.categories,
|
|
12289
12625
|
ref_key: "categoryFilters",
|
|
12290
12626
|
ref: categoryFilters
|
|
12291
12627
|
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
12292
|
-
_ctx.options.facets ? (openBlock(), createBlock(_sfc_main$
|
|
12628
|
+
_ctx.options.facets ? (openBlock(), createBlock(_sfc_main$G, {
|
|
12293
12629
|
key: 2,
|
|
12294
12630
|
options: _ctx.options.facets
|
|
12295
12631
|
}, null, 8, ["options"])) : createCommentVNode("", true)
|
|
@@ -12297,20 +12633,20 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12297
12633
|
};
|
|
12298
12634
|
}
|
|
12299
12635
|
});
|
|
12300
|
-
const _hoisted_1$
|
|
12636
|
+
const _hoisted_1$B = {
|
|
12301
12637
|
key: 0,
|
|
12302
12638
|
class: "lupa-mobile-filter-sidebar"
|
|
12303
12639
|
};
|
|
12304
|
-
const _hoisted_2$
|
|
12305
|
-
const _hoisted_3$
|
|
12306
|
-
const _hoisted_4$
|
|
12640
|
+
const _hoisted_2$r = ["onClick"];
|
|
12641
|
+
const _hoisted_3$k = { class: "lupa-mobile-sidebar-content" };
|
|
12642
|
+
const _hoisted_4$f = { class: "lupa-sidebar-top" };
|
|
12307
12643
|
const _hoisted_5$9 = { class: "lupa-sidebar-title" };
|
|
12308
12644
|
const _hoisted_6$6 = {
|
|
12309
12645
|
key: 0,
|
|
12310
12646
|
class: "lupa-sidebar-filter-count"
|
|
12311
12647
|
};
|
|
12312
12648
|
const _hoisted_7$4 = { class: "lupa-sidebar-filter-options" };
|
|
12313
|
-
const _sfc_main$
|
|
12649
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
12314
12650
|
__name: "MobileFilterSidebar",
|
|
12315
12651
|
props: {
|
|
12316
12652
|
options: {}
|
|
@@ -12336,13 +12672,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12336
12672
|
searchResultStore.setSidebarState({ visible: false });
|
|
12337
12673
|
};
|
|
12338
12674
|
return (_ctx, _cache) => {
|
|
12339
|
-
return isMobileSidebarVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
12675
|
+
return isMobileSidebarVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$B, [
|
|
12340
12676
|
createBaseVNode("div", {
|
|
12341
12677
|
class: "lupa-sidebar-close",
|
|
12342
12678
|
onClick: withModifiers(handleMobileToggle, ["stop"])
|
|
12343
|
-
}, null, 8, _hoisted_2$
|
|
12344
|
-
createBaseVNode("div", _hoisted_3$
|
|
12345
|
-
createBaseVNode("div", _hoisted_4$
|
|
12679
|
+
}, null, 8, _hoisted_2$r),
|
|
12680
|
+
createBaseVNode("div", _hoisted_3$k, [
|
|
12681
|
+
createBaseVNode("div", _hoisted_4$f, [
|
|
12346
12682
|
createBaseVNode("div", _hoisted_5$9, [
|
|
12347
12683
|
createTextVNode(toDisplayString(sidebarTitle.value) + " ", 1),
|
|
12348
12684
|
isFilterCountVisible.value ? (openBlock(), createElementBlock("span", _hoisted_6$6, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
|
|
@@ -12353,7 +12689,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12353
12689
|
})
|
|
12354
12690
|
]),
|
|
12355
12691
|
createBaseVNode("div", _hoisted_7$4, [
|
|
12356
|
-
createVNode(_sfc_main$
|
|
12692
|
+
createVNode(_sfc_main$F, {
|
|
12357
12693
|
options: _ctx.options,
|
|
12358
12694
|
expandable: isActiveFiltersExpanded.value
|
|
12359
12695
|
}, null, 8, ["options", "expandable"])
|
|
@@ -12363,14 +12699,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12363
12699
|
};
|
|
12364
12700
|
}
|
|
12365
12701
|
});
|
|
12366
|
-
const _hoisted_1$
|
|
12367
|
-
const _hoisted_2$
|
|
12368
|
-
const _hoisted_3$
|
|
12702
|
+
const _hoisted_1$A = { id: "lupa-search-results-breadcrumbs" };
|
|
12703
|
+
const _hoisted_2$q = ["href", "onClick"];
|
|
12704
|
+
const _hoisted_3$j = {
|
|
12369
12705
|
key: 1,
|
|
12370
12706
|
class: "lupa-search-results-breadcrumb-text"
|
|
12371
12707
|
};
|
|
12372
|
-
const _hoisted_4$
|
|
12373
|
-
const _sfc_main$
|
|
12708
|
+
const _hoisted_4$e = { key: 2 };
|
|
12709
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
12374
12710
|
__name: "SearchResultsBreadcrumbs",
|
|
12375
12711
|
props: {
|
|
12376
12712
|
breadcrumbs: {}
|
|
@@ -12395,7 +12731,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12395
12731
|
handleRoutingEvent(link, event, hasEventRouting.value);
|
|
12396
12732
|
};
|
|
12397
12733
|
return (_ctx, _cache) => {
|
|
12398
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
12734
|
+
return openBlock(), createElementBlock("div", _hoisted_1$A, [
|
|
12399
12735
|
(openBlock(true), createElementBlock(Fragment, null, renderList(breadcrumbsValue.value, (breadcrumb, index) => {
|
|
12400
12736
|
return openBlock(), createElementBlock("span", {
|
|
12401
12737
|
class: "lupa-search-results-breadcrumb",
|
|
@@ -12409,19 +12745,19 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12409
12745
|
var _a;
|
|
12410
12746
|
return handleNavigation(e, (_a = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a : "");
|
|
12411
12747
|
}
|
|
12412
|
-
}, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$
|
|
12413
|
-
index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
12748
|
+
}, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$q)) : (openBlock(), createElementBlock("span", _hoisted_3$j, toDisplayString(getLabel(breadcrumb.label)), 1)),
|
|
12749
|
+
index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$e, " / ")) : createCommentVNode("", true)
|
|
12414
12750
|
]);
|
|
12415
12751
|
}), 128))
|
|
12416
12752
|
]);
|
|
12417
12753
|
};
|
|
12418
12754
|
}
|
|
12419
12755
|
});
|
|
12420
|
-
const _hoisted_1$
|
|
12756
|
+
const _hoisted_1$z = {
|
|
12421
12757
|
id: "lupa-search-result-filters",
|
|
12422
12758
|
class: "lupa-search-result-filters"
|
|
12423
12759
|
};
|
|
12424
|
-
const _sfc_main$
|
|
12760
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
12425
12761
|
__name: "FiltersTopDropdown",
|
|
12426
12762
|
props: {
|
|
12427
12763
|
options: {}
|
|
@@ -12429,8 +12765,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12429
12765
|
setup(__props) {
|
|
12430
12766
|
return (_ctx, _cache) => {
|
|
12431
12767
|
var _a;
|
|
12432
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
12433
|
-
_ctx.options.facets ? (openBlock(), createBlock(_sfc_main$
|
|
12768
|
+
return openBlock(), createElementBlock("div", _hoisted_1$z, [
|
|
12769
|
+
_ctx.options.facets ? (openBlock(), createBlock(_sfc_main$G, {
|
|
12434
12770
|
key: 0,
|
|
12435
12771
|
options: _ctx.options.facets,
|
|
12436
12772
|
"facet-style": (_a = _ctx.options.facets.style) == null ? void 0 : _a.type,
|
|
@@ -12440,8 +12776,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12440
12776
|
};
|
|
12441
12777
|
}
|
|
12442
12778
|
});
|
|
12443
|
-
const _hoisted_1$
|
|
12444
|
-
const _sfc_main$
|
|
12779
|
+
const _hoisted_1$y = { id: "lupa-search-results-layout-selection" };
|
|
12780
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
12445
12781
|
__name: "SearchResultsLayoutSelection",
|
|
12446
12782
|
setup(__props) {
|
|
12447
12783
|
const searchResultStore = useSearchResultStore();
|
|
@@ -12452,7 +12788,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12452
12788
|
searchResultStore.setLayout(layout2);
|
|
12453
12789
|
};
|
|
12454
12790
|
return (_ctx, _cache) => {
|
|
12455
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
12791
|
+
return openBlock(), createElementBlock("div", _hoisted_1$y, [
|
|
12456
12792
|
createBaseVNode("div", {
|
|
12457
12793
|
class: normalizeClass([
|
|
12458
12794
|
"lupa-layout-selection-grid",
|
|
@@ -12474,11 +12810,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12474
12810
|
};
|
|
12475
12811
|
}
|
|
12476
12812
|
});
|
|
12477
|
-
const _hoisted_1$
|
|
12813
|
+
const _hoisted_1$x = {
|
|
12478
12814
|
key: 0,
|
|
12479
12815
|
class: "lupa-mobile-toggle-filter-count"
|
|
12480
12816
|
};
|
|
12481
|
-
const _sfc_main$
|
|
12817
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
12482
12818
|
__name: "SearchResultsMobileToggle",
|
|
12483
12819
|
props: {
|
|
12484
12820
|
label: {},
|
|
@@ -12496,26 +12832,26 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12496
12832
|
onClick: handleMobileToggle
|
|
12497
12833
|
}, [
|
|
12498
12834
|
createTextVNode(toDisplayString(_ctx.label) + " ", 1),
|
|
12499
|
-
_ctx.showFilterCount && unref(currentFilterCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
12835
|
+
_ctx.showFilterCount && unref(currentFilterCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$x, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
|
|
12500
12836
|
], 2);
|
|
12501
12837
|
};
|
|
12502
12838
|
}
|
|
12503
12839
|
});
|
|
12504
|
-
const _hoisted_1$
|
|
12840
|
+
const _hoisted_1$w = {
|
|
12505
12841
|
key: 0,
|
|
12506
12842
|
id: "lupa-search-results-page-select",
|
|
12507
12843
|
"data-cy": "lupa-search-results-page-select"
|
|
12508
12844
|
};
|
|
12509
|
-
const _hoisted_2$
|
|
12845
|
+
const _hoisted_2$p = {
|
|
12510
12846
|
key: 0,
|
|
12511
12847
|
class: "lupa-page-number-separator"
|
|
12512
12848
|
};
|
|
12513
|
-
const _hoisted_3$
|
|
12514
|
-
const _hoisted_4$
|
|
12849
|
+
const _hoisted_3$i = ["onClick"];
|
|
12850
|
+
const _hoisted_4$d = {
|
|
12515
12851
|
key: 0,
|
|
12516
12852
|
class: "lupa-page-number-separator"
|
|
12517
12853
|
};
|
|
12518
|
-
const _sfc_main$
|
|
12854
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
12519
12855
|
__name: "SearchResultsPageSelect",
|
|
12520
12856
|
props: {
|
|
12521
12857
|
lastPageLabel: {},
|
|
@@ -12581,7 +12917,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12581
12917
|
const handlePageChange = (page) => {
|
|
12582
12918
|
if (page > 0) {
|
|
12583
12919
|
paramStore.appendParams({
|
|
12584
|
-
params: [{ name: QUERY_PARAMS$1.PAGE, value: page.toString() }]
|
|
12920
|
+
params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.PAGE), value: page.toString() }]
|
|
12585
12921
|
});
|
|
12586
12922
|
if (scrollToResultsOptions.value.enabled) {
|
|
12587
12923
|
scrollToSearchResults(
|
|
@@ -12592,7 +12928,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12592
12928
|
}
|
|
12593
12929
|
};
|
|
12594
12930
|
return (_ctx, _cache) => {
|
|
12595
|
-
return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
12931
|
+
return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$w, [
|
|
12596
12932
|
showBack.value ? (openBlock(), createElementBlock("div", {
|
|
12597
12933
|
key: 0,
|
|
12598
12934
|
class: normalizeClass(firstPageLabel.value === "<" ? "lupa-page-arrow" : "lupa-show-less"),
|
|
@@ -12603,7 +12939,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12603
12939
|
class: "lupa-page-number lupa-page-number-first",
|
|
12604
12940
|
onClick: _cache[1] || (_cache[1] = () => handlePageChange(1))
|
|
12605
12941
|
}, " 1 "),
|
|
12606
|
-
showFirstPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
12942
|
+
showFirstPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_2$p, "...")) : createCommentVNode("", true)
|
|
12607
12943
|
], 64)) : createCommentVNode("", true),
|
|
12608
12944
|
(openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (page) => {
|
|
12609
12945
|
return openBlock(), createElementBlock("div", {
|
|
@@ -12614,10 +12950,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12614
12950
|
page === _ctx.options.selectedPage ? "lupa-page-number-selected" : ""
|
|
12615
12951
|
]),
|
|
12616
12952
|
"data-cy": "lupa-page-number"
|
|
12617
|
-
}, toDisplayString(page), 11, _hoisted_3$
|
|
12953
|
+
}, toDisplayString(page), 11, _hoisted_3$i);
|
|
12618
12954
|
}), 128)),
|
|
12619
12955
|
showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
12620
|
-
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
12956
|
+
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$d, "...")) : createCommentVNode("", true),
|
|
12621
12957
|
createBaseVNode("div", {
|
|
12622
12958
|
class: "lupa-page-number lupa-page-number-last",
|
|
12623
12959
|
onClick: _cache[2] || (_cache[2] = () => {
|
|
@@ -12636,14 +12972,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12636
12972
|
};
|
|
12637
12973
|
}
|
|
12638
12974
|
});
|
|
12639
|
-
const _hoisted_1$
|
|
12975
|
+
const _hoisted_1$v = {
|
|
12640
12976
|
id: "lupa-search-results-page-size",
|
|
12641
12977
|
"data-cy": "lupa-search-results-page-size"
|
|
12642
12978
|
};
|
|
12643
|
-
const _hoisted_2$
|
|
12644
|
-
const _hoisted_3$
|
|
12645
|
-
const _hoisted_4$
|
|
12646
|
-
const _sfc_main$
|
|
12979
|
+
const _hoisted_2$o = { id: "lupa-select" };
|
|
12980
|
+
const _hoisted_3$h = { class: "lupa-select-label" };
|
|
12981
|
+
const _hoisted_4$c = ["aria-label"];
|
|
12982
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
12647
12983
|
__name: "SearchResultsPageSize",
|
|
12648
12984
|
props: {
|
|
12649
12985
|
label: {},
|
|
@@ -12651,18 +12987,19 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12651
12987
|
},
|
|
12652
12988
|
setup(__props) {
|
|
12653
12989
|
const paramsStore = useParamsStore();
|
|
12990
|
+
const optionsStore = useOptionsStore();
|
|
12654
12991
|
const select = ref(null);
|
|
12655
12992
|
const handleSelect = (e) => {
|
|
12656
12993
|
const value = e.target.value;
|
|
12657
12994
|
paramsStore.appendParams({
|
|
12658
|
-
params: [{ name: QUERY_PARAMS$1.LIMIT, value }],
|
|
12659
|
-
paramsToRemove: [QUERY_PARAMS$1.PAGE]
|
|
12995
|
+
params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS$1.LIMIT), value }],
|
|
12996
|
+
paramsToRemove: [optionsStore.getQueryParamName(QUERY_PARAMS$1.PAGE)]
|
|
12660
12997
|
});
|
|
12661
12998
|
};
|
|
12662
12999
|
return (_ctx, _cache) => {
|
|
12663
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
12664
|
-
createBaseVNode("div", _hoisted_2$
|
|
12665
|
-
createBaseVNode("label", _hoisted_3$
|
|
13000
|
+
return openBlock(), createElementBlock("div", _hoisted_1$v, [
|
|
13001
|
+
createBaseVNode("div", _hoisted_2$o, [
|
|
13002
|
+
createBaseVNode("label", _hoisted_3$h, toDisplayString(_ctx.label), 1),
|
|
12666
13003
|
createBaseVNode("select", {
|
|
12667
13004
|
class: "lupa-select-dropdown",
|
|
12668
13005
|
"aria-label": _ctx.label,
|
|
@@ -12674,21 +13011,21 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12674
13011
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options.sizes, (option) => {
|
|
12675
13012
|
return openBlock(), createElementBlock("option", { key: option }, toDisplayString(option), 1);
|
|
12676
13013
|
}), 128))
|
|
12677
|
-
], 40, _hoisted_4$
|
|
13014
|
+
], 40, _hoisted_4$c)
|
|
12678
13015
|
])
|
|
12679
13016
|
]);
|
|
12680
13017
|
};
|
|
12681
13018
|
}
|
|
12682
13019
|
});
|
|
12683
|
-
const _hoisted_1$
|
|
13020
|
+
const _hoisted_1$u = {
|
|
12684
13021
|
id: "lupa-search-results-sort",
|
|
12685
13022
|
class: "lupa-search-results-sort"
|
|
12686
13023
|
};
|
|
12687
|
-
const _hoisted_2$
|
|
12688
|
-
const _hoisted_3$
|
|
12689
|
-
const _hoisted_4$
|
|
13024
|
+
const _hoisted_2$n = { id: "lupa-select" };
|
|
13025
|
+
const _hoisted_3$g = { class: "lupa-select-label" };
|
|
13026
|
+
const _hoisted_4$b = ["aria-label"];
|
|
12690
13027
|
const _hoisted_5$8 = ["value"];
|
|
12691
|
-
const _sfc_main$
|
|
13028
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
12692
13029
|
__name: "SearchResultsSort",
|
|
12693
13030
|
props: {
|
|
12694
13031
|
options: {},
|
|
@@ -12697,6 +13034,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12697
13034
|
setup(__props) {
|
|
12698
13035
|
const props = __props;
|
|
12699
13036
|
const paramStore = useParamsStore();
|
|
13037
|
+
const optionStore = useOptionsStore();
|
|
12700
13038
|
const { sort } = storeToRefs(paramStore);
|
|
12701
13039
|
const selectedKey = ref("");
|
|
12702
13040
|
const previousKey = ref("");
|
|
@@ -12730,15 +13068,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12730
13068
|
paramStore.setSortSettings({ selectedSortKey: value, previousSortKey: previousKey.value });
|
|
12731
13069
|
(_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value, previousSortKey: previousKey.value });
|
|
12732
13070
|
paramStore.appendParams({
|
|
12733
|
-
params: [{ name: QUERY_PARAMS$1.SORT, value }],
|
|
12734
|
-
paramsToRemove: [QUERY_PARAMS$1.PAGE]
|
|
13071
|
+
params: [{ name: optionStore.getQueryParamName(QUERY_PARAMS$1.SORT), value }],
|
|
13072
|
+
paramsToRemove: [optionStore.getQueryParamName(QUERY_PARAMS$1.PAGE)]
|
|
12735
13073
|
});
|
|
12736
13074
|
previousKey.value = selectedKey.value;
|
|
12737
13075
|
};
|
|
12738
13076
|
return (_ctx, _cache) => {
|
|
12739
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
12740
|
-
createBaseVNode("div", _hoisted_2$
|
|
12741
|
-
createBaseVNode("label", _hoisted_3$
|
|
13077
|
+
return openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
13078
|
+
createBaseVNode("div", _hoisted_2$n, [
|
|
13079
|
+
createBaseVNode("label", _hoisted_3$g, toDisplayString(_ctx.options.label), 1),
|
|
12742
13080
|
withDirectives(createBaseVNode("select", {
|
|
12743
13081
|
class: "lupa-select-dropdown",
|
|
12744
13082
|
"aria-label": _ctx.options.label,
|
|
@@ -12753,7 +13091,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12753
13091
|
value: option.key
|
|
12754
13092
|
}, toDisplayString(option.label), 9, _hoisted_5$8);
|
|
12755
13093
|
}), 128))
|
|
12756
|
-
], 40, _hoisted_4$
|
|
13094
|
+
], 40, _hoisted_4$b), [
|
|
12757
13095
|
[vModelSelect, selectedKey.value]
|
|
12758
13096
|
])
|
|
12759
13097
|
])
|
|
@@ -12761,14 +13099,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12761
13099
|
};
|
|
12762
13100
|
}
|
|
12763
13101
|
});
|
|
12764
|
-
const _hoisted_1$
|
|
12765
|
-
const _hoisted_2$
|
|
12766
|
-
const _hoisted_3$
|
|
12767
|
-
const _hoisted_4$
|
|
13102
|
+
const _hoisted_1$t = { class: "lupa-toolbar-left" };
|
|
13103
|
+
const _hoisted_2$m = { key: 1 };
|
|
13104
|
+
const _hoisted_3$f = { key: 3 };
|
|
13105
|
+
const _hoisted_4$a = { key: 5 };
|
|
12768
13106
|
const _hoisted_5$7 = { class: "lupa-toolbar-right" };
|
|
12769
13107
|
const _hoisted_6$5 = { key: 1 };
|
|
12770
13108
|
const _hoisted_7$3 = { key: 3 };
|
|
12771
|
-
const _sfc_main$
|
|
13109
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
12772
13110
|
__name: "SearchResultsToolbar",
|
|
12773
13111
|
props: {
|
|
12774
13112
|
options: {},
|
|
@@ -12867,32 +13205,32 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12867
13205
|
id: "lupa-search-results-toolbar",
|
|
12868
13206
|
class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
|
|
12869
13207
|
}, [
|
|
12870
|
-
createBaseVNode("div", _hoisted_1$
|
|
12871
|
-
showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$
|
|
12872
|
-
showItemSummary.value ? (openBlock(), createBlock(_sfc_main$
|
|
13208
|
+
createBaseVNode("div", _hoisted_1$t, [
|
|
13209
|
+
showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_2$m)),
|
|
13210
|
+
showItemSummary.value ? (openBlock(), createBlock(_sfc_main$S, {
|
|
12873
13211
|
key: 2,
|
|
12874
13212
|
label: searchSummaryLabel.value,
|
|
12875
13213
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
12876
13214
|
onClear: handleClearAll
|
|
12877
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_3$
|
|
12878
|
-
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$
|
|
13215
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_3$f)),
|
|
13216
|
+
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$z, {
|
|
12879
13217
|
key: 4,
|
|
12880
13218
|
options: paginationOptions.value.pageSelect,
|
|
12881
13219
|
"last-page-label": paginationOptions.value.labels.showMore,
|
|
12882
13220
|
"first-page-label": paginationOptions.value.labels.showLess
|
|
12883
|
-
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_4$
|
|
13221
|
+
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_4$a))
|
|
12884
13222
|
]),
|
|
12885
13223
|
createBaseVNode("div", _hoisted_5$7, [
|
|
12886
|
-
createVNode(_sfc_main$
|
|
13224
|
+
createVNode(_sfc_main$A, {
|
|
12887
13225
|
label: optionsValue.value.labels.mobileFilterButton,
|
|
12888
13226
|
"show-filter-count": showMobileFilterCount.value
|
|
12889
13227
|
}, null, 8, ["label", "show-filter-count"]),
|
|
12890
|
-
paginationDisplay.value.pageSize ? (openBlock(), createBlock(_sfc_main$
|
|
13228
|
+
paginationDisplay.value.pageSize ? (openBlock(), createBlock(_sfc_main$y, {
|
|
12891
13229
|
key: 0,
|
|
12892
13230
|
options: paginationOptions.value.pageSize,
|
|
12893
13231
|
label: paginationOptions.value.labels.pageSize
|
|
12894
13232
|
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_6$5)),
|
|
12895
|
-
sortOptions.value ? (openBlock(), createBlock(_sfc_main$
|
|
13233
|
+
sortOptions.value ? (openBlock(), createBlock(_sfc_main$x, {
|
|
12896
13234
|
key: 2,
|
|
12897
13235
|
options: sortOptions.value,
|
|
12898
13236
|
callbacks: callbacks.value
|
|
@@ -12902,259 +13240,6 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12902
13240
|
};
|
|
12903
13241
|
}
|
|
12904
13242
|
});
|
|
12905
|
-
const _hoisted_1$y = { class: "lupa-badge-title" };
|
|
12906
|
-
const _hoisted_2$n = ["src"];
|
|
12907
|
-
const _hoisted_3$f = { key: 1 };
|
|
12908
|
-
const _hoisted_4$a = {
|
|
12909
|
-
key: 0,
|
|
12910
|
-
class: "lupa-badge-full-text"
|
|
12911
|
-
};
|
|
12912
|
-
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
12913
|
-
__name: "SearchResultGeneratedBadge",
|
|
12914
|
-
props: {
|
|
12915
|
-
options: {},
|
|
12916
|
-
badge: {}
|
|
12917
|
-
},
|
|
12918
|
-
setup(__props) {
|
|
12919
|
-
const props = __props;
|
|
12920
|
-
const image = computed(() => {
|
|
12921
|
-
var _a, _b, _c;
|
|
12922
|
-
return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.image) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : "";
|
|
12923
|
-
});
|
|
12924
|
-
const showTitle = computed(() => {
|
|
12925
|
-
var _a, _b, _c;
|
|
12926
|
-
return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.showTitle) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : true;
|
|
12927
|
-
});
|
|
12928
|
-
const hasAdditionalText = computed(() => {
|
|
12929
|
-
var _a, _b;
|
|
12930
|
-
return Boolean((_a = props.badge) == null ? void 0 : _a.additionalText) && typeof ((_b = props.badge) == null ? void 0 : _b.additionalText) === "string";
|
|
12931
|
-
});
|
|
12932
|
-
const hasTitleText = computed(() => {
|
|
12933
|
-
var _a, _b;
|
|
12934
|
-
return Boolean((_a = props.badge) == null ? void 0 : _a.titleText) && typeof ((_b = props.badge) == null ? void 0 : _b.titleText) === "string";
|
|
12935
|
-
});
|
|
12936
|
-
const customClassName = computed(() => {
|
|
12937
|
-
var _a, _b, _c;
|
|
12938
|
-
return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.customClass) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : "";
|
|
12939
|
-
});
|
|
12940
|
-
return (_ctx, _cache) => {
|
|
12941
|
-
return openBlock(), createElementBlock("div", {
|
|
12942
|
-
class: normalizeClass(["lupa-dynamic-badge", customClassName.value]),
|
|
12943
|
-
style: normalizeStyle({ background: _ctx.badge.backgroundColor, color: _ctx.badge.color })
|
|
12944
|
-
}, [
|
|
12945
|
-
createBaseVNode("span", _hoisted_1$y, [
|
|
12946
|
-
image.value ? (openBlock(), createElementBlock("img", {
|
|
12947
|
-
key: 0,
|
|
12948
|
-
src: image.value
|
|
12949
|
-
}, null, 8, _hoisted_2$n)) : createCommentVNode("", true),
|
|
12950
|
-
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$f, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
12951
|
-
]),
|
|
12952
|
-
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$a, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
12953
|
-
], 6);
|
|
12954
|
-
};
|
|
12955
|
-
}
|
|
12956
|
-
});
|
|
12957
|
-
const _hoisted_1$x = { class: "lupa-generated-badges" };
|
|
12958
|
-
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
12959
|
-
__name: "SearchResultGeneratedBadges",
|
|
12960
|
-
props: {
|
|
12961
|
-
options: {}
|
|
12962
|
-
},
|
|
12963
|
-
setup(__props) {
|
|
12964
|
-
const props = __props;
|
|
12965
|
-
const badgeField = computed(() => {
|
|
12966
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
12967
|
-
const fieldHasBadges = ((_a = props.options.generate) == null ? void 0 : _a.key) && props.options.product[(_c = (_b = props.options.generate) == null ? void 0 : _b.key) != null ? _c : ""] && Array.isArray(props.options.product[(_e = (_d = props.options.generate) == null ? void 0 : _d.key) != null ? _e : ""]);
|
|
12968
|
-
return fieldHasBadges ? props.options.product[(_g = (_f = props.options.generate) == null ? void 0 : _f.key) != null ? _g : ""] : [];
|
|
12969
|
-
});
|
|
12970
|
-
const keyMap = computed(() => {
|
|
12971
|
-
var _a, _b;
|
|
12972
|
-
return (_b = (_a = props.options.generate) == null ? void 0 : _a.keyMap) != null ? _b : {};
|
|
12973
|
-
});
|
|
12974
|
-
const badges = computed(() => {
|
|
12975
|
-
return badgeField.value.filter((f2) => Boolean(f2)).map((f2) => ({
|
|
12976
|
-
backgroundColor: keyMap.value.backgroundColor ? f2[keyMap.value.backgroundColor] : void 0,
|
|
12977
|
-
color: keyMap.value.color ? f2[keyMap.value.color] : void 0,
|
|
12978
|
-
titleText: keyMap.value.titleText ? f2[keyMap.value.titleText] : void 0,
|
|
12979
|
-
additionalText: keyMap.value.additionalText ? f2[keyMap.value.additionalText] : void 0,
|
|
12980
|
-
id: keyMap.value.id ? f2[keyMap.value.id] : void 0
|
|
12981
|
-
})).filter((b) => Boolean(b.id));
|
|
12982
|
-
});
|
|
12983
|
-
return (_ctx, _cache) => {
|
|
12984
|
-
return openBlock(), createElementBlock("div", _hoisted_1$x, [
|
|
12985
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(badges.value, (badge) => {
|
|
12986
|
-
return openBlock(), createBlock(_sfc_main$B, {
|
|
12987
|
-
key: badge.id,
|
|
12988
|
-
badge,
|
|
12989
|
-
options: _ctx.options
|
|
12990
|
-
}, null, 8, ["badge", "options"]);
|
|
12991
|
-
}), 128))
|
|
12992
|
-
]);
|
|
12993
|
-
};
|
|
12994
|
-
}
|
|
12995
|
-
});
|
|
12996
|
-
const _hoisted_1$w = ["innerHTML"];
|
|
12997
|
-
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
12998
|
-
__name: "CustomBadge",
|
|
12999
|
-
props: {
|
|
13000
|
-
badge: {}
|
|
13001
|
-
},
|
|
13002
|
-
setup(__props) {
|
|
13003
|
-
const props = __props;
|
|
13004
|
-
const text = computed(() => {
|
|
13005
|
-
var _a, _b, _c;
|
|
13006
|
-
return (_c = (_b = props.badge).html) == null ? void 0 : _c.call(_b, (_a = props.badge.product) != null ? _a : {});
|
|
13007
|
-
});
|
|
13008
|
-
const className = computed(() => {
|
|
13009
|
-
var _a;
|
|
13010
|
-
return (_a = props.badge.className) != null ? _a : "";
|
|
13011
|
-
});
|
|
13012
|
-
return (_ctx, _cache) => {
|
|
13013
|
-
return openBlock(), createElementBlock("div", {
|
|
13014
|
-
class: normalizeClass(className.value),
|
|
13015
|
-
innerHTML: text.value
|
|
13016
|
-
}, null, 10, _hoisted_1$w);
|
|
13017
|
-
};
|
|
13018
|
-
}
|
|
13019
|
-
});
|
|
13020
|
-
const _hoisted_1$v = { class: "lupa-text-badges" };
|
|
13021
|
-
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
13022
|
-
__name: "TextBadge",
|
|
13023
|
-
props: {
|
|
13024
|
-
badge: {}
|
|
13025
|
-
},
|
|
13026
|
-
setup(__props) {
|
|
13027
|
-
const props = __props;
|
|
13028
|
-
const badges = computed(() => {
|
|
13029
|
-
var _a, _b;
|
|
13030
|
-
return (_b = (_a = props.badge) == null ? void 0 : _a.value) != null ? _b : [];
|
|
13031
|
-
});
|
|
13032
|
-
const displayBadges = computed(() => {
|
|
13033
|
-
return badges.value.slice(0, props.badge.maxItems);
|
|
13034
|
-
});
|
|
13035
|
-
return (_ctx, _cache) => {
|
|
13036
|
-
return openBlock(), createElementBlock("div", _hoisted_1$v, [
|
|
13037
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
|
|
13038
|
-
return openBlock(), createElementBlock("div", {
|
|
13039
|
-
class: "lupa-badge lupa-text-badge",
|
|
13040
|
-
key: item
|
|
13041
|
-
}, toDisplayString(_ctx.badge.prefix) + toDisplayString(item), 1);
|
|
13042
|
-
}), 128))
|
|
13043
|
-
]);
|
|
13044
|
-
};
|
|
13045
|
-
}
|
|
13046
|
-
});
|
|
13047
|
-
const _hoisted_1$u = { class: "lupa-image-badges" };
|
|
13048
|
-
const _hoisted_2$m = ["src"];
|
|
13049
|
-
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
13050
|
-
__name: "ImageBadge",
|
|
13051
|
-
props: {
|
|
13052
|
-
badge: {}
|
|
13053
|
-
},
|
|
13054
|
-
setup(__props) {
|
|
13055
|
-
const props = __props;
|
|
13056
|
-
const badges = computed(() => {
|
|
13057
|
-
return props.badge.value;
|
|
13058
|
-
});
|
|
13059
|
-
const displayBadges = computed(() => {
|
|
13060
|
-
return badges.value.slice(0, props.badge.maxItems);
|
|
13061
|
-
});
|
|
13062
|
-
const getImageUrl = (src) => {
|
|
13063
|
-
if (!props.badge.rootImageUrl) {
|
|
13064
|
-
return src;
|
|
13065
|
-
}
|
|
13066
|
-
return `${props.badge.rootImageUrl}${src}`;
|
|
13067
|
-
};
|
|
13068
|
-
return (_ctx, _cache) => {
|
|
13069
|
-
return openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
13070
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
|
|
13071
|
-
return openBlock(), createElementBlock("div", {
|
|
13072
|
-
class: "lupa-badge lupa-image-badge",
|
|
13073
|
-
key: item
|
|
13074
|
-
}, [
|
|
13075
|
-
createBaseVNode("img", {
|
|
13076
|
-
src: getImageUrl(item)
|
|
13077
|
-
}, null, 8, _hoisted_2$m)
|
|
13078
|
-
]);
|
|
13079
|
-
}), 128))
|
|
13080
|
-
]);
|
|
13081
|
-
};
|
|
13082
|
-
}
|
|
13083
|
-
});
|
|
13084
|
-
const _hoisted_1$t = { id: "lupa-search-results-badges" };
|
|
13085
|
-
const __default__$1 = {
|
|
13086
|
-
components: {
|
|
13087
|
-
CustomBadge: _sfc_main$z,
|
|
13088
|
-
TextBadge: _sfc_main$y,
|
|
13089
|
-
ImageBadge: _sfc_main$x
|
|
13090
|
-
}
|
|
13091
|
-
};
|
|
13092
|
-
const _sfc_main$w = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$1), {
|
|
13093
|
-
__name: "SearchResultsBadgeWrapper",
|
|
13094
|
-
props: {
|
|
13095
|
-
position: {},
|
|
13096
|
-
options: {}
|
|
13097
|
-
},
|
|
13098
|
-
setup(__props) {
|
|
13099
|
-
const props = __props;
|
|
13100
|
-
const positionValue = computed(() => {
|
|
13101
|
-
var _a;
|
|
13102
|
-
return (_a = props.position) != null ? _a : "card";
|
|
13103
|
-
});
|
|
13104
|
-
const anchorPosition = computed(() => {
|
|
13105
|
-
return props.options.anchor;
|
|
13106
|
-
});
|
|
13107
|
-
const badges = computed(() => {
|
|
13108
|
-
if (!props.options.elements) {
|
|
13109
|
-
return [];
|
|
13110
|
-
}
|
|
13111
|
-
return props.options.elements.filter((e) => {
|
|
13112
|
-
var _a;
|
|
13113
|
-
return !e.display || e.display((_a = props.options.product) != null ? _a : {});
|
|
13114
|
-
}).map((x) => {
|
|
13115
|
-
var _a;
|
|
13116
|
-
return __spreadProps2(__spreadValues2({}, x), {
|
|
13117
|
-
value: ((_a = props.options.product) == null ? void 0 : _a[x.key]) || "badge",
|
|
13118
|
-
product: props.options.product
|
|
13119
|
-
});
|
|
13120
|
-
});
|
|
13121
|
-
});
|
|
13122
|
-
const displayBadges = computed(() => {
|
|
13123
|
-
return positionValue.value === "card" ? badges.value.filter((b) => !b.position || b.position === "card") : badges.value.filter((b) => b.position === "image");
|
|
13124
|
-
});
|
|
13125
|
-
const getBadgeComponent = (type) => {
|
|
13126
|
-
switch (type) {
|
|
13127
|
-
case BadgeType.TEXT:
|
|
13128
|
-
return "TextBadge";
|
|
13129
|
-
case BadgeType.IMAGE:
|
|
13130
|
-
return "ImageBadge";
|
|
13131
|
-
case BadgeType.CUSTOM_HTML:
|
|
13132
|
-
return "CustomBadge";
|
|
13133
|
-
default:
|
|
13134
|
-
return "CustomBadge";
|
|
13135
|
-
}
|
|
13136
|
-
};
|
|
13137
|
-
return (_ctx, _cache) => {
|
|
13138
|
-
return openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
13139
|
-
createBaseVNode("div", {
|
|
13140
|
-
id: "lupa-badges",
|
|
13141
|
-
class: normalizeClass(anchorPosition.value)
|
|
13142
|
-
}, [
|
|
13143
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (badge, index) => {
|
|
13144
|
-
return openBlock(), createBlock(resolveDynamicComponent(getBadgeComponent(badge.type)), {
|
|
13145
|
-
key: index,
|
|
13146
|
-
badge
|
|
13147
|
-
}, null, 8, ["badge"]);
|
|
13148
|
-
}), 128)),
|
|
13149
|
-
positionValue.value === "card" ? (openBlock(), createBlock(_sfc_main$A, {
|
|
13150
|
-
key: 0,
|
|
13151
|
-
options: _ctx.options
|
|
13152
|
-
}, null, 8, ["options"])) : createCommentVNode("", true)
|
|
13153
|
-
], 2)
|
|
13154
|
-
]);
|
|
13155
|
-
};
|
|
13156
|
-
}
|
|
13157
|
-
}));
|
|
13158
13243
|
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
13159
13244
|
__name: "SearchResultsProductImage",
|
|
13160
13245
|
props: {
|
|
@@ -13589,7 +13674,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13589
13674
|
setup(__props, { emit: emit2 }) {
|
|
13590
13675
|
const props = __props;
|
|
13591
13676
|
const dynamicDataStore = useDynamicDataStore();
|
|
13592
|
-
const { dynamicDataIdMap, loading } = storeToRefs(dynamicDataStore);
|
|
13677
|
+
const { dynamicDataIdMap, loadingIds, loading } = storeToRefs(dynamicDataStore);
|
|
13593
13678
|
const elementComponent = computed(() => {
|
|
13594
13679
|
switch (props.element.type) {
|
|
13595
13680
|
case DocumentElementType.IMAGE:
|
|
@@ -13615,9 +13700,6 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13615
13700
|
}
|
|
13616
13701
|
return "searchResultsProductTitle";
|
|
13617
13702
|
});
|
|
13618
|
-
const isLoadingDynamicData = computed(() => {
|
|
13619
|
-
return Boolean(props.element.dynamic && loading.value);
|
|
13620
|
-
});
|
|
13621
13703
|
const enhancedItem = computed(() => {
|
|
13622
13704
|
var _a, _b, _c, _d;
|
|
13623
13705
|
if (!((_a = props.item) == null ? void 0 : _a.id)) {
|
|
@@ -13632,7 +13714,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13632
13714
|
const handleProductEvent = (item) => {
|
|
13633
13715
|
emit2("productEvent", item);
|
|
13634
13716
|
};
|
|
13717
|
+
const isLoadingDynamicData = (id) => {
|
|
13718
|
+
return Boolean(props.element.dynamic && id && loading.value && (loadingIds == null ? void 0 : loadingIds.value[id]));
|
|
13719
|
+
};
|
|
13635
13720
|
return (_ctx, _cache) => {
|
|
13721
|
+
var _a;
|
|
13636
13722
|
return displayElement.value ? (openBlock(), createBlock(resolveDynamicComponent(elementComponent.value), {
|
|
13637
13723
|
key: 0,
|
|
13638
13724
|
item: enhancedItem.value,
|
|
@@ -13640,7 +13726,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13640
13726
|
labels: _ctx.labels,
|
|
13641
13727
|
inStock: _ctx.inStock,
|
|
13642
13728
|
link: _ctx.link,
|
|
13643
|
-
class: normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData.
|
|
13729
|
+
class: normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData((_a = _ctx.item) == null ? void 0 : _a.id) }),
|
|
13644
13730
|
onProductEvent: handleProductEvent
|
|
13645
13731
|
}, null, 40, ["item", "options", "labels", "inStock", "link", "class"])) : createCommentVNode("", true);
|
|
13646
13732
|
};
|
|
@@ -13800,7 +13886,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13800
13886
|
"data-cy": "lupa-search-result-product-card",
|
|
13801
13887
|
class: ["lupa-search-result-product-card", !isInStock.value ? "lupa-out-of-stock" : ""]
|
|
13802
13888
|
}, customDocumentHtmlAttributes.value, { onClick: handleClick }), [
|
|
13803
|
-
createVNode(_sfc_main$
|
|
13889
|
+
createVNode(_sfc_main$_, { options: badgesOptions.value }, null, 8, ["options"]),
|
|
13804
13890
|
createBaseVNode("div", {
|
|
13805
13891
|
class: normalizeClass(["lupa-search-result-product-contents", listLayoutClass.value])
|
|
13806
13892
|
}, [
|
|
@@ -13820,7 +13906,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13820
13906
|
link: link.value
|
|
13821
13907
|
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
13822
13908
|
}), 128)),
|
|
13823
|
-
createVNode(_sfc_main$
|
|
13909
|
+
createVNode(_sfc_main$_, {
|
|
13824
13910
|
options: badgesOptions.value,
|
|
13825
13911
|
position: "image",
|
|
13826
13912
|
class: "lupa-image-badges"
|
|
@@ -14167,7 +14253,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14167
14253
|
const props = __props;
|
|
14168
14254
|
const searchResultStore = useSearchResultStore();
|
|
14169
14255
|
const paramStore = useParamsStore();
|
|
14170
|
-
useOptionsStore();
|
|
14256
|
+
const optionStore = useOptionsStore();
|
|
14171
14257
|
const {
|
|
14172
14258
|
hasResults,
|
|
14173
14259
|
currentQueryText,
|
|
@@ -14251,7 +14337,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14251
14337
|
};
|
|
14252
14338
|
const goToFirstPage = () => {
|
|
14253
14339
|
paramStore.appendParams({
|
|
14254
|
-
params: [{ name: QUERY_PARAMS$1.PAGE, value: "1" }]
|
|
14340
|
+
params: [{ name: optionStore.getQueryParamName(QUERY_PARAMS$1.PAGE), value: "1" }]
|
|
14255
14341
|
});
|
|
14256
14342
|
};
|
|
14257
14343
|
return (_ctx, _cache) => {
|
|
@@ -14262,17 +14348,17 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14262
14348
|
class: "lupa-loader"
|
|
14263
14349
|
})) : createCommentVNode("", true),
|
|
14264
14350
|
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
14265
|
-
showTopFilters.value ? (openBlock(), createBlock(_sfc_main$
|
|
14351
|
+
showTopFilters.value ? (openBlock(), createBlock(_sfc_main$C, {
|
|
14266
14352
|
key: 0,
|
|
14267
14353
|
options: (_a = _ctx.options.filters) != null ? _a : {}
|
|
14268
14354
|
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
14269
|
-
showMobileFilters.value ? (openBlock(), createBlock(_sfc_main$
|
|
14355
|
+
showMobileFilters.value ? (openBlock(), createBlock(_sfc_main$w, {
|
|
14270
14356
|
key: 1,
|
|
14271
14357
|
class: "lupa-toolbar-mobile",
|
|
14272
14358
|
options: _ctx.options,
|
|
14273
14359
|
"pagination-location": "top"
|
|
14274
14360
|
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
14275
|
-
currentFilterOptions.value ? (openBlock(), createBlock(_sfc_main$
|
|
14361
|
+
currentFilterOptions.value ? (openBlock(), createBlock(_sfc_main$P, {
|
|
14276
14362
|
key: 2,
|
|
14277
14363
|
class: normalizeClass(currentFiltersClass.value),
|
|
14278
14364
|
"data-cy": "lupa-search-result-filters-mobile-toolbar",
|
|
@@ -14286,7 +14372,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14286
14372
|
sdkOptions: _ctx.options.options
|
|
14287
14373
|
}, null, 8, ["options", "sdkOptions"]),
|
|
14288
14374
|
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
14289
|
-
createVNode(_sfc_main$
|
|
14375
|
+
createVNode(_sfc_main$w, {
|
|
14290
14376
|
class: "lupa-toolbar-top",
|
|
14291
14377
|
options: _ctx.options,
|
|
14292
14378
|
"pagination-location": "top"
|
|
@@ -14316,7 +14402,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14316
14402
|
onClick: goToFirstPage
|
|
14317
14403
|
}, toDisplayString(_ctx.options.labels.backToFirstPage), 1)) : createCommentVNode("", true)
|
|
14318
14404
|
])) : createCommentVNode("", true),
|
|
14319
|
-
createVNode(_sfc_main$
|
|
14405
|
+
createVNode(_sfc_main$w, {
|
|
14320
14406
|
class: "lupa-toolbar-bottom",
|
|
14321
14407
|
options: _ctx.options,
|
|
14322
14408
|
"pagination-location": "bottom"
|
|
@@ -14395,7 +14481,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14395
14481
|
onClick: handleNavigationBack
|
|
14396
14482
|
}, toDisplayString(backTitle.value), 9, _hoisted_3$5)
|
|
14397
14483
|
])) : createCommentVNode("", true),
|
|
14398
|
-
createVNode(_sfc_main$
|
|
14484
|
+
createVNode(_sfc_main$w, {
|
|
14399
14485
|
class: "lupa-toolbar-mobile",
|
|
14400
14486
|
"pagination-location": "top",
|
|
14401
14487
|
options: _ctx.options
|
|
@@ -14457,7 +14543,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14457
14543
|
const handlePopState = () => {
|
|
14458
14544
|
var _a;
|
|
14459
14545
|
const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url);
|
|
14460
|
-
paramStore.add(parseParams(searchParams));
|
|
14546
|
+
paramStore.add(parseParams(optionStore.getQueryParamName, searchParams));
|
|
14461
14547
|
};
|
|
14462
14548
|
onMounted(() => __async(this, null, function* () {
|
|
14463
14549
|
var _a, _b;
|
|
@@ -14557,7 +14643,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14557
14643
|
var _a;
|
|
14558
14644
|
const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url, params);
|
|
14559
14645
|
const publicQuery = createPublicQuery(
|
|
14560
|
-
parseParams(searchParams),
|
|
14646
|
+
parseParams(optionStore.getQueryParamName, searchParams),
|
|
14561
14647
|
props.options.sort,
|
|
14562
14648
|
defaultSearchResultPageSize.value
|
|
14563
14649
|
);
|
|
@@ -14577,10 +14663,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14577
14663
|
}
|
|
14578
14664
|
}
|
|
14579
14665
|
const params = new URLSearchParams(window.location.search);
|
|
14580
|
-
if (!params.has(QUERY_PARAMS$1.QUERY) && !props.initialData) {
|
|
14666
|
+
if (!params.has(optionStore.getQueryParamName(QUERY_PARAMS$1.QUERY)) && !props.initialData) {
|
|
14581
14667
|
handleUrlChange(params);
|
|
14582
14668
|
}
|
|
14583
|
-
paramStore.add(parseParams(params));
|
|
14669
|
+
paramStore.add(parseParams(optionStore.getQueryParamName, params));
|
|
14584
14670
|
paramStore.setDefaultLimit(defaultSearchResultPageSize.value);
|
|
14585
14671
|
};
|
|
14586
14672
|
watch(searchString, () => handleParamsChange());
|
|
@@ -14614,7 +14700,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14614
14700
|
);
|
|
14615
14701
|
optionStore.setSearchResultOptions({ options: props.options });
|
|
14616
14702
|
searchResultStore.add(__spreadValues2({}, initialData));
|
|
14617
|
-
paramStore.add(parseParams(searchParams), props.options.ssr);
|
|
14703
|
+
paramStore.add(parseParams(optionStore.getQueryParamName, searchParams), props.options.ssr);
|
|
14618
14704
|
paramStore.setDefaultLimit(defaultSearchResultPageSize.value);
|
|
14619
14705
|
handleResults({ queryKey: props.options.queryKey, results: initialData });
|
|
14620
14706
|
}
|
|
@@ -14627,8 +14713,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14627
14713
|
class: normalizeClass(["lupa-search-result-wrapper", { "lupa-search-wrapper-no-results": !unref(hasResults) }])
|
|
14628
14714
|
}, [
|
|
14629
14715
|
_ctx.isContainer ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
14630
|
-
createVNode(_sfc_main$
|
|
14631
|
-
createVNode(_sfc_main$
|
|
14716
|
+
createVNode(_sfc_main$T, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
|
|
14717
|
+
createVNode(_sfc_main$R, {
|
|
14632
14718
|
"show-summary": true,
|
|
14633
14719
|
options: _ctx.options,
|
|
14634
14720
|
"is-product-list": (_a = _ctx.isProductList) != null ? _a : false
|
|
@@ -14638,24 +14724,24 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14638
14724
|
key: 1,
|
|
14639
14725
|
options: _ctx.options
|
|
14640
14726
|
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
14641
|
-
_ctx.options.filters ? (openBlock(), createBlock(_sfc_main$
|
|
14727
|
+
_ctx.options.filters ? (openBlock(), createBlock(_sfc_main$E, {
|
|
14642
14728
|
key: 2,
|
|
14643
14729
|
options: _ctx.options.filters
|
|
14644
14730
|
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
14645
|
-
unref(currentQueryText) || _ctx.isProductList ? (openBlock(), createBlock(_sfc_main$
|
|
14731
|
+
unref(currentQueryText) || _ctx.isProductList ? (openBlock(), createBlock(_sfc_main$D, {
|
|
14646
14732
|
key: 3,
|
|
14647
14733
|
breadcrumbs: _ctx.options.breadcrumbs
|
|
14648
14734
|
}, null, 8, ["breadcrumbs"])) : createCommentVNode("", true),
|
|
14649
14735
|
isTitleResultTopPosition.value ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
|
|
14650
|
-
showFilterSidebar.value ? (openBlock(), createBlock(_sfc_main$
|
|
14736
|
+
showFilterSidebar.value ? (openBlock(), createBlock(_sfc_main$F, {
|
|
14651
14737
|
key: 0,
|
|
14652
14738
|
options: (_b = _ctx.options.filters) != null ? _b : {},
|
|
14653
14739
|
ref_key: "searchResultsFilters",
|
|
14654
14740
|
ref: searchResultsFilters
|
|
14655
14741
|
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
14656
14742
|
createBaseVNode("div", _hoisted_3$4, [
|
|
14657
|
-
createVNode(_sfc_main$
|
|
14658
|
-
createVNode(_sfc_main$
|
|
14743
|
+
createVNode(_sfc_main$T, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
|
|
14744
|
+
createVNode(_sfc_main$R, {
|
|
14659
14745
|
options: _ctx.options,
|
|
14660
14746
|
"is-product-list": (_c = _ctx.isProductList) != null ? _c : false
|
|
14661
14747
|
}, null, 8, ["options", "is-product-list"]),
|
|
@@ -14670,13 +14756,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14670
14756
|
}, 8, ["options", "ssr"])
|
|
14671
14757
|
])
|
|
14672
14758
|
])) : (openBlock(), createElementBlock(Fragment, { key: 5 }, [
|
|
14673
|
-
createVNode(_sfc_main$
|
|
14674
|
-
createVNode(_sfc_main$
|
|
14759
|
+
createVNode(_sfc_main$T, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
|
|
14760
|
+
createVNode(_sfc_main$R, {
|
|
14675
14761
|
options: _ctx.options,
|
|
14676
14762
|
"is-product-list": (_d = _ctx.isProductList) != null ? _d : false
|
|
14677
14763
|
}, null, 8, ["options", "is-product-list"]),
|
|
14678
14764
|
createBaseVNode("div", _hoisted_4$3, [
|
|
14679
|
-
showFilterSidebar.value ? (openBlock(), createBlock(_sfc_main$
|
|
14765
|
+
showFilterSidebar.value ? (openBlock(), createBlock(_sfc_main$F, {
|
|
14680
14766
|
key: 0,
|
|
14681
14767
|
options: (_e = _ctx.options.filters) != null ? _e : {},
|
|
14682
14768
|
ref_key: "searchResultsFilters",
|
|
@@ -20306,7 +20392,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
20306
20392
|
onClick: withModifiers(innerClick, ["stop"])
|
|
20307
20393
|
}, [
|
|
20308
20394
|
createBaseVNode("div", _hoisted_2$7, [
|
|
20309
|
-
createVNode(_sfc_main$
|
|
20395
|
+
createVNode(_sfc_main$U, {
|
|
20310
20396
|
options: fullSearchBoxOptions.value,
|
|
20311
20397
|
"is-search-container": true,
|
|
20312
20398
|
ref_key: "searchBox",
|
|
@@ -27318,7 +27404,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
27318
27404
|
};
|
|
27319
27405
|
__expose({ fetch: fetch2 });
|
|
27320
27406
|
return (_ctx, _cache) => {
|
|
27321
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
27407
|
+
return openBlock(), createBlock(unref(_sfc_main$U), {
|
|
27322
27408
|
options: fullSearchBoxOptions.value,
|
|
27323
27409
|
ref_key: "searchBox",
|
|
27324
27410
|
ref: searchBox2
|