@getlupa/client 0.5.1-alpha-5 → 0.5.1-alpha-8

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 (44) hide show
  1. package/dist/cjs/components/product-list/CategoryFilter.vue.d.ts +3 -4
  2. package/dist/cjs/components/product-list/CategoryFilterItem.vue.d.ts +2 -3
  3. package/dist/cjs/components/product-list/CategoryTopFilters.vue.d.ts +10 -0
  4. package/dist/cjs/components/search-results/SearchResultsBreadcrumbs.vue.d.ts +4 -1
  5. package/dist/cjs/components/search-results/products/SearchResultsProducts.vue.d.ts +1 -6
  6. package/dist/cjs/components/search-results/products/SearchResultsToolbar.vue.d.ts +12 -6
  7. package/dist/cjs/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +1 -2
  8. package/dist/cjs/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +1 -1
  9. package/dist/cjs/index.d.ts +8 -2
  10. package/dist/cjs/index.min.js +13232 -13060
  11. package/dist/cjs/types/DocumentElement.d.ts +9 -2
  12. package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +1 -1
  13. package/dist/cjs/utils/link.utils.d.ts +2 -0
  14. package/dist/cjs/utils/routing.utils.d.ts +1 -0
  15. package/dist/es/components/product-list/CategoryFilter.vue.d.ts +3 -4
  16. package/dist/es/components/product-list/CategoryFilterItem.vue.d.ts +2 -3
  17. package/dist/es/components/product-list/CategoryTopFilters.vue.d.ts +10 -0
  18. package/dist/es/components/search-results/SearchResultsBreadcrumbs.vue.d.ts +4 -1
  19. package/dist/es/components/search-results/products/SearchResultsProducts.vue.d.ts +1 -6
  20. package/dist/es/components/search-results/products/SearchResultsToolbar.vue.d.ts +12 -6
  21. package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +1 -2
  22. package/dist/es/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +1 -1
  23. package/dist/es/index.d.ts +8 -2
  24. package/dist/es/index.min.js +13195 -13027
  25. package/dist/es/types/DocumentElement.d.ts +9 -2
  26. package/dist/es/types/search-results/SearchResultsOptions.d.ts +1 -1
  27. package/dist/es/utils/link.utils.d.ts +2 -0
  28. package/dist/es/utils/routing.utils.d.ts +1 -0
  29. package/dist/iife/components/product-list/CategoryFilter.vue.d.ts +3 -4
  30. package/dist/iife/components/product-list/CategoryFilterItem.vue.d.ts +2 -3
  31. package/dist/iife/components/product-list/CategoryTopFilters.vue.d.ts +10 -0
  32. package/dist/iife/components/search-results/SearchResultsBreadcrumbs.vue.d.ts +4 -1
  33. package/dist/iife/components/search-results/products/SearchResultsProducts.vue.d.ts +1 -6
  34. package/dist/iife/components/search-results/products/SearchResultsToolbar.vue.d.ts +12 -6
  35. package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +1 -2
  36. package/dist/iife/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +1 -1
  37. package/dist/iife/index.d.ts +8 -2
  38. package/dist/iife/index.min.js +1 -1
  39. package/dist/iife/types/DocumentElement.d.ts +9 -2
  40. package/dist/iife/types/search-results/SearchResultsOptions.d.ts +1 -1
  41. package/dist/iife/utils/link.utils.d.ts +2 -0
  42. package/dist/iife/utils/routing.utils.d.ts +1 -0
  43. package/dist/style.css +1 -1
  44. package/package.json +1 -1
@@ -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 & {
@@ -7,7 +7,6 @@ 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;
12
11
  };
13
12
  export declare type SearchTitlePosition = "page-top" | "search-results-top";
@@ -39,6 +38,7 @@ export declare type SearchResultsProductOptions = SearchResultsProductCardOption
39
38
  pagination: SearchResultsPagination;
40
39
  sort: SearchResultsSortOptions[];
41
40
  filters?: SearchResultsFilterOptions;
41
+ searchTitlePosition?: string;
42
42
  toolbar?: {
43
43
  layoutSelector?: boolean;
44
44
  itemSummary?: boolean;
@@ -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 +1,2 @@
1
1
  export declare const emitRoutingEvent: (url: string) => void;
2
+ export declare const handleRoutingEvent: (link: string, event?: Event | undefined, hasEventRouting?: boolean) => void;
@@ -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
+ }
@@ -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
  }
@@ -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;
@@ -23,7 +23,6 @@ export default class SearchResultsProductCard extends Vue {
23
23
  get labels(): SearchResultsOptionLabels;
24
24
  get link(): string;
25
25
  get hasEventRouting(): boolean;
26
- get url(): string | undefined;
27
26
  isInStock: boolean;
28
27
  mounted(): void;
29
28
  checkIfIsInStock(): Promise<void>;
@@ -32,5 +31,5 @@ export default class SearchResultsProductCard extends Vue {
32
31
  handleProductEvent(item: {
33
32
  type: ReportableEventType;
34
33
  }): void;
35
- handleNavigation(): void;
34
+ handleNavigation(event?: Event): void;
36
35
  }
@@ -11,5 +11,5 @@ export default class SearchResultsProductTitle extends Vue {
11
11
  get isHtml(): boolean;
12
12
  get maxLines(): number;
13
13
  get hasEventRouting(): boolean;
14
- handleNavigation(): void;
14
+ handleNavigation(event?: Event): void;
15
15
  }
@@ -1,7 +1,13 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
- import { SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
2
+ import { FacetStyle, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
3
  import { SdkOptions, TrackingOptions } from "./types/General";
4
4
  import { ProductListOptions } from "./types/product-list/ProductListOptions";
5
+ import { DocumentElementType } from "./types/DocumentElement";
6
+ import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
+ import { Environment, SortDirection } from "@getlupa/client-sdk/Types";
8
+ import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
9
+ import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
10
+ import { BadgeType } from "./types/search-results/BadgeOptions";
5
11
  declare const lupaSearch: {
6
12
  searchBox: (options: SearchBoxOptions) => void;
7
13
  searchResults: (options: SearchResultsOptions) => void;
@@ -11,5 +17,5 @@ declare const lupaSearch: {
11
17
  clearSearchResults: () => void;
12
18
  clearProductList: () => void;
13
19
  };
14
- export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, };
20
+ export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, };
15
21
  export default lupaSearch;