@getlupa/client 0.4.3 → 0.5.0
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.
- package/README.md +1 -1
- package/dist/cjs/components/search-results/filters/facets/TermFacet.vue.d.ts +3 -2
- package/dist/cjs/constants/development/searchBoxDev.example.const.d.ts +1 -0
- package/dist/cjs/constants/development/searchResultsDev.example.const.d.ts +1 -0
- package/dist/cjs/constants/queryParams.const.d.ts +1 -0
- package/dist/cjs/index.min.js +442 -233
- package/dist/cjs/store/modules/searchBox.d.ts +4 -3
- package/dist/cjs/types/General.d.ts +4 -0
- package/dist/cjs/types/search-box/SearchBoxOptions.d.ts +1 -0
- package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/cjs/utils/filter.toggle.utils.d.ts +1 -1
- package/dist/cjs/utils/filter.utils.d.ts +1 -0
- package/dist/cjs/utils/price.utils.d.ts +2 -2
- package/dist/cjs/utils/tracking.utils.d.ts +4 -0
- package/dist/es/components/search-results/filters/facets/TermFacet.vue.d.ts +3 -2
- package/dist/es/constants/development/searchBoxDev.example.const.d.ts +1 -0
- package/dist/es/constants/development/searchResultsDev.example.const.d.ts +1 -0
- package/dist/es/constants/queryParams.const.d.ts +1 -0
- package/dist/es/index.min.js +442 -233
- package/dist/es/store/modules/searchBox.d.ts +4 -3
- package/dist/es/types/General.d.ts +4 -0
- package/dist/es/types/search-box/SearchBoxOptions.d.ts +1 -0
- package/dist/es/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/es/utils/filter.toggle.utils.d.ts +1 -1
- package/dist/es/utils/filter.utils.d.ts +1 -0
- package/dist/es/utils/price.utils.d.ts +2 -2
- package/dist/es/utils/tracking.utils.d.ts +4 -0
- package/dist/iife/components/search-results/filters/facets/TermFacet.vue.d.ts +3 -2
- package/dist/iife/constants/development/searchBoxDev.example.const.d.ts +1 -0
- package/dist/iife/constants/development/searchResultsDev.example.const.d.ts +1 -0
- package/dist/iife/constants/queryParams.const.d.ts +1 -0
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/store/modules/searchBox.d.ts +4 -3
- package/dist/iife/types/General.d.ts +4 -0
- package/dist/iife/types/search-box/SearchBoxOptions.d.ts +1 -0
- package/dist/iife/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/iife/utils/filter.toggle.utils.d.ts +1 -1
- package/dist/iife/utils/filter.utils.d.ts +1 -0
- package/dist/iife/utils/price.utils.d.ts +2 -2
- package/dist/iife/utils/tracking.utils.d.ts +4 -0
- package/package.json +2 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SearchBoxOptions } from "@/types/search-box/SearchBoxOptions";
|
|
2
|
-
import {
|
|
2
|
+
import { PublicQuery, SearchQueryResult, Suggestion } from "@getlupa/client-sdk/Types";
|
|
3
3
|
import { VuexModule } from "vuex-module-decorators";
|
|
4
4
|
import { DisplaySuggestion, HighlightedDocInfo } from "@/types/search-box/Common";
|
|
5
5
|
import { SearchBoxPanel } from "@/types/search-box/SearchBoxPanel";
|
|
6
|
+
import { SdkOptions } from "@/types/General";
|
|
6
7
|
export default class SearchBoxModule extends VuexModule {
|
|
7
8
|
options: SearchBoxOptions;
|
|
8
9
|
docResults: Record<string, SearchQueryResult>;
|
|
@@ -43,7 +44,7 @@ export default class SearchBoxModule extends VuexModule {
|
|
|
43
44
|
querySuggestions({ queryKey, publicQuery, options, }: {
|
|
44
45
|
queryKey: string;
|
|
45
46
|
publicQuery: PublicQuery;
|
|
46
|
-
options?:
|
|
47
|
+
options?: SdkOptions;
|
|
47
48
|
}): Promise<{
|
|
48
49
|
queryKey: string;
|
|
49
50
|
suggestions?: Suggestion[];
|
|
@@ -52,7 +53,7 @@ export default class SearchBoxModule extends VuexModule {
|
|
|
52
53
|
queryDocuments({ queryKey, publicQuery, options, }: {
|
|
53
54
|
queryKey: string;
|
|
54
55
|
publicQuery: PublicQuery;
|
|
55
|
-
options?:
|
|
56
|
+
options?: SdkOptions;
|
|
56
57
|
}): Promise<{
|
|
57
58
|
queryKey: string;
|
|
58
59
|
result?: SearchQueryResult;
|
|
@@ -2,6 +2,10 @@ import { Environment } from "@getlupa/client-sdk/Types";
|
|
|
2
2
|
import { AnalyticsOptions } from "./AnalyticsOptions";
|
|
3
3
|
export declare type SdkOptions = {
|
|
4
4
|
environment: Environment;
|
|
5
|
+
customUrl?: string;
|
|
6
|
+
customPayload?: Record<string, unknown>;
|
|
7
|
+
customHeaders?: Record<string, string>;
|
|
8
|
+
onError?: (err: unknown) => unknown;
|
|
5
9
|
};
|
|
6
10
|
export declare type TrackingOptions = {
|
|
7
11
|
trackBase?: boolean;
|
|
@@ -18,6 +18,7 @@ export declare type SearchResultsSimilarQueriesLabels = {
|
|
|
18
18
|
export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchResultsDidYouMeanLabels & SearchResultsSimilarQueriesLabels & {
|
|
19
19
|
sortBy: string;
|
|
20
20
|
currency: string;
|
|
21
|
+
priceSeparator?: string;
|
|
21
22
|
itemCount: string;
|
|
22
23
|
emptyResults: string;
|
|
23
24
|
mobileFilterButton: string;
|
|
@@ -16,7 +16,7 @@ export declare const getFacetParam: (key: string, value: string[] | string, type
|
|
|
16
16
|
};
|
|
17
17
|
export declare const toggleTermFilter: (appendParams: AppendParams, facetAction: TermFacetAction, currentFilters?: FilterGroup | undefined) => void;
|
|
18
18
|
export declare const toggleHierarchyFilter: (appendParams: AppendParams, facetAction: HierarchyFacetAction, currentFilters?: FilterGroup | undefined, removeAllLevels?: boolean) => void;
|
|
19
|
-
export declare const toggleRangeFilter: (appendParams: AppendParams, facetAction: RangeFacetAction) => void;
|
|
19
|
+
export declare const toggleRangeFilter: (appendParams: AppendParams, facetAction: RangeFacetAction, currentFilters?: FilterGroup | undefined) => void;
|
|
20
20
|
export declare const toggleTermParam: (params?: string[], param?: string) => string[];
|
|
21
21
|
export declare const toggleLastPram: (params?: string[], param?: string) => string[];
|
|
22
22
|
export declare const toggleHierarchyParam: (params?: string[], param?: string, removeAllLevels?: boolean) => string[];
|
|
@@ -8,3 +8,4 @@ export declare const isArrayKey: (key: string) => boolean;
|
|
|
8
8
|
export declare const getMostSpecificHierarchyTerms: (terms: string[]) => string[];
|
|
9
9
|
export declare const recursiveFilter: (items: HierarchyTree[], query?: string) => HierarchyTree[];
|
|
10
10
|
export declare const recursiveFilterItem: (item: HierarchyTree, query?: string) => HierarchyTree | undefined;
|
|
11
|
+
export declare const rangeFilterToString: (rangeFilter: FilterGroupItemTypeRange, separator?: string | undefined) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const formatPrice: (price?: string | number | undefined, currency?: string) => string;
|
|
2
|
-
export declare const formatPriceSummary: ([min, max]: [min?: string | number | undefined, max?: string | number | undefined], currency?: string | undefined) => string;
|
|
1
|
+
export declare const formatPrice: (price?: string | number | undefined, currency?: string, separator?: string) => string;
|
|
2
|
+
export declare const formatPriceSummary: ([min, max]: [min?: string | number | undefined, max?: string | number | undefined], currency?: string | undefined, separator?: string) => string;
|
|
@@ -2,4 +2,8 @@ import { TrackingOptions } from "@/types/General";
|
|
|
2
2
|
import { TrackableEventData } from "@/types/search-box/Common";
|
|
3
3
|
import { Options } from "@getlupa/client-sdk/Types";
|
|
4
4
|
export declare const initTracking: (options: TrackingOptions) => void;
|
|
5
|
+
export declare const getLupaTrackingContext: () => {
|
|
6
|
+
userId?: string;
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
};
|
|
5
9
|
export declare const track: (queryKey?: string | undefined, data?: TrackableEventData, options?: Options | undefined) => void;
|
|
@@ -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;
|