@getlupa/client 0.4.3-2 → 0.5.1-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 (87) hide show
  1. package/README.md +11 -3
  2. package/dist/cjs/ProductListEntry.vue.d.ts +5 -0
  3. package/dist/cjs/components/product-list/CategoryDescription.vue.d.ts +8 -0
  4. package/dist/cjs/components/product-list/CategoryFilter.vue.d.ts +20 -0
  5. package/dist/cjs/components/product-list/CategoryFilterItem.vue.d.ts +12 -0
  6. package/dist/cjs/components/product-list/ProductList.vue.d.ts +6 -0
  7. package/dist/cjs/components/search-results/SearchResults.vue.d.ts +6 -1
  8. package/dist/cjs/components/search-results/filters/CurrentFilters.vue.d.ts +2 -0
  9. package/dist/cjs/components/search-results/filters/facets/TermFacet.vue.d.ts +3 -2
  10. package/dist/cjs/constants/development/searchBoxDev.example.const.d.ts +1 -0
  11. package/dist/cjs/constants/development/searchProductListDev.example.d.ts +28 -0
  12. package/dist/cjs/constants/development/searchResultsDev.example.const.d.ts +1 -0
  13. package/dist/cjs/constants/global.const.d.ts +1 -0
  14. package/dist/cjs/constants/queryParams.const.d.ts +1 -0
  15. package/dist/cjs/index-iife.d.ts +5 -0
  16. package/dist/cjs/index.d.ts +3 -0
  17. package/dist/cjs/index.min.js +2069 -1190
  18. package/dist/cjs/store/modules/options.d.ts +6 -1
  19. package/dist/cjs/store/modules/searchBox.d.ts +4 -3
  20. package/dist/cjs/types/General.d.ts +4 -0
  21. package/dist/cjs/types/product-list/ProductListOptions.d.ts +28 -0
  22. package/dist/cjs/types/search-box/SearchBoxOptions.d.ts +1 -0
  23. package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +3 -0
  24. package/dist/cjs/utils/filter.toggle.utils.d.ts +1 -1
  25. package/dist/cjs/utils/filter.utils.d.ts +1 -0
  26. package/dist/cjs/utils/price.utils.d.ts +2 -2
  27. package/dist/cjs/utils/query.utils.d.ts +2 -1
  28. package/dist/cjs/utils/routing.utils.d.ts +1 -0
  29. package/dist/cjs/utils/tracking.utils.d.ts +4 -0
  30. package/dist/es/ProductListEntry.vue.d.ts +5 -0
  31. package/dist/es/components/product-list/CategoryDescription.vue.d.ts +8 -0
  32. package/dist/es/components/product-list/CategoryFilter.vue.d.ts +20 -0
  33. package/dist/es/components/product-list/CategoryFilterItem.vue.d.ts +12 -0
  34. package/dist/es/components/product-list/ProductList.vue.d.ts +6 -0
  35. package/dist/es/components/search-results/SearchResults.vue.d.ts +6 -1
  36. package/dist/es/components/search-results/filters/CurrentFilters.vue.d.ts +2 -0
  37. package/dist/es/components/search-results/filters/facets/TermFacet.vue.d.ts +3 -2
  38. package/dist/es/constants/development/searchBoxDev.example.const.d.ts +1 -0
  39. package/dist/es/constants/development/searchProductListDev.example.d.ts +28 -0
  40. package/dist/es/constants/development/searchResultsDev.example.const.d.ts +1 -0
  41. package/dist/es/constants/global.const.d.ts +1 -0
  42. package/dist/es/constants/queryParams.const.d.ts +1 -0
  43. package/dist/es/index-iife.d.ts +5 -0
  44. package/dist/es/index.d.ts +3 -0
  45. package/dist/es/index.min.js +2069 -1190
  46. package/dist/es/store/modules/options.d.ts +6 -1
  47. package/dist/es/store/modules/searchBox.d.ts +4 -3
  48. package/dist/es/types/General.d.ts +4 -0
  49. package/dist/es/types/product-list/ProductListOptions.d.ts +28 -0
  50. package/dist/es/types/search-box/SearchBoxOptions.d.ts +1 -0
  51. package/dist/es/types/search-results/SearchResultsOptions.d.ts +3 -0
  52. package/dist/es/utils/filter.toggle.utils.d.ts +1 -1
  53. package/dist/es/utils/filter.utils.d.ts +1 -0
  54. package/dist/es/utils/price.utils.d.ts +2 -2
  55. package/dist/es/utils/query.utils.d.ts +2 -1
  56. package/dist/es/utils/routing.utils.d.ts +1 -0
  57. package/dist/es/utils/tracking.utils.d.ts +4 -0
  58. package/dist/iife/ProductListEntry.vue.d.ts +5 -0
  59. package/dist/iife/components/product-list/CategoryDescription.vue.d.ts +8 -0
  60. package/dist/iife/components/product-list/CategoryFilter.vue.d.ts +20 -0
  61. package/dist/iife/components/product-list/CategoryFilterItem.vue.d.ts +12 -0
  62. package/dist/iife/components/product-list/ProductList.vue.d.ts +6 -0
  63. package/dist/iife/components/search-results/SearchResults.vue.d.ts +6 -1
  64. package/dist/iife/components/search-results/filters/CurrentFilters.vue.d.ts +2 -0
  65. package/dist/iife/components/search-results/filters/facets/TermFacet.vue.d.ts +3 -2
  66. package/dist/iife/constants/development/searchBoxDev.example.const.d.ts +1 -0
  67. package/dist/iife/constants/development/searchProductListDev.example.d.ts +28 -0
  68. package/dist/iife/constants/development/searchResultsDev.example.const.d.ts +1 -0
  69. package/dist/iife/constants/global.const.d.ts +1 -0
  70. package/dist/iife/constants/queryParams.const.d.ts +1 -0
  71. package/dist/iife/index-iife.d.ts +5 -0
  72. package/dist/iife/index.d.ts +3 -0
  73. package/dist/iife/index.min.js +1 -1
  74. package/dist/iife/store/modules/options.d.ts +6 -1
  75. package/dist/iife/store/modules/searchBox.d.ts +4 -3
  76. package/dist/iife/types/General.d.ts +4 -0
  77. package/dist/iife/types/product-list/ProductListOptions.d.ts +28 -0
  78. package/dist/iife/types/search-box/SearchBoxOptions.d.ts +1 -0
  79. package/dist/iife/types/search-results/SearchResultsOptions.d.ts +3 -0
  80. package/dist/iife/utils/filter.toggle.utils.d.ts +1 -1
  81. package/dist/iife/utils/filter.utils.d.ts +1 -0
  82. package/dist/iife/utils/price.utils.d.ts +2 -2
  83. package/dist/iife/utils/query.utils.d.ts +2 -1
  84. package/dist/iife/utils/routing.utils.d.ts +1 -0
  85. package/dist/iife/utils/tracking.utils.d.ts +4 -0
  86. package/dist/style.css +1 -1
  87. package/package.json +2 -2
