@getlupa/client 0.6.0-alpha-5 → 0.6.0-alpha-8
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 -1
- 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 +71 -43
- package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +7 -1
- package/dist/es/components/product-list/CategoryFilter.vue.d.ts +4 -1
- package/dist/es/components/search-results/SearchResults.vue.d.ts +0 -1
- 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 +71 -43
- package/dist/es/types/search-results/SearchResultsOptions.d.ts +7 -1
- package/dist/iife/components/product-list/CategoryFilter.vue.d.ts +4 -1
- package/dist/iife/components/search-results/SearchResults.vue.d.ts +0 -1
- 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 +7 -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;
|
|
@@ -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, SearchResultEventCallbacks, 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, SearchResultEventCallbacks, };
|
|
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);
|
|
@@ -32555,6 +32566,8 @@ var AdditionalPanels$1 = /*#__PURE__*/function (_Vue) {
|
|
|
32555
32566
|
}, {
|
|
32556
32567
|
key: "mounted",
|
|
32557
32568
|
value: function mounted() {
|
|
32569
|
+
console.log("m");
|
|
32570
|
+
|
|
32558
32571
|
if (!this.query) {
|
|
32559
32572
|
return;
|
|
32560
32573
|
}
|
|
@@ -32566,6 +32579,7 @@ var AdditionalPanels$1 = /*#__PURE__*/function (_Vue) {
|
|
|
32566
32579
|
value: function handleQueryChange() {
|
|
32567
32580
|
var _this2 = this;
|
|
32568
32581
|
|
|
32582
|
+
console.log("q");
|
|
32569
32583
|
var context = getLupaTrackingContext();
|
|
32570
32584
|
var query = Object.assign(Object.assign({}, context), {
|
|
32571
32585
|
limit: this.panel.totalCountLimit,
|
|
@@ -32573,12 +32587,23 @@ var AdditionalPanels$1 = /*#__PURE__*/function (_Vue) {
|
|
|
32573
32587
|
});
|
|
32574
32588
|
getLupaSdk.query(this.panel.queryKey, query, this.options).then(function (res) {
|
|
32575
32589
|
if (res.success) {
|
|
32576
|
-
_this2.
|
|
32590
|
+
_this2.handleResults(res);
|
|
32577
32591
|
}
|
|
32578
32592
|
}).catch(function (err) {
|
|
32579
32593
|
console.error(err);
|
|
32580
32594
|
});
|
|
32581
32595
|
}
|
|
32596
|
+
}, {
|
|
32597
|
+
key: "handleResults",
|
|
32598
|
+
value: function handleResults(res) {
|
|
32599
|
+
var _a, _b;
|
|
32600
|
+
|
|
32601
|
+
this.result = res;
|
|
32602
|
+
(_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onAdditionalPanelResults) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
32603
|
+
queryKey: this.panel.queryKey,
|
|
32604
|
+
hasResults: res.total > 0
|
|
32605
|
+
});
|
|
32606
|
+
}
|
|
32582
32607
|
}, {
|
|
32583
32608
|
key: "toggleShowMore",
|
|
32584
32609
|
value: function toggleShowMore() {
|
|
@@ -32604,6 +32629,10 @@ __decorate([Prop({
|
|
|
32604
32629
|
|
|
32605
32630
|
__decorate([params$8.Getter("query")], AdditionalPanels$1.prototype, "query", void 0);
|
|
32606
32631
|
|
|
32632
|
+
__decorate([options$4.State(function (o) {
|
|
32633
|
+
return o.searchResultOptions;
|
|
32634
|
+
})], AdditionalPanels$1.prototype, "searchResultOptions", void 0);
|
|
32635
|
+
|
|
32607
32636
|
__decorate([Watch("query")], AdditionalPanels$1.prototype, "handleQueryChange", null);
|
|
32608
32637
|
|
|
32609
32638
|
AdditionalPanels$1 = __decorate([Component({
|
|
@@ -32969,6 +32998,11 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
|
|
|
32969
32998
|
get: function get() {
|
|
32970
32999
|
return this.showFirstPage && !this.pages.includes(2);
|
|
32971
33000
|
}
|
|
33001
|
+
}, {
|
|
33002
|
+
key: "showPagination",
|
|
33003
|
+
get: function get() {
|
|
33004
|
+
return this.pages.length > 1;
|
|
33005
|
+
}
|
|
32972
33006
|
}, {
|
|
32973
33007
|
key: "handlePageChange",
|
|
32974
33008
|
value: function handlePageChange(page) {
|
|
@@ -33019,7 +33053,7 @@ var __vue_render__$i = function __vue_render__() {
|
|
|
33019
33053
|
|
|
33020
33054
|
var _c = _vm._self._c || _h;
|
|
33021
33055
|
|
|
33022
|
-
return _c("div", {
|
|
33056
|
+
return _vm.showPagination ? _c("div", {
|
|
33023
33057
|
attrs: {
|
|
33024
33058
|
id: "lupa-search-results-page-select",
|
|
33025
33059
|
"data-cy": "lupa-search-results-page-select"
|
|
@@ -33072,7 +33106,7 @@ var __vue_render__$i = function __vue_render__() {
|
|
|
33072
33106
|
return _vm.handlePageChange(_vm.options.selectedPage + 1);
|
|
33073
33107
|
}
|
|
33074
33108
|
}
|
|
33075
|
-
}, [_vm._v("\n " + _vm._s(_vm.lastPageLabel) + "\n ")]) : _vm._e()], 2);
|
|
33109
|
+
}, [_vm._v("\n " + _vm._s(_vm.lastPageLabel) + "\n ")]) : _vm._e()], 2) : _vm._e();
|
|
33076
33110
|
};
|
|
33077
33111
|
|
|
33078
33112
|
var __vue_staticRenderFns__$i = [];
|
|
@@ -34317,13 +34351,13 @@ var __vue_render__$8 = function __vue_render__() {
|
|
|
34317
34351
|
options: _vm.currentFilterOptions,
|
|
34318
34352
|
expandable: true
|
|
34319
34353
|
}
|
|
34320
|
-
}) : _vm._e(), _vm._v(" "), _c("AdditionalPanels", {
|
|
34354
|
+
}) : _vm._e()] : _vm._e(), _vm._v(" "), _c("AdditionalPanels", {
|
|
34321
34355
|
attrs: {
|
|
34322
34356
|
options: _vm.options,
|
|
34323
34357
|
location: "top",
|
|
34324
34358
|
sdkOptions: _vm.options.options
|
|
34325
34359
|
}
|
|
34326
|
-
}), _vm._v(" "), _c("SearchResultsToolbar", {
|
|
34360
|
+
}), _vm._v(" "), _vm.hasResults ? [_c("SearchResultsToolbar", {
|
|
34327
34361
|
staticClass: "lupa-toolbar-top",
|
|
34328
34362
|
attrs: {
|
|
34329
34363
|
options: _vm.options,
|
|
@@ -34857,24 +34891,18 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
|
|
|
34857
34891
|
value: function handleResults(_ref) {
|
|
34858
34892
|
var queryKey = _ref.queryKey,
|
|
34859
34893
|
results = _ref.results;
|
|
34894
|
+
|
|
34895
|
+
var _a, _b, _c, _d;
|
|
34896
|
+
|
|
34860
34897
|
this.trackResults({
|
|
34861
34898
|
queryKey: queryKey,
|
|
34862
34899
|
results: results
|
|
34863
34900
|
});
|
|
34864
|
-
this.handleNoResults(results);
|
|
34865
|
-
}
|
|
34866
|
-
}, {
|
|
34867
|
-
key: "handleNoResults",
|
|
34868
|
-
value: function handleNoResults(results) {
|
|
34869
|
-
var _a, _b, _c;
|
|
34870
|
-
|
|
34871
34901
|
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));
|
|
34872
|
-
|
|
34873
|
-
|
|
34874
|
-
|
|
34875
|
-
}
|
|
34876
|
-
|
|
34877
|
-
(_c = this.options.callbacks) === null || _c === void 0 ? void 0 : _c.noResults();
|
|
34902
|
+
(_d = (_c = this.options.callbacks) === null || _c === void 0 ? void 0 : _c.onSearchResults) === null || _d === void 0 ? void 0 : _d.call(_c, {
|
|
34903
|
+
queryKey: queryKey,
|
|
34904
|
+
hasResults: hasResults
|
|
34905
|
+
});
|
|
34878
34906
|
}
|
|
34879
34907
|
}, {
|
|
34880
34908
|
key: "handleResize",
|
|
@@ -19,8 +19,14 @@ 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
|
+
};
|
|
22
26
|
export declare type SearchResultEventCallbacks = {
|
|
23
|
-
|
|
27
|
+
onSearchResults?: (context: CallbackContext) => unknown;
|
|
28
|
+
onAdditionalPanelResults?: (context: CallbackContext) => unknown;
|
|
29
|
+
onCategoryFilterResults?: (context: CallbackContext) => unknown;
|
|
24
30
|
};
|
|
25
31
|
export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchResultsDidYouMeanLabels & SearchResultsSimilarQueriesLabels & {
|
|
26
32
|
sortBy: 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;
|
|
@@ -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, SearchResultEventCallbacks, 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, SearchResultEventCallbacks, };
|
|
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;
|