@getlupa/client 0.6.0-alpha-4 → 0.6.0-alpha-7
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/product-list/CategoryFilter.vue.d.ts +4 -1
- package/dist/cjs/components/search-results/SearchResults.vue.d.ts +0 -4
- package/dist/cjs/components/search-results/additional-panels/AdditionalPanel.vue.d.ts +3 -0
- package/dist/cjs/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts +1 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.min.js +87 -36
- package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +10 -1
- package/dist/es/components/product-list/CategoryFilter.vue.d.ts +4 -1
- package/dist/es/components/search-results/SearchResults.vue.d.ts +0 -4
- package/dist/es/components/search-results/additional-panels/AdditionalPanel.vue.d.ts +3 -0
- package/dist/es/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts +1 -0
- package/dist/es/index.d.ts +2 -2
- package/dist/es/index.min.js +87 -36
- package/dist/es/types/search-results/SearchResultsOptions.d.ts +10 -1
- package/dist/iife/components/product-list/CategoryFilter.vue.d.ts +4 -1
- package/dist/iife/components/search-results/SearchResults.vue.d.ts +0 -4
- package/dist/iife/components/search-results/additional-panels/AdditionalPanel.vue.d.ts +3 -0
- package/dist/iife/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts +1 -0
- package/dist/iife/index.d.ts +2 -2
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/types/search-results/SearchResultsOptions.d.ts +10 -1
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
|
-
import { Options } from "@getlupa/client-sdk/Types";
|
|
2
|
+
import { Options, SdkError, SearchQueryResult } from "@getlupa/client-sdk/Types";
|
|
3
3
|
import { CategoryFilterOptions } from "@/types/product-list/ProductListOptions";
|
|
4
|
+
import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
|
|
4
5
|
export default class CategoryFilter extends Vue {
|
|
5
6
|
options: CategoryFilterOptions;
|
|
6
7
|
categoryChildren: Record<string, string>[];
|
|
7
8
|
envOptions: Options;
|
|
9
|
+
searchResultOptions: SearchResultsOptions;
|
|
8
10
|
get hasBackButton(): boolean;
|
|
9
11
|
get hasEventRouting(): boolean;
|
|
10
12
|
get backTitle(): string | undefined;
|
|
@@ -13,6 +15,7 @@ export default class CategoryFilter extends Vue {
|
|
|
13
15
|
get parentUrlLink(): string | undefined;
|
|
14
16
|
get isActive(): boolean;
|
|
15
17
|
mounted(): Promise<void>;
|
|
18
|
+
handleResult(result: SearchQueryResult | SdkError): void;
|
|
16
19
|
getCategoryKey(item: Record<string, string>): string;
|
|
17
20
|
handleNavigationParent(event?: Event): void;
|
|
18
21
|
handleNavigationBack(event?: Event): void;
|
|
@@ -25,10 +25,6 @@ export default class SearchResults extends Vue {
|
|
|
25
25
|
setDefaultLimit: (defaultLimit: number) => {
|
|
26
26
|
defaultLimit: number;
|
|
27
27
|
};
|
|
28
|
-
handleNoResultsFlag: ({ resultCount, noResultsParam, }: {
|
|
29
|
-
resultCount: number;
|
|
30
|
-
noResultsParam?: string;
|
|
31
|
-
}) => void;
|
|
32
28
|
addParams: (params: QueryParams) => {
|
|
33
29
|
params: QueryParams;
|
|
34
30
|
};
|
|
@@ -3,11 +3,13 @@ import Vue from "vue";
|
|
|
3
3
|
import { SdkOptions } from "@/types/General";
|
|
4
4
|
import { SearchQueryResult } from "@getlupa/client-sdk/Types";
|
|
5
5
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
6
|
+
import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
|
|
6
7
|
export default class AdditionalPanels extends Vue {
|
|
7
8
|
panel: SearchResultsAdditionalPanelOptions;
|
|
8
9
|
options: SdkOptions;
|
|
9
10
|
result: SearchQueryResult;
|
|
10
11
|
query: string;
|
|
12
|
+
searchResultOptions: SearchResultsOptions;
|
|
11
13
|
showAll: boolean;
|
|
12
14
|
get displayShowMore(): boolean;
|
|
13
15
|
get itemCount(): number;
|
|
@@ -16,6 +18,7 @@ export default class AdditionalPanels extends Vue {
|
|
|
16
18
|
get hasResults(): boolean;
|
|
17
19
|
mounted(): void;
|
|
18
20
|
handleQueryChange(): void;
|
|
21
|
+
handleResults(res: SearchQueryResult): void;
|
|
19
22
|
toggleShowMore(): void;
|
|
20
23
|
addParams(label: string, itemCount: number): string;
|
|
21
24
|
}
|
package/dist/cjs/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export default class SearchResultsPageSelect extends Vue {
|
|
|
14
14
|
get showLastPageSeparator(): boolean;
|
|
15
15
|
get showFirstPage(): boolean;
|
|
16
16
|
get showFirstPageSeparator(): boolean;
|
|
17
|
+
get showPagination(): boolean;
|
|
17
18
|
appendParams: ({ params, paramsToRemove, }: {
|
|
18
19
|
params: {
|
|
19
20
|
name: string;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
|
|
2
|
-
import { FacetStyle, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
2
|
+
import { CallbackContext, FacetStyle, SearchResultEventCallbacks, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
3
3
|
import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
|
|
4
4
|
import { ProductListOptions } from "./types/product-list/ProductListOptions";
|
|
5
5
|
import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
|
|
@@ -17,5 +17,5 @@ declare const lupaSearch: {
|
|
|
17
17
|
clearSearchResults: () => void;
|
|
18
18
|
clearProductList: () => void;
|
|
19
19
|
};
|
|
20
|
-
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, };
|
|
20
|
+
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, };
|
|
21
21
|
export default lupaSearch;
|
package/dist/cjs/index.min.js
CHANGED
|
@@ -22147,7 +22147,7 @@ var getPageUrl = function getPageUrl(pathnameOverride) {
|
|
|
22147
22147
|
|
|
22148
22148
|
var history$3 = namespace("history");
|
|
22149
22149
|
var tracking$5 = namespace("tracking");
|
|
22150
|
-
var options$
|
|
22150
|
+
var options$b = namespace("options");
|
|
22151
22151
|
|
|
22152
22152
|
var SearchBoxProduct = /*#__PURE__*/function (_Vue) {
|
|
22153
22153
|
_inherits(SearchBoxProduct, _Vue);
|
|
@@ -22245,7 +22245,7 @@ __decorate([Prop({
|
|
|
22245
22245
|
default: false
|
|
22246
22246
|
})], SearchBoxProduct.prototype, "highlighted", void 0);
|
|
22247
22247
|
|
|
22248
|
-
__decorate([options$
|
|
22248
|
+
__decorate([options$b.Getter("boxRoutingBehavior")], SearchBoxProduct.prototype, "boxRoutingBehavior", void 0);
|
|
22249
22249
|
|
|
22250
22250
|
__decorate([tracking$5.Action("track")], SearchBoxProduct.prototype, "trackClick", void 0);
|
|
22251
22251
|
|
|
@@ -23676,7 +23676,7 @@ var defaultSuggestedValue = {
|
|
|
23676
23676
|
var history$1 = namespace("history");
|
|
23677
23677
|
var params$d = namespace("params");
|
|
23678
23678
|
var searchBox$2 = namespace("searchBox");
|
|
23679
|
-
var options$
|
|
23679
|
+
var options$a = namespace("options");
|
|
23680
23680
|
var tracking$4 = namespace("tracking");
|
|
23681
23681
|
|
|
23682
23682
|
var SearchBox = /*#__PURE__*/function (_Vue) {
|
|
@@ -23961,7 +23961,7 @@ __decorate([tracking$4.Action("track")], SearchBox.prototype, "trackClick", void
|
|
|
23961
23961
|
|
|
23962
23962
|
__decorate([params$d.Action("setSearchResultsLink")], SearchBox.prototype, "setSearchResultsLink", void 0);
|
|
23963
23963
|
|
|
23964
|
-
__decorate([options$
|
|
23964
|
+
__decorate([options$a.Mutation("setSearchBoxOptions")], SearchBox.prototype, "setSearchBoxOptions", void 0);
|
|
23965
23965
|
|
|
23966
23966
|
__decorate([params$d.Action("goToResults")], SearchBox.prototype, "goToResults", void 0);
|
|
23967
23967
|
|
|
@@ -25611,7 +25611,7 @@ var toggleHierarchyParam = function toggleHierarchyParam() {
|
|
|
25611
25611
|
|
|
25612
25612
|
var searchResult$h = namespace("searchResult");
|
|
25613
25613
|
var params$c = namespace("params");
|
|
25614
|
-
var options$
|
|
25614
|
+
var options$9 = namespace("options");
|
|
25615
25615
|
|
|
25616
25616
|
var CurrentFilters = /*#__PURE__*/function (_Vue) {
|
|
25617
25617
|
_inherits(CurrentFilters, _Vue);
|
|
@@ -25688,7 +25688,7 @@ __decorate([searchResult$h.Getter("displayFilters")], CurrentFilters.prototype,
|
|
|
25688
25688
|
|
|
25689
25689
|
__decorate([searchResult$h.Getter("currentFilterCount")], CurrentFilters.prototype, "currentFilterCount", void 0);
|
|
25690
25690
|
|
|
25691
|
-
__decorate([options$
|
|
25691
|
+
__decorate([options$9.Getter("initialFilters")], CurrentFilters.prototype, "initialFilters", void 0);
|
|
25692
25692
|
|
|
25693
25693
|
__decorate([params$c.Action("removeParams")], CurrentFilters.prototype, "removeParams", void 0);
|
|
25694
25694
|
|
|
@@ -28623,7 +28623,7 @@ var _typeof = _typeof$2.exports.default;
|
|
|
28623
28623
|
|
|
28624
28624
|
var VueSlider = /*@__PURE__*/getDefaultExportFromCjs(vueSliderComponent_umd_min.exports);
|
|
28625
28625
|
|
|
28626
|
-
var options$
|
|
28626
|
+
var options$8 = namespace("options");
|
|
28627
28627
|
|
|
28628
28628
|
var TermFacet = /*#__PURE__*/function (_Vue) {
|
|
28629
28629
|
_inherits(TermFacet, _Vue);
|
|
@@ -28830,7 +28830,7 @@ __decorate([Prop({
|
|
|
28830
28830
|
}
|
|
28831
28831
|
})], TermFacet.prototype, "currentFilters", void 0);
|
|
28832
28832
|
|
|
28833
|
-
__decorate([options$
|
|
28833
|
+
__decorate([options$8.State(function (s) {
|
|
28834
28834
|
return s.searchResultOptions;
|
|
28835
28835
|
})], TermFacet.prototype, "searchResultOptions", void 0);
|
|
28836
28836
|
|
|
@@ -29946,7 +29946,7 @@ var __vue_component__$F = /*#__PURE__*/normalizeComponent({
|
|
|
29946
29946
|
staticRenderFns: __vue_staticRenderFns__$F
|
|
29947
29947
|
}, __vue_inject_styles__$F, __vue_script__$F, __vue_scope_id__$F, __vue_is_functional_template__$F, __vue_module_identifier__$F, false, undefined, undefined, undefined);
|
|
29948
29948
|
|
|
29949
|
-
var options$
|
|
29949
|
+
var options$7 = namespace("options");
|
|
29950
29950
|
|
|
29951
29951
|
var CategoryFilter = /*#__PURE__*/function (_Vue) {
|
|
29952
29952
|
_inherits(CategoryFilter, _Vue);
|
|
@@ -30025,18 +30025,9 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
|
|
|
30025
30025
|
|
|
30026
30026
|
case 2:
|
|
30027
30027
|
result = _context.sent;
|
|
30028
|
+
this.handleResult(result);
|
|
30028
30029
|
|
|
30029
|
-
|
|
30030
|
-
_context.next = 5;
|
|
30031
|
-
break;
|
|
30032
|
-
}
|
|
30033
|
-
|
|
30034
|
-
return _context.abrupt("return");
|
|
30035
|
-
|
|
30036
|
-
case 5:
|
|
30037
|
-
this.categoryChildren = result.items;
|
|
30038
|
-
|
|
30039
|
-
case 6:
|
|
30030
|
+
case 4:
|
|
30040
30031
|
case "end":
|
|
30041
30032
|
return _context.stop();
|
|
30042
30033
|
}
|
|
@@ -30044,6 +30035,21 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
|
|
|
30044
30035
|
}, _callee, this);
|
|
30045
30036
|
}));
|
|
30046
30037
|
}
|
|
30038
|
+
}, {
|
|
30039
|
+
key: "handleResult",
|
|
30040
|
+
value: function handleResult(result) {
|
|
30041
|
+
var _a, _b;
|
|
30042
|
+
|
|
30043
|
+
if (!result.success) {
|
|
30044
|
+
return;
|
|
30045
|
+
}
|
|
30046
|
+
|
|
30047
|
+
this.categoryChildren = result.items;
|
|
30048
|
+
(_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onCategoryFilterResults) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
30049
|
+
queryKey: this.options.queryKey,
|
|
30050
|
+
hasResults: result.total > 0
|
|
30051
|
+
});
|
|
30052
|
+
}
|
|
30047
30053
|
}, {
|
|
30048
30054
|
key: "getCategoryKey",
|
|
30049
30055
|
value: function getCategoryKey(item) {
|
|
@@ -30076,7 +30082,11 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
|
|
|
30076
30082
|
|
|
30077
30083
|
__decorate([Prop()], CategoryFilter.prototype, "options", void 0);
|
|
30078
30084
|
|
|
30079
|
-
__decorate([options$
|
|
30085
|
+
__decorate([options$7.Getter("envOptions")], CategoryFilter.prototype, "envOptions", void 0);
|
|
30086
|
+
|
|
30087
|
+
__decorate([options$7.State(function (o) {
|
|
30088
|
+
return o.searchResultOptions;
|
|
30089
|
+
})], CategoryFilter.prototype, "searchResultOptions", void 0);
|
|
30080
30090
|
|
|
30081
30091
|
CategoryFilter = __decorate([Component({
|
|
30082
30092
|
name: "categoryFilter",
|
|
@@ -31063,7 +31073,7 @@ var __vue_component__$w = /*#__PURE__*/normalizeComponent({
|
|
|
31063
31073
|
staticRenderFns: __vue_staticRenderFns__$w
|
|
31064
31074
|
}, __vue_inject_styles__$w, __vue_script__$w, __vue_scope_id__$w, __vue_is_functional_template__$w, __vue_module_identifier__$w, false, undefined, undefined, undefined);
|
|
31065
31075
|
|
|
31066
|
-
var options$
|
|
31076
|
+
var options$6 = namespace("options");
|
|
31067
31077
|
|
|
31068
31078
|
var SearchResultsProductTitle = /*#__PURE__*/function (_Vue) {
|
|
31069
31079
|
_inherits(SearchResultsProductTitle, _Vue);
|
|
@@ -31116,7 +31126,7 @@ __decorate([Prop({
|
|
|
31116
31126
|
default: ""
|
|
31117
31127
|
})], SearchResultsProductTitle.prototype, "link", void 0);
|
|
31118
31128
|
|
|
31119
|
-
__decorate([options$
|
|
31129
|
+
__decorate([options$6.State(function (o) {
|
|
31120
31130
|
return o.searchResultOptions;
|
|
31121
31131
|
})], SearchResultsProductTitle.prototype, "searchResultOptions", void 0);
|
|
31122
31132
|
|
|
@@ -32027,7 +32037,7 @@ var __vue_component__$n = /*#__PURE__*/normalizeComponent({
|
|
|
32027
32037
|
var tracking$3 = namespace("tracking");
|
|
32028
32038
|
var params$9 = namespace("params");
|
|
32029
32039
|
var searchResult$c = namespace("searchResult");
|
|
32030
|
-
var options$
|
|
32040
|
+
var options$5 = namespace("options");
|
|
32031
32041
|
|
|
32032
32042
|
var SearchResultsProductCard = /*#__PURE__*/function (_Vue) {
|
|
32033
32043
|
_inherits(SearchResultsProductCard, _Vue);
|
|
@@ -32198,7 +32208,7 @@ __decorate([searchResult$c.State(function (state) {
|
|
|
32198
32208
|
return state.layout;
|
|
32199
32209
|
})], SearchResultsProductCard.prototype, "layout", void 0);
|
|
32200
32210
|
|
|
32201
|
-
__decorate([options$
|
|
32211
|
+
__decorate([options$5.Getter("searchResultsRoutingBehavior")], SearchResultsProductCard.prototype, "searchResultsRoutingBehavior", void 0);
|
|
32202
32212
|
|
|
32203
32213
|
__decorate([params$9.Getter("query")], SearchResultsProductCard.prototype, "query", void 0);
|
|
32204
32214
|
|
|
@@ -32501,6 +32511,7 @@ var track = function track(queryKey) {
|
|
|
32501
32511
|
};
|
|
32502
32512
|
|
|
32503
32513
|
var params$8 = namespace("params");
|
|
32514
|
+
var options$4 = namespace("options");
|
|
32504
32515
|
|
|
32505
32516
|
var AdditionalPanels$1 = /*#__PURE__*/function (_Vue) {
|
|
32506
32517
|
_inherits(AdditionalPanels, _Vue);
|
|
@@ -32573,12 +32584,23 @@ var AdditionalPanels$1 = /*#__PURE__*/function (_Vue) {
|
|
|
32573
32584
|
});
|
|
32574
32585
|
getLupaSdk.query(this.panel.queryKey, query, this.options).then(function (res) {
|
|
32575
32586
|
if (res.success) {
|
|
32576
|
-
_this2.
|
|
32587
|
+
_this2.handleResults(res);
|
|
32577
32588
|
}
|
|
32578
32589
|
}).catch(function (err) {
|
|
32579
32590
|
console.error(err);
|
|
32580
32591
|
});
|
|
32581
32592
|
}
|
|
32593
|
+
}, {
|
|
32594
|
+
key: "handleResults",
|
|
32595
|
+
value: function handleResults(res) {
|
|
32596
|
+
var _a, _b;
|
|
32597
|
+
|
|
32598
|
+
this.result = res;
|
|
32599
|
+
(_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onAdditionalPanelResults) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
32600
|
+
queryKey: this.panel.queryKey,
|
|
32601
|
+
hasResults: res.total > 0
|
|
32602
|
+
});
|
|
32603
|
+
}
|
|
32582
32604
|
}, {
|
|
32583
32605
|
key: "toggleShowMore",
|
|
32584
32606
|
value: function toggleShowMore() {
|
|
@@ -32604,6 +32626,10 @@ __decorate([Prop({
|
|
|
32604
32626
|
|
|
32605
32627
|
__decorate([params$8.Getter("query")], AdditionalPanels$1.prototype, "query", void 0);
|
|
32606
32628
|
|
|
32629
|
+
__decorate([options$4.State(function (o) {
|
|
32630
|
+
return o.searchResultOptions;
|
|
32631
|
+
})], AdditionalPanels$1.prototype, "searchResultOptions", void 0);
|
|
32632
|
+
|
|
32607
32633
|
__decorate([Watch("query")], AdditionalPanels$1.prototype, "handleQueryChange", null);
|
|
32608
32634
|
|
|
32609
32635
|
AdditionalPanels$1 = __decorate([Component({
|
|
@@ -32969,6 +32995,11 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
|
|
|
32969
32995
|
get: function get() {
|
|
32970
32996
|
return this.showFirstPage && !this.pages.includes(2);
|
|
32971
32997
|
}
|
|
32998
|
+
}, {
|
|
32999
|
+
key: "showPagination",
|
|
33000
|
+
get: function get() {
|
|
33001
|
+
return this.pages.length > 1;
|
|
33002
|
+
}
|
|
32972
33003
|
}, {
|
|
32973
33004
|
key: "handlePageChange",
|
|
32974
33005
|
value: function handlePageChange(page) {
|
|
@@ -33019,7 +33050,7 @@ var __vue_render__$i = function __vue_render__() {
|
|
|
33019
33050
|
|
|
33020
33051
|
var _c = _vm._self._c || _h;
|
|
33021
33052
|
|
|
33022
|
-
return _c("div", {
|
|
33053
|
+
return _vm.showPagination ? _c("div", {
|
|
33023
33054
|
attrs: {
|
|
33024
33055
|
id: "lupa-search-results-page-select",
|
|
33025
33056
|
"data-cy": "lupa-search-results-page-select"
|
|
@@ -33072,7 +33103,7 @@ var __vue_render__$i = function __vue_render__() {
|
|
|
33072
33103
|
return _vm.handlePageChange(_vm.options.selectedPage + 1);
|
|
33073
33104
|
}
|
|
33074
33105
|
}
|
|
33075
|
-
}, [_vm._v("\n " + _vm._s(_vm.lastPageLabel) + "\n ")]) : _vm._e()], 2);
|
|
33106
|
+
}, [_vm._v("\n " + _vm._s(_vm.lastPageLabel) + "\n ")]) : _vm._e()], 2) : _vm._e();
|
|
33076
33107
|
};
|
|
33077
33108
|
|
|
33078
33109
|
var __vue_staticRenderFns__$i = [];
|
|
@@ -34317,13 +34348,13 @@ var __vue_render__$8 = function __vue_render__() {
|
|
|
34317
34348
|
options: _vm.currentFilterOptions,
|
|
34318
34349
|
expandable: true
|
|
34319
34350
|
}
|
|
34320
|
-
}) : _vm._e(), _vm._v(" "), _c("AdditionalPanels", {
|
|
34351
|
+
}) : _vm._e()] : _vm._e(), _vm._v(" "), _c("AdditionalPanels", {
|
|
34321
34352
|
attrs: {
|
|
34322
34353
|
options: _vm.options,
|
|
34323
34354
|
location: "top",
|
|
34324
34355
|
sdkOptions: _vm.options.options
|
|
34325
34356
|
}
|
|
34326
|
-
}), _vm._v(" "), _c("SearchResultsToolbar", {
|
|
34357
|
+
}), _vm._v(" "), _vm.hasResults ? [_c("SearchResultsToolbar", {
|
|
34327
34358
|
staticClass: "lupa-toolbar-top",
|
|
34328
34359
|
attrs: {
|
|
34329
34360
|
options: _vm.options,
|
|
@@ -34858,15 +34889,16 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
|
|
|
34858
34889
|
var queryKey = _ref.queryKey,
|
|
34859
34890
|
results = _ref.results;
|
|
34860
34891
|
|
|
34861
|
-
var _a;
|
|
34892
|
+
var _a, _b, _c, _d;
|
|
34862
34893
|
|
|
34863
34894
|
this.trackResults({
|
|
34864
34895
|
queryKey: queryKey,
|
|
34865
34896
|
results: results
|
|
34866
34897
|
});
|
|
34867
|
-
|
|
34868
|
-
|
|
34869
|
-
|
|
34898
|
+
var hasResults = Boolean(results.total > 0 || ((_a = results.similarQueries) === null || _a === void 0 ? void 0 : _a.length) || ((_b = results.didYouMean) === null || _b === void 0 ? void 0 : _b.options));
|
|
34899
|
+
(_d = (_c = this.options.callbacks) === null || _c === void 0 ? void 0 : _c.onSearchResults) === null || _d === void 0 ? void 0 : _d.call(_c, {
|
|
34900
|
+
queryKey: queryKey,
|
|
34901
|
+
hasResults: hasResults
|
|
34870
34902
|
});
|
|
34871
34903
|
}
|
|
34872
34904
|
}, {
|
|
@@ -34913,8 +34945,6 @@ __decorate([params$1.State("searchString")], SearchResults.prototype, "searchStr
|
|
|
34913
34945
|
|
|
34914
34946
|
__decorate([params$1.Action("setDefaultLimit")], SearchResults.prototype, "setDefaultLimit", void 0);
|
|
34915
34947
|
|
|
34916
|
-
__decorate([params$1.Action("handleNoResultsFlag")], SearchResults.prototype, "handleNoResultsFlag", void 0);
|
|
34917
|
-
|
|
34918
34948
|
__decorate([params$1.Action("add")], SearchResults.prototype, "addParams", void 0);
|
|
34919
34949
|
|
|
34920
34950
|
__decorate([params$1.Action("removeParams")], SearchResults.prototype, "removeParams", void 0);
|
|
@@ -37105,6 +37135,13 @@ var tracking = function tracking(options) {
|
|
|
37105
37135
|
};
|
|
37106
37136
|
|
|
37107
37137
|
var searchBox = function searchBox(options) {
|
|
37138
|
+
var _a;
|
|
37139
|
+
|
|
37140
|
+
try {
|
|
37141
|
+
(_a = app.box) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
37142
|
+
} catch (_b) {// Does not exist, do nothing
|
|
37143
|
+
}
|
|
37144
|
+
|
|
37108
37145
|
Vue$1.use(Vuex);
|
|
37109
37146
|
app.box = new Vue$1({
|
|
37110
37147
|
el: options.inputSelector,
|
|
@@ -37123,6 +37160,13 @@ var searchBox = function searchBox(options) {
|
|
|
37123
37160
|
};
|
|
37124
37161
|
|
|
37125
37162
|
var searchResults = function searchResults(options) {
|
|
37163
|
+
var _a;
|
|
37164
|
+
|
|
37165
|
+
try {
|
|
37166
|
+
(_a = app.results) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
37167
|
+
} catch (_b) {// Does not exist, do nothing
|
|
37168
|
+
}
|
|
37169
|
+
|
|
37126
37170
|
Vue$1.use(Vuex);
|
|
37127
37171
|
app.results = new Vue$1({
|
|
37128
37172
|
el: options.containerSelector,
|
|
@@ -37141,6 +37185,13 @@ var searchResults = function searchResults(options) {
|
|
|
37141
37185
|
};
|
|
37142
37186
|
|
|
37143
37187
|
var productList = function productList(options) {
|
|
37188
|
+
var _a;
|
|
37189
|
+
|
|
37190
|
+
try {
|
|
37191
|
+
(_a = app.productList) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
37192
|
+
} catch (_b) {// Does not exist, do nothing
|
|
37193
|
+
}
|
|
37194
|
+
|
|
37144
37195
|
Vue$1.use(Vuex);
|
|
37145
37196
|
app.productList = new Vue$1({
|
|
37146
37197
|
el: options.containerSelector,
|
|
@@ -7,8 +7,8 @@ export declare type SearchResultsOptions = SearchResultsProductOptions & SearchR
|
|
|
7
7
|
containerSelector: string;
|
|
8
8
|
breadcrumbs: SearchResultsBreadcrumb[];
|
|
9
9
|
classMap?: Record<string, string>;
|
|
10
|
-
noResultsQueryFlag?: string;
|
|
11
10
|
disallowEmptyQuery?: boolean;
|
|
11
|
+
callbacks?: SearchResultEventCallbacks;
|
|
12
12
|
};
|
|
13
13
|
export declare type SearchTitlePosition = "page-top" | "search-results-top";
|
|
14
14
|
export declare type SearchResultsDidYouMeanLabels = {
|
|
@@ -19,6 +19,15 @@ export declare type SearchResultsSimilarQueriesLabels = {
|
|
|
19
19
|
similarQuery: string;
|
|
20
20
|
similarQueries: string;
|
|
21
21
|
};
|
|
22
|
+
export declare type CallbackContext = {
|
|
23
|
+
queryKey: string;
|
|
24
|
+
hasResults: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare type SearchResultEventCallbacks = {
|
|
27
|
+
onSearchResults?: (context: CallbackContext) => unknown;
|
|
28
|
+
onAdditionalPanelResults?: (context: CallbackContext) => unknown;
|
|
29
|
+
onCategoryFilterResults?: (context: CallbackContext) => unknown;
|
|
30
|
+
};
|
|
22
31
|
export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchResultsDidYouMeanLabels & SearchResultsSimilarQueriesLabels & {
|
|
23
32
|
sortBy: string;
|
|
24
33
|
currency: string;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
|
-
import { Options } from "@getlupa/client-sdk/Types";
|
|
2
|
+
import { Options, SdkError, SearchQueryResult } from "@getlupa/client-sdk/Types";
|
|
3
3
|
import { CategoryFilterOptions } from "@/types/product-list/ProductListOptions";
|
|
4
|
+
import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
|
|
4
5
|
export default class CategoryFilter extends Vue {
|
|
5
6
|
options: CategoryFilterOptions;
|
|
6
7
|
categoryChildren: Record<string, string>[];
|
|
7
8
|
envOptions: Options;
|
|
9
|
+
searchResultOptions: SearchResultsOptions;
|
|
8
10
|
get hasBackButton(): boolean;
|
|
9
11
|
get hasEventRouting(): boolean;
|
|
10
12
|
get backTitle(): string | undefined;
|
|
@@ -13,6 +15,7 @@ export default class CategoryFilter extends Vue {
|
|
|
13
15
|
get parentUrlLink(): string | undefined;
|
|
14
16
|
get isActive(): boolean;
|
|
15
17
|
mounted(): Promise<void>;
|
|
18
|
+
handleResult(result: SearchQueryResult | SdkError): void;
|
|
16
19
|
getCategoryKey(item: Record<string, string>): string;
|
|
17
20
|
handleNavigationParent(event?: Event): void;
|
|
18
21
|
handleNavigationBack(event?: Event): void;
|
|
@@ -25,10 +25,6 @@ export default class SearchResults extends Vue {
|
|
|
25
25
|
setDefaultLimit: (defaultLimit: number) => {
|
|
26
26
|
defaultLimit: number;
|
|
27
27
|
};
|
|
28
|
-
handleNoResultsFlag: ({ resultCount, noResultsParam, }: {
|
|
29
|
-
resultCount: number;
|
|
30
|
-
noResultsParam?: string;
|
|
31
|
-
}) => void;
|
|
32
28
|
addParams: (params: QueryParams) => {
|
|
33
29
|
params: QueryParams;
|
|
34
30
|
};
|
|
@@ -3,11 +3,13 @@ import Vue from "vue";
|
|
|
3
3
|
import { SdkOptions } from "@/types/General";
|
|
4
4
|
import { SearchQueryResult } from "@getlupa/client-sdk/Types";
|
|
5
5
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
6
|
+
import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
|
|
6
7
|
export default class AdditionalPanels extends Vue {
|
|
7
8
|
panel: SearchResultsAdditionalPanelOptions;
|
|
8
9
|
options: SdkOptions;
|
|
9
10
|
result: SearchQueryResult;
|
|
10
11
|
query: string;
|
|
12
|
+
searchResultOptions: SearchResultsOptions;
|
|
11
13
|
showAll: boolean;
|
|
12
14
|
get displayShowMore(): boolean;
|
|
13
15
|
get itemCount(): number;
|
|
@@ -16,6 +18,7 @@ export default class AdditionalPanels extends Vue {
|
|
|
16
18
|
get hasResults(): boolean;
|
|
17
19
|
mounted(): void;
|
|
18
20
|
handleQueryChange(): void;
|
|
21
|
+
handleResults(res: SearchQueryResult): void;
|
|
19
22
|
toggleShowMore(): void;
|
|
20
23
|
addParams(label: string, itemCount: number): string;
|
|
21
24
|
}
|
package/dist/es/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export default class SearchResultsPageSelect extends Vue {
|
|
|
14
14
|
get showLastPageSeparator(): boolean;
|
|
15
15
|
get showFirstPage(): boolean;
|
|
16
16
|
get showFirstPageSeparator(): boolean;
|
|
17
|
+
get showPagination(): boolean;
|
|
17
18
|
appendParams: ({ params, paramsToRemove, }: {
|
|
18
19
|
params: {
|
|
19
20
|
name: string;
|
package/dist/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
|
|
2
|
-
import { FacetStyle, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
2
|
+
import { CallbackContext, FacetStyle, SearchResultEventCallbacks, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
3
3
|
import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
|
|
4
4
|
import { ProductListOptions } from "./types/product-list/ProductListOptions";
|
|
5
5
|
import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
|
|
@@ -17,5 +17,5 @@ declare const lupaSearch: {
|
|
|
17
17
|
clearSearchResults: () => void;
|
|
18
18
|
clearProductList: () => void;
|
|
19
19
|
};
|
|
20
|
-
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, };
|
|
20
|
+
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, };
|
|
21
21
|
export default lupaSearch;
|