@getlupa/client 0.5.1-alpha-1 → 0.5.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 (50) hide show
  1. package/dist/cjs/components/search-results/SearchResults.vue.d.ts +17 -3
  2. package/dist/cjs/components/search-results/SearchResultsTitle.vue.d.ts +11 -0
  3. package/dist/cjs/components/search-results/filters/CurrentFilters.vue.d.ts +2 -2
  4. package/dist/cjs/components/search-results/filters/MobileFilterSidebar.vue.d.ts +4 -0
  5. package/dist/cjs/components/search-results/filters/facets/FacetList.vue.d.ts +1 -0
  6. package/dist/cjs/components/search-results/filters/facets/StatsFacet.vue.d.ts +12 -1
  7. package/dist/cjs/components/search-results/filters/facets/TermFacet.vue.d.ts +2 -1
  8. package/dist/cjs/components/search-results/products/SearchResultsMobileToggle.vue.d.ts +2 -0
  9. package/dist/cjs/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  10. package/dist/cjs/constants/development/searchBoxDev.example.const.d.ts +1 -0
  11. package/dist/cjs/constants/development/searchResultsDev.example.const.d.ts +16 -0
  12. package/dist/cjs/constants/searchResults.const.d.ts +1 -0
  13. package/dist/cjs/index.min.js +1386 -1004
  14. package/dist/cjs/store/modules/params.d.ts +7 -5
  15. package/dist/cjs/store/modules/searchResult.d.ts +3 -0
  16. package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +18 -0
  17. package/dist/es/components/search-results/SearchResults.vue.d.ts +17 -3
  18. package/dist/es/components/search-results/SearchResultsTitle.vue.d.ts +11 -0
  19. package/dist/es/components/search-results/filters/CurrentFilters.vue.d.ts +2 -2
  20. package/dist/es/components/search-results/filters/MobileFilterSidebar.vue.d.ts +4 -0
  21. package/dist/es/components/search-results/filters/facets/FacetList.vue.d.ts +1 -0
  22. package/dist/es/components/search-results/filters/facets/StatsFacet.vue.d.ts +12 -1
  23. package/dist/es/components/search-results/filters/facets/TermFacet.vue.d.ts +2 -1
  24. package/dist/es/components/search-results/products/SearchResultsMobileToggle.vue.d.ts +2 -0
  25. package/dist/es/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  26. package/dist/es/constants/development/searchBoxDev.example.const.d.ts +1 -0
  27. package/dist/es/constants/development/searchResultsDev.example.const.d.ts +16 -0
  28. package/dist/es/constants/searchResults.const.d.ts +1 -0
  29. package/dist/es/index.min.js +1386 -1004
  30. package/dist/es/store/modules/params.d.ts +7 -5
  31. package/dist/es/store/modules/searchResult.d.ts +3 -0
  32. package/dist/es/types/search-results/SearchResultsOptions.d.ts +18 -0
  33. package/dist/iife/components/search-results/SearchResults.vue.d.ts +17 -3
  34. package/dist/iife/components/search-results/SearchResultsTitle.vue.d.ts +11 -0
  35. package/dist/iife/components/search-results/filters/CurrentFilters.vue.d.ts +2 -2
  36. package/dist/iife/components/search-results/filters/MobileFilterSidebar.vue.d.ts +4 -0
  37. package/dist/iife/components/search-results/filters/facets/FacetList.vue.d.ts +1 -0
  38. package/dist/iife/components/search-results/filters/facets/StatsFacet.vue.d.ts +12 -1
  39. package/dist/iife/components/search-results/filters/facets/TermFacet.vue.d.ts +2 -1
  40. package/dist/iife/components/search-results/products/SearchResultsMobileToggle.vue.d.ts +2 -0
  41. package/dist/iife/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  42. package/dist/iife/constants/development/searchBoxDev.example.const.d.ts +1 -0
  43. package/dist/iife/constants/development/searchResultsDev.example.const.d.ts +16 -0
  44. package/dist/iife/constants/searchResults.const.d.ts +1 -0
  45. package/dist/iife/index.min.js +1 -1
  46. package/dist/iife/store/modules/params.d.ts +7 -5
  47. package/dist/iife/store/modules/searchResult.d.ts +3 -0
  48. package/dist/iife/types/search-results/SearchResultsOptions.d.ts +18 -0
  49. package/dist/style.css +1 -1
  50. package/package.json +1 -1
