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

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.
@@ -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,7 +1,7 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
2
  import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
3
  import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
4
- import { ProductListOptions } from "./types/product-list/ProductListOptions";
4
+ import { CategoryFilterOptions, ProductListOptions } from "./types/product-list/ProductListOptions";
5
5
  import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
6
6
  import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
7
  import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
@@ -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, FacetFilterQuery, };
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, CategoryFilterOptions, };
21
21
  export default lupaSearch;
@@ -21676,7 +21676,7 @@ var S_MIN_WIDTH = 575;
21676
21676
  var MD_MIN_WIDTH = 767;
21677
21677
  var L_MIN_WIDTH = 991;
21678
21678
  var XL_MIN_WIDTH = 1199;
21679
- var MAX_FACET_VALUES = 1000;
21679
+ var MAX_FACET_VALUES = 5000;
21680
21680
  var CURRENCY_KEY_INDICATOR = "price";
21681
21681
  var DEFAULT_PAGE_SIZE = 12;
21682
21682
  var LUPA_ROUTING_EVENT = "lupaRedirect";
@@ -30053,23 +30053,33 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
30053
30053
  }, {
30054
30054
  key: "mounted",
30055
30055
  value: function mounted() {
30056
+ var _a;
30057
+
30056
30058
  return __awaiter$1(this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
30057
30059
  var result;
30058
30060
  return regenerator.wrap(function _callee$(_context) {
30059
30061
  while (1) {
30060
30062
  switch (_context.prev = _context.next) {
30061
30063
  case 0:
30062
- _context.next = 2;
30064
+ if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.queryKey) {
30065
+ _context.next = 2;
30066
+ break;
30067
+ }
30068
+
30069
+ return _context.abrupt("return");
30070
+
30071
+ case 2:
30072
+ _context.next = 4;
30063
30073
  return getLupaSdk.query(this.options.queryKey, {
30064
30074
  searchText: "",
30065
30075
  filters: this.options.filters
30066
30076
  }, this.envOptions);
30067
30077
 
30068
- case 2:
30078
+ case 4:
30069
30079
  result = _context.sent;
30070
30080
  this.handleResult(result);
30071
30081
 
30072
- case 4:
30082
+ case 6:
30073
30083
  case "end":
30074
30084
  return _context.stop();
30075
30085
  }
@@ -30080,14 +30090,14 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
30080
30090
  }, {
30081
30091
  key: "handleResult",
30082
30092
  value: function handleResult(result) {
30083
- var _a, _b;
30093
+ var _a, _b, _c;
30084
30094
 
30085
- if (!result.success) {
30095
+ if (!result.success || !((_a = this.options) === null || _a === void 0 ? void 0 : _a.queryKey)) {
30086
30096
  return;
30087
30097
  }
30088
30098
 
30089
30099
  this.categoryChildren = result.items;
30090
- (_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onCategoryFilterResults) === null || _b === void 0 ? void 0 : _b.call(_a, {
30100
+ (_c = (_b = this.searchResultOptions.callbacks) === null || _b === void 0 ? void 0 : _b.onCategoryFilterResults) === null || _c === void 0 ? void 0 : _c.call(_b, {
30091
30101
  queryKey: this.options.queryKey,
30092
30102
  hasResults: result.total > 0
30093
30103
  });
@@ -34853,6 +34863,8 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
34853
34863
  }, {
34854
34864
  key: "mounted",
34855
34865
  value: function mounted() {
34866
+ var _a, _b;
34867
+
34856
34868
  window.addEventListener("resize", this.handleResize);
34857
34869
  this.setSearchResultOptions({
34858
34870
  options: this.options
@@ -34861,6 +34873,7 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
34861
34873
  this.setInitialFilters({
34862
34874
  initialFilters: this.initialFilters
34863
34875
  });
34876
+ (_b = (_a = this.options.callbacks) === null || _a === void 0 ? void 0 : _a.onMounted) === null || _b === void 0 ? void 0 : _b.call(_a);
34864
34877
  }
34865
34878
  }, {
34866
34879
  key: "beforeDestroy",
@@ -35281,8 +35294,11 @@ var __vue_render__$2 = function __vue_render__() {
35281
35294
  }, [_c("div", {
35282
35295
  staticClass: "lupa-category-title"
35283
35296
  }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _c("div", {
35284
- staticClass: "lupa-category-description"
35285
- }, [_vm._v(_vm._s(_vm.description))])]) : _vm._e();
35297
+ staticClass: "lupa-category-description",
35298
+ domProps: {
35299
+ innerHTML: _vm._s(_vm.description)
35300
+ }
35301
+ })]) : _vm._e();
35286
35302
  };
35287
35303
 
35288
35304
  var __vue_staticRenderFns__$2 = [];
@@ -2,7 +2,7 @@ import { FilterGroup } from "@getlupa/client-sdk/Types";
2
2
  import { RoutingBehavior } from "../search-results/RoutingBehavior";
3
3
  import { SearchResultsOptions } from "../search-results/SearchResultsOptions";
4
4
  export declare type CategoryFilterOptions = {
5
- queryKey: string;
5
+ queryKey?: string;
6
6
  routingBehavior?: RoutingBehavior;
7
7
  keys: {
8
8
  titleKey?: string;
@@ -24,5 +24,5 @@ export declare type CategoryFilterOptions = {
24
24
  };
25
25
  export declare type ProductListOptions = SearchResultsOptions & {
26
26
  initialFilters?: FilterGroup;
27
- categories: CategoryFilterOptions;
27
+ categories?: CategoryFilterOptions;
28
28
  };
@@ -27,6 +27,7 @@ export declare type SearchResultEventCallbacks = {
27
27
  onSearchResults?: (context: CallbackContext) => unknown;
28
28
  onAdditionalPanelResults?: (context: CallbackContext) => unknown;
29
29
  onCategoryFilterResults?: (context: CallbackContext) => unknown;
30
+ onMounted?: () => unknown;
30
31
  };
31
32
  export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchResultsDidYouMeanLabels & SearchResultsSimilarQueriesLabels & {
32
33
  sortBy: string;
@@ -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,7 +1,7 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
2
  import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
3
  import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
4
- import { ProductListOptions } from "./types/product-list/ProductListOptions";
4
+ import { CategoryFilterOptions, ProductListOptions } from "./types/product-list/ProductListOptions";
5
5
  import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
6
6
  import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
7
  import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
@@ -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, FacetFilterQuery, };
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, CategoryFilterOptions, };
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";
@@ -30049,23 +30049,33 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
30049
30049
  }, {
30050
30050
  key: "mounted",
30051
30051
  value: function mounted() {
30052
+ var _a;
30053
+
30052
30054
  return __awaiter$1(this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
30053
30055
  var result;
30054
30056
  return regenerator.wrap(function _callee$(_context) {
30055
30057
  while (1) {
30056
30058
  switch (_context.prev = _context.next) {
30057
30059
  case 0:
30058
- _context.next = 2;
30060
+ if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.queryKey) {
30061
+ _context.next = 2;
30062
+ break;
30063
+ }
30064
+
30065
+ return _context.abrupt("return");
30066
+
30067
+ case 2:
30068
+ _context.next = 4;
30059
30069
  return getLupaSdk.query(this.options.queryKey, {
30060
30070
  searchText: "",
30061
30071
  filters: this.options.filters
30062
30072
  }, this.envOptions);
30063
30073
 
30064
- case 2:
30074
+ case 4:
30065
30075
  result = _context.sent;
30066
30076
  this.handleResult(result);
30067
30077
 
30068
- case 4:
30078
+ case 6:
30069
30079
  case "end":
30070
30080
  return _context.stop();
30071
30081
  }
@@ -30076,14 +30086,14 @@ var CategoryFilter = /*#__PURE__*/function (_Vue) {
30076
30086
  }, {
30077
30087
  key: "handleResult",
30078
30088
  value: function handleResult(result) {
30079
- var _a, _b;
30089
+ var _a, _b, _c;
30080
30090
 
30081
- if (!result.success) {
30091
+ if (!result.success || !((_a = this.options) === null || _a === void 0 ? void 0 : _a.queryKey)) {
30082
30092
  return;
30083
30093
  }
30084
30094
 
30085
30095
  this.categoryChildren = result.items;
30086
- (_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onCategoryFilterResults) === null || _b === void 0 ? void 0 : _b.call(_a, {
30096
+ (_c = (_b = this.searchResultOptions.callbacks) === null || _b === void 0 ? void 0 : _b.onCategoryFilterResults) === null || _c === void 0 ? void 0 : _c.call(_b, {
30087
30097
  queryKey: this.options.queryKey,
30088
30098
  hasResults: result.total > 0
30089
30099
  });
@@ -34849,6 +34859,8 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
34849
34859
  }, {
34850
34860
  key: "mounted",
34851
34861
  value: function mounted() {
34862
+ var _a, _b;
34863
+
34852
34864
  window.addEventListener("resize", this.handleResize);
34853
34865
  this.setSearchResultOptions({
34854
34866
  options: this.options
@@ -34857,6 +34869,7 @@ var SearchResults = /*#__PURE__*/function (_Vue) {
34857
34869
  this.setInitialFilters({
34858
34870
  initialFilters: this.initialFilters
34859
34871
  });
34872
+ (_b = (_a = this.options.callbacks) === null || _a === void 0 ? void 0 : _a.onMounted) === null || _b === void 0 ? void 0 : _b.call(_a);
34860
34873
  }
34861
34874
  }, {
34862
34875
  key: "beforeDestroy",
@@ -35277,8 +35290,11 @@ var __vue_render__$2 = function __vue_render__() {
35277
35290
  }, [_c("div", {
35278
35291
  staticClass: "lupa-category-title"
35279
35292
  }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _c("div", {
35280
- staticClass: "lupa-category-description"
35281
- }, [_vm._v(_vm._s(_vm.description))])]) : _vm._e();
35293
+ staticClass: "lupa-category-description",
35294
+ domProps: {
35295
+ innerHTML: _vm._s(_vm.description)
35296
+ }
35297
+ })]) : _vm._e();
35282
35298
  };
35283
35299
 
35284
35300
  var __vue_staticRenderFns__$2 = [];
@@ -2,7 +2,7 @@ import { FilterGroup } from "@getlupa/client-sdk/Types";
2
2
  import { RoutingBehavior } from "../search-results/RoutingBehavior";
3
3
  import { SearchResultsOptions } from "../search-results/SearchResultsOptions";
4
4
  export declare type CategoryFilterOptions = {
5
- queryKey: string;
5
+ queryKey?: string;
6
6
  routingBehavior?: RoutingBehavior;
7
7
  keys: {
8
8
  titleKey?: string;
@@ -24,5 +24,5 @@ export declare type CategoryFilterOptions = {
24
24
  };
25
25
  export declare type ProductListOptions = SearchResultsOptions & {
26
26
  initialFilters?: FilterGroup;
27
- categories: CategoryFilterOptions;
27
+ categories?: CategoryFilterOptions;
28
28
  };
@@ -27,6 +27,7 @@ export declare type SearchResultEventCallbacks = {
27
27
  onSearchResults?: (context: CallbackContext) => unknown;
28
28
  onAdditionalPanelResults?: (context: CallbackContext) => unknown;
29
29
  onCategoryFilterResults?: (context: CallbackContext) => unknown;
30
+ onMounted?: () => unknown;
30
31
  };
31
32
  export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchResultsDidYouMeanLabels & SearchResultsSimilarQueriesLabels & {
32
33
  sortBy: string;
@@ -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,7 +1,7 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
2
  import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
3
  import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
4
- import { ProductListOptions } from "./types/product-list/ProductListOptions";
4
+ import { CategoryFilterOptions, ProductListOptions } from "./types/product-list/ProductListOptions";
5
5
  import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
6
6
  import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
7
  import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
@@ -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, FacetFilterQuery, };
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, CategoryFilterOptions, };
21
21
  export default lupaSearch;