@getlupa/client 0.5.1-alpha-22 → 0.6.0-alpha-2

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;
@@ -32916,9 +32916,10 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
32916
32916
  _createClass(SearchResultsPageSelect, [{
32917
32917
  key: "pages",
32918
32918
  get: function get() {
32919
+ var currentPage = Math.min(this.options.count, this.options.selectedPage);
32919
32920
  var delta = Math.floor(this.options.display / 2),
32920
- left = this.options.selectedPage - delta,
32921
- right = this.options.selectedPage + (this.options.display - delta);
32921
+ left = currentPage - delta,
32922
+ right = currentPage + (this.options.display - delta);
32922
32923
  return Array.from({
32923
32924
  length: this.options.count
32924
32925
  }, function (v, k) {
@@ -32927,6 +32928,11 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
32927
32928
  return i && i >= left && i < right;
32928
32929
  });
32929
32930
  }
32931
+ }, {
32932
+ key: "showBack",
32933
+ get: function get() {
32934
+ return this.options.selectedPage > 1 && this.options.selectedPage <= this.options.count;
32935
+ }
32930
32936
  }, {
32931
32937
  key: "lastPage",
32932
32938
  get: function get() {
@@ -33009,7 +33015,7 @@ var __vue_render__$i = function __vue_render__() {
33009
33015
  id: "lupa-search-results-page-select",
33010
33016
  "data-cy": "lupa-search-results-page-select"
33011
33017
  }
33012
- }, [_vm.options.selectedPage > 1 ? _c("div", {
33018
+ }, [_vm.showBack ? _c("div", {
33013
33019
  class: _vm.firstPageLabel === "<" ? "lupa-page-arrow" : "lupa-show-less",
33014
33020
  on: {
33015
33021
  click: function click() {
@@ -33641,7 +33647,7 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33641
33647
  }, {
33642
33648
  key: "displayPageSelect",
33643
33649
  get: function get() {
33644
- return this.paginationDisplay.pageSelect && this.paginationOptions.pageSelect.count > 0 && this.paginationOptions.pageSelect.count >= this.paginationOptions.pageSelect.selectedPage;
33650
+ return this.paginationDisplay.pageSelect && this.paginationOptions.pageSelect.count > 0;
33645
33651
  }
33646
33652
  }, {
33647
33653
  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,5 @@ 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;
18
+ export declare type SortDirection = "asc" | "desc";
@@ -1,4 +1,4 @@
1
- import { SortDirection } from "@getlupa/client-sdk/Types";
1
+ import { SortDirection } from "../General";
2
2
  export declare type SearchResultsSortOptions = {
3
3
  key: string;
4
4
  label: string;
@@ -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;
@@ -32912,9 +32912,10 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
32912
32912
  _createClass(SearchResultsPageSelect, [{
32913
32913
  key: "pages",
32914
32914
  get: function get() {
32915
+ var currentPage = Math.min(this.options.count, this.options.selectedPage);
32915
32916
  var delta = Math.floor(this.options.display / 2),
32916
- left = this.options.selectedPage - delta,
32917
- right = this.options.selectedPage + (this.options.display - delta);
32917
+ left = currentPage - delta,
32918
+ right = currentPage + (this.options.display - delta);
32918
32919
  return Array.from({
32919
32920
  length: this.options.count
32920
32921
  }, function (v, k) {
@@ -32923,6 +32924,11 @@ var SearchResultsPageSelect = /*#__PURE__*/function (_Vue) {
32923
32924
  return i && i >= left && i < right;
32924
32925
  });
32925
32926
  }
32927
+ }, {
32928
+ key: "showBack",
32929
+ get: function get() {
32930
+ return this.options.selectedPage > 1 && this.options.selectedPage <= this.options.count;
32931
+ }
32926
32932
  }, {
32927
32933
  key: "lastPage",
32928
32934
  get: function get() {
@@ -33005,7 +33011,7 @@ var __vue_render__$i = function __vue_render__() {
33005
33011
  id: "lupa-search-results-page-select",
33006
33012
  "data-cy": "lupa-search-results-page-select"
33007
33013
  }
33008
- }, [_vm.options.selectedPage > 1 ? _c("div", {
33014
+ }, [_vm.showBack ? _c("div", {
33009
33015
  class: _vm.firstPageLabel === "<" ? "lupa-page-arrow" : "lupa-show-less",
33010
33016
  on: {
33011
33017
  click: function click() {
@@ -33637,7 +33643,7 @@ var SearchResultsToolbar = /*#__PURE__*/function (_Vue) {
33637
33643
  }, {
33638
33644
  key: "displayPageSelect",
33639
33645
  get: function get() {
33640
- return this.paginationDisplay.pageSelect && this.paginationOptions.pageSelect.count > 0 && this.paginationOptions.pageSelect.count >= this.paginationOptions.pageSelect.selectedPage;
33646
+ return this.paginationDisplay.pageSelect && this.paginationOptions.pageSelect.count > 0;
33641
33647
  }
33642
33648
  }, {
33643
33649
  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,5 @@ 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;
18
+ export declare type SortDirection = "asc" | "desc";
@@ -1,4 +1,4 @@
1
- import { SortDirection } from "@getlupa/client-sdk/Types";
1
+ import { SortDirection } from "../General";
2
2
  export declare type SearchResultsSortOptions = {
3
3
  key: string;
4
4
  label: string;
@@ -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;