@getlupa/client 0.6.0-alpha-20 → 0.6.0-alpha-21

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.
@@ -2,7 +2,6 @@ import Vue from "vue";
2
2
  import { ProductListOptions } from "@/types/product-list/ProductListOptions";
3
3
  export default class CategoryDescription extends Vue {
4
4
  options: ProductListOptions;
5
- get title(): string | undefined;
6
5
  get description(): string | undefined;
7
6
  get overviewVisible(): boolean;
8
7
  }
@@ -8,6 +8,7 @@ export default class SearchResultsProducts extends Vue {
8
8
  loading: boolean;
9
9
  hasResults: boolean;
10
10
  currentQueryText: string;
11
+ isPageEmpty: boolean;
11
12
  isMobileSidebarVisible: boolean;
12
13
  productCardOptions(): SearchResultsProductCardOptions;
13
14
  get similarQueriesLabels(): SearchResultsSimilarQueriesLabels;
@@ -21,4 +22,11 @@ export default class SearchResultsProducts extends Vue {
21
22
  page: number;
22
23
  get columnSize(): string;
23
24
  getProductKey(index: string, product: Document): string;
25
+ appendParams: ({ params, }: {
26
+ params: {
27
+ name: string;
28
+ value: string;
29
+ }[];
30
+ }) => void;
31
+ goToFirstPage(): void;
24
32
  }
@@ -13,6 +13,8 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
13
13
  priceSeparator: string;
14
14
  showMore: string;
15
15
  emptyResults: string;
16
+ noItemsInPage: string;
17
+ backToFirstPage: string;
16
18
  mobileFilterButton: string;
17
19
  htmlTitleTemplate: string;
18
20
  noResultsSuggestion: string;
@@ -11,4 +11,5 @@ export declare const XL_MIN_WIDTH = 1199;
11
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
+ export declare const DEFAULT_PAGE_SIZE_SELECTION: number[];
14
15
  export declare const LUPA_ROUTING_EVENT = "lupaRedirect";
@@ -11919,6 +11919,7 @@ const XL_MIN_WIDTH = 1199;
11919
11919
  const MAX_FACET_VALUES = 5000;
11920
11920
  const CURRENCY_KEY_INDICATOR = "price";
11921
11921
  const DEFAULT_PAGE_SIZE = 12;
11922
+ const DEFAULT_PAGE_SIZE_SELECTION = [12, 24, 36, 60];
11922
11923
  const LUPA_ROUTING_EVENT = "lupaRedirect";
11923
11924
 
11924
11925
  const formatRange = (filter) => {
@@ -19818,6 +19819,11 @@ let SearchResultsProducts = class SearchResultsProducts extends Vue$1 {
19818
19819
  getProductKey(index, product) {
19819
19820
  return getProductKey(index, product, this.options.idKey);
19820
19821
  }
19822
+ goToFirstPage() {
19823
+ this.appendParams({
19824
+ params: [{ name: QUERY_PARAMS.PAGE, value: "1" }],
19825
+ });
19826
+ }
19821
19827
  };
19822
19828
  __decorate([
19823
19829
  Prop()
@@ -19831,6 +19837,9 @@ __decorate([
19831
19837
  __decorate([
19832
19838
  searchResult$4.Getter("currentQueryText")
19833
19839
  ], SearchResultsProducts.prototype, "currentQueryText", void 0);
19840
+ __decorate([
19841
+ searchResult$4.Getter("isPageEmpty")
19842
+ ], SearchResultsProducts.prototype, "isPageEmpty", void 0);
19834
19843
  __decorate([
19835
19844
  searchResult$4.State((state) => state.isMobileSidebarVisible)
19836
19845
  ], SearchResultsProducts.prototype, "isMobileSidebarVisible", void 0);
@@ -19849,6 +19858,9 @@ __decorate([
19849
19858
  __decorate([
19850
19859
  params$2.Getter("page")
19851
19860
  ], SearchResultsProducts.prototype, "page", void 0);
19861
+ __decorate([
19862
+ params$2.Action("appendParams")
19863
+ ], SearchResultsProducts.prototype, "appendParams", void 0);
19852
19864
  SearchResultsProducts = __decorate([
19853
19865
  Component({
19854
19866
  name: "searchResultsProducts",
@@ -19946,6 +19958,38 @@ var __vue_render__$8 = function () {
19946
19958
  1
19947
19959
  ),
19948
19960
  _vm._v(" "),
19961
+ _vm.isPageEmpty && _vm.options.labels.noItemsInPage
19962
+ ? _c(
19963
+ "div",
19964
+ {
19965
+ staticClass: "lupa-empty-results",
19966
+ attrs: { "data-cy": "lupa-no-results-in-page" },
19967
+ },
19968
+ [
19969
+ _vm._v(
19970
+ "\n " +
19971
+ _vm._s(_vm.options.labels.noItemsInPage) +
19972
+ "\n "
19973
+ ),
19974
+ _vm.options.labels.backToFirstPage
19975
+ ? _c(
19976
+ "span",
19977
+ {
19978
+ staticClass: "lupa-empty-page-action",
19979
+ on: { click: _vm.goToFirstPage },
19980
+ },
19981
+ [
19982
+ _vm._v(
19983
+ "\n " +
19984
+ _vm._s(_vm.options.labels.backToFirstPage)
19985
+ ),
19986
+ ]
19987
+ )
19988
+ : _vm._e(),
19989
+ ]
19990
+ )
19991
+ : _vm._e(),
19992
+ _vm._v(" "),
19949
19993
  _c("SearchResultsToolbar", {
19950
19994
  staticClass: "lupa-toolbar-bottom",
19951
19995
  attrs: { options: _vm.options, "pagination-location": "bottom" },
@@ -20755,17 +20799,13 @@ __vue_render__$3._withStripped = true;
20755
20799
  );
20756
20800
 
20757
20801
  let CategoryDescription = class CategoryDescription extends Vue$1 {
20758
- get title() {
20759
- var _a, _b;
20760
- return (_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.title;
20761
- }
20762
20802
  get description() {
20763
20803
  var _a, _b;
20764
20804
  return (_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.description;
20765
20805
  }
20766
20806
  get overviewVisible() {
20767
20807
  var _a, _b;
20768
- return Boolean((_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.title);
20808
+ return Boolean((_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.description);
20769
20809
  }
20770
20810
  };
20771
20811
  __decorate([
@@ -20791,10 +20831,6 @@ var __vue_render__$2 = function () {
20791
20831
  var _c = _vm._self._c || _h;
20792
20832
  return _vm.overviewVisible
20793
20833
  ? _c("div", { staticClass: "lupa-category-overview" }, [
20794
- _c("div", { staticClass: "lupa-category-title" }, [
20795
- _vm._v(_vm._s(_vm.title)),
20796
- ]),
20797
- _vm._v(" "),
20798
20834
  _c("div", {
20799
20835
  staticClass: "lupa-category-description",
20800
20836
  domProps: { innerHTML: _vm._s(_vm.description) },
@@ -21662,6 +21698,10 @@ let SearchResultModule = class SearchResultModule extends VuexModule {
21662
21698
  return "xl";
21663
21699
  }
21664
21700
  }
21701
+ get isPageEmpty() {
21702
+ var _a;
21703
+ return (this.hasResults && ((_a = this.searchResult.offset) !== null && _a !== void 0 ? _a : 0) >= this.totalItems);
21704
+ }
21665
21705
  setSidebarVisibility({ visible }) {
21666
21706
  this.isMobileSidebarVisible = visible;
21667
21707
  }
@@ -21974,8 +22014,8 @@ let OptionsModule = class OptionsModule extends VuexModule {
21974
22014
  return (_b = (_a = this.currentResolutionPageSizes) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : DEFAULT_PAGE_SIZE;
21975
22015
  }
21976
22016
  get currentResolutionPageSizes() {
21977
- var _a, _b, _c;
21978
- const 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;
22017
+ var _a, _b, _c, _d;
22018
+ const pageSizes = (_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 ? _d : DEFAULT_PAGE_SIZE_SELECTION;
21979
22019
  if (Array.isArray(pageSizes)) {
21980
22020
  return pageSizes;
21981
22021
  }
@@ -26,6 +26,7 @@ export default class SearchResultModule extends VuexModule {
26
26
  get itemRange(): number[];
27
27
  get isMobileWidth(): boolean;
28
28
  get currentScreenWidth(): ScreenSize;
29
+ get isPageEmpty(): boolean;
29
30
  setSidebarVisibility({ visible }: {
30
31
  visible: boolean;
31
32
  }): void;
@@ -39,6 +39,8 @@ export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels &
39
39
  mobileFilterButton: string;
40
40
  htmlTitleTemplate: string;
41
41
  outOfStock?: string;
42
+ noItemsInPage?: string;
43
+ backToFirstPage?: string;
42
44
  };
43
45
  export declare type SearchResultsAdditionalPanels = {
44
46
  additionalPanels?: SearchResultsAdditionalPanelOptions[];
@@ -2,7 +2,6 @@ import Vue from "vue";
2
2
  import { ProductListOptions } from "@/types/product-list/ProductListOptions";
3
3
  export default class CategoryDescription extends Vue {
4
4
  options: ProductListOptions;
5
- get title(): string | undefined;
6
5
  get description(): string | undefined;
7
6
  get overviewVisible(): boolean;
8
7
  }
@@ -8,6 +8,7 @@ export default class SearchResultsProducts extends Vue {
8
8
  loading: boolean;
9
9
  hasResults: boolean;
10
10
  currentQueryText: string;
11
+ isPageEmpty: boolean;
11
12
  isMobileSidebarVisible: boolean;
12
13
  productCardOptions(): SearchResultsProductCardOptions;
13
14
  get similarQueriesLabels(): SearchResultsSimilarQueriesLabels;
@@ -21,4 +22,11 @@ export default class SearchResultsProducts extends Vue {
21
22
  page: number;
22
23
  get columnSize(): string;
23
24
  getProductKey(index: string, product: Document): string;
25
+ appendParams: ({ params, }: {
26
+ params: {
27
+ name: string;
28
+ value: string;
29
+ }[];
30
+ }) => void;
31
+ goToFirstPage(): void;
24
32
  }
@@ -13,6 +13,8 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
13
13
  priceSeparator: string;
14
14
  showMore: string;
15
15
  emptyResults: string;
16
+ noItemsInPage: string;
17
+ backToFirstPage: string;
16
18
  mobileFilterButton: string;
17
19
  htmlTitleTemplate: string;
18
20
  noResultsSuggestion: string;
@@ -11,4 +11,5 @@ export declare const XL_MIN_WIDTH = 1199;
11
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
+ export declare const DEFAULT_PAGE_SIZE_SELECTION: number[];
14
15
  export declare const LUPA_ROUTING_EVENT = "lupaRedirect";
@@ -11915,6 +11915,7 @@ const XL_MIN_WIDTH = 1199;
11915
11915
  const MAX_FACET_VALUES = 5000;
11916
11916
  const CURRENCY_KEY_INDICATOR = "price";
11917
11917
  const DEFAULT_PAGE_SIZE = 12;
11918
+ const DEFAULT_PAGE_SIZE_SELECTION = [12, 24, 36, 60];
11918
11919
  const LUPA_ROUTING_EVENT = "lupaRedirect";
11919
11920
 
11920
11921
  const formatRange = (filter) => {
@@ -19814,6 +19815,11 @@ let SearchResultsProducts = class SearchResultsProducts extends Vue$1 {
19814
19815
  getProductKey(index, product) {
19815
19816
  return getProductKey(index, product, this.options.idKey);
19816
19817
  }
19818
+ goToFirstPage() {
19819
+ this.appendParams({
19820
+ params: [{ name: QUERY_PARAMS.PAGE, value: "1" }],
19821
+ });
19822
+ }
19817
19823
  };
19818
19824
  __decorate([
19819
19825
  Prop()
@@ -19827,6 +19833,9 @@ __decorate([
19827
19833
  __decorate([
19828
19834
  searchResult$4.Getter("currentQueryText")
19829
19835
  ], SearchResultsProducts.prototype, "currentQueryText", void 0);
19836
+ __decorate([
19837
+ searchResult$4.Getter("isPageEmpty")
19838
+ ], SearchResultsProducts.prototype, "isPageEmpty", void 0);
19830
19839
  __decorate([
19831
19840
  searchResult$4.State((state) => state.isMobileSidebarVisible)
19832
19841
  ], SearchResultsProducts.prototype, "isMobileSidebarVisible", void 0);
@@ -19845,6 +19854,9 @@ __decorate([
19845
19854
  __decorate([
19846
19855
  params$2.Getter("page")
19847
19856
  ], SearchResultsProducts.prototype, "page", void 0);
19857
+ __decorate([
19858
+ params$2.Action("appendParams")
19859
+ ], SearchResultsProducts.prototype, "appendParams", void 0);
19848
19860
  SearchResultsProducts = __decorate([
19849
19861
  Component({
19850
19862
  name: "searchResultsProducts",
@@ -19942,6 +19954,38 @@ var __vue_render__$8 = function () {
19942
19954
  1
19943
19955
  ),
19944
19956
  _vm._v(" "),
19957
+ _vm.isPageEmpty && _vm.options.labels.noItemsInPage
19958
+ ? _c(
19959
+ "div",
19960
+ {
19961
+ staticClass: "lupa-empty-results",
19962
+ attrs: { "data-cy": "lupa-no-results-in-page" },
19963
+ },
19964
+ [
19965
+ _vm._v(
19966
+ "\n " +
19967
+ _vm._s(_vm.options.labels.noItemsInPage) +
19968
+ "\n "
19969
+ ),
19970
+ _vm.options.labels.backToFirstPage
19971
+ ? _c(
19972
+ "span",
19973
+ {
19974
+ staticClass: "lupa-empty-page-action",
19975
+ on: { click: _vm.goToFirstPage },
19976
+ },
19977
+ [
19978
+ _vm._v(
19979
+ "\n " +
19980
+ _vm._s(_vm.options.labels.backToFirstPage)
19981
+ ),
19982
+ ]
19983
+ )
19984
+ : _vm._e(),
19985
+ ]
19986
+ )
19987
+ : _vm._e(),
19988
+ _vm._v(" "),
19945
19989
  _c("SearchResultsToolbar", {
19946
19990
  staticClass: "lupa-toolbar-bottom",
19947
19991
  attrs: { options: _vm.options, "pagination-location": "bottom" },
@@ -20751,17 +20795,13 @@ __vue_render__$3._withStripped = true;
20751
20795
  );
20752
20796
 
20753
20797
  let CategoryDescription = class CategoryDescription extends Vue$1 {
20754
- get title() {
20755
- var _a, _b;
20756
- return (_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.title;
20757
- }
20758
20798
  get description() {
20759
20799
  var _a, _b;
20760
20800
  return (_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.description;
20761
20801
  }
20762
20802
  get overviewVisible() {
20763
20803
  var _a, _b;
20764
- return Boolean((_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.title);
20804
+ return Boolean((_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.description);
20765
20805
  }
20766
20806
  };
20767
20807
  __decorate([
@@ -20787,10 +20827,6 @@ var __vue_render__$2 = function () {
20787
20827
  var _c = _vm._self._c || _h;
20788
20828
  return _vm.overviewVisible
20789
20829
  ? _c("div", { staticClass: "lupa-category-overview" }, [
20790
- _c("div", { staticClass: "lupa-category-title" }, [
20791
- _vm._v(_vm._s(_vm.title)),
20792
- ]),
20793
- _vm._v(" "),
20794
20830
  _c("div", {
20795
20831
  staticClass: "lupa-category-description",
20796
20832
  domProps: { innerHTML: _vm._s(_vm.description) },
@@ -21658,6 +21694,10 @@ let SearchResultModule = class SearchResultModule extends VuexModule {
21658
21694
  return "xl";
21659
21695
  }
21660
21696
  }
21697
+ get isPageEmpty() {
21698
+ var _a;
21699
+ return (this.hasResults && ((_a = this.searchResult.offset) !== null && _a !== void 0 ? _a : 0) >= this.totalItems);
21700
+ }
21661
21701
  setSidebarVisibility({ visible }) {
21662
21702
  this.isMobileSidebarVisible = visible;
21663
21703
  }
@@ -21970,8 +22010,8 @@ let OptionsModule = class OptionsModule extends VuexModule {
21970
22010
  return (_b = (_a = this.currentResolutionPageSizes) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : DEFAULT_PAGE_SIZE;
21971
22011
  }
21972
22012
  get currentResolutionPageSizes() {
21973
- var _a, _b, _c;
21974
- const 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;
22013
+ var _a, _b, _c, _d;
22014
+ const pageSizes = (_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 ? _d : DEFAULT_PAGE_SIZE_SELECTION;
21975
22015
  if (Array.isArray(pageSizes)) {
21976
22016
  return pageSizes;
21977
22017
  }
@@ -26,6 +26,7 @@ export default class SearchResultModule extends VuexModule {
26
26
  get itemRange(): number[];
27
27
  get isMobileWidth(): boolean;
28
28
  get currentScreenWidth(): ScreenSize;
29
+ get isPageEmpty(): boolean;
29
30
  setSidebarVisibility({ visible }: {
30
31
  visible: boolean;
31
32
  }): void;
@@ -39,6 +39,8 @@ export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels &
39
39
  mobileFilterButton: string;
40
40
  htmlTitleTemplate: string;
41
41
  outOfStock?: string;
42
+ noItemsInPage?: string;
43
+ backToFirstPage?: string;
42
44
  };
43
45
  export declare type SearchResultsAdditionalPanels = {
44
46
  additionalPanels?: SearchResultsAdditionalPanelOptions[];
@@ -2,7 +2,6 @@ import Vue from "vue";
2
2
  import { ProductListOptions } from "@/types/product-list/ProductListOptions";
3
3
  export default class CategoryDescription extends Vue {
4
4
  options: ProductListOptions;
5
- get title(): string | undefined;
6
5
  get description(): string | undefined;
7
6
  get overviewVisible(): boolean;
8
7
  }
@@ -8,6 +8,7 @@ export default class SearchResultsProducts extends Vue {
8
8
  loading: boolean;
9
9
  hasResults: boolean;
10
10
  currentQueryText: string;
11
+ isPageEmpty: boolean;
11
12
  isMobileSidebarVisible: boolean;
12
13
  productCardOptions(): SearchResultsProductCardOptions;
13
14
  get similarQueriesLabels(): SearchResultsSimilarQueriesLabels;
@@ -21,4 +22,11 @@ export default class SearchResultsProducts extends Vue {
21
22
  page: number;
22
23
  get columnSize(): string;
23
24
  getProductKey(index: string, product: Document): string;
25
+ appendParams: ({ params, }: {
26
+ params: {
27
+ name: string;
28
+ value: string;
29
+ }[];
30
+ }) => void;
31
+ goToFirstPage(): void;
24
32
  }
@@ -13,6 +13,8 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
13
13
  priceSeparator: string;
14
14
  showMore: string;
15
15
  emptyResults: string;
16
+ noItemsInPage: string;
17
+ backToFirstPage: string;
16
18
  mobileFilterButton: string;
17
19
  htmlTitleTemplate: string;
18
20
  noResultsSuggestion: string;
@@ -11,4 +11,5 @@ export declare const XL_MIN_WIDTH = 1199;
11
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
+ export declare const DEFAULT_PAGE_SIZE_SELECTION: number[];
14
15
  export declare const LUPA_ROUTING_EVENT = "lupaRedirect";