@@ -25,25 +25,27 @@ export default class ParamsModule extends VuexModule {
25
25
  params: QueryParams;
26
26
  searchString: string;
27
27
  };
28
- removeParams({ paramsToRemove }: {
28
+ removeParams({ paramsToRemove, save, }: {
29
29
  paramsToRemove?: "all" | string[];
30
+ save: boolean;
30
31
  }): {
31
- params: QueryParams;
32
- searchString: string;
32
+ params?: QueryParams;
33
+ searchString?: string;
33
34
  };
34
35
  goToResults({ searchText, facet, }: {
35
36
  searchText: string;
36
37
  facet?: InputSuggestionFacet;
37
38
  }): void;
38
- appendParams({ params, paramsToRemove, encode, }: {
39
+ appendParams({ params, paramsToRemove, encode, save, }: {
39
40
  params: {
40
41
  name: string;
41
42
  value: string;
42
43
  }[];
43
44
  paramsToRemove?: "all" | string[];
44
45
  encode?: boolean;
46
+ save?: boolean;
45
47
  }): {
46
- params: QueryParams;
48
+ params?: QueryParams;
47
49
  searchString?: string;
48
50
  };
49
51
  setDefaultLimit(defaultLimit: number): {
@@ -1,3 +1,4 @@
1
+ import { LabeledFilter } from "@/types/search-results/Filters";
1
2
  import { ResultsLayout } from "@/types/search-results/ResultsLayout";
2
3
  import { ProductGrid } from "@/types/search-results/SearchResultsOptions";
3
4
  import { FacetResult, FilterGroup, SearchQueryResult } from "@getlupa/client-sdk/Types";
@@ -15,6 +16,8 @@ export default class SearchResultModule extends VuexModule {
15
16
  get currentQueryText(): string;
16
17
  get totalItems(): number;
17
18
  get hasResults(): boolean;
19
+ get labeledFilters(): LabeledFilter[];
20
+ get currentFilterCount(): number;
18
21
  get hasAnyFilter(): boolean;
19
22
  get itemRange(): number[];
20
23
  setSidebarVisibility({ visible }: {
@@ -7,7 +7,10 @@ export declare type SearchResultsOptions = SearchResultsProductOptions & SearchR
7
7
  containerSelector: string;
8
8
  breadcrumbs: SearchResultsBreadcrumb[];
9
9
  classMap?: Record<string, string>;
10
+ searchTitlePosition?: string;
11
+ noResultsQueryFlag?: string;
10
12
  };
13
+ export declare type SearchTitlePosition = "page-top" | "search-results-top";
11
14
  export declare type SearchResultsDidYouMeanLabels = {
12
15
  noResultsSuggestion: string;
13
16
  didYouMean: string;
@@ -39,6 +42,7 @@ export declare type SearchResultsProductOptions = SearchResultsProductCardOption
39
42
  layoutSelector?: boolean;
40
43
  itemSummary?: boolean;
41
44
  clearFilters?: boolean;
45
+ totalCount?: boolean;
42
46
  };
43
47
  };
44
48
  export declare type ProductGrid = {
@@ -77,12 +81,17 @@ export declare type ResultCurrentFilterOptions = {
77
81
  mobileSidebar: boolean;
78
82
  mobileToolbar: boolean;
79
83
  };
84
+ mobileSidebar?: {
85
+ showFilterCount?: boolean;
86
+ activeFiltersExpanded?: boolean;
87
+ };
80
88
  };
81
89
  export declare type FacetStyle = "sidebar" | "top-dropdown";
82
90
  export declare type ResultFacetOptions = {
83
91
  labels: {
84
92
  title: string;
85
93
  showAll: string;
94
+ showLess?: string;
86
95
  facetFilter: string;
87
96
  facetClear?: string;
88
97
  };
@@ -95,11 +104,20 @@ export declare type ResultFacetOptions = {
95
104
  topLevelValueCountLimit?: number;
96
105
  filterable?: boolean;
97
106
  };
107
+ stats?: {
108
+ slider?: boolean;
109
+ inputs?: boolean;
110
+ labels?: {
111
+ from?: string;
112
+ to?: string;
113
+ };
114
+ };
98
115
  facetValueCountLimit?: number;
99
116
  showDocumentCount?: boolean;
100
117
  style?: {
101
118
  type: FacetStyle;
102
119
  };
120
+ exclude?: string[];
103
121
  };
104
122
  export declare type SearchResultsFilterOptions = {
105
123
  currentFilters?: ResultCurrentFilterOptions;
@@ -7,9 +7,10 @@ export default class SearchResults extends Vue {
7
7
  initialFilters: FilterGroup;
8
8
  isProductList: boolean;
9
9
  get productsOptions(): SearchResultsProductOptions;
10
+ currentQueryText: string;
10
11
  get didYouMeanLabels(): SearchResultsDidYouMeanLabels;
11
- get queryText(): string;
12
12
  get showFilterSidebar(): boolean;
13
+ get isTitleResultTopPosition(): boolean;
13
14
  trackSearch: ({ queryKey, query, }: {
14
15
  queryKey: string;
15
16
  query: PublicQuery;
@@ -18,8 +19,6 @@ export default class SearchResults extends Vue {
18
19
  queryKey: string;
19
20
  results: SearchQueryResult;
20
21
  }) => void;
21
- currentQueryText: string;
22
- suggestedSearchText: string;
23
22
  searchString: string;
24
23
  setDefaultLimit: (defaultLimit: number) => {
25
24
  defaultLimit: number;
@@ -27,6 +26,17 @@ export default class SearchResults extends Vue {
27
26
  addParams: (params: QueryParams) => {
28
27
  params: QueryParams;
29
28
  };
29
+ removeParams: ({ paramsToRemove, save, }: {
30
+ paramsToRemove: string[];
31
+ save: boolean;
32
+ }) => void;
33
+ appendParams: ({ params, save, }: {
34
+ params: {
35
+ name: string;
36
+ value: string;
37
+ }[];
38
+ save: boolean;
39
+ }) => void;
30
40
  setSearchResultOptions: ({ options, }: {
31
41
  options: SearchResultsOptions;
32
42
  }) => void;
@@ -43,6 +53,10 @@ export default class SearchResults extends Vue {
43
53
  };
44
54
  handleUrlChange(params?: URLSearchParams): void;
45
55
  query(publicQuery: PublicQuery): void;
56
+ handleResults({ queryKey, results, }: {
57
+ queryKey: string;
58
+ results: SearchQueryResult;
59
+ }): void;
46
60
  setColumnCount: ({ width, grid, }: {
47
61
  width: number;
48
62
  grid: ProductGrid;
@@ -0,0 +1,11 @@
1
+ import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
2
+ import Vue from "vue";
3
+ export default class SearchResultsTitle extends Vue {
4
+ options: SearchResultsOptions;
5
+ currentQueryText: string;
6
+ totalItems: number;
7
+ suggestedSearchText: string;
8
+ get queryText(): string;
9
+ get showProductCount(): boolean;
10
+ getLabel(label: string): string;
11
+ }
@@ -9,11 +9,11 @@ export default class CurrentFilters extends Vue {
9
9
  isOpen: boolean;
10
10
  currentFilters: FilterGroup;
11
11
  facets: FacetResult[] | undefined;
12
+ labeledFilters: LabeledFilter[];
12
13
  initialFilters: FilterGroup;
13
14
  get displayFilters(): LabeledFilter[];
14
- get labeledFilters(): LabeledFilter[];
15
15
  get hasFilters(): boolean;
16
- get filterCount(): number;
16
+ get currentFilterCount(): number;
17
17
  removeParams: ({ paramsToRemove, }: {
18
18
  paramsToRemove?: string[];
19
19
  }) => {
@@ -6,5 +6,9 @@ export default class MobileFilterSidebar extends Vue {
6
6
  visible: boolean;
7
7
  }) => void;
8
8
  isMobileSidebarVisible: boolean;
9
+ currentFilterCount: number;
10
+ get sidebarTitle(): string;
11
+ get isFilterCountVisible(): boolean;
12
+ get isActiveFiltersExpanded(): boolean;
9
13
  handleMobileToggle(): void;
10
14
  }
@@ -8,6 +8,7 @@ export default class FacetList extends Vue {
8
8
  currentFilters: FilterGroup;
9
9
  facetStyle: FacetStyle;
10
10
  clearable: boolean;
11
+ get displayFacets(): FacetResult[];
11
12
  handleFacetSelect(facetAction: FacetAction): void;
12
13
  clear(facet: FacetResult): void;
13
14
  }
@@ -1,11 +1,21 @@
1
1
  import Vue from "vue";
2
2
  import { FacetGroupTypeStats, FilterGroupItemTypeRange } from "@getlupa/client-sdk/Types";
3
- import { ResultFacetOptions } from "@/types/search-results/SearchResultsOptions";
3
+ import { ResultFacetOptions, SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
4
4
  export default class TermFacet extends Vue {
5
5
  options: ResultFacetOptions;
6
6
  facet: FacetGroupTypeStats;
7
7
  currentFilters: FilterGroupItemTypeRange;
8
8
  innerSliderRange: number[];
9
+ searchResultOptions: SearchResultsOptions;
10
+ get rangeLabelFrom(): string;
11
+ get rangeLabelTo(): string;
12
+ get currency(): string;
13
+ get isSliderVisible(): boolean;
14
+ get isInputVisible(): boolean;
15
+ get fromValue(): string;
16
+ set fromValue(stringValue: string);
17
+ get toValue(): string;
18
+ set toValue(stringValue: string);
9
19
  get currentGte(): number | undefined;
10
20
  get currentLte(): number | undefined;
11
21
  get currentMinValue(): number;
@@ -18,6 +28,7 @@ export default class TermFacet extends Vue {
18
28
  get statsSummary(): string;
19
29
  onMinValueChange(): void;
20
30
  onMaxValueChange(): void;
31
+ handleInputChange(): void;
21
32
  handleChange(): void;
22
33
  handleDragging(value: number[]): void;
23
34
  }
@@ -13,7 +13,8 @@ export default class TermFacet extends Vue {
13
13
  get filteredValues(): FacetGroupItem[];
14
14
  get isFilterable(): boolean;
15
15
  get isRange(): boolean;
16
+ get displayShowMore(): boolean;
16
17
  handleFacetClick(item: FacetGroupItem): void;
17
- handleShowAll(): void;
18
+ toggleShowAll(): void;
18
19
  isChecked(item: FacetGroupItem): boolean;
19
20
  }
@@ -1,6 +1,8 @@
1
1
  import Vue from "vue";
2
2
  export default class SearchResultsMobileToggle extends Vue {
3
3
  label: string;
4
+ showFilterCount: boolean;
5
+ currentFilterCount: number;
4
6
  setSidebarVisibility: ({ visible, }: {
5
7
  visible: boolean;
6
8
  }) => void;
@@ -14,6 +14,7 @@ export default class SearchResultsToolbar extends Vue {
14
14
  hasAnyFilter: boolean;
15
15
  get displayPageSelect(): boolean;
16
16
  get searchSummaryLabel(): string;
17
+ get showMobileFilterCount(): boolean;
17
18
  removeAllFilters: () => {
18
19
  params: QueryParams;
19
20
  };
@@ -19,6 +19,7 @@ export declare const SEARCH_BOX_CONFIGURATION: {
19
19
  links: {
20
20
  searchResults: string;
21
21
  };
22
+ searchTitlePosition: string;
22
23
  panels: SearchBoxPanel[];
23
24
  history: {
24
25
  labels: {
@@ -20,6 +20,9 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
20
20
  similarQuery: string;
21
21
  similarQueries: string;
22
22
  };
23
+ toolbar: {
24
+ totalCount: boolean;
25
+ };
23
26
  grid: {
24
27
  columns: {
25
28
  xl: number;
@@ -56,11 +59,16 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
56
59
  title: string;
57
60
  clearAll: string;
58
61
  };
62
+ mobileSidebar: {
63
+ showFilterCount: boolean;
64
+ activeFiltersExpanded: boolean;
65
+ };
59
66
  };
60
67
  facets: {
61
68
  labels: {
62
69
  title: string;
63
70
  showAll: string;
71
+ showLess: string;
64
72
  facetFilter: string;
65
73
  };
66
74
  hierarchy: {
@@ -68,6 +76,14 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
68
76
  topLevelValueCountLimit: number;
69
77
  filterable: boolean;
70
78
  };
79
+ stats: {
80
+ slider: boolean;
81
+ inputs: boolean;
82
+ labels: {
83
+ from: string;
84
+ to: string;
85
+ };
86
+ };
71
87
  filterable: {
72
88
  minValues: number;
73
89
  };
@@ -6,6 +6,7 @@ export declare const DEFAULT_OPTIONS_RESULTS: {
6
6
  };
7
7
  queryKey: string;
8
8
  containerSelector: string;
9
+ searchTitlePosition: string;
9
10
  labels: {
10
11
  pageSize: string;
11
12
  sortBy: string;