@getlupa/vue 0.11.3 → 0.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.js
CHANGED
|
@@ -3227,7 +3227,11 @@ const _hoisted_2$Q = { class: "lupa-input-clear" };
|
|
|
3227
3227
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
3228
3228
|
const _hoisted_4$s = ["value"];
|
|
3229
3229
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
3230
|
-
const _hoisted_6$9 = {
|
|
3230
|
+
const _hoisted_6$9 = /* @__PURE__ */ vue.createElementVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
3231
|
+
const _hoisted_7$7 = [
|
|
3232
|
+
_hoisted_6$9
|
|
3233
|
+
];
|
|
3234
|
+
const _hoisted_8$3 = {
|
|
3231
3235
|
key: 0,
|
|
3232
3236
|
class: "lupa-close-label"
|
|
3233
3237
|
};
|
|
@@ -3239,7 +3243,7 @@ const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
|
|
|
3239
3243
|
emitInputOnFocus: { type: Boolean },
|
|
3240
3244
|
suggestedValue: {}
|
|
3241
3245
|
},
|
|
3242
|
-
emits: ["input", "focus"],
|
|
3246
|
+
emits: ["input", "focus", "search"],
|
|
3243
3247
|
setup(__props, { expose: __expose, emit }) {
|
|
3244
3248
|
const props = __props;
|
|
3245
3249
|
const paramStore = useParamsStore();
|
|
@@ -3300,6 +3304,9 @@ const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
|
|
|
3300
3304
|
handleInput();
|
|
3301
3305
|
}
|
|
3302
3306
|
};
|
|
3307
|
+
const handleSubmit = () => {
|
|
3308
|
+
emit("search");
|
|
3309
|
+
};
|
|
3303
3310
|
const clear = () => {
|
|
3304
3311
|
emit("input", "");
|
|
3305
3312
|
};
|
|
@@ -3341,14 +3348,18 @@ const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
|
|
|
3341
3348
|
onFocus: handleFocus
|
|
3342
3349
|
}), null, 16, _hoisted_5$h), [
|
|
3343
3350
|
[vue.vModelText, inputValue.value]
|
|
3344
|
-
])
|
|
3351
|
+
]),
|
|
3352
|
+
_ctx.options.showSubmitButton ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
3353
|
+
key: 0,
|
|
3354
|
+
onClick: handleSubmit
|
|
3355
|
+
}, _hoisted_7$7)) : vue.createCommentVNode("", true)
|
|
3345
3356
|
]),
|
|
3346
3357
|
_ctx.canClose ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3347
3358
|
key: 0,
|
|
3348
3359
|
class: "lupa-close-search-container",
|
|
3349
3360
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
3350
3361
|
}, [
|
|
3351
|
-
labels.value.close ? (vue.openBlock(), vue.createElementBlock("span",
|
|
3362
|
+
labels.value.close ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$3, vue.toDisplayString(labels.value.close), 1)) : vue.createCommentVNode("", true)
|
|
3352
3363
|
])) : vue.createCommentVNode("", true)
|
|
3353
3364
|
]);
|
|
3354
3365
|
};
|
|
@@ -3739,14 +3750,15 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
3739
3750
|
result,
|
|
3740
3751
|
mode
|
|
3741
3752
|
}) {
|
|
3742
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3753
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3743
3754
|
const enabledForMode = mode === "searchBox" ? isDynamicDataEnabledForSearchBox.value : isDynamicDataEnabledForSearchResults.value;
|
|
3744
3755
|
if (!result || !enabledForMode) {
|
|
3745
3756
|
return;
|
|
3746
3757
|
}
|
|
3747
3758
|
const resultIds = (_b = (_a = result == null ? void 0 : result.items) == null ? void 0 : _a.map((i) => i.id)) != null ? _b : [];
|
|
3748
3759
|
const similarQueryResultIds = (_e = (_d = (_c = result.similarQueries) == null ? void 0 : _c.map((q) => q.items.map((i) => i.id))) == null ? void 0 : _d.flat()) != null ? _e : [];
|
|
3749
|
-
|
|
3760
|
+
const similarResultIds = (_g = (_f = result.similarResults) == null ? void 0 : _f.items.map((i) => i.id)) != null ? _g : [];
|
|
3761
|
+
let requestedIds = [...resultIds, ...similarQueryResultIds, ...similarResultIds];
|
|
3750
3762
|
if (isCacheEnabled.value) {
|
|
3751
3763
|
requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
|
|
3752
3764
|
}
|
|
@@ -3760,7 +3772,7 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
3760
3772
|
if (!(dynamicData == null ? void 0 : dynamicData.handler)) {
|
|
3761
3773
|
return {};
|
|
3762
3774
|
}
|
|
3763
|
-
const dynamicDataResult = (
|
|
3775
|
+
const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
|
|
3764
3776
|
const seed = {};
|
|
3765
3777
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
3766
3778
|
(a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
|
|
@@ -5428,7 +5440,13 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
|
|
|
5428
5440
|
return suggestedValue.value.override ? suggestedValue.value.item.suggestion : inputValue.value;
|
|
5429
5441
|
});
|
|
5430
5442
|
const inputOptions = vue.computed(
|
|
5431
|
-
() => pick(props.options, [
|
|
5443
|
+
() => pick(props.options, [
|
|
5444
|
+
"minInputLength",
|
|
5445
|
+
"labels",
|
|
5446
|
+
"links",
|
|
5447
|
+
"inputAttributes",
|
|
5448
|
+
"showSubmitButton"
|
|
5449
|
+
])
|
|
5432
5450
|
);
|
|
5433
5451
|
const panelOptions = vue.computed(
|
|
5434
5452
|
() => pick(props.options, [
|
|
@@ -5655,6 +5673,7 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
|
|
|
5655
5673
|
ref: searchBoxInput,
|
|
5656
5674
|
onInput: handleInput,
|
|
5657
5675
|
onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
|
|
5676
|
+
onSearch: handleSearch,
|
|
5658
5677
|
onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
5659
5678
|
}, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
|
|
5660
5679
|
opened.value || _ctx.isSearchContainer ? (vue.openBlock(), vue.createBlock(_sfc_main$W, {
|
|
@@ -6243,11 +6262,11 @@ const _hoisted_4$i = ["onClick"];
|
|
|
6243
6262
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
6244
6263
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
6245
6264
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
6246
|
-
const _hoisted_8$
|
|
6265
|
+
const _hoisted_8$2 = {
|
|
6247
6266
|
key: 0,
|
|
6248
6267
|
class: "lupa-term-count"
|
|
6249
6268
|
};
|
|
6250
|
-
const _hoisted_9$
|
|
6269
|
+
const _hoisted_9$2 = { key: 0 };
|
|
6251
6270
|
const _hoisted_10$1 = { key: 1 };
|
|
6252
6271
|
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
6253
6272
|
__name: "TermFacet",
|
|
@@ -6343,7 +6362,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
6343
6362
|
]),
|
|
6344
6363
|
vue.createElementVNode("div", _hoisted_6$8, [
|
|
6345
6364
|
vue.createElementVNode("span", _hoisted_7$6, vue.toDisplayString(item.title), 1),
|
|
6346
|
-
_ctx.options.showDocumentCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$
|
|
6365
|
+
_ctx.options.showDocumentCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$2, "(" + vue.toDisplayString(item.count) + ")", 1)) : vue.createCommentVNode("", true)
|
|
6347
6366
|
])
|
|
6348
6367
|
], 10, _hoisted_4$i);
|
|
6349
6368
|
}), 128))
|
|
@@ -6354,7 +6373,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
|
6354
6373
|
"data-cy": "lupa-facet-term",
|
|
6355
6374
|
onClick: toggleShowAll
|
|
6356
6375
|
}, [
|
|
6357
|
-
showAll.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$
|
|
6376
|
+
showAll.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$2, vue.toDisplayString(_ctx.options.labels.showLess), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_10$1, vue.toDisplayString(_ctx.options.labels.showAll), 1))
|
|
6358
6377
|
])) : vue.createCommentVNode("", true)
|
|
6359
6378
|
]);
|
|
6360
6379
|
};
|
|
@@ -7352,8 +7371,8 @@ const _hoisted_4$h = {
|
|
|
7352
7371
|
const _hoisted_5$b = { class: "lupa-stats-from" };
|
|
7353
7372
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
7354
7373
|
const _hoisted_7$5 = { key: 0 };
|
|
7355
|
-
const _hoisted_8 = /* @__PURE__ */ vue.createElementVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
7356
|
-
const _hoisted_9 = {
|
|
7374
|
+
const _hoisted_8$1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
7375
|
+
const _hoisted_9$1 = {
|
|
7357
7376
|
key: 0,
|
|
7358
7377
|
class: "lupa-stats-range-label"
|
|
7359
7378
|
};
|
|
@@ -7561,9 +7580,9 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
|
7561
7580
|
isPrice.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$5, vue.toDisplayString(currency.value), 1)) : vue.createCommentVNode("", true)
|
|
7562
7581
|
])
|
|
7563
7582
|
]),
|
|
7564
|
-
_hoisted_8,
|
|
7583
|
+
_hoisted_8$1,
|
|
7565
7584
|
vue.createElementVNode("div", null, [
|
|
7566
|
-
rangeLabelTo.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, vue.toDisplayString(rangeLabelTo.value), 1)) : vue.createCommentVNode("", true),
|
|
7585
|
+
rangeLabelTo.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, vue.toDisplayString(rangeLabelTo.value), 1)) : vue.createCommentVNode("", true),
|
|
7567
7586
|
vue.createElementVNode("div", _hoisted_10, [
|
|
7568
7587
|
vue.withDirectives(vue.createElementVNode("input", {
|
|
7569
7588
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
@@ -8652,12 +8671,20 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
8652
8671
|
}
|
|
8653
8672
|
});
|
|
8654
8673
|
const _hoisted_1$t = { class: "lupa-toolbar-left" };
|
|
8655
|
-
const _hoisted_2$m = {
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
const
|
|
8660
|
-
const
|
|
8674
|
+
const _hoisted_2$m = {
|
|
8675
|
+
key: 0,
|
|
8676
|
+
class: "lupa-toolbar-right-title"
|
|
8677
|
+
};
|
|
8678
|
+
const _hoisted_3$f = { key: 2 };
|
|
8679
|
+
const _hoisted_4$a = { key: 4 };
|
|
8680
|
+
const _hoisted_5$7 = { key: 6 };
|
|
8681
|
+
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
8682
|
+
const _hoisted_7$3 = {
|
|
8683
|
+
key: 0,
|
|
8684
|
+
class: "lupa-toolbar-right-title"
|
|
8685
|
+
};
|
|
8686
|
+
const _hoisted_8 = { key: 2 };
|
|
8687
|
+
const _hoisted_9 = { key: 4 };
|
|
8661
8688
|
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
8662
8689
|
__name: "SearchResultsToolbar",
|
|
8663
8690
|
props: {
|
|
@@ -8738,6 +8765,14 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
8738
8765
|
const defaultLabel = (_c = (_b = (_a = paginationOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.itemCount) != null ? _c : "";
|
|
8739
8766
|
return !hasAnyFilter.value || !showFilterClear.value ? defaultLabel : (_f = (_e = (_d = paginationOptions.value) == null ? void 0 : _d.labels) == null ? void 0 : _e.filteredItemCount) != null ? _f : defaultLabel;
|
|
8740
8767
|
});
|
|
8768
|
+
const toolbarLeftLabel = vue.computed(() => {
|
|
8769
|
+
var _a;
|
|
8770
|
+
return (_a = optionsValue.value.labels.toolbarLeftLabel) != null ? _a : "";
|
|
8771
|
+
});
|
|
8772
|
+
const toolbarRightLabel = vue.computed(() => {
|
|
8773
|
+
var _a;
|
|
8774
|
+
return (_a = optionsValue.value.labels.toolbarRightLabel) != null ? _a : "";
|
|
8775
|
+
});
|
|
8741
8776
|
const showMobileFilterCount = vue.computed(() => {
|
|
8742
8777
|
var _a, _b, _c;
|
|
8743
8778
|
return Boolean((_c = (_b = (_a = optionsValue.value.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.mobileSidebar) == null ? void 0 : _c.showFilterCount);
|
|
@@ -8758,35 +8793,37 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
8758
8793
|
class: vue.normalizeClass({ "lupa-filter-no-results": !hasResults.value })
|
|
8759
8794
|
}, [
|
|
8760
8795
|
vue.createElementVNode("div", _hoisted_1$t, [
|
|
8761
|
-
|
|
8796
|
+
toolbarLeftLabel.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$m, vue.toDisplayString(toolbarLeftLabel.value), 1)) : vue.createCommentVNode("", true),
|
|
8797
|
+
showLayoutSelection.value ? (vue.openBlock(), vue.createBlock(_sfc_main$B, { key: 1 })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$f)),
|
|
8762
8798
|
showItemSummary.value ? (vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
8763
|
-
key:
|
|
8799
|
+
key: 3,
|
|
8764
8800
|
label: searchSummaryLabel.value,
|
|
8765
8801
|
clearable: vue.unref(hasAnyFilter) && showFilterClear.value,
|
|
8766
8802
|
onClear: handleClearAll
|
|
8767
|
-
}, null, 8, ["label", "clearable"])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
8803
|
+
}, null, 8, ["label", "clearable"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$a)),
|
|
8768
8804
|
displayPageSelect.value ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
|
|
8769
|
-
key:
|
|
8805
|
+
key: 5,
|
|
8770
8806
|
options: paginationOptions.value.pageSelect,
|
|
8771
8807
|
"last-page-label": paginationOptions.value.labels.showMore,
|
|
8772
8808
|
"first-page-label": paginationOptions.value.labels.showLess
|
|
8773
|
-
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
8809
|
+
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$7))
|
|
8774
8810
|
]),
|
|
8775
|
-
vue.createElementVNode("div",
|
|
8811
|
+
vue.createElementVNode("div", _hoisted_6$5, [
|
|
8812
|
+
toolbarRightLabel.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$3, vue.toDisplayString(toolbarRightLabel.value), 1)) : vue.createCommentVNode("", true),
|
|
8776
8813
|
vue.createVNode(_sfc_main$A, {
|
|
8777
8814
|
label: optionsValue.value.labels.mobileFilterButton,
|
|
8778
8815
|
"show-filter-count": showMobileFilterCount.value
|
|
8779
8816
|
}, null, 8, ["label", "show-filter-count"]),
|
|
8780
8817
|
paginationDisplay.value.pageSize ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
|
|
8781
|
-
key:
|
|
8818
|
+
key: 1,
|
|
8782
8819
|
options: paginationOptions.value.pageSize,
|
|
8783
8820
|
label: paginationOptions.value.labels.pageSize
|
|
8784
|
-
}, null, 8, ["options", "label"])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
8821
|
+
}, null, 8, ["options", "label"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8)),
|
|
8785
8822
|
sortOptions.value ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
8786
|
-
key:
|
|
8823
|
+
key: 3,
|
|
8787
8824
|
options: sortOptions.value,
|
|
8788
8825
|
callbacks: callbacks.value
|
|
8789
|
-
}, null, 8, ["options", "callbacks"])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
8826
|
+
}, null, 8, ["options", "callbacks"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_9))
|
|
8790
8827
|
])
|
|
8791
8828
|
], 2);
|
|
8792
8829
|
};
|
|
@@ -10157,12 +10194,12 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
10157
10194
|
queryKey,
|
|
10158
10195
|
results
|
|
10159
10196
|
}) {
|
|
10160
|
-
var _a, _b, _c, _d;
|
|
10197
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10161
10198
|
trackingStore.trackResults({ queryKey, results });
|
|
10162
10199
|
const hasResults2 = Boolean(
|
|
10163
|
-
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options)
|
|
10200
|
+
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)
|
|
10164
10201
|
);
|
|
10165
|
-
(
|
|
10202
|
+
(_f = (_e = props.options.callbacks) == null ? void 0 : _e.onSearchResults) == null ? void 0 : _f.call(_e, { queryKey, hasResults: hasResults2, params: paramStore.params });
|
|
10166
10203
|
if (!hasResults2) {
|
|
10167
10204
|
return;
|
|
10168
10205
|
}
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -37,7 +37,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
37
37
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
import { toRaw, isRef, isReactive, toRef, effectScope, ref, markRaw, hasInjectionContext, inject, getCurrentInstance, watch, reactive, nextTick, computed, unref, getCurrentScope, onScopeDispose, toRefs, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, withDirectives, mergeProps, vModelText,
|
|
40
|
+
import { toRaw, isRef, isReactive, toRef, effectScope, ref, markRaw, hasInjectionContext, inject, getCurrentInstance, watch, reactive, nextTick, computed, unref, getCurrentScope, onScopeDispose, toRefs, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, withDirectives, mergeProps, vModelText, createCommentVNode, toDisplayString, onMounted, onBeforeMount, Fragment, renderList, createBlock, onBeforeUnmount, createVNode, Transition, withCtx, toHandlers, withModifiers, resolveDynamicComponent, renderSlot, normalizeStyle, createSlots, normalizeProps, guardReactiveProps, createTextVNode, onUnmounted, resolveComponent, vModelSelect, h as h$1, provide, cloneVNode } from "vue";
|
|
41
41
|
var isVue2 = false;
|
|
42
42
|
function set(target, key, val) {
|
|
43
43
|
if (Array.isArray(target)) {
|
|
@@ -3225,7 +3225,11 @@ const _hoisted_2$Q = { class: "lupa-input-clear" };
|
|
|
3225
3225
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
3226
3226
|
const _hoisted_4$s = ["value"];
|
|
3227
3227
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
3228
|
-
const _hoisted_6$9 = {
|
|
3228
|
+
const _hoisted_6$9 = /* @__PURE__ */ createElementVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
3229
|
+
const _hoisted_7$7 = [
|
|
3230
|
+
_hoisted_6$9
|
|
3231
|
+
];
|
|
3232
|
+
const _hoisted_8$3 = {
|
|
3229
3233
|
key: 0,
|
|
3230
3234
|
class: "lupa-close-label"
|
|
3231
3235
|
};
|
|
@@ -3237,7 +3241,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
3237
3241
|
emitInputOnFocus: { type: Boolean },
|
|
3238
3242
|
suggestedValue: {}
|
|
3239
3243
|
},
|
|
3240
|
-
emits: ["input", "focus"],
|
|
3244
|
+
emits: ["input", "focus", "search"],
|
|
3241
3245
|
setup(__props, { expose: __expose, emit }) {
|
|
3242
3246
|
const props = __props;
|
|
3243
3247
|
const paramStore = useParamsStore();
|
|
@@ -3298,6 +3302,9 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
3298
3302
|
handleInput();
|
|
3299
3303
|
}
|
|
3300
3304
|
};
|
|
3305
|
+
const handleSubmit = () => {
|
|
3306
|
+
emit("search");
|
|
3307
|
+
};
|
|
3301
3308
|
const clear = () => {
|
|
3302
3309
|
emit("input", "");
|
|
3303
3310
|
};
|
|
@@ -3339,14 +3346,18 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
3339
3346
|
onFocus: handleFocus
|
|
3340
3347
|
}), null, 16, _hoisted_5$h), [
|
|
3341
3348
|
[vModelText, inputValue.value]
|
|
3342
|
-
])
|
|
3349
|
+
]),
|
|
3350
|
+
_ctx.options.showSubmitButton ? (openBlock(), createElementBlock("button", {
|
|
3351
|
+
key: 0,
|
|
3352
|
+
onClick: handleSubmit
|
|
3353
|
+
}, _hoisted_7$7)) : createCommentVNode("", true)
|
|
3343
3354
|
]),
|
|
3344
3355
|
_ctx.canClose ? (openBlock(), createElementBlock("div", {
|
|
3345
3356
|
key: 0,
|
|
3346
3357
|
class: "lupa-close-search-container",
|
|
3347
3358
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
3348
3359
|
}, [
|
|
3349
|
-
labels.value.close ? (openBlock(), createElementBlock("span",
|
|
3360
|
+
labels.value.close ? (openBlock(), createElementBlock("span", _hoisted_8$3, toDisplayString(labels.value.close), 1)) : createCommentVNode("", true)
|
|
3350
3361
|
])) : createCommentVNode("", true)
|
|
3351
3362
|
]);
|
|
3352
3363
|
};
|
|
@@ -3737,14 +3748,15 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
3737
3748
|
result,
|
|
3738
3749
|
mode
|
|
3739
3750
|
}) {
|
|
3740
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3751
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3741
3752
|
const enabledForMode = mode === "searchBox" ? isDynamicDataEnabledForSearchBox.value : isDynamicDataEnabledForSearchResults.value;
|
|
3742
3753
|
if (!result || !enabledForMode) {
|
|
3743
3754
|
return;
|
|
3744
3755
|
}
|
|
3745
3756
|
const resultIds = (_b = (_a = result == null ? void 0 : result.items) == null ? void 0 : _a.map((i) => i.id)) != null ? _b : [];
|
|
3746
3757
|
const similarQueryResultIds = (_e = (_d = (_c = result.similarQueries) == null ? void 0 : _c.map((q) => q.items.map((i) => i.id))) == null ? void 0 : _d.flat()) != null ? _e : [];
|
|
3747
|
-
|
|
3758
|
+
const similarResultIds = (_g = (_f = result.similarResults) == null ? void 0 : _f.items.map((i) => i.id)) != null ? _g : [];
|
|
3759
|
+
let requestedIds = [...resultIds, ...similarQueryResultIds, ...similarResultIds];
|
|
3748
3760
|
if (isCacheEnabled.value) {
|
|
3749
3761
|
requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
|
|
3750
3762
|
}
|
|
@@ -3758,7 +3770,7 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
3758
3770
|
if (!(dynamicData == null ? void 0 : dynamicData.handler)) {
|
|
3759
3771
|
return {};
|
|
3760
3772
|
}
|
|
3761
|
-
const dynamicDataResult = (
|
|
3773
|
+
const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
|
|
3762
3774
|
const seed = {};
|
|
3763
3775
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
3764
3776
|
(a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
|
|
@@ -5426,7 +5438,13 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
5426
5438
|
return suggestedValue.value.override ? suggestedValue.value.item.suggestion : inputValue.value;
|
|
5427
5439
|
});
|
|
5428
5440
|
const inputOptions = computed(
|
|
5429
|
-
() => pick(props.options, [
|
|
5441
|
+
() => pick(props.options, [
|
|
5442
|
+
"minInputLength",
|
|
5443
|
+
"labels",
|
|
5444
|
+
"links",
|
|
5445
|
+
"inputAttributes",
|
|
5446
|
+
"showSubmitButton"
|
|
5447
|
+
])
|
|
5430
5448
|
);
|
|
5431
5449
|
const panelOptions = computed(
|
|
5432
5450
|
() => pick(props.options, [
|
|
@@ -5653,6 +5671,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
5653
5671
|
ref: searchBoxInput,
|
|
5654
5672
|
onInput: handleInput,
|
|
5655
5673
|
onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
|
|
5674
|
+
onSearch: handleSearch,
|
|
5656
5675
|
onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
5657
5676
|
}, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
|
|
5658
5677
|
opened.value || _ctx.isSearchContainer ? (openBlock(), createBlock(_sfc_main$W, {
|
|
@@ -6241,11 +6260,11 @@ const _hoisted_4$i = ["onClick"];
|
|
|
6241
6260
|
const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
|
|
6242
6261
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
6243
6262
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
6244
|
-
const _hoisted_8$
|
|
6263
|
+
const _hoisted_8$2 = {
|
|
6245
6264
|
key: 0,
|
|
6246
6265
|
class: "lupa-term-count"
|
|
6247
6266
|
};
|
|
6248
|
-
const _hoisted_9$
|
|
6267
|
+
const _hoisted_9$2 = { key: 0 };
|
|
6249
6268
|
const _hoisted_10$1 = { key: 1 };
|
|
6250
6269
|
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
6251
6270
|
__name: "TermFacet",
|
|
@@ -6341,7 +6360,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
6341
6360
|
]),
|
|
6342
6361
|
createElementVNode("div", _hoisted_6$8, [
|
|
6343
6362
|
createElementVNode("span", _hoisted_7$6, toDisplayString(item.title), 1),
|
|
6344
|
-
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$
|
|
6363
|
+
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
6345
6364
|
])
|
|
6346
6365
|
], 10, _hoisted_4$i);
|
|
6347
6366
|
}), 128))
|
|
@@ -6352,7 +6371,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
6352
6371
|
"data-cy": "lupa-facet-term",
|
|
6353
6372
|
onClick: toggleShowAll
|
|
6354
6373
|
}, [
|
|
6355
|
-
showAll.value ? (openBlock(), createElementBlock("span", _hoisted_9$
|
|
6374
|
+
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))
|
|
6356
6375
|
])) : createCommentVNode("", true)
|
|
6357
6376
|
]);
|
|
6358
6377
|
};
|
|
@@ -7350,8 +7369,8 @@ const _hoisted_4$h = {
|
|
|
7350
7369
|
const _hoisted_5$b = { class: "lupa-stats-from" };
|
|
7351
7370
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
7352
7371
|
const _hoisted_7$5 = { key: 0 };
|
|
7353
|
-
const _hoisted_8 = /* @__PURE__ */ createElementVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
7354
|
-
const _hoisted_9 = {
|
|
7372
|
+
const _hoisted_8$1 = /* @__PURE__ */ createElementVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
7373
|
+
const _hoisted_9$1 = {
|
|
7355
7374
|
key: 0,
|
|
7356
7375
|
class: "lupa-stats-range-label"
|
|
7357
7376
|
};
|
|
@@ -7559,9 +7578,9 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
7559
7578
|
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
|
|
7560
7579
|
])
|
|
7561
7580
|
]),
|
|
7562
|
-
_hoisted_8,
|
|
7581
|
+
_hoisted_8$1,
|
|
7563
7582
|
createElementVNode("div", null, [
|
|
7564
|
-
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
7583
|
+
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
7565
7584
|
createElementVNode("div", _hoisted_10, [
|
|
7566
7585
|
withDirectives(createElementVNode("input", {
|
|
7567
7586
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
@@ -8650,12 +8669,20 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
8650
8669
|
}
|
|
8651
8670
|
});
|
|
8652
8671
|
const _hoisted_1$t = { class: "lupa-toolbar-left" };
|
|
8653
|
-
const _hoisted_2$m = {
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
const
|
|
8658
|
-
const
|
|
8672
|
+
const _hoisted_2$m = {
|
|
8673
|
+
key: 0,
|
|
8674
|
+
class: "lupa-toolbar-right-title"
|
|
8675
|
+
};
|
|
8676
|
+
const _hoisted_3$f = { key: 2 };
|
|
8677
|
+
const _hoisted_4$a = { key: 4 };
|
|
8678
|
+
const _hoisted_5$7 = { key: 6 };
|
|
8679
|
+
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
8680
|
+
const _hoisted_7$3 = {
|
|
8681
|
+
key: 0,
|
|
8682
|
+
class: "lupa-toolbar-right-title"
|
|
8683
|
+
};
|
|
8684
|
+
const _hoisted_8 = { key: 2 };
|
|
8685
|
+
const _hoisted_9 = { key: 4 };
|
|
8659
8686
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
8660
8687
|
__name: "SearchResultsToolbar",
|
|
8661
8688
|
props: {
|
|
@@ -8736,6 +8763,14 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
8736
8763
|
const defaultLabel = (_c = (_b = (_a = paginationOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.itemCount) != null ? _c : "";
|
|
8737
8764
|
return !hasAnyFilter.value || !showFilterClear.value ? defaultLabel : (_f = (_e = (_d = paginationOptions.value) == null ? void 0 : _d.labels) == null ? void 0 : _e.filteredItemCount) != null ? _f : defaultLabel;
|
|
8738
8765
|
});
|
|
8766
|
+
const toolbarLeftLabel = computed(() => {
|
|
8767
|
+
var _a;
|
|
8768
|
+
return (_a = optionsValue.value.labels.toolbarLeftLabel) != null ? _a : "";
|
|
8769
|
+
});
|
|
8770
|
+
const toolbarRightLabel = computed(() => {
|
|
8771
|
+
var _a;
|
|
8772
|
+
return (_a = optionsValue.value.labels.toolbarRightLabel) != null ? _a : "";
|
|
8773
|
+
});
|
|
8739
8774
|
const showMobileFilterCount = computed(() => {
|
|
8740
8775
|
var _a, _b, _c;
|
|
8741
8776
|
return Boolean((_c = (_b = (_a = optionsValue.value.filters) == null ? void 0 : _a.currentFilters) == null ? void 0 : _b.mobileSidebar) == null ? void 0 : _c.showFilterCount);
|
|
@@ -8756,35 +8791,37 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
8756
8791
|
class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
|
|
8757
8792
|
}, [
|
|
8758
8793
|
createElementVNode("div", _hoisted_1$t, [
|
|
8759
|
-
|
|
8794
|
+
toolbarLeftLabel.value ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString(toolbarLeftLabel.value), 1)) : createCommentVNode("", true),
|
|
8795
|
+
showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 1 })) : (openBlock(), createElementBlock("div", _hoisted_3$f)),
|
|
8760
8796
|
showItemSummary.value ? (openBlock(), createBlock(_sfc_main$T, {
|
|
8761
|
-
key:
|
|
8797
|
+
key: 3,
|
|
8762
8798
|
label: searchSummaryLabel.value,
|
|
8763
8799
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
8764
8800
|
onClear: handleClearAll
|
|
8765
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div",
|
|
8801
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$a)),
|
|
8766
8802
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$z, {
|
|
8767
|
-
key:
|
|
8803
|
+
key: 5,
|
|
8768
8804
|
options: paginationOptions.value.pageSelect,
|
|
8769
8805
|
"last-page-label": paginationOptions.value.labels.showMore,
|
|
8770
8806
|
"first-page-label": paginationOptions.value.labels.showLess
|
|
8771
|
-
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div",
|
|
8807
|
+
}, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_5$7))
|
|
8772
8808
|
]),
|
|
8773
|
-
createElementVNode("div",
|
|
8809
|
+
createElementVNode("div", _hoisted_6$5, [
|
|
8810
|
+
toolbarRightLabel.value ? (openBlock(), createElementBlock("div", _hoisted_7$3, toDisplayString(toolbarRightLabel.value), 1)) : createCommentVNode("", true),
|
|
8774
8811
|
createVNode(_sfc_main$A, {
|
|
8775
8812
|
label: optionsValue.value.labels.mobileFilterButton,
|
|
8776
8813
|
"show-filter-count": showMobileFilterCount.value
|
|
8777
8814
|
}, null, 8, ["label", "show-filter-count"]),
|
|
8778
8815
|
paginationDisplay.value.pageSize ? (openBlock(), createBlock(_sfc_main$y, {
|
|
8779
|
-
key:
|
|
8816
|
+
key: 1,
|
|
8780
8817
|
options: paginationOptions.value.pageSize,
|
|
8781
8818
|
label: paginationOptions.value.labels.pageSize
|
|
8782
|
-
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div",
|
|
8819
|
+
}, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_8)),
|
|
8783
8820
|
sortOptions.value ? (openBlock(), createBlock(_sfc_main$x, {
|
|
8784
|
-
key:
|
|
8821
|
+
key: 3,
|
|
8785
8822
|
options: sortOptions.value,
|
|
8786
8823
|
callbacks: callbacks.value
|
|
8787
|
-
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div",
|
|
8824
|
+
}, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_9))
|
|
8788
8825
|
])
|
|
8789
8826
|
], 2);
|
|
8790
8827
|
};
|
|
@@ -10155,12 +10192,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
10155
10192
|
queryKey,
|
|
10156
10193
|
results
|
|
10157
10194
|
}) {
|
|
10158
|
-
var _a, _b, _c, _d;
|
|
10195
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10159
10196
|
trackingStore.trackResults({ queryKey, results });
|
|
10160
10197
|
const hasResults2 = Boolean(
|
|
10161
|
-
results.total > 0 || ((_a = results.similarQueries) == null ? void 0 : _a.length) || ((_b = results.didYouMean) == null ? void 0 : _b.options)
|
|
10198
|
+
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)
|
|
10162
10199
|
);
|
|
10163
|
-
(
|
|
10200
|
+
(_f = (_e = props.options.callbacks) == null ? void 0 : _e.onSearchResults) == null ? void 0 : _f.call(_e, { queryKey, hasResults: hasResults2, params: paramStore.params });
|
|
10164
10201
|
if (!hasResults2) {
|
|
10165
10202
|
return;
|
|
10166
10203
|
}
|
|
@@ -18,7 +18,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
18
18
|
type: __PropType<InputSuggestion>;
|
|
19
19
|
required: true;
|
|
20
20
|
};
|
|
21
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "focus")[], "input" | "focus", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "search" | "focus")[], "input" | "search" | "focus", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
22
|
options: {
|
|
23
23
|
type: __PropType<SearchBoxInputOptions>;
|
|
24
24
|
required: true;
|
|
@@ -37,6 +37,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
37
37
|
};
|
|
38
38
|
}>> & {
|
|
39
39
|
onInput?: (...args: any[]) => any;
|
|
40
|
+
onSearch?: (...args: any[]) => any;
|
|
40
41
|
onFocus?: (...args: any[]) => any;
|
|
41
42
|
}, {}, {}>;
|
|
42
43
|
export default _sfc_main;
|
|
@@ -35,6 +35,7 @@ export type SearchBoxInputOptions = {
|
|
|
35
35
|
labels: SearchBoxOptionLabels;
|
|
36
36
|
links: SearchBoxOptionLinks;
|
|
37
37
|
inputAttributes?: Record<string, string>;
|
|
38
|
+
showSubmitButton?: boolean;
|
|
38
39
|
};
|
|
39
40
|
export type SearchBoxResultCallbackContext = {
|
|
40
41
|
hasAnyResults?: boolean;
|
|
@@ -73,6 +73,8 @@ export type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchRe
|
|
|
73
73
|
outOfStock?: string;
|
|
74
74
|
noItemsInPage?: string;
|
|
75
75
|
backToFirstPage?: string;
|
|
76
|
+
toolbarRightLabel?: string;
|
|
77
|
+
toolbarLeftLabel?: string;
|
|
76
78
|
};
|
|
77
79
|
export type SearchResultsAdditionalPanels = {
|
|
78
80
|
additionalPanels?: SearchResultsAdditionalPanelOptions[];
|