@getlupa/client 0.5.1 → 0.6.0-alpha-3

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.
Files changed (104) hide show
  1. package/dist/cjs/ProductListEntry.vue.d.ts +1 -0
  2. package/dist/cjs/components/product-list/CategoryFilter.vue.d.ts +3 -4
  3. package/dist/cjs/components/product-list/CategoryFilterItem.vue.d.ts +2 -3
  4. package/dist/cjs/components/product-list/CategoryTopFilters.vue.d.ts +10 -0
  5. package/dist/cjs/components/search-box/products/SearchBoxProduct.vue.d.ts +3 -1
  6. package/dist/cjs/components/search-results/SearchResults.vue.d.ts +10 -0
  7. package/dist/cjs/components/search-results/SearchResultsBreadcrumbs.vue.d.ts +4 -1
  8. package/dist/cjs/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  9. package/dist/cjs/components/search-results/filters/CurrentFilters.vue.d.ts +2 -3
  10. package/dist/cjs/components/search-results/products/SearchResultsProducts.vue.d.ts +1 -6
  11. package/dist/cjs/components/search-results/products/SearchResultsToolbar.vue.d.ts +12 -6
  12. package/dist/cjs/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts +10 -1
  13. package/dist/cjs/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +4 -0
  14. package/dist/cjs/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +4 -0
  15. package/dist/cjs/constants/searchResults.const.d.ts +1 -0
  16. package/dist/cjs/index.d.ts +8 -3
  17. package/dist/cjs/index.min.js +16950 -14205
  18. package/dist/cjs/store/modules/options.d.ts +4 -0
  19. package/dist/cjs/store/modules/params.d.ts +6 -1
  20. package/dist/cjs/store/modules/searchResult.d.ts +6 -0
  21. package/dist/cjs/types/DocumentElement.d.ts +9 -2
  22. package/dist/cjs/types/General.d.ts +4 -2
  23. package/dist/cjs/types/product-list/ProductListOptions.d.ts +2 -2
  24. package/dist/cjs/types/search-box/SearchBoxOptions.d.ts +2 -0
  25. package/dist/cjs/types/search-results/PaginationOptions.d.ts +1 -0
  26. package/dist/cjs/types/search-results/RoutingBehavior.d.ts +1 -0
  27. package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +4 -1
  28. package/dist/cjs/types/search-results/SearchResultsPagination.d.ts +2 -1
  29. package/dist/cjs/types/search-results/SearchResultsProductCardOptions.d.ts +2 -0
  30. package/dist/cjs/types/search-results/SearchResultsSort.d.ts +1 -1
  31. package/dist/cjs/utils/link.utils.d.ts +2 -0
  32. package/dist/cjs/utils/query.utils.d.ts +1 -1
  33. package/dist/cjs/utils/routing.utils.d.ts +5 -0
  34. package/dist/cjs/utils/string.utils.d.ts +1 -0
  35. package/dist/es/ProductListEntry.vue.d.ts +1 -0
  36. package/dist/es/components/product-list/CategoryFilter.vue.d.ts +3 -4
  37. package/dist/es/components/product-list/CategoryFilterItem.vue.d.ts +2 -3
  38. package/dist/es/components/product-list/CategoryTopFilters.vue.d.ts +10 -0
  39. package/dist/es/components/search-box/products/SearchBoxProduct.vue.d.ts +3 -1
  40. package/dist/es/components/search-results/SearchResults.vue.d.ts +10 -0
  41. package/dist/es/components/search-results/SearchResultsBreadcrumbs.vue.d.ts +4 -1
  42. package/dist/es/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  43. package/dist/es/components/search-results/filters/CurrentFilters.vue.d.ts +2 -3
  44. package/dist/es/components/search-results/products/SearchResultsProducts.vue.d.ts +1 -6
  45. package/dist/es/components/search-results/products/SearchResultsToolbar.vue.d.ts +12 -6
  46. package/dist/es/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts +10 -1
  47. package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +4 -0
  48. package/dist/es/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +4 -0
  49. package/dist/es/constants/searchResults.const.d.ts +1 -0
  50. package/dist/es/index.d.ts +8 -3
  51. package/dist/es/index.min.js +17055 -14310
  52. package/dist/es/store/modules/options.d.ts +4 -0
  53. package/dist/es/store/modules/params.d.ts +6 -1
  54. package/dist/es/store/modules/searchResult.d.ts +6 -0
  55. package/dist/es/types/DocumentElement.d.ts +9 -2
  56. package/dist/es/types/General.d.ts +4 -2
  57. package/dist/es/types/product-list/ProductListOptions.d.ts +2 -2
  58. package/dist/es/types/search-box/SearchBoxOptions.d.ts +2 -0
  59. package/dist/es/types/search-results/PaginationOptions.d.ts +1 -0
  60. package/dist/es/types/search-results/RoutingBehavior.d.ts +1 -0
  61. package/dist/es/types/search-results/SearchResultsOptions.d.ts +4 -1
  62. package/dist/es/types/search-results/SearchResultsPagination.d.ts +2 -1
  63. package/dist/es/types/search-results/SearchResultsProductCardOptions.d.ts +2 -0
  64. package/dist/es/types/search-results/SearchResultsSort.d.ts +1 -1
  65. package/dist/es/utils/link.utils.d.ts +2 -0
  66. package/dist/es/utils/query.utils.d.ts +1 -1
  67. package/dist/es/utils/routing.utils.d.ts +5 -0
  68. package/dist/es/utils/string.utils.d.ts +1 -0
  69. package/dist/iife/ProductListEntry.vue.d.ts +1 -0
  70. package/dist/iife/components/product-list/CategoryFilter.vue.d.ts +3 -4
  71. package/dist/iife/components/product-list/CategoryFilterItem.vue.d.ts +2 -3
  72. package/dist/iife/components/product-list/CategoryTopFilters.vue.d.ts +10 -0
  73. package/dist/iife/components/search-box/products/SearchBoxProduct.vue.d.ts +3 -1
  74. package/dist/iife/components/search-results/SearchResults.vue.d.ts +10 -0
  75. package/dist/iife/components/search-results/SearchResultsBreadcrumbs.vue.d.ts +4 -1
  76. package/dist/iife/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  77. package/dist/iife/components/search-results/filters/CurrentFilters.vue.d.ts +2 -3
  78. package/dist/iife/components/search-results/products/SearchResultsProducts.vue.d.ts +1 -6
  79. package/dist/iife/components/search-results/products/SearchResultsToolbar.vue.d.ts +12 -6
  80. package/dist/iife/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts +10 -1
  81. package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +4 -0
  82. package/dist/iife/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +4 -0
  83. package/dist/iife/constants/searchResults.const.d.ts +1 -0
  84. package/dist/iife/index.d.ts +8 -3
  85. package/dist/iife/index.min.js +1 -1
  86. package/dist/iife/store/modules/options.d.ts +4 -0
  87. package/dist/iife/store/modules/params.d.ts +6 -1
  88. package/dist/iife/store/modules/searchResult.d.ts +6 -0
  89. package/dist/iife/types/DocumentElement.d.ts +9 -2
  90. package/dist/iife/types/General.d.ts +4 -2
  91. package/dist/iife/types/product-list/ProductListOptions.d.ts +2 -2
  92. package/dist/iife/types/search-box/SearchBoxOptions.d.ts +2 -0
  93. package/dist/iife/types/search-results/PaginationOptions.d.ts +1 -0
  94. package/dist/iife/types/search-results/RoutingBehavior.d.ts +1 -0
  95. package/dist/iife/types/search-results/SearchResultsOptions.d.ts +4 -1
  96. package/dist/iife/types/search-results/SearchResultsPagination.d.ts +2 -1
  97. package/dist/iife/types/search-results/SearchResultsProductCardOptions.d.ts +2 -0
  98. package/dist/iife/types/search-results/SearchResultsSort.d.ts +1 -1
  99. package/dist/iife/utils/link.utils.d.ts +2 -0
  100. package/dist/iife/utils/query.utils.d.ts +1 -1
  101. package/dist/iife/utils/routing.utils.d.ts +5 -0
  102. package/dist/iife/utils/string.utils.d.ts +1 -0
  103. package/dist/style.css +1 -1
  104. package/package.json +4 -2
