@getlupa/client 0.5.1-alpha-21 → 0.6.0-alpha-1

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.
@@ -6,6 +6,7 @@ export default class SearchResultsPageSelect extends Vue {
6
6
  firstPageLabel: string;
7
7
  options: PaginationPageSelect;
8
8
  get pages(): number[];
9
+ get showBack(): boolean;
9
10
  get lastPage(): number | undefined;
10
11
  get showLastPage(): boolean;
11
12
  get showLastPageSeparator(): boolean;
@@ -1,12 +1,13 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
2
  import { FacetStyle, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
- import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
3
+ import { SdkOptions, TrackingOptions, Environment } 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";
6
6
  import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
7
  import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
8
  import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
9
  import { BadgeType } from "./types/search-results/BadgeOptions";
10
+ import { SortDirection } from "@getlupa/client-sdk/Types";
10
11
  declare const lupaSearch: {
11
12
  searchBox: (options: SearchBoxOptions) => void;
12
13
  searchResults: (options: SearchResultsOptions) => void;
@@ -2,6 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var Types = require('@getlupa/client-sdk/Types');
6
+
5
7
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
8
 
7
9
  function getDefaultExportFromCjs (x) {
@@ -25121,8 +25123,8 @@ try {
25121
25123
 
25122
25124
  var regenerator = runtime.exports;
25123
25125
 
25124
- var production = "https://api.getlupa.com/v1/";
25125
- var staging = "https://api.staging.getlupa.com/v1/";
25126
+ var production = "https://api.lupasearch.com/v1/";
25127
+ var staging = "https://api.staging.lupasearch.com/v1/";
25126
25128
  var Env = {
25127
25129
  production: production,
25128
25130
  staging: staging
@@ -32916,9 +32918,10 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
32916
32918
  _createClass(SearchResultsPageSelect, [{
32917
32919
  key: "pages",
32918
32920
  get: function get() {
32921
+ var currentPage = Math.min(this.options.count, this.options.selectedPage);
32919
32922
  var delta = Math.floor(this.options.display / 2),
32920
- left = this.options.selectedPage - delta,
32921
- right = this.options.selectedPage + (this.options.display - delta);
32923
+ left = currentPage - delta,
32924
+ right = currentPage + (this.options.display - delta);
32922
32925
  return Array.from({
32923
32926
  length: this.options.count
32924
32927
  }, function (v, k) {
@@ -32927,6 +32930,11 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
32927
32930
  return i && i >= left && i < right;
32928
32931
  });
32929
32932
  }
32933
+ }, {
32934
+ key: "showBack",
32935
+ get: function get() {
32936
+ return this.options.selectedPage > 1 && this.options.selectedPage <= this.options.count;
32937
+ }
32930
32938
  }, {
32931
32939
  key: "lastPage",
32932
32940
  get: function get() {
@@ -33009,7 +33017,7 @@ var __vue_render__$i = function __vue_render__() {
33009
33017
  id: "lupa-search-results-page-select",
33010
33018
  "data-cy": "lupa-search-results-page-select"
33011
33019
  }
33012
- }, [_vm.options.selectedPage > 1 ? _c("div", {
33020
+ }, [_vm.showBack ? _c("div", {
33013
33021
  class: _vm.firstPageLabel === "<" ? "lupa-page-arrow" : "lupa-show-less",
33014
33022
  on: {
33015
33023
  click: function click() {
@@ -33641,7 +33649,7 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33641
33649
  }, {
33642
33650
  key: "displayPageSelect",
33643
33651
  get: function get() {
33644
- return this.paginationDisplay.pageSelect && this.paginationOptions.pageSelect.count > 0 && this.paginationOptions.pageSelect.count >= this.paginationOptions.pageSelect.selectedPage;
33652
+ return this.paginationDisplay.pageSelect && this.paginationOptions.pageSelect.count > 0;
33645
33653
  }
33646
33654
  }, {
33647
33655
  key: "searchSummaryLabel",
@@ -37149,4 +37157,8 @@ var lupaSearch = {
37149
37157
  clearProductList: clearProductList
37150
37158
  };
37151
37159
 
37160
+ Object.defineProperty(exports, 'SortDirection', {
37161
+ enumerable: true,
37162
+ get: function () { return Types.SortDirection; }
37163
+ });
37152
37164
  exports["default"] = lupaSearch;
@@ -1,5 +1,5 @@
1
1
  import { AnalyticsOptions } from "./AnalyticsOptions";
2
- import { Environment as SdkEnvironment, SortDirection as SdkSortDirection } from "@getlupa/client-sdk/Types";
2
+ import { Environment as SdkEnvironment } from "@getlupa/client-sdk/Types";
3
3
  export declare type SdkOptions = {
4
4
  environment: SdkEnvironment;
5
5
  customUrl?: string;
@@ -14,5 +14,4 @@ export declare type TrackingOptions = {
14
14
  userKey?: string;
15
15
  analytics?: AnalyticsOptions;
16
16
  };
17
- export declare type SortDirection = SdkSortDirection;
18
17
  export declare type Environment = SdkEnvironment;
@@ -6,6 +6,7 @@ export default class SearchResultsPageSelect extends Vue {
6
6
  firstPageLabel: string;
7
7
  options: PaginationPageSelect;
8
8
  get pages(): number[];
9
+ get showBack(): boolean;
9
10
  get lastPage(): number | undefined;
10
11
  get showLastPage(): boolean;
11
12
  get showLastPageSeparator(): boolean;
@@ -1,12 +1,13 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
2
  import { FacetStyle, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
- import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
3
+ import { SdkOptions, TrackingOptions, Environment } 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";
6
6
  import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
7
  import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
8
  import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
9
  import { BadgeType } from "./types/search-results/BadgeOptions";
10
+ import { SortDirection } from "@getlupa/client-sdk/Types";
10
11
  declare const lupaSearch: {
11
12
  searchBox: (options: SearchBoxOptions) => void;
12
13
  searchResults: (options: SearchResultsOptions) => void;
@@ -1,3 +1,5 @@
1
+ export { SortDirection } from '@getlupa/client-sdk/Types';
2
+
1
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
4
 
3
5
  function getDefaultExportFromCjs (x) {
@@ -25117,8 +25119,8 @@ try {
25117
25119
 
25118
25120
  var regenerator = runtime.exports;
25119
25121
 
25120
- var production = "https://api.getlupa.com/v1/";
25121
- var staging = "https://api.staging.getlupa.com/v1/";
25122
+ var production = "https://api.lupasearch.com/v1/";
25123
+ var staging = "https://api.staging.lupasearch.com/v1/";
25122
25124
  var Env = {
25123
25125
  production: production,
25124
25126
  staging: staging
@@ -32912,9 +32914,10 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
32912
32914
  _createClass(SearchResultsPageSelect, [{
32913
32915
  key: "pages",
32914
32916
  get: function get() {
32917
+ var currentPage = Math.min(this.options.count, this.options.selectedPage);
32915
32918
  var delta = Math.floor(this.options.display / 2),
32916
- left = this.options.selectedPage - delta,
32917
- right = this.options.selectedPage + (this.options.display - delta);
32919
+ left = currentPage - delta,
32920
+ right = currentPage + (this.options.display - delta);
32918
32921
  return Array.from({
32919
32922
  length: this.options.count
32920
32923
  }, function (v, k) {
@@ -32923,6 +32926,11 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
32923
32926
  return i && i >= left && i < right;
32924
32927
  });
32925
32928
  }
32929
+ }, {
32930
+ key: "showBack",
32931
+ get: function get() {
32932
+ return this.options.selectedPage > 1 && this.options.selectedPage <= this.options.count;
32933
+ }
32926
32934
  }, {
32927
32935
  key: "lastPage",
32928
32936
  get: function get() {
@@ -33005,7 +33013,7 @@ var __vue_render__$i = function __vue_render__() {
33005
33013
  id: "lupa-search-results-page-select",
33006
33014
  "data-cy": "lupa-search-results-page-select"
33007
33015
  }
33008
- }, [_vm.options.selectedPage > 1 ? _c("div", {
33016
+ }, [_vm.showBack ? _c("div", {
33009
33017
  class: _vm.firstPageLabel === "<" ? "lupa-page-arrow" : "lupa-show-less",
33010
33018
  on: {
33011
33019
  click: function click() {
@@ -33637,7 +33645,7 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33637
33645
  }, {
33638
33646
  key: "displayPageSelect",
33639
33647
  get: function get() {
33640
- return this.paginationDisplay.pageSelect && this.paginationOptions.pageSelect.count > 0 && this.paginationOptions.pageSelect.count >= this.paginationOptions.pageSelect.selectedPage;
33648
+ return this.paginationDisplay.pageSelect && this.paginationOptions.pageSelect.count > 0;
33641
33649
  }
33642
33650
  }, {
33643
33651
  key: "searchSummaryLabel",
@@ -1,5 +1,5 @@
1
1
  import { AnalyticsOptions } from "./AnalyticsOptions";
2
- import { Environment as SdkEnvironment, SortDirection as SdkSortDirection } from "@getlupa/client-sdk/Types";
2
+ import { Environment as SdkEnvironment } from "@getlupa/client-sdk/Types";
3
3
  export declare type SdkOptions = {
4
4
  environment: SdkEnvironment;
5
5
  customUrl?: string;
@@ -14,5 +14,4 @@ export declare type TrackingOptions = {
14
14
  userKey?: string;
15
15
  analytics?: AnalyticsOptions;
16
16
  };
17
- export declare type SortDirection = SdkSortDirection;
18
17
  export declare type Environment = SdkEnvironment;
@@ -6,6 +6,7 @@ export default class SearchResultsPageSelect extends Vue {
6
6
  firstPageLabel: string;
7
7
  options: PaginationPageSelect;
8
8
  get pages(): number[];
9
+ get showBack(): boolean;
9
10
  get lastPage(): number | undefined;
10
11
  get showLastPage(): boolean;
11
12
  get showLastPageSeparator(): boolean;
@@ -1,12 +1,13 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
2
  import { FacetStyle, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
- import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
3
+ import { SdkOptions, TrackingOptions, Environment } 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";
6
6
  import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
7
  import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
8
  import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
9
  import { BadgeType } from "./types/search-results/BadgeOptions";
10
+ import { SortDirection } from "@getlupa/client-sdk/Types";
10
11
  declare const lupaSearch: {
11
12
  searchBox: (options: SearchBoxOptions) => void;
12
13
  searchResults: (options: SearchResultsOptions) => void;