@getlupa/client 0.6.0-alpha-12 → 0.6.0-alpha-15

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.
Files changed (28) hide show
  1. package/dist/cjs/components/search-results/filters/facets/FacetDisplay.vue.d.ts +9 -0
  2. package/dist/cjs/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  3. package/dist/cjs/constants/global.const.d.ts +1 -1
  4. package/dist/cjs/index.d.ts +2 -2
  5. package/dist/cjs/index.min.js +194 -43
  6. package/dist/cjs/store/modules/options.d.ts +1 -0
  7. package/dist/cjs/store/modules/searchResult.d.ts +7 -0
  8. package/dist/cjs/types/General.d.ts +1 -0
  9. package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +13 -1
  10. package/dist/es/components/search-results/filters/facets/FacetDisplay.vue.d.ts +9 -0
  11. package/dist/es/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  12. package/dist/es/constants/global.const.d.ts +1 -1
  13. package/dist/es/index.d.ts +2 -2
  14. package/dist/es/index.min.js +194 -43
  15. package/dist/es/store/modules/options.d.ts +1 -0
  16. package/dist/es/store/modules/searchResult.d.ts +7 -0
  17. package/dist/es/types/General.d.ts +1 -0
  18. package/dist/es/types/search-results/SearchResultsOptions.d.ts +13 -1
  19. package/dist/iife/components/search-results/filters/facets/FacetDisplay.vue.d.ts +9 -0
  20. package/dist/iife/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  21. package/dist/iife/constants/global.const.d.ts +1 -1
  22. package/dist/iife/index.d.ts +2 -2
  23. package/dist/iife/index.min.js +1 -1
  24. package/dist/iife/store/modules/options.d.ts +1 -0
  25. package/dist/iife/store/modules/searchResult.d.ts +7 -0
  26. package/dist/iife/types/General.d.ts +1 -0
  27. package/dist/iife/types/search-results/SearchResultsOptions.d.ts +13 -1
  28. package/package.json +1 -1
@@ -8,7 +8,7 @@ export declare const S_MIN_WIDTH = 575;
8
8
  export declare const MD_MIN_WIDTH = 767;
9
9
  export declare const L_MIN_WIDTH = 991;
10
10
  export declare const XL_MIN_WIDTH = 1199;
11
- export declare const MAX_FACET_VALUES = 1000;
11
+ export declare const MAX_FACET_VALUES = 5000;
12
12
  export declare const CURRENCY_KEY_INDICATOR = "price";
13
13
  export declare const DEFAULT_PAGE_SIZE = 12;
14
14
  export declare const LUPA_ROUTING_EVENT = "lupaRedirect";
@@ -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;
@@ -21672,7 +21672,7 @@ var S_MIN_WIDTH = 575;
21672
21672
  var MD_MIN_WIDTH = 767;
21673
21673
  var L_MIN_WIDTH = 991;
21674
21674
  var XL_MIN_WIDTH = 1199;
21675
- var MAX_FACET_VALUES = 1000;
21675
+ var MAX_FACET_VALUES = 5000;
21676
21676
  var CURRENCY_KEY_INDICATOR = "price";
21677
21677
  var DEFAULT_PAGE_SIZE = 12;
21678
21678
  var LUPA_ROUTING_EVENT = "lupaRedirect";
@@ -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);
@@ -32206,7 +32248,7 @@ __decorate([searchResult$c.State(function (state) {
32206
32248
  return state.layout;
32207
32249
  })], SearchResultsProductCard.prototype, "layout", void 0);
32208
32250
 
32209
- __decorate([options$5.Getter("searchResultsRoutingBehavior")], SearchResultsProductCard.prototype, "searchResultsRoutingBehavior", void 0);
32251
+ __decorate([options$6.Getter("searchResultsRoutingBehavior")], SearchResultsProductCard.prototype, "searchResultsRoutingBehavior", void 0);
32210
32252
 
32211
32253
  __decorate([params$9.Getter("query")], SearchResultsProductCard.prototype, "query", void 0);
32212
32254
 
@@ -32511,7 +32553,7 @@ var track = function track(queryKey) {
32511
32553
  };
32512
32554
 
32513
32555
  var params$8 = namespace("params");
32514
- var options$4 = namespace("options");
32556
+ var options$5 = namespace("options");
32515
32557
 
