@getlupa/client 0.7.0-alpha-6 → 0.7.0-alpha-9
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/dist/cjs/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +2 -1
- package/dist/cjs/components/search-results/products/product-card/badges/SearchResultGeneratedBadge.vue.d.ts +7 -0
- package/dist/cjs/components/search-results/products/product-card/badges/SearchResultGeneratedBadges.vue.d.ts +9 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.min.js +846 -652
- package/dist/cjs/types/search-results/BadgeOptions.d.ts +13 -0
- package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/cjs/types/search-results/SearchResultsProductCardOptions.d.ts +2 -1
- package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +2 -1
- package/dist/es/components/search-results/products/product-card/badges/SearchResultGeneratedBadge.vue.d.ts +7 -0
- package/dist/es/components/search-results/products/product-card/badges/SearchResultGeneratedBadges.vue.d.ts +9 -0
- package/dist/es/index.d.ts +2 -2
- package/dist/es/index.min.js +846 -652
- package/dist/es/types/search-results/BadgeOptions.d.ts +13 -0
- package/dist/es/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/es/types/search-results/SearchResultsProductCardOptions.d.ts +2 -1
- package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +2 -1
- package/dist/iife/components/search-results/products/product-card/badges/SearchResultGeneratedBadge.vue.d.ts +7 -0
- package/dist/iife/components/search-results/products/product-card/badges/SearchResultGeneratedBadges.vue.d.ts +9 -0
- package/dist/iife/index.d.ts +2 -2
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/types/search-results/BadgeOptions.d.ts +13 -0
- package/dist/iife/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/iife/types/search-results/SearchResultsProductCardOptions.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { AnchorPosition } from "./SearchResultsProductCardOptions";
|
|
2
2
|
export declare type SearchResultBadgeType = "text" | "image" | "customHtml";
|
|
3
|
+
export declare type BadgeGenerateSeed = {
|
|
4
|
+
id?: string;
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
titleText?: string;
|
|
8
|
+
additionalText?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare type BadgeGenerateOptions<T = Record<string, any>> = {
|
|
11
|
+
key?: string;
|
|
12
|
+
keyMap?: Record<keyof BadgeGenerateSeed, keyof T>;
|
|
13
|
+
image?: (field: BadgeGenerateSeed) => string | undefined;
|
|
14
|
+
};
|
|
3
15
|
export declare type BadgeOptions = {
|
|
4
16
|
anchor: AnchorPosition;
|
|
5
17
|
elements: BadgeElement[];
|
|
18
|
+
generate?: BadgeGenerateOptions;
|
|
6
19
|
product?: any;
|
|
7
20
|
};
|
|
8
21
|
export declare type SearchResultBadgeElement<T = any> = {
|
|
@@ -28,6 +28,7 @@ export declare type SearchResultEventCallbacks = {
|
|
|
28
28
|
onSearchResults?: (context: CallbackContext) => unknown;
|
|
29
29
|
onAdditionalPanelResults?: (context: CallbackContext) => unknown;
|
|
30
30
|
onCategoryFilterResults?: (context: CallbackContext) => unknown;
|
|
31
|
+
onProductClick?: (context: CallbackContext) => unknown;
|
|
31
32
|
onMounted?: () => unknown;
|
|
32
33
|
};
|
|
33
34
|
export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchResultsDidYouMeanLabels & SearchResultsSimilarQueriesLabels & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Document } from "@getlupa/client-sdk/Types";
|
|
2
2
|
import { DocumentElement } from "../DocumentElement";
|
|
3
|
-
import { BadgeElement } from "./BadgeOptions";
|
|
3
|
+
import { BadgeElement, BadgeGenerateOptions } from "./BadgeOptions";
|
|
4
4
|
import { RoutingBehavior } from "./RoutingBehavior";
|
|
5
5
|
import { SearchResultsOptionLabels } from "./SearchResultsOptions";
|
|
6
6
|
export declare type SearchResultsProductCardOptions = {
|
|
@@ -18,5 +18,6 @@ export declare type SearchResultsProductCardOptions = {
|
|
|
18
18
|
export declare type SearchResultBadgeOptions = {
|
|
19
19
|
anchor: AnchorPosition;
|
|
20
20
|
elements: BadgeElement[];
|
|
21
|
+
generate?: BadgeGenerateOptions;
|
|
21
22
|
};
|
|
22
23
|
export declare type AnchorPosition = "tr" | "tl";
|
package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ 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
5
|
import { RoutingBehavior } from "@/types/search-results/RoutingBehavior";
|
|
6
|
-
import { SearchResultsOptionLabels } from "@/types/search-results/SearchResultsOptions";
|
|
6
|
+
import { SearchResultsOptionLabels, SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
|
|
7
7
|
import { SearchResultsProductCardOptions } from "@/types/search-results/SearchResultsProductCardOptions";
|
|
8
8
|
import { Document, ReportableEventType } from "@getlupa/client-sdk/Types";
|
|
9
9
|
import Vue from "vue";
|
|
@@ -13,6 +13,7 @@ export default class SearchResultsProductCard extends Vue {
|
|
|
13
13
|
isAdditionalPanel: boolean;
|
|
14
14
|
layout: ResultsLayout;
|
|
15
15
|
searchResultsRoutingBehavior: RoutingBehavior;
|
|
16
|
+
searchResultOptions: SearchResultsOptions;
|
|
16
17
|
query: string;
|
|
17
18
|
trackClick: ({ queryKey, data, }: {
|
|
18
19
|
queryKey: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BadgeGenerateSeed, BadgeOptions } from "@/types/search-results/BadgeOptions";
|
|
2
|
+
import Vue from "vue";
|
|
3
|
+
export default class SearchResultGeneratedBadges extends Vue {
|
|
4
|
+
options: BadgeOptions;
|
|
5
|
+
get badgeField(): Record<string, any>[];
|
|
6
|
+
get keyMap(): Record<string, string>;
|
|
7
|
+
get hasBadges(): boolean;
|
|
8
|
+
get badges(): BadgeGenerateSeed[];
|
|
9
|
+
}
|
package/dist/es/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, Description
|
|
|
6
6
|
import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
|
|
7
7
|
import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
|
|
8
8
|
import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
|
|
9
|
-
import { BadgeType, SearchResultBadgeElement, SearchResultBadgeType } from "./types/search-results/BadgeOptions";
|
|
9
|
+
import { BadgeGenerateOptions, BadgeGenerateSeed, BadgeOptions, BadgeType, SearchResultBadgeElement, SearchResultBadgeType } from "./types/search-results/BadgeOptions";
|
|
10
10
|
import { SearchResultsSortOptions, SortOptions } from "./types/search-results/SearchResultsSort";
|
|
11
11
|
declare const lupaSearch: {
|
|
12
12
|
searchBox: (options: SearchBoxOptions) => void;
|
|
@@ -17,5 +17,5 @@ declare const lupaSearch: {
|
|
|
17
17
|
clearSearchResults: () => void;
|
|
18
18
|
clearProductList: () => void;
|
|
19
19
|
};
|
|
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, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, };
|
|
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, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, };
|
|
21
21
|
export default lupaSearch;
|