@@ -1,4 +1,5 @@
1
1
  import { SearchBoxOptions } from "@/types/search-box/SearchBoxOptions";
2
+ import { RoutingBehavior } from "@/types/search-results/RoutingBehavior";
2
3
  import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
3
4
  import { FilterGroup, Options } from "@getlupa/client-sdk/Types";
4
5
  import { VuexModule } from "vuex-module-decorators";
@@ -9,6 +10,9 @@ export default class OptionsModule extends VuexModule {
9
10
  get envOptions(): Options;
10
11
  get classMap(): Record<string, string>;
11
12
  get initialFilters(): FilterGroup;
13
+ get boxRoutingBehavior(): RoutingBehavior;
14
+ get searchResultsRoutingBehavior(): RoutingBehavior;
15
+ get defaultSearchResultPageSize(): number;
12
16
  setSearchBoxOptions({ options }: {
13
17
  options: SearchBoxOptions;
14
18
  }): void;
@@ -32,11 +32,15 @@ export default class ParamsModule extends VuexModule {
32
32
  params?: QueryParams;
33
33
  searchString?: string;
34
34
  };
35
+ handleNoResultsFlag({ resultCount, noResultsParam, }: {
36
+ resultCount: number;
37
+ noResultsParam?: string;
38
+ }): void;
35
39
  goToResults({ searchText, facet, }: {
36
40
  searchText: string;
37
41
  facet?: InputSuggestionFacet;
38
42
  }): void;
39
- appendParams({ params, paramsToRemove, encode, save, }: {
43
+ appendParams({ params, paramsToRemove, encode, save, searchResultsLink, }: {
40
44
  params: {
41
45
  name: string;
42
46
  value: string;
@@ -44,6 +48,7 @@ export default class ParamsModule extends VuexModule {
44
48
  paramsToRemove?: "all" | string[];
45
49
  encode?: boolean;
46
50
  save?: boolean;
51
+ searchResultsLink?: string;
47
52
  }): {
48
53
  params?: QueryParams;
49
54
  searchString?: string;
@@ -10,6 +10,7 @@ export default class SearchResultModule extends VuexModule {
10
10
  layout: ResultsLayout;
11
11
  loading: boolean;
12
12
  isMobileSidebarVisible: boolean;
13
+ screenWidth: number;
13
14
  get facets(): FacetResult[] | undefined;
14
15
  get currentFilters(): FilterGroup | undefined;
15
16
  get filters(): FilterGroup;
@@ -17,9 +18,11 @@ export default class SearchResultModule extends VuexModule {
17
18
  get totalItems(): number;
18
19
  get hasResults(): boolean;
19
20
  get labeledFilters(): LabeledFilter[];
21
+ get displayFilters(): LabeledFilter[];
20
22
  get currentFilterCount(): number;
21
23
  get hasAnyFilter(): boolean;
22
24
  get itemRange(): number[];
25
+ get isMobileWidth(): boolean;
23
26
  setSidebarVisibility({ visible }: {
24
27
  visible: boolean;
25
28
  }): void;
@@ -30,6 +33,9 @@ export default class SearchResultModule extends VuexModule {
30
33
  layout?: ResultsLayout;
31
34
  }): void;
32
35
  load(loading: boolean): void;
36
+ setScreenWidth({ width }: {
37
+ width: number;
38
+ }): void;
33
39
  add(searchResult: SearchQueryResult): {
34
40
  searchResult: SearchQueryResult;
35
41
  pageSize: number;
@@ -12,7 +12,7 @@ export declare enum DocumentElementType {
12
12
  }
13
13
  export declare type DocumentElementBase = {
14
14
  type: DocumentElementType;
15
- key: string;
15
+ key?: string;
16
16
  display?: (document: Record<string, unknown>) => boolean;
17
17
  isHtml?: boolean;
18
18
  };
@@ -20,25 +20,31 @@ export declare type ImageDocumentElement = DocumentElementBase & {
20
20
  type: DocumentElementType.IMAGE;
21
21
  placeholder: string;
22
22
  baseUrl?: string;
23
+ key: string;
23
24
  };
24
25
  export declare type TitleDocumentElement = DocumentElementBase & {
25
26
  type: DocumentElementType.TITLE;
26
27
  maxLines: number;
27
28
  link?: boolean;
29
+ key: string;
28
30
  };
29
31
  export declare type DescriptionDocumentElement = DocumentElementBase & {
30
32
  type: DocumentElementType.DESCRIPTION;
31
33
  maxLines: number;
34
+ key: string;
32
35
  };
33
36
  export declare type CustomDocumentElement = DocumentElementBase & {
34
37
  type: DocumentElementType.CUSTOM;
35
38
  className: string;
39
+ key: string;
36
40
  };
37
41
  export declare type PriceElement = DocumentElementBase & {
38
42
  type: DocumentElementType.PRICE;
43
+ key: string;
39
44
  };
40
45
  export declare type RegularPriceDocumentElement = DocumentElementBase & {
41
46
  type: DocumentElementType.REGULARPRICE;
47
+ key: string;
42
48
  };
43
49
  export declare type RatingElement = DocumentElementBase & {
44
50
  type: DocumentElementType.RATING;
@@ -46,6 +52,7 @@ export declare type RatingElement = DocumentElementBase & {
46
52
  links: RatingLinks;
47
53
  totalKey: string;
48
54
  getRatingPercentage?: (doc: Document) => number;
55
+ key: string;
49
56
  };
50
57
  export declare type RatingLabels = {
51
58
  numberOfRatings: string;
@@ -57,7 +64,7 @@ export declare type AddToCartElement = DocumentElementBase & {
57
64
  type: DocumentElementType.ADDTOCART;
58
65
  action: (document: Document, amount: number) => Promise<unknown> | undefined;
59
66
  labels: {
60
- addToCart: "Add to Cart";
67
+ addToCart: string;
61
68
  };
62
69
  };
63
70
  export declare type CustomHtmlElement = DocumentElementBase & {
@@ -1,7 +1,7 @@
1
- import { Environment } from "@getlupa/client-sdk/Types";
2
1
  import { AnalyticsOptions } from "./AnalyticsOptions";
2
+ import { Environment as SdkEnvironment } from "@getlupa/client-sdk/Types";
3
3
  export declare type SdkOptions = {
4
- environment: Environment;
4
+ environment: SdkEnvironment;
5
5
  customUrl?: string;
6
6
  customPayload?: Record<string, unknown>;
7
7
  customHeaders?: Record<string, string>;
@@ -14,3 +14,5 @@ export declare type TrackingOptions = {
14
14
  userKey?: string;
15
15
  analytics?: AnalyticsOptions;
16
16
  };
17
+ export declare type Environment = SdkEnvironment;
18
+ export declare type SortDirection = "asc" | "desc";
@@ -1,4 +1,5 @@
1
1
  import { FilterGroup } from "@getlupa/client-sdk/Types";
2
+ import { RoutingBehavior } from "../search-results/RoutingBehavior";
2
3
  import { SearchResultsOptions } from "../search-results/SearchResultsOptions";
3
4
  export declare type CategoryFilterOptions = {
4
5
  queryKey: string;
@@ -21,8 +22,7 @@ export declare type CategoryFilterOptions = {
21
22
  description: string;
22
23
  };
23
24
  };
24
- export declare type RoutingBehavior = "direct-link" | "event";
25
25
  export declare type ProductListOptions = SearchResultsOptions & {
26
26
  initialFilters?: FilterGroup;
27
- categories?: CategoryFilterOptions;
27
+ categories: CategoryFilterOptions;
28
28
  };
@@ -1,9 +1,11 @@
1
1
  import { SdkOptions } from "../General";
2
+ import { RoutingBehavior } from "../search-results/RoutingBehavior";
2
3
  import { SearchBoxHistory } from "./SearchBoxHistory";
3
4
  import { SearchBoxPanel } from "./SearchBoxPanel";
4
5
  export declare type SearchBoxOptions = SearchBoxPanelOptions & {
5
6
  inputSelector: string;
6
7
  searchTriggers?: string[];
8
+ routingBehavior?: RoutingBehavior;
7
9
  };
8
10
  export declare type SearchBoxOptionLabels = {
9
11
  placeholder: string;
@@ -12,6 +12,7 @@ export declare type PaginationPageSelect = {
12
12
  count: number;
13
13
  selectedPage: number;
14
14
  display: number;
15
+ displayMobile: number;
15
16
  };
16
17
  export declare type PaginationDisplay = {
17
18
  pageSize: boolean;
@@ -0,0 +1 @@
1
+ export declare type RoutingBehavior = "direct-link" | "event";
@@ -7,8 +7,8 @@ export declare type SearchResultsOptions = SearchResultsProductOptions & SearchR
7
7
  containerSelector: string;
8
8
  breadcrumbs: SearchResultsBreadcrumb[];
9
9
  classMap?: Record<string, string>;
10
- searchTitlePosition?: string;
11
10
  noResultsQueryFlag?: string;
11
+ disallowEmptyQuery?: boolean;
12
12
  };
13
13
  export declare type SearchTitlePosition = "page-top" | "search-results-top";
14
14
  export declare type SearchResultsDidYouMeanLabels = {
@@ -23,6 +23,7 @@ export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels &
23
23
  sortBy: string;
24
24
  currency: string;
25
25
  priceSeparator?: string;
26
+ searchResults?: string;
26
27
  itemCount: string;
27
28
  emptyResults: string;
28
29
  mobileFilterButton: string;
@@ -38,6 +39,7 @@ export declare type SearchResultsProductOptions = SearchResultsProductCardOption
38
39
  pagination: SearchResultsPagination;
39
40
  sort: SearchResultsSortOptions[];
40
41
  filters?: SearchResultsFilterOptions;
42
+ searchTitlePosition?: string;
41
43
  toolbar?: {
42
44
  layoutSelector?: boolean;
43
45
  itemSummary?: boolean;
@@ -66,6 +68,7 @@ export declare type SearchResultsPagination = {
66
68
  pageSelection: {
67
69
  position: SearchResultsPaginationPosition;
68
70
  display: number;
71
+ displayMobile: number;
69
72
  };
70
73
  };
71
74
  export declare type SearchResultsPaginationPosition = {
@@ -1,6 +1,7 @@
1
1
  export declare type SearchResultsPaginationLabels = {
2
2
  pageSize: string;
3
- showMore: string;
3
+ showMore?: string;
4
+ showLess?: string;
4
5
  itemCount: string;
5
6
  filteredItemCount?: string;
6
7
  };
@@ -1,9 +1,11 @@
1
1
  import { Document } from "@getlupa/client-sdk/Types";
2
2
  import { DocumentElement } from "../DocumentElement";
3
3
  import { BadgeElement } from "./BadgeOptions";
4
+ import { RoutingBehavior } from "./RoutingBehavior";
4
5
  import { SearchResultsOptionLabels } from "./SearchResultsOptions";
5
6
  export declare type SearchResultsProductCardOptions = {
6
7
  labels: SearchResultsOptionLabels;
8
+ routingBehavior?: RoutingBehavior;
7
9
  isInStock: (doc: Document) => boolean;
8
10
  badges: SearchResultBadgeOptions;
9
11
  links: {
@@ -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;
@@ -2,3 +2,5 @@ import { InputSuggestionFacet } from "@/types/search-box/Common";
2
2
  export declare const generateLink: (linkPattern: string, document: Record<string, unknown>) => string;
3
3
  export declare const generateResultLink: (link: string, searchText?: string | undefined, facet?: InputSuggestionFacet | undefined) => string;
4
4
  export declare const getPathName: (resultPageLink: string) => string;
5
+ export declare const getRelativePath: (link: string) => string;
6
+ export declare const linksMatch: (link1?: string | undefined, link2?: string | undefined) => boolean;
@@ -1,5 +1,5 @@
1
1
  import { QueryParams } from "@/types/search-results/QueryParams";
2
2
  import { SearchResultsSortOptions } from "@/types/search-results/SearchResultsSort";
3
3
  import { FilterGroup, PublicQuery } from "@getlupa/client-sdk/Types";
4
- export declare const createPublicQuery: (queryParams: QueryParams, sortOptions?: SearchResultsSortOptions[] | undefined) => PublicQuery;
4
+ export declare const createPublicQuery: (queryParams: QueryParams, sortOptions?: SearchResultsSortOptions[] | undefined, defaultPageSize?: number | undefined) => PublicQuery;
5
5
  export declare const getPublicQuery: (publicQuery: PublicQuery, initialFilters: FilterGroup, isProductList: boolean) => PublicQuery;
@@ -1 +1,6 @@
1
+ import { InputSuggestionFacet } from "@/types/search-box/Common";
2
+ import { RoutingBehavior } from "..";
1
3
  export declare const emitRoutingEvent: (url: string) => void;
4
+ export declare const handleRoutingEvent: (link: string, event?: Event | undefined, hasEventRouting?: boolean) => void;
5
+ export declare const redirectToResultsPage: (link: string, searchText: string, facet?: InputSuggestionFacet | undefined, routingBehavior?: RoutingBehavior) => void;
6
+ export declare const getPageUrl: (pathnameOverride?: string | undefined) => URL;
@@ -5,3 +5,4 @@ export declare const addParamsToLabel: (label: string, ...params: unknown[]) =>
5
5
  export declare const getRandomString: (length: number) => string;
6
6
  export declare const getDisplayValue: (value?: string | number | undefined) => string;
7
7
  export declare const getProductKey: (index: string, product: Document, idKey: string | undefined) => string;
8
+ export declare const escapeHtml: (value?: string | undefined) => string;
@@ -2,4 +2,5 @@ import Vue from "vue";
2
2
  import { ProductListOptions } from "./types/product-list/ProductListOptions";
3
3
  export default class ProductListEntry extends Vue {
4
4
  productListOptions: ProductListOptions;
5
+ get fullProductListOptions(): ProductListOptions;
5
6
  }
@@ -6,15 +6,14 @@ export default class CategoryFilter extends Vue {
6
6
  categoryChildren: Record<string, string>[];
7
7
  envOptions: Options;
8
8
  get hasBackButton(): boolean;
9
- get hasDirectRouting(): boolean;
9
+ get hasEventRouting(): boolean;
10
10
  get backTitle(): string | undefined;
11
- get backUrl(): string | undefined;
12
11
  get backUrlLink(): string | undefined;
13
12
  get parentTitle(): string | undefined;
14
- get parentUrl(): string | undefined;
15
13
  get parentUrlLink(): string | undefined;
16
14
  get isActive(): boolean;
17
15
  mounted(): Promise<void>;
18
16
  getCategoryKey(item: Record<string, string>): string;
19
- handleNavigation(url: string): void;
17
+ handleNavigationParent(event?: Event): void;
18
+ handleNavigationBack(event?: Event): void;
20
19
  }
@@ -5,8 +5,7 @@ export default class CategoryFilterItem extends Vue {
5
5
  item: Record<string, string>;
6
6
  get title(): string;
7
7
  get urlLink(): string;
8
- get url(): string | undefined;
9
8
  get isActive(): boolean;
10
- get hasDirectRouting(): boolean;
11
- handleNavigation(): void;
9
+ get hasEventRouting(): boolean;
10
+ handleNavigation(event?: Event): void;
12
11
  }
@@ -0,0 +1,10 @@
1
+ import { ProductListOptions } from "@/types/product-list/ProductListOptions";
2
+ import Vue from "vue";
3
+ export default class CategoryTopFilters extends Vue {
4
+ options: ProductListOptions;
5
+ get hasBackButton(): boolean;
6
+ get backTitle(): string | undefined;
7
+ get backUrlLink(): string | undefined;
8
+ get hasEventRouting(): boolean;
9
+ handleNavigationBack(event?: Event): void;
10
+ }
@@ -4,12 +4,14 @@ import { DocumentSearchBoxPanel } from "@/types/search-box/SearchBoxPanel";
4
4
  import { SearchBoxOptionLabels } from "@/types/search-box/SearchBoxOptions";
5
5
  import { DocumentElement } from "@/types/DocumentElement";
6
6
  import { TrackableEventData } from "@/types/search-box/Common";
7
+ import { RoutingBehavior } from "@/types/search-results/RoutingBehavior";
7
8
  export default class SearchBoxProduct extends Vue {
8
9
  item: Document;
9
10
  inputValue: string;
10
11
  panelOptions: DocumentSearchBoxPanel;
11
12
  labels?: SearchBoxOptionLabels;
12
13
  highlighted?: boolean;
14
+ boxRoutingBehavior: RoutingBehavior;
13
15
  trackClick: ({ queryKey, data, }: {
14
16
  queryKey: string;
15
17
  data: TrackableEventData;
@@ -21,5 +23,5 @@ export default class SearchBoxProduct extends Vue {
21
23
  get imageElements(): DocumentElement[];
22
24
  get detailElements(): DocumentElement[];
23
25
  get id(): string;
24
- handleClick(): void;
26
+ handleClick(event?: Event): void;
25
27
  }
@@ -8,6 +8,8 @@ export default class SearchResults extends Vue {
8
8
  isProductList: boolean;
9
9
  get productsOptions(): SearchResultsProductOptions;
10
10
  currentQueryText: string;
11
+ hasResults: boolean;
12
+ currentFilterCount: number;
11
13
  get didYouMeanLabels(): SearchResultsDidYouMeanLabels;
12
14
  get showFilterSidebar(): boolean;
13
15
  get isTitleResultTopPosition(): boolean;
@@ -23,6 +25,10 @@ export default class SearchResults extends Vue {
23
25
  setDefaultLimit: (defaultLimit: number) => {
24
26
  defaultLimit: number;
25
27
  };
28
+ handleNoResultsFlag: ({ resultCount, noResultsParam, }: {
29
+ resultCount: number;
30
+ noResultsParam?: string;
31
+ }) => void;
26
32
  addParams: (params: QueryParams) => {
27
33
  params: QueryParams;
28
34
  };
@@ -51,12 +57,16 @@ export default class SearchResults extends Vue {
51
57
  setLoading: (loading: boolean) => {
52
58
  loading: boolean;
53
59
  };
60
+ defaultSearchResultPageSize: number;
54
61
  handleUrlChange(params?: URLSearchParams): void;
55
62
  query(publicQuery: PublicQuery): void;
56
63
  handleResults({ queryKey, results, }: {
57
64
  queryKey: string;
58
65
  results: SearchQueryResult;
59
66
  }): void;
67
+ setScreenWidth: ({ width, }: {
68
+ width: number;
69
+ }) => void;
60
70
  setColumnCount: ({ width, grid, }: {
61
71
  width: number;
62
72
  grid: ProductGrid;
@@ -1,7 +1,10 @@
1
- import { SearchResultsBreadcrumb } from "@/types/search-results/SearchResultsOptions";
1
+ import { SearchResultsBreadcrumb, SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
2
2
  import Vue from "vue";
3
3
  export default class SearchResultsBreadcrumbs extends Vue {
4
4
  breadcrumbs: SearchResultsBreadcrumb[];
5
5
  currentQueryText: string;
6
+ searchResultOptions: SearchResultsOptions;
7
+ get hasEventRouting(): boolean;
6
8
  getLabel(label: string): string;
9
+ handleNavigation(event: Event, link: string): void;
7
10
  }
@@ -2,10 +2,12 @@ import { SearchResultsOptions } from "@/types/search-results/SearchResultsOption
2
2
  import Vue from "vue";
3
3
  export default class SearchResultsTitle extends Vue {
4
4
  options: SearchResultsOptions;
5
+ isProductList: boolean;
5
6
  currentQueryText: string;
6
7
  totalItems: number;
7
8
  suggestedSearchText: string;
8
9
  get queryText(): string;
9
10
  get showProductCount(): boolean;
11
+ get showSearchTitle(): boolean;
10
12
  getLabel(label: string): string;
11
13
  }
@@ -9,11 +9,10 @@ export default class CurrentFilters extends Vue {
9
9
  isOpen: boolean;
10
10
  currentFilters: FilterGroup;
11
11
  facets: FacetResult[] | undefined;
12
- labeledFilters: LabeledFilter[];
12
+ displayFilters: LabeledFilter[];
13
+ currentFilterCount: number;
13
14
  initialFilters: FilterGroup;
14
- get displayFilters(): LabeledFilter[];
15
15
  get hasFilters(): boolean;
16
- get currentFilterCount(): number;
17
16
  removeParams: ({ paramsToRemove, }: {
18
17
  paramsToRemove?: string[];
19
18
  }) => {
@@ -1,8 +1,6 @@
1
- import { PaginationDisplay, PaginationOptions } from "@/types/search-results/PaginationOptions";
2
1
  import { ResultsLayout } from "@/types/search-results/ResultsLayout";
3
2
  import { ResultCurrentFilterOptions, SearchResultsProductOptions, SearchResultsSimilarQueriesLabels } from "@/types/search-results/SearchResultsOptions";
4
3
  import { SearchResultsProductCardOptions } from "@/types/search-results/SearchResultsProductCardOptions";
5
- import { SortOptions } from "@/types/search-results/SearchResultsSort";
6
4
  import { Document, SearchQueryResult } from "@getlupa/client-sdk/Types";
7
5
  import Vue from "vue";
8
6
  export default class SearchResultsProducts extends Vue {
@@ -14,6 +12,7 @@ export default class SearchResultsProducts extends Vue {
14
12
  productCardOptions(): SearchResultsProductCardOptions;
15
13
  get similarQueriesLabels(): SearchResultsSimilarQueriesLabels;
16
14
  get showTopFilters(): boolean;
15
+ get showMobileFilters(): boolean;
17
16
  get currentFilterOptions(): ResultCurrentFilterOptions | undefined;
18
17
  columnCount: number;
19
18
  searchResult: SearchQueryResult;
@@ -21,9 +20,5 @@ export default class SearchResultsProducts extends Vue {
21
20
  limit: number;
22
21
  page: number;
23
22
  get columnSize(): string;
24
- get sortOptions(): SortOptions;
25
- get paginationOptions(): PaginationOptions;
26
- get topPagination(): PaginationDisplay;
27
- get bottomPagination(): PaginationDisplay;
28
23
  getProductKey(index: string, product: Document): string;
29
24
  }
@@ -3,15 +3,21 @@ import Vue from "vue";
3
3
  import { SortOptions } from "@/types/search-results/SearchResultsSort";
4
4
  import { SearchResultsProductOptions } from "@/types/search-results/SearchResultsOptions";
5
5
  import { QueryParams } from "@/types/search-results/QueryParams";
6
+ import { SearchQueryResult } from "@getlupa/client-sdk/Types";
6
7
  export default class SearchResultsToolbar extends Vue {
7
8
  options: SearchResultsProductOptions;
8
- paginationOptions: PaginationOptions;
9
- paginationDisplay: PaginationDisplay;
10
- sortOptions: SortOptions;
11
- showLayoutSelection: boolean;
12
- showItemSummary: boolean;
13
- showFilterClear: boolean;
9
+ paginationLocation: "top" | "bottom";
10
+ limit: number;
11
+ page: number;
14
12
  hasAnyFilter: boolean;
13
+ searchResult: SearchQueryResult;
14
+ get isBottomLocation(): boolean;
15
+ get showFilterClear(): boolean;
16
+ get showItemSummary(): boolean;
17
+ get showLayoutSelection(): boolean;
18
+ get sortOptions(): SortOptions | undefined;
19
+ get paginationDisplay(): PaginationDisplay;
20
+ get paginationOptions(): PaginationOptions;
15
21
  get displayPageSelect(): boolean;
16
22
  get searchSummaryLabel(): string;
17
23
  get showMobileFilterCount(): boolean;
@@ -2,9 +2,18 @@ import { PaginationPageSelect } from "@/types/search-results/PaginationOptions";
2
2
  import { QueryParams } from "@/types/search-results/QueryParams";
3
3
  import Vue from "vue";
4
4
  export default class SearchResultsPageSelect extends Vue {
5
- label: string;
5
+ lastPageLabel: string;
6
+ firstPageLabel: string;
6
7
  options: PaginationPageSelect;
8
+ isMobileWidth: boolean;
9
+ get pageOptionsCount(): number;
7
10
  get pages(): number[];
11
+ get showBack(): boolean;
12
+ get lastPage(): number | undefined;
13
+ get showLastPage(): boolean;
14
+ get showLastPageSeparator(): boolean;
15
+ get showFirstPage(): boolean;
16
+ get showFirstPageSeparator(): boolean;
8
17
  appendParams: ({ params, paramsToRemove, }: {
9
18
  params: {
10
19
  name: string;
@@ -2,6 +2,7 @@ import { DocumentElement } from "@/types/DocumentElement";
2
2
  import { TrackableEventData } from "@/types/search-box/Common";
3
3
  import { BadgeOptions } from "@/types/search-results/BadgeOptions";
4
4
  import { ResultsLayout } from "@/types/search-results/ResultsLayout";
5
+ import { RoutingBehavior } from "@/types/search-results/RoutingBehavior";
5
6
  import { SearchResultsOptionLabels } from "@/types/search-results/SearchResultsOptions";
6
7
  import { SearchResultsProductCardOptions } from "@/types/search-results/SearchResultsProductCardOptions";
7
8
  import { Document, ReportableEventType } from "@getlupa/client-sdk/Types";
@@ -11,6 +12,7 @@ export default class SearchResultsProductCard extends Vue {
11
12
  options: SearchResultsProductCardOptions;
12
13
  isAdditionalPanel: boolean;
13
14
  layout: ResultsLayout;
15
+ searchResultsRoutingBehavior: RoutingBehavior;
14
16
  query: string;
15
17
  trackClick: ({ queryKey, data, }: {
16
18
  queryKey: string;
@@ -22,6 +24,7 @@ export default class SearchResultsProductCard extends Vue {
22
24
  get detailElements(): DocumentElement[];
23
25
  get labels(): SearchResultsOptionLabels;
24
26
  get link(): string;
27
+ get hasEventRouting(): boolean;
25
28
  isInStock: boolean;
26
29
  mounted(): void;
27
30
  checkIfIsInStock(): Promise<void>;
@@ -30,4 +33,5 @@ export default class SearchResultsProductCard extends Vue {
30
33
  handleProductEvent(item: {
31
34
  type: ReportableEventType;
32
35
  }): void;
36
+ handleNavigation(event?: Event): void;
33
37
  }
@@ -1,11 +1,15 @@
1
1
  import Vue from "vue";
2
2
  import { Document } from "@getlupa/client-sdk/Types";
3
3
  import { TitleDocumentElement } from "@/types/DocumentElement";
4
+ import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
4
5
  export default class SearchResultsProductTitle extends Vue {
5
6
  item: Document;
6
7
  options: TitleDocumentElement;
7
8
  link: string;
9
+ searchResultOptions: SearchResultsOptions;
8
10
  get title(): unknown;
9
11
  get isHtml(): boolean;
10
12
  get maxLines(): number;
13
+ get hasEventRouting(): boolean;
14
+ handleNavigation(event?: Event): void;
11
15
  }
@@ -46,6 +46,7 @@ export declare const DEFAULT_OPTIONS_RESULTS: {
46
46
  bottom: boolean;
47
47
  };
48
48
  display: number;
49
+ displayMobile: number;
49
50
  };
50
51
  };
51
52
  sort: never[];
@@ -1,7 +1,12 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
- import { SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
- import { TrackingOptions } from "./types/General";
2
+ import { FacetStyle, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
+ import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
4
4
  import { ProductListOptions } from "./types/product-list/ProductListOptions";
5
+ import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
6
+ import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
+ import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
+ import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
+ import { BadgeType } from "./types/search-results/BadgeOptions";
5
10
  declare const lupaSearch: {
6
11
  searchBox: (options: SearchBoxOptions) => void;
7
12
  searchResults: (options: SearchResultsOptions) => void;
@@ -11,5 +16,5 @@ declare const lupaSearch: {
11
16
  clearSearchResults: () => void;
12
17
  clearProductList: () => void;
13
18
  };
14
- export { TrackingOptions, SearchBoxOptions, SearchResultsOptions };
19
+ export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, };
15
20
  export default lupaSearch;