package/README.md CHANGED
@@ -14,7 +14,7 @@ To
14
14
 
15
15
  - `src/constants/development/searchResultsDev.const.ts`.
16
16
 
17
- If files are copied, development build will not work.
17
+ If files are not copied, development build will not work.
18
18
 
19
19
  ## Project setup
20
20
 
@@ -62,10 +62,18 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
62
62
 
63
63
  ## Documentation
64
64
 
65
- If you are integrating standalone version of the plugin (as a cdn link):
65
+ If you are integrating **standalone** version of the plugin (as a **cdn** link):
66
66
 
67
67
  - See [Getting Started - Standalone](/docs/getting-started-standalone.md) for more information about plugin integration.
68
68
 
69
- For integration as an npm package:
69
+ For integration as an **npm package**:
70
70
 
71
71
  - See [Getting Started - npm](/docs/getting-started-npm.md) for more information about plugin integration.
72
+
73
+ For more information about individual components and all available options:
74
+
75
+ - [Search Box](/docs/components/search-box.md)
76
+
77
+ - [Search Results](/docs/components/search-results.md)
78
+
79
+ - [Tracing and Analytics](/docs/components/tracking.md)
@@ -0,0 +1,5 @@
1
+ import Vue from "vue";
2
+ import { ProductListOptions } from "./types/product-list/ProductListOptions";
3
+ export default class ProductListEntry extends Vue {
4
+ productListOptions: ProductListOptions;
5
+ }
@@ -0,0 +1,8 @@
1
+ import Vue from "vue";
2
+ import { ProductListOptions } from "@/types/product-list/ProductListOptions";
3
+ export default class CategoryDescription extends Vue {
4
+ options: ProductListOptions;
5
+ get title(): string | undefined;
6
+ get description(): string | undefined;
7
+ get overviewVisible(): boolean;
8
+ }
@@ -0,0 +1,20 @@
1
+ import Vue from "vue";
2
+ import { Options } from "@getlupa/client-sdk/Types";
3
+ import { CategoryFilterOptions } from "@/types/product-list/ProductListOptions";
4
+ export default class CategoryFilter extends Vue {
5
+ options: CategoryFilterOptions;
6
+ categoryChildren: Record<string, string>[];
7
+ envOptions: Options;
8
+ get hasBackButton(): boolean;
9
+ get hasDirectRouting(): boolean;
10
+ get backTitle(): string | undefined;
11
+ get backUrl(): string | undefined;
12
+ get backUrlLink(): string | undefined;
13
+ get parentTitle(): string | undefined;
14
+ get parentUrl(): string | undefined;
15
+ get parentUrlLink(): string | undefined;
16
+ get isActive(): boolean;
17
+ mounted(): Promise<void>;
18
+ getCategoryKey(item: Record<string, string>): string;
19
+ handleNavigation(url: string): void;
20
+ }
@@ -0,0 +1,12 @@
1
+ import Vue from "vue";
2
+ import { CategoryFilterOptions } from "@/types/product-list/ProductListOptions";
3
+ export default class CategoryFilterItem extends Vue {
4
+ options: CategoryFilterOptions;
5
+ item: Record<string, string>;
6
+ get title(): string;
7
+ get urlLink(): string;
8
+ get url(): string | undefined;
9
+ get isActive(): boolean;
10
+ get hasDirectRouting(): boolean;
11
+ handleNavigation(): void;
12
+ }
@@ -0,0 +1,6 @@
1
+ import Vue from "vue";
2
+ import { ProductListOptions } from "@/types/product-list/ProductListOptions";
3
+ export default class ProductList extends Vue {
4
+ options: ProductListOptions;
5
+ get componentOptions(): ProductListOptions;
6
+ }
@@ -1,9 +1,11 @@
1
1
  import { QueryParams } from "@/types/search-results/QueryParams";