32516
32558
  var AdditionalPanels$1 = /*#__PURE__*/function (_Vue) {
32517
32559
  _inherits(AdditionalPanels, _Vue);
@@ -32626,7 +32668,7 @@ __decorate([Prop({
32626
32668
 
32627
32669
  __decorate([params$8.Getter("query")], AdditionalPanels$1.prototype, "query", void 0);
32628
32670
 
32629
- __decorate([options$4.State(function (o) {
32671
+ __decorate([options$5.State(function (o) {
32630
32672
  return o.searchResultOptions;
32631
32673
  })], AdditionalPanels$1.prototype, "searchResultOptions", void 0);
32632
32674
 
@@ -33311,7 +33353,7 @@ var __vue_component__$h = /*#__PURE__*/normalizeComponent({
33311
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);
33312
33354
 
33313
33355
  var searchResult$a = namespace("searchResult");
33314
- var options$3 = namespace("options");
33356
+ var options$4 = namespace("options");
33315
33357
 
33316
33358
  var SearchResultsLayoutSelection = /*#__PURE__*/function (_Vue) {
33317
33359
  _inherits(SearchResultsLayoutSelection, _Vue);
@@ -33338,7 +33380,7 @@ __decorate([searchResult$a.State(function (state) {
33338
33380
  return state.layout;
33339
33381
  })], SearchResultsLayoutSelection.prototype, "layout", void 0);
33340
33382
 
33341
- __decorate([options$3.Getter("classMap")], SearchResultsLayoutSelection.prototype, "classMap", void 0);
33383
+ __decorate([options$4.Getter("classMap")], SearchResultsLayoutSelection.prototype, "classMap", void 0);
33342
33384
 
33343
33385
  __decorate([searchResult$a.Action("setLayout")], SearchResultsLayoutSelection.prototype, "setLayout", void 0);
33344
33386
 
@@ -33592,6 +33634,7 @@ var __vue_component__$e = /*#__PURE__*/normalizeComponent({
33592
33634
 
33593
33635
  var searchResult$7 = namespace("searchResult");
33594
33636
  var params$4 = namespace("params");
33637
+ var options$3 = namespace("options");
33595
33638
 
33596
33639
  var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33597
33640
  _inherits(SearchResultsToolbar, _Vue);
@@ -33668,11 +33711,10 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33668
33711
  }, {
33669
33712
  key: "paginationOptions",
33670
33713
  get: function get() {
33671
- var pageSize = this.options.pagination.sizeSelection;
33672
33714
  var pageSelect = this.options.pagination.pageSelection;
33673
- var r = {
33715
+ return {
33674
33716
  pageSize: {
33675
- sizes: pageSize.sizes,
33717
+ sizes: this.currentResolutionPageSizes,
33676
33718
  selectedSize: this.limit
33677
33719
  },
33678
33720
  pageSelect: {
@@ -33683,7 +33725,6 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33683
33725
  },
33684
33726
  labels: this.options.labels
33685
33727
  };
33686
- return r;
33687
33728
  }
33688
33729
  }, {
33689
33730
  key: "displayPageSelect",
@@ -33732,6 +33773,8 @@ __decorate([searchResult$7.State(function (state) {
33732
33773
  return state.searchResult;
33733
33774
  })], SearchResultsToolbar.prototype, "searchResult", void 0);
33734
33775
 
33776
+ __decorate([options$3.Getter("currentResolutionPageSizes")], SearchResultsToolbar.prototype, "currentResolutionPageSizes", void 0);
33777
+
33735
33778
  __decorate([params$4.Action("removeAllFilters")], SearchResultsToolbar.prototype, "removeAllFilters", void 0);
33736
33779
 
33737
33780
  SearchResultsToolbar = __decorate([Component({
@@ -34823,13 +34866,11 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
34823
34866
  }, {
34824
34867
  key: "handleMounted",
34825
34868
  value: function handleMounted() {
34826
- var _a, _b, _c;
34827
-
34828
34869
  this.handleResize();
34829
34870
  var params = new URLSearchParams(window.location.search);
34830
34871
  this.handleUrlChange(params);
34831
34872
  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]);
34873
+ this.setDefaultLimit(this.defaultSearchResultPageSize);
34833
34874
  }
34834
34875
  }, {
34835
34876
  key: "handleParamsChange",
@@ -36426,8 +36467,6 @@ var setDocumentTitle = function setDocumentTitle(template) {
36426
36467
  document.title = addParamsToLabel(template, textToInsert);
36427
36468
  };
36428
36469
 
36429
- var MOBILE_WIDTH = 767;
36430
-
36431
36470
  var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36432
36471
  _inherits(SearchResultModule, _VuexModule);
36433
36472
 
@@ -36507,6 +36546,13 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36507
36546
 
36508
36547
  return (_b = (_a = this.displayFilters) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
36509
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
+ }
36510
36556
  }, {
36511
36557
  key: "hasAnyFilter",
36512
36558
  get: function get() {
@@ -36524,7 +36570,24 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36524
36570
  }, {
36525
36571
  key: "isMobileWidth",
36526
36572
  get: function get() {
36527
- 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
+ }
36528
36591
  }
36529
36592
  }, {
36530
36593
  key: "setSidebarVisibility",
@@ -36544,6 +36607,62 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36544
36607
  this.addToCartAmount = addToCartAmount || this.addToCartAmount;
36545
36608
  this.layout = layout || this.layout;
36546
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
+ }
36547
36666
  }, {
36548
36667
  key: "load",
36549
36668
  value: function load(loading) {
@@ -36551,8 +36670,8 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36551
36670
  }
36552
36671
  }, {
36553
36672
  key: "setScreenWidth",
36554
- value: function setScreenWidth(_ref3) {
36555
- var width = _ref3.width;
36673
+ value: function setScreenWidth(_ref4) {
36674
+ var width = _ref4.width;
36556
36675
  this.screenWidth = width;
36557
36676
  }
36558
36677
  }, {
@@ -36573,9 +36692,9 @@ var SearchResultModule = /*#__PURE__*/function (_VuexModule) {
36573
36692
  }
36574
36693
  }, {
36575
36694
  key: "setColumnCount",
36576
- value: function setColumnCount(_ref4) {
36577
- var width = _ref4.width,
36578
- grid = _ref4.grid;
36695
+ value: function setColumnCount(_ref5) {
36696
+ var width = _ref5.width,
36697
+ grid = _ref5.grid;
36579
36698
 
36580
36699
  if (!width || !grid) {
36581
36700
  return {
@@ -36645,6 +36764,8 @@ __decorate([Mutation], SearchResultModule.prototype, "setSidebarVisibility", nul
36645
36764
 
36646
36765
  __decorate([Mutation], SearchResultModule.prototype, "save", null);
36647
36766
 
36767
+ __decorate([Action], SearchResultModule.prototype, "queryFacet", null);
36768
+
36648
36769
  __decorate([Mutation], SearchResultModule.prototype, "load", null);
36649
36770
 
36650
36771
  __decorate([Mutation], SearchResultModule.prototype, "setScreenWidth", null);
@@ -36989,9 +37110,39 @@ var OptionsModule = /*#__PURE__*/function (_VuexModule) {
36989
37110
  }, {
36990
37111
  key: "defaultSearchResultPageSize",
36991
37112
  get: function get() {
36992
- 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;
36993
37121
 
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;
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
+ }
36995
37146
  }
36996
37147
  }, {
36997
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";
@@ -70,9 +70,17 @@ export declare type SearchResultsPaginationLabels = {
70
70
  pageSize: string;
71
71
  showMore: string;
72
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;
73
81
  export declare type SearchResultsPagination = {
74
82
  sizeSelection: {
75
- sizes: number[];
83
+ sizes: SearchResultPageSizes;
76
84
  position: SearchResultsPaginationPosition;
77
85
  };
78
86
  pageSelection: {
@@ -100,6 +108,9 @@ export declare type ResultCurrentFilterOptions = {
100
108
  };
101
109
  };
102
110
  export declare type FacetStyle = "sidebar" | "top-dropdown";
111
+ export declare type FacetFilterQuery = {
112
+ queryKey: string;
113
+ };
103
114
  export declare type ResultFacetOptions = {
104
115
  labels: {
105
116
  title: string;
@@ -131,6 +142,7 @@ export declare type ResultFacetOptions = {
131
142
  type: FacetStyle;
132
143
  };
133
144
  exclude?: string[];
145
+ facetFilterQueries?: Record<string, FacetFilterQuery>;
134
146
  };
135
147
  export declare type SearchResultsFilterOptions = {
136
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
  };
@@ -8,7 +8,7 @@ export declare const S_MIN_WIDTH = 575;
8
8
  export declare const MD_MIN_WIDTH = 767;
9
9
  export declare const L_MIN_WIDTH = 991;
10
10
  export declare const XL_MIN_WIDTH = 1199;
11
- export declare const MAX_FACET_VALUES = 1000;
11
+ export declare const MAX_FACET_VALUES = 5000;
12
12
  export declare const CURRENCY_KEY_INDICATOR = "price";
13
13
  export declare const DEFAULT_PAGE_SIZE = 12;
14
14
  export declare const LUPA_ROUTING_EVENT = "lupaRedirect";
@@ -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;