@getlupa/client 0.5.1-alpha-2 → 0.5.1-alpha-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +3 -0
- package/dist/cjs/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +4 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.min.js +55 -18
- package/dist/cjs/types/product-list/ProductListOptions.d.ts +2 -2
- package/dist/cjs/types/search-results/RoutingBehavior.d.ts +1 -0
- package/dist/cjs/types/search-results/SearchResultsProductCardOptions.d.ts +2 -0
- package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +3 -0
- package/dist/es/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +4 -0
- package/dist/es/index.d.ts +2 -2
- package/dist/es/index.min.js +55 -18
- package/dist/es/types/product-list/ProductListOptions.d.ts +2 -2
- package/dist/es/types/search-results/RoutingBehavior.d.ts +1 -0
- package/dist/es/types/search-results/SearchResultsProductCardOptions.d.ts +2 -0
- package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +3 -0
- package/dist/iife/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +4 -0
- package/dist/iife/index.d.ts +2 -2
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/types/product-list/ProductListOptions.d.ts +2 -2
- package/dist/iife/types/search-results/RoutingBehavior.d.ts +1 -0
- package/dist/iife/types/search-results/SearchResultsProductCardOptions.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export default class SearchResultsProductCard extends Vue {
|
|
|
22
22
|
get detailElements(): DocumentElement[];
|
|
23
23
|
get labels(): SearchResultsOptionLabels;
|
|
24
24
|
get link(): string;
|
|
25
|
+
get hasEventRouting(): boolean;
|
|
26
|
+
get url(): string | undefined;
|
|
25
27
|
isInStock: boolean;
|
|
26
28
|
mounted(): void;
|
|
27
29
|
checkIfIsInStock(): Promise<void>;
|
|
@@ -30,4 +32,5 @@ export default class SearchResultsProductCard extends Vue {
|
|
|
30
32
|
handleProductEvent(item: {
|
|
31
33
|
type: ReportableEventType;
|
|
32
34
|
}): void;
|
|
35
|
+
handleNavigation(): void;
|
|
33
36
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
2
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
3
3
|
import { TitleDocumentElement } from "@/types/DocumentElement";
|
|
4
|
+
import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
|
|
4
5
|
export default class SearchResultsProductTitle extends Vue {
|
|
5
6
|
item: Document;
|
|
6
7
|
options: TitleDocumentElement;
|
|
7
8
|
link: string;
|
|
9
|
+
searchResultOptions: SearchResultsOptions;
|
|
8
10
|
get title(): unknown;
|
|
9
11
|
get isHtml(): boolean;
|
|
10
12
|
get maxLines(): number;
|
|
13
|
+
get hasEventRouting(): boolean;
|
|
14
|
+
handleNavigation(): void;
|
|
11
15
|
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
|
|
2
2
|
import { SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
3
|
-
import { TrackingOptions } from "./types/General";
|
|
3
|
+
import { SdkOptions, TrackingOptions } from "./types/General";
|
|
4
4
|
import { ProductListOptions } from "./types/product-list/ProductListOptions";
|
|
5
5
|
declare const lupaSearch: {
|
|
6
6
|
searchBox: (options: SearchBoxOptions) => void;
|
|
@@ -11,5 +11,5 @@ declare const lupaSearch: {
|
|
|
11
11
|
clearSearchResults: () => void;
|
|
12
12
|
clearProductList: () => void;
|
|
13
13
|
};
|
|
14
|
-
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions };
|
|
14
|
+
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, };
|
|
15
15
|
export default lupaSearch;
|
package/dist/cjs/index.min.js
CHANGED
|
@@ -19340,7 +19340,7 @@ var defaultSuggestedValue = {
|
|
|
19340
19340
|
var history$1 = namespace("history");
|
|
19341
19341
|
var params$d = namespace("params");
|
|
19342
19342
|
var searchBox$2 = namespace("searchBox");
|
|
19343
|
-
var options$
|
|
19343
|
+
var options$7 = namespace("options");
|
|
19344
19344
|
var tracking$4 = namespace("tracking");
|
|
19345
19345
|
|
|
19346
19346
|
var SearchBox = /*#__PURE__*/function (_Vue) {
|
|
@@ -19624,7 +19624,7 @@ __decorate([tracking$4.Action("track")], SearchBox.prototype, "trackClick", void
|
|
|
19624
19624
|
|
|
19625
19625
|
__decorate([params$d.Action("setSearchResultsLink")], SearchBox.prototype, "setSearchResultsLink", void 0);
|
|
19626
19626
|
|
|
19627
|
-
__decorate([options$
|
|
19627
|
+
__decorate([options$7.Mutation("setSearchBoxOptions")], SearchBox.prototype, "setSearchBoxOptions", void 0);
|
|
19628
19628
|
|
|
19629
19629
|
__decorate([params$d.Action("goToResults")], SearchBox.prototype, "goToResults", void 0);
|
|
19630
19630
|
|
|
@@ -21788,7 +21788,7 @@ var toggleHierarchyParam = function toggleHierarchyParam() {
|
|
|
21788
21788
|
|
|
21789
21789
|
var searchResult$g = namespace("searchResult");
|
|
21790
21790
|
var params$c = namespace("params");
|
|
21791
|
-
var options$
|
|
21791
|
+
var options$6 = namespace("options");
|
|
21792
21792
|
|
|
21793
21793
|
var CurrentFilters = /*#__PURE__*/function (_Vue) {
|
|
21794
21794
|
_inherits(CurrentFilters, _Vue);
|
|
@@ -21865,7 +21865,7 @@ __decorate([searchResult$g.Getter("displayFilters")], CurrentFilters.prototype,
|
|
|
21865
21865
|
|
|
21866
21866
|
__decorate([searchResult$g.Getter("currentFilterCount")], CurrentFilters.prototype, "currentFilterCount", void 0);
|
|
21867
21867
|
|
|
21868
|
-
__decorate([options$
|
|
21868
|
+
__decorate([options$6.Getter("initialFilters")], CurrentFilters.prototype, "initialFilters", void 0);
|
|
21869
21869
|
|
|
21870
21870
|
__decorate([params$c.Action("removeParams")], CurrentFilters.prototype, "removeParams", void 0);
|
|
21871
21871
|
|
|
@@ -24800,7 +24800,7 @@ var _typeof = _typeof$2.exports.default;
|
|
|
24800
24800
|
|
|
24801
24801
|
var VueSlider = /*@__PURE__*/getDefaultExportFromCjs(vueSliderComponent_umd_min.exports);
|
|
24802
24802
|
|
|
24803
|
-
var options$
|
|
24803
|
+
var options$5 = namespace("options");
|
|
24804
24804
|
|
|
24805
24805
|
var TermFacet = /*#__PURE__*/function (_Vue) {
|
|
24806
24806
|
_inherits(TermFacet, _Vue);
|
|
@@ -25007,7 +25007,7 @@ __decorate([Prop({
|
|
|
25007
25007
|
}
|
|
25008
25008
|
})], TermFacet.prototype, "currentFilters", void 0);
|
|
25009
25009
|
|
|
25010
|
-
__decorate([options$
|
|
25010
|
+
__decorate([options$5.State(function (s) {
|
|
25011
25011
|
return s.searchResultOptions;
|
|
25012
25012
|
})], TermFacet.prototype, "searchResultOptions", void 0);
|
|
25013
25013
|
|
|
@@ -26141,7 +26141,7 @@ var __vue_component__$E = /*#__PURE__*/normalizeComponent({
|
|
|
26141
26141
|
staticRenderFns: __vue_staticRenderFns__$E
|
|
26142
26142
|
}, __vue_inject_styles__$E, __vue_script__$E, __vue_scope_id__$E, __vue_is_functional_template__$E, __vue_module_identifier__$E, false, undefined, undefined, undefined);
|
|
26143
26143
|
|
|
26144
|
-
var options$
|
|
26144
|
+
var options$4 = namespace("options");
|
|
26145
26145
|
|
|
26146
26146
|
var CategoryFilter = /*#__PURE__*/function (_Vue) {
|
|
26147
26147
|
_inherits(CategoryFilter, _Vue);
|
|
@@ -26270,7 +26270,7 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
|
|
|
26270
26270
|
|
|
26271
26271
|
__decorate([Prop()], CategoryFilter.prototype, "options", void 0);
|
|
26272
26272
|
|
|
26273
|
-
__decorate([options$
|
|
26273
|
+
__decorate([options$4.Getter("envOptions")], CategoryFilter.prototype, "envOptions", void 0);
|
|
26274
26274
|
|
|
26275
26275
|
CategoryFilter = __decorate([Component({
|
|
26276
26276
|
name: "categoryFilter",
|
|
@@ -27258,6 +27258,8 @@ var __vue_component__$v = /*#__PURE__*/normalizeComponent({
|
|
|
27258
27258
|
staticRenderFns: __vue_staticRenderFns__$v
|
|
27259
27259
|
}, __vue_inject_styles__$v, __vue_script__$v, __vue_scope_id__$v, __vue_is_functional_template__$v, __vue_module_identifier__$v, false, undefined, undefined, undefined);
|
|
27260
27260
|
|
|
27261
|
+
var options$3 = namespace("options");
|
|
27262
|
+
|
|
27261
27263
|
var SearchResultsProductTitle = /*#__PURE__*/function (_Vue) {
|
|
27262
27264
|
_inherits(SearchResultsProductTitle, _Vue);
|
|
27263
27265
|
|
|
@@ -27286,6 +27288,16 @@ var SearchResultsProductTitle = /*#__PURE__*/function (_Vue) {
|
|
|
27286
27288
|
get: function get() {
|
|
27287
27289
|
return this.options.maxLines;
|
|
27288
27290
|
}
|
|
27291
|
+
}, {
|
|
27292
|
+
key: "hasEventRouting",
|
|
27293
|
+
get: function get() {
|
|
27294
|
+
return this.searchResultOptions.routingBehavior === "event";
|
|
27295
|
+
}
|
|
27296
|
+
}, {
|
|
27297
|
+
key: "handleNavigation",
|
|
27298
|
+
value: function handleNavigation() {
|
|
27299
|
+
emitRoutingEvent(this.link);
|
|
27300
|
+
}
|
|
27289
27301
|
}]);
|
|
27290
27302
|
|
|
27291
27303
|
return SearchResultsProductTitle;
|
|
@@ -27299,6 +27311,10 @@ __decorate([Prop({
|
|
|
27299
27311
|
default: ""
|
|
27300
27312
|
})], SearchResultsProductTitle.prototype, "link", void 0);
|
|
27301
27313
|
|
|
27314
|
+
__decorate([options$3.State(function (o) {
|
|
27315
|
+
return o.searchResultOptions;
|
|
27316
|
+
})], SearchResultsProductTitle.prototype, "searchResultOptions", void 0);
|
|
27317
|
+
|
|
27302
27318
|
SearchResultsProductTitle = __decorate([Component({
|
|
27303
27319
|
name: "searchResultsProductTitle"
|
|
27304
27320
|
})], SearchResultsProductTitle);
|
|
@@ -27325,12 +27341,14 @@ var __vue_render__$u = function __vue_render__() {
|
|
|
27325
27341
|
style: "-webkit-line-clamp: " + _vm.maxLines
|
|
27326
27342
|
}, [!_vm.options.link ? _c("span", {
|
|
27327
27343
|
staticClass: "lupa-search-results-product-title-text"
|
|
27328
|
-
}, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _vm._v(" "), _vm.options.link ? _c("a", {
|
|
27344
|
+
}, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _vm._v(" "), _vm.options.link ? _c("a", _vm._g({
|
|
27329
27345
|
staticClass: "lupa-search-results-product-title-text lupa-title-link",
|
|
27330
27346
|
attrs: {
|
|
27331
|
-
href: _vm.link
|
|
27347
|
+
href: _vm.hasEventRouting ? undefined : _vm.link
|
|
27332
27348
|
}
|
|
27333
|
-
},
|
|
27349
|
+
}, _vm.hasEventRouting ? {
|
|
27350
|
+
click: _vm.handleNavigation
|
|
27351
|
+
} : {}), [_vm._v(_vm._s(_vm.title))]) : _vm._e()]);
|
|
27334
27352
|
};
|
|
27335
27353
|
|
|
27336
27354
|
var __vue_staticRenderFns__$u = [];
|
|
@@ -28288,6 +28306,16 @@ var SearchResultsProductCard = /*#__PURE__*/function (_Vue) {
|
|
|
28288
28306
|
|
|
28289
28307
|
return generateLink((_c = (_b = this.options.links) === null || _b === void 0 ? void 0 : _b.details) !== null && _c !== void 0 ? _c : "", this.product);
|
|
28290
28308
|
}
|
|
28309
|
+
}, {
|
|
28310
|
+
key: "hasEventRouting",
|
|
28311
|
+
get: function get() {
|
|
28312
|
+
return this.options.routingBehavior === "event";
|
|
28313
|
+
}
|
|
28314
|
+
}, {
|
|
28315
|
+
key: "url",
|
|
28316
|
+
get: function get() {
|
|
28317
|
+
return this.hasEventRouting ? undefined : this.link;
|
|
28318
|
+
}
|
|
28291
28319
|
}, {
|
|
28292
28320
|
key: "mounted",
|
|
28293
28321
|
value: function mounted() {
|
|
@@ -28365,6 +28393,11 @@ var SearchResultsProductCard = /*#__PURE__*/function (_Vue) {
|
|
|
28365
28393
|
}
|
|
28366
28394
|
});
|
|
28367
28395
|
}
|
|
28396
|
+
}, {
|
|
28397
|
+
key: "handleNavigation",
|
|
28398
|
+
value: function handleNavigation() {
|
|
28399
|
+
emitRoutingEvent(this.link);
|
|
28400
|
+
}
|
|
28368
28401
|
}]);
|
|
28369
28402
|
|
|
28370
28403
|
return SearchResultsProductCard;
|
|
@@ -28424,12 +28457,14 @@ var __vue_render__$l = function __vue_render__() {
|
|
|
28424
28457
|
}
|
|
28425
28458
|
}), _vm._v(" "), _c("div", {
|
|
28426
28459
|
class: ["lupa-search-result-product-contents", _vm.listLayoutClass]
|
|
28427
|
-
}, [_c("a", {
|
|
28460
|
+
}, [_c("a", _vm._g({
|
|
28428
28461
|
staticClass: "lupa-search-result-product-image-section",
|
|
28429
28462
|
attrs: {
|
|
28430
|
-
href: _vm.
|
|
28463
|
+
href: _vm.url || undefined
|
|
28431
28464
|
}
|
|
28432
|
-
}, _vm.
|
|
28465
|
+
}, _vm.hasEventRouting ? {
|
|
28466
|
+
click: _vm.handleNavigation
|
|
28467
|
+
} : {}), _vm._l(_vm.imageElements, function (element) {
|
|
28433
28468
|
return _c("SearchResultsProductCardElement", {
|
|
28434
28469
|
key: element.key,
|
|
28435
28470
|
staticClass: "lupa-search-results-product-element",
|
|
@@ -30247,7 +30282,7 @@ var SearchResultsProducts = /*#__PURE__*/function (_Vue) {
|
|
|
30247
30282
|
_createClass(SearchResultsProducts, [{
|
|
30248
30283
|
key: "productCardOptions",
|
|
30249
30284
|
value: function productCardOptions() {
|
|
30250
|
-
return pick(this.options, ["isInStock", "badges", "links", "elements", "labels", "queryKey", "idKey"]);
|
|
30285
|
+
return pick(this.options, ["isInStock", "badges", "links", "elements", "labels", "queryKey", "idKey", "routingBehavior"]);
|
|
30251
30286
|
}
|
|
30252
30287
|
}, {
|
|
30253
30288
|
key: "similarQueriesLabels",
|
|
@@ -30713,7 +30748,7 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
|
|
|
30713
30748
|
_createClass(SearchResults, [{
|
|
30714
30749
|
key: "productsOptions",
|
|
30715
30750
|
get: function get() {
|
|
30716
|
-
return pick(this.options, ["grid", "labels", "queryKey", "options", "pagination", "sort", "isInStock", "badges", "links", "elements", "additionalPanels", "idKey", "filters"]);
|
|
30751
|
+
return pick(this.options, ["grid", "labels", "queryKey", "options", "pagination", "sort", "isInStock", "badges", "links", "elements", "additionalPanels", "idKey", "filters", "routingBehavior"]);
|
|
30717
30752
|
}
|
|
30718
30753
|
}, {
|
|
30719
30754
|
key: "didYouMeanLabels",
|
|
@@ -30752,11 +30787,13 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
|
|
|
30752
30787
|
}, {
|
|
30753
30788
|
key: "handleMounted",
|
|
30754
30789
|
value: function handleMounted() {
|
|
30790
|
+
var _a, _b, _c;
|
|
30791
|
+
|
|
30755
30792
|
this.handleResize();
|
|
30756
30793
|
var params = new URLSearchParams(window.location.search);
|
|
30757
30794
|
this.handleUrlChange(params);
|
|
30758
30795
|
this.addParams(parseParams(params));
|
|
30759
|
-
this.setDefaultLimit(this.options.pagination.sizeSelection.sizes[0]);
|
|
30796
|
+
this.setDefaultLimit((_c = (_b = (_a = this.options.pagination) === null || _a === void 0 ? void 0 : _a.sizeSelection) === null || _b === void 0 ? void 0 : _b.sizes) === null || _c === void 0 ? void 0 : _c[0]);
|
|
30760
30797
|
}
|
|
30761
30798
|
}, {
|
|
30762
30799
|
key: "handleParamsChange",
|
|
@@ -30922,7 +30959,7 @@ var __vue_render__$4 = function __vue_render__() {
|
|
|
30922
30959
|
attrs: {
|
|
30923
30960
|
options: _vm.options.filters
|
|
30924
30961
|
}
|
|
30925
|
-
}) : _vm._e(), _vm._v(" "), _vm.currentQueryText ? _c("SearchResultsBreadcrumbs", {
|
|
30962
|
+
}) : _vm._e(), _vm._v(" "), _vm.currentQueryText || _vm.isProductList ? _c("SearchResultsBreadcrumbs", {
|
|
30926
30963
|
attrs: {
|
|
30927
30964
|
breadcrumbs: _vm.options.breadcrumbs
|
|
30928
30965
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FilterGroup } from "@getlupa/client-sdk/Types";
|
|
2
|
+
import { RoutingBehavior } from "../search-results/RoutingBehavior";
|
|
2
3
|
import { SearchResultsOptions } from "../search-results/SearchResultsOptions";
|
|
3
4
|
export declare type CategoryFilterOptions = {
|
|
4
5
|
queryKey: string;
|
|
@@ -21,8 +22,7 @@ export declare type CategoryFilterOptions = {
|
|
|
21
22
|
description: string;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
|
-
export declare type RoutingBehavior = "direct-link" | "event";
|
|
25
25
|
export declare type ProductListOptions = SearchResultsOptions & {
|
|
26
26
|
initialFilters?: FilterGroup;
|
|
27
|
-
categories
|
|
27
|
+
categories: CategoryFilterOptions;
|
|
28
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type RoutingBehavior = "direct-link" | "event";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
2
2
|
import { DocumentElement } from "../DocumentElement";
|
|
3
3
|
import { BadgeElement } from "./BadgeOptions";
|
|
4
|
+
import { RoutingBehavior } from "./RoutingBehavior";
|
|
4
5
|
import { SearchResultsOptionLabels } from "./SearchResultsOptions";
|
|
5
6
|
export declare type SearchResultsProductCardOptions = {
|
|
6
7
|
labels: SearchResultsOptionLabels;
|
|
8
|
+
routingBehavior?: RoutingBehavior;
|
|
7
9
|
isInStock: (doc: Document) => boolean;
|
|
8
10
|
badges: SearchResultBadgeOptions;
|
|
9
11
|
links: {
|
package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export default class SearchResultsProductCard extends Vue {
|
|
|
22
22
|
get detailElements(): DocumentElement[];
|
|
23
23
|
get labels(): SearchResultsOptionLabels;
|
|
24
24
|
get link(): string;
|
|
25
|
+
get hasEventRouting(): boolean;
|
|
26
|
+
get url(): string | undefined;
|
|
25
27
|
isInStock: boolean;
|
|
26
28
|
mounted(): void;
|
|
27
29
|
checkIfIsInStock(): Promise<void>;
|
|
@@ -30,4 +32,5 @@ export default class SearchResultsProductCard extends Vue {
|
|
|
30
32
|
handleProductEvent(item: {
|
|
31
33
|
type: ReportableEventType;
|
|
32
34
|
}): void;
|
|
35
|
+
handleNavigation(): void;
|
|
33
36
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
2
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
3
3
|
import { TitleDocumentElement } from "@/types/DocumentElement";
|
|
4
|
+
import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
|
|
4
5
|
export default class SearchResultsProductTitle extends Vue {
|
|
5
6
|
item: Document;
|
|
6
7
|
options: TitleDocumentElement;
|
|
7
8
|
link: string;
|
|
9
|
+
searchResultOptions: SearchResultsOptions;
|
|
8
10
|
get title(): unknown;
|
|
9
11
|
get isHtml(): boolean;
|
|
10
12
|
get maxLines(): number;
|
|
13
|
+
get hasEventRouting(): boolean;
|
|
14
|
+
handleNavigation(): void;
|
|
11
15
|
}
|
package/dist/es/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
|
|
2
2
|
import { SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
3
|
-
import { TrackingOptions } from "./types/General";
|
|
3
|
+
import { SdkOptions, TrackingOptions } from "./types/General";
|
|
4
4
|
import { ProductListOptions } from "./types/product-list/ProductListOptions";
|
|
5
5
|
declare const lupaSearch: {
|
|
6
6
|
searchBox: (options: SearchBoxOptions) => void;
|
|
@@ -11,5 +11,5 @@ declare const lupaSearch: {
|
|
|
11
11
|
clearSearchResults: () => void;
|
|
12
12
|
clearProductList: () => void;
|
|
13
13
|
};
|
|
14
|
-
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions };
|
|
14
|
+
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, };
|
|
15
15
|
export default lupaSearch;
|
package/dist/es/index.min.js
CHANGED
|
@@ -19336,7 +19336,7 @@ var defaultSuggestedValue = {
|
|
|
19336
19336
|
var history$1 = namespace("history");
|
|
19337
19337
|
var params$d = namespace("params");
|
|
19338
19338
|
var searchBox$2 = namespace("searchBox");
|
|
19339
|
-
var options$
|
|
19339
|
+
var options$7 = namespace("options");
|
|
19340
19340
|
var tracking$4 = namespace("tracking");
|
|
19341
19341
|
|
|
19342
19342
|
var SearchBox = /*#__PURE__*/function (_Vue) {
|
|
@@ -19620,7 +19620,7 @@ __decorate([tracking$4.Action("track")], SearchBox.prototype, "trackClick", void
|
|
|
19620
19620
|
|
|
19621
19621
|
__decorate([params$d.Action("setSearchResultsLink")], SearchBox.prototype, "setSearchResultsLink", void 0);
|
|
19622
19622
|
|
|
19623
|
-
__decorate([options$
|
|
19623
|
+
__decorate([options$7.Mutation("setSearchBoxOptions")], SearchBox.prototype, "setSearchBoxOptions", void 0);
|
|
19624
19624
|
|
|
19625
19625
|
__decorate([params$d.Action("goToResults")], SearchBox.prototype, "goToResults", void 0);
|
|
19626
19626
|
|
|
@@ -21784,7 +21784,7 @@ var toggleHierarchyParam = function toggleHierarchyParam() {
|
|
|
21784
21784
|
|
|
21785
21785
|
var searchResult$g = namespace("searchResult");
|
|
21786
21786
|
var params$c = namespace("params");
|
|
21787
|
-
var options$
|
|
21787
|
+
var options$6 = namespace("options");
|
|
21788
21788
|
|
|
21789
21789
|
var CurrentFilters = /*#__PURE__*/function (_Vue) {
|
|
21790
21790
|
_inherits(CurrentFilters, _Vue);
|
|
@@ -21861,7 +21861,7 @@ __decorate([searchResult$g.Getter("displayFilters")], CurrentFilters.prototype,
|
|
|
21861
21861
|
|
|
21862
21862
|
__decorate([searchResult$g.Getter("currentFilterCount")], CurrentFilters.prototype, "currentFilterCount", void 0);
|
|
21863
21863
|
|
|
21864
|
-
__decorate([options$
|
|
21864
|
+
__decorate([options$6.Getter("initialFilters")], CurrentFilters.prototype, "initialFilters", void 0);
|
|
21865
21865
|
|
|
21866
21866
|
__decorate([params$c.Action("removeParams")], CurrentFilters.prototype, "removeParams", void 0);
|
|
21867
21867
|
|
|
@@ -24796,7 +24796,7 @@ var _typeof = _typeof$2.exports.default;
|
|
|
24796
24796
|
|
|
24797
24797
|
var VueSlider = /*@__PURE__*/getDefaultExportFromCjs(vueSliderComponent_umd_min.exports);
|
|
24798
24798
|
|
|
24799
|
-
var options$
|
|
24799
|
+
var options$5 = namespace("options");
|
|
24800
24800
|
|
|
24801
24801
|
var TermFacet = /*#__PURE__*/function (_Vue) {
|
|
24802
24802
|
_inherits(TermFacet, _Vue);
|
|
@@ -25003,7 +25003,7 @@ __decorate([Prop({
|
|
|
25003
25003
|
}
|
|
25004
25004
|
})], TermFacet.prototype, "currentFilters", void 0);
|
|
25005
25005
|
|
|
25006
|
-
__decorate([options$
|
|
25006
|
+
__decorate([options$5.State(function (s) {
|
|
25007
25007
|
return s.searchResultOptions;
|
|
25008
25008
|
})], TermFacet.prototype, "searchResultOptions", void 0);
|
|
25009
25009
|
|
|
@@ -26137,7 +26137,7 @@ var __vue_component__$E = /*#__PURE__*/normalizeComponent({
|
|
|
26137
26137
|
staticRenderFns: __vue_staticRenderFns__$E
|
|
26138
26138
|
}, __vue_inject_styles__$E, __vue_script__$E, __vue_scope_id__$E, __vue_is_functional_template__$E, __vue_module_identifier__$E, false, undefined, undefined, undefined);
|
|
26139
26139
|
|
|
26140
|
-
var options$
|
|
26140
|
+
var options$4 = namespace("options");
|
|
26141
26141
|
|
|
26142
26142
|
var CategoryFilter = /*#__PURE__*/function (_Vue) {
|
|
26143
26143
|
_inherits(CategoryFilter, _Vue);
|
|
@@ -26266,7 +26266,7 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
|
|
|
26266
26266
|
|
|
26267
26267
|
__decorate([Prop()], CategoryFilter.prototype, "options", void 0);
|
|
26268
26268
|
|
|
26269
|
-
__decorate([options$
|
|
26269
|
+
__decorate([options$4.Getter("envOptions")], CategoryFilter.prototype, "envOptions", void 0);
|
|
26270
26270
|
|
|
26271
26271
|
CategoryFilter = __decorate([Component({
|
|
26272
26272
|
name: "categoryFilter",
|
|
@@ -27254,6 +27254,8 @@ var __vue_component__$v = /*#__PURE__*/normalizeComponent({
|
|
|
27254
27254
|
staticRenderFns: __vue_staticRenderFns__$v
|
|
27255
27255
|
}, __vue_inject_styles__$v, __vue_script__$v, __vue_scope_id__$v, __vue_is_functional_template__$v, __vue_module_identifier__$v, false, undefined, undefined, undefined);
|
|
27256
27256
|
|
|
27257
|
+
var options$3 = namespace("options");
|
|
27258
|
+
|
|
27257
27259
|
var SearchResultsProductTitle = /*#__PURE__*/function (_Vue) {
|
|
27258
27260
|
_inherits(SearchResultsProductTitle, _Vue);
|
|
27259
27261
|
|
|
@@ -27282,6 +27284,16 @@ var SearchResultsProductTitle = /*#__PURE__*/function (_Vue) {
|
|
|
27282
27284
|
get: function get() {
|
|
27283
27285
|
return this.options.maxLines;
|
|
27284
27286
|
}
|
|
27287
|
+
}, {
|
|
27288
|
+
key: "hasEventRouting",
|
|
27289
|
+
get: function get() {
|
|
27290
|
+
return this.searchResultOptions.routingBehavior === "event";
|
|
27291
|
+
}
|
|
27292
|
+
}, {
|
|
27293
|
+
key: "handleNavigation",
|
|
27294
|
+
value: function handleNavigation() {
|
|
27295
|
+
emitRoutingEvent(this.link);
|
|
27296
|
+
}
|
|
27285
27297
|
}]);
|
|
27286
27298
|
|
|
27287
27299
|
return SearchResultsProductTitle;
|
|
@@ -27295,6 +27307,10 @@ __decorate([Prop({
|
|
|
27295
27307
|
default: ""
|
|
27296
27308
|
})], SearchResultsProductTitle.prototype, "link", void 0);
|
|
27297
27309
|
|
|
27310
|
+
__decorate([options$3.State(function (o) {
|
|
27311
|
+
return o.searchResultOptions;
|
|
27312
|
+
})], SearchResultsProductTitle.prototype, "searchResultOptions", void 0);
|
|
27313
|
+
|
|
27298
27314
|
SearchResultsProductTitle = __decorate([Component({
|
|
27299
27315
|
name: "searchResultsProductTitle"
|
|
27300
27316
|
})], SearchResultsProductTitle);
|
|
@@ -27321,12 +27337,14 @@ var __vue_render__$u = function __vue_render__() {
|
|
|
27321
27337
|
style: "-webkit-line-clamp: " + _vm.maxLines
|
|
27322
27338
|
}, [!_vm.options.link ? _c("span", {
|
|
27323
27339
|
staticClass: "lupa-search-results-product-title-text"
|
|
27324
|
-
}, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _vm._v(" "), _vm.options.link ? _c("a", {
|
|
27340
|
+
}, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _vm._v(" "), _vm.options.link ? _c("a", _vm._g({
|
|
27325
27341
|
staticClass: "lupa-search-results-product-title-text lupa-title-link",
|
|
27326
27342
|
attrs: {
|
|
27327
|
-
href: _vm.link
|
|
27343
|
+
href: _vm.hasEventRouting ? undefined : _vm.link
|
|
27328
27344
|
}
|
|
27329
|
-
},
|
|
27345
|
+
}, _vm.hasEventRouting ? {
|
|
27346
|
+
click: _vm.handleNavigation
|
|
27347
|
+
} : {}), [_vm._v(_vm._s(_vm.title))]) : _vm._e()]);
|
|
27330
27348
|
};
|
|
27331
27349
|
|
|
27332
27350
|
var __vue_staticRenderFns__$u = [];
|
|
@@ -28284,6 +28302,16 @@ var SearchResultsProductCard = /*#__PURE__*/function (_Vue) {
|
|
|
28284
28302
|
|
|
28285
28303
|
return generateLink((_c = (_b = this.options.links) === null || _b === void 0 ? void 0 : _b.details) !== null && _c !== void 0 ? _c : "", this.product);
|
|
28286
28304
|
}
|
|
28305
|
+
}, {
|
|
28306
|
+
key: "hasEventRouting",
|
|
28307
|
+
get: function get() {
|
|
28308
|
+
return this.options.routingBehavior === "event";
|
|
28309
|
+
}
|
|
28310
|
+
}, {
|
|
28311
|
+
key: "url",
|
|
28312
|
+
get: function get() {
|
|
28313
|
+
return this.hasEventRouting ? undefined : this.link;
|
|
28314
|
+
}
|
|
28287
28315
|
}, {
|
|
28288
28316
|
key: "mounted",
|
|
28289
28317
|
value: function mounted() {
|
|
@@ -28361,6 +28389,11 @@ var SearchResultsProductCard = /*#__PURE__*/function (_Vue) {
|
|
|
28361
28389
|
}
|
|
28362
28390
|
});
|
|
28363
28391
|
}
|
|
28392
|
+
}, {
|
|
28393
|
+
key: "handleNavigation",
|
|
28394
|
+
value: function handleNavigation() {
|
|
28395
|
+
emitRoutingEvent(this.link);
|
|
28396
|
+
}
|
|
28364
28397
|
}]);
|
|
28365
28398
|
|
|
28366
28399
|
return SearchResultsProductCard;
|
|
@@ -28420,12 +28453,14 @@ var __vue_render__$l = function __vue_render__() {
|
|
|
28420
28453
|
}
|
|
28421
28454
|
}), _vm._v(" "), _c("div", {
|
|
28422
28455
|
class: ["lupa-search-result-product-contents", _vm.listLayoutClass]
|
|
28423
|
-
}, [_c("a", {
|
|
28456
|
+
}, [_c("a", _vm._g({
|
|
28424
28457
|
staticClass: "lupa-search-result-product-image-section",
|
|
28425
28458
|
attrs: {
|
|
28426
|
-
href: _vm.
|
|
28459
|
+
href: _vm.url || undefined
|
|
28427
28460
|
}
|
|
28428
|
-
}, _vm.
|
|
28461
|
+
}, _vm.hasEventRouting ? {
|
|
28462
|
+
click: _vm.handleNavigation
|
|
28463
|
+
} : {}), _vm._l(_vm.imageElements, function (element) {
|
|
28429
28464
|
return _c("SearchResultsProductCardElement", {
|
|
28430
28465
|
key: element.key,
|
|
28431
28466
|
staticClass: "lupa-search-results-product-element",
|
|
@@ -30243,7 +30278,7 @@ var SearchResultsProducts = /*#__PURE__*/function (_Vue) {
|
|
|
30243
30278
|
_createClass(SearchResultsProducts, [{
|
|
30244
30279
|
key: "productCardOptions",
|
|
30245
30280
|
value: function productCardOptions() {
|
|
30246
|
-
return pick(this.options, ["isInStock", "badges", "links", "elements", "labels", "queryKey", "idKey"]);
|
|
30281
|
+
return pick(this.options, ["isInStock", "badges", "links", "elements", "labels", "queryKey", "idKey", "routingBehavior"]);
|
|
30247
30282
|
}
|
|
30248
30283
|
}, {
|
|
30249
30284
|
key: "similarQueriesLabels",
|
|
@@ -30709,7 +30744,7 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
|
|
|
30709
30744
|
_createClass(SearchResults, [{
|
|
30710
30745
|
key: "productsOptions",
|
|
30711
30746
|
get: function get() {
|
|
30712
|
-
return pick(this.options, ["grid", "labels", "queryKey", "options", "pagination", "sort", "isInStock", "badges", "links", "elements", "additionalPanels", "idKey", "filters"]);
|
|
30747
|
+
return pick(this.options, ["grid", "labels", "queryKey", "options", "pagination", "sort", "isInStock", "badges", "links", "elements", "additionalPanels", "idKey", "filters", "routingBehavior"]);
|
|
30713
30748
|
}
|
|
30714
30749
|
}, {
|
|
30715
30750
|
key: "didYouMeanLabels",
|
|
@@ -30748,11 +30783,13 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
|
|
|
30748
30783
|
}, {
|
|
30749
30784
|
key: "handleMounted",
|
|
30750
30785
|
value: function handleMounted() {
|
|
30786
|
+
var _a, _b, _c;
|
|
30787
|
+
|
|
30751
30788
|
this.handleResize();
|
|
30752
30789
|
var params = new URLSearchParams(window.location.search);
|
|
30753
30790
|
this.handleUrlChange(params);
|
|
30754
30791
|
this.addParams(parseParams(params));
|
|
30755
|
-
this.setDefaultLimit(this.options.pagination.sizeSelection.sizes[0]);
|
|
30792
|
+
this.setDefaultLimit((_c = (_b = (_a = this.options.pagination) === null || _a === void 0 ? void 0 : _a.sizeSelection) === null || _b === void 0 ? void 0 : _b.sizes) === null || _c === void 0 ? void 0 : _c[0]);
|
|
30756
30793
|
}
|
|
30757
30794
|
}, {
|
|
30758
30795
|
key: "handleParamsChange",
|
|
@@ -30918,7 +30955,7 @@ var __vue_render__$4 = function __vue_render__() {
|
|
|
30918
30955
|
attrs: {
|
|
30919
30956
|
options: _vm.options.filters
|
|
30920
30957
|
}
|
|
30921
|
-
}) : _vm._e(), _vm._v(" "), _vm.currentQueryText ? _c("SearchResultsBreadcrumbs", {
|
|
30958
|
+
}) : _vm._e(), _vm._v(" "), _vm.currentQueryText || _vm.isProductList ? _c("SearchResultsBreadcrumbs", {
|
|
30922
30959
|
attrs: {
|
|
30923
30960
|
breadcrumbs: _vm.options.breadcrumbs
|
|
30924
30961
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FilterGroup } from "@getlupa/client-sdk/Types";
|
|
2
|
+
import { RoutingBehavior } from "../search-results/RoutingBehavior";
|
|
2
3
|
import { SearchResultsOptions } from "../search-results/SearchResultsOptions";
|
|
3
4
|
export declare type CategoryFilterOptions = {
|
|
4
5
|
queryKey: string;
|
|
@@ -21,8 +22,7 @@ export declare type CategoryFilterOptions = {
|
|
|
21
22
|
description: string;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
|
-
export declare type RoutingBehavior = "direct-link" | "event";
|
|
25
25
|
export declare type ProductListOptions = SearchResultsOptions & {
|
|
26
26
|
initialFilters?: FilterGroup;
|
|
27
|
-
categories
|
|
27
|
+
categories: CategoryFilterOptions;
|
|
28
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type RoutingBehavior = "direct-link" | "event";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
2
2
|
import { DocumentElement } from "../DocumentElement";
|
|
3
3
|
import { BadgeElement } from "./BadgeOptions";
|
|
4
|
+
import { RoutingBehavior } from "./RoutingBehavior";
|
|
4
5
|
import { SearchResultsOptionLabels } from "./SearchResultsOptions";
|
|
5
6
|
export declare type SearchResultsProductCardOptions = {
|
|
6
7
|
labels: SearchResultsOptionLabels;
|
|
8
|
+
routingBehavior?: RoutingBehavior;
|
|
7
9
|
isInStock: (doc: Document) => boolean;
|
|
8
10
|
badges: SearchResultBadgeOptions;
|
|
9
11
|
links: {
|
package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export default class SearchResultsProductCard extends Vue {
|
|
|
22
22
|
get detailElements(): DocumentElement[];
|
|
23
23
|
get labels(): SearchResultsOptionLabels;
|
|
24
24
|
get link(): string;
|
|
25
|
+
get hasEventRouting(): boolean;
|
|
26
|
+
get url(): string | undefined;
|
|
25
27
|
isInStock: boolean;
|
|
26
28
|
mounted(): void;
|
|
27
29
|
checkIfIsInStock(): Promise<void>;
|
|
@@ -30,4 +32,5 @@ export default class SearchResultsProductCard extends Vue {
|
|
|
30
32
|
handleProductEvent(item: {
|
|
31
33
|
type: ReportableEventType;
|
|
32
34
|
}): void;
|
|
35
|
+
handleNavigation(): void;
|
|
33
36
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
2
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
3
3
|
import { TitleDocumentElement } from "@/types/DocumentElement";
|
|
4
|
+
import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
|
|
4
5
|
export default class SearchResultsProductTitle extends Vue {
|
|
5
6
|
item: Document;
|
|
6
7
|
options: TitleDocumentElement;
|
|
7
8
|
link: string;
|
|
9
|
+
searchResultOptions: SearchResultsOptions;
|
|
8
10
|
get title(): unknown;
|
|
9
11
|
get isHtml(): boolean;
|
|
10
12
|
get maxLines(): number;
|
|
13
|
+
get hasEventRouting(): boolean;
|
|
14
|
+
handleNavigation(): void;
|
|
11
15
|
}
|
package/dist/iife/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
|
|
2
2
|
import { SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
3
|
-
import { TrackingOptions } from "./types/General";
|
|
3
|
+
import { SdkOptions, TrackingOptions } from "./types/General";
|
|
4
4
|
import { ProductListOptions } from "./types/product-list/ProductListOptions";
|
|
5
5
|
declare const lupaSearch: {
|
|
6
6
|
searchBox: (options: SearchBoxOptions) => void;
|
|
@@ -11,5 +11,5 @@ declare const lupaSearch: {
|
|
|
11
11
|
clearSearchResults: () => void;
|
|
12
12
|
clearProductList: () => void;
|
|
13
13
|
};
|
|
14
|
-
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions };
|
|
14
|
+
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, };
|
|
15
15
|
export default lupaSearch;
|