2
2
  import { ProductGrid, SearchResultsDidYouMeanLabels, SearchResultsOptions, SearchResultsProductOptions } from "@/types/search-results/SearchResultsOptions";
3
- import { PublicQuery, SearchQueryResult } from "@getlupa/client-sdk/Types";
3
+ import { FilterGroup, PublicQuery, SearchQueryResult } from "@getlupa/client-sdk/Types";
4
4
  import Vue from "vue";
5
5
  export default class SearchResults extends Vue {
6
6
  options: SearchResultsOptions;
7
+ initialFilters: FilterGroup;
8
+ isProductList: boolean;
7
9
  get productsOptions(): SearchResultsProductOptions;
8
10
  get didYouMeanLabels(): SearchResultsDidYouMeanLabels;
9
11
  get queryText(): string;
@@ -28,6 +30,9 @@ export default class SearchResults extends Vue {
28
30
  setSearchResultOptions: ({ options, }: {
29
31
  options: SearchResultsOptions;
30
32
  }) => void;
33
+ setInitialFilters: ({ initialFilters, }: {
34
+ initialFilters: FilterGroup;
35
+ }) => void;
31
36
  mounted(): void;
32
37
  beforeDestroy(): void;
33
38
  handleMounted(): void;
@@ -9,6 +9,8 @@ export default class CurrentFilters extends Vue {
9
9
  isOpen: boolean;
10
10
  currentFilters: FilterGroup;
11
11
  facets: FacetResult[] | undefined;
12
+ initialFilters: FilterGroup;
13
+ get displayFilters(): LabeledFilter[];
12
14
  get labeledFilters(): LabeledFilter[];
13
15
  get hasFilters(): boolean;
14
16
  get filterCount(): number;
@@ -1,10 +1,10 @@
1
1
  import Vue from "vue";
2
- import { FacetGroup, FacetGroupItem, FilterGroupItemTypeTerms } from "@getlupa/client-sdk/Types";
2
+ import { FacetGroup, FacetGroupItem, FilterGroupItemTypeRange, FilterGroupItemTypeTerms } from "@getlupa/client-sdk/Types";
3
3
  import { ResultFacetOptions } from "@/types/search-results/SearchResultsOptions";
4
4
  export default class TermFacet extends Vue {
5
5
  options: ResultFacetOptions;
6
6
  facet: FacetGroup;
7
- currentFilters: FilterGroupItemTypeTerms;
7
+ currentFilters: FilterGroupItemTypeTerms | FilterGroupItemTypeRange[];
8
8
  showAll: boolean;
9
9
  termFilter: string;
10
10
  get itemLimit(): number;
@@ -12,6 +12,7 @@ export default class TermFacet extends Vue {
12
12
  get displayValues(): FacetGroupItem[];
13
13
  get filteredValues(): FacetGroupItem[];
14
14
  get isFilterable(): boolean;
15
+ get isRange(): boolean;
15
16
  handleFacetClick(item: FacetGroupItem): void;
16
17
  handleShowAll(): void;
17
18
  isChecked(item: FacetGroupItem): boolean;
@@ -13,6 +13,7 @@ export declare const SEARCH_BOX_CONFIGURATION: {
13
13
  noResults: string;
14
14
  moreResults: string;
15
15
  currency: string;
16
+ priceSeparator: string;
16
17
  defaultFacetLabel: string;
17
18
  };
18
19
  links: {
@@ -0,0 +1,28 @@
1
+ export declare const PRODUCT_LIST_CONFIGURATION: {
2
+ initialFilters: {
3
+ category: string[];
4
+ };
5
+ categories: {
6
+ queryKey: string;
7
+ routingBehavior: string;
8
+ keys: {
9
+ titleKey: string;
10
+ urlKey: string;
11
+ };
12
+ filters: {
13
+ category: string[];
14
+ };
15
+ back: {
16
+ title: string;
17
+ url: string;
18
+ };
19
+ parent: {
20
+ title: string;
21
+ url: string;
22
+ };
23
+ current: {
24
+ title: string;
25
+ description: string;
26
+ };
27
+ };
28
+ };
@@ -10,6 +10,7 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
10
10
  sortBy: string;
11
11
  itemCount: string;
12
12
  currency: string;
13
+ priceSeparator: string;
13
14
  showMore: string;
14
15
  emptyResults: string;
15
16
  mobileFilterButton: string;
@@ -11,3 +11,4 @@ export declare const XL_MIN_WIDTH = 1199;
11
11
  export declare const MAX_FACET_VALUES = 1000;
12
12
  export declare const CURRENCY_KEY_INDICATOR = "price";
13
13
  export declare const DEFAULT_PAGE_SIZE = 12;
14
+ export declare const LUPA_ROUTING_EVENT = "lupaRedirect";
@@ -23,3 +23,4 @@ export declare const FACET_FILTER_MAP: {
23
23
  export declare const FACET_KEY_SEPARATOR = ".";
24
24
  export declare const FACET_RANGE_SEPARATOR = ":";
25
25
  export declare const HIERARCHY_SEPARATOR = ">";
26
+ export declare const FACET_TERM_RANGE_SEPARATOR = "-";
@@ -1,4 +1,5 @@
1
1
  import { TrackingOptions } from "./types/General";
2
+ import { ProductListOptions } from "./types/product-list/ProductListOptions";
2
3
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
3
4
  import { SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
4
5
  declare global {
@@ -7,15 +8,19 @@ declare global {
7
8
  searchBox: (options: SearchBoxOptions) => void;
8
9
  searchResults: (options: SearchResultsOptions) => void;
9
10
  tracking: (options: TrackingOptions) => void;
11
+ productList: (options: ProductListOptions) => void;
10
12
  clearSearchBox: () => void;
11
13
  clearSearchResults: () => void;
14
+ clearProductList: () => void;
12
15
  };
13
16
  lupaSearch: {
14
17
  searchBox: (options: SearchBoxOptions) => void;
15
18
  searchResults: (options: SearchResultsOptions) => void;
16
19
  tracking: (options: TrackingOptions) => void;
20
+ productList: (options: ProductListOptions) => void;
17
21
  clearSearchBox: () => void;
18
22
  clearSearchResults: () => void;
23
+ clearProductList: () => void;
19
24
  };
20
25
  }
21
26
  }
@@ -1,12 +1,15 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
2
  import { SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
3
  import { TrackingOptions } from "./types/General";
4
+ import { ProductListOptions } from "./types/product-list/ProductListOptions";
4
5
  declare const lupaSearch: {
5
6
  searchBox: (options: SearchBoxOptions) => void;
6
7
  searchResults: (options: SearchResultsOptions) => void;
7
8
  tracking: (options: TrackingOptions) => void;
9
+ productList: (options: ProductListOptions) => void;
8
10
  clearSearchBox: () => void;
9
11
  clearSearchResults: () => void;
12
+ clearProductList: () => void;
10
13
  };
11
14
  export { TrackingOptions, SearchBoxOptions, SearchResultsOptions };
12
15
  export default lupaSearch;