@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.
@@ -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
  };
@@ -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;
@@ -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$b = namespace("options");
22150
+ var options$c = 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$b.Getter("boxRoutingBehavior")], SearchBoxProduct.prototype, "boxRoutingBehavior", void 0);
22248
+ __decorate([options$c.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$a = namespace("options");
23679
+ var options$b = 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$a.Mutation("setSearchBoxOptions")], SearchBox.prototype, "setSearchBoxOptions", void 0);
23964
+ __decorate([options$b.Mutation("setSearchBoxOptions")], SearchBox.prototype, "setSearchBoxOptions", void 0);
23965
23965
 
23966
23966
  __decorate([params$d.Action("goToResults")], SearchBox.prototype, "goToResults", void 0);
23967
23967
 
@@ -25609,9 +25609,9 @@ var toggleHierarchyParam = function toggleHierarchyParam() {
25609
25609
  return getMostSpecificHierarchyTerms([param].concat(_toConsumableArray(params)));
25610
25610
  };
25611
25611
 
25612
- var searchResult$h = namespace("searchResult");
25612
+ var searchResult$i = namespace("searchResult");
25613
25613
  var params$c = namespace("params");
25614
- var options$9 = namespace("options");
25614
+ var options$a = namespace("options");
25615
25615
 
25616
25616
  var CurrentFilters = /*#__PURE__*/function (_Vue) {
25617
25617
  _inherits(CurrentFilters, _Vue);
@@ -25680,15 +25680,15 @@ __decorate([Prop({
25680
25680
  default: false
25681
25681
  })], CurrentFilters.prototype, "expandable", void 0);
25682
25682
 
25683
- __decorate([searchResult$h.Getter("filters")], CurrentFilters.prototype, "currentFilters", void 0);
25683
+ __decorate([searchResult$i.Getter("filters")], CurrentFilters.prototype, "currentFilters", void 0);
25684
25684
 
25685
- __decorate([searchResult$h.Getter("facets")], CurrentFilters.prototype, "facets", void 0);
25685
+ __decorate([searchResult$i.Getter("facets")], CurrentFilters.prototype, "facets", void 0);
25686
25686
 
25687
- __decorate([searchResult$h.Getter("displayFilters")], CurrentFilters.prototype, "displayFilters", void 0);
25687
+ __decorate([searchResult$i.Getter("displayFilters")], CurrentFilters.prototype, "displayFilters", void 0);
25688
25688
 
25689
- __decorate([searchResult$h.Getter("currentFilterCount")], CurrentFilters.prototype, "currentFilterCount", void 0);
25689
+ __decorate([searchResult$i.Getter("currentFilterCount")], CurrentFilters.prototype, "currentFilterCount", void 0);
25690
25690
 
25691
- __decorate([options$9.Getter("initialFilters")], CurrentFilters.prototype, "initialFilters", void 0);
25691
+ __decorate([options$a.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$8 = namespace("options");
28626
+ var options$9 = 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$8.State(function (s) {
28833
+ __decorate([options$9.State(function (s) {
28834
28834
  return s.searchResultOptions;
28835
28835
  })], TermFacet.prototype, "searchResultOptions", void 0);
28836
28836
 
@@ -29317,6 +29317,8 @@ var __vue_component__$J = /*#__PURE__*/normalizeComponent({
29317
29317
  staticRenderFns: __vue_staticRenderFns__$J
29318
29318
  }, __vue_inject_styles__$J, __vue_script__$J, __vue_scope_id__$J, __vue_is_functional_template__$J, __vue_module_identifier__$J, false, undefined, undefined, undefined);
29319
29319
 
29320
+ var searchResult$h = namespace("searchResult");
29321
+
29320
29322
  var FacetDisplay = /*#__PURE__*/function (_Vue) {
29321
29323
  _inherits(FacetDisplay, _Vue);
29322
29324
 
@@ -29364,7 +29366,23 @@ var FacetDisplay = /*#__PURE__*/function (_Vue) {
29364
29366
  }, {
29365
29367
  key: "hasFilter",
29366
29368
  get: function get() {
29367
- return Boolean(this.currentFilters[this.facet.key]);
29369
+ var _a;
29370
+
29371
+ return Boolean(((_a = this.currentFilters) !== null && _a !== void 0 ? _a : {})[this.facet.key]);
29372
+ }
29373
+ }, {
29374
+ key: "filterQueryKey",
29375
+ get: function get() {
29376
+ var _a, _b;
29377
+
29378
+ return (_b = (_a = this.options.facetFilterQueries) === null || _a === void 0 ? void 0 : _a[this.facet.key]) === null || _b === void 0 ? void 0 : _b.queryKey;
29379
+ }
29380
+ }, {
29381
+ key: "activeFilterKeys",
29382
+ get: function get() {
29383
+ var _a;
29384
+
29385
+ return ((_a = this.currentFilterKeys) !== null && _a !== void 0 ? _a : []).join(",");
29368
29386
  }
29369
29387
  }, {
29370
29388
  key: "mounted",
@@ -29399,10 +29417,28 @@ var FacetDisplay = /*#__PURE__*/function (_Vue) {
29399
29417
  this.isOpen = false;
29400
29418
  }
29401
29419
  }
29420
+ }, {
29421
+ key: "handleParamsChange",
29422
+ value: function handleParamsChange() {
29423
+ this.handleFacetQueryFilter();
29424
+ }
29402
29425
  }, {
29403
29426
  key: "toggleFacet",
29404
29427
  value: function toggleFacet() {
29405
29428
  this.isOpen = !this.isOpen;
29429
+ this.handleFacetQueryFilter();
29430
+ }
29431
+ }, {
29432
+ key: "handleFacetQueryFilter",
29433
+ value: function handleFacetQueryFilter() {
29434
+ if (!this.filterQueryKey || !this.isOpen) {
29435
+ return;
29436
+ }
29437
+
29438
+ this.queryFacet({
29439
+ queryKey: this.filterQueryKey,
29440
+ facetKey: this.facet.key
29441
+ });
29406
29442
  }
29407
29443
  }, {
29408
29444
  key: "handleFacetSelect",
@@ -29438,6 +29474,12 @@ __decorate([Prop({
29438
29474
  default: false
29439
29475
  })], FacetDisplay.prototype, "clearable", void 0);
29440
29476
 
29477
+ __decorate([searchResult$h.Getter("currentFilterKeys")], FacetDisplay.prototype, "currentFilterKeys", void 0);
29478
+
29479
+ __decorate([Watch("activeFilterKeys")], FacetDisplay.prototype, "handleParamsChange", null);
29480
+
29481
+ __decorate([searchResult$h.Action("queryFacet")], FacetDisplay.prototype, "queryFacet", void 0);
29482
+
29441
29483
  FacetDisplay = __decorate([Component({
29442
29484
  name: "facetDisplay",
29443
29485
  components: {
@@ -29946,7 +29988,7 @@ var __vue_component__$F = /*#__PURE__*/normalizeComponent({
29946
29988
  staticRenderFns: __vue_staticRenderFns__$F
29947
29989
  }, __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
29990
 
29949
- var options$7 = namespace("options");
29991
+ var options$8 = namespace("options");
29950
29992
 
29951
29993
  var CategoryFilter = /*#__PURE__*/function (_Vue) {
29952
29994
  _inherits(CategoryFilter, _Vue);
@@ -30082,9 +30124,9 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
30082
30124
 
30083
30125
  __decorate([Prop()], CategoryFilter.prototype, "options", void 0);
30084
30126
 
30085
- __decorate([options$7.Getter("envOptions")], CategoryFilter.prototype, "envOptions", void 0);
30127
+ __decorate([options$8.Getter("envOptions")], CategoryFilter.prototype, "envOptions", void 0);
30086
30128
 
30087
- __decorate([options$7.State(function (o) {
30129
+ __decorate([options$8.State(function (o) {
30088
30130
  return o.searchResultOptions;
30089
30131
  })], CategoryFilter.prototype, "searchResultOptions", void 0);
30090
30132
 
@@ -31073,7 +31115,7 @@ var __vue_component__$w = /*#__PURE__*/normalizeComponent({
31073
31115
  staticRenderFns: __vue_staticRenderFns__$w
31074
31116
  }, __vue_inject_styles__$w, __vue_script__$w, __vue_scope_id__$w, __vue_is_functional_template__$w, __vue_module_identifier__$w, false, undefined, undefined, undefined);
31075
31117
 
31076
- var options$6 = namespace("options");
31118
+ var options$7 = namespace("options");
31077
31119
 
31078
31120
  var SearchResultsProductTitle = /*#__PURE__*/function (_Vue) {
31079
31121
  _inherits(SearchResultsProductTitle, _Vue);
@@ -31126,7 +31168,7 @@ __decorate([Prop({
31126
31168
  default: ""
31127
31169
  })], SearchResultsProductTitle.prototype, "link", void 0);
31128
31170
 
31129
- __decorate([options$6.State(function (o) {
31171
+ __decorate([options$7.State(function (o) {
31130
31172
  return o.searchResultOptions;
31131
31173
  })], SearchResultsProductTitle.prototype, "searchResultOptions", void 0);
31132
31174
 
@@ -32037,7 +32079,7 @@ var __vue_component__$n = /*#__PURE__*/normalizeComponent({
32037
32079
  var tracking$3 = namespace("tracking");
32038
32080
  var params$9 = namespace("params");
32039
32081
  var searchResult$c = namespace("searchResult");
32040
- var options$5 = namespace("options");
32082
+ var options$6 = namespace("options");
32041
32083
 
32042
32084
  var SearchResultsProductCard = /*#__PURE__*/function (_Vue) {
32043
32085
  _inherits(SearchResultsProductCard, _Vue);
@@ -32087,7 +32129,9 @@ var SearchResultsProductCard = /*#__PURE__*/function (_Vue) {
32087
32129
  }, {
32088
32130
  key: "labels",
32089
32131
  get: function get() {
32090
- return this.options.labels;
32132
+ var _a;
32133
+
32134
+ return (_a = this.options.labels) !== null && _a !== void 0 ? _a : {};
32091
32135
  }
32092
32136
  }, {
32093
32137
  key: "link",
@@ -32208,7 +32252,7 @@ __decorate([searchResult$c.State(function (state) {
32208
32252
  return state.layout;
32209
32253
  })], SearchResultsProductCard.prototype, "layout", void 0);
32210
32254
 
32211
- __decorate([options$5.Getter("searchResultsRoutingBehavior")], SearchResultsProductCard.prototype, "searchResultsRoutingBehavior", void 0);
32255
+ __decorate([options$6.Getter("searchResultsRoutingBehavior")], SearchResultsProductCard.prototype, "searchResultsRoutingBehavior", void 0);
32212
32256
 
32213
32257
  __decorate([params$9.Getter("query")], SearchResultsProductCard.prototype, "query", void 0);
32214
32258
 
@@ -32257,7 +32301,7 @@ var __vue_render__$m = function __vue_render__() {
32257
32301
  on: {
32258
32302
  click: _vm.handleNavigation
32259
32303
  }
32260
- }, _vm._l(_vm.imageElements, function (element) {
32304
+ }, [_vm._l(_vm.imageElements, function (element) {
32261
32305
  return _c("SearchResultsProductCardElement", {
32262
32306
  key: element.key,
32263
32307
  staticClass: "lupa-search-results-product-element",
@@ -32269,7 +32313,9 @@ var __vue_render__$m = function __vue_render__() {
32269
32313
  link: _vm.link
32270
32314
  }
32271
32315
  });
32272
- }), 1), _vm._v(" "), _c("div", {
32316
+ }), _vm._v(" "), _vm.labels.outOfStock && !_vm.isInStock ? _c("div", {
32317
+ staticClass: "lupa-out-of-stock"
32318
+ }, [_vm._v("\n " + _vm._s(_vm.labels.outOfStock) + "\n ")]) : _vm._e()], 2), _vm._v(" "), _c("div", {
32273
32319
  staticClass: "lupa-search-result-product-details-section"
32274
32320
  }, _vm._l(_vm.detailElements, function (element) {
32275
32321
  return _c("SearchResultsProductCardElement", {
@@ -32511,7 +32557,7 @@ var track = function track(queryKey) {
32511
32557
  };
32512
32558
 
32513
32559
  var params$8 = namespace("params");
32514
- var options$4 = namespace("options");
32560
+ var options$5 = namespace("options");
32515
32561
 
32516
32562
  var AdditionalPanels$1 = /*#__PURE__*/function (_Vue) {
32517
32563
  _inherits(AdditionalPanels, _Vue);
@@ -32626,7 +32672,7 @@ __decorate([Prop({
32626
32672
 
32627
32673
  __decorate([params$8.Getter("query")], AdditionalPanels$1.prototype, "query", void 0);
32628
32674
 
32629
- __decorate([options$4.State(function (o) {
32675
+ __decorate([options$5.State(function (o) {
32630
32676
  return o.searchResultOptions;
32631
32677
  })], AdditionalPanels$1.prototype, "searchResultOptions", void 0);
32632
32678
 
@@ -33311,7 +33357,7 @@ var __vue_component__$h = /*#__PURE__*/normalizeComponent({
33311
33357
  }, __vue_inject_styles__$h, __vue_script__$h, __vue_scope_id__$h, __vue_is_functional_template__$h, __vue_module_identifier__$h, false, undefined, undefined, undefined);
33312
33358
 
33313
33359
  var searchResult$a = namespace("searchResult");
33314
- var options$3 = namespace("options");
33360
+ var options$4 = namespace("options");
33315
33361
 
33316
33362
  var SearchResultsLayoutSelection = /*#__PURE__*/function (_Vue) {
33317
33363
  _inherits(SearchResultsLayoutSelection, _Vue);
@@ -33338,7 +33384,7 @@ __decorate([searchResult$a.State(function (state) {
33338
33384
  return state.layout;
33339
33385
  })], SearchResultsLayoutSelection.prototype, "layout", void 0);
33340
33386
 
33341
- __decorate([options$3.Getter("classMap")], SearchResultsLayoutSelection.prototype, "classMap", void 0);
33387
+ __decorate([options$4.Getter("classMap")], SearchResultsLayoutSelection.prototype, "classMap", void 0);
33342
33388
 
33343
33389
  __decorate([searchResult$a.Action("setLayout")], SearchResultsLayoutSelection.prototype, "setLayout", void 0);
33344
33390
 
@@ -33592,6 +33638,7 @@ var __vue_component__$e = /*#__PURE__*/normalizeComponent({
33592
33638
 
33593
33639
  var searchResult$7 = namespace("searchResult");
33594
33640
  var params$4 = namespace("params");
33641
+ var options$3 = namespace("options");
33595
33642
 
33596
33643
  var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33597
33644
  _inherits(SearchResultsToolbar, _Vue);
@@ -33668,11 +33715,10 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33668
33715
  }, {
33669
33716
  key: "paginationOptions",
33670
33717
  get: function get() {
33671
- var pageSize = this.options.pagination.sizeSelection;
33672
33718
  var pageSelect = this.options.pagination.pageSelection;
33673
- var r = {
33719
+ return {
33674
33720
  pageSize: {
33675
- sizes: pageSize.sizes,
33721
+ sizes: this.currentResolutionPageSizes,
33676
33722
  selectedSize: this.limit
33677
33723
  },
33678
33724
  pageSelect: {
@@ -33683,7 +33729,6 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33683
33729
  },
33684
33730
  labels: this.options.labels
33685
33731
  };
33686
- return r;
33687
33732
  }
33688
33733
  }, {
33689
33734
  key: "displayPageSelect",
@@ -33732,6 +33777,8 @@ __decorate([searchResult$7.State(function (state) {
33732
33777
  return state.searchResult;
33733
33778
  })], SearchResultsToolbar.prototype, "searchResult", void 0);
33734
33779
 
33780
+ __decorate([options$3.Getter("currentResolutionPageSizes")], SearchResultsToolbar.prototype, "currentResolutionPageSizes", void 0);
33781
+
33735
33782
  __decorate([params$4.Action("removeAllFilters")], SearchResultsToolbar.prototype, "removeAllFilters", void 0);
33736
33783
 
33737
33784
  SearchResultsToolbar = __decorate([Component({
@@ -34823,13 +34870,11 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
34823
34870
  }, {
34824
34871
  key: "handleMounted",
34825
34872
  value: function handleMounted() {
34826
- var _a, _b, _c;
34827
-
34828
34873
  this.handleResize();
34829
34874
  var params = new URLSearchParams(window.location.search);
34830
34875
  this.handleUrlChange(params);
34831
34876
  this.addParams(parseParams(params));
34832
- 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]);
34877
+ this.setDefaultLimit(this.defaultSearchResultPageSize);
34833
34878
  }
34834
34879
  }, {
34835
34880
  key: "handleParamsChange",
@@ -36426,8 +36471,6 @@ var setDocumentTitle = function setDocumentTitle(template) {
36426
36471
  document.title = addParamsToLabel(template, textToInsert);
36427
36472
  };
36428
36473
 
36429
- var MOBILE_WIDTH = 767;
36430
-
36431
36474
  var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36432
36475
  _inherits(SearchResultModule, _VuexModule);
36433
36476
 
@@ -36507,6 +36550,13 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36507
36550
 
36508
36551
  return (_b = (_a = this.displayFilters) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
36509
36552
  }
36553
+ }, {
36554
+ key: "currentFilterKeys",
36555
+ get: function get() {
36556
+ var _a;
36557
+
36558
+ return Object.keys((_a = this.currentFilters) !== null && _a !== void 0 ? _a : {});
36559
+ }
36510
36560
  }, {
36511
36561
  key: "hasAnyFilter",
36512
36562
  get: function get() {
@@ -36524,7 +36574,24 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36524
36574
  }, {
36525
36575
  key: "isMobileWidth",
36526
36576
  get: function get() {
36527
- return this.screenWidth < MOBILE_WIDTH;
36577
+ return this.currentScreenWidth === "sm" || this.currentScreenWidth === "xs";
36578
+ }
36579
+ }, {
36580
+ key: "currentScreenWidth",
36581
+ get: function get() {
36582
+ var width = this.screenWidth;
36583
+
36584
+ if (width <= S_MIN_WIDTH) {
36585
+ return "xs";
36586
+ } else if (width > S_MIN_WIDTH && width <= MD_MIN_WIDTH) {
36587
+ return "sm";
36588
+ } else if (width > MD_MIN_WIDTH && width <= L_MIN_WIDTH) {
36589
+ return "md";
36590
+ } else if (width > L_MIN_WIDTH && width <= XL_MIN_WIDTH) {
36591
+ return "l";
36592
+ } else {
36593
+ return "xl";
36594
+ }
36528
36595
  }
36529
36596
  }, {
36530
36597
  key: "setSidebarVisibility",
@@ -36544,6 +36611,62 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36544
36611
  this.addToCartAmount = addToCartAmount || this.addToCartAmount;
36545
36612
  this.layout = layout || this.layout;
36546
36613
  }
36614
+ }, {
36615
+ key: "queryFacet",
36616
+ value: function queryFacet(_ref3) {
36617
+ var queryKey = _ref3.queryKey,
36618
+ facetKey = _ref3.facetKey;
36619
+
36620
+ var _a, _b, _c, _d, _e;
36621
+
36622
+ return __awaiter$1(this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
36623
+ var query, options, result, facet, facetItems, updatedResult;
36624
+ return regenerator.wrap(function _callee$(_context) {
36625
+ while (1) {
36626
+ switch (_context.prev = _context.next) {
36627
+ case 0:
36628
+ query = {
36629
+ searchText: "",
36630
+ filters: Object.assign({}, this.currentFilters)
36631
+ };
36632
+ options = (_a = this.context.rootGetters["options/envOptions"]) !== null && _a !== void 0 ? _a : {};
36633
+ _context.next = 4;
36634
+ return getLupaSdk.query(queryKey, query, options);
36635
+
36636
+ case 4:
36637
+ result = _context.sent;
36638
+
36639
+ if (result.success) {
36640
+ _context.next = 7;
36641
+ break;
36642
+ }
36643
+
36644
+ return _context.abrupt("return");
36645
+
36646
+ case 7:
36647
+ facet = (_b = result.facets) === null || _b === void 0 ? void 0 : _b.find(function (f) {
36648
+ return f.key === facetKey;
36649
+ });
36650
+ facetItems = (_d = (_c = facet) === null || _c === void 0 ? void 0 : _c.items) !== null && _d !== void 0 ? _d : [];
36651
+ updatedResult = Object.assign(Object.assign({}, this.searchResult), {
36652
+ facets: (_e = this.facets) === null || _e === void 0 ? void 0 : _e.map(function (f) {
36653
+ return f.key === facetKey ? Object.assign(Object.assign({}, f), {
36654
+ items: facetItems
36655
+ }) : f;
36656
+ })
36657
+ });
36658
+ this.context.commit("save", {
36659
+ searchResult: updatedResult
36660
+ });
36661
+
36662
+ case 11:
36663
+ case "end":
36664
+ return _context.stop();
36665
+ }
36666
+ }
36667
+ }, _callee, this);
36668
+ }));
36669
+ }
36547
36670
  }, {
36548
36671
  key: "load",
36549
36672
  value: function load(loading) {
@@ -36551,8 +36674,8 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36551
36674
  }
36552
36675
  }, {
36553
36676
  key: "setScreenWidth",
36554
- value: function setScreenWidth(_ref3) {
36555
- var width = _ref3.width;
36677
+ value: function setScreenWidth(_ref4) {
36678
+ var width = _ref4.width;
36556
36679
  this.screenWidth = width;
36557
36680
  }
36558
36681
  }, {
@@ -36573,9 +36696,9 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36573
36696
  }
36574
36697
  }, {
36575
36698
  key: "setColumnCount",
36576
- value: function setColumnCount(_ref4) {
36577
- var width = _ref4.width,
36578
- grid = _ref4.grid;
36699
+ value: function setColumnCount(_ref5) {
36700
+ var width = _ref5.width,
36701
+ grid = _ref5.grid;
36579
36702
 
36580
36703
  if (!width || !grid) {
36581
36704
  return {
@@ -36645,6 +36768,8 @@ __decorate([Mutation], SearchResultModule.prototype, "setSidebarVisibility", nul
36645
36768
 
36646
36769
  __decorate([Mutation], SearchResultModule.prototype, "save", null);
36647
36770
 
36771
+ __decorate([Action], SearchResultModule.prototype, "queryFacet", null);
36772
+
36648
36773
  __decorate([Mutation], SearchResultModule.prototype, "load", null);
36649
36774
 
36650
36775
  __decorate([Mutation], SearchResultModule.prototype, "setScreenWidth", null);
@@ -36989,9 +37114,39 @@ var OptionsModule = /*#__PURE__*/function (_VuexModule) {
36989
37114
  }, {
36990
37115
  key: "defaultSearchResultPageSize",
36991
37116
  get: function get() {
36992
- var _a, _b, _c, _d, _e;
37117
+ var _a, _b;
37118
+
37119
+ return (_b = (_a = this.currentResolutionPageSizes) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : DEFAULT_PAGE_SIZE;
37120
+ }
37121
+ }, {
37122
+ key: "currentResolutionPageSizes",
37123
+ get: function get() {
37124
+ var _a, _b, _c;
36993
37125
 
36994
- 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;
37126
+ 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;
37127
+
37128
+ if (Array.isArray(pageSizes)) {
37129
+ return pageSizes;
37130
+ }
37131
+
37132
+ var screenSize = this.context.rootGetters["searchResult/currentScreenWidth"];
37133
+
37134
+ switch (screenSize) {
37135
+ case "xs":
37136
+ return pageSizes.xs;
37137
+
37138
+ case "sm":
37139
+ return pageSizes.sm;
37140
+
37141
+ case "md":
37142
+ return pageSizes.md;
37143
+
37144
+ case "l":
37145
+ return pageSizes.l;
37146
+
37147
+ case "xl":
37148
+ return pageSizes.xl;
37149
+ }
36995
37150
  }
36996
37151
  }, {
36997
37152
  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
  }