@getlupa/client 0.5.1 → 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.
Files changed (95) 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 +7 -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 +8 -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/index.d.ts +9 -3
  16. package/dist/cjs/index.min.js +16923 -14203
  17. package/dist/cjs/store/modules/options.d.ts +4 -0
  18. package/dist/cjs/store/modules/params.d.ts +6 -1
  19. package/dist/cjs/store/modules/searchResult.d.ts +1 -0
  20. package/dist/cjs/types/DocumentElement.d.ts +9 -2
  21. package/dist/cjs/types/General.d.ts +3 -2
  22. package/dist/cjs/types/product-list/ProductListOptions.d.ts +2 -2
  23. package/dist/cjs/types/search-box/SearchBoxOptions.d.ts +2 -0
  24. package/dist/cjs/types/search-results/RoutingBehavior.d.ts +1 -0
  25. package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +3 -1
  26. package/dist/cjs/types/search-results/SearchResultsPagination.d.ts +2 -1
  27. package/dist/cjs/types/search-results/SearchResultsProductCardOptions.d.ts +2 -0
  28. package/dist/cjs/utils/link.utils.d.ts +2 -0
  29. package/dist/cjs/utils/query.utils.d.ts +1 -1
  30. package/dist/cjs/utils/routing.utils.d.ts +5 -0
  31. package/dist/cjs/utils/string.utils.d.ts +1 -0
  32. package/dist/es/ProductListEntry.vue.d.ts +1 -0
  33. package/dist/es/components/product-list/CategoryFilter.vue.d.ts +3 -4
  34. package/dist/es/components/product-list/CategoryFilterItem.vue.d.ts +2 -3
  35. package/dist/es/components/product-list/CategoryTopFilters.vue.d.ts +10 -0
  36. package/dist/es/components/search-box/products/SearchBoxProduct.vue.d.ts +3 -1
  37. package/dist/es/components/search-results/SearchResults.vue.d.ts +7 -0
  38. package/dist/es/components/search-results/SearchResultsBreadcrumbs.vue.d.ts +4 -1
  39. package/dist/es/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  40. package/dist/es/components/search-results/filters/CurrentFilters.vue.d.ts +2 -3
  41. package/dist/es/components/search-results/products/SearchResultsProducts.vue.d.ts +1 -6
  42. package/dist/es/components/search-results/products/SearchResultsToolbar.vue.d.ts +12 -6
  43. package/dist/es/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts +8 -1
  44. package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +4 -0
  45. package/dist/es/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +4 -0
  46. package/dist/es/index.d.ts +9 -3
  47. package/dist/es/index.min.js +17034 -14318
  48. package/dist/es/store/modules/options.d.ts +4 -0
  49. package/dist/es/store/modules/params.d.ts +6 -1
  50. package/dist/es/store/modules/searchResult.d.ts +1 -0
  51. package/dist/es/types/DocumentElement.d.ts +9 -2
  52. package/dist/es/types/General.d.ts +3 -2
  53. package/dist/es/types/product-list/ProductListOptions.d.ts +2 -2
  54. package/dist/es/types/search-box/SearchBoxOptions.d.ts +2 -0
  55. package/dist/es/types/search-results/RoutingBehavior.d.ts +1 -0
  56. package/dist/es/types/search-results/SearchResultsOptions.d.ts +3 -1
  57. package/dist/es/types/search-results/SearchResultsPagination.d.ts +2 -1
  58. package/dist/es/types/search-results/SearchResultsProductCardOptions.d.ts +2 -0
  59. package/dist/es/utils/link.utils.d.ts +2 -0
  60. package/dist/es/utils/query.utils.d.ts +1 -1
  61. package/dist/es/utils/routing.utils.d.ts +5 -0
  62. package/dist/es/utils/string.utils.d.ts +1 -0
  63. package/dist/iife/ProductListEntry.vue.d.ts +1 -0
  64. package/dist/iife/components/product-list/CategoryFilter.vue.d.ts +3 -4
  65. package/dist/iife/components/product-list/CategoryFilterItem.vue.d.ts +2 -3
  66. package/dist/iife/components/product-list/CategoryTopFilters.vue.d.ts +10 -0
  67. package/dist/iife/components/search-box/products/SearchBoxProduct.vue.d.ts +3 -1
  68. package/dist/iife/components/search-results/SearchResults.vue.d.ts +7 -0
  69. package/dist/iife/components/search-results/SearchResultsBreadcrumbs.vue.d.ts +4 -1
  70. package/dist/iife/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  71. package/dist/iife/components/search-results/filters/CurrentFilters.vue.d.ts +2 -3
  72. package/dist/iife/components/search-results/products/SearchResultsProducts.vue.d.ts +1 -6
  73. package/dist/iife/components/search-results/products/SearchResultsToolbar.vue.d.ts +12 -6
  74. package/dist/iife/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts +8 -1
  75. package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +4 -0
  76. package/dist/iife/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +4 -0
  77. package/dist/iife/index.d.ts +9 -3
  78. package/dist/iife/index.min.js +1 -1
  79. package/dist/iife/store/modules/options.d.ts +4 -0
  80. package/dist/iife/store/modules/params.d.ts +6 -1
  81. package/dist/iife/store/modules/searchResult.d.ts +1 -0
  82. package/dist/iife/types/DocumentElement.d.ts +9 -2
  83. package/dist/iife/types/General.d.ts +3 -2
  84. package/dist/iife/types/product-list/ProductListOptions.d.ts +2 -2
  85. package/dist/iife/types/search-box/SearchBoxOptions.d.ts +2 -0
  86. package/dist/iife/types/search-results/RoutingBehavior.d.ts +1 -0
  87. package/dist/iife/types/search-results/SearchResultsOptions.d.ts +3 -1
  88. package/dist/iife/types/search-results/SearchResultsPagination.d.ts +2 -1
  89. package/dist/iife/types/search-results/SearchResultsProductCardOptions.d.ts +2 -0
  90. package/dist/iife/utils/link.utils.d.ts +2 -0
  91. package/dist/iife/utils/query.utils.d.ts +1 -1
  92. package/dist/iife/utils/routing.utils.d.ts +5 -0
  93. package/dist/iife/utils/string.utils.d.ts +1 -0
  94. package/dist/style.css +1 -1
  95. package/package.json +4 -2
@@ -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,6 +57,7 @@ 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, }: {
@@ -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,16 @@ 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;
7
8
  get pages(): number[];
9
+ get showBack(): boolean;
10
+ get lastPage(): number | undefined;
11
+ get showLastPage(): boolean;
12
+ get showLastPageSeparator(): boolean;
13
+ get showFirstPage(): boolean;
14
+ get showFirstPageSeparator(): boolean;
8
15
  appendParams: ({ params, paramsToRemove, }: {
9
16
  params: {
10
17
  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
  }
@@ -1,7 +1,13 @@
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 } 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";
10
+ import { SortDirection } from "@getlupa/client-sdk/Types";
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 };
20
+ 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
21
  export default lupaSearch;