@getlupa/client 1.11.4 → 1.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lupaSearch.iife.js +72 -35
- package/dist/lupaSearch.js +72 -35
- package/dist/lupaSearch.mjs +72 -35
- package/dist/lupaSearch.umd.js +72 -35
- package/package.json +2 -2
package/dist/lupaSearch.iife.js
CHANGED
|
@@ -8451,7 +8451,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8451
8451
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
8452
8452
|
const _hoisted_4$s = ["value"];
|
|
8453
8453
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
8454
|
-
const _hoisted_6$9 = {
|
|
8454
|
+
const _hoisted_6$9 = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
8455
|
+
const _hoisted_7$7 = [
|
|
8456
|
+
_hoisted_6$9
|
|
8457
|
+
];
|
|
8458
|
+
const _hoisted_8$3 = {
|
|
8455
8459
|
key: 0,
|
|
8456
8460
|
class: "lupa-close-label"
|
|
8457
8461
|
};
|
|
@@ -8463,7 +8467,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8463
8467
|
emitInputOnFocus: { type: Boolean },
|
|
8464
8468
|
suggestedValue: {}
|
|
8465
8469
|
},
|
|
8466
|
-
emits: ["input", "focus"],
|
|
8470
|
+
emits: ["input", "focus", "search"],
|
|
8467
8471
|
setup(__props, { expose: __expose, emit: emit2 }) {
|
|
8468
8472
|
const props = __props;
|
|
8469
8473
|
const paramStore = useParamsStore();
|
|
@@ -8524,6 +8528,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8524
8528
|
handleInput();
|
|
8525
8529
|
}
|
|
8526
8530
|
};
|
|
8531
|
+
const handleSubmit = () => {
|
|
8532
|
+
emit2("search");
|
|
8533
|
+
};
|
|
8527
8534
|
const clear2 = () => {
|
|
8528
8535
|
emit2("input", "");
|
|
8529
8536
|
};
|
|
@@ -8565,14 +8572,18 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8565
8572
|
onFocus: handleFocus
|
|
8566
8573
|
}), null, 16, _hoisted_5$h), [
|
|
8567
8574
|
[vModelText, inputValue.value]
|
|
8568
|
-
])
|
|
8575
|
+
]),
|
|
8576
|
+
_ctx.options.showSubmitButton ? (openBlock(), createElementBlock("button", {
|
|
8577
|
+
key: 0,
|
|
8578
|
+
onClick: handleSubmit
|
|
8579
|
+
}, _hoisted_7$7)) : createCommentVNode("", true)
|
|
8569
8580
|
]),
|
|
8570
8581
|
_ctx.canClose ? (openBlock(), createElementBlock("div", {
|
|
8571
8582
|
key: 0,
|
|
8572
8583
|
class: "lupa-close-search-container",
|
|
8573
8584
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
8574
8585
|
}, [
|
|
8575
|
-
labels.value.close ? (openBlock(), createElementBlock("span",
|
|
8586
|
+
labels.value.close ? (openBlock(), createElementBlock("span", _hoisted_8$3, toDisplayString(labels.value.close), 1)) : createCommentVNode("", true)
|
|
8576
8587
|
])) : createCommentVNode("", true)
|
|
8577
8588
|
]);
|
|
8578
8589
|
};
|
|
@@ -8963,14 +8974,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8963
8974
|
result,
|
|
8964
8975
|
mode
|
|
8965
8976
|
}) {
|
|
8966
|
-
var _a, _b, _c, _d, _e, _f;
|
|
8977
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8967
8978
|
const enabledForMode = mode === "searchBox" ? isDynamicDataEnabledForSearchBox.value : isDynamicDataEnabledForSearchResults.value;
|
|
8968
8979
|
if (!result || !enabledForMode) {
|
|
8969
8980
|
return;
|
|
8970
8981
|
}
|
|
8971
8982
|
const resultIds = (_b = (_a = result == null ? void 0 : result.items) == null ? void 0 : _a.map((i) => i.id)) != null ? _b : [];
|
|
8972
8983
|
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 : [];
|
|
8973
|
-
|
|
8984
|
+
const similarResultIds = (_g = (_f = result.similarResults) == null ? void 0 : _f.items.map((i) => i.id)) != null ? _g : [];
|
|
8985
|
+
let requestedIds = [...resultIds, ...similarQueryResultIds, ...similarResultIds];
|
|
8974
8986
|
if (isCacheEnabled.value) {
|
|
8975
8987
|
requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
|
|
8976
8988
|
}
|
|
@@ -8984,7 +8996,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8984
8996
|
if (!(dynamicData == null ? void 0 : dynamicData.handler)) {
|
|
8985
8997
|
return {};
|
|
8986
8998
|
}
|
|
8987
|
-
const dynamicDataResult = (
|
|
8999
|
+
const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
|
|
8988
9000
|
const seed = {};
|
|
8989
9001
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
8990
9002
|
(a, c2) => __spreadProps2(__spreadValues2({}, a), { [`${c2.id}`]: c2 }),
|
|
@@ -10652,7 +10664,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10652
10664
|
return suggestedValue.value.override ? suggestedValue.value.item.suggestion : inputValue.value;
|
|
10653
10665
|
});
|
|
10654
10666
|
const inputOptions = computed(
|
|
10655
|
-
() => pick(props.options, [
|
|
10667
|
+
() => pick(props.options, [
|
|
10668
|
+
"minInputLength",
|
|
10669
|
+
"labels",
|
|
10670
|
+
"links",
|
|
10671
|
+
"inputAttributes",
|
|
10672
|
+
"showSubmitButton"
|
|
10673
|
+
])
|
|
10656
10674
|
);
|
|
10657
10675
|
const panelOptions = computed(
|
|
10658
10676
|
() => pick(props.options, [
|
|
@@ -10879,6 +10897,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10879
10897
|
ref: searchBoxInput,
|
|
10880
10898
|
onInput: handleInput,
|
|
10881
10899
|
onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
|
|
10900
|
+
onSearch: handleSearch,
|
|
10882
10901
|
onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
10883
10902
|
}, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
|
|
10884
10903
|
opened.value || _ctx.isSearchContainer ? (openBlock(), createBlock(_sfc_main$W, {
|
|
@@ -11451,11 +11470,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11451
11470
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
11452
11471
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
11453
11472
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
11454
|
-
const _hoisted_8$
|
|
11473
|
+
const _hoisted_8$2 = {
|
|
11455
11474
|
key: 0,
|
|
11456
11475
|
class: "lupa-term-count"
|
|
11457
11476
|
};
|
|
11458
|
-
const _hoisted_9$
|
|
11477
|
+
const _hoisted_9$2 = { key: 0 };
|
|
11459
11478
|
const _hoisted_10$1 = { key: 1 };
|
|
11460
11479
|
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
11461
11480
|
__name: "TermFacet",
|
|
@@ -11551,7 +11570,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11551
11570
|
]),
|
|
11552
11571
|
createBaseVNode("div", _hoisted_6$8, [
|
|
11553
11572
|
createBaseVNode("span", _hoisted_7$6, toDisplayString(item.title), 1),
|
|
11554
|
-
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$
|
|
11573
|
+
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
11555
11574
|
])
|
|
11556
11575
|
], 10, _hoisted_4$i);
|
|
11557
11576
|
}), 128))
|
|
@@ -11562,7 +11581,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11562
11581
|
"data-cy": "lupa-facet-term",
|
|
11563
11582
|
onClick: toggleShowAll
|
|
11564
11583
|
}, [
|
|
11565
|
-
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$
|
|
11584
|
+
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$2, toDisplayString(_ctx.options.labels.showLess), 1)) : (openBlock(), createElementBlock("span", _hoisted_10$1, toDisplayString(_ctx.options.labels.showAll), 1))
|
|
11566
11585
|
])) : createCommentVNode("", true)
|
|
11567
11586
|
]);
|
|
11568
11587
|
};
|
|
@@ -12560,8 +12579,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12560
12579
|
const _hoisted_5$b = { class: "lupa-stats-from" };
|
|
12561
12580
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
12562
12581
|
const _hoisted_7$5 = { key: 0 };
|
|
12563
|
-
const _hoisted_8 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
12564
|
-
const _hoisted_9 = {
|
|
12582
|
+
const _hoisted_8$1 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
12583
|
+
const _hoisted_9$1 = {
|
|
12565
12584
|
key: 0,
|
|
12566
12585
|
class: "lupa-stats-range-label"
|
|
12567
12586
|
};
|
|
@@ -12769,9 +12788,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12769
12788
|
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
|
|
12770
12789
|
])
|
|
12771
12790
|
]),
|
|
12772
|
-
_hoisted_8,
|
|
12791
|
+
_hoisted_8$1,
|
|
12773
12792
|
createBaseVNode("div", null, [
|
|
12774
|
-
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
12793
|
+
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
12775
12794
|
createBaseVNode("div", _hoisted_10, [
|
|
12776
12795
|
withDirectives(createBaseVNode("input", {
|
|
12777
12796
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
@@ -13860,12 +13879,20 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13860
13879
|
}
|
|
13861
13880
|
});
|
|
13862
13881
|
const _hoisted_1$t = { class: "lupa-toolbar-left" };
|
|
13863
|
-
const _hoisted_2$m = {
|
|
13864
|
-
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
const
|
|
13868
|
-
const
|
|
13882
|
+
const _hoisted_2$m = {
|
|
13883
|
+
key: 0,
|
|
13884
|
+
class: "lupa-toolbar-right-title"
|
|
13885
|
+
};
|
|
13886
|
+
const _hoisted_3$f = { key: 2 };
|
|
13887
|
+
const _hoisted_4$a = { key: 4 };
|
|
13888
|
+
const _hoisted_5$7 = { key: 6 };
|
|
13889
|
+
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
13890
|
+
const _hoisted_7$3 = {
|
|
13891
|
+
key: 0,
|
|
13892
|
+
class: "lupa-toolbar-right-title"
|
|
13893
|
+
};
|
|
13894
|
+
const _hoisted_8 = { key: 2 };
|
|
13895
|
+
const _hoisted_9 = { key: 4 };
|
|
13869
13896
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
13870
13897
|
__name: "SearchResultsToolbar",
|
|
13871
13898
|
props: {
|
|
@@ -13946,6 +13973,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13946
13973
|
const defaultLabel = (_c = (_b = (_a = paginationOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.itemCount) != null ? _c : "";
|
|
13947
13974
|
return !hasAnyFilter.value || !showFilterClear.value ? defaultLabel : (_f = (_e = (_d = paginationOptions.value) == null ? void 0 : _d.labels) == null ? void 0 : _e.filteredItemCount) != null ? _f : defaultLabel;
|
|
13948
13975
|
});
|
|
13976
|
+
const toolbarLeftLabel = computed(() => {
|
|
13977
|
+
var _a;
|
|
13978
|
+
return (_a = optionsValue.value.labels.toolbarLeftLabel) != null ? _a : "";
|
|
13979
|
+
});
|
|
13980
|
+
const toolbarRightLabel = computed(() => {
|
|
13981
|
+
var _a;
|
|
13982
|
+
return (_a = optionsValue.value.labels.toolbarRightLabel) != null ? _a : "";
|
|
13983
|
+
});
|
|
13949
13984
|
const showMobileFilterCount = computed(() => {
|
|
13950
13985
|
var _a, _b, _c;
|
|
13951
13986
|
return Boolean((_c = (_b = (_a = optionsValue.value.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.mobileSidebar) == null ? void 0 : _c.showFilterCount);
|
|
@@ -13966,35 +14001,37 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13966
14001
|
class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
|
|
13967
14002
|
}, [
|
|
13968
14003
|
createBaseVNode("div", _hoisted_1$t, [
|
|
13969
|
-
|
|
14004
|
+
toolbarLeftLabel.value ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString(toolbarLeftLabel.value), 1)) : createCommentVNode("", true),
|
|
14005
|
+
showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 1 })) : (openBlock(), createElementBlock("div", _hoisted_3$f)),
|
|
13970
14006
|
showItemSummary.value ? (openBlock(), createBlock(_sfc_main$T, {
|
|
13971
|
-
key:
|
|
14007
|
+
key: 3,
|
|
13972
14008
|
label: searchSummaryLabel.value,
|
|
13973
14009
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
13974
14010
|
onClear: handleClearAll
|
|
13975
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div",
|
|
14011
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$a)),
|
|
13976
14012
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$z, {
|
|
13977
|
-
key:
|
|
14013
|
+
key: 5,
|
|
13978
14014
|
options: paginationOptions.value.pageSelect,
|
|
13979
14015
|
"last-page-label": paginationOptions.value.labels.showMore,
|
|
13980
14016
|
"first-page-label": paginationOptions.value.labels.showLess
|
|
13981
|
-
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div",
|
|
14017
|
+
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_5$7))
|
|
13982
14018
|
]),
|
|
13983
|
-
createBaseVNode("div",
|
|
14019
|
+
createBaseVNode("div", _hoisted_6$5, [
|
|
14020
|
+
toolbarRightLabel.value ? (openBlock(), createElementBlock("div", _hoisted_7$3, toDisplayString(toolbarRightLabel.value), 1)) : createCommentVNode("", true),
|
|
13984
14021
|
createVNode(_sfc_main$A, {
|
|
13985
14022
|
label: optionsValue.value.labels.mobileFilterButton,
|
|
13986
14023
|
"show-filter-count": showMobileFilterCount.value
|
|
13987
14024
|
}, null, 8, ["label", "show-filter-count"]),
|
|
13988
14025
|
paginationDisplay.value.pageSize ? (openBlock(), createBlock(_sfc_main$y, {
|
|
13989
|
-
key:
|
|
14026
|
+
key: 1,
|
|
13990
14027
|
options: paginationOptions.value.pageSize,
|
|
13991
14028
|
label: paginationOptions.value.labels.pageSize
|
|
13992
|
-
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div",
|
|
14029
|
+
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_8)),
|
|
13993
14030
|
sortOptions.value ? (openBlock(), createBlock(_sfc_main$x, {
|
|
13994
|
-
key:
|
|
14031
|
+
key: 3,
|
|
13995
14032
|
options: sortOptions.value,
|
|
13996
14033
|
callbacks: callbacks.value
|
|
13997
|
-
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div",
|
|
14034
|
+
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_9))
|
|
13998
14035
|
])
|
|
13999
14036
|
], 2);
|
|
14000
14037
|
};
|
|
@@ -15365,12 +15402,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
15365
15402
|
queryKey,
|
|
15366
15403
|
results
|
|
15367
15404
|
}) {
|
|
15368
|
-
var _a, _b, _c, _d;
|
|
15405
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15369
15406
|
trackingStore.trackResults({ queryKey, results });
|
|
15370
15407
|
const hasResults2 = Boolean(
|
|
15371
|
-
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options)
|
|
15408
|
+
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options) || ((_d = (_c = results.similarResults) == null ? void 0 : _c.items) == null ? void 0 : _d.length)
|
|
15372
15409
|
);
|
|
15373
|
-
(
|
|
15410
|
+
(_f = (_e = props.options.callbacks) == null ? void 0 : _e.onSearchResults) == null ? void 0 : _f.call(_e, { queryKey, hasResults: hasResults2, params: paramStore.params });
|
|
15374
15411
|
if (!hasResults2) {
|
|
15375
15412
|
return;
|
|
15376
15413
|
}
|
package/dist/lupaSearch.js
CHANGED
|
@@ -8451,7 +8451,11 @@ const _hoisted_2$Q = { class: "lupa-input-clear" };
|
|
|
8451
8451
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
8452
8452
|
const _hoisted_4$s = ["value"];
|
|
8453
8453
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
8454
|
-
const _hoisted_6$9 = {
|
|
8454
|
+
const _hoisted_6$9 = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
8455
|
+
const _hoisted_7$7 = [
|
|
8456
|
+
_hoisted_6$9
|
|
8457
|
+
];
|
|
8458
|
+
const _hoisted_8$3 = {
|
|
8455
8459
|
key: 0,
|
|
8456
8460
|
class: "lupa-close-label"
|
|
8457
8461
|
};
|
|
@@ -8463,7 +8467,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
8463
8467
|
emitInputOnFocus: { type: Boolean },
|
|
8464
8468
|
suggestedValue: {}
|
|
8465
8469
|
},
|
|
8466
|
-
emits: ["input", "focus"],
|
|
8470
|
+
emits: ["input", "focus", "search"],
|
|
8467
8471
|
setup(__props, { expose: __expose, emit: emit2 }) {
|
|
8468
8472
|
const props = __props;
|
|
8469
8473
|
const paramStore = useParamsStore();
|
|
@@ -8524,6 +8528,9 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
8524
8528
|
handleInput();
|
|
8525
8529
|
}
|
|
8526
8530
|
};
|
|
8531
|
+
const handleSubmit = () => {
|
|
8532
|
+
emit2("search");
|
|
8533
|
+
};
|
|
8527
8534
|
const clear2 = () => {
|
|
8528
8535
|
emit2("input", "");
|
|
8529
8536
|
};
|
|
@@ -8565,14 +8572,18 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
8565
8572
|
onFocus: handleFocus
|
|
8566
8573
|
}), null, 16, _hoisted_5$h), [
|
|
8567
8574
|
[vModelText, inputValue.value]
|
|
8568
|
-
])
|
|
8575
|
+
]),
|
|
8576
|
+
_ctx.options.showSubmitButton ? (openBlock(), createElementBlock("button", {
|
|
8577
|
+
key: 0,
|
|
8578
|
+
onClick: handleSubmit
|
|
8579
|
+
}, _hoisted_7$7)) : createCommentVNode("", true)
|
|
8569
8580
|
]),
|
|
8570
8581
|
_ctx.canClose ? (openBlock(), createElementBlock("div", {
|
|
8571
8582
|
key: 0,
|
|
8572
8583
|
class: "lupa-close-search-container",
|
|
8573
8584
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
8574
8585
|
}, [
|
|
8575
|
-
labels.value.close ? (openBlock(), createElementBlock("span",
|
|
8586
|
+
labels.value.close ? (openBlock(), createElementBlock("span", _hoisted_8$3, toDisplayString(labels.value.close), 1)) : createCommentVNode("", true)
|
|
8576
8587
|
])) : createCommentVNode("", true)
|
|
8577
8588
|
]);
|
|
8578
8589
|
};
|
|
@@ -8963,14 +8974,15 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
8963
8974
|
result,
|
|
8964
8975
|
mode
|
|
8965
8976
|
}) {
|
|
8966
|
-
var _a, _b, _c, _d, _e, _f;
|
|
8977
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8967
8978
|
const enabledForMode = mode === "searchBox" ? isDynamicDataEnabledForSearchBox.value : isDynamicDataEnabledForSearchResults.value;
|
|
8968
8979
|
if (!result || !enabledForMode) {
|
|
8969
8980
|
return;
|
|
8970
8981
|
}
|
|
8971
8982
|
const resultIds = (_b = (_a = result == null ? void 0 : result.items) == null ? void 0 : _a.map((i) => i.id)) != null ? _b : [];
|
|
8972
8983
|
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 : [];
|
|
8973
|
-
|
|
8984
|
+
const similarResultIds = (_g = (_f = result.similarResults) == null ? void 0 : _f.items.map((i) => i.id)) != null ? _g : [];
|
|
8985
|
+
let requestedIds = [...resultIds, ...similarQueryResultIds, ...similarResultIds];
|
|
8974
8986
|
if (isCacheEnabled.value) {
|
|
8975
8987
|
requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
|
|
8976
8988
|
}
|
|
@@ -8984,7 +8996,7 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
8984
8996
|
if (!(dynamicData == null ? void 0 : dynamicData.handler)) {
|
|
8985
8997
|
return {};
|
|
8986
8998
|
}
|
|
8987
|
-
const dynamicDataResult = (
|
|
8999
|
+
const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
|
|
8988
9000
|
const seed = {};
|
|
8989
9001
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
8990
9002
|
(a, c2) => __spreadProps2(__spreadValues2({}, a), { [`${c2.id}`]: c2 }),
|
|
@@ -10652,7 +10664,13 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
10652
10664
|
return suggestedValue.value.override ? suggestedValue.value.item.suggestion : inputValue.value;
|
|
10653
10665
|
});
|
|
10654
10666
|
const inputOptions = computed(
|
|
10655
|
-
() => pick(props.options, [
|
|
10667
|
+
() => pick(props.options, [
|
|
10668
|
+
"minInputLength",
|
|
10669
|
+
"labels",
|
|
10670
|
+
"links",
|
|
10671
|
+
"inputAttributes",
|
|
10672
|
+
"showSubmitButton"
|
|
10673
|
+
])
|
|
10656
10674
|
);
|
|
10657
10675
|
const panelOptions = computed(
|
|
10658
10676
|
() => pick(props.options, [
|
|
@@ -10879,6 +10897,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
10879
10897
|
ref: searchBoxInput,
|
|
10880
10898
|
onInput: handleInput,
|
|
10881
10899
|
onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
|
|
10900
|
+
onSearch: handleSearch,
|
|
10882
10901
|
onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
10883
10902
|
}, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
|
|
10884
10903
|
opened.value || _ctx.isSearchContainer ? (openBlock(), createBlock(_sfc_main$W, {
|
|
@@ -11451,11 +11470,11 @@ const _hoisted_4$i = ["onClick"];
|
|
|
11451
11470
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
11452
11471
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
11453
11472
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
11454
|
-
const _hoisted_8$
|
|
11473
|
+
const _hoisted_8$2 = {
|
|
11455
11474
|
key: 0,
|
|
11456
11475
|
class: "lupa-term-count"
|
|
11457
11476
|
};
|
|
11458
|
-
const _hoisted_9$
|
|
11477
|
+
const _hoisted_9$2 = { key: 0 };
|
|
11459
11478
|
const _hoisted_10$1 = { key: 1 };
|
|
11460
11479
|
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
11461
11480
|
__name: "TermFacet",
|
|
@@ -11551,7 +11570,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
11551
11570
|
]),
|
|
11552
11571
|
createBaseVNode("div", _hoisted_6$8, [
|
|
11553
11572
|
createBaseVNode("span", _hoisted_7$6, toDisplayString(item.title), 1),
|
|
11554
|
-
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$
|
|
11573
|
+
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
11555
11574
|
])
|
|
11556
11575
|
], 10, _hoisted_4$i);
|
|
11557
11576
|
}), 128))
|
|
@@ -11562,7 +11581,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
11562
11581
|
"data-cy": "lupa-facet-term",
|
|
11563
11582
|
onClick: toggleShowAll
|
|
11564
11583
|
}, [
|
|
11565
|
-
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$
|
|
11584
|
+
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$2, toDisplayString(_ctx.options.labels.showLess), 1)) : (openBlock(), createElementBlock("span", _hoisted_10$1, toDisplayString(_ctx.options.labels.showAll), 1))
|
|
11566
11585
|
])) : createCommentVNode("", true)
|
|
11567
11586
|
]);
|
|
11568
11587
|
};
|
|
@@ -12560,8 +12579,8 @@ const _hoisted_4$h = {
|
|
|
12560
12579
|
const _hoisted_5$b = { class: "lupa-stats-from" };
|
|
12561
12580
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
12562
12581
|
const _hoisted_7$5 = { key: 0 };
|
|
12563
|
-
const _hoisted_8 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
12564
|
-
const _hoisted_9 = {
|
|
12582
|
+
const _hoisted_8$1 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
12583
|
+
const _hoisted_9$1 = {
|
|
12565
12584
|
key: 0,
|
|
12566
12585
|
class: "lupa-stats-range-label"
|
|
12567
12586
|
};
|
|
@@ -12769,9 +12788,9 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
12769
12788
|
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
|
|
12770
12789
|
])
|
|
12771
12790
|
]),
|
|
12772
|
-
_hoisted_8,
|
|
12791
|
+
_hoisted_8$1,
|
|
12773
12792
|
createBaseVNode("div", null, [
|
|
12774
|
-
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
12793
|
+
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
12775
12794
|
createBaseVNode("div", _hoisted_10, [
|
|
12776
12795
|
withDirectives(createBaseVNode("input", {
|
|
12777
12796
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
@@ -13860,12 +13879,20 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
13860
13879
|
}
|
|
13861
13880
|
});
|
|
13862
13881
|
const _hoisted_1$t = { class: "lupa-toolbar-left" };
|
|
13863
|
-
const _hoisted_2$m = {
|
|
13864
|
-
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
const
|
|
13868
|
-
const
|
|
13882
|
+
const _hoisted_2$m = {
|
|
13883
|
+
key: 0,
|
|
13884
|
+
class: "lupa-toolbar-right-title"
|
|
13885
|
+
};
|
|
13886
|
+
const _hoisted_3$f = { key: 2 };
|
|
13887
|
+
const _hoisted_4$a = { key: 4 };
|
|
13888
|
+
const _hoisted_5$7 = { key: 6 };
|
|
13889
|
+
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
13890
|
+
const _hoisted_7$3 = {
|
|
13891
|
+
key: 0,
|
|
13892
|
+
class: "lupa-toolbar-right-title"
|
|
13893
|
+
};
|
|
13894
|
+
const _hoisted_8 = { key: 2 };
|
|
13895
|
+
const _hoisted_9 = { key: 4 };
|
|
13869
13896
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
13870
13897
|
__name: "SearchResultsToolbar",
|
|
13871
13898
|
props: {
|
|
@@ -13946,6 +13973,14 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
13946
13973
|
const defaultLabel = (_c = (_b = (_a = paginationOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.itemCount) != null ? _c : "";
|
|
13947
13974
|
return !hasAnyFilter.value || !showFilterClear.value ? defaultLabel : (_f = (_e = (_d = paginationOptions.value) == null ? void 0 : _d.labels) == null ? void 0 : _e.filteredItemCount) != null ? _f : defaultLabel;
|
|
13948
13975
|
});
|
|
13976
|
+
const toolbarLeftLabel = computed(() => {
|
|
13977
|
+
var _a;
|
|
13978
|
+
return (_a = optionsValue.value.labels.toolbarLeftLabel) != null ? _a : "";
|
|
13979
|
+
});
|
|
13980
|
+
const toolbarRightLabel = computed(() => {
|
|
13981
|
+
var _a;
|
|
13982
|
+
return (_a = optionsValue.value.labels.toolbarRightLabel) != null ? _a : "";
|
|
13983
|
+
});
|
|
13949
13984
|
const showMobileFilterCount = computed(() => {
|
|
13950
13985
|
var _a, _b, _c;
|
|
13951
13986
|
return Boolean((_c = (_b = (_a = optionsValue.value.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.mobileSidebar) == null ? void 0 : _c.showFilterCount);
|
|
@@ -13966,35 +14001,37 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
13966
14001
|
class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
|
|
13967
14002
|
}, [
|
|
13968
14003
|
createBaseVNode("div", _hoisted_1$t, [
|
|
13969
|
-
|
|
14004
|
+
toolbarLeftLabel.value ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString(toolbarLeftLabel.value), 1)) : createCommentVNode("", true),
|
|
14005
|
+
showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 1 })) : (openBlock(), createElementBlock("div", _hoisted_3$f)),
|
|
13970
14006
|
showItemSummary.value ? (openBlock(), createBlock(_sfc_main$T, {
|
|
13971
|
-
key:
|
|
14007
|
+
key: 3,
|
|
13972
14008
|
label: searchSummaryLabel.value,
|
|
13973
14009
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
13974
14010
|
onClear: handleClearAll
|
|
13975
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div",
|
|
14011
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$a)),
|
|
13976
14012
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$z, {
|
|
13977
|
-
key:
|
|
14013
|
+
key: 5,
|
|
13978
14014
|
options: paginationOptions.value.pageSelect,
|
|
13979
14015
|
"last-page-label": paginationOptions.value.labels.showMore,
|
|
13980
14016
|
"first-page-label": paginationOptions.value.labels.showLess
|
|
13981
|
-
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div",
|
|
14017
|
+
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_5$7))
|
|
13982
14018
|
]),
|
|
13983
|
-
createBaseVNode("div",
|
|
14019
|
+
createBaseVNode("div", _hoisted_6$5, [
|
|
14020
|
+
toolbarRightLabel.value ? (openBlock(), createElementBlock("div", _hoisted_7$3, toDisplayString(toolbarRightLabel.value), 1)) : createCommentVNode("", true),
|
|
13984
14021
|
createVNode(_sfc_main$A, {
|
|
13985
14022
|
label: optionsValue.value.labels.mobileFilterButton,
|
|
13986
14023
|
"show-filter-count": showMobileFilterCount.value
|
|
13987
14024
|
}, null, 8, ["label", "show-filter-count"]),
|
|
13988
14025
|
paginationDisplay.value.pageSize ? (openBlock(), createBlock(_sfc_main$y, {
|
|
13989
|
-
key:
|
|
14026
|
+
key: 1,
|
|
13990
14027
|
options: paginationOptions.value.pageSize,
|
|
13991
14028
|
label: paginationOptions.value.labels.pageSize
|
|
13992
|
-
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div",
|
|
14029
|
+
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_8)),
|
|
13993
14030
|
sortOptions.value ? (openBlock(), createBlock(_sfc_main$x, {
|
|
13994
|
-
key:
|
|
14031
|
+
key: 3,
|
|
13995
14032
|
options: sortOptions.value,
|
|
13996
14033
|
callbacks: callbacks.value
|
|
13997
|
-
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div",
|
|
14034
|
+
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_9))
|
|
13998
14035
|
])
|
|
13999
14036
|
], 2);
|
|
14000
14037
|
};
|
|
@@ -15365,12 +15402,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
15365
15402
|
queryKey,
|
|
15366
15403
|
results
|
|
15367
15404
|
}) {
|
|
15368
|
-
var _a, _b, _c, _d;
|
|
15405
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15369
15406
|
trackingStore.trackResults({ queryKey, results });
|
|
15370
15407
|
const hasResults2 = Boolean(
|
|
15371
|
-
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options)
|
|
15408
|
+
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options) || ((_d = (_c = results.similarResults) == null ? void 0 : _c.items) == null ? void 0 : _d.length)
|
|
15372
15409
|
);
|
|
15373
|
-
(
|
|
15410
|
+
(_f = (_e = props.options.callbacks) == null ? void 0 : _e.onSearchResults) == null ? void 0 : _f.call(_e, { queryKey, hasResults: hasResults2, params: paramStore.params });
|
|
15374
15411
|
if (!hasResults2) {
|
|
15375
15412
|
return;
|
|
15376
15413
|
}
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -8449,7 +8449,11 @@ const _hoisted_2$Q = { class: "lupa-input-clear" };
|
|
|
8449
8449
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
8450
8450
|
const _hoisted_4$s = ["value"];
|
|
8451
8451
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
8452
|
-
const _hoisted_6$9 = {
|
|
8452
|
+
const _hoisted_6$9 = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
8453
|
+
const _hoisted_7$7 = [
|
|
8454
|
+
_hoisted_6$9
|
|
8455
|
+
];
|
|
8456
|
+
const _hoisted_8$3 = {
|
|
8453
8457
|
key: 0,
|
|
8454
8458
|
class: "lupa-close-label"
|
|
8455
8459
|
};
|
|
@@ -8461,7 +8465,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
8461
8465
|
emitInputOnFocus: { type: Boolean },
|
|
8462
8466
|
suggestedValue: {}
|
|
8463
8467
|
},
|
|
8464
|
-
emits: ["input", "focus"],
|
|
8468
|
+
emits: ["input", "focus", "search"],
|
|
8465
8469
|
setup(__props, { expose: __expose, emit: emit2 }) {
|
|
8466
8470
|
const props = __props;
|
|
8467
8471
|
const paramStore = useParamsStore();
|
|
@@ -8522,6 +8526,9 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
8522
8526
|
handleInput();
|
|
8523
8527
|
}
|
|
8524
8528
|
};
|
|
8529
|
+
const handleSubmit = () => {
|
|
8530
|
+
emit2("search");
|
|
8531
|
+
};
|
|
8525
8532
|
const clear2 = () => {
|
|
8526
8533
|
emit2("input", "");
|
|
8527
8534
|
};
|
|
@@ -8563,14 +8570,18 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
8563
8570
|
onFocus: handleFocus
|
|
8564
8571
|
}), null, 16, _hoisted_5$h), [
|
|
8565
8572
|
[vModelText, inputValue.value]
|
|
8566
|
-
])
|
|
8573
|
+
]),
|
|
8574
|
+
_ctx.options.showSubmitButton ? (openBlock(), createElementBlock("button", {
|
|
8575
|
+
key: 0,
|
|
8576
|
+
onClick: handleSubmit
|
|
8577
|
+
}, _hoisted_7$7)) : createCommentVNode("", true)
|
|
8567
8578
|
]),
|
|
8568
8579
|
_ctx.canClose ? (openBlock(), createElementBlock("div", {
|
|
8569
8580
|
key: 0,
|
|
8570
8581
|
class: "lupa-close-search-container",
|
|
8571
8582
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
8572
8583
|
}, [
|
|
8573
|
-
labels.value.close ? (openBlock(), createElementBlock("span",
|
|
8584
|
+
labels.value.close ? (openBlock(), createElementBlock("span", _hoisted_8$3, toDisplayString(labels.value.close), 1)) : createCommentVNode("", true)
|
|
8574
8585
|
])) : createCommentVNode("", true)
|
|
8575
8586
|
]);
|
|
8576
8587
|
};
|
|
@@ -8961,14 +8972,15 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
8961
8972
|
result,
|
|
8962
8973
|
mode
|
|
8963
8974
|
}) {
|
|
8964
|
-
var _a, _b, _c, _d, _e, _f;
|
|
8975
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8965
8976
|
const enabledForMode = mode === "searchBox" ? isDynamicDataEnabledForSearchBox.value : isDynamicDataEnabledForSearchResults.value;
|
|
8966
8977
|
if (!result || !enabledForMode) {
|
|
8967
8978
|
return;
|
|
8968
8979
|
}
|
|
8969
8980
|
const resultIds = (_b = (_a = result == null ? void 0 : result.items) == null ? void 0 : _a.map((i) => i.id)) != null ? _b : [];
|
|
8970
8981
|
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 : [];
|
|
8971
|
-
|
|
8982
|
+
const similarResultIds = (_g = (_f = result.similarResults) == null ? void 0 : _f.items.map((i) => i.id)) != null ? _g : [];
|
|
8983
|
+
let requestedIds = [...resultIds, ...similarQueryResultIds, ...similarResultIds];
|
|
8972
8984
|
if (isCacheEnabled.value) {
|
|
8973
8985
|
requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
|
|
8974
8986
|
}
|
|
@@ -8982,7 +8994,7 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
8982
8994
|
if (!(dynamicData == null ? void 0 : dynamicData.handler)) {
|
|
8983
8995
|
return {};
|
|
8984
8996
|
}
|
|
8985
|
-
const dynamicDataResult = (
|
|
8997
|
+
const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
|
|
8986
8998
|
const seed = {};
|
|
8987
8999
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
8988
9000
|
(a, c2) => __spreadProps2(__spreadValues2({}, a), { [`${c2.id}`]: c2 }),
|
|
@@ -10650,7 +10662,13 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
10650
10662
|
return suggestedValue.value.override ? suggestedValue.value.item.suggestion : inputValue.value;
|
|
10651
10663
|
});
|
|
10652
10664
|
const inputOptions = computed(
|
|
10653
|
-
() => pick(props.options, [
|
|
10665
|
+
() => pick(props.options, [
|
|
10666
|
+
"minInputLength",
|
|
10667
|
+
"labels",
|
|
10668
|
+
"links",
|
|
10669
|
+
"inputAttributes",
|
|
10670
|
+
"showSubmitButton"
|
|
10671
|
+
])
|
|
10654
10672
|
);
|
|
10655
10673
|
const panelOptions = computed(
|
|
10656
10674
|
() => pick(props.options, [
|
|
@@ -10877,6 +10895,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
10877
10895
|
ref: searchBoxInput,
|
|
10878
10896
|
onInput: handleInput,
|
|
10879
10897
|
onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
|
|
10898
|
+
onSearch: handleSearch,
|
|
10880
10899
|
onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
10881
10900
|
}, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
|
|
10882
10901
|
opened.value || _ctx.isSearchContainer ? (openBlock(), createBlock(_sfc_main$W, {
|
|
@@ -11449,11 +11468,11 @@ const _hoisted_4$i = ["onClick"];
|
|
|
11449
11468
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
11450
11469
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
11451
11470
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
11452
|
-
const _hoisted_8$
|
|
11471
|
+
const _hoisted_8$2 = {
|
|
11453
11472
|
key: 0,
|
|
11454
11473
|
class: "lupa-term-count"
|
|
11455
11474
|
};
|
|
11456
|
-
const _hoisted_9$
|
|
11475
|
+
const _hoisted_9$2 = { key: 0 };
|
|
11457
11476
|
const _hoisted_10$1 = { key: 1 };
|
|
11458
11477
|
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
11459
11478
|
__name: "TermFacet",
|
|
@@ -11549,7 +11568,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
11549
11568
|
]),
|
|
11550
11569
|
createBaseVNode("div", _hoisted_6$8, [
|
|
11551
11570
|
createBaseVNode("span", _hoisted_7$6, toDisplayString(item.title), 1),
|
|
11552
|
-
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$
|
|
11571
|
+
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
11553
11572
|
])
|
|
11554
11573
|
], 10, _hoisted_4$i);
|
|
11555
11574
|
}), 128))
|
|
@@ -11560,7 +11579,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
11560
11579
|
"data-cy": "lupa-facet-term",
|
|
11561
11580
|
onClick: toggleShowAll
|
|
11562
11581
|
}, [
|
|
11563
|
-
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$
|
|
11582
|
+
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$2, toDisplayString(_ctx.options.labels.showLess), 1)) : (openBlock(), createElementBlock("span", _hoisted_10$1, toDisplayString(_ctx.options.labels.showAll), 1))
|
|
11564
11583
|
])) : createCommentVNode("", true)
|
|
11565
11584
|
]);
|
|
11566
11585
|
};
|
|
@@ -12558,8 +12577,8 @@ const _hoisted_4$h = {
|
|
|
12558
12577
|
const _hoisted_5$b = { class: "lupa-stats-from" };
|
|
12559
12578
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
12560
12579
|
const _hoisted_7$5 = { key: 0 };
|
|
12561
|
-
const _hoisted_8 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
12562
|
-
const _hoisted_9 = {
|
|
12580
|
+
const _hoisted_8$1 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
12581
|
+
const _hoisted_9$1 = {
|
|
12563
12582
|
key: 0,
|
|
12564
12583
|
class: "lupa-stats-range-label"
|
|
12565
12584
|
};
|
|
@@ -12767,9 +12786,9 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
12767
12786
|
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
|
|
12768
12787
|
])
|
|
12769
12788
|
]),
|
|
12770
|
-
_hoisted_8,
|
|
12789
|
+
_hoisted_8$1,
|
|
12771
12790
|
createBaseVNode("div", null, [
|
|
12772
|
-
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
12791
|
+
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
12773
12792
|
createBaseVNode("div", _hoisted_10, [
|
|
12774
12793
|
withDirectives(createBaseVNode("input", {
|
|
12775
12794
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
@@ -13858,12 +13877,20 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
13858
13877
|
}
|
|
13859
13878
|
});
|
|
13860
13879
|
const _hoisted_1$t = { class: "lupa-toolbar-left" };
|
|
13861
|
-
const _hoisted_2$m = {
|
|
13862
|
-
|
|
13863
|
-
|
|
13864
|
-
|
|
13865
|
-
const
|
|
13866
|
-
const
|
|
13880
|
+
const _hoisted_2$m = {
|
|
13881
|
+
key: 0,
|
|
13882
|
+
class: "lupa-toolbar-right-title"
|
|
13883
|
+
};
|
|
13884
|
+
const _hoisted_3$f = { key: 2 };
|
|
13885
|
+
const _hoisted_4$a = { key: 4 };
|
|
13886
|
+
const _hoisted_5$7 = { key: 6 };
|
|
13887
|
+
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
13888
|
+
const _hoisted_7$3 = {
|
|
13889
|
+
key: 0,
|
|
13890
|
+
class: "lupa-toolbar-right-title"
|
|
13891
|
+
};
|
|
13892
|
+
const _hoisted_8 = { key: 2 };
|
|
13893
|
+
const _hoisted_9 = { key: 4 };
|
|
13867
13894
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
13868
13895
|
__name: "SearchResultsToolbar",
|
|
13869
13896
|
props: {
|
|
@@ -13944,6 +13971,14 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
13944
13971
|
const defaultLabel = (_c = (_b = (_a = paginationOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.itemCount) != null ? _c : "";
|
|
13945
13972
|
return !hasAnyFilter.value || !showFilterClear.value ? defaultLabel : (_f = (_e = (_d = paginationOptions.value) == null ? void 0 : _d.labels) == null ? void 0 : _e.filteredItemCount) != null ? _f : defaultLabel;
|
|
13946
13973
|
});
|
|
13974
|
+
const toolbarLeftLabel = computed(() => {
|
|
13975
|
+
var _a;
|
|
13976
|
+
return (_a = optionsValue.value.labels.toolbarLeftLabel) != null ? _a : "";
|
|
13977
|
+
});
|
|
13978
|
+
const toolbarRightLabel = computed(() => {
|
|
13979
|
+
var _a;
|
|
13980
|
+
return (_a = optionsValue.value.labels.toolbarRightLabel) != null ? _a : "";
|
|
13981
|
+
});
|
|
13947
13982
|
const showMobileFilterCount = computed(() => {
|
|
13948
13983
|
var _a, _b, _c;
|
|
13949
13984
|
return Boolean((_c = (_b = (_a = optionsValue.value.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.mobileSidebar) == null ? void 0 : _c.showFilterCount);
|
|
@@ -13964,35 +13999,37 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
13964
13999
|
class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
|
|
13965
14000
|
}, [
|
|
13966
14001
|
createBaseVNode("div", _hoisted_1$t, [
|
|
13967
|
-
|
|
14002
|
+
toolbarLeftLabel.value ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString(toolbarLeftLabel.value), 1)) : createCommentVNode("", true),
|
|
14003
|
+
showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 1 })) : (openBlock(), createElementBlock("div", _hoisted_3$f)),
|
|
13968
14004
|
showItemSummary.value ? (openBlock(), createBlock(_sfc_main$T, {
|
|
13969
|
-
key:
|
|
14005
|
+
key: 3,
|
|
13970
14006
|
label: searchSummaryLabel.value,
|
|
13971
14007
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
13972
14008
|
onClear: handleClearAll
|
|
13973
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div",
|
|
14009
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$a)),
|
|
13974
14010
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$z, {
|
|
13975
|
-
key:
|
|
14011
|
+
key: 5,
|
|
13976
14012
|
options: paginationOptions.value.pageSelect,
|
|
13977
14013
|
"last-page-label": paginationOptions.value.labels.showMore,
|
|
13978
14014
|
"first-page-label": paginationOptions.value.labels.showLess
|
|
13979
|
-
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div",
|
|
14015
|
+
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_5$7))
|
|
13980
14016
|
]),
|
|
13981
|
-
createBaseVNode("div",
|
|
14017
|
+
createBaseVNode("div", _hoisted_6$5, [
|
|
14018
|
+
toolbarRightLabel.value ? (openBlock(), createElementBlock("div", _hoisted_7$3, toDisplayString(toolbarRightLabel.value), 1)) : createCommentVNode("", true),
|
|
13982
14019
|
createVNode(_sfc_main$A, {
|
|
13983
14020
|
label: optionsValue.value.labels.mobileFilterButton,
|
|
13984
14021
|
"show-filter-count": showMobileFilterCount.value
|
|
13985
14022
|
}, null, 8, ["label", "show-filter-count"]),
|
|
13986
14023
|
paginationDisplay.value.pageSize ? (openBlock(), createBlock(_sfc_main$y, {
|
|
13987
|
-
key:
|
|
14024
|
+
key: 1,
|
|
13988
14025
|
options: paginationOptions.value.pageSize,
|
|
13989
14026
|
label: paginationOptions.value.labels.pageSize
|
|
13990
|
-
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div",
|
|
14027
|
+
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_8)),
|
|
13991
14028
|
sortOptions.value ? (openBlock(), createBlock(_sfc_main$x, {
|
|
13992
|
-
key:
|
|
14029
|
+
key: 3,
|
|
13993
14030
|
options: sortOptions.value,
|
|
13994
14031
|
callbacks: callbacks.value
|
|
13995
|
-
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div",
|
|
14032
|
+
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_9))
|
|
13996
14033
|
])
|
|
13997
14034
|
], 2);
|
|
13998
14035
|
};
|
|
@@ -15363,12 +15400,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
15363
15400
|
queryKey,
|
|
15364
15401
|
results
|
|
15365
15402
|
}) {
|
|
15366
|
-
var _a, _b, _c, _d;
|
|
15403
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15367
15404
|
trackingStore.trackResults({ queryKey, results });
|
|
15368
15405
|
const hasResults2 = Boolean(
|
|
15369
|
-
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options)
|
|
15406
|
+
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options) || ((_d = (_c = results.similarResults) == null ? void 0 : _c.items) == null ? void 0 : _d.length)
|
|
15370
15407
|
);
|
|
15371
|
-
(
|
|
15408
|
+
(_f = (_e = props.options.callbacks) == null ? void 0 : _e.onSearchResults) == null ? void 0 : _f.call(_e, { queryKey, hasResults: hasResults2, params: paramStore.params });
|
|
15372
15409
|
if (!hasResults2) {
|
|
15373
15410
|
return;
|
|
15374
15411
|
}
|
package/dist/lupaSearch.umd.js
CHANGED
|
@@ -8453,7 +8453,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8453
8453
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
8454
8454
|
const _hoisted_4$s = ["value"];
|
|
8455
8455
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
8456
|
-
const _hoisted_6$9 = {
|
|
8456
|
+
const _hoisted_6$9 = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
8457
|
+
const _hoisted_7$7 = [
|
|
8458
|
+
_hoisted_6$9
|
|
8459
|
+
];
|
|
8460
|
+
const _hoisted_8$3 = {
|
|
8457
8461
|
key: 0,
|
|
8458
8462
|
class: "lupa-close-label"
|
|
8459
8463
|
};
|
|
@@ -8465,7 +8469,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8465
8469
|
emitInputOnFocus: { type: Boolean },
|
|
8466
8470
|
suggestedValue: {}
|
|
8467
8471
|
},
|
|
8468
|
-
emits: ["input", "focus"],
|
|
8472
|
+
emits: ["input", "focus", "search"],
|
|
8469
8473
|
setup(__props, { expose: __expose, emit: emit2 }) {
|
|
8470
8474
|
const props = __props;
|
|
8471
8475
|
const paramStore = useParamsStore();
|
|
@@ -8526,6 +8530,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8526
8530
|
handleInput();
|
|
8527
8531
|
}
|
|
8528
8532
|
};
|
|
8533
|
+
const handleSubmit = () => {
|
|
8534
|
+
emit2("search");
|
|
8535
|
+
};
|
|
8529
8536
|
const clear2 = () => {
|
|
8530
8537
|
emit2("input", "");
|
|
8531
8538
|
};
|
|
@@ -8567,14 +8574,18 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8567
8574
|
onFocus: handleFocus
|
|
8568
8575
|
}), null, 16, _hoisted_5$h), [
|
|
8569
8576
|
[vModelText, inputValue.value]
|
|
8570
|
-
])
|
|
8577
|
+
]),
|
|
8578
|
+
_ctx.options.showSubmitButton ? (openBlock(), createElementBlock("button", {
|
|
8579
|
+
key: 0,
|
|
8580
|
+
onClick: handleSubmit
|
|
8581
|
+
}, _hoisted_7$7)) : createCommentVNode("", true)
|
|
8571
8582
|
]),
|
|
8572
8583
|
_ctx.canClose ? (openBlock(), createElementBlock("div", {
|
|
8573
8584
|
key: 0,
|
|
8574
8585
|
class: "lupa-close-search-container",
|
|
8575
8586
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
8576
8587
|
}, [
|
|
8577
|
-
labels.value.close ? (openBlock(), createElementBlock("span",
|
|
8588
|
+
labels.value.close ? (openBlock(), createElementBlock("span", _hoisted_8$3, toDisplayString(labels.value.close), 1)) : createCommentVNode("", true)
|
|
8578
8589
|
])) : createCommentVNode("", true)
|
|
8579
8590
|
]);
|
|
8580
8591
|
};
|
|
@@ -8965,14 +8976,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8965
8976
|
result,
|
|
8966
8977
|
mode
|
|
8967
8978
|
}) {
|
|
8968
|
-
var _a, _b, _c, _d, _e, _f;
|
|
8979
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8969
8980
|
const enabledForMode = mode === "searchBox" ? isDynamicDataEnabledForSearchBox.value : isDynamicDataEnabledForSearchResults.value;
|
|
8970
8981
|
if (!result || !enabledForMode) {
|
|
8971
8982
|
return;
|
|
8972
8983
|
}
|
|
8973
8984
|
const resultIds = (_b = (_a = result == null ? void 0 : result.items) == null ? void 0 : _a.map((i) => i.id)) != null ? _b : [];
|
|
8974
8985
|
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 : [];
|
|
8975
|
-
|
|
8986
|
+
const similarResultIds = (_g = (_f = result.similarResults) == null ? void 0 : _f.items.map((i) => i.id)) != null ? _g : [];
|
|
8987
|
+
let requestedIds = [...resultIds, ...similarQueryResultIds, ...similarResultIds];
|
|
8976
8988
|
if (isCacheEnabled.value) {
|
|
8977
8989
|
requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
|
|
8978
8990
|
}
|
|
@@ -8986,7 +8998,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8986
8998
|
if (!(dynamicData == null ? void 0 : dynamicData.handler)) {
|
|
8987
8999
|
return {};
|
|
8988
9000
|
}
|
|
8989
|
-
const dynamicDataResult = (
|
|
9001
|
+
const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
|
|
8990
9002
|
const seed = {};
|
|
8991
9003
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
8992
9004
|
(a, c2) => __spreadProps2(__spreadValues2({}, a), { [`${c2.id}`]: c2 }),
|
|
@@ -10654,7 +10666,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10654
10666
|
return suggestedValue.value.override ? suggestedValue.value.item.suggestion : inputValue.value;
|
|
10655
10667
|
});
|
|
10656
10668
|
const inputOptions = computed(
|
|
10657
|
-
() => pick(props.options, [
|
|
10669
|
+
() => pick(props.options, [
|
|
10670
|
+
"minInputLength",
|
|
10671
|
+
"labels",
|
|
10672
|
+
"links",
|
|
10673
|
+
"inputAttributes",
|
|
10674
|
+
"showSubmitButton"
|
|
10675
|
+
])
|
|
10658
10676
|
);
|
|
10659
10677
|
const panelOptions = computed(
|
|
10660
10678
|
() => pick(props.options, [
|
|
@@ -10881,6 +10899,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
10881
10899
|
ref: searchBoxInput,
|
|
10882
10900
|
onInput: handleInput,
|
|
10883
10901
|
onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
|
|
10902
|
+
onSearch: handleSearch,
|
|
10884
10903
|
onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
10885
10904
|
}, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
|
|
10886
10905
|
opened.value || _ctx.isSearchContainer ? (openBlock(), createBlock(_sfc_main$W, {
|
|
@@ -11453,11 +11472,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11453
11472
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
11454
11473
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
11455
11474
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
11456
|
-
const _hoisted_8$
|
|
11475
|
+
const _hoisted_8$2 = {
|
|
11457
11476
|
key: 0,
|
|
11458
11477
|
class: "lupa-term-count"
|
|
11459
11478
|
};
|
|
11460
|
-
const _hoisted_9$
|
|
11479
|
+
const _hoisted_9$2 = { key: 0 };
|
|
11461
11480
|
const _hoisted_10$1 = { key: 1 };
|
|
11462
11481
|
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
11463
11482
|
__name: "TermFacet",
|
|
@@ -11553,7 +11572,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11553
11572
|
]),
|
|
11554
11573
|
createBaseVNode("div", _hoisted_6$8, [
|
|
11555
11574
|
createBaseVNode("span", _hoisted_7$6, toDisplayString(item.title), 1),
|
|
11556
|
-
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$
|
|
11575
|
+
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
11557
11576
|
])
|
|
11558
11577
|
], 10, _hoisted_4$i);
|
|
11559
11578
|
}), 128))
|
|
@@ -11564,7 +11583,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
11564
11583
|
"data-cy": "lupa-facet-term",
|
|
11565
11584
|
onClick: toggleShowAll
|
|
11566
11585
|
}, [
|
|
11567
|
-
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$
|
|
11586
|
+
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$2, toDisplayString(_ctx.options.labels.showLess), 1)) : (openBlock(), createElementBlock("span", _hoisted_10$1, toDisplayString(_ctx.options.labels.showAll), 1))
|
|
11568
11587
|
])) : createCommentVNode("", true)
|
|
11569
11588
|
]);
|
|
11570
11589
|
};
|
|
@@ -12562,8 +12581,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12562
12581
|
const _hoisted_5$b = { class: "lupa-stats-from" };
|
|
12563
12582
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
12564
12583
|
const _hoisted_7$5 = { key: 0 };
|
|
12565
|
-
const _hoisted_8 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
12566
|
-
const _hoisted_9 = {
|
|
12584
|
+
const _hoisted_8$1 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
12585
|
+
const _hoisted_9$1 = {
|
|
12567
12586
|
key: 0,
|
|
12568
12587
|
class: "lupa-stats-range-label"
|
|
12569
12588
|
};
|
|
@@ -12771,9 +12790,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
12771
12790
|
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
|
|
12772
12791
|
])
|
|
12773
12792
|
]),
|
|
12774
|
-
_hoisted_8,
|
|
12793
|
+
_hoisted_8$1,
|
|
12775
12794
|
createBaseVNode("div", null, [
|
|
12776
|
-
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
12795
|
+
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
12777
12796
|
createBaseVNode("div", _hoisted_10, [
|
|
12778
12797
|
withDirectives(createBaseVNode("input", {
|
|
12779
12798
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
@@ -13862,12 +13881,20 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13862
13881
|
}
|
|
13863
13882
|
});
|
|
13864
13883
|
const _hoisted_1$t = { class: "lupa-toolbar-left" };
|
|
13865
|
-
const _hoisted_2$m = {
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
const
|
|
13870
|
-
const
|
|
13884
|
+
const _hoisted_2$m = {
|
|
13885
|
+
key: 0,
|
|
13886
|
+
class: "lupa-toolbar-right-title"
|
|
13887
|
+
};
|
|
13888
|
+
const _hoisted_3$f = { key: 2 };
|
|
13889
|
+
const _hoisted_4$a = { key: 4 };
|
|
13890
|
+
const _hoisted_5$7 = { key: 6 };
|
|
13891
|
+
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
13892
|
+
const _hoisted_7$3 = {
|
|
13893
|
+
key: 0,
|
|
13894
|
+
class: "lupa-toolbar-right-title"
|
|
13895
|
+
};
|
|
13896
|
+
const _hoisted_8 = { key: 2 };
|
|
13897
|
+
const _hoisted_9 = { key: 4 };
|
|
13871
13898
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
13872
13899
|
__name: "SearchResultsToolbar",
|
|
13873
13900
|
props: {
|
|
@@ -13948,6 +13975,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13948
13975
|
const defaultLabel = (_c = (_b = (_a = paginationOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.itemCount) != null ? _c : "";
|
|
13949
13976
|
return !hasAnyFilter.value || !showFilterClear.value ? defaultLabel : (_f = (_e = (_d = paginationOptions.value) == null ? void 0 : _d.labels) == null ? void 0 : _e.filteredItemCount) != null ? _f : defaultLabel;
|
|
13950
13977
|
});
|
|
13978
|
+
const toolbarLeftLabel = computed(() => {
|
|
13979
|
+
var _a;
|
|
13980
|
+
return (_a = optionsValue.value.labels.toolbarLeftLabel) != null ? _a : "";
|
|
13981
|
+
});
|
|
13982
|
+
const toolbarRightLabel = computed(() => {
|
|
13983
|
+
var _a;
|
|
13984
|
+
return (_a = optionsValue.value.labels.toolbarRightLabel) != null ? _a : "";
|
|
13985
|
+
});
|
|
13951
13986
|
const showMobileFilterCount = computed(() => {
|
|
13952
13987
|
var _a, _b, _c;
|
|
13953
13988
|
return Boolean((_c = (_b = (_a = optionsValue.value.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.mobileSidebar) == null ? void 0 : _c.showFilterCount);
|
|
@@ -13968,35 +14003,37 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13968
14003
|
class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
|
|
13969
14004
|
}, [
|
|
13970
14005
|
createBaseVNode("div", _hoisted_1$t, [
|
|
13971
|
-
|
|
14006
|
+
toolbarLeftLabel.value ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString(toolbarLeftLabel.value), 1)) : createCommentVNode("", true),
|
|
14007
|
+
showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 1 })) : (openBlock(), createElementBlock("div", _hoisted_3$f)),
|
|
13972
14008
|
showItemSummary.value ? (openBlock(), createBlock(_sfc_main$T, {
|
|
13973
|
-
key:
|
|
14009
|
+
key: 3,
|
|
13974
14010
|
label: searchSummaryLabel.value,
|
|
13975
14011
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
13976
14012
|
onClear: handleClearAll
|
|
13977
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div",
|
|
14013
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$a)),
|
|
13978
14014
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$z, {
|
|
13979
|
-
key:
|
|
14015
|
+
key: 5,
|
|
13980
14016
|
options: paginationOptions.value.pageSelect,
|
|
13981
14017
|
"last-page-label": paginationOptions.value.labels.showMore,
|
|
13982
14018
|
"first-page-label": paginationOptions.value.labels.showLess
|
|
13983
|
-
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div",
|
|
14019
|
+
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_5$7))
|
|
13984
14020
|
]),
|
|
13985
|
-
createBaseVNode("div",
|
|
14021
|
+
createBaseVNode("div", _hoisted_6$5, [
|
|
14022
|
+
toolbarRightLabel.value ? (openBlock(), createElementBlock("div", _hoisted_7$3, toDisplayString(toolbarRightLabel.value), 1)) : createCommentVNode("", true),
|
|
13986
14023
|
createVNode(_sfc_main$A, {
|
|
13987
14024
|
label: optionsValue.value.labels.mobileFilterButton,
|
|
13988
14025
|
"show-filter-count": showMobileFilterCount.value
|
|
13989
14026
|
}, null, 8, ["label", "show-filter-count"]),
|
|
13990
14027
|
paginationDisplay.value.pageSize ? (openBlock(), createBlock(_sfc_main$y, {
|
|
13991
|
-
key:
|
|
14028
|
+
key: 1,
|
|
13992
14029
|
options: paginationOptions.value.pageSize,
|
|
13993
14030
|
label: paginationOptions.value.labels.pageSize
|
|
13994
|
-
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div",
|
|
14031
|
+
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_8)),
|
|
13995
14032
|
sortOptions.value ? (openBlock(), createBlock(_sfc_main$x, {
|
|
13996
|
-
key:
|
|
14033
|
+
key: 3,
|
|
13997
14034
|
options: sortOptions.value,
|
|
13998
14035
|
callbacks: callbacks.value
|
|
13999
|
-
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div",
|
|
14036
|
+
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_9))
|
|
14000
14037
|
])
|
|
14001
14038
|
], 2);
|
|
14002
14039
|
};
|
|
@@ -15367,12 +15404,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
15367
15404
|
queryKey,
|
|
15368
15405
|
results
|
|
15369
15406
|
}) {
|
|
15370
|
-
var _a, _b, _c, _d;
|
|
15407
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15371
15408
|
trackingStore.trackResults({ queryKey, results });
|
|
15372
15409
|
const hasResults2 = Boolean(
|
|
15373
|
-
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options)
|
|
15410
|
+
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options) || ((_d = (_c = results.similarResults) == null ? void 0 : _c.items) == null ? void 0 : _d.length)
|
|
15374
15411
|
);
|
|
15375
|
-
(
|
|
15412
|
+
(_f = (_e = props.options.callbacks) == null ? void 0 : _e.onSearchResults) == null ? void 0 : _f.call(_e, { queryKey, hasResults: hasResults2, params: paramStore.params });
|
|
15376
15413
|
if (!hasResults2) {
|
|
15377
15414
|
return;
|
|
15378
15415
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getlupa/client",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.6",
|
|
4
4
|
"main": "dist/lupaSearch.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@getlupa/client-sdk": "^1.3.4",
|
|
23
|
-
"@getlupa/vue": "0.11.
|
|
23
|
+
"@getlupa/vue": "0.11.6",
|
|
24
24
|
"@rushstack/eslint-patch": "^1.3.2",
|
|
25
25
|
"@tsconfig/node18": "^2.0.1",
|
|
26
26
|
"@types/jsdom": "^21.1.1",
|