@sunrise-upc/mobile-prod-card 8.9.10 → 8.9.12

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 (38) hide show
  1. package/dist/cjs/Analytics/AnalyticsConstants.d.ts +2 -0
  2. package/dist/cjs/components/LineCheckV3/APIResourceConstants.d.ts +1 -0
  3. package/dist/cjs/components/RecommendedOptions/RecommendedOptions.d.ts +10 -0
  4. package/dist/cjs/components/RecommendedOptions/RecommendedOptionsUtils.d.ts +14 -0
  5. package/dist/cjs/components/RecommendedOptions/ServiceOption/ServiceOptionCard/ItemsCounter.d.ts +3 -0
  6. package/dist/cjs/components/RecommendedOptions/ServiceOption/ServiceOptionCard/ServiceDetailSection.d.ts +20 -0
  7. package/dist/cjs/components/RecommendedOptions/ServiceOption/ServiceOptionCard/ServiceOptionCard.d.ts +17 -0
  8. package/dist/cjs/components/RecommendedOptions/ServiceOption/ServiceOptionLoader.d.ts +3 -0
  9. package/dist/cjs/components/RecommendedOptions/ServiceOption/ServiceOptionPrice/ServiceOptionPrice.d.ts +11 -0
  10. package/dist/cjs/components/RecommendedOptions/index.d.ts +1 -0
  11. package/dist/cjs/components/RecommendedOptions/types.d.ts +102 -0
  12. package/dist/cjs/components/index.d.ts +1 -0
  13. package/dist/cjs/index.js +3 -3
  14. package/dist/cjs/services/ServiceOptionsPropConfig.d.ts +16 -0
  15. package/dist/cjs/services/index.d.ts +1 -0
  16. package/dist/cjs/utils/AnalyticsUtils.d.ts +1 -0
  17. package/dist/cjs/utils/constants.d.ts +2 -0
  18. package/dist/cjs/utils/utils.d.ts +1 -0
  19. package/dist/esm/Analytics/AnalyticsConstants.d.ts +2 -0
  20. package/dist/esm/components/LineCheckV3/APIResourceConstants.d.ts +1 -0
  21. package/dist/esm/components/RecommendedOptions/RecommendedOptions.d.ts +10 -0
  22. package/dist/esm/components/RecommendedOptions/RecommendedOptionsUtils.d.ts +14 -0
  23. package/dist/esm/components/RecommendedOptions/ServiceOption/ServiceOptionCard/ItemsCounter.d.ts +3 -0
  24. package/dist/esm/components/RecommendedOptions/ServiceOption/ServiceOptionCard/ServiceDetailSection.d.ts +20 -0
  25. package/dist/esm/components/RecommendedOptions/ServiceOption/ServiceOptionCard/ServiceOptionCard.d.ts +17 -0
  26. package/dist/esm/components/RecommendedOptions/ServiceOption/ServiceOptionLoader.d.ts +3 -0
  27. package/dist/esm/components/RecommendedOptions/ServiceOption/ServiceOptionPrice/ServiceOptionPrice.d.ts +11 -0
  28. package/dist/esm/components/RecommendedOptions/index.d.ts +1 -0
  29. package/dist/esm/components/RecommendedOptions/types.d.ts +102 -0
  30. package/dist/esm/components/index.d.ts +1 -0
  31. package/dist/esm/index.js +3 -3
  32. package/dist/esm/services/ServiceOptionsPropConfig.d.ts +16 -0
  33. package/dist/esm/services/index.d.ts +1 -0
  34. package/dist/esm/utils/AnalyticsUtils.d.ts +1 -0
  35. package/dist/esm/utils/constants.d.ts +2 -0
  36. package/dist/esm/utils/utils.d.ts +1 -0
  37. package/dist/index.d.ts +87 -2
  38. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ export interface ServiceOptionsPropConfigSchema {
2
+ baseURL: string | '';
3
+ cartURL: string | '';
4
+ storyBlokURL: string | '';
5
+ }
6
+ export declare class ServiceOptionsPropConfig {
7
+ private static instance;
8
+ config: ServiceOptionsPropConfigSchema;
9
+ private constructor();
10
+ getConfig: () => ServiceOptionsPropConfigSchema;
11
+ getBaseUrl: () => string;
12
+ getCartUrl: () => string;
13
+ getSBUrl: () => string;
14
+ static getInstance: () => ServiceOptionsPropConfig;
15
+ static create: (p_config: ServiceOptionsPropConfigSchema) => void;
16
+ }
@@ -3,3 +3,4 @@ export * from './ProductTeaserPropsConfig';
3
3
  export * from './LinecheckBasicPropConfig';
