@searchstax-inc/searchstudio-ux-angular 1.2.53 → 4.1.0
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/CHANGELOG.md +16 -1
- package/README.md +1224 -687
- package/package.json +5 -2
- package/esm2022/lib/components/searchstax-input/searchstax-input.component.mjs +0 -115
- package/esm2022/lib/components/searchstax-results/searchstax-results.component.mjs +0 -83
- package/esm2022/lib/components/searchstax-search-answer/searchstax-search-answer.component.mjs +0 -46
- package/esm2022/lib/components/searchstax-search-external/searchstax-search-external.component.mjs +0 -40
- package/esm2022/lib/components/searchstax-search-facets/searchstax-search-facets.component.mjs +0 -112
- package/esm2022/lib/components/searchstax-search-location/searchstax-search-location.component.mjs +0 -92
- package/esm2022/lib/components/searchstax-search-overview/searchstax-search-overview.component.mjs +0 -41
- package/esm2022/lib/components/searchstax-search-pagination/searchstax-search-pagination.component.mjs +0 -62
- package/esm2022/lib/components/searchstax-search-related/searchstax-search-related.component.mjs +0 -44
- package/esm2022/lib/components/searchstax-search-sorting/searchstax-search-sorting.component.mjs +0 -46
- package/esm2022/lib/components/searchstax-wrapper.component.mjs +0 -93
- package/esm2022/lib/searchstudio-ux-angular.module.mjs +0 -73
- package/esm2022/lib/services/store-service.service.mjs +0 -17
- package/esm2022/public-api.mjs +0 -17
- package/esm2022/searchstax-inc-searchstudio-ux-angular.mjs +0 -5
- package/fesm2022/searchstax-inc-searchstudio-ux-angular.mjs +0 -818
- package/fesm2022/searchstax-inc-searchstudio-ux-angular.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/searchstax-input/searchstax-input.component.d.ts +0 -27
- package/lib/components/searchstax-results/searchstax-results.component.d.ts +0 -26
- package/lib/components/searchstax-search-answer/searchstax-search-answer.component.d.ts +0 -19
- package/lib/components/searchstax-search-external/searchstax-search-external.component.d.ts +0 -17
- package/lib/components/searchstax-search-facets/searchstax-search-facets.component.d.ts +0 -37
- package/lib/components/searchstax-search-location/searchstax-search-location.component.d.ts +0 -33
- package/lib/components/searchstax-search-overview/searchstax-search-overview.component.d.ts +0 -17
- package/lib/components/searchstax-search-pagination/searchstax-search-pagination.component.d.ts +0 -21
- package/lib/components/searchstax-search-related/searchstax-search-related.component.d.ts +0 -19
- package/lib/components/searchstax-search-sorting/searchstax-search-sorting.component.d.ts +0 -18
- package/lib/components/searchstax-wrapper.component.d.ts +0 -31
- package/lib/searchstudio-ux-angular.module.d.ts +0 -19
- package/lib/services/store-service.service.d.ts +0 -8
- package/public-api.d.ts +0 -13
|
@@ -1,818 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, Output, Input, Component, NgModule } from '@angular/core';
|
|
3
|
-
import { Searchstax } from '@searchstax-inc/searchstudio-ux-js';
|
|
4
|
-
import * as i2 from '@angular/common';
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
import * as i3 from '@angular/forms';
|
|
7
|
-
import { FormsModule } from '@angular/forms';
|
|
8
|
-
|
|
9
|
-
class StoreServiceService {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.searchstax = new Searchstax('vue');
|
|
12
|
-
}
|
|
13
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StoreServiceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
14
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StoreServiceService, providedIn: 'root' }); }
|
|
15
|
-
}
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StoreServiceService, decorators: [{
|
|
17
|
-
type: Injectable,
|
|
18
|
-
args: [{
|
|
19
|
-
providedIn: 'root'
|
|
20
|
-
}]
|
|
21
|
-
}], ctorParameters: () => [] });
|
|
22
|
-
|
|
23
|
-
class SearchstaxWrapper {
|
|
24
|
-
constructor(storeServiceService) {
|
|
25
|
-
this.storeServiceService = storeServiceService;
|
|
26
|
-
this.language = 'en';
|
|
27
|
-
this.model = '';
|
|
28
|
-
this.searchURL = '';
|
|
29
|
-
this.suggesterURL = '';
|
|
30
|
-
this.trackApiKey = '';
|
|
31
|
-
this.searchAuth = '';
|
|
32
|
-
this.analyticsBaseUrl = '';
|
|
33
|
-
this.analyticsSrc = '';
|
|
34
|
-
this.questionURL = '';
|
|
35
|
-
this.authType = 'basic';
|
|
36
|
-
this.autoCorrect = true;
|
|
37
|
-
this.initialized = new EventEmitter();
|
|
38
|
-
this.hooks = {};
|
|
39
|
-
}
|
|
40
|
-
ngOnInit() {
|
|
41
|
-
if (this.beforeSearch) {
|
|
42
|
-
this.hooks.beforeSearch = this.beforeSearch;
|
|
43
|
-
}
|
|
44
|
-
if (this.afterSearch) {
|
|
45
|
-
this.hooks.afterSearch = this.afterSearch;
|
|
46
|
-
}
|
|
47
|
-
this.storeServiceService.searchstax.initialize({
|
|
48
|
-
language: this.language,
|
|
49
|
-
model: this.model,
|
|
50
|
-
searchURL: this.searchURL,
|
|
51
|
-
suggesterURL: this.suggesterURL,
|
|
52
|
-
trackApiKey: this.trackApiKey,
|
|
53
|
-
searchAuth: this.searchAuth,
|
|
54
|
-
authType: this.authType,
|
|
55
|
-
autoCorrect: this.autoCorrect,
|
|
56
|
-
router: this.router,
|
|
57
|
-
hooks: this.hooks,
|
|
58
|
-
analyticsBaseUrl: this.analyticsBaseUrl,
|
|
59
|
-
analyticsSrc: this.analyticsSrc,
|
|
60
|
-
sessionId: this.sessionId,
|
|
61
|
-
questionURL: this.questionURL
|
|
62
|
-
});
|
|
63
|
-
this.initialized.emit(this.storeServiceService.searchstax);
|
|
64
|
-
}
|
|
65
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxWrapper, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
66
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxWrapper, selector: "app-searchstax-wrapper", inputs: { language: "language", model: "model", searchURL: "searchURL", suggesterURL: "suggesterURL", trackApiKey: "trackApiKey", searchAuth: "searchAuth", sessionId: "sessionId", analyticsBaseUrl: "analyticsBaseUrl", analyticsSrc: "analyticsSrc", questionURL: "questionURL", authType: "authType", autoCorrect: "autoCorrect", router: "router", beforeSearch: "beforeSearch", afterSearch: "afterSearch" }, outputs: { initialized: "initialized" }, ngImport: i0, template: `
|
|
67
|
-
<div>
|
|
68
|
-
<ng-content></ng-content>
|
|
69
|
-
</div>
|
|
70
|
-
`, isInline: true }); }
|
|
71
|
-
}
|
|
72
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxWrapper, decorators: [{
|
|
73
|
-
type: Component,
|
|
74
|
-
args: [{ selector: 'app-searchstax-wrapper', template: `
|
|
75
|
-
<div>
|
|
76
|
-
<ng-content></ng-content>
|
|
77
|
-
</div>
|
|
78
|
-
` }]
|
|
79
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { language: [{
|
|
80
|
-
type: Input
|
|
81
|
-
}], model: [{
|
|
82
|
-
type: Input
|
|
83
|
-
}], searchURL: [{
|
|
84
|
-
type: Input
|
|
85
|
-
}], suggesterURL: [{
|
|
86
|
-
type: Input
|
|
87
|
-
}], trackApiKey: [{
|
|
88
|
-
type: Input
|
|
89
|
-
}], searchAuth: [{
|
|
90
|
-
type: Input
|
|
91
|
-
}], sessionId: [{
|
|
92
|
-
type: Input
|
|
93
|
-
}], analyticsBaseUrl: [{
|
|
94
|
-
type: Input
|
|
95
|
-
}], analyticsSrc: [{
|
|
96
|
-
type: Input
|
|
97
|
-
}], questionURL: [{
|
|
98
|
-
type: Input
|
|
99
|
-
}], authType: [{
|
|
100
|
-
type: Input
|
|
101
|
-
}], autoCorrect: [{
|
|
102
|
-
type: Input
|
|
103
|
-
}], router: [{
|
|
104
|
-
type: Input
|
|
105
|
-
}], beforeSearch: [{
|
|
106
|
-
type: Input
|
|
107
|
-
}], afterSearch: [{
|
|
108
|
-
type: Input
|
|
109
|
-
}], initialized: [{
|
|
110
|
-
type: Output
|
|
111
|
-
}] } });
|
|
112
|
-
|
|
113
|
-
class SearchstaxSearchLocationWidget {
|
|
114
|
-
constructor(storeServiceService) {
|
|
115
|
-
this.storeServiceService = storeServiceService;
|
|
116
|
-
this.locationData = null;
|
|
117
|
-
this.inputValue = "";
|
|
118
|
-
this.selectValue = "";
|
|
119
|
-
this.locationAdded = false;
|
|
120
|
-
this.locationError = false;
|
|
121
|
-
this.rand = Math.random();
|
|
122
|
-
this.context = this;
|
|
123
|
-
}
|
|
124
|
-
ngOnInit() {
|
|
125
|
-
if (this.storeServiceService.searchstax) {
|
|
126
|
-
this.attachObservables();
|
|
127
|
-
setTimeout(() => {
|
|
128
|
-
this.addWidget();
|
|
129
|
-
}, 100);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
throw Error("Searchstax instance needs to be passed via props");
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
locationBlur(context) {
|
|
136
|
-
context.storeServiceService.searchstax.searchLocationWidget?.triggerGeocoder(context.inputValue);
|
|
137
|
-
}
|
|
138
|
-
radiusChange(e, context) {
|
|
139
|
-
const target = e.target;
|
|
140
|
-
context.selectValue = target.value;
|
|
141
|
-
context.storeServiceService.searchstax.searchLocationWidget?.setRadiusValue(context.selectValue);
|
|
142
|
-
}
|
|
143
|
-
inputChange(e, context) {
|
|
144
|
-
const target = e.target;
|
|
145
|
-
context.inputValue = target.value;
|
|
146
|
-
}
|
|
147
|
-
getCurrentLocation(context) {
|
|
148
|
-
context.storeServiceService.searchstax.searchLocationWidget?.getCurrentLocation();
|
|
149
|
-
}
|
|
150
|
-
addWidget() {
|
|
151
|
-
if (!this.locationAdded &&
|
|
152
|
-
this.storeServiceService.searchstax.routerHelper) {
|
|
153
|
-
this.locationAdded = true;
|
|
154
|
-
this.storeServiceService.searchstax.addSearchLocationWidget("searchstax-location-container" + this.rand, {
|
|
155
|
-
hooks: {
|
|
156
|
-
locationDecode: this.locationDecode,
|
|
157
|
-
locationDecodeCoordinatesToAddress: this.locationDecodeCoordinatesToAddress,
|
|
158
|
-
},
|
|
159
|
-
locationSearchEnabled: this.locationSearchEnabled,
|
|
160
|
-
locationValuesOverride: this.locationValuesOverride,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
attachObservables() {
|
|
165
|
-
this.storeServiceService.searchstax.dataLayer.$locationWidgetTemplateData.subscribe((sortingData) => {
|
|
166
|
-
this.locationData = sortingData;
|
|
167
|
-
});
|
|
168
|
-
this.storeServiceService.searchstax.dataLayer.$searchObject.subscribe((result) => {
|
|
169
|
-
this.inputValue = result.location.address ?? "";
|
|
170
|
-
this.selectValue = result.location.radius || "";
|
|
171
|
-
});
|
|
172
|
-
this.storeServiceService.searchstax.dataLayer.$locationError.subscribe((locationError) => {
|
|
173
|
-
this.locationError = locationError;
|
|
174
|
-
});
|
|
175
|
-
this.storeServiceService.searchstax.dataLayer.$searchLocationChange.subscribe((location) => {
|
|
176
|
-
this.inputValue = location;
|
|
177
|
-
});
|
|
178
|
-
this.storeServiceService.searchstax.dataLayer.$searchRadiusChange.subscribe((radius) => {
|
|
179
|
-
this.selectValue = radius;
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchLocationWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
183
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxSearchLocationWidget, selector: "app-searchstax-search-location", inputs: { templateOverride: "templateOverride", locationSearchEnabled: "locationSearchEnabled", locationValuesOverride: "locationValuesOverride", locationDecode: "locationDecode", locationDecodeCoordinatesToAddress: "locationDecodeCoordinatesToAddress" }, ngImport: i0, template: "<div\n [id]=\"'searchstax-location-container' + rand\"\n class=\"searchstax-location-container\"\n>\n <div\n class=\"searchstax-location-input-container\"\n data-test-id=\"searchstax-location-input-container\"\n *ngIf=\"locationData && !templateOverride\"\n >\n <div class=\"searchstax-location-input-wrapper\">\n <span class=\"searchstax-location-input-label\">NEAR</span>\n <div class=\"searchstax-location-input-wrapper-inner\">\n <input\n type=\"text\"\n id=\"searchstax-location-input\"\n class=\"searchstax-location-input\"\n [ngClass]=\"{\n 'searchstax-input-location-error': locationError\n }\"\n placeholder=\"Zip, Postal Code or City...\"\n aria-label=\"Search Location Input\"\n data-test-id=\"searchstax-location-input\"\n [(ngModel)]=\"inputValue\"\n (blur)=\"locationBlur(context)\"\n />\n <button\n (click)=\"getCurrentLocation(context)\"\n class=\"searchstax-get-current-location-button\"\n >\n Use my current location\n </button>\n </div>\n <span\n *ngIf=\"locationData.shouldShowLocationDistanceDropdown\"\n class=\"searchstax-location-input-label\"\n >WITHIN</span\n >\n <select\n *ngIf=\"locationData.shouldShowLocationDistanceDropdown\"\n id=\"searchstax-location-radius-select\"\n class=\"searchstax-location-radius-select\"\n aria-label=\"Search Location Radius Select\"\n data-test-id=\"searchstax-location-radius-select\"\n (change)=\"radiusChange($event, context)\"\n [(ngModel)]=\"selectValue\"\n >\n <option\n *ngFor=\"let value of locationData.locationSearchDistanceValues\"\n [value]=\"value.value\"\n >\n {{ value.label }}\n </option>\n </select>\n </div>\n </div>\n\n <div *ngIf=\"locationData && templateOverride\">\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
|
|
184
|
-
}
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchLocationWidget, decorators: [{
|
|
186
|
-
type: Component,
|
|
187
|
-
args: [{ selector: "app-searchstax-search-location", template: "<div\n [id]=\"'searchstax-location-container' + rand\"\n class=\"searchstax-location-container\"\n>\n <div\n class=\"searchstax-location-input-container\"\n data-test-id=\"searchstax-location-input-container\"\n *ngIf=\"locationData && !templateOverride\"\n >\n <div class=\"searchstax-location-input-wrapper\">\n <span class=\"searchstax-location-input-label\">NEAR</span>\n <div class=\"searchstax-location-input-wrapper-inner\">\n <input\n type=\"text\"\n id=\"searchstax-location-input\"\n class=\"searchstax-location-input\"\n [ngClass]=\"{\n 'searchstax-input-location-error': locationError\n }\"\n placeholder=\"Zip, Postal Code or City...\"\n aria-label=\"Search Location Input\"\n data-test-id=\"searchstax-location-input\"\n [(ngModel)]=\"inputValue\"\n (blur)=\"locationBlur(context)\"\n />\n <button\n (click)=\"getCurrentLocation(context)\"\n class=\"searchstax-get-current-location-button\"\n >\n Use my current location\n </button>\n </div>\n <span\n *ngIf=\"locationData.shouldShowLocationDistanceDropdown\"\n class=\"searchstax-location-input-label\"\n >WITHIN</span\n >\n <select\n *ngIf=\"locationData.shouldShowLocationDistanceDropdown\"\n id=\"searchstax-location-radius-select\"\n class=\"searchstax-location-radius-select\"\n aria-label=\"Search Location Radius Select\"\n data-test-id=\"searchstax-location-radius-select\"\n (change)=\"radiusChange($event, context)\"\n [(ngModel)]=\"selectValue\"\n >\n <option\n *ngFor=\"let value of locationData.locationSearchDistanceValues\"\n [value]=\"value.value\"\n >\n {{ value.label }}\n </option>\n </select>\n </div>\n </div>\n\n <div *ngIf=\"locationData && templateOverride\">\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </div>\n</div>\n" }]
|
|
188
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { templateOverride: [{
|
|
189
|
-
type: Input
|
|
190
|
-
}], locationSearchEnabled: [{
|
|
191
|
-
type: Input
|
|
192
|
-
}], locationValuesOverride: [{
|
|
193
|
-
type: Input
|
|
194
|
-
}], locationDecode: [{
|
|
195
|
-
type: Input
|
|
196
|
-
}], locationDecodeCoordinatesToAddress: [{
|
|
197
|
-
type: Input
|
|
198
|
-
}] } });
|
|
199
|
-
|
|
200
|
-
class SearchstaxInputWidget {
|
|
201
|
-
constructor(storeServiceService) {
|
|
202
|
-
this.storeServiceService = storeServiceService;
|
|
203
|
-
this.searchInputId = "";
|
|
204
|
-
this.hooks = {};
|
|
205
|
-
this.suggestions = [];
|
|
206
|
-
this.context = this;
|
|
207
|
-
this.templateData = null;
|
|
208
|
-
}
|
|
209
|
-
ngOnInit() {
|
|
210
|
-
if (this.storeServiceService.searchstax) {
|
|
211
|
-
this.attachObservables();
|
|
212
|
-
// const hooks: { [key: string]: (prop: any) => any } = {}
|
|
213
|
-
if (this.afterAutosuggest) {
|
|
214
|
-
this.hooks["afterAutosuggest"] = this.afterAutosuggest;
|
|
215
|
-
}
|
|
216
|
-
if (this.beforeAutosuggest) {
|
|
217
|
-
this.hooks["beforeAutosuggest"] = this.beforeAutosuggest;
|
|
218
|
-
}
|
|
219
|
-
setTimeout(() => {
|
|
220
|
-
this.storeServiceService.searchstax.addSearchInputWidget("searchstax-input-container", {
|
|
221
|
-
suggestAfterMinChars: this.suggestAfterMinChars,
|
|
222
|
-
hooks: this.hooks,
|
|
223
|
-
templates: {
|
|
224
|
-
mainTemplate: {
|
|
225
|
-
template: ``,
|
|
226
|
-
searchInputId: this.searchInputId ?? "searchstax-search-input",
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
this.storeServiceService.searchstax.dataLayer.setInputTemplateRendered(true);
|
|
231
|
-
}, 100);
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
throw Error("Searchstax instance needs to be passed via props");
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
locationDecode(term) {
|
|
238
|
-
return new Promise((resolve) => {
|
|
239
|
-
// make a request to google geocoding API to retrieve lat, lon and address
|
|
240
|
-
const geocodingAPIKey = "AIzaSyDK5wQQaz7kmP60_DViAto5rTQ301eVBFs";
|
|
241
|
-
const geocodingURL = `https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURIComponent(term)}&key=${geocodingAPIKey}`;
|
|
242
|
-
fetch(geocodingURL)
|
|
243
|
-
.then((response) => response.json())
|
|
244
|
-
.then((data) => {
|
|
245
|
-
if (data.status === "OK" && data.results.length > 0) {
|
|
246
|
-
const result = data.results[0];
|
|
247
|
-
const location = {
|
|
248
|
-
lat: result.geometry.location.lat,
|
|
249
|
-
lon: result.geometry.location.lng,
|
|
250
|
-
address: result.formatted_address,
|
|
251
|
-
};
|
|
252
|
-
resolve(location);
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
resolve({
|
|
256
|
-
address: undefined,
|
|
257
|
-
lat: undefined,
|
|
258
|
-
lon: undefined,
|
|
259
|
-
error: true,
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
})
|
|
263
|
-
.catch(() => {
|
|
264
|
-
resolve({
|
|
265
|
-
address: undefined,
|
|
266
|
-
lat: undefined,
|
|
267
|
-
lon: undefined,
|
|
268
|
-
error: true,
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
onMouseLeave(context) {
|
|
274
|
-
context.storeServiceService.searchstax.searchInputWidget?.resetAutosuggestSelection();
|
|
275
|
-
context.storeServiceService.searchstax.searchInputWidget?.markActiveAutosuggestItem();
|
|
276
|
-
}
|
|
277
|
-
onMouseOver(suggestion, context) {
|
|
278
|
-
context.storeServiceService.searchstax.searchInputWidget?.onSuggestionEnter(suggestion);
|
|
279
|
-
}
|
|
280
|
-
onMouseClick(e, context) {
|
|
281
|
-
e.stopImmediatePropagation();
|
|
282
|
-
context.storeServiceService.searchstax.searchInputWidget?.suggestionChosen();
|
|
283
|
-
}
|
|
284
|
-
attachObservables() {
|
|
285
|
-
this.storeServiceService.searchstax.dataLayer.$autosuggestResults.subscribe((suggestions) => {
|
|
286
|
-
this.suggestions = suggestions?.suggestions ?? [];
|
|
287
|
-
});
|
|
288
|
-
this.storeServiceService.searchstax.dataLayer.$inputWidgetTemplateData.subscribe((data) => {
|
|
289
|
-
this.templateData = data;
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxInputWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
293
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxInputWidget, selector: "app-searchstax-input", inputs: { afterAutosuggest: "afterAutosuggest", beforeAutosuggest: "beforeAutosuggest", searchInputId: "searchInputId", suggestAfterMinChars: "suggestAfterMinChars", templateOverride: "templateOverride" }, ngImport: i0, template: "<div id=\"searchstax-input-container\">\n <div class=\"searchstax-search-input-container searchstax-search-input-container-new\" [class]=\"{ 'searchstax-alternative-render': !!templateData?.locationEnabled }\">\n <ng-container *ngIf=\"!templateOverride\">\n <div class=\"searchstax-search-input-wrapper\">\n <input\n type=\"text\"\n id=\"searchstax-search-input\"\n class=\"searchstax-search-input\"\n placeholder=\"SEARCH FOR...\"\n aria-label=\"search\"\n />\n <div\n class=\"searchstax-autosuggest-container\"\n [ngClass]=\"{ hidden: suggestions.length === 0 }\"\n (mouseleave)=\"(onMouseLeave)\"\n >\n <div\n class=\"searchstax-autosuggest-item\"\n *ngFor=\"let suggestion of suggestions\"\n >\n <div\n class=\"searchstax-autosuggest-item-term-container\"\n [innerHtml]=\"suggestion.term\"\n (mouseover)=\"onMouseOver(suggestion, context)\"\n tabindex=\"0\"\n (click)=\"onMouseClick($event, context)\"\n ></div>\n </div>\n </div>\n </div>\n <app-searchstax-search-location [locationDecode]=\"locationDecode\"></app-searchstax-search-location>\n <button\n class=\"searchstax-spinner-icon\"\n id=\"searchstax-search-input-action-button\"\n aria-label=\"search\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"templateOverride\">\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </ng-container>\n\n <!-- <slot\n name=\"input\"\n :suggestions=\"suggestions\"\n :onMouseClick=\"onMouseClick\"\n :onMouseOver=\"onMouseOver\"\n :onMouseLeave=\"onMouseLeave\"\n ></slot> -->\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SearchstaxSearchLocationWidget, selector: "app-searchstax-search-location", inputs: ["templateOverride", "locationSearchEnabled", "locationValuesOverride", "locationDecode", "locationDecodeCoordinatesToAddress"] }] }); }
|
|
294
|
-
}
|
|
295
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxInputWidget, decorators: [{
|
|
296
|
-
type: Component,
|
|
297
|
-
args: [{ selector: "app-searchstax-input", template: "<div id=\"searchstax-input-container\">\n <div class=\"searchstax-search-input-container searchstax-search-input-container-new\" [class]=\"{ 'searchstax-alternative-render': !!templateData?.locationEnabled }\">\n <ng-container *ngIf=\"!templateOverride\">\n <div class=\"searchstax-search-input-wrapper\">\n <input\n type=\"text\"\n id=\"searchstax-search-input\"\n class=\"searchstax-search-input\"\n placeholder=\"SEARCH FOR...\"\n aria-label=\"search\"\n />\n <div\n class=\"searchstax-autosuggest-container\"\n [ngClass]=\"{ hidden: suggestions.length === 0 }\"\n (mouseleave)=\"(onMouseLeave)\"\n >\n <div\n class=\"searchstax-autosuggest-item\"\n *ngFor=\"let suggestion of suggestions\"\n >\n <div\n class=\"searchstax-autosuggest-item-term-container\"\n [innerHtml]=\"suggestion.term\"\n (mouseover)=\"onMouseOver(suggestion, context)\"\n tabindex=\"0\"\n (click)=\"onMouseClick($event, context)\"\n ></div>\n </div>\n </div>\n </div>\n <app-searchstax-search-location [locationDecode]=\"locationDecode\"></app-searchstax-search-location>\n <button\n class=\"searchstax-spinner-icon\"\n id=\"searchstax-search-input-action-button\"\n aria-label=\"search\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"templateOverride\">\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </ng-container>\n\n <!-- <slot\n name=\"input\"\n :suggestions=\"suggestions\"\n :onMouseClick=\"onMouseClick\"\n :onMouseOver=\"onMouseOver\"\n :onMouseLeave=\"onMouseLeave\"\n ></slot> -->\n </div>\n</div>\n" }]
|
|
298
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { afterAutosuggest: [{
|
|
299
|
-
type: Input
|
|
300
|
-
}], beforeAutosuggest: [{
|
|
301
|
-
type: Input
|
|
302
|
-
}], searchInputId: [{
|
|
303
|
-
type: Input
|
|
304
|
-
}], suggestAfterMinChars: [{
|
|
305
|
-
type: Input
|
|
306
|
-
}], templateOverride: [{
|
|
307
|
-
type: Input
|
|
308
|
-
}] } });
|
|
309
|
-
|
|
310
|
-
class SearchstaxResultsWidget {
|
|
311
|
-
get hooks() {
|
|
312
|
-
const hooks = {};
|
|
313
|
-
if (this.afterLinkClick) {
|
|
314
|
-
hooks['afterLinkClick'] = this.afterLinkClick;
|
|
315
|
-
}
|
|
316
|
-
return hooks;
|
|
317
|
-
}
|
|
318
|
-
constructor(storeServiceService) {
|
|
319
|
-
this.storeServiceService = storeServiceService;
|
|
320
|
-
this.searchResults = null;
|
|
321
|
-
this.metadata = null;
|
|
322
|
-
this.searchTerm = '';
|
|
323
|
-
this.context = this;
|
|
324
|
-
}
|
|
325
|
-
ngOnInit() {
|
|
326
|
-
if (this.storeServiceService.searchstax) {
|
|
327
|
-
this.attachObservables();
|
|
328
|
-
setTimeout(() => {
|
|
329
|
-
this.storeServiceService.searchstax.addSearchResultsWidget('searchstax-results-container', {
|
|
330
|
-
templates: {},
|
|
331
|
-
hooks: this.hooks,
|
|
332
|
-
renderMethod: this.renderMethod ?? "pagination",
|
|
333
|
-
});
|
|
334
|
-
}, 0);
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
throw Error('Searchstax instance needs to be passed via props');
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
executeSearch(term, event, context) {
|
|
341
|
-
event.preventDefault();
|
|
342
|
-
context.storeServiceService.searchstax.executeSearch(term);
|
|
343
|
-
}
|
|
344
|
-
attachObservables() {
|
|
345
|
-
this.storeServiceService.searchstax.dataLayer.$searchResults.subscribe((results) => {
|
|
346
|
-
const current = this.searchResults ? [...this.searchResults] : [];
|
|
347
|
-
const newResults = results ?? [];
|
|
348
|
-
const resultsCombined = this.renderMethod === "infiniteScroll"
|
|
349
|
-
? [...current, ...newResults]
|
|
350
|
-
: results;
|
|
351
|
-
if (this.storeServiceService.searchstax.dataLayer.$searchObject.value?.page === 1) {
|
|
352
|
-
this.searchResults = newResults;
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
this.searchResults = resultsCombined;
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
this.storeServiceService.searchstax.dataLayer.$searchTermChange.subscribe((result) => {
|
|
359
|
-
this.searchTerm = result;
|
|
360
|
-
});
|
|
361
|
-
this.storeServiceService.searchstax.dataLayer.$searchResultsMetadata.subscribe((value) => {
|
|
362
|
-
this.metadata = value;
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
resultClicked(result, event, context) {
|
|
366
|
-
event.preventDefault();
|
|
367
|
-
event.stopPropagation();
|
|
368
|
-
context.storeServiceService.searchstax.executeLinkClick(result.uniqueId);
|
|
369
|
-
}
|
|
370
|
-
isImage(field) {
|
|
371
|
-
return field.isImage && typeof field.value === 'string';
|
|
372
|
-
}
|
|
373
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxResultsWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
374
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxResultsWidget, selector: "app-searchstax-results", inputs: { afterLinkClick: "afterLinkClick", noResultsTemplate: "noResultsTemplate", resultsTemplate: "resultsTemplate", renderMethod: "renderMethod" }, ngImport: i0, template: "<div id=\"searchstax-results-container\">\n <div class=\"searchstax-search-results-container\">\n <div id=\"searchstax-result-container\">\n <div\n *ngIf=\"searchResults?.length === 0 && searchTerm !== '' && searchTerm !== '*' && storeServiceService.searchstax.dataLayer.parsedData.firstSearchHappened && !noResultsTemplate\"\n >\n <div class=\"searchstax-no-results\">\n Showing <strong>no results</strong> for\n <strong>\"{{ searchTerm }}\"</strong>\n <br />\n <span *ngIf=\"metadata?.spellingSuggestion\"\n > Did you mean\n <a href=\"#\" class=\"searchstax-suggestion-term\" (click)=\"executeSearch(metadata?.spellingSuggestion ?? '', $event, context)\">{{\n metadata?.spellingSuggestion\n }}</a\n >?</span\n >\n </div>\n <ul>\n <li>\n Try searching for search related terms or topics. We offer a wide\n variety of content to help you get the information you need.\n </li>\n <li>Lost? Click on the \u2018X\u201D in the Search Box to reset your search.</li>\n </ul>\n </div>\n <div\n *ngIf=\"searchResults?.length === 0 && searchTerm !== '' && searchTerm !== '*' && storeServiceService.searchstax.dataLayer.parsedData.firstSearchHappened && noResultsTemplate\"\n >\n <ng-container\n *ngTemplateOutlet=\"noResultsTemplate; context: context\"\n ></ng-container>\n </div>\n\n <div\n class=\"searchstax-search-results\"\n *ngIf=\"searchResults && searchResults.length && !resultsTemplate\"\n >\n\n <a\n *ngFor=\"let searchResult of searchResults\"\n [href]=\"searchResult.url\"\n [attr.data-searchstax-unique-result-id]=\"searchResult.uniqueId\"\n (click)=\"resultClicked(searchResult, $event, context)\"\n (keyup.enter)=\"resultClicked(searchResult, $event, context)\"\n (keyup.space)=\"resultClicked(searchResult, $event, context)\"\n tabindex=\"0\"\n class=\"searchstax-result-item-link searchstax-result-item-link-wrapping\"\n >\n\n <div\n class=\"searchstax-search-result\"\n [ngClass]=\"{ 'has-thumbnail': searchResult.thumbnail }\"\n\n >\n <div\n *ngIf=\"searchResult.promoted\"\n class=\"searchstax-search-result-promoted\"\n ></div>\n <div\n *ngIf=\"searchResult.ribbon\"\n [innerHTML]=\"searchResult.ribbon\"\n class=\"searchstax-search-result-ribbon\"\n >\n </div>\n <img\n *ngIf=\"searchResult.thumbnail\"\n [src]=\"searchResult.thumbnail\"\n class=\"searchstax-thumbnail\"\n />\n <div class=\"searchstax-search-result-title-container\">\n <span class=\"searchstax-search-result-title\" [innerHTML]=\"searchResult.title\"></span>\n </div>\n <p *ngIf=\"searchResult.paths\" class=\"searchstax-search-result-common\" [innerHTML]=\"searchResult.paths\">\n </p>\n <p\n *ngIf=\"searchResult.description\"\n [innerHTML]=\"searchResult.description\"\n class=\"searchstax-search-result-description searchstax-search-result-common\"\n >\n </p>\n <div *ngFor=\"let unmappedField of searchResult.unmappedFields\">\n <div\n *ngIf=\"isImage(unmappedField)\"\n class=\"searchstax-search-result-image-container\"\n >\n <img\n [src]=\"unmappedField.value\"\n class=\"searchstax-result-image\"\n />\n </div>\n <div *ngIf=\"!isImage(unmappedField)\">\n <p class=\"searchstax-search-result-common\"\n [innerHTML]=\"unmappedField.value\"\n >\n </p>\n </div>\n </div>\n </div>\n </a>\n </div>\n\n <div *ngIf=\"searchResults && searchResults.length && resultsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"resultsTemplate; context: context\"\n ></ng-container>\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
375
|
-
}
|
|
376
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxResultsWidget, decorators: [{
|
|
377
|
-
type: Component,
|
|
378
|
-
args: [{ selector: 'app-searchstax-results', template: "<div id=\"searchstax-results-container\">\n <div class=\"searchstax-search-results-container\">\n <div id=\"searchstax-result-container\">\n <div\n *ngIf=\"searchResults?.length === 0 && searchTerm !== '' && searchTerm !== '*' && storeServiceService.searchstax.dataLayer.parsedData.firstSearchHappened && !noResultsTemplate\"\n >\n <div class=\"searchstax-no-results\">\n Showing <strong>no results</strong> for\n <strong>\"{{ searchTerm }}\"</strong>\n <br />\n <span *ngIf=\"metadata?.spellingSuggestion\"\n > Did you mean\n <a href=\"#\" class=\"searchstax-suggestion-term\" (click)=\"executeSearch(metadata?.spellingSuggestion ?? '', $event, context)\">{{\n metadata?.spellingSuggestion\n }}</a\n >?</span\n >\n </div>\n <ul>\n <li>\n Try searching for search related terms or topics. We offer a wide\n variety of content to help you get the information you need.\n </li>\n <li>Lost? Click on the \u2018X\u201D in the Search Box to reset your search.</li>\n </ul>\n </div>\n <div\n *ngIf=\"searchResults?.length === 0 && searchTerm !== '' && searchTerm !== '*' && storeServiceService.searchstax.dataLayer.parsedData.firstSearchHappened && noResultsTemplate\"\n >\n <ng-container\n *ngTemplateOutlet=\"noResultsTemplate; context: context\"\n ></ng-container>\n </div>\n\n <div\n class=\"searchstax-search-results\"\n *ngIf=\"searchResults && searchResults.length && !resultsTemplate\"\n >\n\n <a\n *ngFor=\"let searchResult of searchResults\"\n [href]=\"searchResult.url\"\n [attr.data-searchstax-unique-result-id]=\"searchResult.uniqueId\"\n (click)=\"resultClicked(searchResult, $event, context)\"\n (keyup.enter)=\"resultClicked(searchResult, $event, context)\"\n (keyup.space)=\"resultClicked(searchResult, $event, context)\"\n tabindex=\"0\"\n class=\"searchstax-result-item-link searchstax-result-item-link-wrapping\"\n >\n\n <div\n class=\"searchstax-search-result\"\n [ngClass]=\"{ 'has-thumbnail': searchResult.thumbnail }\"\n\n >\n <div\n *ngIf=\"searchResult.promoted\"\n class=\"searchstax-search-result-promoted\"\n ></div>\n <div\n *ngIf=\"searchResult.ribbon\"\n [innerHTML]=\"searchResult.ribbon\"\n class=\"searchstax-search-result-ribbon\"\n >\n </div>\n <img\n *ngIf=\"searchResult.thumbnail\"\n [src]=\"searchResult.thumbnail\"\n class=\"searchstax-thumbnail\"\n />\n <div class=\"searchstax-search-result-title-container\">\n <span class=\"searchstax-search-result-title\" [innerHTML]=\"searchResult.title\"></span>\n </div>\n <p *ngIf=\"searchResult.paths\" class=\"searchstax-search-result-common\" [innerHTML]=\"searchResult.paths\">\n </p>\n <p\n *ngIf=\"searchResult.description\"\n [innerHTML]=\"searchResult.description\"\n class=\"searchstax-search-result-description searchstax-search-result-common\"\n >\n </p>\n <div *ngFor=\"let unmappedField of searchResult.unmappedFields\">\n <div\n *ngIf=\"isImage(unmappedField)\"\n class=\"searchstax-search-result-image-container\"\n >\n <img\n [src]=\"unmappedField.value\"\n class=\"searchstax-result-image\"\n />\n </div>\n <div *ngIf=\"!isImage(unmappedField)\">\n <p class=\"searchstax-search-result-common\"\n [innerHTML]=\"unmappedField.value\"\n >\n </p>\n </div>\n </div>\n </div>\n </a>\n </div>\n\n <div *ngIf=\"searchResults && searchResults.length && resultsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"resultsTemplate; context: context\"\n ></ng-container>\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
379
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { afterLinkClick: [{
|
|
380
|
-
type: Input
|
|
381
|
-
}], noResultsTemplate: [{
|
|
382
|
-
type: Input
|
|
383
|
-
}], resultsTemplate: [{
|
|
384
|
-
type: Input
|
|
385
|
-
}], renderMethod: [{
|
|
386
|
-
type: Input
|
|
387
|
-
}] } });
|
|
388
|
-
|
|
389
|
-
class SearchstaxSearchFeedbackWidget {
|
|
390
|
-
constructor(storeServiceService) {
|
|
391
|
-
this.storeServiceService = storeServiceService;
|
|
392
|
-
this.searchFeedbackData = null;
|
|
393
|
-
this.rand = Math.random();
|
|
394
|
-
this.context = this;
|
|
395
|
-
}
|
|
396
|
-
ngOnInit() {
|
|
397
|
-
if (this.storeServiceService.searchstax) {
|
|
398
|
-
this.attachObservables();
|
|
399
|
-
setTimeout(() => {
|
|
400
|
-
this.storeServiceService.searchstax.addSearchFeedbackWidget("search-feedback-container" + this.rand, {});
|
|
401
|
-
}, 0);
|
|
402
|
-
}
|
|
403
|
-
else {
|
|
404
|
-
throw Error("Searchstax instance needs to be passed via props");
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
onOriginalQueryClick(e, context) {
|
|
408
|
-
e.stopImmediatePropagation();
|
|
409
|
-
context.storeServiceService.searchstax.searchFeedbackWidget?.onOriginalQueryClick(e);
|
|
410
|
-
}
|
|
411
|
-
attachObservables() {
|
|
412
|
-
this.storeServiceService.searchstax.dataLayer.$searchFeedbackData.subscribe((searchFeedbackData) => {
|
|
413
|
-
this.searchFeedbackData = searchFeedbackData;
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchFeedbackWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
417
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxSearchFeedbackWidget, selector: "app-searchstax-search-feedback", inputs: { templateOverride: "templateOverride" }, ngImport: i0, template: "<div\n class=\"search-feedback-container\"\n [id]=\"'search-feedback-container' + rand\"\n>\n <div\n class=\"searchstax-feedback-container\"\n *ngIf=\"\n searchFeedbackData &&\n searchFeedbackData?.searchExecuted &&\n !templateOverride &&\n searchFeedbackData?.totalResults\n \"\n >\n Showing\n <b\n >{{ searchFeedbackData!.startResultIndex }} -\n {{ searchFeedbackData!.endResultIndex }}</b\n >\n of <b>{{ searchFeedbackData!.totalResults }}</b> results\n <span *ngIf=\"searchFeedbackData.searchTerm\"\n >for \"<b>{{ searchFeedbackData!.searchTerm }}</b\n >\"\n </span>\n <div class=\"searchstax-feedback-container-suggested\">\n <div *ngIf=\"searchFeedbackData.autoCorrectedQuery\">\n Search instead for\n <a\n href=\"#\"\n (click)=\"onOriginalQueryClick($event, context)\"\n class=\"searchstax-feedback-original-query\"\n >{{ searchFeedbackData!.originalQuery }}</a\n >\n </div>\n </div>\n </div>\n\n <div\n *ngIf=\"\n searchFeedbackData &&\n searchFeedbackData?.searchExecuted &&\n templateOverride &&\n searchFeedbackData?.totalResults\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
418
|
-
}
|
|
419
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchFeedbackWidget, decorators: [{
|
|
420
|
-
type: Component,
|
|
421
|
-
args: [{ selector: "app-searchstax-search-feedback", template: "<div\n class=\"search-feedback-container\"\n [id]=\"'search-feedback-container' + rand\"\n>\n <div\n class=\"searchstax-feedback-container\"\n *ngIf=\"\n searchFeedbackData &&\n searchFeedbackData?.searchExecuted &&\n !templateOverride &&\n searchFeedbackData?.totalResults\n \"\n >\n Showing\n <b\n >{{ searchFeedbackData!.startResultIndex }} -\n {{ searchFeedbackData!.endResultIndex }}</b\n >\n of <b>{{ searchFeedbackData!.totalResults }}</b> results\n <span *ngIf=\"searchFeedbackData.searchTerm\"\n >for \"<b>{{ searchFeedbackData!.searchTerm }}</b\n >\"\n </span>\n <div class=\"searchstax-feedback-container-suggested\">\n <div *ngIf=\"searchFeedbackData.autoCorrectedQuery\">\n Search instead for\n <a\n href=\"#\"\n (click)=\"onOriginalQueryClick($event, context)\"\n class=\"searchstax-feedback-original-query\"\n >{{ searchFeedbackData!.originalQuery }}</a\n >\n </div>\n </div>\n </div>\n\n <div\n *ngIf=\"\n searchFeedbackData &&\n searchFeedbackData?.searchExecuted &&\n templateOverride &&\n searchFeedbackData?.totalResults\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </div>\n</div>\n" }]
|
|
422
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { templateOverride: [{
|
|
423
|
-
type: Input
|
|
424
|
-
}] } });
|
|
425
|
-
|
|
426
|
-
class SearchstaxSearchPaginationWidget {
|
|
427
|
-
constructor(storeServiceService) {
|
|
428
|
-
this.storeServiceService = storeServiceService;
|
|
429
|
-
this.paginationData = null;
|
|
430
|
-
this.rand = Math.random();
|
|
431
|
-
this.context = this;
|
|
432
|
-
this.paginationAdded = false;
|
|
433
|
-
}
|
|
434
|
-
ngOnInit() {
|
|
435
|
-
if (this.storeServiceService.searchstax) {
|
|
436
|
-
this.attachObservables();
|
|
437
|
-
setTimeout(() => {
|
|
438
|
-
this.addWidget();
|
|
439
|
-
}, 0);
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
throw Error("Searchstax instance needs to be passed via props");
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
nextPage(event, context) {
|
|
446
|
-
event.stopImmediatePropagation();
|
|
447
|
-
if (!context.paginationData?.isLastPage) {
|
|
448
|
-
context.storeServiceService.searchstax.searchPaginationWidget?.nextPage(event);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
previousPage(event, context) {
|
|
452
|
-
event.stopImmediatePropagation();
|
|
453
|
-
if (!context.paginationData?.isFirstPage) {
|
|
454
|
-
context.storeServiceService.searchstax.searchPaginationWidget?.previousPage(event);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
addWidget() {
|
|
458
|
-
if (!this.paginationAdded &&
|
|
459
|
-
this.storeServiceService.searchstax.routerHelper) {
|
|
460
|
-
this.paginationAdded = true;
|
|
461
|
-
this.storeServiceService.searchstax.addPaginationWidget("searchstax-pagination-container" + this.rand, {});
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
attachObservables() {
|
|
465
|
-
this.storeServiceService.searchstax.dataLayer.$searchObject.subscribe((pagination) => {
|
|
466
|
-
this.addWidget();
|
|
467
|
-
});
|
|
468
|
-
this.storeServiceService.searchstax.dataLayer.$paginationData.subscribe((pagination) => {
|
|
469
|
-
this.paginationData = pagination;
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchPaginationWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
473
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxSearchPaginationWidget, selector: "app-searchstax-search-pagination", inputs: { templateOverride: "templateOverride", infiniteScrollTemplateOverride: "infiniteScrollTemplateOverride" }, ngImport: i0, template: "<div [id]=\"'searchstax-pagination-container' + rand\">\n <div\n class=\"searchstax-pagination-container\"\n *ngIf=\"\n paginationData?.totalResults &&\n !templateOverride &&\n !paginationData?.isInfiniteScroll\n \"\n >\n <div class=\"searchstax-pagination-content\">\n <a\n class=\"searchstax-pagination-previous\"\n [class]=\"paginationData?.isFirstPage ? 'disabled' : ''\"\n (click)=\"previousPage($event, context)\"\n (keyup.enter)=\"previousPage($event, context)\"\n (keyup.space)=\"previousPage($event, context)\"\n tabindex=\"0\"\n id=\"searchstax-pagination-previous\"\n >\n < Previous\n </a>\n <div class=\"searchstax-pagination-details\">\n {{ paginationData?.startResultIndex }} -\n {{ paginationData?.endResultIndex }} of\n {{ paginationData?.totalResults }}\n </div>\n <a\n class=\"searchstax-pagination-next\"\n [class]=\"paginationData?.isLastPage ? 'disabled' : ''\"\n (click)=\"nextPage($event, context)\"\n (keyup.enter)=\"nextPage($event, context)\"\n (keyup.space)=\"nextPage($event, context)\"\n tabindex=\"0\"\n id=\"searchstax-pagination-next\"\n >Next ></a\n >\n </div>\n </div>\n\n <div\n *ngIf=\"\n paginationData?.totalResults &&\n templateOverride &&\n !paginationData?.isInfiniteScroll\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </div>\n\n <div\n class=\"searchstax-pagination-container\"\n *ngIf=\"\n paginationData?.totalResults &&\n !infiniteScrollTemplateOverride &&\n paginationData?.totalResults !== 0 &&\n !paginationData?.isLastPage &&\n paginationData?.isInfiniteScroll\n \"\n >\n <a\n class=\"searchstax-pagination-load-more\"\n (click)=\"nextPage($event, context)\"\n (keyup.enter)=\"nextPage($event, context)\"\n (keyup.space)=\"nextPage($event, context)\"\n tabindex=\"0\"\n >\n Load More\n </a>\n </div>\n\n <div\n *ngIf=\"\n paginationData?.totalResults &&\n infiniteScrollTemplateOverride &&\n paginationData?.totalResults !== 0 &&\n !paginationData?.isLastPage &&\n paginationData?.isInfiniteScroll\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"infiniteScrollTemplateOverride; context: context\"\n ></ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
474
|
-
}
|
|
475
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchPaginationWidget, decorators: [{
|
|
476
|
-
type: Component,
|
|
477
|
-
args: [{ selector: "app-searchstax-search-pagination", template: "<div [id]=\"'searchstax-pagination-container' + rand\">\n <div\n class=\"searchstax-pagination-container\"\n *ngIf=\"\n paginationData?.totalResults &&\n !templateOverride &&\n !paginationData?.isInfiniteScroll\n \"\n >\n <div class=\"searchstax-pagination-content\">\n <a\n class=\"searchstax-pagination-previous\"\n [class]=\"paginationData?.isFirstPage ? 'disabled' : ''\"\n (click)=\"previousPage($event, context)\"\n (keyup.enter)=\"previousPage($event, context)\"\n (keyup.space)=\"previousPage($event, context)\"\n tabindex=\"0\"\n id=\"searchstax-pagination-previous\"\n >\n < Previous\n </a>\n <div class=\"searchstax-pagination-details\">\n {{ paginationData?.startResultIndex }} -\n {{ paginationData?.endResultIndex }} of\n {{ paginationData?.totalResults }}\n </div>\n <a\n class=\"searchstax-pagination-next\"\n [class]=\"paginationData?.isLastPage ? 'disabled' : ''\"\n (click)=\"nextPage($event, context)\"\n (keyup.enter)=\"nextPage($event, context)\"\n (keyup.space)=\"nextPage($event, context)\"\n tabindex=\"0\"\n id=\"searchstax-pagination-next\"\n >Next ></a\n >\n </div>\n </div>\n\n <div\n *ngIf=\"\n paginationData?.totalResults &&\n templateOverride &&\n !paginationData?.isInfiniteScroll\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </div>\n\n <div\n class=\"searchstax-pagination-container\"\n *ngIf=\"\n paginationData?.totalResults &&\n !infiniteScrollTemplateOverride &&\n paginationData?.totalResults !== 0 &&\n !paginationData?.isLastPage &&\n paginationData?.isInfiniteScroll\n \"\n >\n <a\n class=\"searchstax-pagination-load-more\"\n (click)=\"nextPage($event, context)\"\n (keyup.enter)=\"nextPage($event, context)\"\n (keyup.space)=\"nextPage($event, context)\"\n tabindex=\"0\"\n >\n Load More\n </a>\n </div>\n\n <div\n *ngIf=\"\n paginationData?.totalResults &&\n infiniteScrollTemplateOverride &&\n paginationData?.totalResults !== 0 &&\n !paginationData?.isLastPage &&\n paginationData?.isInfiniteScroll\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"infiniteScrollTemplateOverride; context: context\"\n ></ng-container>\n </div>\n</div>\n" }]
|
|
478
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { templateOverride: [{
|
|
479
|
-
type: Input
|
|
480
|
-
}], infiniteScrollTemplateOverride: [{
|
|
481
|
-
type: Input
|
|
482
|
-
}] } });
|
|
483
|
-
|
|
484
|
-
class SearchstaxSearchFacetsWidget {
|
|
485
|
-
// @ViewChildren("facetContainers") facetContainers: QueryList<ElementRef>;
|
|
486
|
-
constructor(storeServiceService) {
|
|
487
|
-
this.storeServiceService = storeServiceService;
|
|
488
|
-
this.facetsTemplateDataDesktop = null;
|
|
489
|
-
this.facetsTemplateDataMobile = null;
|
|
490
|
-
this.context = this;
|
|
491
|
-
this.selectedFacetsCheckboxes = [];
|
|
492
|
-
this.selectedFacetsRange = [];
|
|
493
|
-
this.rand = Math.random();
|
|
494
|
-
}
|
|
495
|
-
ngOnInit() {
|
|
496
|
-
if (this.storeServiceService.searchstax) {
|
|
497
|
-
this.attachObservables();
|
|
498
|
-
setTimeout(() => {
|
|
499
|
-
this.addWidget();
|
|
500
|
-
}, 0);
|
|
501
|
-
}
|
|
502
|
-
else {
|
|
503
|
-
throw Error("Searchstax instance needs to be passed via props");
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
addWidget() {
|
|
507
|
-
this.storeServiceService.searchstax.addFacetsWidget('searchstax-facets-container' + this.rand, {
|
|
508
|
-
facetingType: this.facetingType,
|
|
509
|
-
specificFacets: this.specificFacets,
|
|
510
|
-
itemsPerPageDesktop: this.itemsPerPageDesktop,
|
|
511
|
-
itemsPerPageMobile: this.itemsPerPageMobile
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
attachObservables() {
|
|
515
|
-
this.storeServiceService.searchstax.dataLayer.$facetsTemplateData.subscribe((data) => {
|
|
516
|
-
if (data?.isMobile) {
|
|
517
|
-
this.facetsTemplateDataMobile = data;
|
|
518
|
-
}
|
|
519
|
-
else {
|
|
520
|
-
this.facetsTemplateDataDesktop = data;
|
|
521
|
-
}
|
|
522
|
-
});
|
|
523
|
-
this.storeServiceService.searchstax.dataLayer.$selectedFacetsTemplateData.subscribe((data) => {
|
|
524
|
-
const da = data ?? [];
|
|
525
|
-
this.selectedFacetsCheckboxes = da.filter((d) => d.type === 'checkbox');
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
unselectFacet(facet, context) {
|
|
529
|
-
context.storeServiceService.searchstax.searchFacetsWidget?.unselectFacet(facet);
|
|
530
|
-
}
|
|
531
|
-
unselectAll(context) {
|
|
532
|
-
context.storeServiceService.searchstax.searchFacetsWidget?.removeSelectedFacets();
|
|
533
|
-
}
|
|
534
|
-
isNotDeactivated(name, context) {
|
|
535
|
-
return !context.storeServiceService.searchstax.searchFacetsWidget?.deactivatedFacets[name];
|
|
536
|
-
}
|
|
537
|
-
toggleFacetGroup(name, context) {
|
|
538
|
-
if (context.storeServiceService.searchstax.searchFacetsWidget)
|
|
539
|
-
if (context.isNotDeactivated(name, context)) {
|
|
540
|
-
context.storeServiceService.searchstax.searchFacetsWidget.deactivatedFacets[name] = true;
|
|
541
|
-
}
|
|
542
|
-
else {
|
|
543
|
-
context.storeServiceService.searchstax.searchFacetsWidget.deactivatedFacets[name] = false;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
isChecked(facetValue, context) {
|
|
547
|
-
return context.storeServiceService.searchstax.searchFacetsWidget?.isChecked(facetValue);
|
|
548
|
-
}
|
|
549
|
-
selectFacet(el, event, data, isInput, context) {
|
|
550
|
-
const wrapperDiv = document.createElement('div');
|
|
551
|
-
wrapperDiv.innerHTML = el.outerHTML;
|
|
552
|
-
context.storeServiceService.searchstax.searchFacetsWidget?.onFacetSelect(event, data, el, isInput);
|
|
553
|
-
}
|
|
554
|
-
showMoreLessDesktop(e, data, context) {
|
|
555
|
-
context.storeServiceService.searchstax.searchFacetsWidget?.onShowMoreLessClick(e, data, false);
|
|
556
|
-
}
|
|
557
|
-
showMoreLessMobile(e, data, context) {
|
|
558
|
-
context.storeServiceService.searchstax.searchFacetsWidget?.onShowMoreLessClick(e, data, true);
|
|
559
|
-
}
|
|
560
|
-
openOverlay(context) {
|
|
561
|
-
context.storeServiceService.searchstax.searchFacetsWidget?.openOverlay();
|
|
562
|
-
}
|
|
563
|
-
closeOverlay(context) {
|
|
564
|
-
context.storeServiceService.searchstax.searchFacetsWidget?.closeOverlay();
|
|
565
|
-
}
|
|
566
|
-
facetValues(facet) {
|
|
567
|
-
return facet.values;
|
|
568
|
-
}
|
|
569
|
-
facetMobileData(facet) {
|
|
570
|
-
return facet;
|
|
571
|
-
}
|
|
572
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchFacetsWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
573
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxSearchFacetsWidget, selector: "app-searchstax-search-facets", inputs: { templateOverrideMobile: "templateOverrideMobile", templateOverrideDesktop: "templateOverrideDesktop", facetingType: "facetingType", itemsPerPageDesktop: "itemsPerPageDesktop", itemsPerPageMobile: "itemsPerPageMobile", specificFacets: "specificFacets" }, ngImport: i0, template: "<div [id]=\"'searchstax-facets-container' + rand\">\n <div\n *ngIf=\"facetsTemplateDataDesktop?.hasResultsOrExternalPromotions && !templateOverrideDesktop\"\n class=\"searchstax-facets-container-desktop\"\n >\n <div\n class=\"searchstax-facet-container\"\n *ngFor=\"let facet of facetsTemplateDataDesktop?.facets\"\n [class]=\"{ active: isNotDeactivated(facet.name, context) }\"\n >\n <div>\n <div class=\"searchstax-facet-title-container\" (click)=\"toggleFacetGroup(facet.name, context)\">\n <div class=\"searchstax-facet-title\">{{ facet.label }}</div>\n <div class=\"searchstax-facet-title-arrow active\"></div>\n </div>\n <div class=\"searchstax-facet-values-container\">\n <div\n *ngFor=\"let facetValue of facetValues(facet); index as key\"\n class=\"searchstax-facet-value-container\"\n [class]=\"{ 'searchstax-facet-value-disabled': facetValue.disabled }\"\n #ref\n >\n <div class=\"searchstax-facet-input\">\n <input\n type=\"checkbox\"\n class=\"searchstax-facet-input-checkbox\"\n [attr.aria-label]=\"facetValue.value + ' ' + facetValue.count\"\n [checked]=\"isChecked(facetValue, context)\"\n [disabled]=\"facetValue.disabled\"\n (click)=\"selectFacet(ref, $event, facetValue, true, context)\"\n />\n </div>\n <div class=\"searchstax-facet-value-label\" (click)=\"selectFacet(ref, $event, facetValue, false, context)\">\n {{ facetValue.value }}\n </div>\n <div class=\"searchstax-facet-value-count\" (click)=\"selectFacet(ref, $event, facetValue, false, context)\">\n ({{ facetValue.count }})\n </div>\n </div>\n <div class=\"searchstax-facet-show-more-container\" *ngIf=\"facet.hasMoreFacets\">\n <div class=\"searchstax-facet-show-more-container\" (click)=\"showMoreLessDesktop($event, facet, context)\" (keyup.enter)=\"showMoreLessDesktop($event, facet, context)\" (keyup.space)=\"showMoreLessDesktop($event, facet, context)\" tabindex=\"0\">\n <div\n *ngIf=\"facet.showingAllFacets\"\n class=\"searchstax-facet-show-less-button searchstax-facet-show-button\"\n >\n less\n </div>\n <div\n *ngIf=\"!facet.showingAllFacets\"\n class=\"searchstax-facet-show-more-button searchstax-facet-show-button\"\n >\n more\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf=\"facetsTemplateDataDesktop?.hasResultsOrExternalPromotions && templateOverrideDesktop\">\n <ng-container *ngTemplateOutlet=\"templateOverrideDesktop; context: context\"></ng-container>\n </div>\n\n <div\n class=\"searchstax-facets-container-mobile\"\n *ngIf=\"facetsTemplateDataMobile?.hasResultsOrExternalPromotions && !templateOverrideMobile\"\n >\n <div class=\"searchstax-facets-pills-container\">\n <div class=\"searchstax-facets-pill searchstax-facets-pill-filter-by\" (click)=\"openOverlay(context)\">\n <div class=\"searchstax-facets-pill-label\">Filter By</div>\n </div>\n <div class=\"searchstax-facets-pills-selected\">\n <div\n class=\"searchstax-facets-pill searchstax-facets-pill-facets\"\n *ngFor=\"let facet of selectedFacetsCheckboxes\"\n (click)=\"unselectFacet(facet, context)\"\n >\n <div class=\"searchstax-facets-pill-label\">{{ facet.value }} ({{ facet.count }})</div>\n <div class=\"searchstax-facets-pill-icon-close\"></div>\n </div>\n </div>\n <div\n class=\"searchstax-facets-pill searchstax-clear-filters searchstax-facets-pill-clear-all\"\n *ngIf=\"selectedFacetsCheckboxes.length\"\n (click)=\"unselectAll(context)\"\n >\n <div class=\"searchstax-facets-pill-label\">Clear Filters</div>\n </div>\n </div>\n <div\n class=\"searchstax-facets-mobile-overlay\"\n [class]=\"{ 'searchstax-show': facetMobileData(facetsTemplateDataMobile)?.overlayOpened }\"\n >\n <div class=\"searchstax-facets-mobile-overlay-header\">\n <div class=\"searchstax-facets-mobile-overlay-header-title\">Filter By</div>\n <div class=\"searchstax-search-close\" (click)=\"closeOverlay(context)\"></div>\n </div>\n <div class=\"searchstax-facets-container-mobile\">\n <div\n *ngFor=\"let facet of facetsTemplateDataMobile?.facets\"\n class=\"searchstax-facet-container\"\n [class]=\"{ active: isNotDeactivated(facet.name, context) }\"\n >\n <div>\n <div class=\"searchstax-facet-title-container\" (click)=\"toggleFacetGroup(facet.name, context)\">\n <div class=\"searchstax-facet-title\">{{ facet.label }}</div>\n <div class=\"searchstax-facet-title-arrow active\"></div>\n </div>\n <div class=\"searchstax-facet-values-container\">\n <div\n *ngFor=\"let facetValue of facetValues(facet); index as key\"\n class=\"searchstax-facet-value-container\"\n [class]=\"{ 'searchstax-facet-value-disabled': facetValue.disabled }\"\n #ref\n >\n <div class=\"searchstax-facet-input\">\n <input\n type=\"checkbox\"\n class=\"searchstax-facet-input-checkbox\"\n [attr.aria-label]=\"facetValue.value + ' ' + facetValue.count\"\n [checked]=\"isChecked(facetValue, context)\"\n [disabled]=\"facetValue.disabled\"\n (click)=\"selectFacet(ref, $event, facetValue, true, context)\"\n />\n </div>\n <div\n class=\"searchstax-facet-value-label\"\n (click)=\"selectFacet(ref, $event, facetValue, false, context)\"\n >\n {{ facetValue.value }}\n </div>\n <div\n class=\"searchstax-facet-value-count\"\n (click)=\"selectFacet(ref, $event, facetValue, false, context)\"\n >\n ({{ facetValue.count }})\n </div>\n </div>\n <div class=\"searchstax-facet-show-more-container\" *ngIf=\"facet.hasMoreFacets\">\n <div class=\"searchstax-facet-show-more-container\" (click)=\"showMoreLessMobile($event, facet, context)\" (keyup.enter)=\"showMoreLessMobile($event, facet, context)\" (keyup.space)=\"showMoreLessMobile($event, facet, context)\" tabindex=\"0\">\n <div\n *ngIf=\"facet.showingAllFacets\"\n class=\"searchstax-facet-show-less-button searchstax-facet-show-button\"\n >\n less\n </div>\n <div\n *ngIf=\"!facet.showingAllFacets\"\n class=\"searchstax-facet-show-more-button searchstax-facet-show-button\"\n >\n more\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <button class=\"searchstax-facets-mobile-overlay-done\" (click)=\"closeOverlay(context)\">Done</button>\n </div>\n </div>\n <div *ngIf=\"facetsTemplateDataMobile?.hasResultsOrExternalPromotions && templateOverrideMobile\">\n <ng-container *ngTemplateOutlet=\"templateOverrideMobile; context: context\"></ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
574
|
-
}
|
|
575
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchFacetsWidget, decorators: [{
|
|
576
|
-
type: Component,
|
|
577
|
-
args: [{ selector: "app-searchstax-search-facets", template: "<div [id]=\"'searchstax-facets-container' + rand\">\n <div\n *ngIf=\"facetsTemplateDataDesktop?.hasResultsOrExternalPromotions && !templateOverrideDesktop\"\n class=\"searchstax-facets-container-desktop\"\n >\n <div\n class=\"searchstax-facet-container\"\n *ngFor=\"let facet of facetsTemplateDataDesktop?.facets\"\n [class]=\"{ active: isNotDeactivated(facet.name, context) }\"\n >\n <div>\n <div class=\"searchstax-facet-title-container\" (click)=\"toggleFacetGroup(facet.name, context)\">\n <div class=\"searchstax-facet-title\">{{ facet.label }}</div>\n <div class=\"searchstax-facet-title-arrow active\"></div>\n </div>\n <div class=\"searchstax-facet-values-container\">\n <div\n *ngFor=\"let facetValue of facetValues(facet); index as key\"\n class=\"searchstax-facet-value-container\"\n [class]=\"{ 'searchstax-facet-value-disabled': facetValue.disabled }\"\n #ref\n >\n <div class=\"searchstax-facet-input\">\n <input\n type=\"checkbox\"\n class=\"searchstax-facet-input-checkbox\"\n [attr.aria-label]=\"facetValue.value + ' ' + facetValue.count\"\n [checked]=\"isChecked(facetValue, context)\"\n [disabled]=\"facetValue.disabled\"\n (click)=\"selectFacet(ref, $event, facetValue, true, context)\"\n />\n </div>\n <div class=\"searchstax-facet-value-label\" (click)=\"selectFacet(ref, $event, facetValue, false, context)\">\n {{ facetValue.value }}\n </div>\n <div class=\"searchstax-facet-value-count\" (click)=\"selectFacet(ref, $event, facetValue, false, context)\">\n ({{ facetValue.count }})\n </div>\n </div>\n <div class=\"searchstax-facet-show-more-container\" *ngIf=\"facet.hasMoreFacets\">\n <div class=\"searchstax-facet-show-more-container\" (click)=\"showMoreLessDesktop($event, facet, context)\" (keyup.enter)=\"showMoreLessDesktop($event, facet, context)\" (keyup.space)=\"showMoreLessDesktop($event, facet, context)\" tabindex=\"0\">\n <div\n *ngIf=\"facet.showingAllFacets\"\n class=\"searchstax-facet-show-less-button searchstax-facet-show-button\"\n >\n less\n </div>\n <div\n *ngIf=\"!facet.showingAllFacets\"\n class=\"searchstax-facet-show-more-button searchstax-facet-show-button\"\n >\n more\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf=\"facetsTemplateDataDesktop?.hasResultsOrExternalPromotions && templateOverrideDesktop\">\n <ng-container *ngTemplateOutlet=\"templateOverrideDesktop; context: context\"></ng-container>\n </div>\n\n <div\n class=\"searchstax-facets-container-mobile\"\n *ngIf=\"facetsTemplateDataMobile?.hasResultsOrExternalPromotions && !templateOverrideMobile\"\n >\n <div class=\"searchstax-facets-pills-container\">\n <div class=\"searchstax-facets-pill searchstax-facets-pill-filter-by\" (click)=\"openOverlay(context)\">\n <div class=\"searchstax-facets-pill-label\">Filter By</div>\n </div>\n <div class=\"searchstax-facets-pills-selected\">\n <div\n class=\"searchstax-facets-pill searchstax-facets-pill-facets\"\n *ngFor=\"let facet of selectedFacetsCheckboxes\"\n (click)=\"unselectFacet(facet, context)\"\n >\n <div class=\"searchstax-facets-pill-label\">{{ facet.value }} ({{ facet.count }})</div>\n <div class=\"searchstax-facets-pill-icon-close\"></div>\n </div>\n </div>\n <div\n class=\"searchstax-facets-pill searchstax-clear-filters searchstax-facets-pill-clear-all\"\n *ngIf=\"selectedFacetsCheckboxes.length\"\n (click)=\"unselectAll(context)\"\n >\n <div class=\"searchstax-facets-pill-label\">Clear Filters</div>\n </div>\n </div>\n <div\n class=\"searchstax-facets-mobile-overlay\"\n [class]=\"{ 'searchstax-show': facetMobileData(facetsTemplateDataMobile)?.overlayOpened }\"\n >\n <div class=\"searchstax-facets-mobile-overlay-header\">\n <div class=\"searchstax-facets-mobile-overlay-header-title\">Filter By</div>\n <div class=\"searchstax-search-close\" (click)=\"closeOverlay(context)\"></div>\n </div>\n <div class=\"searchstax-facets-container-mobile\">\n <div\n *ngFor=\"let facet of facetsTemplateDataMobile?.facets\"\n class=\"searchstax-facet-container\"\n [class]=\"{ active: isNotDeactivated(facet.name, context) }\"\n >\n <div>\n <div class=\"searchstax-facet-title-container\" (click)=\"toggleFacetGroup(facet.name, context)\">\n <div class=\"searchstax-facet-title\">{{ facet.label }}</div>\n <div class=\"searchstax-facet-title-arrow active\"></div>\n </div>\n <div class=\"searchstax-facet-values-container\">\n <div\n *ngFor=\"let facetValue of facetValues(facet); index as key\"\n class=\"searchstax-facet-value-container\"\n [class]=\"{ 'searchstax-facet-value-disabled': facetValue.disabled }\"\n #ref\n >\n <div class=\"searchstax-facet-input\">\n <input\n type=\"checkbox\"\n class=\"searchstax-facet-input-checkbox\"\n [attr.aria-label]=\"facetValue.value + ' ' + facetValue.count\"\n [checked]=\"isChecked(facetValue, context)\"\n [disabled]=\"facetValue.disabled\"\n (click)=\"selectFacet(ref, $event, facetValue, true, context)\"\n />\n </div>\n <div\n class=\"searchstax-facet-value-label\"\n (click)=\"selectFacet(ref, $event, facetValue, false, context)\"\n >\n {{ facetValue.value }}\n </div>\n <div\n class=\"searchstax-facet-value-count\"\n (click)=\"selectFacet(ref, $event, facetValue, false, context)\"\n >\n ({{ facetValue.count }})\n </div>\n </div>\n <div class=\"searchstax-facet-show-more-container\" *ngIf=\"facet.hasMoreFacets\">\n <div class=\"searchstax-facet-show-more-container\" (click)=\"showMoreLessMobile($event, facet, context)\" (keyup.enter)=\"showMoreLessMobile($event, facet, context)\" (keyup.space)=\"showMoreLessMobile($event, facet, context)\" tabindex=\"0\">\n <div\n *ngIf=\"facet.showingAllFacets\"\n class=\"searchstax-facet-show-less-button searchstax-facet-show-button\"\n >\n less\n </div>\n <div\n *ngIf=\"!facet.showingAllFacets\"\n class=\"searchstax-facet-show-more-button searchstax-facet-show-button\"\n >\n more\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <button class=\"searchstax-facets-mobile-overlay-done\" (click)=\"closeOverlay(context)\">Done</button>\n </div>\n </div>\n <div *ngIf=\"facetsTemplateDataMobile?.hasResultsOrExternalPromotions && templateOverrideMobile\">\n <ng-container *ngTemplateOutlet=\"templateOverrideMobile; context: context\"></ng-container>\n </div>\n</div>\n" }]
|
|
578
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { templateOverrideMobile: [{
|
|
579
|
-
type: Input
|
|
580
|
-
}], templateOverrideDesktop: [{
|
|
581
|
-
type: Input
|
|
582
|
-
}], facetingType: [{
|
|
583
|
-
type: Input
|
|
584
|
-
}], itemsPerPageDesktop: [{
|
|
585
|
-
type: Input
|
|
586
|
-
}], itemsPerPageMobile: [{
|
|
587
|
-
type: Input
|
|
588
|
-
}], specificFacets: [{
|
|
589
|
-
type: Input
|
|
590
|
-
}] } });
|
|
591
|
-
|
|
592
|
-
class SearchstaxSearchSortingWidget {
|
|
593
|
-
constructor(storeServiceService) {
|
|
594
|
-
this.storeServiceService = storeServiceService;
|
|
595
|
-
this.sortingData = null;
|
|
596
|
-
this.rand = Math.random();
|
|
597
|
-
this.context = this;
|
|
598
|
-
this.selectedSorting = "";
|
|
599
|
-
}
|
|
600
|
-
ngOnInit() {
|
|
601
|
-
if (this.storeServiceService.searchstax) {
|
|
602
|
-
this.attachObservables();
|
|
603
|
-
setTimeout(() => {
|
|
604
|
-
this.storeServiceService.searchstax.addSearchSortingWidget("search-sorting-container" + this.rand, {});
|
|
605
|
-
}, 0);
|
|
606
|
-
}
|
|
607
|
-
else {
|
|
608
|
-
throw Error("Searchstax instance needs to be passed via props");
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
orderChange(e, context) {
|
|
612
|
-
e.stopImmediatePropagation();
|
|
613
|
-
context.storeServiceService.searchstax.searchSortingWidget?.setOrderQuery(e.target.value);
|
|
614
|
-
}
|
|
615
|
-
attachObservables() {
|
|
616
|
-
this.storeServiceService.searchstax.dataLayer.$searchSortingData.subscribe((sortingData) => {
|
|
617
|
-
this.sortingData = sortingData;
|
|
618
|
-
});
|
|
619
|
-
this.storeServiceService.searchstax.dataLayer.$searchObject.subscribe((searchObject) => {
|
|
620
|
-
this.selectedSorting = decodeURIComponent(searchObject?.order ?? '');
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchSortingWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
624
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxSearchSortingWidget, selector: "app-searchstax-search-sorting", inputs: { templateOverride: "templateOverride" }, ngImport: i0, template: "<div class=\"search-feedback-container\" [id]=\"'search-sorting-container' + rand\">\n <div\n class=\"searchstax-sorting-container\"\n *ngIf=\"sortingData && sortingData?.searchExecuted && sortingData?.hasResultsOrExternalPromotions && !templateOverride\"\n >\n <label class=\"searchstax-sorting-label\" for=\"searchstax-search-order-select\">Sort By</label>\n <select\n id=\"searchstax-search-order-select\"\n class=\"searchstax-search-order-select\"\n [(ngModel)]=\"selectedSorting\"\n (change)=\"orderChange($event, context)\"\n >\n <option *ngFor=\"let sortOption of sortingData.sortOptions\" [value]=\"sortOption.key\">{{sortOption.value}}</option>\n </select>\n </div>\n\n <div\n *ngIf=\"\n sortingData && sortingData?.searchExecuted && sortingData?.hasResultsOrExternalPromotions && templateOverride\n \"\n >\n <ng-container *ngTemplateOutlet=\"templateOverride; context: context\"></ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
|
|
625
|
-
}
|
|
626
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchSortingWidget, decorators: [{
|
|
627
|
-
type: Component,
|
|
628
|
-
args: [{ selector: "app-searchstax-search-sorting", template: "<div class=\"search-feedback-container\" [id]=\"'search-sorting-container' + rand\">\n <div\n class=\"searchstax-sorting-container\"\n *ngIf=\"sortingData && sortingData?.searchExecuted && sortingData?.hasResultsOrExternalPromotions && !templateOverride\"\n >\n <label class=\"searchstax-sorting-label\" for=\"searchstax-search-order-select\">Sort By</label>\n <select\n id=\"searchstax-search-order-select\"\n class=\"searchstax-search-order-select\"\n [(ngModel)]=\"selectedSorting\"\n (change)=\"orderChange($event, context)\"\n >\n <option *ngFor=\"let sortOption of sortingData.sortOptions\" [value]=\"sortOption.key\">{{sortOption.value}}</option>\n </select>\n </div>\n\n <div\n *ngIf=\"\n sortingData && sortingData?.searchExecuted && sortingData?.hasResultsOrExternalPromotions && templateOverride\n \"\n >\n <ng-container *ngTemplateOutlet=\"templateOverride; context: context\"></ng-container>\n </div>\n</div>\n" }]
|
|
629
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { templateOverride: [{
|
|
630
|
-
type: Input
|
|
631
|
-
}] } });
|
|
632
|
-
|
|
633
|
-
class SearchstaxSearchAnswerWidget {
|
|
634
|
-
constructor(storeServiceService) {
|
|
635
|
-
this.storeServiceService = storeServiceService;
|
|
636
|
-
this.answerData = null;
|
|
637
|
-
this.rand = Math.random();
|
|
638
|
-
this.context = this;
|
|
639
|
-
}
|
|
640
|
-
ngOnInit() {
|
|
641
|
-
if (this.storeServiceService.searchstax) {
|
|
642
|
-
this.attachObservables();
|
|
643
|
-
setTimeout(() => {
|
|
644
|
-
this.storeServiceService.searchstax.addAnswerWidget('searchstax-answer-container' + this.rand, { showShowMoreAfterWordCount: this.showShowMoreAfterWordCount, feedbackwidget: this.feedbackwidget });
|
|
645
|
-
}, 0);
|
|
646
|
-
}
|
|
647
|
-
else {
|
|
648
|
-
throw Error("Searchstax instance needs to be passed via props");
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
showMore(event, context) {
|
|
652
|
-
if (context.storeServiceService.searchstax) {
|
|
653
|
-
context.storeServiceService.searchstax.answerWidget?.showMore(event);
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
attachObservables() {
|
|
657
|
-
this.storeServiceService.searchstax.dataLayer.$answerData.subscribe((answerData) => {
|
|
658
|
-
this.answerData = answerData;
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchAnswerWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
662
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxSearchAnswerWidget, selector: "app-searchstax-answer", inputs: { templateOverride: "templateOverride", feedbackwidget: "feedbackwidget", showShowMoreAfterWordCount: "showShowMoreAfterWordCount" }, ngImport: i0, template: "<div [id]=\"'searchstax-answer-container' + rand\">\n <div\n *ngIf=\"\n answerData &&\n answerData?.searchExecuted &&\n answerData.shouldShowAnswer &&\n !templateOverride\n \"\n >\n <div class=\"searchstax-answer-wrap\">\n <div class=\"searchstax-answer-icon\"></div>\n <div>\n <div\n [class]=\"\n 'searchstax-answer-container' + answerData.showMoreButtonVisible\n ? 'searchstax-answer-show-more'\n : ''\n \"\n >\n <div class=\"searchstax-answer-title\">Answer</div>\n <div class=\"searchstax-answer-error\" *ngIf=\"answerData.shouldShowAnswerError\" [innerHTML]=\"answerData.answerErrorMessage\"></div>\n <div\n class=\"searchstax-answer-description\"\n [innerHTML]=\"answerData.fullAnswerFormatted\"\n ></div>\n <div\n *ngIf=\"answerData.answerLoading\"\n class=\"searchstax-answer-loading\"\n ></div>\n </div>\n <div\n *ngIf=\"answerData.showMoreButtonVisible\"\n class=\"searchstax-answer-load-more-button-container\"\n >\n <button\n class=\"searchstax-answer-load-more-button\"\n (click)=\"showMore($event, context)\"\n >\n Show More...\n </button>\n </div>\n </div>\n <div class=\"searchstax-answer-footer\">\n <div id=\"feedbackWidgetContainer\"></div>\n <div class=\"searchstax-lightweight-widget-separator-inline\"></div>\n <p class=\"searchstax-disclaimer\">Generative AI is Experimental</p>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"\n answerData &&\n answerData?.searchExecuted &&\n answerData.shouldShowAnswer &&\n templateOverride\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
663
|
-
}
|
|
664
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchAnswerWidget, decorators: [{
|
|
665
|
-
type: Component,
|
|
666
|
-
args: [{ selector: "app-searchstax-answer", template: "<div [id]=\"'searchstax-answer-container' + rand\">\n <div\n *ngIf=\"\n answerData &&\n answerData?.searchExecuted &&\n answerData.shouldShowAnswer &&\n !templateOverride\n \"\n >\n <div class=\"searchstax-answer-wrap\">\n <div class=\"searchstax-answer-icon\"></div>\n <div>\n <div\n [class]=\"\n 'searchstax-answer-container' + answerData.showMoreButtonVisible\n ? 'searchstax-answer-show-more'\n : ''\n \"\n >\n <div class=\"searchstax-answer-title\">Answer</div>\n <div class=\"searchstax-answer-error\" *ngIf=\"answerData.shouldShowAnswerError\" [innerHTML]=\"answerData.answerErrorMessage\"></div>\n <div\n class=\"searchstax-answer-description\"\n [innerHTML]=\"answerData.fullAnswerFormatted\"\n ></div>\n <div\n *ngIf=\"answerData.answerLoading\"\n class=\"searchstax-answer-loading\"\n ></div>\n </div>\n <div\n *ngIf=\"answerData.showMoreButtonVisible\"\n class=\"searchstax-answer-load-more-button-container\"\n >\n <button\n class=\"searchstax-answer-load-more-button\"\n (click)=\"showMore($event, context)\"\n >\n Show More...\n </button>\n </div>\n </div>\n <div class=\"searchstax-answer-footer\">\n <div id=\"feedbackWidgetContainer\"></div>\n <div class=\"searchstax-lightweight-widget-separator-inline\"></div>\n <p class=\"searchstax-disclaimer\">Generative AI is Experimental</p>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"\n answerData &&\n answerData?.searchExecuted &&\n answerData.shouldShowAnswer &&\n templateOverride\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"templateOverride; context: context\"\n ></ng-container>\n </div>\n</div>\n" }]
|
|
667
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { templateOverride: [{
|
|
668
|
-
type: Input
|
|
669
|
-
}], feedbackwidget: [{
|
|
670
|
-
type: Input
|
|
671
|
-
}], showShowMoreAfterWordCount: [{
|
|
672
|
-
type: Input
|
|
673
|
-
}] } });
|
|
674
|
-
|
|
675
|
-
class SearchstaxSearchRelatedSearchesWidget {
|
|
676
|
-
constructor(storeServiceService) {
|
|
677
|
-
this.storeServiceService = storeServiceService;
|
|
678
|
-
this.relatedData = null;
|
|
679
|
-
this.rand = Math.random();
|
|
680
|
-
this.context = this;
|
|
681
|
-
}
|
|
682
|
-
ngOnInit() {
|
|
683
|
-
if (this.storeServiceService.searchstax) {
|
|
684
|
-
this.attachObservables();
|
|
685
|
-
setTimeout(() => {
|
|
686
|
-
this.storeServiceService.searchstax.addRelatedSearchesWidget("searchstax-related-searches-container" + this.rand, { relatedSearchesURL: this.relatedSearchesURL ?? "", relatedSearchesAPIKey: this.relatedSearchesAPIKey ?? "" });
|
|
687
|
-
}, 0);
|
|
688
|
-
}
|
|
689
|
-
else {
|
|
690
|
-
throw Error("Searchstax instance needs to be passed via props");
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
executeSearch(result, context) {
|
|
694
|
-
context.storeServiceService.searchstax.relatedSearchesWidget?.executeSearch(result);
|
|
695
|
-
}
|
|
696
|
-
attachObservables() {
|
|
697
|
-
this.storeServiceService.searchstax.dataLayer.$searchRelatedSearchesData.subscribe((relatedData) => {
|
|
698
|
-
this.relatedData = relatedData;
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchRelatedSearchesWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
702
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxSearchRelatedSearchesWidget, selector: "app-searchstax-related-searches", inputs: { relatedSearchesURL: "relatedSearchesURL", relatedSearchesAPIKey: "relatedSearchesAPIKey", templateOverride: "templateOverride" }, ngImport: i0, template: "<div\n class=\"searchstax-related-searches-container\"\n [id]=\"'searchstax-related-searches-container' + rand\"\n *ngIf=\"relatedData && relatedData?.searchExecuted && relatedData?.hasRelatedSearches && !templateOverride\"\n>\n Related searches: <span id=\"searchstax-related-searches\"></span>\n <span class=\"searchstax-related-search\" *ngIf=\"relatedData.relatedSearches\">\n <span\n *ngFor=\"let related of relatedData.relatedSearches\"\n tabindex=\"0\"\n (click)=\"executeSearch(related, context)\"\n (keyup.enter)=\"executeSearch(related, context)\"\n (keyup.space)=\"executeSearch(related, context)\"\n class=\"searchstax-related-search searchstax-related-search-item\"\n >\n {{ related.related_search }}<span *ngIf=\"!related.last\">,</span>\n </span>\n </span>\n</div>\n\n<div *ngIf=\"relatedData && relatedData?.searchExecuted && relatedData?.hasRelatedSearches && templateOverride\">\n <ng-container *ngTemplateOutlet=\"templateOverride; context: context\"></ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
703
|
-
}
|
|
704
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchRelatedSearchesWidget, decorators: [{
|
|
705
|
-
type: Component,
|
|
706
|
-
args: [{ selector: "app-searchstax-related-searches", template: "<div\n class=\"searchstax-related-searches-container\"\n [id]=\"'searchstax-related-searches-container' + rand\"\n *ngIf=\"relatedData && relatedData?.searchExecuted && relatedData?.hasRelatedSearches && !templateOverride\"\n>\n Related searches: <span id=\"searchstax-related-searches\"></span>\n <span class=\"searchstax-related-search\" *ngIf=\"relatedData.relatedSearches\">\n <span\n *ngFor=\"let related of relatedData.relatedSearches\"\n tabindex=\"0\"\n (click)=\"executeSearch(related, context)\"\n (keyup.enter)=\"executeSearch(related, context)\"\n (keyup.space)=\"executeSearch(related, context)\"\n class=\"searchstax-related-search searchstax-related-search-item\"\n >\n {{ related.related_search }}<span *ngIf=\"!related.last\">,</span>\n </span>\n </span>\n</div>\n\n<div *ngIf=\"relatedData && relatedData?.searchExecuted && relatedData?.hasRelatedSearches && templateOverride\">\n <ng-container *ngTemplateOutlet=\"templateOverride; context: context\"></ng-container>\n</div>\n" }]
|
|
707
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { relatedSearchesURL: [{
|
|
708
|
-
type: Input
|
|
709
|
-
}], relatedSearchesAPIKey: [{
|
|
710
|
-
type: Input
|
|
711
|
-
}], templateOverride: [{
|
|
712
|
-
type: Input
|
|
713
|
-
}] } });
|
|
714
|
-
|
|
715
|
-
class SearchstaxSearchExternalPromotionsWidget {
|
|
716
|
-
constructor(storeServiceService) {
|
|
717
|
-
this.storeServiceService = storeServiceService;
|
|
718
|
-
this.externalPromotionsData = null;
|
|
719
|
-
this.rand = Math.random();
|
|
720
|
-
this.context = this;
|
|
721
|
-
}
|
|
722
|
-
ngOnInit() {
|
|
723
|
-
if (this.storeServiceService.searchstax) {
|
|
724
|
-
this.attachObservables();
|
|
725
|
-
setTimeout(() => {
|
|
726
|
-
this.storeServiceService.searchstax.addExternalPromotionsWidget("searchstax-external-promotions-layout-container" + this.rand, {});
|
|
727
|
-
}, 0);
|
|
728
|
-
}
|
|
729
|
-
else {
|
|
730
|
-
throw Error("Searchstax instance needs to be passed via props");
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
trackClick(externalPromotion, event, context) {
|
|
734
|
-
context.storeServiceService.searchstax.externalPromotionsWidget?.trackClick(externalPromotion, event);
|
|
735
|
-
}
|
|
736
|
-
attachObservables() {
|
|
737
|
-
this.storeServiceService.searchstax.dataLayer.$searchExternalPromotionsData.subscribe((externalPromotionsData) => {
|
|
738
|
-
this.externalPromotionsData = externalPromotionsData;
|
|
739
|
-
});
|
|
740
|
-
}
|
|
741
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchExternalPromotionsWidget, deps: [{ token: StoreServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
742
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchstaxSearchExternalPromotionsWidget, selector: "app-searchstax-external-promotions", inputs: { templateOverride: "templateOverride" }, ngImport: i0, template: "<div [id]=\"'searchstax-external-promotions-layout-container' + rand\">\n <div\n class=\"searchstax-external-promotions-container\"\n id=\"searchstax-external-promotions-container\"\n *ngIf=\"\n externalPromotionsData &&\n externalPromotionsData?.searchExecuted &&\n externalPromotionsData?.hasExternalPromotions &&\n !templateOverride\n \"\n >\n <div\n class=\"searchstax-external-promotion searchstax-search-result\"\n *ngFor=\"let externalPromotion of externalPromotionsData.externalPromotions\"\n >\n <div class=\"icon-elevated\"></div>\n <a\n *ngIf=\"externalPromotion.url\"\n [href]=\"externalPromotion.url\"\n (click)=\"trackClick(externalPromotion, $event, context)\"\n class=\"searchstax-result-item-link\"\n ></a>\n <div class=\"searchstax-search-result-title-container\">\n <span class=\"searchstax-search-result-title\">{{ externalPromotion.name }}</span>\n </div>\n <p\n *ngIf=\"externalPromotion.description\"\n class=\"searchstax-search-result-description searchstax-search-result-common\"\n >\n {{ externalPromotion.description }}\n </p>\n <p *ngIf=\"externalPromotion.url\" class=\"searchstax-search-result-description searchstax-search-result-common\">\n {{ externalPromotion.url }}\n </p>\n </div>\n </div>\n <div\n *ngIf=\"\n externalPromotionsData &&\n externalPromotionsData?.searchExecuted &&\n externalPromotionsData?.hasExternalPromotions &&\n templateOverride\n \"\n >\n <ng-container *ngTemplateOutlet=\"templateOverride; context: context\"></ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
743
|
-
}
|
|
744
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstaxSearchExternalPromotionsWidget, decorators: [{
|
|
745
|
-
type: Component,
|
|
746
|
-
args: [{ selector: "app-searchstax-external-promotions", template: "<div [id]=\"'searchstax-external-promotions-layout-container' + rand\">\n <div\n class=\"searchstax-external-promotions-container\"\n id=\"searchstax-external-promotions-container\"\n *ngIf=\"\n externalPromotionsData &&\n externalPromotionsData?.searchExecuted &&\n externalPromotionsData?.hasExternalPromotions &&\n !templateOverride\n \"\n >\n <div\n class=\"searchstax-external-promotion searchstax-search-result\"\n *ngFor=\"let externalPromotion of externalPromotionsData.externalPromotions\"\n >\n <div class=\"icon-elevated\"></div>\n <a\n *ngIf=\"externalPromotion.url\"\n [href]=\"externalPromotion.url\"\n (click)=\"trackClick(externalPromotion, $event, context)\"\n class=\"searchstax-result-item-link\"\n ></a>\n <div class=\"searchstax-search-result-title-container\">\n <span class=\"searchstax-search-result-title\">{{ externalPromotion.name }}</span>\n </div>\n <p\n *ngIf=\"externalPromotion.description\"\n class=\"searchstax-search-result-description searchstax-search-result-common\"\n >\n {{ externalPromotion.description }}\n </p>\n <p *ngIf=\"externalPromotion.url\" class=\"searchstax-search-result-description searchstax-search-result-common\">\n {{ externalPromotion.url }}\n </p>\n </div>\n </div>\n <div\n *ngIf=\"\n externalPromotionsData &&\n externalPromotionsData?.searchExecuted &&\n externalPromotionsData?.hasExternalPromotions &&\n templateOverride\n \"\n >\n <ng-container *ngTemplateOutlet=\"templateOverride; context: context\"></ng-container>\n </div>\n</div>\n" }]
|
|
747
|
-
}], ctorParameters: () => [{ type: StoreServiceService }], propDecorators: { templateOverride: [{
|
|
748
|
-
type: Input
|
|
749
|
-
}] } });
|
|
750
|
-
|
|
751
|
-
class SearchstudioUxAngularModule {
|
|
752
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstudioUxAngularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
753
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: SearchstudioUxAngularModule, declarations: [SearchstaxWrapper,
|
|
754
|
-
SearchstaxInputWidget,
|
|
755
|
-
SearchstaxResultsWidget,
|
|
756
|
-
SearchstaxSearchFeedbackWidget,
|
|
757
|
-
SearchstaxSearchPaginationWidget,
|
|
758
|
-
SearchstaxSearchFacetsWidget,
|
|
759
|
-
SearchstaxSearchSortingWidget,
|
|
760
|
-
SearchstaxSearchRelatedSearchesWidget,
|
|
761
|
-
SearchstaxSearchExternalPromotionsWidget,
|
|
762
|
-
SearchstaxSearchAnswerWidget,
|
|
763
|
-
SearchstaxSearchLocationWidget], imports: [CommonModule, FormsModule], exports: [SearchstaxWrapper,
|
|
764
|
-
SearchstaxInputWidget,
|
|
765
|
-
SearchstaxResultsWidget,
|
|
766
|
-
SearchstaxSearchFeedbackWidget,
|
|
767
|
-
SearchstaxSearchPaginationWidget,
|
|
768
|
-
SearchstaxSearchFacetsWidget,
|
|
769
|
-
SearchstaxSearchSortingWidget,
|
|
770
|
-
SearchstaxSearchRelatedSearchesWidget,
|
|
771
|
-
SearchstaxSearchExternalPromotionsWidget,
|
|
772
|
-
SearchstaxSearchAnswerWidget,
|
|
773
|
-
SearchstaxSearchLocationWidget] }); }
|
|
774
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstudioUxAngularModule, imports: [CommonModule, FormsModule] }); }
|
|
775
|
-
}
|
|
776
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchstudioUxAngularModule, decorators: [{
|
|
777
|
-
type: NgModule,
|
|
778
|
-
args: [{
|
|
779
|
-
declarations: [
|
|
780
|
-
SearchstaxWrapper,
|
|
781
|
-
SearchstaxInputWidget,
|
|
782
|
-
SearchstaxResultsWidget,
|
|
783
|
-
SearchstaxSearchFeedbackWidget,
|
|
784
|
-
SearchstaxSearchPaginationWidget,
|
|
785
|
-
SearchstaxSearchFacetsWidget,
|
|
786
|
-
SearchstaxSearchSortingWidget,
|
|
787
|
-
SearchstaxSearchRelatedSearchesWidget,
|
|
788
|
-
SearchstaxSearchExternalPromotionsWidget,
|
|
789
|
-
SearchstaxSearchAnswerWidget,
|
|
790
|
-
SearchstaxSearchLocationWidget
|
|
791
|
-
],
|
|
792
|
-
imports: [CommonModule, FormsModule],
|
|
793
|
-
exports: [
|
|
794
|
-
SearchstaxWrapper,
|
|
795
|
-
SearchstaxInputWidget,
|
|
796
|
-
SearchstaxResultsWidget,
|
|
797
|
-
SearchstaxSearchFeedbackWidget,
|
|
798
|
-
SearchstaxSearchPaginationWidget,
|
|
799
|
-
SearchstaxSearchFacetsWidget,
|
|
800
|
-
SearchstaxSearchSortingWidget,
|
|
801
|
-
SearchstaxSearchRelatedSearchesWidget,
|
|
802
|
-
SearchstaxSearchExternalPromotionsWidget,
|
|
803
|
-
SearchstaxSearchAnswerWidget,
|
|
804
|
-
SearchstaxSearchLocationWidget
|
|
805
|
-
],
|
|
806
|
-
}]
|
|
807
|
-
}] });
|
|
808
|
-
|
|
809
|
-
/*
|
|
810
|
-
* Public API Surface of searchstudio-ux-angular
|
|
811
|
-
*/
|
|
812
|
-
|
|
813
|
-
/**
|
|
814
|
-
* Generated bundle index. Do not edit.
|
|
815
|
-
*/
|
|
816
|
-
|
|
817
|
-
export { SearchstaxInputWidget, SearchstaxResultsWidget, SearchstaxSearchAnswerWidget, SearchstaxSearchExternalPromotionsWidget, SearchstaxSearchFacetsWidget, SearchstaxSearchFeedbackWidget, SearchstaxSearchLocationWidget, SearchstaxSearchPaginationWidget, SearchstaxSearchRelatedSearchesWidget, SearchstaxSearchSortingWidget, SearchstaxWrapper, SearchstudioUxAngularModule, StoreServiceService };
|
|
818
|
-
//# sourceMappingURL=searchstax-inc-searchstudio-ux-angular.mjs.map
|