@getlupa/client 0.6.0-alpha-11 → 0.6.0-alpha-14

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.
@@ -21,6 +21,7 @@ export default class SearchResultsToolbar extends Vue {
21
21
  get displayPageSelect(): boolean;
22
22
  get searchSummaryLabel(): string;
23
23
  get showMobileFilterCount(): boolean;
24
+ currentResolutionPageSizes: number[];
24
25
  removeAllFilters: () => {
25
26
  params: QueryParams;
26
27
  };
@@ -1,5 +1,5 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
- import { CallbackContext, FacetStyle, SearchResultEventCallbacks, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
2
+ import { CallbackContext, FacetFilterQuery, 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, CallbackContext, };
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, FacetFilterQuery, };
21
21
  export default lupaSearch;
@@ -22143,7 +22143,7 @@ var getPageUrl = function getPageUrl(pathnameOverride) {
22143
22143
 
22144
22144
  var history$3 = namespace("history");
22145
22145
  var tracking$5 = namespace("tracking");
22146
- var options$b = namespace("options");
22146
+ var options$c = namespace("options");
22147
22147
 
22148
22148
  var SearchBoxProduct = /*#__PURE__*/function (_Vue) {
22149
22149
  _inherits(SearchBoxProduct, _Vue);
@@ -22241,7 +22241,7 @@ __decorate([Prop({
22241
22241
  default: false
22242
22242
  })], SearchBoxProduct.prototype, "highlighted", void 0);
22243
22243
 
22244
- __decorate([options$b.Getter("boxRoutingBehavior")], SearchBoxProduct.prototype, "boxRoutingBehavior", void 0);
22244
+ __decorate([options$c.Getter("boxRoutingBehavior")], SearchBoxProduct.prototype, "boxRoutingBehavior", void 0);
22245
22245
 
22246
22246
  __decorate([tracking$5.Action("track")], SearchBoxProduct.prototype, "trackClick", void 0);
22247
22247
 
@@ -23672,7 +23672,7 @@ var defaultSuggestedValue = {
23672
23672
  var history$1 = namespace("history");
23673
23673
  var params$d = namespace("params");
23674
23674
  var searchBox$2 = namespace("searchBox");
23675
- var options$a = namespace("options");
23675
+ var options$b = namespace("options");
23676
23676
  var tracking$4 = namespace("tracking");
23677
23677
 
23678
23678
  var SearchBox = /*#__PURE__*/function (_Vue) {
@@ -23957,7 +23957,7 @@ __decorate([tracking$4.Action("track")], SearchBox.prototype, "trackClick", void
23957
23957
 
23958
23958
  __decorate([params$d.Action("setSearchResultsLink")], SearchBox.prototype, "setSearchResultsLink", void 0);
23959
23959
 
23960
- __decorate([options$a.Mutation("setSearchBoxOptions")], SearchBox.prototype, "setSearchBoxOptions", void 0);
23960
+ __decorate([options$b.Mutation("setSearchBoxOptions")], SearchBox.prototype, "setSearchBoxOptions", void 0);
23961
23961
 
23962
23962
  __decorate([params$d.Action("goToResults")], SearchBox.prototype, "goToResults", void 0);
23963
23963
 
@@ -25605,9 +25605,9 @@ var toggleHierarchyParam = function toggleHierarchyParam() {
25605
25605
  return getMostSpecificHierarchyTerms([param].concat(_toConsumableArray(params)));
25606
25606
  };
25607
25607
 
25608
- var searchResult$h = namespace("searchResult");
25608
+ var searchResult$i = namespace("searchResult");
25609
25609
  var params$c = namespace("params");
25610
- var options$9 = namespace("options");
25610
+ var options$a = namespace("options");
25611
25611
 
25612
25612
  var CurrentFilters = /*#__PURE__*/function (_Vue) {
25613
25613
  _inherits(CurrentFilters, _Vue);
@@ -25676,15 +25676,15 @@ __decorate([Prop({
25676
25676
  default: false
25677
25677
  })], CurrentFilters.prototype, "expandable", void 0);
25678
25678
 
25679
- __decorate([searchResult$h.Getter("filters")], CurrentFilters.prototype, "currentFilters", void 0);
25679
+ __decorate([searchResult$i.Getter("filters")], CurrentFilters.prototype, "currentFilters", void 0);
25680
25680
 
25681
- __decorate([searchResult$h.Getter("facets")], CurrentFilters.prototype, "facets", void 0);
25681
+ __decorate([searchResult$i.Getter("facets")], CurrentFilters.prototype, "facets", void 0);
25682
25682
 
25683
- __decorate([searchResult$h.Getter("displayFilters")], CurrentFilters.prototype, "displayFilters", void 0);
25683
+ __decorate([searchResult$i.Getter("displayFilters")], CurrentFilters.prototype, "displayFilters", void 0);
25684
25684
 
25685
- __decorate([searchResult$h.Getter("currentFilterCount")], CurrentFilters.prototype, "currentFilterCount", void 0);
25685
+ __decorate([searchResult$i.Getter("currentFilterCount")], CurrentFilters.prototype, "currentFilterCount", void 0);
25686
25686
 
25687
- __decorate([options$9.Getter("initialFilters")], CurrentFilters.prototype, "initialFilters", void 0);
25687
+ __decorate([options$a.Getter("initialFilters")], CurrentFilters.prototype, "initialFilters", void 0);
25688
25688
 
25689
25689
  __decorate([params$c.Action("removeParams")], CurrentFilters.prototype, "removeParams", void 0);
25690
25690
 
@@ -28619,7 +28619,7 @@ var _typeof = _typeof$2.exports.default;
28619
28619
 
28620
28620
  var VueSlider = /*@__PURE__*/getDefaultExportFromCjs(vueSliderComponent_umd_min.exports);
28621
28621
 
28622
- var options$8 = namespace("options");
28622
+ var options$9 = namespace("options");
28623
28623
 
28624
28624
  var TermFacet = /*#__PURE__*/function (_Vue) {
28625
28625
  _inherits(TermFacet, _Vue);
@@ -28826,7 +28826,7 @@ __decorate([Prop({
28826
28826
  }
28827
28827
  })], TermFacet.prototype, "currentFilters", void 0);
28828
28828
 
28829
- __decorate([options$8.State(function (s) {
28829
+ __decorate([options$9.State(function (s) {
28830
28830
  return s.searchResultOptions;
28831
28831
  })], TermFacet.prototype, "searchResultOptions", void 0);
28832
28832
 
@@ -29313,6 +29313,8 @@ var __vue_component__$J = /*#__PURE__*/normalizeComponent({
29313
29313
  staticRenderFns: __vue_staticRenderFns__$J
29314
29314
  }, __vue_inject_styles__$J, __vue_script__$J, __vue_scope_id__$J, __vue_is_functional_template__$J, __vue_module_identifier__$J, false, undefined, undefined, undefined);
29315
29315
 
29316
+ var searchResult$h = namespace("searchResult");
29317
+
29316
29318
  var FacetDisplay = /*#__PURE__*/function (_Vue) {
29317
29319
  _inherits(FacetDisplay, _Vue);
29318
29320
 
@@ -29360,7 +29362,23 @@ var FacetDisplay = /*#__PURE__*/function (_Vue) {
29360
29362
  }, {
29361
29363
  key: "hasFilter",
29362
29364
  get: function get() {
29363
- return Boolean(this.currentFilters[this.facet.key]);
29365
+ var _a;
29366
+
29367
+ return Boolean(((_a = this.currentFilters) !== null && _a !== void 0 ? _a : {})[this.facet.key]);
29368
+ }
29369
+ }, {
29370
+ key: "filterQueryKey",
29371
+ get: function get() {
29372
+ var _a, _b;
29373
+
29374
+ return (_b = (_a = this.options.facetFilterQueries) === null || _a === void 0 ? void 0 : _a[this.facet.key]) === null || _b === void 0 ? void 0 : _b.queryKey;
29375
+ }
29376
+ }, {
29377
+ key: "activeFilterKeys",
29378
+ get: function get() {
29379
+ var _a;
29380
+
29381
+ return ((_a = this.currentFilterKeys) !== null && _a !== void 0 ? _a : []).join(",");
29364
29382
  }
29365
29383
  }, {
29366
29384
  key: "mounted",
@@ -29395,10 +29413,28 @@ var FacetDisplay = /*#__PURE__*/function (_Vue) {
29395
29413
  this.isOpen = false;
29396
29414
  }
29397
29415
  }
29416
+ }, {
29417
+ key: "handleParamsChange",
29418
+ value: function handleParamsChange() {
29419
+ this.handleFacetQueryFilter();
29420
+ }
29398
29421
  }, {
29399
29422
  key: "toggleFacet",
29400
29423
  value: function toggleFacet() {
29401
29424
  this.isOpen = !this.isOpen;
29425
+ this.handleFacetQueryFilter();
29426
+ }
29427
+ }, {
29428
+ key: "handleFacetQueryFilter",
29429
+ value: function handleFacetQueryFilter() {
29430
+ if (!this.filterQueryKey || !this.isOpen) {
29431
+ return;
29432
+ }
29433
+
29434
+ this.queryFacet({
29435
+ queryKey: this.filterQueryKey,
29436
+ facetKey: this.facet.key
29437
+ });
29402
29438
  }
29403
29439
  }, {
29404
29440
  key: "handleFacetSelect",
@@ -29434,6 +29470,12 @@ __decorate([Prop({
29434
29470
  default: false
29435
29471
  })], FacetDisplay.prototype, "clearable", void 0);
29436
29472
 
29473
+ __decorate([searchResult$h.Getter("currentFilterKeys")], FacetDisplay.prototype, "currentFilterKeys", void 0);
29474
+
29475
+ __decorate([Watch("activeFilterKeys")], FacetDisplay.prototype, "handleParamsChange", null);
29476
+
29477
+ __decorate([searchResult$h.Action("queryFacet")], FacetDisplay.prototype, "queryFacet", void 0);
29478
+
29437
29479
  FacetDisplay = __decorate([Component({
29438
29480
  name: "facetDisplay",
29439
29481
  components: {
@@ -29942,7 +29984,7 @@ var __vue_component__$F = /*#__PURE__*/normalizeComponent({
29942
29984
  staticRenderFns: __vue_staticRenderFns__$F
29943
29985
  }, __vue_inject_styles__$F, __vue_script__$F, __vue_scope_id__$F, __vue_is_functional_template__$F, __vue_module_identifier__$F, false, undefined, undefined, undefined);
29944
29986
 
29945
- var options$7 = namespace("options");
29987
+ var options$8 = namespace("options");
29946
29988
 
29947
29989
  var CategoryFilter = /*#__PURE__*/function (_Vue) {
29948
29990
  _inherits(CategoryFilter, _Vue);
@@ -30078,9 +30120,9 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
30078
30120
 
30079
30121
  __decorate([Prop()], CategoryFilter.prototype, "options", void 0);
30080
30122
 
30081
- __decorate([options$7.Getter("envOptions")], CategoryFilter.prototype, "envOptions", void 0);
30123
+ __decorate([options$8.Getter("envOptions")], CategoryFilter.prototype, "envOptions", void 0);
30082
30124
 
30083
- __decorate([options$7.State(function (o) {
30125
+ __decorate([options$8.State(function (o) {
30084
30126
  return o.searchResultOptions;
30085
30127
  })], CategoryFilter.prototype, "searchResultOptions", void 0);
30086
30128
 
@@ -31069,7 +31111,7 @@ var __vue_component__$w = /*#__PURE__*/normalizeComponent({
31069
31111
  staticRenderFns: __vue_staticRenderFns__$w
31070
31112
  }, __vue_inject_styles__$w, __vue_script__$w, __vue_scope_id__$w, __vue_is_functional_template__$w, __vue_module_identifier__$w, false, undefined, undefined, undefined);
31071
31113
 
31072
- var options$6 = namespace("options");
31114
+ var options$7 = namespace("options");
31073
31115
 
31074
31116
  var SearchResultsProductTitle = /*#__PURE__*/function (_Vue) {
31075
31117
  _inherits(SearchResultsProductTitle, _Vue);
@@ -31122,7 +31164,7 @@ __decorate([Prop({
31122
31164
  default: ""
31123
31165
  })], SearchResultsProductTitle.prototype, "link", void 0);
31124
31166
 
31125
- __decorate([options$6.State(function (o) {
31167
+ __decorate([options$7.State(function (o) {
31126
31168
  return o.searchResultOptions;
31127
31169
  })], SearchResultsProductTitle.prototype, "searchResultOptions", void 0);
31128
31170
 
@@ -32033,7 +32075,7 @@ var __vue_component__$n = /*#__PURE__*/normalizeComponent({
32033
32075
  var tracking$3 = namespace("tracking");
32034
32076
  var params$9 = namespace("params");
32035
32077
  var searchResult$c = namespace("searchResult");
32036
- var options$5 = namespace("options");
32078
+ var options$6 = namespace("options");
32037
32079
 
32038
32080
  var SearchResultsProductCard = /*#__PURE__*/function (_Vue) {
32039
32081
  _inherits(SearchResultsProductCard, _Vue);
@@ -32083,7 +32125,9 @@ var SearchResultsProductCard = /*#__PURE__*/function (_Vue) {
32083
32125
  }, {
32084
32126
  key: "labels",
32085
32127
  get: function get() {
32086
- return this.options.labels;
32128
+ var _a;
32129
+
32130
+ return (_a = this.options.labels) !== null && _a !== void 0 ? _a : {};
32087
32131
  }
32088
32132
  }, {
32089
32133
  key: "link",
@@ -32204,7 +32248,7 @@ __decorate([searchResult$c.State(function (state) {
32204
32248
  return state.layout;
32205
32249
  })], SearchResultsProductCard.prototype, "layout", void 0);
32206
32250
 
32207
- __decorate([options$5.Getter("searchResultsRoutingBehavior")], SearchResultsProductCard.prototype, "searchResultsRoutingBehavior", void 0);
32251
+ __decorate([options$6.Getter("searchResultsRoutingBehavior")], SearchResultsProductCard.prototype, "searchResultsRoutingBehavior", void 0);
32208
32252
 
32209
32253
  __decorate([params$9.Getter("query")], SearchResultsProductCard.prototype, "query", void 0);
32210
32254
 
@@ -32253,7 +32297,7 @@ var __vue_render__$m = function __vue_render__() {
32253
32297
  on: {
32254
32298
  click: _vm.handleNavigation
32255
32299
  }
32256
- }, _vm._l(_vm.imageElements, function (element) {
32300
+ }, [_vm._l(_vm.imageElements, function (element) {
32257
32301
  return _c("SearchResultsProductCardElement", {
32258
32302
  key: element.key,
32259
32303
  staticClass: "lupa-search-results-product-element",
@@ -32265,7 +32309,9 @@ var __vue_render__$m = function __vue_render__() {
32265
32309
  link: _vm.link
32266
32310
  }
32267
32311
  });
32268
- }), 1), _vm._v(" "), _c("div", {
32312
+ }), _vm._v(" "), _vm.labels.outOfStock && !_vm.isInStock ? _c("div", {
32313
+ staticClass: "lupa-out-of-stock"
32314
+ }, [_vm._v("\n " + _vm._s(_vm.labels.outOfStock) + "\n ")]) : _vm._e()], 2), _vm._v(" "), _c("div", {
32269
32315
  staticClass: "lupa-search-result-product-details-section"
32270
32316
  }, _vm._l(_vm.detailElements, function (element) {
32271
32317
  return _c("SearchResultsProductCardElement", {
@@ -32507,7 +32553,7 @@ var track = function track(queryKey) {
32507
32553
  };
32508
32554
 
32509
32555
  var params$8 = namespace("params");
32510
- var options$4 = namespace("options");
32556
+ var options$5 = namespace("options");
32511
32557
 
32512
32558
  var AdditionalPanels$1 = /*#__PURE__*/function (_Vue) {
32513
32559
  _inherits(AdditionalPanels, _Vue);
@@ -32622,7 +32668,7 @@ __decorate([Prop({
32622
32668
 
32623
32669
  __decorate([params$8.Getter("query")], AdditionalPanels$1.prototype, "query", void 0);
32624
32670
 
32625
- __decorate([options$4.State(function (o) {
32671
+ __decorate([options$5.State(function (o) {
32626
32672
  return o.searchResultOptions;
32627
32673
  })], AdditionalPanels$1.prototype, "searchResultOptions", void 0);
32628
32674
 
@@ -33307,7 +33353,7 @@ var __vue_component__$h = /*#__PURE__*/normalizeComponent({
33307
33353
  }, __vue_inject_styles__$h, __vue_script__$h, __vue_scope_id__$h, __vue_is_functional_template__$h, __vue_module_identifier__$h, false, undefined, undefined, undefined);
33308
33354
 
33309
33355
  var searchResult$a = namespace("searchResult");
33310
- var options$3 = namespace("options");
33356
+ var options$4 = namespace("options");
33311
33357
 
33312
33358
  var SearchResultsLayoutSelection = /*#__PURE__*/function (_Vue) {
33313
33359
  _inherits(SearchResultsLayoutSelection, _Vue);
@@ -33334,7 +33380,7 @@ __decorate([searchResult$a.State(function (state) {
33334
33380
  return state.layout;
33335
33381
  })], SearchResultsLayoutSelection.prototype, "layout", void 0);
33336
33382
 
33337
- __decorate([options$3.Getter("classMap")], SearchResultsLayoutSelection.prototype, "classMap", void 0);
33383
+ __decorate([options$4.Getter("classMap")], SearchResultsLayoutSelection.prototype, "classMap", void 0);
33338
33384
 
33339
33385
  __decorate([searchResult$a.Action("setLayout")], SearchResultsLayoutSelection.prototype, "setLayout", void 0);
33340
33386
 
@@ -33588,6 +33634,7 @@ var __vue_component__$e = /*#__PURE__*/normalizeComponent({
33588
33634
 
33589
33635
  var searchResult$7 = namespace("searchResult");
33590
33636
  var params$4 = namespace("params");
33637
+ var options$3 = namespace("options");
33591
33638
 
33592
33639
  var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33593
33640
  _inherits(SearchResultsToolbar, _Vue);
@@ -33664,11 +33711,10 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33664
33711
  }, {
33665
33712
  key: "paginationOptions",
33666
33713
  get: function get() {
33667
- var pageSize = this.options.pagination.sizeSelection;
33668
33714
  var pageSelect = this.options.pagination.pageSelection;
33669
- var r = {
33715
+ return {
33670
33716
  pageSize: {
33671
- sizes: pageSize.sizes,
33717
+ sizes: this.currentResolutionPageSizes,
33672
33718
  selectedSize: this.limit
33673
33719
  },
33674
33720
  pageSelect: {
@@ -33679,7 +33725,6 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33679
33725
  },
33680
33726
  labels: this.options.labels
33681
33727
  };
33682
- return r;
33683
33728
  }
33684
33729
  }, {
33685
33730
  key: "displayPageSelect",
@@ -33728,6 +33773,8 @@ __decorate([searchResult$7.State(function (state) {
33728
33773
  return state.searchResult;
33729
33774
  })], SearchResultsToolbar.prototype, "searchResult", void 0);
33730
33775
 
33776
+ __decorate([options$3.Getter("currentResolutionPageSizes")], SearchResultsToolbar.prototype, "currentResolutionPageSizes", void 0);
33777
+
33731
33778
  __decorate([params$4.Action("removeAllFilters")], SearchResultsToolbar.prototype, "removeAllFilters", void 0);
33732
33779
 
33733
33780
  SearchResultsToolbar = __decorate([Component({
@@ -34819,13 +34866,11 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
34819
34866
  }, {
34820
34867
  key: "handleMounted",
34821
34868
  value: function handleMounted() {
34822
- var _a, _b, _c;
34823
-
34824
34869
  this.handleResize();
34825
34870
  var params = new URLSearchParams(window.location.search);
34826
34871
  this.handleUrlChange(params);
34827
34872
  this.addParams(parseParams(params));
34828
- 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]);
34873
+ this.setDefaultLimit(this.defaultSearchResultPageSize);
34829
34874
  }
34830
34875
  }, {
34831
34876
  key: "handleParamsChange",
@@ -36422,8 +36467,6 @@ var setDocumentTitle = function setDocumentTitle(template) {
36422
36467
  document.title = addParamsToLabel(template, textToInsert);
36423
36468
  };
36424
36469
 
36425
- var MOBILE_WIDTH = 767;
36426
-
36427
36470
  var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36428
36471
  _inherits(SearchResultModule, _VuexModule);
36429
36472
 
@@ -36503,6 +36546,13 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36503
36546
 
36504
36547
  return (_b = (_a = this.displayFilters) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
36505
36548
  }
36549
+ }, {
36550
+ key: "currentFilterKeys",
36551
+ get: function get() {
36552
+ var _a;
36553
+
36554
+ return Object.keys((_a = this.currentFilters) !== null && _a !== void 0 ? _a : {});
36555
+ }
36506
36556
  }, {
36507
36557
  key: "hasAnyFilter",
36508
36558
  get: function get() {
@@ -36520,7 +36570,24 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36520
36570
  }, {
36521
36571
  key: "isMobileWidth",
36522
36572
  get: function get() {
36523
- return this.screenWidth < MOBILE_WIDTH;
36573
+ return this.currentScreenWidth === "sm" || this.currentScreenWidth === "xs";
36574
+ }
36575
+ }, {
36576
+ key: "currentScreenWidth",
36577
+ get: function get() {
36578
+ var width = this.screenWidth;
36579
+
36580
+ if (width <= S_MIN_WIDTH) {
36581
+ return "xs";
36582
+ } else if (width > S_MIN_WIDTH && width <= MD_MIN_WIDTH) {
36583
+ return "sm";
36584
+ } else if (width > MD_MIN_WIDTH && width <= L_MIN_WIDTH) {
36585
+ return "md";
36586
+ } else if (width > L_MIN_WIDTH && width <= XL_MIN_WIDTH) {
36587
+ return "l";
36588
+ } else {
36589
+ return "xl";
36590
+ }
36524
36591
  }
36525
36592
  }, {
36526
36593
  key: "setSidebarVisibility",
@@ -36540,6 +36607,62 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36540
36607
  this.addToCartAmount = addToCartAmount || this.addToCartAmount;
36541
36608
  this.layout = layout || this.layout;
36542
36609
  }
36610
+ }, {
36611
+ key: "queryFacet",
36612
+ value: function queryFacet(_ref3) {
36613
+ var queryKey = _ref3.queryKey,
36614
+ facetKey = _ref3.facetKey;
36615
+
36616
+ var _a, _b, _c, _d, _e;
36617
+
36618
+ return __awaiter$1(this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
36619
+ var query, options, result, facet, facetItems, updatedResult;
36620
+ return regenerator.wrap(function _callee$(_context) {
36621
+ while (1) {
36622
+ switch (_context.prev = _context.next) {
36623
+ case 0:
36624
+ query = {
36625
+ searchText: "",
36626
+ filters: Object.assign({}, this.currentFilters)
36627
+ };
36628
+ options = (_a = this.context.rootGetters["options/envOptions"]) !== null && _a !== void 0 ? _a : {};
36629
+ _context.next = 4;
36630
+ return getLupaSdk.query(queryKey, query, options);
36631
+
36632
+ case 4:
36633
+ result = _context.sent;
36634
+
36635
+ if (result.success) {
36636
+ _context.next = 7;
36637
+ break;
36638
+ }
36639
+
36640
+ return _context.abrupt("return");
36641
+
36642
+ case 7:
36643
+ facet = (_b = result.facets) === null || _b === void 0 ? void 0 : _b.find(function (f) {
36644
+ return f.key === facetKey;
36645
+ });
36646
+ facetItems = (_d = (_c = facet) === null || _c === void 0 ? void 0 : _c.items) !== null && _d !== void 0 ? _d : [];
36647
+ updatedResult = Object.assign(Object.assign({}, this.searchResult), {
36648
+ facets: (_e = this.facets) === null || _e === void 0 ? void 0 : _e.map(function (f) {
36649
+ return f.key === facetKey ? Object.assign(Object.assign({}, f), {
36650
+ items: facetItems
36651
+ }) : f;
36652
+ })
36653
+ });
36654
+ this.context.commit("save", {
36655
+ searchResult: updatedResult
36656
+ });
36657
+
36658
+ case 11:
36659
+ case "end":
36660
+ return _context.stop();
36661
+ }
36662
+ }
36663
+ }, _callee, this);
36664
+ }));
36665
+ }
36543
36666
  }, {
36544
36667
  key: "load",
36545
36668
  value: function load(loading) {
@@ -36547,8 +36670,8 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36547
36670
  }
36548
36671
  }, {
36549
36672
  key: "setScreenWidth",
36550
- value: function setScreenWidth(_ref3) {
36551
- var width = _ref3.width;
36673
+ value: function setScreenWidth(_ref4) {
36674
+ var width = _ref4.width;
36552
36675
  this.screenWidth = width;
36553
36676
  }
36554
36677
  }, {
@@ -36569,9 +36692,9 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36569
36692
  }
36570
36693
  }, {
36571
36694
  key: "setColumnCount",
36572
- value: function setColumnCount(_ref4) {
36573
- var width = _ref4.width,
36574
- grid = _ref4.grid;
36695
+ value: function setColumnCount(_ref5) {
36696
+ var width = _ref5.width,
36697
+ grid = _ref5.grid;
36575
36698
 
36576
36699
  if (!width || !grid) {
36577
36700
  return {
@@ -36641,6 +36764,8 @@ __decorate([Mutation], SearchResultModule.prototype, "setSidebarVisibility", nul
36641
36764
 
36642
36765
  __decorate([Mutation], SearchResultModule.prototype, "save", null);
36643
36766
 
36767
+ __decorate([Action], SearchResultModule.prototype, "queryFacet", null);
36768
+
36644
36769
  __decorate([Mutation], SearchResultModule.prototype, "load", null);
36645
36770
 
36646
36771
  __decorate([Mutation], SearchResultModule.prototype, "setScreenWidth", null);
@@ -36985,9 +37110,39 @@ var OptionsModule = /*#__PURE__*/function (_VuexModule) {
36985
37110
  }, {
36986
37111
  key: "defaultSearchResultPageSize",
36987
37112
  get: function get() {
36988
- var _a, _b, _c, _d, _e;
37113
+ var _a, _b;
37114
+
37115
+ return (_b = (_a = this.currentResolutionPageSizes) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : DEFAULT_PAGE_SIZE;
37116
+ }
37117
+ }, {
37118
+ key: "currentResolutionPageSizes",
37119
+ get: function get() {
37120
+ var _a, _b, _c;
36989
37121
 
36990
- return (_e = (_d = (_c = (_b = (_a = this.searchResultOptions) === null || _a === void 0 ? void 0 : _a.pagination) === null || _b === void 0 ? void 0 : _b.sizeSelection) === null || _c === void 0 ? void 0 : _c.sizes) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : DEFAULT_PAGE_SIZE;
37122
+ var pageSizes = (_c = (_b = (_a = this.searchResultOptions) === null || _a === void 0 ? void 0 : _a.pagination) === null || _b === void 0 ? void 0 : _b.sizeSelection) === null || _c === void 0 ? void 0 : _c.sizes;
37123
+
37124
+ if (Array.isArray(pageSizes)) {
37125
+ return pageSizes;
37126
+ }
37127
+
37128
+ var screenSize = this.context.rootGetters["searchResult/currentScreenWidth"];
37129
+
37130
+ switch (screenSize) {
37131
+ case "xs":
37132
+ return pageSizes.xs;
37133
+
37134
+ case "sm":
37135
+ return pageSizes.sm;
37136
+
37137
+ case "md":
37138
+ return pageSizes.md;
37139
+
37140
+ case "l":
37141
+ return pageSizes.l;
37142
+
37143
+ case "xl":
37144
+ return pageSizes.xl;
37145
+ }
36991
37146
  }
36992
37147
  }, {
36993
37148
  key: "setSearchBoxOptions",
@@ -13,6 +13,7 @@ export default class OptionsModule extends VuexModule {
13
13
  get boxRoutingBehavior(): RoutingBehavior;
14
14
  get searchResultsRoutingBehavior(): RoutingBehavior;
15
15
  get defaultSearchResultPageSize(): number;
16
+ get currentResolutionPageSizes(): number[];
16
17
  setSearchBoxOptions({ options }: {
17
18
  options: SearchBoxOptions;
18
19
  }): void;
@@ -1,3 +1,4 @@
1
+ import { ScreenSize } from "@/types/General";
1
2
  import { LabeledFilter } from "@/types/search-results/Filters";
2
3
  import { ResultsLayout } from "@/types/search-results/ResultsLayout";
3
4
  import { ProductGrid } from "@/types/search-results/SearchResultsOptions";
@@ -20,9 +21,11 @@ export default class SearchResultModule extends VuexModule {
20
21
  get labeledFilters(): LabeledFilter[];
21
22
  get displayFilters(): LabeledFilter[];
22
23
  get currentFilterCount(): number;
24
+ get currentFilterKeys(): string[];
23
25
  get hasAnyFilter(): boolean;
24
26
  get itemRange(): number[];
25
27
  get isMobileWidth(): boolean;
28
+ get currentScreenWidth(): ScreenSize;
26
29
  setSidebarVisibility({ visible }: {
27
30
  visible: boolean;
28
31
  }): void;
@@ -32,6 +35,10 @@ export default class SearchResultModule extends VuexModule {
32
35
  addToCartAmount?: number;
33
36
  layout?: ResultsLayout;
34
37
  }): void;
38
+ queryFacet({ queryKey, facetKey, }: {
39
+ queryKey: string;
40
+ facetKey: string;
41
+ }): Promise<void>;
35
42
  load(loading: boolean): void;
36
43
  setScreenWidth({ width }: {
37
44
  width: number;
@@ -16,3 +16,4 @@ export declare type TrackingOptions = {
16
16
  };
17
17
  export declare type Environment = SdkEnvironment;
18
18
  export declare type SortDirection = "asc" | "desc";
19
+ export declare type ScreenSize = "xs" | "sm" | "md" | "l" | "xl";
@@ -37,6 +37,7 @@ export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels &
37
37
  emptyResults: string;
38
38
  mobileFilterButton: string;
39
39
  htmlTitleTemplate: string;
40
+ outOfStock?: string;
40
41
  };
41
42
  export declare type SearchResultsAdditionalPanels = {
42
43
  additionalPanels?: SearchResultsAdditionalPanelOptions[];
@@ -69,9 +70,17 @@ export declare type SearchResultsPaginationLabels = {
69
70
  pageSize: string;
70
71
  showMore: string;
71
72
  };
73
+ export declare type ResponsiveSearchResultPageSizes = {
74
+ xs: number[];
75
+ sm: number[];
76
+ md: number[];
77
+ l: number[];
78
+ xl: number[];
79
+ };
80
+ export declare type SearchResultPageSizes = number[] | ResponsiveSearchResultPageSizes;
72
81
  export declare type SearchResultsPagination = {
73
82
  sizeSelection: {
74
- sizes: number[];
83
+ sizes: SearchResultPageSizes;
75
84
  position: SearchResultsPaginationPosition;
76
85
  };
77
86
  pageSelection: {
@@ -99,6 +108,9 @@ export declare type ResultCurrentFilterOptions = {
99
108
  };
100
109
  };
101
110
  export declare type FacetStyle = "sidebar" | "top-dropdown";
111
+ export declare type FacetFilterQuery = {
112
+ queryKey: string;
113
+ };
102
114
  export declare type ResultFacetOptions = {
103
115
  labels: {
104
116
  title: string;
@@ -130,6 +142,7 @@ export declare type ResultFacetOptions = {
130
142
  type: FacetStyle;
131
143
  };
132
144
  exclude?: string[];
145
+ facetFilterQueries?: Record<string, FacetFilterQuery>;
133
146
  };
134
147
  export declare type SearchResultsFilterOptions = {
135
148
  currentFilters?: ResultCurrentFilterOptions;
@@ -7,14 +7,23 @@ export default class FacetDisplay extends Vue {
7
7
  facet: FacetResult;
8
8
  currentFilters: FilterGroup;
9
9
  clearable: boolean;
10
+ currentFilterKeys: string[];
10
11
  isOpen: boolean;
11
12
  get facetType(): string;
12
13
  get hasItems(): boolean;
13
14
  get hasFilter(): boolean;
15
+ get filterQueryKey(): string | undefined;
16
+ get activeFilterKeys(): string;
14
17
  mounted(): void;
15
18
  beforeDestroy(): void;
16
19
  handleMouseClick(e: MouseEvent): void;
20
+ handleParamsChange(): void;
21
+ queryFacet: ({ queryKey, facetKey, }: {
22
+ queryKey: string;
23
+ facetKey: string;
24
+ }) => Promise<void>;
17
25
  toggleFacet(): void;
26
+ handleFacetQueryFilter(): void;
18
27
  handleFacetSelect(item: FacetAction): void;
19
28
  clear(): void;
20
29
  }
@@ -21,6 +21,7 @@ export default class SearchResultsToolbar extends Vue {
21
21
  get displayPageSelect(): boolean;
22
22
  get searchSummaryLabel(): string;
23
23
  get showMobileFilterCount(): boolean;
24
+ currentResolutionPageSizes: number[];
24
25
  removeAllFilters: () => {
25
26
  params: QueryParams;
26
27
  };