4
4
  export * from './StickyBottomSheetConfig';
5
5
  export * from './LoginBasicPropConfig';
6
+ export * from './ServiceOptionsPropConfig';
@@ -1,4 +1,5 @@
1
1
  export declare const trackNewDatalayerEvent: (event: string, eventName: string, eventInfo?: any) => void;
2
+ export declare const ecommerceEmptyDatalayer: () => void;
2
3
  declare global {
3
4
  interface Window {
4
5
  appEventData: any;
@@ -55,6 +55,8 @@ export declare const BREADCRUMB = "...";
55
55
  export declare const PRE_TO_POST = "PRE_TO_POST";
56
56
  export declare const P2PSUBSCRIBEDPLAN = "Sunrise Prepaid Unlimited";
57
57
  export declare const TV_SERVICE_OPTION = "TV_SERVICE_OPTION";
58
+ export declare const INTERNET_SERVICE_OPTION = "INTERNET_SERVICE_OPTION";
59
+ export declare const VOICE_SERVICE_OPTION = "VOICE_SERVICE_OPTION";
58
60
  export declare const ERROR_BORDER = "#BF0760";
59
61
  export declare const DISABLED_BACKGROUND = "#E6E3DF";
60
62
  export declare const LOGIN_MFA = "LOGIN_MFA";
@@ -15,6 +15,7 @@ export declare const isModemPresent: () => boolean;
15
15
  export declare const iconHandler: (type: string) => string;
16
16
  export declare const checkLinkWithLang: (url: string) => string | undefined;
17
17
  export declare const getSBAssetUrl: (wafIdentifier: any, image?: string) => string;
18
+ export declare const getCompressedImage: (wafIdentifier: any, imageUrl: string) => string;
18
19
  export declare const getNoteValues: (hardwareProducts: any, key: string) => undefined;
19
20
  /**US 349849 - MIA migration
20
21
  * price model
@@ -8,6 +8,7 @@ export declare const VIEWOPTIONPOPUP = "view_option_popup";
8
8
  export declare const CLOSEOPTIONPOPUP = "close_option_popup";
9
9
  export declare const CTABUTTONCLICK = "cta_button_click";
10
10
  export declare const DOWNLOADPRODUCT = "download_product_details";
11
+ export declare const ADDOPTIONTOCART = "add_option_to_cart";
11
12
  export declare const BUNDLEPRODUCT = "BUNDLE";
12
13
  export declare const GAEVENT = "gaEvent";
13
14
  export declare const STAGETEASER = "Stage Teaser";
@@ -79,6 +80,7 @@ export declare const TOGGLECLICK = "toggle_click";
79
80
  export declare const ACCESSORYCATEGORY = "Accessory";
80
81
  export declare const ACCESSORYLISTNAME = "Device Accessories";
81
82
  export declare const VIEWITEM = "view_item_list";
83
+ export declare const REMOVEOPTIONFROMCART = "remove_option_from_cart";
82
84
  export declare const VIEWEACHITEM = "view_item";
83
85
  export declare const REMOVEFROMCART = "remove_from_cart";
84
86
  export declare const ADD_TO_CART = "add_to_cart";
@@ -5,4 +5,5 @@ export declare const apiResConstants: {
5
5
  LINE_CHECK: string;
6
6
  CONSTANTSKEYS: string;
7
7
  X_SUN_SITEID: string;
8
+ SERVICE_OPTIONS_BY_OFFER: string;
8
9
  };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ComponentWithContentProps } from '../types';
3
+ import type { RecommendedOptionsSchema, RecommendedOptionsCallbacks } from './types';
4
+ declare const RecommendedOptions: React.FC<ComponentWithContentProps<RecommendedOptionsSchema> & RecommendedOptionsCallbacks & {
5
+ cartItem?: any;
6
+ activelocaleId?: string;
7
+ updateCartData?: (cartData: unknown) => void;
8
+ isPartialFetching?: boolean;
9
+ }>;
10
+ export default RecommendedOptions;
@@ -0,0 +1,14 @@
1
+ import { RecommendedOptionsTranslations } from './types';
2
+ export declare const fetchOptions: (offerId?: string) => Promise<any>;
3
+ export declare const fetchStoryblokOptions: (optionCatalogPath: String, categories: Array<string>, language: string) => Promise<any>;
4
+ export declare const getTranslation: (translations: RecommendedOptionsTranslations, key: string) => string;
5
+ export declare const updateCartWithServiceOption: (cartId: string, payload: any) => Promise<any>;
6
+ export declare const createServiceOptionPayload: (option: any, itemType: string) => {
7
+ cartItem: {
8
+ itemType: string;
9
+ items: {
10
+ id: string;
11
+ count: number;
12
+ }[];
13
+ }[];
14
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const ItemsCounter: ({ count, parentCallBack, maxLimit, handleClick, translations }: any) => JSX.Element;
3
+ export default ItemsCounter;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { RecommendedOptionsTranslations } from '../../types';
3
+ interface ServiceDetailsSectionInterface {
4
+ text: string;
5
+ size?: number;
6
+ init?: boolean;
7
+ setIsDetailsOverlay: React.Dispatch<React.SetStateAction<boolean>>;
8
+ isDetailsOverlay: boolean;
9
+ setCardOverlayDetails: React.Dispatch<React.SetStateAction<any[]>>;
10
+ content: any;
11
+ setShowpop: React.Dispatch<React.SetStateAction<boolean>>;
12
+ serviceOptions: any[];
13
+ handleClick: any;
14
+ description: any;
15
+ detailsBtn: boolean;
16
+ checked?: boolean;
17
+ translations: RecommendedOptionsTranslations;
18
+ }
19
+ declare const ServiceDetailsSection: ({ content, text, size, init, setIsDetailsOverlay, isDetailsOverlay, setCardOverlayDetails, setShowpop, serviceOptions, handleClick, description, checked, translations }: ServiceDetailsSectionInterface) => JSX.Element;
20
+ export default ServiceDetailsSection;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { RecommendedOptionsTranslations } from '../../types';
3
+ type ServiceOptionCardInterface = {
4
+ content: any;
5
+ checked: boolean;
6
+ onClick: (id: string, check: boolean, quantity: number) => void;
7
+ offer: any;
8
+ category: string;
9
+ show: boolean;
10
+ setShowpop: any;
11
+ serviceOptions: any[];
12
+ activeTab: string;
13
+ translations: RecommendedOptionsTranslations;
14
+ cartLoading: boolean;
15
+ };
16
+ declare const ServiceOptionCard: ({ content, checked, onClick, offer, category, show, setShowpop, serviceOptions, activeTab, translations, cartLoading }: ServiceOptionCardInterface) => JSX.Element;
17
+ export default ServiceOptionCard;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const ServiceOptionLoader: () => JSX.Element;
3
+ export default ServiceOptionLoader;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { RecommendedOptionsTranslations } from '../../types';
3
+ interface isflexitooltip {
4
+ content: any;
5
+ isDetailsOverlay?: boolean;
6
+ showOptionToolTip?: boolean;
7
+ selections?: any;
8
+ translations: RecommendedOptionsTranslations;
9
+ }
10
+ declare const ServiceOptionPrice: ({ content, isDetailsOverlay, showOptionToolTip, translations }: isflexitooltip) => JSX.Element;
11
+ export default ServiceOptionPrice;
@@ -0,0 +1 @@
1
+ export { default } from './RecommendedOptions';
@@ -0,0 +1,102 @@
1
+ import type { GenericSBProps, Asset } from '../types';
2
+ export type NormalizedServiceOptionsPayload = {
3
+ options: any;
4
+ raw: any;
5
+ };
6
+ export type StoryblokReferenceBlock = {
7
+ component?: string;
8
+ reference?: {
9
+ content?: {
10
+ body?: any;
11
+ };
12
+ };
13
+ };
14
+ export type FilterOptionPair = {
15
+ value: string;
16
+ name: string;
17
+ };
18
+ export type DropdownFilterOption = {
19
+ value: string;
20
+ name: string;
21
+ label: string;
22
+ itemsLength: number;
23
+ codes: string[];
24
+ };
25
+ export type FilterCategoryConfigBlock = {
26
+ component?: string;
27
+ value?: string;
28
+ name?: string;
29
+ };
30
+ export interface RecommendedOptionsTabItem extends GenericSBProps {
31
+ tabKey: string;
32
+ tabLabel: string;
33
+ active: boolean;
34
+ optionsList: string[];
35
+ filterOptions?: StoryblokReferenceBlock | StoryblokReferenceBlock[];
36
+ }
37
+ export interface OptionCardData extends GenericSBProps {
38
+ id: string;
39
+ title: string;
40
+ description: string | Array<Object>;
41
+ price?: string;
42
+ priceUnit?: string;
43
+ priceHelpText?: string;
44
+ isQuantifiable?: boolean;
45
+ maxQuantity?: number;
46
+ moreDetailsLink?: string;
47
+ productImage?: Asset;
48
+ }
49
+ export interface TranslationItem extends GenericSBProps {
50
+ key: string;
51
+ label: string;
52
+ component: 'translationItem';
53
+ }
54
+ export type RecommendedOptionsTranslations = TranslationItem[];
55
+ export interface RecommendedOptionsSchema extends GenericSBProps {
56
+ listHeightDesktop: number;
57
+ categories: any;
58
+ optionCatalogPath: string;
59
+ headline: string;
60
+ description: string | Array<Object>;
61
+ tabs: RecommendedOptionsTabItem[];
62
+ translations: RecommendedOptionsTranslations;
63
+ updateCartData: (cartData: any) => void;
64
+ }
65
+ export type ServiceOptionSelectionPayload = {
66
+ id: string;
67
+ isSelected: boolean;
68
+ quantity: number;
69
+ category: string;
70
+ tabKey: string;
71
+ offer: any;
72
+ product: any;
73
+ };
74
+ export interface RecommendedOptionsCallbacks {
75
+ onAddToPlan?: (optionId: string, quantity?: number) => void;
76
+ onQuantityChange?: (optionId: string, quantity: number) => void;
77
+ onServiceOptionSelect?: (payload: ServiceOptionSelectionPayload) => void;
78
+ className?: string;
79
+ 'aria-label'?: string;
80
+ optionDataResolver?: (optionIds: string[]) => OptionCardData[];
81
+ }
82
+ export interface OptionCardProps extends OptionCardData {
83
+ quantity?: number;
84
+ onAddToPlan?: (id: string, quantity?: number) => void;
85
+ onQuantityChange?: (id: string, quantity: number) => void;
86
+ className?: string;
87
+ 'aria-describedby'?: string;
88
+ }
89
+ export interface QuantitySelectorProps {
90
+ value: number;
91
+ maxQuantity: number;
92
+ onChange: (quantity: number) => void;
93
+ 'aria-label'?: string;
94
+ }
95
+ export type BaseProductWithCodes = {
96
+ raw: any;
97
+ codes: string[];
98
+ };
99
+ export type CategorySection = {
100
+ option: DropdownFilterOption;
101
+ items: BaseProductWithCodes[];
102
+ };
@@ -20,3 +20,4 @@ export { default as ProgressionBar } from './ProgressionBar';
20
20
  export { default as OttServiceOptionsSmallPopup } from './StaticLineTable/OttServiceOptions/OttServiceOptionsSmallPopup';
21
21
  export { default as MultiItemAccessoriesWithProvider } from './Accessories';
22
22
  export { default as NotificationToast } from './NotificationToast/NotificationToast';
23
+ export { default as RecommendedOptions } from './RecommendedOptions';