@getlupa/client 0.6.0-alpha-16 → 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.
@@ -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;
@@ -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
  });
@@ -35284,8 +35294,11 @@ var __vue_render__$2 = function __vue_render__() {
35284
35294
  }, [_c("div", {
35285
35295
  staticClass: "lupa-category-title"
35286
35296
  }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _c("div", {
35287
- staticClass: "lupa-category-description"
35288
- }, [_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();
35289
35302
  };
35290
35303
 
35291
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
  };
@@ -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;
@@ -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
  });
@@ -35280,8 +35290,11 @@ var __vue_render__$2 = function __vue_render__() {
35280
35290
  }, [_c("div", {
35281
35291
  staticClass: "lupa-category-title"
35282
35292
  }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _c("div", {
35283
- staticClass: "lupa-category-description"
35284
- }, [_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();
35285
35298
  };
35286
35299
 
35287
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
  };
@@ -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;