@getlupa/client 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/search-box/SearchBox.vue.d.ts +6 -1
- package/dist/cjs/components/search-box/SearchBoxInput.vue.d.ts +2 -0
- package/dist/cjs/components/search-box/products/SearchBoxProduct.vue.d.ts +1 -0
- package/dist/cjs/components/search-results/SearchResults.vue.d.ts +3 -0
- package/dist/cjs/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
- package/dist/cjs/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
- package/dist/cjs/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +1 -0
- package/dist/cjs/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +2 -0
- package/dist/cjs/constants/development/searchBoxDev.example.const.d.ts +1 -0
- package/dist/cjs/constants/development/searchResultsDev.example.const.d.ts +1 -0
- package/dist/cjs/constants/global.const.d.ts +1 -0
- package/dist/cjs/index.min.js +366 -147
- package/dist/cjs/store/modules/tracking.d.ts +3 -1
- package/dist/cjs/types/AnalyticsOptions.d.ts +3 -2
- package/dist/cjs/types/search-box/Common.d.ts +1 -0
- package/dist/cjs/types/search-box/SearchBoxOptions.d.ts +1 -0
- package/dist/cjs/types/search-container/SearchContainerOptions.d.ts +1 -0
- package/dist/cjs/types/search-results/SearchResultsProductCardOptions.d.ts +1 -0
- package/dist/cjs/utils/shadowDom.utils.d.ts +5 -0
- package/dist/containerStyle.js +1 -0
- package/dist/es/components/search-box/SearchBox.vue.d.ts +6 -1
- package/dist/es/components/search-box/SearchBoxInput.vue.d.ts +2 -0
- package/dist/es/components/search-box/products/SearchBoxProduct.vue.d.ts +1 -0
- package/dist/es/components/search-results/SearchResults.vue.d.ts +3 -0
- package/dist/es/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
- package/dist/es/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
- package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +1 -0
- package/dist/es/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +2 -0
- package/dist/es/constants/development/searchBoxDev.example.const.d.ts +1 -0
- package/dist/es/constants/development/searchResultsDev.example.const.d.ts +1 -0
- package/dist/es/constants/global.const.d.ts +1 -0
- package/dist/es/index.min.js +366 -147
- package/dist/es/store/modules/tracking.d.ts +3 -1
- package/dist/es/types/AnalyticsOptions.d.ts +3 -2
- package/dist/es/types/search-box/Common.d.ts +1 -0
- package/dist/es/types/search-box/SearchBoxOptions.d.ts +1 -0
- package/dist/es/types/search-container/SearchContainerOptions.d.ts +1 -0
- package/dist/es/types/search-results/SearchResultsProductCardOptions.d.ts +1 -0
- package/dist/es/utils/shadowDom.utils.d.ts +5 -0
- package/dist/iife/components/search-box/SearchBox.vue.d.ts +6 -1
- package/dist/iife/components/search-box/SearchBoxInput.vue.d.ts +2 -0
- package/dist/iife/components/search-box/products/SearchBoxProduct.vue.d.ts +1 -0
- package/dist/iife/components/search-results/SearchResults.vue.d.ts +3 -0
- package/dist/iife/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
- package/dist/iife/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
- package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +1 -0
- package/dist/iife/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +2 -0
- package/dist/iife/constants/development/searchBoxDev.example.const.d.ts +1 -0
- package/dist/iife/constants/development/searchResultsDev.example.const.d.ts +1 -0
- package/dist/iife/constants/global.const.d.ts +1 -0
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/store/modules/tracking.d.ts +3 -1
- package/dist/iife/types/AnalyticsOptions.d.ts +3 -2
- package/dist/iife/types/search-box/Common.d.ts +1 -0
- package/dist/iife/types/search-box/SearchBoxOptions.d.ts +1 -0
- package/dist/iife/types/search-container/SearchContainerOptions.d.ts +1 -0
- package/dist/iife/types/search-results/SearchResultsProductCardOptions.d.ts +1 -0
- package/dist/iife/utils/shadowDom.utils.d.ts +5 -0
- package/dist/lupaContainerStyle.css +1 -0
- package/dist/style.css +1 -1
- package/package.json +3 -2
package/dist/cjs/index.min.js
CHANGED
|
@@ -10984,7 +10984,7 @@ let SearchBoxInput = class SearchBoxInput extends Vue$1 {
|
|
|
10984
10984
|
if (target) {
|
|
10985
10985
|
this.inputValue = target.value;
|
|
10986
10986
|
}
|
|
10987
|
-
this.$emit("input", this.inputValue
|
|
10987
|
+
this.$emit("input", this.inputValue);
|
|
10988
10988
|
}
|
|
10989
10989
|
handleFocus() {
|
|
10990
10990
|
this.$emit("focus");
|
|
@@ -10992,6 +10992,13 @@ let SearchBoxInput = class SearchBoxInput extends Vue$1 {
|
|
|
10992
10992
|
this.handleInput();
|
|
10993
10993
|
}
|
|
10994
10994
|
}
|
|
10995
|
+
clear() {
|
|
10996
|
+
this.$emit("input", "");
|
|
10997
|
+
}
|
|
10998
|
+
focus() {
|
|
10999
|
+
var _a, _b;
|
|
11000
|
+
(_b = (_a = this.$refs) === null || _a === void 0 ? void 0 : _a.mainInput) === null || _b === void 0 ? void 0 : _b.focus();
|
|
11001
|
+
}
|
|
10995
11002
|
};
|
|
10996
11003
|
__decorate([
|
|
10997
11004
|
Prop()
|
|
@@ -11161,6 +11168,14 @@ var __vue_render__$1b = function () {
|
|
|
11161
11168
|
var _h = _vm.$createElement;
|
|
11162
11169
|
var _c = _vm._self._c || _h;
|
|
11163
11170
|
return _c("div", { attrs: { id: "lupa-search-box-input-container" } }, [
|
|
11171
|
+
_c("div", { staticClass: "lupa-input-clear" }, [
|
|
11172
|
+
_c("div", {
|
|
11173
|
+
staticClass: "lupa-input-clear-content",
|
|
11174
|
+
class: { "lupa-input-clear-filled": _vm.inputValue },
|
|
11175
|
+
on: { click: _vm.clear },
|
|
11176
|
+
}),
|
|
11177
|
+
]),
|
|
11178
|
+
_vm._v(" "),
|
|
11164
11179
|
_c("div", { attrs: { id: "lupa-search-box-input" } }, [
|
|
11165
11180
|
_c("input", {
|
|
11166
11181
|
staticClass: "lupa-hint",
|
|
@@ -11182,6 +11197,7 @@ var __vue_render__$1b = function () {
|
|
|
11182
11197
|
expression: "inputValue",
|
|
11183
11198
|
},
|
|
11184
11199
|
],
|
|
11200
|
+
ref: "mainInput",
|
|
11185
11201
|
staticClass: "lupa-search-box-input-field",
|
|
11186
11202
|
attrs: {
|
|
11187
11203
|
autocomplete: "off",
|
|
@@ -11221,7 +11237,13 @@ var __vue_render__$1b = function () {
|
|
|
11221
11237
|
},
|
|
11222
11238
|
},
|
|
11223
11239
|
},
|
|
11224
|
-
[
|
|
11240
|
+
[
|
|
11241
|
+
_vm.labels.close
|
|
11242
|
+
? _c("span", { staticClass: "lupa-close-label" }, [
|
|
11243
|
+
_vm._v(_vm._s(_vm.labels.close)),
|
|
11244
|
+
])
|
|
11245
|
+
: _vm._e(),
|
|
11246
|
+
]
|
|
11225
11247
|
)
|
|
11226
11248
|
: _vm._e(),
|
|
11227
11249
|
])
|
|
@@ -11232,7 +11254,7 @@ __vue_render__$1b._withStripped = true;
|
|
|
11232
11254
|
/* style */
|
|
11233
11255
|
const __vue_inject_styles__$1b = function (inject) {
|
|
11234
11256
|
if (!inject) return
|
|
11235
|
-
inject("data-v-
|
|
11257
|
+
inject("data-v-219ea03b_0", { source: "\n.lupa-search-box-input-field,\n.lupa-hint {\n width: 100%;\n}\n.lupa-search-box-input-field {\n position: relative !important;\n background: transparent !important;\n}\n.lupa-hint {\n opacity: 0.5;\n position: absolute !important;\n pointer-events: none;\n}\n.lupa-input-clear {\n display: none;\n}\n", map: undefined, media: undefined });
|
|
11236
11258
|
|
|
11237
11259
|
};
|
|
11238
11260
|
/* scoped */
|
|
@@ -11966,7 +11988,8 @@ const MAX_FACET_VALUES = 5000;
|
|
|
11966
11988
|
const CURRENCY_KEY_INDICATOR = "price";
|
|
11967
11989
|
const DEFAULT_PAGE_SIZE = 12;
|
|
11968
11990
|
const DEFAULT_PAGE_SIZE_SELECTION = [12, 24, 36, 60];
|
|
11969
|
-
const LUPA_ROUTING_EVENT = "lupaRedirect";
|
|
11991
|
+
const LUPA_ROUTING_EVENT = "lupaRedirect";
|
|
11992
|
+
const DEFAULT_CONTAINER_STYLE = "containerStyle.css";
|
|
11970
11993
|
|
|
11971
11994
|
const formatRange = (filter) => {
|
|
11972
11995
|
var _a, _b;
|
|
@@ -12214,7 +12237,7 @@ const getRelativePath = (link) => {
|
|
|
12214
12237
|
}
|
|
12215
12238
|
catch (_a) {
|
|
12216
12239
|
// Invalid url, let's return original string
|
|
12217
|
-
return link;
|
|
12240
|
+
return (link === null || link === void 0 ? void 0 : link.endsWith("/")) ? link.slice(0, link.length - 1) : link;
|
|
12218
12241
|
}
|
|
12219
12242
|
};
|
|
12220
12243
|
// Checks if url links match absolutely, or if their relative parts are equal
|
|
@@ -12272,7 +12295,18 @@ let SearchBoxProduct = class SearchBoxProduct extends Vue$1 {
|
|
|
12272
12295
|
}
|
|
12273
12296
|
return "";
|
|
12274
12297
|
}
|
|
12298
|
+
get title() {
|
|
12299
|
+
if (!this.panelOptions.titleKey) {
|
|
12300
|
+
return "";
|
|
12301
|
+
}
|
|
12302
|
+
const title = this.item[this.panelOptions.titleKey] || "";
|
|
12303
|
+
this.addHistory({
|
|
12304
|
+
item: title,
|
|
12305
|
+
});
|
|
12306
|
+
return title;
|
|
12307
|
+
}
|
|
12275
12308
|
handleClick(event) {
|
|
12309
|
+
var _a;
|
|
12276
12310
|
if (this.panelOptions.titleKey) {
|
|
12277
12311
|
this.addHistory({
|
|
12278
12312
|
item: this.item[this.panelOptions.titleKey] || "",
|
|
@@ -12289,7 +12323,7 @@ let SearchBoxProduct = class SearchBoxProduct extends Vue$1 {
|
|
|
12289
12323
|
type: "itemClick",
|
|
12290
12324
|
analytics: {
|
|
12291
12325
|
type: "autocomplete_product_click",
|
|
12292
|
-
label: this.link,
|
|
12326
|
+
label: (_a = this.title) !== null && _a !== void 0 ? _a : this.link,
|
|
12293
12327
|
},
|
|
12294
12328
|
},
|
|
12295
12329
|
});
|
|
@@ -13332,8 +13366,9 @@ let SearchBoxMainPanel = class SearchBoxMainPanel extends Vue$1 {
|
|
|
13332
13366
|
this.sdkOptions = this.options.options;
|
|
13333
13367
|
}
|
|
13334
13368
|
get displayResults() {
|
|
13335
|
-
var _a;
|
|
13336
|
-
return ((_a = this.inputValue) === null || _a === void 0 ? void 0 : _a.length)
|
|
13369
|
+
var _a, _b;
|
|
13370
|
+
return (((_a = this.inputValue) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
13371
|
+
((_b = this.inputValue) === null || _b === void 0 ? void 0 : _b.length) >= this.options.minInputLength);
|
|
13337
13372
|
}
|
|
13338
13373
|
get displayHistory() {
|
|
13339
13374
|
var _a;
|
|
@@ -13532,7 +13567,7 @@ __vue_render__$V._withStripped = true;
|
|
|
13532
13567
|
/* style */
|
|
13533
13568
|
const __vue_inject_styles__$V = function (inject) {
|
|
13534
13569
|
if (!inject) return
|
|
13535
|
-
inject("data-v-
|
|
13570
|
+
inject("data-v-947d134e_0", { source: "#lupa-search-box-panel {\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n}\n.lupa-more-results {\n text-align: center;\n}", map: undefined, media: undefined });
|
|
13536
13571
|
|
|
13537
13572
|
};
|
|
13538
13573
|
/* scoped */
|
|
@@ -30824,12 +30859,16 @@ let SearchBox = class SearchBox extends Vue$1 {
|
|
|
30824
30859
|
return (_a = this.options.searchTriggers) !== null && _a !== void 0 ? _a : [];
|
|
30825
30860
|
}
|
|
30826
30861
|
mounted() {
|
|
30862
|
+
var _a, _b;
|
|
30827
30863
|
window.addEventListener("keydown", this.handleKeyDown);
|
|
30828
30864
|
window.addEventListener("click", this.handleMouseClick);
|
|
30829
30865
|
this.setSearchResultsLink(this.options.links.searchResults);
|
|
30830
30866
|
this.saveOptions({ options: this.options });
|
|
30831
30867
|
this.setSearchBoxOptions({ options: this.options });
|
|
30832
30868
|
bindSearchTriggers(this.searchTriggers, this.handleCurrentValueSearch);
|
|
30869
|
+
if (this.isSearchContainer) {
|
|
30870
|
+
(_b = (_a = this.$refs) === null || _a === void 0 ? void 0 : _a.searchBoxInput) === null || _b === void 0 ? void 0 : _b.focus();
|
|
30871
|
+
}
|
|
30833
30872
|
}
|
|
30834
30873
|
beforeDestroy() {
|
|
30835
30874
|
window.removeEventListener("keydown", this.handleKeyDown);
|
|
@@ -30867,11 +30906,12 @@ let SearchBox = class SearchBox extends Vue$1 {
|
|
|
30867
30906
|
}
|
|
30868
30907
|
handleInput(value) {
|
|
30869
30908
|
this.opened = true;
|
|
30870
|
-
this.inputValue = value;
|
|
30909
|
+
this.inputValue = value.replace(/\s+$/, "");
|
|
30871
30910
|
this.suggestedValue = defaultSuggestedValue;
|
|
30911
|
+
this.trackSearchQuery(value);
|
|
30872
30912
|
if (this.isSearchContainer) {
|
|
30873
30913
|
this.goToResultsDebounced({
|
|
30874
|
-
searchText:
|
|
30914
|
+
searchText: value,
|
|
30875
30915
|
});
|
|
30876
30916
|
}
|
|
30877
30917
|
}
|
|
@@ -30961,11 +31001,22 @@ let SearchBox = class SearchBox extends Vue$1 {
|
|
|
30961
31001
|
type: "itemClick",
|
|
30962
31002
|
analytics: {
|
|
30963
31003
|
type: "autocomplete_product_click",
|
|
30964
|
-
label: doc.
|
|
31004
|
+
label: doc.title || doc.id,
|
|
30965
31005
|
},
|
|
30966
31006
|
},
|
|
30967
31007
|
});
|
|
30968
31008
|
}
|
|
31009
|
+
trackSearchQuery(query) {
|
|
31010
|
+
if (!query) {
|
|
31011
|
+
return;
|
|
31012
|
+
}
|
|
31013
|
+
this.trackSearch({
|
|
31014
|
+
queryKey: this.suggestedValue.queryKey,
|
|
31015
|
+
query: {
|
|
31016
|
+
searchText: query,
|
|
31017
|
+
},
|
|
31018
|
+
});
|
|
31019
|
+
}
|
|
30969
31020
|
trackSuggestionClick(suggestion) {
|
|
30970
31021
|
var _a;
|
|
30971
31022
|
if (suggestion ||
|
|
@@ -30980,7 +31031,7 @@ let SearchBox = class SearchBox extends Vue$1 {
|
|
|
30980
31031
|
searchQuery: this.inputValue,
|
|
30981
31032
|
type: "suggestionClick",
|
|
30982
31033
|
analytics: {
|
|
30983
|
-
type: "
|
|
31034
|
+
type: "autocomplete_suggestion_click",
|
|
30984
31035
|
label: suggestion || this.searchValue,
|
|
30985
31036
|
},
|
|
30986
31037
|
},
|
|
@@ -31012,6 +31063,9 @@ __decorate([
|
|
|
31012
31063
|
__decorate([
|
|
31013
31064
|
tracking$4.Action("track")
|
|
31014
31065
|
], SearchBox.prototype, "trackClick", void 0);
|
|
31066
|
+
__decorate([
|
|
31067
|
+
tracking$4.Action("trackSearch")
|
|
31068
|
+
], SearchBox.prototype, "trackSearch", void 0);
|
|
31015
31069
|
__decorate([
|
|
31016
31070
|
params$e.Action("setSearchResultsLink")
|
|
31017
31071
|
], SearchBox.prototype, "setSearchResultsLink", void 0);
|
|
@@ -31046,6 +31100,7 @@ var __vue_render__$U = function () {
|
|
|
31046
31100
|
{ staticClass: "lupa-search-box-wrapper" },
|
|
31047
31101
|
[
|
|
31048
31102
|
_c("SearchBoxInput", {
|
|
31103
|
+
ref: "searchBoxInput",
|
|
31049
31104
|
attrs: {
|
|
31050
31105
|
options: _vm.inputOptions,
|
|
31051
31106
|
suggestedValue: _vm.suggestedValue,
|
|
@@ -31085,7 +31140,7 @@ __vue_render__$U._withStripped = true;
|
|
|
31085
31140
|
/* style */
|
|
31086
31141
|
const __vue_inject_styles__$U = function (inject) {
|
|
31087
31142
|
if (!inject) return
|
|
31088
|
-
inject("data-v-
|
|
31143
|
+
inject("data-v-49023ab6_0", { source: "\n#lupa-search-box {\n width: 100%;\n}\n.lupa-search-box-wrapper {\n position: relative;\n}\n", map: undefined, media: undefined });
|
|
31089
31144
|
|
|
31090
31145
|
};
|
|
31091
31146
|
/* scoped */
|
|
@@ -33062,6 +33117,7 @@ __vue_render__$L._withStripped = true;
|
|
|
33062
33117
|
);
|
|
33063
33118
|
|
|
33064
33119
|
const RESULT_ROOT_ID = "lupa-search-results";
|
|
33120
|
+
const SHADOW_ROOT_ID = "lupa-shadow-id";
|
|
33065
33121
|
const CONTAINER_ROOT_ID = "lupa-search-container";
|
|
33066
33122
|
const scrollToSearchResults = (timeout = 500) => {
|
|
33067
33123
|
if (timeout) {
|
|
@@ -33072,12 +33128,19 @@ const scrollToSearchResults = (timeout = 500) => {
|
|
|
33072
33128
|
}
|
|
33073
33129
|
};
|
|
33074
33130
|
const scrollTo = (elementId) => {
|
|
33075
|
-
|
|
33131
|
+
var _a, _b;
|
|
33132
|
+
let el = document.getElementById(elementId);
|
|
33133
|
+
const shadowRoot = (_a = document.getElementById(SHADOW_ROOT_ID)) === null || _a === void 0 ? void 0 : _a.shadowRoot;
|
|
33134
|
+
if (!el) {
|
|
33135
|
+
el = (_b = shadowRoot === null || shadowRoot === void 0 ? void 0 : shadowRoot.getElementById(elementId)) !== null && _b !== void 0 ? _b : null;
|
|
33136
|
+
}
|
|
33076
33137
|
if (!el) {
|
|
33077
33138
|
return;
|
|
33078
33139
|
}
|
|
33079
|
-
const
|
|
33080
|
-
|
|
33140
|
+
const searchContainer = shadowRoot
|
|
33141
|
+
? shadowRoot.getElementById(CONTAINER_ROOT_ID)
|
|
33142
|
+
: undefined;
|
|
33143
|
+
const container = searchContainer !== null && searchContainer !== void 0 ? searchContainer : window;
|
|
33081
33144
|
container.scrollTo({
|
|
33082
33145
|
top: el.offsetTop,
|
|
33083
33146
|
behavior: "smooth",
|
|
@@ -34543,6 +34606,7 @@ var __vue_render__$x = function () {
|
|
|
34543
34606
|
{
|
|
34544
34607
|
staticClass: "lupa-search-results-product-title",
|
|
34545
34608
|
style: "-webkit-line-clamp: " + _vm.maxLines,
|
|
34609
|
+
attrs: { title: _vm.title },
|
|
34546
34610
|
},
|
|
34547
34611
|
[
|
|
34548
34612
|
!_vm.options.link
|
|
@@ -35047,9 +35111,17 @@ __vue_render__$s._withStripped = true;
|
|
|
35047
35111
|
);
|
|
35048
35112
|
|
|
35049
35113
|
let SearchResultsProductCustom = class SearchResultsProductCustom extends Vue$1 {
|
|
35050
|
-
get
|
|
35114
|
+
get value() {
|
|
35051
35115
|
return this.item[this.options.key];
|
|
35052
35116
|
}
|
|
35117
|
+
get text() {
|
|
35118
|
+
return this.isArray
|
|
35119
|
+
? this.item[this.options.key].join(", ")
|
|
35120
|
+
: this.item[this.options.key];
|
|
35121
|
+
}
|
|
35122
|
+
get isArray() {
|
|
35123
|
+
return Array.isArray(this.value);
|
|
35124
|
+
}
|
|
35053
35125
|
get className() {
|
|
35054
35126
|
return this.options.className;
|
|
35055
35127
|
}
|
|
@@ -35367,10 +35439,14 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
|
|
|
35367
35439
|
});
|
|
35368
35440
|
}
|
|
35369
35441
|
get id() {
|
|
35370
|
-
|
|
35371
|
-
|
|
35372
|
-
|
|
35373
|
-
|
|
35442
|
+
return this.options.idKey
|
|
35443
|
+
? this.product[this.options.idKey]
|
|
35444
|
+
: "";
|
|
35445
|
+
}
|
|
35446
|
+
get title() {
|
|
35447
|
+
return this.options.titleKey
|
|
35448
|
+
? this.product[this.options.titleKey]
|
|
35449
|
+
: "";
|
|
35374
35450
|
}
|
|
35375
35451
|
handleClick() {
|
|
35376
35452
|
var _a, _b;
|
|
@@ -35380,6 +35456,10 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
|
|
|
35380
35456
|
itemId: this.id,
|
|
35381
35457
|
searchQuery: this.query,
|
|
35382
35458
|
type: "itemClick",
|
|
35459
|
+
analytics: {
|
|
35460
|
+
type: "search_product_click",
|
|
35461
|
+
label: this.title || this.id || this.link,
|
|
35462
|
+
},
|
|
35383
35463
|
},
|
|
35384
35464
|
});
|
|
35385
35465
|
(_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onProductClick) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
@@ -35396,8 +35476,8 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
|
|
|
35396
35476
|
type: item.type,
|
|
35397
35477
|
analytics: item.type === "addToCart"
|
|
35398
35478
|
? {
|
|
35399
|
-
type: "
|
|
35400
|
-
label: this.link,
|
|
35479
|
+
type: "search_add_to_cart",
|
|
35480
|
+
label: this.title || this.id || this.link,
|
|
35401
35481
|
}
|
|
35402
35482
|
: undefined,
|
|
35403
35483
|
},
|
|
@@ -35567,7 +35647,7 @@ __vue_render__$o._withStripped = true;
|
|
|
35567
35647
|
|
|
35568
35648
|
const initAnalyticsTracking = (analyticsOptions) => {
|
|
35569
35649
|
try {
|
|
35570
|
-
if (
|
|
35650
|
+
if (analyticsOptions === null || analyticsOptions === void 0 ? void 0 : analyticsOptions.enabled) {
|
|
35571
35651
|
window.sessionStorage.setItem(TRACKING_ANALYTICS_KEY, JSON.stringify(analyticsOptions));
|
|
35572
35652
|
}
|
|
35573
35653
|
else {
|
|
@@ -35712,25 +35792,66 @@ const sendGa = (name, ...args) => {
|
|
|
35712
35792
|
});
|
|
35713
35793
|
};
|
|
35714
35794
|
const trackAnalyticsEvent = (data) => {
|
|
35715
|
-
var _a;
|
|
35795
|
+
var _a, _b, _c;
|
|
35716
35796
|
try {
|
|
35717
35797
|
const options = JSON.parse((_a = window.sessionStorage.getItem(TRACKING_ANALYTICS_KEY)) !== null && _a !== void 0 ? _a : "{}");
|
|
35718
|
-
if (!data.analytics ||
|
|
35798
|
+
if (!data.analytics ||
|
|
35799
|
+
!options.enabled ||
|
|
35800
|
+
((_b = options.ignoreEvents) === null || _b === void 0 ? void 0 : _b.includes((_c = data.analytics) === null || _c === void 0 ? void 0 : _c.type))) {
|
|
35719
35801
|
return;
|
|
35720
35802
|
}
|
|
35721
|
-
|
|
35722
|
-
|
|
35723
|
-
|
|
35724
|
-
|
|
35803
|
+
switch (options.type) {
|
|
35804
|
+
case "ua":
|
|
35805
|
+
sendUaAnalyticsEvent(data, options);
|
|
35806
|
+
break;
|
|
35807
|
+
case "ga4":
|
|
35808
|
+
sendGa4AnalyticsEvent(data, options);
|
|
35809
|
+
break;
|
|
35810
|
+
case "debug":
|
|
35811
|
+
processDebugEvent(data);
|
|
35812
|
+
break;
|
|
35813
|
+
default:
|
|
35814
|
+
sendUaAnalyticsEvent(data, options);
|
|
35725
35815
|
}
|
|
35726
|
-
sendGa("send", "event", options.parentEventName, data.analytics.type, data.analytics.label);
|
|
35727
35816
|
}
|
|
35728
|
-
catch (
|
|
35817
|
+
catch (_d) {
|
|
35729
35818
|
console.error("Unable to send an event to google analytics");
|
|
35730
35819
|
}
|
|
35731
35820
|
};
|
|
35821
|
+
const sendUaAnalyticsEvent = (data, options) => {
|
|
35822
|
+
var _a, _b, _c, _d;
|
|
35823
|
+
const ga = window.ga;
|
|
35824
|
+
if (!ga) {
|
|
35825
|
+
console.error("Google Analytics object not found");
|
|
35826
|
+
return;
|
|
35827
|
+
}
|
|
35828
|
+
sendGa("send", "event", options.parentEventName, (_b = (_a = data.analytics) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : "", (_d = (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : "");
|
|
35829
|
+
};
|
|
35830
|
+
const sendGa4AnalyticsEvent = (data, options) => {
|
|
35831
|
+
var _a, _b, _c, _d;
|
|
35832
|
+
if (!window || !window.dataLayer) {
|
|
35833
|
+
console.error("dataLayer object not found.");
|
|
35834
|
+
return;
|
|
35835
|
+
}
|
|
35836
|
+
const sendItemTitle = data.searchQuery !== ((_a = data.analytics) === null || _a === void 0 ? void 0 : _a.label);
|
|
35837
|
+
const params = {
|
|
35838
|
+
search_text: data.searchQuery,
|
|
35839
|
+
item_title: sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined,
|
|
35840
|
+
};
|
|
35841
|
+
window.dataLayer.push(Object.assign({ event: (_d = (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : options.parentEventName }, params));
|
|
35842
|
+
};
|
|
35843
|
+
const processDebugEvent = (data) => {
|
|
35844
|
+
var _a, _b, _c;
|
|
35845
|
+
const sendItemTitle = data.searchQuery !== ((_a = data.analytics) === null || _a === void 0 ? void 0 : _a.label);
|
|
35846
|
+
const params = {
|
|
35847
|
+
event: (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.type,
|
|
35848
|
+
search_text: data.searchQuery,
|
|
35849
|
+
item_title: sendItemTitle ? (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.label : undefined,
|
|
35850
|
+
};
|
|
35851
|
+
console.debug("Analytics debug event:", params);
|
|
35852
|
+
};
|
|
35732
35853
|
const track = (queryKey, data = {}, options) => {
|
|
35733
|
-
if (!isTrackingEnabled()) {
|
|
35854
|
+
if (!isTrackingEnabled() || !data.searchQuery) {
|
|
35734
35855
|
return;
|
|
35735
35856
|
}
|
|
35736
35857
|
trackLupaEvent(queryKey, data, options);
|
|
@@ -36856,6 +36977,9 @@ let SearchResultsToolbar = class SearchResultsToolbar extends Vue$1 {
|
|
|
36856
36977
|
var _a, _b, _c;
|
|
36857
36978
|
return Boolean((_c = (_b = (_a = this.options.filters) === null || _a === void 0 ? void 0 : _a.currentFilters) === null || _b === void 0 ? void 0 : _b.mobileSidebar) === null || _c === void 0 ? void 0 : _c.showFilterCount);
|
|
36858
36979
|
}
|
|
36980
|
+
get hasResults() {
|
|
36981
|
+
return this.searchResult.total > 0;
|
|
36982
|
+
}
|
|
36859
36983
|
};
|
|
36860
36984
|
__decorate([
|
|
36861
36985
|
Prop({ default: () => ({ labels: {} }) })
|
|
@@ -36904,65 +37028,72 @@ var __vue_render__$f = function () {
|
|
|
36904
37028
|
var _vm = this;
|
|
36905
37029
|
var _h = _vm.$createElement;
|
|
36906
37030
|
var _c = _vm._self._c || _h;
|
|
36907
|
-
return _c(
|
|
36908
|
-
|
|
36909
|
-
|
|
36910
|
-
{
|
|
36911
|
-
|
|
36912
|
-
|
|
36913
|
-
|
|
36914
|
-
|
|
36915
|
-
|
|
36916
|
-
|
|
36917
|
-
|
|
36918
|
-
|
|
36919
|
-
|
|
36920
|
-
|
|
36921
|
-
|
|
36922
|
-
|
|
36923
|
-
|
|
36924
|
-
|
|
36925
|
-
|
|
36926
|
-
|
|
36927
|
-
|
|
36928
|
-
|
|
36929
|
-
|
|
36930
|
-
|
|
36931
|
-
|
|
36932
|
-
|
|
36933
|
-
|
|
36934
|
-
|
|
36935
|
-
|
|
36936
|
-
|
|
36937
|
-
|
|
36938
|
-
|
|
36939
|
-
|
|
36940
|
-
|
|
36941
|
-
|
|
36942
|
-
|
|
36943
|
-
|
|
36944
|
-
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
|
|
36948
|
-
|
|
36949
|
-
|
|
36950
|
-
|
|
36951
|
-
|
|
36952
|
-
|
|
36953
|
-
|
|
36954
|
-
|
|
36955
|
-
|
|
36956
|
-
|
|
36957
|
-
|
|
36958
|
-
|
|
36959
|
-
|
|
36960
|
-
|
|
36961
|
-
|
|
36962
|
-
|
|
36963
|
-
|
|
36964
|
-
|
|
36965
|
-
|
|
37031
|
+
return _c(
|
|
37032
|
+
"div",
|
|
37033
|
+
{
|
|
37034
|
+
class: { "lupa-filter-no-results": !_vm.hasResults },
|
|
37035
|
+
attrs: { id: "lupa-search-results-toolbar" },
|
|
37036
|
+
},
|
|
37037
|
+
[
|
|
37038
|
+
_c(
|
|
37039
|
+
"div",
|
|
37040
|
+
{ staticClass: "lupa-toolbar-left" },
|
|
37041
|
+
[
|
|
37042
|
+
_vm.showLayoutSelection
|
|
37043
|
+
? _c("SearchResultsLayoutSelection")
|
|
37044
|
+
: _c("div"),
|
|
37045
|
+
_vm._v(" "),
|
|
37046
|
+
_vm.showItemSummary
|
|
37047
|
+
? _c("SearchResultsSummary", {
|
|
37048
|
+
attrs: {
|
|
37049
|
+
label: _vm.searchSummaryLabel,
|
|
37050
|
+
clearable: _vm.hasAnyFilter && _vm.showFilterClear,
|
|
37051
|
+
},
|
|
37052
|
+
on: { clear: _vm.handleClearAll },
|
|
37053
|
+
})
|
|
37054
|
+
: _c("div"),
|
|
37055
|
+
_vm._v(" "),
|
|
37056
|
+
_vm.displayPageSelect
|
|
37057
|
+
? _c("SearchResultsPageSelect", {
|
|
37058
|
+
attrs: {
|
|
37059
|
+
options: _vm.paginationOptions.pageSelect,
|
|
37060
|
+
"last-page-label": _vm.paginationOptions.labels.showMore,
|
|
37061
|
+
"first-page-label": _vm.paginationOptions.labels.showLess,
|
|
37062
|
+
},
|
|
37063
|
+
})
|
|
37064
|
+
: _c("div"),
|
|
37065
|
+
],
|
|
37066
|
+
1
|
|
37067
|
+
),
|
|
37068
|
+
_vm._v(" "),
|
|
37069
|
+
_c(
|
|
37070
|
+
"div",
|
|
37071
|
+
{ staticClass: "lupa-toolbar-right" },
|
|
37072
|
+
[
|
|
37073
|
+
_c("SearchResultsMobileToggle", {
|
|
37074
|
+
attrs: {
|
|
37075
|
+
label: _vm.options.labels.mobileFilterButton,
|
|
37076
|
+
"show-filter-count": _vm.showMobileFilterCount,
|
|
37077
|
+
},
|
|
37078
|
+
}),
|
|
37079
|
+
_vm._v(" "),
|
|
37080
|
+
_vm.paginationDisplay.pageSize
|
|
37081
|
+
? _c("SearchResultsPageSize", {
|
|
37082
|
+
attrs: {
|
|
37083
|
+
options: _vm.paginationOptions.pageSize,
|
|
37084
|
+
label: _vm.paginationOptions.labels.pageSize,
|
|
37085
|
+
},
|
|
37086
|
+
})
|
|
37087
|
+
: _c("div"),
|
|
37088
|
+
_vm._v(" "),
|
|
37089
|
+
_vm.sortOptions
|
|
37090
|
+
? _c("SearchResultsSort", { attrs: { options: _vm.sortOptions } })
|
|
37091
|
+
: _c("div"),
|
|
37092
|
+
],
|
|
37093
|
+
1
|
|
37094
|
+
),
|
|
37095
|
+
]
|
|
37096
|
+
)
|
|
36966
37097
|
};
|
|
36967
37098
|
var __vue_staticRenderFns__$f = [];
|
|
36968
37099
|
__vue_render__$f._withStripped = true;
|
|
@@ -37024,7 +37155,7 @@ __vue_render__$e._withStripped = true;
|
|
|
37024
37155
|
/* style */
|
|
37025
37156
|
const __vue_inject_styles__$e = function (inject) {
|
|
37026
37157
|
if (!inject) return
|
|
37027
|
-
inject("data-v-
|
|
37158
|
+
inject("data-v-3353d3a1_0", { source: ".lupa-spinner {\n color: #555555;\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n padding-top: 100px;\n padding-right: 72px;\n}\n.lupa-spinner div {\n transform-origin: 40px 40px;\n animation: lupa-spinner 1.2s linear infinite;\n}\n.lupa-spinner div:after {\n content: \" \";\n display: block;\n position: absolute;\n top: 3px;\n left: 37px;\n width: 6px;\n height: 18px;\n border-radius: 20%;\n background: #555555;\n}\n.lupa-spinner div:nth-child(1) {\n transform: rotate(0deg);\n animation-delay: -1.1s;\n}\n.lupa-spinner div:nth-child(2) {\n transform: rotate(30deg);\n animation-delay: -1s;\n}\n.lupa-spinner div:nth-child(3) {\n transform: rotate(60deg);\n animation-delay: -0.9s;\n}\n.lupa-spinner div:nth-child(4) {\n transform: rotate(90deg);\n animation-delay: -0.8s;\n}\n.lupa-spinner div:nth-child(5) {\n transform: rotate(120deg);\n animation-delay: -0.7s;\n}\n.lupa-spinner div:nth-child(6) {\n transform: rotate(150deg);\n animation-delay: -0.6s;\n}\n.lupa-spinner div:nth-child(7) {\n transform: rotate(180deg);\n animation-delay: -0.5s;\n}\n.lupa-spinner div:nth-child(8) {\n transform: rotate(210deg);\n animation-delay: -0.4s;\n}\n.lupa-spinner div:nth-child(9) {\n transform: rotate(240deg);\n animation-delay: -0.3s;\n}\n.lupa-spinner div:nth-child(10) {\n transform: rotate(270deg);\n animation-delay: -0.2s;\n}\n.lupa-spinner div:nth-child(11) {\n transform: rotate(300deg);\n animation-delay: -0.1s;\n}\n.lupa-spinner div:nth-child(12) {\n transform: rotate(330deg);\n animation-delay: 0s;\n}\n@keyframes lupa-spinner {\n0% {\n opacity: 1;\n}\n100% {\n opacity: 0;\n}\n}\n.lupa-spinner-wrapper {\n width: 100%;\n overflow: hidden;\n}", map: undefined, media: undefined });
|
|
37028
37159
|
|
|
37029
37160
|
};
|
|
37030
37161
|
/* scoped */
|
|
@@ -37397,6 +37528,7 @@ let SearchResultsProducts = class SearchResultsProducts extends Vue$1 {
|
|
|
37397
37528
|
"labels",
|
|
37398
37529
|
"queryKey",
|
|
37399
37530
|
"idKey",
|
|
37531
|
+
"titleKey",
|
|
37400
37532
|
"routingBehavior",
|
|
37401
37533
|
]);
|
|
37402
37534
|
}
|
|
@@ -37797,6 +37929,10 @@ let SearchResultsTitle = class SearchResultsTitle extends Vue$1 {
|
|
|
37797
37929
|
var _a, _b;
|
|
37798
37930
|
return (_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.descriptionTop;
|
|
37799
37931
|
}
|
|
37932
|
+
get summaryLabel() {
|
|
37933
|
+
var _a, _b;
|
|
37934
|
+
return (_b = (_a = this.options.labels) === null || _a === void 0 ? void 0 : _a.itemCount) !== null && _b !== void 0 ? _b : "";
|
|
37935
|
+
}
|
|
37800
37936
|
getLabel(label) {
|
|
37801
37937
|
return addParamsToLabel(label, `'${this.currentQueryText}'`);
|
|
37802
37938
|
}
|
|
@@ -37807,6 +37943,9 @@ __decorate([
|
|
|
37807
37943
|
__decorate([
|
|
37808
37944
|
Prop({ default: false })
|
|
37809
37945
|
], SearchResultsTitle.prototype, "isProductList", void 0);
|
|
37946
|
+
__decorate([
|
|
37947
|
+
Prop({ default: false })
|
|
37948
|
+
], SearchResultsTitle.prototype, "showSummary", void 0);
|
|
37810
37949
|
__decorate([
|
|
37811
37950
|
searchResult$2.Getter("currentQueryText")
|
|
37812
37951
|
], SearchResultsTitle.prototype, "currentQueryText", void 0);
|
|
@@ -37819,6 +37958,9 @@ __decorate([
|
|
|
37819
37958
|
SearchResultsTitle = __decorate([
|
|
37820
37959
|
Component({
|
|
37821
37960
|
name: "SearchResultsTitle",
|
|
37961
|
+
components: {
|
|
37962
|
+
SearchResultsSummary: __vue_component__$h,
|
|
37963
|
+
},
|
|
37822
37964
|
})
|
|
37823
37965
|
], SearchResultsTitle);
|
|
37824
37966
|
var script$8 = SearchResultsTitle;
|
|
@@ -37831,36 +37973,44 @@ var __vue_render__$8 = function () {
|
|
|
37831
37973
|
var _vm = this;
|
|
37832
37974
|
var _h = _vm.$createElement;
|
|
37833
37975
|
var _c = _vm._self._c || _h;
|
|
37834
|
-
return _c(
|
|
37835
|
-
|
|
37836
|
-
|
|
37837
|
-
|
|
37838
|
-
|
|
37839
|
-
|
|
37840
|
-
|
|
37841
|
-
|
|
37842
|
-
|
|
37843
|
-
|
|
37844
|
-
|
|
37845
|
-
|
|
37846
|
-
|
|
37847
|
-
|
|
37848
|
-
|
|
37849
|
-
|
|
37850
|
-
|
|
37851
|
-
|
|
37852
|
-
|
|
37853
|
-
|
|
37854
|
-
|
|
37855
|
-
|
|
37856
|
-
|
|
37857
|
-
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37976
|
+
return _c(
|
|
37977
|
+
"div",
|
|
37978
|
+
[
|
|
37979
|
+
_vm.showSearchTitle
|
|
37980
|
+
? _c(
|
|
37981
|
+
"h1",
|
|
37982
|
+
{
|
|
37983
|
+
staticClass: "lupa-result-page-title",
|
|
37984
|
+
attrs: { "data-cy": "lupa-result-page-title" },
|
|
37985
|
+
},
|
|
37986
|
+
[
|
|
37987
|
+
_vm._v("\n " + _vm._s(_vm.options.labels.searchResults)),
|
|
37988
|
+
_vm.queryText
|
|
37989
|
+
? _c("span", [_vm._v("'" + _vm._s(_vm.queryText) + "'")])
|
|
37990
|
+
: _vm._e(),
|
|
37991
|
+
_vm._v(" "),
|
|
37992
|
+
_vm.showProductCount
|
|
37993
|
+
? _c("span", { staticClass: "lupa-results-total-count" }, [
|
|
37994
|
+
_vm._v("(" + _vm._s(_vm.totalItems) + ")"),
|
|
37995
|
+
])
|
|
37996
|
+
: _vm._e(),
|
|
37997
|
+
]
|
|
37998
|
+
)
|
|
37999
|
+
: _vm._e(),
|
|
38000
|
+
_vm._v(" "),
|
|
38001
|
+
_vm.showSummary
|
|
38002
|
+
? _c("SearchResultsSummary", { attrs: { label: _vm.summaryLabel } })
|
|
38003
|
+
: _vm._e(),
|
|
38004
|
+
_vm._v(" "),
|
|
38005
|
+
_vm.descriptionTop
|
|
38006
|
+
? _c("div", {
|
|
38007
|
+
staticClass: "lupa-result-page-description-top",
|
|
38008
|
+
domProps: { innerHTML: _vm._s(_vm.descriptionTop) },
|
|
38009
|
+
})
|
|
38010
|
+
: _vm._e(),
|
|
38011
|
+
],
|
|
38012
|
+
1
|
|
38013
|
+
)
|
|
37864
38014
|
};
|
|
37865
38015
|
var __vue_staticRenderFns__$8 = [];
|
|
37866
38016
|
__vue_render__$8._withStripped = true;
|
|
@@ -38083,7 +38233,11 @@ let SearchResults = class SearchResults extends Vue$1 {
|
|
|
38083
38233
|
this.query(getPublicQuery(publicQuery, this.initialFilters, this.isProductList));
|
|
38084
38234
|
}
|
|
38085
38235
|
query(publicQuery) {
|
|
38086
|
-
this.trackSearch({
|
|
38236
|
+
this.trackSearch({
|
|
38237
|
+
queryKey: this.options.queryKey,
|
|
38238
|
+
query: publicQuery,
|
|
38239
|
+
type: "search_form_submit",
|
|
38240
|
+
});
|
|
38087
38241
|
const context = getLupaTrackingContext();
|
|
38088
38242
|
const limit = publicQuery.limit || this.defaultSearchResultPageSize;
|
|
38089
38243
|
const query = Object.assign(Object.assign(Object.assign({}, publicQuery), context), { limit });
|
|
@@ -38137,6 +38291,9 @@ __decorate([
|
|
|
38137
38291
|
__decorate([
|
|
38138
38292
|
Prop({ default: false })
|
|
38139
38293
|
], SearchResults.prototype, "isProductList", void 0);
|
|
38294
|
+
__decorate([
|
|
38295
|
+
Prop({ default: false })
|
|
38296
|
+
], SearchResults.prototype, "isContainer", void 0);
|
|
38140
38297
|
__decorate([
|
|
38141
38298
|
searchResult$1.Getter("currentQueryText")
|
|
38142
38299
|
], SearchResults.prototype, "currentQueryText", void 0);
|
|
@@ -38220,6 +38377,29 @@ var __vue_render__$6 = function () {
|
|
|
38220
38377
|
"div",
|
|
38221
38378
|
{ staticClass: "lupa-search-result-wrapper" },
|
|
38222
38379
|
[
|
|
38380
|
+
_vm.isContainer
|
|
38381
|
+
? [
|
|
38382
|
+
_c(
|
|
38383
|
+
"div",
|
|
38384
|
+
{ staticClass: "lupa-container-title-summary-mobile" },
|
|
38385
|
+
[
|
|
38386
|
+
_c("SearchResultsDidYouMean", {
|
|
38387
|
+
attrs: { labels: _vm.didYouMeanLabels },
|
|
38388
|
+
}),
|
|
38389
|
+
_vm._v(" "),
|
|
38390
|
+
_c("SearchResultsTitle", {
|
|
38391
|
+
attrs: {
|
|
38392
|
+
"show-summary": true,
|
|
38393
|
+
options: _vm.options,
|
|
38394
|
+
"is-product-list": _vm.isProductList,
|
|
38395
|
+
},
|
|
38396
|
+
}),
|
|
38397
|
+
],
|
|
38398
|
+
1
|
|
38399
|
+
),
|
|
38400
|
+
]
|
|
38401
|
+
: _vm._e(),
|
|
38402
|
+
_vm._v(" "),
|
|
38223
38403
|
_vm.isTitleResultTopPosition
|
|
38224
38404
|
? _c("CategoryTopFilters", { attrs: { options: _vm.options } })
|
|
38225
38405
|
: _vm._e(),
|
|
@@ -38755,7 +38935,10 @@ var __vue_render__$1 = function () {
|
|
|
38755
38935
|
_vm._v(" "),
|
|
38756
38936
|
_c("SearchResults", {
|
|
38757
38937
|
ref: "searchResults",
|
|
38758
|
-
attrs: {
|
|
38938
|
+
attrs: {
|
|
38939
|
+
options: _vm.fullSearchResultsOptions,
|
|
38940
|
+
"is-container": true,
|
|
38941
|
+
},
|
|
38759
38942
|
}),
|
|
38760
38943
|
],
|
|
38761
38944
|
1
|
|
@@ -38867,13 +39050,19 @@ var __vue_render__ = function () {
|
|
|
38867
39050
|
var _vm = this;
|
|
38868
39051
|
var _h = _vm.$createElement;
|
|
38869
39052
|
var _c = _vm._self._c || _h;
|
|
38870
|
-
return
|
|
38871
|
-
|
|
38872
|
-
|
|
38873
|
-
|
|
38874
|
-
|
|
38875
|
-
|
|
38876
|
-
|
|
39053
|
+
return _c(
|
|
39054
|
+
"div",
|
|
39055
|
+
[
|
|
39056
|
+
_vm.isOpen
|
|
39057
|
+
? _c("SearchContainer", {
|
|
39058
|
+
ref: "productList",
|
|
39059
|
+
attrs: { options: _vm.containerOptions },
|
|
39060
|
+
on: { "hook:mounted": _vm.focus, close: _vm.close },
|
|
39061
|
+
})
|
|
39062
|
+
: _vm._e(),
|
|
39063
|
+
],
|
|
39064
|
+
1
|
|
39065
|
+
)
|
|
38877
39066
|
};
|
|
38878
39067
|
var __vue_staticRenderFns__ = [];
|
|
38879
39068
|
__vue_render__._withStripped = true;
|
|
@@ -39349,6 +39538,7 @@ let SearchBoxModule = class SearchBoxModule extends VuexModule {
|
|
|
39349
39538
|
link: generateLink((_b = panel.links) === null || _b === void 0 ? void 0 : _b.details, doc),
|
|
39350
39539
|
queryKey: panel.queryKey,
|
|
39351
39540
|
id: panel.idKey ? doc[panel.idKey] : "",
|
|
39541
|
+
title: panel.titleKey ? doc[panel.titleKey] : "",
|
|
39352
39542
|
};
|
|
39353
39543
|
}
|
|
39354
39544
|
saveSuggestions({ queryKey, suggestions, inputValue, }) {
|
|
@@ -39825,11 +40015,6 @@ let ParamsModule = class ParamsModule extends VuexModule {
|
|
|
39825
40015
|
const routing = (_a = this.context.rootGetters["options/boxRoutingBehavior"]) !== null && _a !== void 0 ? _a : "direct-link";
|
|
39826
40016
|
redirectToResultsPage(this.searchResultsLink, searchText, facet, routing);
|
|
39827
40017
|
}
|
|
39828
|
-
this.context.dispatch("tracking/track", {
|
|
39829
|
-
data: {
|
|
39830
|
-
analytics: { type: "search_form_submit", label: searchText },
|
|
39831
|
-
},
|
|
39832
|
-
}, { root: true });
|
|
39833
40018
|
}
|
|
39834
40019
|
appendParams({ params, paramsToRemove, encode = true, save = true, searchResultsLink, }) {
|
|
39835
40020
|
if (!(params === null || params === void 0 ? void 0 : params.length)) {
|
|
@@ -39980,22 +40165,23 @@ const getSearchTrackingData = (searchText, type) => {
|
|
|
39980
40165
|
};
|
|
39981
40166
|
};
|
|
39982
40167
|
let TrackingModule = class TrackingModule extends VuexModule {
|
|
39983
|
-
trackSearch({ queryKey, query, }) {
|
|
40168
|
+
trackSearch({ queryKey, query, type = "search_query", }) {
|
|
39984
40169
|
var _a, _b;
|
|
39985
40170
|
const options = (_a = this.context.rootGetters["options/envOptions"]) !== null && _a !== void 0 ? _a : {};
|
|
39986
40171
|
const hasFilters = Object.keys((_b = query.filters) !== null && _b !== void 0 ? _b : {}).length > 0;
|
|
39987
40172
|
if (hasFilters) {
|
|
39988
|
-
const data = getSearchTrackingData(query.searchText, "
|
|
40173
|
+
const data = getSearchTrackingData(query.searchText, "search_filters");
|
|
39989
40174
|
track(queryKey, data, options);
|
|
40175
|
+
return;
|
|
39990
40176
|
}
|
|
39991
|
-
const data = getSearchTrackingData(query.searchText,
|
|
40177
|
+
const data = getSearchTrackingData(query.searchText, type);
|
|
39992
40178
|
track(queryKey, data, options);
|
|
39993
40179
|
}
|
|
39994
40180
|
trackResults({ queryKey, results, }) {
|
|
39995
40181
|
var _a;
|
|
39996
40182
|
const options = (_a = this.context.rootGetters["options/envOptions"]) !== null && _a !== void 0 ? _a : {};
|
|
39997
40183
|
if (results.total < 1) {
|
|
39998
|
-
const data = getSearchTrackingData(results.searchText, "
|
|
40184
|
+
const data = getSearchTrackingData(results.searchText, "search_zero_results");
|
|
39999
40185
|
track(queryKey, data, options);
|
|
40000
40186
|
}
|
|
40001
40187
|
}
|
|
@@ -40032,6 +40218,30 @@ var store = new Vuex.Store({
|
|
|
40032
40218
|
},
|
|
40033
40219
|
});
|
|
40034
40220
|
|
|
40221
|
+
const attatchShadowDom = ({ host, manager, styleUrl, }) => {
|
|
40222
|
+
const link = document.createElement("link");
|
|
40223
|
+
link.type = "text/css";
|
|
40224
|
+
link.rel = "stylesheet";
|
|
40225
|
+
link.href = styleUrl;
|
|
40226
|
+
// Fonts only work when added in host document head
|
|
40227
|
+
const linkNode = document.createElement("link");
|
|
40228
|
+
linkNode.type = "text/css";
|
|
40229
|
+
linkNode.rel = "stylesheet";
|
|
40230
|
+
linkNode.href =
|
|
40231
|
+
"https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
|
|
40232
|
+
document.head.appendChild(linkNode);
|
|
40233
|
+
// Add font for material icons
|
|
40234
|
+
const linkNode2 = document.createElement("link");
|
|
40235
|
+
linkNode2.type = "text/css";
|
|
40236
|
+
linkNode2.rel = "stylesheet";
|
|
40237
|
+
linkNode2.href =
|
|
40238
|
+
"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
|
|
40239
|
+
document.head.appendChild(linkNode2);
|
|
40240
|
+
const shadow = host.attachShadow({ mode: "open" });
|
|
40241
|
+
shadow.appendChild(manager);
|
|
40242
|
+
shadow.appendChild(link);
|
|
40243
|
+
};
|
|
40244
|
+
|
|
40035
40245
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
40036
40246
|
const app = {
|
|
40037
40247
|
box: {},
|
|
@@ -40115,6 +40325,7 @@ const productList = (options, mountOptions) => {
|
|
|
40115
40325
|
app.productList[options.containerSelector] = instance;
|
|
40116
40326
|
};
|
|
40117
40327
|
const searchContainer = (options, mountOptions) => {
|
|
40328
|
+
var _a;
|
|
40118
40329
|
const existingInstance = app.productList[options.trigger];
|
|
40119
40330
|
if (existingInstance) {
|
|
40120
40331
|
existingInstance.productListOptions = options;
|
|
@@ -40127,13 +40338,21 @@ const searchContainer = (options, mountOptions) => {
|
|
|
40127
40338
|
return;
|
|
40128
40339
|
}
|
|
40129
40340
|
Vue$1.use(Vuex);
|
|
40130
|
-
const id =
|
|
40131
|
-
const
|
|
40132
|
-
|
|
40133
|
-
document.
|
|
40341
|
+
const id = "lupa-search-container-manager";
|
|
40342
|
+
const shadowId = "lupa-shadow-id";
|
|
40343
|
+
const host = document.createElement("div");
|
|
40344
|
+
const manager = document.createElement("div");
|
|
40345
|
+
host.setAttribute("id", shadowId);
|
|
40346
|
+
manager.setAttribute("id", id);
|
|
40347
|
+
attatchShadowDom({
|
|
40348
|
+
host,
|
|
40349
|
+
manager,
|
|
40350
|
+
styleUrl: (_a = options.styleLink) !== null && _a !== void 0 ? _a : DEFAULT_CONTAINER_STYLE,
|
|
40351
|
+
});
|
|
40352
|
+
document.body.appendChild(host);
|
|
40134
40353
|
const SearchContainerEntryComponent = Vue$1.component("SearchContainerEntry", __vue_component__);
|
|
40135
40354
|
const instance = new SearchContainerEntryComponent({
|
|
40136
|
-
el:
|
|
40355
|
+
el: manager,
|
|
40137
40356
|
propsData: { searchContainerOptions: options },
|
|
40138
40357
|
store,
|
|
40139
40358
|
});
|