@getlupa/client 1.4.1 → 1.4.2
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 +34 -20
- package/dist/lupaSearch.js +34 -20
- package/dist/lupaSearch.mjs +34 -20
- package/dist/lupaSearch.umd.js +34 -20
- package/package.json +2 -2
package/dist/lupaSearch.iife.js
CHANGED
|
@@ -7679,7 +7679,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7679
7679
|
const _hoisted_1$1b = { id: "lupa-search-box-input-container" };
|
|
7680
7680
|
const _hoisted_2$O = { class: "lupa-input-clear" };
|
|
7681
7681
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
7682
|
-
const _hoisted_4$
|
|
7682
|
+
const _hoisted_4$q = ["value"];
|
|
7683
7683
|
const _hoisted_5$f = ["placeholder"];
|
|
7684
7684
|
const _hoisted_6$8 = {
|
|
7685
7685
|
key: 0,
|
|
@@ -7774,7 +7774,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7774
7774
|
class: "lupa-hint",
|
|
7775
7775
|
value: showHint.value ? suggestedValue.value.item.suggestion : "",
|
|
7776
7776
|
disabled: ""
|
|
7777
|
-
}, null, 8, _hoisted_4$
|
|
7777
|
+
}, null, 8, _hoisted_4$q),
|
|
7778
7778
|
withDirectives(createBaseVNode("input", mergeProps({
|
|
7779
7779
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
7780
7780
|
}, inputAttributes.value, {
|
|
@@ -7953,7 +7953,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7953
7953
|
class: "lupa-suggestion-facet",
|
|
7954
7954
|
"data-cy": "lupa-suggestion-facet"
|
|
7955
7955
|
};
|
|
7956
|
-
const _hoisted_4$
|
|
7956
|
+
const _hoisted_4$p = {
|
|
7957
7957
|
class: "lupa-suggestion-facet-label",
|
|
7958
7958
|
"data-cy": "lupa-suggestion-facet-label"
|
|
7959
7959
|
};
|
|
@@ -7999,7 +7999,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7999
7999
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
8000
8000
|
}, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$M, toDisplayString(_ctx.suggestion.display), 1)),
|
|
8001
8001
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
|
|
8002
|
-
createBaseVNode("span", _hoisted_4$
|
|
8002
|
+
createBaseVNode("span", _hoisted_4$p, toDisplayString(facetLabel.value), 1),
|
|
8003
8003
|
createBaseVNode("span", _hoisted_5$e, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
8004
8004
|
])) : createCommentVNode("", true)
|
|
8005
8005
|
]);
|
|
@@ -8401,7 +8401,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8401
8401
|
const _hoisted_1$10 = ["innerHTML"];
|
|
8402
8402
|
const _hoisted_2$J = { key: 0 };
|
|
8403
8403
|
const _hoisted_3$y = { key: 1 };
|
|
8404
|
-
const _hoisted_4$
|
|
8404
|
+
const _hoisted_4$o = { class: "lupa-search-box-custom-label" };
|
|
8405
8405
|
const _hoisted_5$d = { class: "lupa-search-box-custom-text" };
|
|
8406
8406
|
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
8407
8407
|
__name: "SearchBoxProductCustom",
|
|
@@ -8434,7 +8434,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8434
8434
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
8435
8435
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
8436
8436
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$J, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
|
|
8437
|
-
createBaseVNode("div", _hoisted_4$
|
|
8437
|
+
createBaseVNode("div", _hoisted_4$o, toDisplayString(label.value), 1),
|
|
8438
8438
|
createBaseVNode("div", _hoisted_5$d, toDisplayString(text.value), 1)
|
|
8439
8439
|
]))
|
|
8440
8440
|
], 16));
|
|
@@ -8830,7 +8830,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8830
8830
|
const _hoisted_1$Z = ["href"];
|
|
8831
8831
|
const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
|
|
8832
8832
|
const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
|
|
8833
|
-
const _hoisted_4$
|
|
8833
|
+
const _hoisted_4$n = {
|
|
8834
8834
|
key: 0,
|
|
8835
8835
|
class: "lupa-search-box-product-add-to-cart-section"
|
|
8836
8836
|
};
|
|
@@ -8951,7 +8951,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8951
8951
|
}, null, 8, ["item", "element", "labels", "link"]);
|
|
8952
8952
|
}), 128))
|
|
8953
8953
|
]),
|
|
8954
|
-
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
8954
|
+
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$n, [
|
|
8955
8955
|
createVNode(_sfc_main$12, {
|
|
8956
8956
|
class: "lupa-search-box-product-element",
|
|
8957
8957
|
item: _ctx.item,
|
|
@@ -9086,12 +9086,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9086
9086
|
key: 0,
|
|
9087
9087
|
id: "lupa-search-box-panel"
|
|
9088
9088
|
};
|
|
9089
|
-
const _hoisted_2$G =
|
|
9090
|
-
|
|
9091
|
-
"data-cy": "lupa-main-panel"
|
|
9092
|
-
};
|
|
9093
|
-
const _hoisted_3$v = ["data-cy"];
|
|
9094
|
-
const _hoisted_4$n = {
|
|
9089
|
+
const _hoisted_2$G = ["data-cy"];
|
|
9090
|
+
const _hoisted_3$v = {
|
|
9095
9091
|
key: 1,
|
|
9096
9092
|
id: "lupa-search-box-panel"
|
|
9097
9093
|
};
|
|
@@ -9128,7 +9124,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9128
9124
|
const panels = computed(() => props.options.panels);
|
|
9129
9125
|
const sdkOptions = computed(() => props.options.options);
|
|
9130
9126
|
const searchBoxStore = useSearchBoxStore();
|
|
9131
|
-
const { suggestionResults, hasAnyResults } = storeToRefs(searchBoxStore);
|
|
9127
|
+
const { suggestionResults, hasAnyResults, panelItemCounts } = storeToRefs(searchBoxStore);
|
|
9132
9128
|
const displayResults = computed(
|
|
9133
9129
|
() => {
|
|
9134
9130
|
var _a, _b;
|
|
@@ -9209,6 +9205,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9209
9205
|
`${window.innerHeight - panel.getBoundingClientRect().y - 10}px`
|
|
9210
9206
|
);
|
|
9211
9207
|
};
|
|
9208
|
+
const numberOfVisiblePanels = computed(() => {
|
|
9209
|
+
return panelItemCounts.value.filter((v) => v.count > 0).length;
|
|
9210
|
+
});
|
|
9211
|
+
const expandOnSinglePanel = computed(() => {
|
|
9212
|
+
return numberOfVisiblePanels.value === 1 && props.options.expandOnSinglePanel;
|
|
9213
|
+
});
|
|
9212
9214
|
return (_ctx, _cache) => {
|
|
9213
9215
|
var _a;
|
|
9214
9216
|
return openBlock(), createElementBlock("div", {
|
|
@@ -9216,7 +9218,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9216
9218
|
ref: panelContainer
|
|
9217
9219
|
}, [
|
|
9218
9220
|
displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$X, [
|
|
9219
|
-
createBaseVNode("div",
|
|
9221
|
+
createBaseVNode("div", {
|
|
9222
|
+
class: "lupa-main-panel",
|
|
9223
|
+
style: normalizeStyle(expandOnSinglePanel.value ? { display: "block" } : {}),
|
|
9224
|
+
"data-cy": "lupa-main-panel"
|
|
9225
|
+
}, [
|
|
9220
9226
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
|
|
9221
9227
|
return openBlock(), createElementBlock("div", {
|
|
9222
9228
|
key: index,
|
|
@@ -9245,9 +9251,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9245
9251
|
key: "0"
|
|
9246
9252
|
} : void 0
|
|
9247
9253
|
]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
9248
|
-
], 10,
|
|
9254
|
+
], 10, _hoisted_2$G);
|
|
9249
9255
|
}), 128))
|
|
9250
|
-
]),
|
|
9256
|
+
], 4),
|
|
9251
9257
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1f, {
|
|
9252
9258
|
key: 0,
|
|
9253
9259
|
labels: labels.value
|
|
@@ -9258,7 +9264,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9258
9264
|
showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
|
|
9259
9265
|
onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
|
|
9260
9266
|
}, null, 8, ["labels", "showTotalCount"])) : createCommentVNode("", true)
|
|
9261
|
-
])) : displayHistory.value ? (openBlock(), createElementBlock("div",
|
|
9267
|
+
])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
|
|
9262
9268
|
createVNode(_sfc_main$1g, {
|
|
9263
9269
|
options: _ctx.options.history,
|
|
9264
9270
|
history: history.value,
|
|
@@ -9327,7 +9333,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9327
9333
|
"debounce",
|
|
9328
9334
|
"showTotalCount",
|
|
9329
9335
|
"hideMoreResultsButtonOnNoResults",
|
|
9330
|
-
"showNoResultsPanel"
|
|
9336
|
+
"showNoResultsPanel",
|
|
9337
|
+
"expandOnSinglePanel"
|
|
9331
9338
|
])
|
|
9332
9339
|
);
|
|
9333
9340
|
const searchTriggers = computed(() => {
|
|
@@ -13996,8 +14003,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13996
14003
|
const isTitleResultTopPosition = computed(() => {
|
|
13997
14004
|
return props.options.searchTitlePosition === "search-results-top";
|
|
13998
14005
|
});
|
|
14006
|
+
const handlePopState = () => {
|
|
14007
|
+
var _a;
|
|
14008
|
+
const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url);
|
|
14009
|
+
paramStore.add(parseParams(searchParams));
|
|
14010
|
+
};
|
|
13999
14011
|
onMounted(() => {
|
|
14000
14012
|
var _a, _b;
|
|
14013
|
+
window.addEventListener("popstate", handlePopState);
|
|
14001
14014
|
window.addEventListener("resize", handleResize);
|
|
14002
14015
|
if (props.initialData) {
|
|
14003
14016
|
searchResultStore.add(__spreadValues2({}, props.initialData));
|
|
@@ -14008,6 +14021,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14008
14021
|
});
|
|
14009
14022
|
onBeforeUnmount(() => {
|
|
14010
14023
|
window.removeEventListener("resize", handleResize);
|
|
14024
|
+
window.removeEventListener("popstate", handlePopState);
|
|
14011
14025
|
});
|
|
14012
14026
|
const trackItemListView = (title, items = []) => {
|
|
14013
14027
|
trackingStore.trackEvent({
|
package/dist/lupaSearch.js
CHANGED
|
@@ -7679,7 +7679,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
|
|
|
7679
7679
|
const _hoisted_1$1b = { id: "lupa-search-box-input-container" };
|
|
7680
7680
|
const _hoisted_2$O = { class: "lupa-input-clear" };
|
|
7681
7681
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
7682
|
-
const _hoisted_4$
|
|
7682
|
+
const _hoisted_4$q = ["value"];
|
|
7683
7683
|
const _hoisted_5$f = ["placeholder"];
|
|
7684
7684
|
const _hoisted_6$8 = {
|
|
7685
7685
|
key: 0,
|
|
@@ -7774,7 +7774,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
|
7774
7774
|
class: "lupa-hint",
|
|
7775
7775
|
value: showHint.value ? suggestedValue.value.item.suggestion : "",
|
|
7776
7776
|
disabled: ""
|
|
7777
|
-
}, null, 8, _hoisted_4$
|
|
7777
|
+
}, null, 8, _hoisted_4$q),
|
|
7778
7778
|
withDirectives(createBaseVNode("input", mergeProps({
|
|
7779
7779
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
7780
7780
|
}, inputAttributes.value, {
|
|
@@ -7953,7 +7953,7 @@ const _hoisted_3$z = {
|
|
|
7953
7953
|
class: "lupa-suggestion-facet",
|
|
7954
7954
|
"data-cy": "lupa-suggestion-facet"
|
|
7955
7955
|
};
|
|
7956
|
-
const _hoisted_4$
|
|
7956
|
+
const _hoisted_4$p = {
|
|
7957
7957
|
class: "lupa-suggestion-facet-label",
|
|
7958
7958
|
"data-cy": "lupa-suggestion-facet-label"
|
|
7959
7959
|
};
|
|
@@ -7999,7 +7999,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
7999
7999
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
8000
8000
|
}, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$M, toDisplayString(_ctx.suggestion.display), 1)),
|
|
8001
8001
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
|
|
8002
|
-
createBaseVNode("span", _hoisted_4$
|
|
8002
|
+
createBaseVNode("span", _hoisted_4$p, toDisplayString(facetLabel.value), 1),
|
|
8003
8003
|
createBaseVNode("span", _hoisted_5$e, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
8004
8004
|
])) : createCommentVNode("", true)
|
|
8005
8005
|
]);
|
|
@@ -8401,7 +8401,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
8401
8401
|
const _hoisted_1$10 = ["innerHTML"];
|
|
8402
8402
|
const _hoisted_2$J = { key: 0 };
|
|
8403
8403
|
const _hoisted_3$y = { key: 1 };
|
|
8404
|
-
const _hoisted_4$
|
|
8404
|
+
const _hoisted_4$o = { class: "lupa-search-box-custom-label" };
|
|
8405
8405
|
const _hoisted_5$d = { class: "lupa-search-box-custom-text" };
|
|
8406
8406
|
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
8407
8407
|
__name: "SearchBoxProductCustom",
|
|
@@ -8434,7 +8434,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
8434
8434
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
8435
8435
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
8436
8436
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$J, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
|
|
8437
|
-
createBaseVNode("div", _hoisted_4$
|
|
8437
|
+
createBaseVNode("div", _hoisted_4$o, toDisplayString(label.value), 1),
|
|
8438
8438
|
createBaseVNode("div", _hoisted_5$d, toDisplayString(text.value), 1)
|
|
8439
8439
|
]))
|
|
8440
8440
|
], 16));
|
|
@@ -8830,7 +8830,7 @@ const useTrackingStore = defineStore("tracking", () => {
|
|
|
8830
8830
|
const _hoisted_1$Z = ["href"];
|
|
8831
8831
|
const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
|
|
8832
8832
|
const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
|
|
8833
|
-
const _hoisted_4$
|
|
8833
|
+
const _hoisted_4$n = {
|
|
8834
8834
|
key: 0,
|
|
8835
8835
|
class: "lupa-search-box-product-add-to-cart-section"
|
|
8836
8836
|
};
|
|
@@ -8951,7 +8951,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
8951
8951
|
}, null, 8, ["item", "element", "labels", "link"]);
|
|
8952
8952
|
}), 128))
|
|
8953
8953
|
]),
|
|
8954
|
-
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
8954
|
+
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$n, [
|
|
8955
8955
|
createVNode(_sfc_main$12, {
|
|
8956
8956
|
class: "lupa-search-box-product-element",
|
|
8957
8957
|
item: _ctx.item,
|
|
@@ -9086,12 +9086,8 @@ const _hoisted_1$X = {
|
|
|
9086
9086
|
key: 0,
|
|
9087
9087
|
id: "lupa-search-box-panel"
|
|
9088
9088
|
};
|
|
9089
|
-
const _hoisted_2$G =
|
|
9090
|
-
|
|
9091
|
-
"data-cy": "lupa-main-panel"
|
|
9092
|
-
};
|
|
9093
|
-
const _hoisted_3$v = ["data-cy"];
|
|
9094
|
-
const _hoisted_4$n = {
|
|
9089
|
+
const _hoisted_2$G = ["data-cy"];
|
|
9090
|
+
const _hoisted_3$v = {
|
|
9095
9091
|
key: 1,
|
|
9096
9092
|
id: "lupa-search-box-panel"
|
|
9097
9093
|
};
|
|
@@ -9128,7 +9124,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9128
9124
|
const panels = computed(() => props.options.panels);
|
|
9129
9125
|
const sdkOptions = computed(() => props.options.options);
|
|
9130
9126
|
const searchBoxStore = useSearchBoxStore();
|
|
9131
|
-
const { suggestionResults, hasAnyResults } = storeToRefs(searchBoxStore);
|
|
9127
|
+
const { suggestionResults, hasAnyResults, panelItemCounts } = storeToRefs(searchBoxStore);
|
|
9132
9128
|
const displayResults = computed(
|
|
9133
9129
|
() => {
|
|
9134
9130
|
var _a, _b;
|
|
@@ -9209,6 +9205,12 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9209
9205
|
`${window.innerHeight - panel.getBoundingClientRect().y - 10}px`
|
|
9210
9206
|
);
|
|
9211
9207
|
};
|
|
9208
|
+
const numberOfVisiblePanels = computed(() => {
|
|
9209
|
+
return panelItemCounts.value.filter((v) => v.count > 0).length;
|
|
9210
|
+
});
|
|
9211
|
+
const expandOnSinglePanel = computed(() => {
|
|
9212
|
+
return numberOfVisiblePanels.value === 1 && props.options.expandOnSinglePanel;
|
|
9213
|
+
});
|
|
9212
9214
|
return (_ctx, _cache) => {
|
|
9213
9215
|
var _a;
|
|
9214
9216
|
return openBlock(), createElementBlock("div", {
|
|
@@ -9216,7 +9218,11 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9216
9218
|
ref: panelContainer
|
|
9217
9219
|
}, [
|
|
9218
9220
|
displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$X, [
|
|
9219
|
-
createBaseVNode("div",
|
|
9221
|
+
createBaseVNode("div", {
|
|
9222
|
+
class: "lupa-main-panel",
|
|
9223
|
+
style: normalizeStyle(expandOnSinglePanel.value ? { display: "block" } : {}),
|
|
9224
|
+
"data-cy": "lupa-main-panel"
|
|
9225
|
+
}, [
|
|
9220
9226
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
|
|
9221
9227
|
return openBlock(), createElementBlock("div", {
|
|
9222
9228
|
key: index,
|
|
@@ -9245,9 +9251,9 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9245
9251
|
key: "0"
|
|
9246
9252
|
} : void 0
|
|
9247
9253
|
]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
9248
|
-
], 10,
|
|
9254
|
+
], 10, _hoisted_2$G);
|
|
9249
9255
|
}), 128))
|
|
9250
|
-
]),
|
|
9256
|
+
], 4),
|
|
9251
9257
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1f, {
|
|
9252
9258
|
key: 0,
|
|
9253
9259
|
labels: labels.value
|
|
@@ -9258,7 +9264,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9258
9264
|
showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
|
|
9259
9265
|
onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
|
|
9260
9266
|
}, null, 8, ["labels", "showTotalCount"])) : createCommentVNode("", true)
|
|
9261
|
-
])) : displayHistory.value ? (openBlock(), createElementBlock("div",
|
|
9267
|
+
])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
|
|
9262
9268
|
createVNode(_sfc_main$1g, {
|
|
9263
9269
|
options: _ctx.options.history,
|
|
9264
9270
|
history: history.value,
|
|
@@ -9327,7 +9333,8 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
9327
9333
|
"debounce",
|
|
9328
9334
|
"showTotalCount",
|
|
9329
9335
|
"hideMoreResultsButtonOnNoResults",
|
|
9330
|
-
"showNoResultsPanel"
|
|
9336
|
+
"showNoResultsPanel",
|
|
9337
|
+
"expandOnSinglePanel"
|
|
9331
9338
|
])
|
|
9332
9339
|
);
|
|
9333
9340
|
const searchTriggers = computed(() => {
|
|
@@ -13996,8 +14003,14 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
13996
14003
|
const isTitleResultTopPosition = computed(() => {
|
|
13997
14004
|
return props.options.searchTitlePosition === "search-results-top";
|
|
13998
14005
|
});
|
|
14006
|
+
const handlePopState = () => {
|
|
14007
|
+
var _a;
|
|
14008
|
+
const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url);
|
|
14009
|
+
paramStore.add(parseParams(searchParams));
|
|
14010
|
+
};
|
|
13999
14011
|
onMounted(() => {
|
|
14000
14012
|
var _a, _b;
|
|
14013
|
+
window.addEventListener("popstate", handlePopState);
|
|
14001
14014
|
window.addEventListener("resize", handleResize);
|
|
14002
14015
|
if (props.initialData) {
|
|
14003
14016
|
searchResultStore.add(__spreadValues2({}, props.initialData));
|
|
@@ -14008,6 +14021,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
14008
14021
|
});
|
|
14009
14022
|
onBeforeUnmount(() => {
|
|
14010
14023
|
window.removeEventListener("resize", handleResize);
|
|
14024
|
+
window.removeEventListener("popstate", handlePopState);
|
|
14011
14025
|
});
|
|
14012
14026
|
const trackItemListView = (title, items = []) => {
|
|
14013
14027
|
trackingStore.trackEvent({
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -7677,7 +7677,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
|
|
|
7677
7677
|
const _hoisted_1$1b = { id: "lupa-search-box-input-container" };
|
|
7678
7678
|
const _hoisted_2$O = { class: "lupa-input-clear" };
|
|
7679
7679
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
7680
|
-
const _hoisted_4$
|
|
7680
|
+
const _hoisted_4$q = ["value"];
|
|
7681
7681
|
const _hoisted_5$f = ["placeholder"];
|
|
7682
7682
|
const _hoisted_6$8 = {
|
|
7683
7683
|
key: 0,
|
|
@@ -7772,7 +7772,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
|
7772
7772
|
class: "lupa-hint",
|
|
7773
7773
|
value: showHint.value ? suggestedValue.value.item.suggestion : "",
|
|
7774
7774
|
disabled: ""
|
|
7775
|
-
}, null, 8, _hoisted_4$
|
|
7775
|
+
}, null, 8, _hoisted_4$q),
|
|
7776
7776
|
withDirectives(createBaseVNode("input", mergeProps({
|
|
7777
7777
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
7778
7778
|
}, inputAttributes.value, {
|
|
@@ -7951,7 +7951,7 @@ const _hoisted_3$z = {
|
|
|
7951
7951
|
class: "lupa-suggestion-facet",
|
|
7952
7952
|
"data-cy": "lupa-suggestion-facet"
|
|
7953
7953
|
};
|
|
7954
|
-
const _hoisted_4$
|
|
7954
|
+
const _hoisted_4$p = {
|
|
7955
7955
|
class: "lupa-suggestion-facet-label",
|
|
7956
7956
|
"data-cy": "lupa-suggestion-facet-label"
|
|
7957
7957
|
};
|
|
@@ -7997,7 +7997,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
7997
7997
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
7998
7998
|
}, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$M, toDisplayString(_ctx.suggestion.display), 1)),
|
|
7999
7999
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
|
|
8000
|
-
createBaseVNode("span", _hoisted_4$
|
|
8000
|
+
createBaseVNode("span", _hoisted_4$p, toDisplayString(facetLabel.value), 1),
|
|
8001
8001
|
createBaseVNode("span", _hoisted_5$e, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
8002
8002
|
])) : createCommentVNode("", true)
|
|
8003
8003
|
]);
|
|
@@ -8399,7 +8399,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
8399
8399
|
const _hoisted_1$10 = ["innerHTML"];
|
|
8400
8400
|
const _hoisted_2$J = { key: 0 };
|
|
8401
8401
|
const _hoisted_3$y = { key: 1 };
|
|
8402
|
-
const _hoisted_4$
|
|
8402
|
+
const _hoisted_4$o = { class: "lupa-search-box-custom-label" };
|
|
8403
8403
|
const _hoisted_5$d = { class: "lupa-search-box-custom-text" };
|
|
8404
8404
|
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
8405
8405
|
__name: "SearchBoxProductCustom",
|
|
@@ -8432,7 +8432,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
8432
8432
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
8433
8433
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
8434
8434
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$J, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
|
|
8435
|
-
createBaseVNode("div", _hoisted_4$
|
|
8435
|
+
createBaseVNode("div", _hoisted_4$o, toDisplayString(label.value), 1),
|
|
8436
8436
|
createBaseVNode("div", _hoisted_5$d, toDisplayString(text.value), 1)
|
|
8437
8437
|
]))
|
|
8438
8438
|
], 16));
|
|
@@ -8828,7 +8828,7 @@ const useTrackingStore = defineStore("tracking", () => {
|
|
|
8828
8828
|
const _hoisted_1$Z = ["href"];
|
|
8829
8829
|
const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
|
|
8830
8830
|
const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
|
|
8831
|
-
const _hoisted_4$
|
|
8831
|
+
const _hoisted_4$n = {
|
|
8832
8832
|
key: 0,
|
|
8833
8833
|
class: "lupa-search-box-product-add-to-cart-section"
|
|
8834
8834
|
};
|
|
@@ -8949,7 +8949,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
8949
8949
|
}, null, 8, ["item", "element", "labels", "link"]);
|
|
8950
8950
|
}), 128))
|
|
8951
8951
|
]),
|
|
8952
|
-
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
8952
|
+
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$n, [
|
|
8953
8953
|
createVNode(_sfc_main$12, {
|
|
8954
8954
|
class: "lupa-search-box-product-element",
|
|
8955
8955
|
item: _ctx.item,
|
|
@@ -9084,12 +9084,8 @@ const _hoisted_1$X = {
|
|
|
9084
9084
|
key: 0,
|
|
9085
9085
|
id: "lupa-search-box-panel"
|
|
9086
9086
|
};
|
|
9087
|
-
const _hoisted_2$G =
|
|
9088
|
-
|
|
9089
|
-
"data-cy": "lupa-main-panel"
|
|
9090
|
-
};
|
|
9091
|
-
const _hoisted_3$v = ["data-cy"];
|
|
9092
|
-
const _hoisted_4$n = {
|
|
9087
|
+
const _hoisted_2$G = ["data-cy"];
|
|
9088
|
+
const _hoisted_3$v = {
|
|
9093
9089
|
key: 1,
|
|
9094
9090
|
id: "lupa-search-box-panel"
|
|
9095
9091
|
};
|
|
@@ -9126,7 +9122,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9126
9122
|
const panels = computed(() => props.options.panels);
|
|
9127
9123
|
const sdkOptions = computed(() => props.options.options);
|
|
9128
9124
|
const searchBoxStore = useSearchBoxStore();
|
|
9129
|
-
const { suggestionResults, hasAnyResults } = storeToRefs(searchBoxStore);
|
|
9125
|
+
const { suggestionResults, hasAnyResults, panelItemCounts } = storeToRefs(searchBoxStore);
|
|
9130
9126
|
const displayResults = computed(
|
|
9131
9127
|
() => {
|
|
9132
9128
|
var _a, _b;
|
|
@@ -9207,6 +9203,12 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9207
9203
|
`${window.innerHeight - panel.getBoundingClientRect().y - 10}px`
|
|
9208
9204
|
);
|
|
9209
9205
|
};
|
|
9206
|
+
const numberOfVisiblePanels = computed(() => {
|
|
9207
|
+
return panelItemCounts.value.filter((v) => v.count > 0).length;
|
|
9208
|
+
});
|
|
9209
|
+
const expandOnSinglePanel = computed(() => {
|
|
9210
|
+
return numberOfVisiblePanels.value === 1 && props.options.expandOnSinglePanel;
|
|
9211
|
+
});
|
|
9210
9212
|
return (_ctx, _cache) => {
|
|
9211
9213
|
var _a;
|
|
9212
9214
|
return openBlock(), createElementBlock("div", {
|
|
@@ -9214,7 +9216,11 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9214
9216
|
ref: panelContainer
|
|
9215
9217
|
}, [
|
|
9216
9218
|
displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$X, [
|
|
9217
|
-
createBaseVNode("div",
|
|
9219
|
+
createBaseVNode("div", {
|
|
9220
|
+
class: "lupa-main-panel",
|
|
9221
|
+
style: normalizeStyle(expandOnSinglePanel.value ? { display: "block" } : {}),
|
|
9222
|
+
"data-cy": "lupa-main-panel"
|
|
9223
|
+
}, [
|
|
9218
9224
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
|
|
9219
9225
|
return openBlock(), createElementBlock("div", {
|
|
9220
9226
|
key: index,
|
|
@@ -9243,9 +9249,9 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9243
9249
|
key: "0"
|
|
9244
9250
|
} : void 0
|
|
9245
9251
|
]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
9246
|
-
], 10,
|
|
9252
|
+
], 10, _hoisted_2$G);
|
|
9247
9253
|
}), 128))
|
|
9248
|
-
]),
|
|
9254
|
+
], 4),
|
|
9249
9255
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1f, {
|
|
9250
9256
|
key: 0,
|
|
9251
9257
|
labels: labels.value
|
|
@@ -9256,7 +9262,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
9256
9262
|
showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
|
|
9257
9263
|
onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
|
|
9258
9264
|
}, null, 8, ["labels", "showTotalCount"])) : createCommentVNode("", true)
|
|
9259
|
-
])) : displayHistory.value ? (openBlock(), createElementBlock("div",
|
|
9265
|
+
])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
|
|
9260
9266
|
createVNode(_sfc_main$1g, {
|
|
9261
9267
|
options: _ctx.options.history,
|
|
9262
9268
|
history: history.value,
|
|
@@ -9325,7 +9331,8 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
9325
9331
|
"debounce",
|
|
9326
9332
|
"showTotalCount",
|
|
9327
9333
|
"hideMoreResultsButtonOnNoResults",
|
|
9328
|
-
"showNoResultsPanel"
|
|
9334
|
+
"showNoResultsPanel",
|
|
9335
|
+
"expandOnSinglePanel"
|
|
9329
9336
|
])
|
|
9330
9337
|
);
|
|
9331
9338
|
const searchTriggers = computed(() => {
|
|
@@ -13994,8 +14001,14 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
13994
14001
|
const isTitleResultTopPosition = computed(() => {
|
|
13995
14002
|
return props.options.searchTitlePosition === "search-results-top";
|
|
13996
14003
|
});
|
|
14004
|
+
const handlePopState = () => {
|
|
14005
|
+
var _a;
|
|
14006
|
+
const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url);
|
|
14007
|
+
paramStore.add(parseParams(searchParams));
|
|
14008
|
+
};
|
|
13997
14009
|
onMounted(() => {
|
|
13998
14010
|
var _a, _b;
|
|
14011
|
+
window.addEventListener("popstate", handlePopState);
|
|
13999
14012
|
window.addEventListener("resize", handleResize);
|
|
14000
14013
|
if (props.initialData) {
|
|
14001
14014
|
searchResultStore.add(__spreadValues2({}, props.initialData));
|
|
@@ -14006,6 +14019,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
14006
14019
|
});
|
|
14007
14020
|
onBeforeUnmount(() => {
|
|
14008
14021
|
window.removeEventListener("resize", handleResize);
|
|
14022
|
+
window.removeEventListener("popstate", handlePopState);
|
|
14009
14023
|
});
|
|
14010
14024
|
const trackItemListView = (title, items = []) => {
|
|
14011
14025
|
trackingStore.trackEvent({
|
package/dist/lupaSearch.umd.js
CHANGED
|
@@ -7681,7 +7681,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7681
7681
|
const _hoisted_1$1b = { id: "lupa-search-box-input-container" };
|
|
7682
7682
|
const _hoisted_2$O = { class: "lupa-input-clear" };
|
|
7683
7683
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
7684
|
-
const _hoisted_4$
|
|
7684
|
+
const _hoisted_4$q = ["value"];
|
|
7685
7685
|
const _hoisted_5$f = ["placeholder"];
|
|
7686
7686
|
const _hoisted_6$8 = {
|
|
7687
7687
|
key: 0,
|
|
@@ -7776,7 +7776,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7776
7776
|
class: "lupa-hint",
|
|
7777
7777
|
value: showHint.value ? suggestedValue.value.item.suggestion : "",
|
|
7778
7778
|
disabled: ""
|
|
7779
|
-
}, null, 8, _hoisted_4$
|
|
7779
|
+
}, null, 8, _hoisted_4$q),
|
|
7780
7780
|
withDirectives(createBaseVNode("input", mergeProps({
|
|
7781
7781
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
7782
7782
|
}, inputAttributes.value, {
|
|
@@ -7955,7 +7955,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7955
7955
|
class: "lupa-suggestion-facet",
|
|
7956
7956
|
"data-cy": "lupa-suggestion-facet"
|
|
7957
7957
|
};
|
|
7958
|
-
const _hoisted_4$
|
|
7958
|
+
const _hoisted_4$p = {
|
|
7959
7959
|
class: "lupa-suggestion-facet-label",
|
|
7960
7960
|
"data-cy": "lupa-suggestion-facet-label"
|
|
7961
7961
|
};
|
|
@@ -8001,7 +8001,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8001
8001
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
8002
8002
|
}, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$M, toDisplayString(_ctx.suggestion.display), 1)),
|
|
8003
8003
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
|
|
8004
|
-
createBaseVNode("span", _hoisted_4$
|
|
8004
|
+
createBaseVNode("span", _hoisted_4$p, toDisplayString(facetLabel.value), 1),
|
|
8005
8005
|
createBaseVNode("span", _hoisted_5$e, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
8006
8006
|
])) : createCommentVNode("", true)
|
|
8007
8007
|
]);
|
|
@@ -8403,7 +8403,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8403
8403
|
const _hoisted_1$10 = ["innerHTML"];
|
|
8404
8404
|
const _hoisted_2$J = { key: 0 };
|
|
8405
8405
|
const _hoisted_3$y = { key: 1 };
|
|
8406
|
-
const _hoisted_4$
|
|
8406
|
+
const _hoisted_4$o = { class: "lupa-search-box-custom-label" };
|
|
8407
8407
|
const _hoisted_5$d = { class: "lupa-search-box-custom-text" };
|
|
8408
8408
|
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
8409
8409
|
__name: "SearchBoxProductCustom",
|
|
@@ -8436,7 +8436,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8436
8436
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
8437
8437
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
8438
8438
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$J, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
|
|
8439
|
-
createBaseVNode("div", _hoisted_4$
|
|
8439
|
+
createBaseVNode("div", _hoisted_4$o, toDisplayString(label.value), 1),
|
|
8440
8440
|
createBaseVNode("div", _hoisted_5$d, toDisplayString(text.value), 1)
|
|
8441
8441
|
]))
|
|
8442
8442
|
], 16));
|
|
@@ -8832,7 +8832,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8832
8832
|
const _hoisted_1$Z = ["href"];
|
|
8833
8833
|
const _hoisted_2$H = { class: "lupa-search-box-product-image-section" };
|
|
8834
8834
|
const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
|
|
8835
|
-
const _hoisted_4$
|
|
8835
|
+
const _hoisted_4$n = {
|
|
8836
8836
|
key: 0,
|
|
8837
8837
|
class: "lupa-search-box-product-add-to-cart-section"
|
|
8838
8838
|
};
|
|
@@ -8953,7 +8953,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
8953
8953
|
}, null, 8, ["item", "element", "labels", "link"]);
|
|
8954
8954
|
}), 128))
|
|
8955
8955
|
]),
|
|
8956
|
-
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
8956
|
+
addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$n, [
|
|
8957
8957
|
createVNode(_sfc_main$12, {
|
|
8958
8958
|
class: "lupa-search-box-product-element",
|
|
8959
8959
|
item: _ctx.item,
|
|
@@ -9088,12 +9088,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9088
9088
|
key: 0,
|
|
9089
9089
|
id: "lupa-search-box-panel"
|
|
9090
9090
|
};
|
|
9091
|
-
const _hoisted_2$G =
|
|
9092
|
-
|
|
9093
|
-
"data-cy": "lupa-main-panel"
|
|
9094
|
-
};
|
|
9095
|
-
const _hoisted_3$v = ["data-cy"];
|
|
9096
|
-
const _hoisted_4$n = {
|
|
9091
|
+
const _hoisted_2$G = ["data-cy"];
|
|
9092
|
+
const _hoisted_3$v = {
|
|
9097
9093
|
key: 1,
|
|
9098
9094
|
id: "lupa-search-box-panel"
|
|
9099
9095
|
};
|
|
@@ -9130,7 +9126,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9130
9126
|
const panels = computed(() => props.options.panels);
|
|
9131
9127
|
const sdkOptions = computed(() => props.options.options);
|
|
9132
9128
|
const searchBoxStore = useSearchBoxStore();
|
|
9133
|
-
const { suggestionResults, hasAnyResults } = storeToRefs(searchBoxStore);
|
|
9129
|
+
const { suggestionResults, hasAnyResults, panelItemCounts } = storeToRefs(searchBoxStore);
|
|
9134
9130
|
const displayResults = computed(
|
|
9135
9131
|
() => {
|
|
9136
9132
|
var _a, _b;
|
|
@@ -9211,6 +9207,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9211
9207
|
`${window.innerHeight - panel.getBoundingClientRect().y - 10}px`
|
|
9212
9208
|
);
|
|
9213
9209
|
};
|
|
9210
|
+
const numberOfVisiblePanels = computed(() => {
|
|
9211
|
+
return panelItemCounts.value.filter((v) => v.count > 0).length;
|
|
9212
|
+
});
|
|
9213
|
+
const expandOnSinglePanel = computed(() => {
|
|
9214
|
+
return numberOfVisiblePanels.value === 1 && props.options.expandOnSinglePanel;
|
|
9215
|
+
});
|
|
9214
9216
|
return (_ctx, _cache) => {
|
|
9215
9217
|
var _a;
|
|
9216
9218
|
return openBlock(), createElementBlock("div", {
|
|
@@ -9218,7 +9220,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9218
9220
|
ref: panelContainer
|
|
9219
9221
|
}, [
|
|
9220
9222
|
displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$X, [
|
|
9221
|
-
createBaseVNode("div",
|
|
9223
|
+
createBaseVNode("div", {
|
|
9224
|
+
class: "lupa-main-panel",
|
|
9225
|
+
style: normalizeStyle(expandOnSinglePanel.value ? { display: "block" } : {}),
|
|
9226
|
+
"data-cy": "lupa-main-panel"
|
|
9227
|
+
}, [
|
|
9222
9228
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
|
|
9223
9229
|
return openBlock(), createElementBlock("div", {
|
|
9224
9230
|
key: index,
|
|
@@ -9247,9 +9253,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9247
9253
|
key: "0"
|
|
9248
9254
|
} : void 0
|
|
9249
9255
|
]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
9250
|
-
], 10,
|
|
9256
|
+
], 10, _hoisted_2$G);
|
|
9251
9257
|
}), 128))
|
|
9252
|
-
]),
|
|
9258
|
+
], 4),
|
|
9253
9259
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1f, {
|
|
9254
9260
|
key: 0,
|
|
9255
9261
|
labels: labels.value
|
|
@@ -9260,7 +9266,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9260
9266
|
showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
|
|
9261
9267
|
onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
|
|
9262
9268
|
}, null, 8, ["labels", "showTotalCount"])) : createCommentVNode("", true)
|
|
9263
|
-
])) : displayHistory.value ? (openBlock(), createElementBlock("div",
|
|
9269
|
+
])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
|
|
9264
9270
|
createVNode(_sfc_main$1g, {
|
|
9265
9271
|
options: _ctx.options.history,
|
|
9266
9272
|
history: history.value,
|
|
@@ -9329,7 +9335,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
9329
9335
|
"debounce",
|
|
9330
9336
|
"showTotalCount",
|
|
9331
9337
|
"hideMoreResultsButtonOnNoResults",
|
|
9332
|
-
"showNoResultsPanel"
|
|
9338
|
+
"showNoResultsPanel",
|
|
9339
|
+
"expandOnSinglePanel"
|
|
9333
9340
|
])
|
|
9334
9341
|
);
|
|
9335
9342
|
const searchTriggers = computed(() => {
|
|
@@ -13998,8 +14005,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
13998
14005
|
const isTitleResultTopPosition = computed(() => {
|
|
13999
14006
|
return props.options.searchTitlePosition === "search-results-top";
|
|
14000
14007
|
});
|
|
14008
|
+
const handlePopState = () => {
|
|
14009
|
+
var _a;
|
|
14010
|
+
const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url);
|
|
14011
|
+
paramStore.add(parseParams(searchParams));
|
|
14012
|
+
};
|
|
14001
14013
|
onMounted(() => {
|
|
14002
14014
|
var _a, _b;
|
|
14015
|
+
window.addEventListener("popstate", handlePopState);
|
|
14003
14016
|
window.addEventListener("resize", handleResize);
|
|
14004
14017
|
if (props.initialData) {
|
|
14005
14018
|
searchResultStore.add(__spreadValues2({}, props.initialData));
|
|
@@ -14010,6 +14023,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
14010
14023
|
});
|
|
14011
14024
|
onBeforeUnmount(() => {
|
|
14012
14025
|
window.removeEventListener("resize", handleResize);
|
|
14026
|
+
window.removeEventListener("popstate", handlePopState);
|
|
14013
14027
|
});
|
|
14014
14028
|
const trackItemListView = (title, items = []) => {
|
|
14015
14029
|
trackingStore.trackEvent({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getlupa/client",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
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.5.
|
|
23
|
+
"@getlupa/vue": "0.5.1",
|
|
24
24
|
"@rushstack/eslint-patch": "^1.3.2",
|
|
25
25
|
"@tsconfig/node18": "^2.0.1",
|
|
26
26
|
"@types/jsdom": "^21.1.1",
|