@ikas/loyalty-widget-renderer 1.0.0-alpha.9 → 1.0.0-alpha.91
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/build/assets/icons/arrow-right.d.ts +2 -0
- package/build/assets/icons/arrow-right.js +1 -0
- package/build/assets/icons/check-circle.d.ts +2 -0
- package/build/assets/icons/check-circle.js +1 -0
- package/build/assets/index.d.ts +9 -0
- package/build/assets/widget-icons/illustraions/check-fill.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/check-fill.js +1 -0
- package/build/assets/widget-icons/illustraions/informationCircleIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/informationCircleIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/medal.js +1 -1
- package/build/assets/widget-icons/illustraions/refundIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/refundIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/scenery.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/scenery.js +1 -0
- package/build/assets/widget-icons/normal/album02.d.ts +2 -0
- package/build/assets/widget-icons/normal/album02.js +1 -0
- package/build/assets/widget-icons/normal/informationCircle.d.ts +2 -0
- package/build/assets/widget-icons/normal/informationCircle.js +1 -0
- package/build/assets/widget-icons/normal/refund.d.ts +2 -0
- package/build/assets/widget-icons/normal/refund.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/arrayLikeToArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/arrayWithHoles.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/assertThisInitialized.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/classCallCheck.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/createClass.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/defineProperty.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/getPrototypeOf.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/inherits.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/iterableToArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/iterableToArrayLimit.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/nonIterableRest.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/objectWithoutProperties.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/possibleConstructorReturn.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/setPrototypeOf.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/slicedToArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/toArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/toPrimitive.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/toPropertyKey.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/typeof.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +1 -0
- package/build/ext/html-parse-stringify/dist/html-parse-stringify.module.js +1 -0
- package/build/ext/i18next/dist/esm/i18next.js +1 -1
- package/build/ext/react-i18next/dist/es/I18nextProvider.js +1 -1
- package/build/ext/react-i18next/dist/es/Trans.js +1 -0
- package/build/ext/react-i18next/dist/es/context.js +1 -1
- package/build/ext/react-i18next/dist/es/unescape.js +1 -1
- package/build/ext/react-i18next/dist/es/useTranslation.js +1 -1
- package/build/ext/react-i18next/dist/es/utils.js +1 -1
- package/build/ext/tslib/tslib.es6.mjs.js +1 -1
- package/build/ext/void-elements/index.js +1 -0
- package/build/index.d.ts +9 -0
- package/build/index.js +1 -1
- package/build/injector.d.ts +5 -0
- package/build/locales.d.ts +703 -0
- package/build/locales.js +1 -0
- package/build/models/button/index.js +1 -1
- package/build/models/common/index.d.ts +21 -0
- package/build/models/common/index.js +1 -0
- package/build/models/image/index.d.ts +2 -2
- package/build/models/image/index.js +1 -1
- package/build/models/index.d.ts +22 -7
- package/build/models/index.js +1 -1
- package/build/models/loyalty-customer-info/index.d.ts +29 -8
- package/build/models/loyalty-customer-info/index.js +1 -1
- package/build/models/loyalty-program-earning-method/index.d.ts +16 -30
- package/build/models/loyalty-program-earning-method/index.js +1 -1
- package/build/models/loyalty-program-point-history/index.d.ts +5 -3
- package/build/models/loyalty-program-point-history/index.js +1 -1
- package/build/models/loyalty-program-spending-method/index.d.ts +8 -20
- package/build/models/loyalty-program-spending-method/index.js +1 -1
- package/build/models/loyalty-widget/header/header-background/index.d.ts +2 -2
- package/build/models/loyalty-widget/header/header-background/index.js +1 -1
- package/build/models/loyalty-widget/header/index.d.ts +1 -1
- package/build/models/loyalty-widget/header/index.js +1 -1
- package/build/models/loyalty-widget/index.d.ts +4 -2
- package/build/models/loyalty-widget/index.js +1 -1
- package/build/models/loyalty-widget/settings/index.js +1 -1
- package/build/models/loyalty-widget/translations.d.ts +5 -0
- package/build/models/loyalty-widget/translations.js +1 -0
- package/build/models/mini-mode/index.d.ts +10 -0
- package/build/models/mini-mode/index.js +1 -0
- package/build/models/types/index.d.ts +45 -42
- package/build/models/types/index.js +1 -1
- package/build/renderer/components/animate-height/index.d.ts +9 -0
- package/build/renderer/components/animate-height/index.js +1 -0
- package/build/renderer/components/button/index.js +1 -1
- package/build/renderer/components/button/style.d.ts +1 -0
- package/build/renderer/components/button/style.js +1 -1
- package/build/renderer/components/count-up/index.d.ts +7 -0
- package/build/renderer/components/count-up/index.js +1 -0
- package/build/renderer/components/flexible-value-container/index.d.ts +16 -0
- package/build/renderer/components/flexible-value-container/index.js +1 -0
- package/build/renderer/components/loyalty-method-card/index.d.ts +2 -1
- package/build/renderer/components/loyalty-method-card/index.js +1 -1
- package/build/renderer/components/loyalty-method-card/style.d.ts +3 -3
- package/build/renderer/components/loyalty-method-card/style.js +1 -1
- package/build/renderer/components/mini-mode-button/index.d.ts +7 -0
- package/build/renderer/components/mini-mode-button/index.js +1 -0
- package/build/renderer/components/mini-mode-button/style.d.ts +6 -0
- package/build/renderer/components/mini-mode-button/style.js +1 -0
- package/build/renderer/components/mini-mode-description/index.d.ts +8 -0
- package/build/renderer/components/mini-mode-description/index.js +1 -0
- package/build/renderer/components/mini-mode-description/style.d.ts +3 -0
- package/build/renderer/components/mini-mode-description/style.js +1 -0
- package/build/renderer/components/product-filter-card/index.d.ts +13 -0
- package/build/renderer/components/product-filter-card/index.js +1 -0
- package/build/renderer/components/product-filter-card/style.d.ts +10 -0
- package/build/renderer/components/product-filter-card/style.js +1 -0
- package/build/renderer/components/style/icon-wrapper.d.ts +4 -0
- package/build/renderer/components/style/icon-wrapper.js +1 -0
- package/build/renderer/components/style/typography.d.ts +3 -1
- package/build/renderer/components/style/typography.js +1 -1
- package/build/renderer/components/tooltip/index.d.ts +7 -0
- package/build/renderer/components/tooltip/index.js +1 -0
- package/build/renderer/components/tooltip/style.d.ts +4 -0
- package/build/renderer/components/tooltip/style.js +1 -0
- package/build/renderer/components/translation-settings/style.d.ts +9 -0
- package/build/renderer/index.js +1 -1
- package/build/renderer/screens/credit-earning-methods-screen/index.js +1 -1
- package/build/renderer/screens/credit-earning-methods-screen/style.js +1 -1
- package/build/renderer/screens/credit-history-screen/index.js +1 -1
- package/build/renderer/screens/credit-history-screen/style.d.ts +6 -2
- package/build/renderer/screens/credit-history-screen/style.js +1 -1
- package/build/renderer/screens/credit-spending-methods-screen/index.js +1 -1
- package/build/renderer/screens/credit-spending-methods-screen/style.d.ts +3 -1
- package/build/renderer/screens/credit-spending-methods-screen/style.js +1 -1
- package/build/renderer/screens/gift-product-selection-screen/index.d.ts +9 -0
- package/build/renderer/screens/gift-product-selection-screen/index.js +1 -0
- package/build/renderer/screens/gift-product-selection-screen/style.d.ts +22 -0
- package/build/renderer/screens/gift-product-selection-screen/style.js +1 -0
- package/build/renderer/screens/loyalty-level-screen/index.js +1 -1
- package/build/renderer/screens/loyalty-level-screen/style.d.ts +17 -4
- package/build/renderer/screens/loyalty-level-screen/style.js +1 -1
- package/build/renderer/screens/main-screen/applied-discount/index.d.ts +9 -0
- package/build/renderer/screens/main-screen/applied-discount/index.js +1 -0
- package/build/renderer/screens/main-screen/applied-discount/style.d.ts +14 -0
- package/build/renderer/screens/main-screen/applied-discount/style.js +1 -0
- package/build/renderer/screens/main-screen/cart-warning/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/cart-warning/index.js +1 -0
- package/build/renderer/screens/main-screen/cart-warning/style.d.ts +5 -0
- package/build/renderer/screens/main-screen/cart-warning/style.js +1 -0
- package/build/renderer/screens/main-screen/earning-methods-section/index.d.ts +1 -0
- package/build/renderer/screens/main-screen/earning-methods-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/auth-user-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/index.js +1 -1
- package/build/renderer/screens/main-screen/header/logo-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/logo-section/style.d.ts +3 -1
- package/build/renderer/screens/main-screen/header/logo-section/style.js +1 -1
- package/build/renderer/screens/main-screen/header/style.d.ts +11 -5
- package/build/renderer/screens/main-screen/header/style.js +1 -1
- package/build/renderer/screens/main-screen/header/title-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/title-section/style.js +1 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/style.d.ts +4 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/style.js +1 -1
- package/build/renderer/screens/main-screen/index.js +1 -1
- package/build/renderer/screens/main-screen/program-info-section/index.js +1 -1
- package/build/renderer/screens/main-screen/program-info-section/style.d.ts +12 -4
- package/build/renderer/screens/main-screen/program-info-section/style.js +1 -1
- package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.js +1 -1
- package/build/renderer/screens/main-screen/spending-methods-section/index.d.ts +1 -0
- package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -1
- package/build/renderer/screens/main-screen/style.js +1 -1
- package/build/renderer/style.d.ts +19 -3
- package/build/renderer/style.js +1 -1
- package/build/renderer/utils/i18n.d.ts +17 -0
- package/build/renderer/utils/i18n.js +1 -1
- package/build/renderer/utils/locales/de.json.js +1 -0
- package/build/renderer/utils/locales/en.json.js +1 -1
- package/build/renderer/utils/locales/fr.json.js +1 -0
- package/build/renderer/utils/locales/nl.json.js +1 -0
- package/build/renderer/utils/locales/tr.json.js +1 -1
- package/build/renderer/utils/loyalty-details.d.ts +8 -0
- package/build/renderer/utils/loyalty-details.js +1 -1
- package/build/renderer/utils/object-utils.d.ts +2 -0
- package/build/renderer/utils/object-utils.js +1 -0
- package/build/renderer/utils/spending-method-utils.d.ts +20 -0
- package/build/renderer/utils/spending-method-utils.js +1 -0
- package/build/storefront-widget-script-injector.iife.js +68 -0
- package/build/storefront-widget-script-injector.iife.js.map +1 -0
- package/build/utils.d.ts +41 -4
- package/build/utils.js +1 -1
- package/package.json +23 -11
- package/build/_virtual/index.js +0 -1
- package/build/_virtual/use-sync-external-store-shim.development.js +0 -1
- package/build/_virtual/use-sync-external-store-shim.production.js +0 -1
- package/build/ext/mobx/dist/mobx.esm.js +0 -1
- package/build/ext/mobx-react/dist/mobxreact.esm.js +0 -1
- package/build/ext/mobx-react-lite/es/ObserverComponent.js +0 -1
- package/build/ext/mobx-react-lite/es/index.js +0 -1
- package/build/ext/mobx-react-lite/es/observer.js +0 -1
- package/build/ext/mobx-react-lite/es/useAsObservableSource.js +0 -1
- package/build/ext/mobx-react-lite/es/useObserver.js +0 -1
- package/build/ext/mobx-react-lite/es/utils/UniversalFinalizationRegistry.js +0 -1
- package/build/ext/mobx-react-lite/es/utils/assertEnvironment.js +0 -1
- package/build/ext/mobx-react-lite/es/utils/observerBatching.js +0 -1
- package/build/ext/mobx-react-lite/es/utils/observerFinalizationRegistry.js +0 -1
- package/build/ext/mobx-react-lite/es/utils/printDebugValue.js +0 -1
- package/build/ext/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js +0 -1
- package/build/ext/react-i18next/dist/es/defaults.js +0 -1
- package/build/ext/react-i18next/dist/es/i18nInstance.js +0 -1
- package/build/ext/react-i18next/dist/es/initReactI18next.js +0 -1
- package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -10
- package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -10
- package/build/ext/use-sync-external-store/shim/index.js +0 -1
- package/build/models/base.d.ts +0 -4
- package/build/models/base.js +0 -1
- package/build/models/category/index.d.ts +0 -5
- package/build/models/loyalty-widget/header-background/index.d.ts +0 -9
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LoyaltyProgramFilterTypeEnum, PeriodTypeEnum } from "../types";
|
|
2
|
+
export declare class LoyaltyProgramPointLimit {
|
|
3
|
+
maxPointLimit: number | null;
|
|
4
|
+
minPointLimit: number | null;
|
|
5
|
+
constructor(data?: Partial<LoyaltyProgramPointLimit>);
|
|
6
|
+
}
|
|
7
|
+
export declare class LoyaltyProgramFilter {
|
|
8
|
+
type: LoyaltyProgramFilterTypeEnum;
|
|
9
|
+
idList: string[];
|
|
10
|
+
constructor(data?: Partial<LoyaltyProgramFilter>);
|
|
11
|
+
}
|
|
12
|
+
export declare class LoyaltyProgramMethodTranslation {
|
|
13
|
+
description: string;
|
|
14
|
+
locale: string;
|
|
15
|
+
constructor(data?: Partial<LoyaltyProgramMethodTranslation>);
|
|
16
|
+
}
|
|
17
|
+
export declare class LoyaltyProgramPeriod {
|
|
18
|
+
period: string | null;
|
|
19
|
+
periodType: PeriodTypeEnum | null;
|
|
20
|
+
constructor(data?: Partial<LoyaltyProgramPeriod>);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeObservable as i,observable as t}from"mobx";import{LoyaltyProgramFilterTypeEnum as o}from"../types/index.js";var n=function(o){void 0===o&&(o={}),this.maxPointLimit=o.maxPointLimit||null,this.minPointLimit=o.minPointLimit||null,i(this,{maxPointLimit:t,minPointLimit:t})},e=function(n){void 0===n&&(n={}),this.type=n.type||o.CATEGORY,this.idList=n.idList||[],i(this,{type:t,idList:t})},s=function(o){void 0===o&&(o={}),this.description=o.description||"",this.locale=o.locale||"",i(this,{description:t,locale:t})},p=function(o){void 0===o&&(o={}),this.period=o.period||null,this.periodType=o.periodType||null,i(this,{period:t,periodType:t})};export{e as LoyaltyProgramFilter,s as LoyaltyProgramMethodTranslation,p as LoyaltyProgramPeriod,n as LoyaltyProgramPointLimit};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { BaseModel } from "models/base";
|
|
2
1
|
import { ImageTypeEnum } from "models/loyalty-widget/types";
|
|
3
2
|
export declare const IMAGE_SIZE = 1080;
|
|
4
|
-
export declare class LoyaltyWidgetImage
|
|
3
|
+
export declare class LoyaltyWidgetImage {
|
|
5
4
|
link: string | null;
|
|
6
5
|
cdnURL: string | null;
|
|
7
6
|
merchantId: string | null;
|
|
8
7
|
imageId: string | null;
|
|
9
8
|
type: ImageTypeEnum;
|
|
9
|
+
maxHeight: number;
|
|
10
10
|
constructor(data: Partial<LoyaltyWidgetImage>);
|
|
11
11
|
get src(): string | undefined;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{makeObservable as t,observable as i,computed as e}from"mobx";import{ImageTypeEnum as n}from"../loyalty-widget/types/index.js";var a=1080,c=function(){function a(a){var c;this.imageId=a.imageId||null,this.link=a.link||null,this.cdnURL=a.cdnURL||null,this.merchantId=a.merchantId||null,this.type=a.type||n.SHOW,this.maxHeight=null!==(c=a.maxHeight)&&void 0!==c?c:50,t(this,{imageId:i,link:i,cdnURL:i,merchantId:i,type:i,maxHeight:i,src:e})}return Object.defineProperty(a.prototype,"src",{get:function(){if(this.imageId)return"".concat(this.cdnURL,"images/").concat(this.merchantId,"/").concat(this.imageId,"/image_").concat(1080,".webp")},enumerable:!1,configurable:!0}),a}();export{a as IMAGE_SIZE,c as LoyaltyWidgetImage};
|
package/build/models/index.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LoyaltyWidgetCallbacks, LoyaltyWidgetScreenTypeEnum, Category, Product, Brand, Tag, LoyaltyProgramTier } from "./types";
|
|
3
|
-
import { LoyaltyProgramSpendingMethod } from "./loyalty-program-spending-method";
|
|
1
|
+
import { LoyaltyCustomerInfo, LoyaltyProgramTier } from "./loyalty-customer-info";
|
|
4
2
|
import { LoyaltyProgramEarningMethod } from "./loyalty-program-earning-method";
|
|
5
|
-
import { LoyaltyCustomerInfo } from "./loyalty-customer-info";
|
|
6
3
|
import { LoyaltyProgramPointHistory } from "./loyalty-program-point-history";
|
|
4
|
+
import { LoyaltyProgramSpendingMethod } from "./loyalty-program-spending-method";
|
|
5
|
+
import { LoyaltyWidget } from "./loyalty-widget";
|
|
6
|
+
import { Brand, Category, LoyaltyWidgetCallbacks, LoyaltyWidgetScreenTypeEnum, Product, Tag, WidgetMode } from "./types";
|
|
7
7
|
export declare class LoyaltyWidgetViewModel {
|
|
8
|
-
|
|
8
|
+
navigationStack: LoyaltyWidgetScreenTypeEnum[];
|
|
9
|
+
currentWidgetMode: WidgetMode;
|
|
10
|
+
isMiniModeDescriptionClosed: boolean;
|
|
9
11
|
isLoading: boolean;
|
|
12
|
+
isActionLoading: boolean;
|
|
10
13
|
loyaltyWidget: LoyaltyWidget;
|
|
14
|
+
userRefreshTrigger: number;
|
|
15
|
+
cartRefreshTrigger: number;
|
|
11
16
|
cartId?: string | null;
|
|
17
|
+
ikasEventUser: any | null;
|
|
12
18
|
cdnURL: string;
|
|
13
19
|
merchantId: string;
|
|
14
20
|
storeUrl: string;
|
|
15
21
|
currency: string;
|
|
16
|
-
|
|
22
|
+
isPreviewMode: boolean;
|
|
17
23
|
user: LoyaltyCustomerInfo | null;
|
|
18
24
|
categories: Category[] | null;
|
|
19
25
|
products: Product[];
|
|
@@ -24,5 +30,14 @@ export declare class LoyaltyWidgetViewModel {
|
|
|
24
30
|
tiers: LoyaltyProgramTier[];
|
|
25
31
|
pointHistory: LoyaltyProgramPointHistory[];
|
|
26
32
|
callbacks?: LoyaltyWidgetCallbacks;
|
|
27
|
-
constructor(data: Partial<LoyaltyWidgetViewModel> | undefined, cdnURL: string, merchantId: string, currency: string,
|
|
33
|
+
constructor(data: Partial<LoyaltyWidgetViewModel> | undefined, cdnURL: string, merchantId: string, currency: string, storeURL?: string | null, isPreviewMode?: boolean, callbacks?: LoyaltyWidgetCallbacks);
|
|
34
|
+
get currentScreen(): LoyaltyWidgetScreenTypeEnum;
|
|
35
|
+
get isMainScreen(): boolean;
|
|
36
|
+
pushScreen(screen: LoyaltyWidgetScreenTypeEnum): void;
|
|
37
|
+
popScreen(): void;
|
|
38
|
+
resetNavigation(): void;
|
|
39
|
+
get shouldShowSpendingMethods(): boolean;
|
|
40
|
+
setWidgetMode(mode: WidgetMode): void;
|
|
41
|
+
closeMiniModeDescription(): void;
|
|
42
|
+
formatCurrency(price: number): string;
|
|
28
43
|
}
|
package/build/models/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__assign as t}from'./../ext/tslib/tslib.es6.mjs.js';import{makeObservable as i,observable as e,computed as o,action as n}from"mobx";import{markDescriptionClosedForSession as r,markDescriptionPermanentlyClosed as s,isDescriptionClosedForCurrentSession as d,isDescriptionPermanentlyClosed as a}from"../utils.js";import{LoyaltyCustomerInfo as c}from"./loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as h}from"./loyalty-program-earning-method/index.js";import{LoyaltyProgramSpendingMethod as u}from"./loyalty-program-spending-method/index.js";import{LoyaltyWidget as p}from"./loyalty-widget/index.js";import{LoyaltyWidgetScreenTypeEnum as g,WidgetMode as l}from"./types/index.js";var y=function(){function y(r,s,y,M,f,m,v){void 0===r&&(r={}),this.userRefreshTrigger=0,this.cartRefreshTrigger=0,this.navigationStack=[g.MAIN_SCREEN],this.currentWidgetMode=m?l.WIDGET_MODE:l.MINI_MODE,this.isMiniModeDescriptionClosed=d()||a(),this.isLoading=r.isLoading||!1,this.isActionLoading=r.isActionLoading||!1,this.loyaltyWidget=new p(r.loyaltyWidget),this.cdnURL=s,this.merchantId=y,this.storeUrl=f||r.storeUrl||"",this.currency=M,this.isPreviewMode=m||!1,this.cartId=r.cartId||null,this.ikasEventUser=r.ikasEventUser||null,this.user=r.user?new c(r.user):null,this.earningMethods=r.earningMethods?r.earningMethods.map(function(t){return new h(t)}):[],this.spendingMethods=r.spendingMethods?r.spendingMethods.map(function(t){return new u(t)}):[],this.tiers=r.tiers?r.tiers:[],this.categories=r.categories?r.categories:[],this.products=r.products?r.products:[],this.brands=r.brands?r.brands:[],this.tags=r.tags?r.tags:[],this.pointHistory=r.pointHistory?r.pointHistory:[],this.callbacks=v||void 0,i(this,t(t({cartId:e},m?{}:{loyaltyWidget:e}),{isLoading:e,isActionLoading:e,cdnURL:e,merchantId:e,storeUrl:e,currency:e,navigationStack:e,currentScreen:o,isMainScreen:o,pushScreen:n.bound,popScreen:n.bound,resetNavigation:n.bound,setWidgetMode:n.bound,closeMiniModeDescription:n.bound,formatCurrency:n.bound,currentWidgetMode:e,isMiniModeDescriptionClosed:e,user:e,earningMethods:e,spendingMethods:e,tiers:e,categories:e,products:e,brands:e,tags:e,pointHistory:e,ikasEventUser:e,userRefreshTrigger:e,cartRefreshTrigger:e,shouldShowSpendingMethods:o}))}return Object.defineProperty(y.prototype,"currentScreen",{get:function(){return this.navigationStack[this.navigationStack.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isMainScreen",{get:function(){return this.currentScreen===g.MAIN_SCREEN},enumerable:!1,configurable:!0}),y.prototype.pushScreen=function(t){this.currentScreen!==t&&this.navigationStack.push(t)},y.prototype.popScreen=function(){this.navigationStack.length>1&&this.navigationStack.pop()},y.prototype.resetNavigation=function(){this.navigationStack=[g.MAIN_SCREEN]},Object.defineProperty(y.prototype,"shouldShowSpendingMethods",{get:function(){return!!this.user&&(!(this.user.totalPoint<=0)&&0!==this.spendingMethods.length)},enumerable:!1,configurable:!0}),y.prototype.setWidgetMode=function(t){var i,e;this.currentWidgetMode=t,t!==l.WIDGET_MODE||this.isPreviewMode||(this.isMiniModeDescriptionClosed=!0,r(),(null===(e=null===(i=this.loyaltyWidget)||void 0===i?void 0:i.miniMode)||void 0===e?void 0:e.hideDescriptionAfterClose)&&s())},y.prototype.closeMiniModeDescription=function(){var t,i;this.isMiniModeDescriptionClosed=!0,r(),(null===(i=null===(t=this.loyaltyWidget)||void 0===t?void 0:t.miniMode)||void 0===i?void 0:i.hideDescriptionAfterClose)&&s()},y.prototype.formatCurrency=function(t){var i;return(null===(i=this.callbacks)||void 0===i?void 0:i.formatCurrency)?this.callbacks.formatCurrency(t):"".concat(t.toFixed(2)," ").concat(this.currency)},y}();export{y as LoyaltyWidgetViewModel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LoyaltyProgramPeriod } from "../
|
|
1
|
+
import { LoyaltyProgramPeriod } from "../common";
|
|
2
2
|
export declare class LoyaltyProgramTierTranslation {
|
|
3
3
|
locale: string;
|
|
4
4
|
name: string;
|
|
@@ -7,22 +7,43 @@ export declare class LoyaltyProgramTierTranslation {
|
|
|
7
7
|
export declare class LoyaltyProgramTier {
|
|
8
8
|
id: string;
|
|
9
9
|
name: string;
|
|
10
|
-
pointsRequired: number;
|
|
11
|
-
tierPointMultiplier: number;
|
|
10
|
+
pointsRequired: number | null;
|
|
11
|
+
tierPointMultiplier: number | null;
|
|
12
12
|
loyaltyProgramId: string;
|
|
13
|
-
customerSegmentId: string;
|
|
14
|
-
createdAt:
|
|
15
|
-
updatedAt:
|
|
13
|
+
customerSegmentId: string | null;
|
|
14
|
+
createdAt: any | null;
|
|
15
|
+
updatedAt: any | null;
|
|
16
16
|
deleted: boolean;
|
|
17
17
|
isActive: boolean;
|
|
18
18
|
period: LoyaltyProgramPeriod | null;
|
|
19
|
-
translations: LoyaltyProgramTierTranslation[];
|
|
19
|
+
translations: LoyaltyProgramTierTranslation[] | null;
|
|
20
20
|
constructor(data?: Partial<LoyaltyProgramTier>);
|
|
21
21
|
}
|
|
22
|
+
export declare class CartLoyaltyLineData {
|
|
23
|
+
campaignType: CampaignTypeEnum | null;
|
|
24
|
+
discountAmount: number;
|
|
25
|
+
discountAmountType: OrderAmountTypeEnum;
|
|
26
|
+
discountPercentage: number | null;
|
|
27
|
+
loyaltySpendingMethodId: string;
|
|
28
|
+
pointUsed: number;
|
|
29
|
+
constructor(data?: Partial<CartLoyaltyLineData>);
|
|
30
|
+
}
|
|
22
31
|
export declare class LoyaltyCustomerInfo {
|
|
23
|
-
|
|
32
|
+
customerTier: LoyaltyProgramTier | null;
|
|
24
33
|
loyaltyProgramCustomerId: string;
|
|
25
34
|
loyaltyProgramId: string;
|
|
26
35
|
totalPoint: number;
|
|
36
|
+
nextTierRequiredPoint: number | null;
|
|
37
|
+
cartLoyaltyLines: CartLoyaltyLineData[] | null;
|
|
27
38
|
constructor(data?: Partial<LoyaltyCustomerInfo>);
|
|
28
39
|
}
|
|
40
|
+
export declare enum CampaignTypeEnum {
|
|
41
|
+
BUY_X_THEN_GET_Y = "BUY_X_THEN_GET_Y",
|
|
42
|
+
FIXED_AMOUNT = "FIXED_AMOUNT",
|
|
43
|
+
FREE_SHIPPING = "FREE_SHIPPING",
|
|
44
|
+
RATIO = "RATIO"
|
|
45
|
+
}
|
|
46
|
+
export declare enum OrderAmountTypeEnum {
|
|
47
|
+
AMOUNT = "AMOUNT",
|
|
48
|
+
RATIO = "RATIO"
|
|
49
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as e}from
|
|
1
|
+
import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPeriod as i}from"../common/index.js";var n,o,r=function(i){void 0===i&&(i={}),this.locale=i.locale||"",this.name=i.name||"",t(this,{locale:e,name:e})},l=function(n){void 0===n&&(n={}),this.id=n.id||"",this.name=n.name||"",this.pointsRequired=n.pointsRequired||null,this.tierPointMultiplier=n.tierPointMultiplier||null,this.loyaltyProgramId=n.loyaltyProgramId||"",this.customerSegmentId=n.customerSegmentId||null,this.createdAt=n.createdAt||null,this.updatedAt=n.updatedAt||null,this.deleted=n.deleted||!1,this.isActive=n.isActive||!1,this.period=n.period?new i(n.period):null,this.translations=n.translations?n.translations.map(function(t){return new r(t)}):null,t(this,{id:e,name:e,pointsRequired:e,tierPointMultiplier:e,loyaltyProgramId:e,customerSegmentId:e,createdAt:e,updatedAt:e,deleted:e,isActive:e,period:e,translations:e})},s=function(i){void 0===i&&(i={}),this.campaignType=i.campaignType||null,this.discountAmount=i.discountAmount||0,this.discountAmountType=i.discountAmountType||o.AMOUNT,this.discountPercentage=void 0!==i.discountPercentage&&null!==i.discountPercentage?i.discountPercentage:null,this.loyaltySpendingMethodId=i.loyaltySpendingMethodId||"",this.pointUsed=i.pointUsed||0,t(this,{campaignType:e,discountAmount:e,discountAmountType:e,discountPercentage:e,loyaltySpendingMethodId:e,pointUsed:e})},d=function(i){void 0===i&&(i={}),this.customerTier=i.customerTier?new l(i.customerTier):null,this.loyaltyProgramCustomerId=i.loyaltyProgramCustomerId||"",this.loyaltyProgramId=i.loyaltyProgramId||"",this.totalPoint=i.totalPoint||0,this.nextTierRequiredPoint=void 0!==i.nextTierRequiredPoint&&null!==i.nextTierRequiredPoint?i.nextTierRequiredPoint:null,this.cartLoyaltyLines=i.cartLoyaltyLines?i.cartLoyaltyLines.map(function(t){return new s(t)}):null,t(this,{customerTier:e,loyaltyProgramCustomerId:e,loyaltyProgramId:e,totalPoint:e,nextTierRequiredPoint:e,cartLoyaltyLines:e})};!function(t){t.BUY_X_THEN_GET_Y="BUY_X_THEN_GET_Y",t.FIXED_AMOUNT="FIXED_AMOUNT",t.FREE_SHIPPING="FREE_SHIPPING",t.RATIO="RATIO"}(n||(n={})),function(t){t.AMOUNT="AMOUNT",t.RATIO="RATIO"}(o||(o={}));export{n as CampaignTypeEnum,s as CartLoyaltyLineData,d as LoyaltyCustomerInfo,l as LoyaltyProgramTier,r as LoyaltyProgramTierTranslation,o as OrderAmountTypeEnum};
|
|
@@ -1,51 +1,37 @@
|
|
|
1
|
-
import { EarningMethodTypeEnum, LoyaltyProgramPointEarningTypeEnum
|
|
2
|
-
|
|
3
|
-
maxPointLimit: number;
|
|
4
|
-
minPointLimit: number;
|
|
5
|
-
constructor(data?: Partial<LoyaltyProgramPointLimit>);
|
|
6
|
-
}
|
|
7
|
-
export declare class LoyaltyProgramFilter {
|
|
8
|
-
type: LoyaltyProgramFilterTypeEnum;
|
|
9
|
-
idList: string[];
|
|
10
|
-
constructor(data?: Partial<LoyaltyProgramFilter>);
|
|
11
|
-
}
|
|
1
|
+
import { EarningMethodTypeEnum, LoyaltyProgramPointEarningTypeEnum } from "../types";
|
|
2
|
+
import { LoyaltyProgramPointLimit, LoyaltyProgramFilter, LoyaltyProgramMethodTranslation, LoyaltyProgramPeriod } from "../common";
|
|
12
3
|
export declare class LoyaltyProgramEarningMethodOrderSettings {
|
|
13
|
-
maxOrderAmount: number;
|
|
4
|
+
maxOrderAmount: number | null;
|
|
14
5
|
minOrderAmount: number;
|
|
15
|
-
productFilters: LoyaltyProgramFilter[];
|
|
6
|
+
productFilters: LoyaltyProgramFilter[] | null;
|
|
16
7
|
constructor(data?: Partial<LoyaltyProgramEarningMethodOrderSettings>);
|
|
17
8
|
}
|
|
18
9
|
export declare class LoyaltyProgramEarningMethodProductSettings {
|
|
19
|
-
maxProductQuantity: number;
|
|
20
|
-
minProductQuantity: number;
|
|
21
|
-
productFilters: LoyaltyProgramFilter[];
|
|
10
|
+
maxProductQuantity: number | null;
|
|
11
|
+
minProductQuantity: number | null;
|
|
12
|
+
productFilters: LoyaltyProgramFilter[] | null;
|
|
22
13
|
constructor(data?: Partial<LoyaltyProgramEarningMethodProductSettings>);
|
|
23
14
|
}
|
|
24
|
-
export declare class LoyaltyProgramMethodTranslation {
|
|
25
|
-
description: string;
|
|
26
|
-
locale: string;
|
|
27
|
-
constructor(data?: Partial<LoyaltyProgramMethodTranslation>);
|
|
28
|
-
}
|
|
29
15
|
export declare class LoyaltyProgramEarningMethod {
|
|
30
|
-
amountPerPointsEarned: number;
|
|
31
|
-
createdAt:
|
|
16
|
+
amountPerPointsEarned: number | null;
|
|
17
|
+
createdAt: any | null;
|
|
32
18
|
deleted: boolean;
|
|
33
|
-
description: string;
|
|
19
|
+
description: string | null;
|
|
34
20
|
earnedPointLimit: LoyaltyProgramPointLimit | null;
|
|
35
21
|
id: string;
|
|
36
22
|
isActive: boolean;
|
|
37
|
-
lastValidityDate:
|
|
23
|
+
lastValidityDate: any | null;
|
|
38
24
|
loyaltyProgramId: string;
|
|
39
25
|
methodType: EarningMethodTypeEnum;
|
|
40
26
|
orderSettings: LoyaltyProgramEarningMethodOrderSettings | null;
|
|
41
27
|
pointEarningType: LoyaltyProgramPointEarningTypeEnum;
|
|
42
28
|
pointsEarned: number;
|
|
43
29
|
productSettings: LoyaltyProgramEarningMethodProductSettings | null;
|
|
44
|
-
quantityPerPointsEarned: number;
|
|
45
|
-
segmentId: string;
|
|
46
|
-
tierIds: string[];
|
|
47
|
-
translations: LoyaltyProgramMethodTranslation[];
|
|
48
|
-
updatedAt:
|
|
30
|
+
quantityPerPointsEarned: number | null;
|
|
31
|
+
segmentId: string | null;
|
|
32
|
+
tierIds: string[] | null;
|
|
33
|
+
translations: LoyaltyProgramMethodTranslation[] | null;
|
|
34
|
+
updatedAt: any | null;
|
|
49
35
|
validityPeriod: LoyaltyProgramPeriod | null;
|
|
50
36
|
constructor(data?: Partial<LoyaltyProgramEarningMethod>);
|
|
51
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as i}from
|
|
1
|
+
import{makeObservable as t,observable as i}from"mobx";import{EarningMethodTypeEnum as n,LoyaltyProgramPointEarningTypeEnum as e}from"../types/index.js";import{LoyaltyProgramFilter as r,LoyaltyProgramPointLimit as d,LoyaltyProgramMethodTranslation as o,LoyaltyProgramPeriod as s}from"../common/index.js";var a=function(n){void 0===n&&(n={}),this.maxOrderAmount=n.maxOrderAmount||null,this.minOrderAmount=n.minOrderAmount||0,this.productFilters=n.productFilters?n.productFilters.map(function(t){return new r(t)}):null,t(this,{maxOrderAmount:i,minOrderAmount:i,productFilters:i})},l=function(n){void 0===n&&(n={}),this.maxProductQuantity=n.maxProductQuantity||null,this.minProductQuantity=n.minProductQuantity||null,this.productFilters=n.productFilters?n.productFilters.map(function(t){return new r(t)}):null,t(this,{maxProductQuantity:i,minProductQuantity:i,productFilters:i})},u=function(r){void 0===r&&(r={}),this.amountPerPointsEarned=r.amountPerPointsEarned||null,this.createdAt=r.createdAt||null,this.deleted=r.deleted||!1,this.description=r.description||null,this.earnedPointLimit=r.earnedPointLimit?new d(r.earnedPointLimit):null,this.id=r.id||"",this.isActive=r.isActive||!1,this.lastValidityDate=r.lastValidityDate||null,this.loyaltyProgramId=r.loyaltyProgramId||"",this.methodType=r.methodType||n.ORDER_CREATE,this.orderSettings=r.orderSettings?new a(r.orderSettings):null,this.pointEarningType=r.pointEarningType||e.STATIC,this.pointsEarned=r.pointsEarned||0,this.productSettings=r.productSettings?new l(r.productSettings):null,this.quantityPerPointsEarned=r.quantityPerPointsEarned||null,this.segmentId=r.segmentId||null,this.tierIds=r.tierIds||null,this.translations=r.translations?r.translations.map(function(t){return new o(t)}):null,this.updatedAt=r.updatedAt||null,this.validityPeriod=r.validityPeriod?new s(r.validityPeriod):null,t(this,{amountPerPointsEarned:i,createdAt:i,deleted:i,description:i,earnedPointLimit:i,id:i,isActive:i,lastValidityDate:i,loyaltyProgramId:i,methodType:i,orderSettings:i,pointEarningType:i,pointsEarned:i,productSettings:i,quantityPerPointsEarned:i,segmentId:i,tierIds:i,translations:i,updatedAt:i,validityPeriod:i})};export{u as LoyaltyProgramEarningMethod,a as LoyaltyProgramEarningMethodOrderSettings,l as LoyaltyProgramEarningMethodProductSettings};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { LoyaltyProgramPointHistoryTypeEnum } from "../types";
|
|
2
2
|
export declare class LoyaltyProgramPointHistory {
|
|
3
3
|
amount: number;
|
|
4
|
-
createdAt:
|
|
4
|
+
createdAt: any | null;
|
|
5
5
|
customerId: string;
|
|
6
|
+
customerReviewId: string | null;
|
|
6
7
|
deleted: boolean;
|
|
7
|
-
expireDate:
|
|
8
|
+
expireDate: any | null;
|
|
8
9
|
id: string;
|
|
9
10
|
loyaltyProgramCustomerId: string;
|
|
10
11
|
loyaltyProgramEarningMethodId: string | null;
|
|
@@ -12,6 +13,7 @@ export declare class LoyaltyProgramPointHistory {
|
|
|
12
13
|
loyaltyProgramSpendingMethodId: string | null;
|
|
13
14
|
orderId: string | null;
|
|
14
15
|
type: LoyaltyProgramPointHistoryTypeEnum;
|
|
15
|
-
|
|
16
|
+
productVariantId: string | null;
|
|
17
|
+
updatedAt: any | null;
|
|
16
18
|
constructor(data?: Partial<LoyaltyProgramPointHistory>);
|
|
17
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as e}from
|
|
1
|
+
import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPointHistoryTypeEnum as r}from"../types/index.js";var d=function(d){void 0===d&&(d={}),this.amount=d.amount||0,this.createdAt=d.createdAt||null,this.customerId=d.customerId||"",this.customerReviewId=d.customerReviewId||null,this.deleted=d.deleted||!1,this.expireDate=d.expireDate||null,this.id=d.id||"",this.loyaltyProgramCustomerId=d.loyaltyProgramCustomerId||"",this.loyaltyProgramEarningMethodId=d.loyaltyProgramEarningMethodId||null,this.loyaltyProgramId=d.loyaltyProgramId||"",this.loyaltyProgramSpendingMethodId=d.loyaltyProgramSpendingMethodId||null,this.orderId=d.orderId||null,this.type=d.type||r.EARN,this.productVariantId=d.productVariantId||null,this.updatedAt=d.updatedAt||null,t(this,{amount:e,createdAt:e,customerId:e,customerReviewId:e,deleted:e,expireDate:e,id:e,loyaltyProgramCustomerId:e,loyaltyProgramEarningMethodId:e,loyaltyProgramId:e,loyaltyProgramSpendingMethodId:e,orderId:e,type:e,productVariantId:e,updatedAt:e})};export{d as LoyaltyProgramPointHistory};
|
|
@@ -1,38 +1,26 @@
|
|
|
1
|
-
import { LoyaltyProgramMethodSpendingTypeEnum
|
|
2
|
-
|
|
3
|
-
maxPointLimit: number | null;
|
|
4
|
-
minPointLimit: number | null;
|
|
5
|
-
constructor(data?: Partial<LoyaltyProgramPointLimit>);
|
|
6
|
-
}
|
|
7
|
-
export declare class LoyaltyProgramFilter {
|
|
8
|
-
idList: string[];
|
|
9
|
-
type: LoyaltyProgramFilterTypeEnum;
|
|
10
|
-
constructor(data?: Partial<LoyaltyProgramFilter>);
|
|
11
|
-
}
|
|
1
|
+
import { LoyaltyProgramMethodSpendingTypeEnum } from "../types";
|
|
2
|
+
import { LoyaltyProgramPointLimit, LoyaltyProgramFilter, LoyaltyProgramMethodTranslation } from "../common";
|
|
12
3
|
export declare class LoyaltyProgramDiscountSettings {
|
|
13
4
|
discountAmount: number | null;
|
|
14
5
|
freeProductId: string | null;
|
|
6
|
+
freeProductVariantId: string | null;
|
|
15
7
|
point: number;
|
|
16
8
|
constructor(data?: Partial<LoyaltyProgramDiscountSettings>);
|
|
17
9
|
}
|
|
18
|
-
export declare class LoyaltyProgramMethodTranslation {
|
|
19
|
-
description: string | null;
|
|
20
|
-
locale: string | null;
|
|
21
|
-
constructor(data?: Partial<LoyaltyProgramMethodTranslation>);
|
|
22
|
-
}
|
|
23
10
|
export declare class LoyaltyProgramSpendingMethod {
|
|
24
|
-
createdAt:
|
|
11
|
+
createdAt: any | null;
|
|
25
12
|
deleted: boolean;
|
|
26
13
|
description: string | null;
|
|
27
14
|
discountSettings: LoyaltyProgramDiscountSettings | null;
|
|
28
15
|
id: string;
|
|
29
16
|
isActive: boolean;
|
|
17
|
+
isAvailable: boolean | null;
|
|
30
18
|
isDynamic: boolean;
|
|
31
19
|
loyaltyProgramId: string;
|
|
32
20
|
pointUsageLimit: LoyaltyProgramPointLimit | null;
|
|
33
|
-
productFilters: LoyaltyProgramFilter[];
|
|
34
|
-
translations: LoyaltyProgramMethodTranslation[];
|
|
21
|
+
productFilters: LoyaltyProgramFilter[] | null;
|
|
22
|
+
translations: LoyaltyProgramMethodTranslation[] | null;
|
|
35
23
|
type: LoyaltyProgramMethodSpendingTypeEnum;
|
|
36
|
-
updatedAt:
|
|
24
|
+
updatedAt: any | null;
|
|
37
25
|
constructor(data?: Partial<LoyaltyProgramSpendingMethod>);
|
|
38
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as i}from
|
|
1
|
+
import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramMethodSpendingTypeEnum as n}from"../types/index.js";import{LoyaltyProgramPointLimit as e,LoyaltyProgramFilter as s,LoyaltyProgramMethodTranslation as o}from"../common/index.js";var d=function(n){void 0===n&&(n={}),this.discountAmount=n.discountAmount||null,this.freeProductId=n.freeProductId||null,this.freeProductVariantId=n.freeProductVariantId||null,this.point=n.point||0,t(this,{discountAmount:i,freeProductId:i,freeProductVariantId:i,point:i})},l=function(l){void 0===l&&(l={}),this.createdAt=l.createdAt||null,this.deleted=l.deleted||!1,this.description=l.description||null,this.discountSettings=l.discountSettings?new d(l.discountSettings):null,this.id=l.id||"",this.isActive=l.isActive||!1,this.isAvailable=void 0!==l.isAvailable&&null!==l.isAvailable?l.isAvailable:null,this.isDynamic=l.isDynamic||!1,this.loyaltyProgramId=l.loyaltyProgramId||"",this.pointUsageLimit=l.pointUsageLimit?new e(l.pointUsageLimit):null,this.productFilters=l.productFilters?l.productFilters.map(function(t){return new s(t)}):null,this.translations=l.translations?l.translations.map(function(t){return new o(t)}):null,this.type=l.type||n.FIXED_AMOUNT,this.updatedAt=l.updatedAt||null,t(this,{createdAt:i,deleted:i,description:i,discountSettings:i,id:i,isActive:i,isAvailable:i,isDynamic:i,loyaltyProgramId:i,pointUsageLimit:i,productFilters:i,translations:i,type:i,updatedAt:i})};export{d as LoyaltyProgramDiscountSettings,l as LoyaltyProgramSpendingMethod};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BaseModel } from "models/base";
|
|
2
1
|
import { LoyaltyWidgetImage } from "models/image";
|
|
3
2
|
import { HeaderBackgroundTypeEnum } from "../../types";
|
|
4
|
-
export declare class LoyaltyWidgetHeaderBackground
|
|
3
|
+
export declare class LoyaltyWidgetHeaderBackground {
|
|
5
4
|
bgColor: string | null;
|
|
5
|
+
progressBarContainerColor: string | null;
|
|
6
6
|
image: LoyaltyWidgetImage | null;
|
|
7
7
|
type: HeaderBackgroundTypeEnum;
|
|
8
8
|
constructor(data: Partial<LoyaltyWidgetHeaderBackground>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{makeObservable as o,observable as r}from"mobx";import{LoyaltyWidgetImage as e}from"../../../image/index.js";import{HeaderBackgroundTypeEnum as i}from"../../types/index.js";var t=function(t){this.bgColor=t.bgColor||null,this.image=t.image?new e(t.image):null,this.type=t.type||i.COLOR,this.progressBarContainerColor=t.progressBarContainerColor||"#eef2f6",o(this,{bgColor:r,image:r,type:r,progressBarContainerColor:r})};export{t as LoyaltyWidgetHeaderBackground};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as o,observable as r}from
|
|
1
|
+
import{makeObservable as o,observable as r}from"mobx";import{LoyaltyWidgetImage as n}from"../../image/index.js";import{LoyaltyWidgetHeaderBackground as t}from"./header-background/index.js";var e=function(e){var i;void 0===e&&(e={}),this.logo=e.logo?new n(e.logo):new n({}),this.background=e.background?new t(e.background):new t({}),this.textColor=null!==(i=e.textColor)&&void 0!==i?i:null,o(this,{logo:r,background:r,textColor:r})};export{e as LoyaltyWidgetHeader};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiniMode } from "models/mini-mode";
|
|
2
2
|
import { LoyaltyWidgetButton } from "../button";
|
|
3
3
|
import { LoyaltyWidgetHeader } from "./header";
|
|
4
4
|
import { LoyaltyWidgetSettings } from "./settings";
|
|
5
|
+
import { LoyaltyWidgetTranslations } from "./translations";
|
|
5
6
|
export declare class LoyaltyWidget {
|
|
6
7
|
id: string;
|
|
7
8
|
settings: LoyaltyWidgetSettings;
|
|
8
9
|
header: LoyaltyWidgetHeader;
|
|
9
10
|
button: LoyaltyWidgetButton;
|
|
10
|
-
|
|
11
|
+
miniMode: MiniMode;
|
|
12
|
+
translations: LoyaltyWidgetTranslations;
|
|
11
13
|
constructor(data?: Partial<LoyaltyWidget>);
|
|
12
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as
|
|
1
|
+
import{makeObservable as i,observable as t}from"mobx";import'./../../ext/uuid/dist/esm-browser/stringify.js';import'./../../ext/uuid/dist/esm-browser/v3.js';import s from'./../../ext/uuid/dist/esm-browser/v4.js';import'./../../ext/uuid/dist/esm-browser/v5.js';import{MiniMode as e}from"../mini-mode/index.js";import{LoyaltyWidgetButton as o}from"../button/index.js";import{LoyaltyWidgetHeader as n}from"./header/index.js";import{LoyaltyWidgetSettings as r}from"./settings/index.js";import{LoyaltyWidgetTranslations as d}from"./translations.js";var m=function(m){void 0===m&&(m={}),this.id=m.id||s(),this.header=m.header?new n(m.header):new n({}),this.settings=m.settings?new r(m.settings):new r({}),this.miniMode=m.miniMode?new e(m.miniMode):new e({}),this.button=m.button?new o(m.button):new o({}),this.translations=m.translations?new d(m.translations):new d({}),i(this,{id:t,miniMode:t,button:t,header:t,settings:t,translations:t})};export{m as LoyaltyWidget};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as o,observable as i}from
|
|
1
|
+
import{makeObservable as o,observable as i}from"mobx";import{WidgetPositionEnum as r,LoyaltyWidgetLayoutTypeEnum as e,WidgetIconTypeEnum as t,BadgeIconTypeEnum as p}from"../types/index.js";var d=function(d){var s;void 0===d&&(d={}),this.position=d.position||r.RIGHT,this.type=d.type||e.DRAWER,this.primaryColor=d.primaryColor||null,this.cartBorderRadius=null!==(s=d.cartBorderRadius)&&void 0!==s?s:0,this.widgetIconType=d.widgetIconType||t.NORMAL,this.badgeIconLevel=d.badgeIconLevel||p.LEVEL_1,o(this,{position:i,type:i,primaryColor:i,cartBorderRadius:i,widgetIconType:i,badgeIconLevel:i})};export{d as LoyaltyWidgetSettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeObservable as t,observable as o}from"mobx";var a=function(a){void 0===a&&(a={}),this.language=a.language||"tr",this.custom=a.custom||{},t(this,{language:o,custom:o})};export{a as LoyaltyWidgetTranslations};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LoyaltyWidgetImage } from "models/image";
|
|
2
|
+
export declare class MiniMode {
|
|
3
|
+
logo: LoyaltyWidgetImage;
|
|
4
|
+
emoji?: string | null;
|
|
5
|
+
bgColor?: string | null;
|
|
6
|
+
hideDescriptionAfterClose: boolean;
|
|
7
|
+
/** When true, the description bubble next to the mini button is never rendered. */
|
|
8
|
+
hideDescription: boolean;
|
|
9
|
+
constructor(data: Partial<MiniMode>);
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeObservable as o,observable as i}from"mobx";import{LoyaltyWidgetImage as e}from"../image/index.js";var r=function(r){var t,s;this.logo=r.logo?new e(r.logo):new e({}),this.emoji=r.emoji||"🚀",this.bgColor=r.bgColor||"#FFF",this.hideDescriptionAfterClose=null!==(t=r.hideDescriptionAfterClose)&&void 0!==t&&t,this.hideDescription=null!==(s=r.hideDescription)&&void 0!==s&&s,o(this,{logo:i,emoji:i,bgColor:i,hideDescriptionAfterClose:i,hideDescription:i})};export{r as MiniMode};
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoyaltyWidgetViewModel } from "models";
|
|
2
|
+
import type { LoyaltyCustomerInfo, LoyaltyProgramTier } from "../loyalty-customer-info";
|
|
2
3
|
import type { LoyaltyProgramEarningMethod } from "../loyalty-program-earning-method";
|
|
3
|
-
import type { LoyaltyCustomerInfo } from "../loyalty-customer-info";
|
|
4
|
-
import type { LoyaltyWidget } from "../loyalty-widget";
|
|
5
4
|
import type { LoyaltyProgramPointHistory } from "../loyalty-program-point-history";
|
|
5
|
+
import { LoyaltyProgramSpendingMethod } from "../loyalty-program-spending-method";
|
|
6
|
+
import type { LoyaltyWidget } from "../loyalty-widget";
|
|
6
7
|
export declare enum LoyaltyWidgetScreenTypeEnum {
|
|
7
8
|
MAIN_SCREEN = "MAIN_SCREEN",
|
|
8
9
|
CREDIT_SPENDING_METHODS_SCREEN = "CREDIT_SPENDING_METHODS_SCREEN",
|
|
9
10
|
CREDIT_EARNING_METHODS_SCREEN = "CREDIT_EARNING_METHODS_SCREEN",
|
|
10
11
|
CREDIT_HISTORY_SCREEN = "CREDIT_HISTORY_SCREEN",
|
|
11
|
-
LOYALTY_LEVEL_SCREEN = "LOYALTY_LEVEL_SCREEN"
|
|
12
|
+
LOYALTY_LEVEL_SCREEN = "LOYALTY_LEVEL_SCREEN",
|
|
13
|
+
GIFT_PRODUCT_SELECTION_SCREEN = "GIFT_PRODUCT_SELECTION_SCREEN"
|
|
14
|
+
}
|
|
15
|
+
export declare enum WidgetMode {
|
|
16
|
+
MINI_MODE = "MINI_MODE",
|
|
17
|
+
WIDGET_MODE = "WIDGET_MODE"
|
|
12
18
|
}
|
|
13
19
|
export declare enum EarningMethodTypeEnum {
|
|
14
20
|
BUY_PRODUCT = "BUY_PRODUCT",
|
|
@@ -41,18 +47,21 @@ export declare enum PeriodTypeEnum {
|
|
|
41
47
|
WEEK = "WEEK",
|
|
42
48
|
YEAR = "YEAR"
|
|
43
49
|
}
|
|
44
|
-
export declare class LoyaltyProgramPeriod {
|
|
45
|
-
period: string;
|
|
46
|
-
periodType: PeriodTypeEnum;
|
|
47
|
-
constructor(data?: Partial<LoyaltyProgramPeriod>);
|
|
48
|
-
}
|
|
49
50
|
export type Category = {
|
|
50
51
|
id: string;
|
|
51
52
|
name: string;
|
|
52
53
|
};
|
|
54
|
+
export type ProductVariant = {
|
|
55
|
+
id: string;
|
|
56
|
+
mainImageSrc?: string | null;
|
|
57
|
+
variantText?: string | null;
|
|
58
|
+
};
|
|
53
59
|
export type Product = {
|
|
54
60
|
id: string;
|
|
55
61
|
name: string;
|
|
62
|
+
mainImageSrc?: string | null;
|
|
63
|
+
variants?: ProductVariant[];
|
|
64
|
+
url?: string | null;
|
|
56
65
|
};
|
|
57
66
|
export type Brand = {
|
|
58
67
|
id: string;
|
|
@@ -80,45 +89,26 @@ export type StringFilterInput = {
|
|
|
80
89
|
endsWith?: string;
|
|
81
90
|
nendsWith?: string;
|
|
82
91
|
};
|
|
83
|
-
export type LoyaltyProgramTierTranslation = {
|
|
84
|
-
locale: string;
|
|
85
|
-
name: string;
|
|
86
|
-
};
|
|
87
|
-
export type LoyaltyProgramTier = {
|
|
88
|
-
createdAt?: string;
|
|
89
|
-
customerSegmentId?: string;
|
|
90
|
-
deleted: boolean;
|
|
91
|
-
id: string;
|
|
92
|
-
isActive: boolean;
|
|
93
|
-
loyaltyProgramId: string;
|
|
94
|
-
name: string;
|
|
95
|
-
period?: LoyaltyProgramPeriod;
|
|
96
|
-
pointsRequired?: number;
|
|
97
|
-
tierPointMultiplier?: number;
|
|
98
|
-
translations?: LoyaltyProgramTierTranslation[];
|
|
99
|
-
updatedAt?: string;
|
|
100
|
-
};
|
|
101
92
|
export type ListLoyaltyProgramTierInput = {
|
|
102
93
|
id?: StringFilterInput;
|
|
103
|
-
includeDeleted?: boolean;
|
|
104
94
|
loyaltyProgramId?: StringFilterInput;
|
|
105
95
|
};
|
|
106
96
|
export declare enum LoyaltyProgramPointHistoryTypeEnum {
|
|
107
97
|
EARN = "EARN",
|
|
108
|
-
SPEND = "SPEND"
|
|
98
|
+
SPEND = "SPEND",
|
|
99
|
+
REFUND = "REFUND",
|
|
100
|
+
REFILL = "REFILL",
|
|
101
|
+
MANUAL_EARN = "MANUAL_EARN",
|
|
102
|
+
MANUAL_DEDUCT = "MANUAL_DEDUCT"
|
|
103
|
+
}
|
|
104
|
+
export interface LoyaltyProgramPointHistoryTypeEnumFilterInput {
|
|
105
|
+
eq?: LoyaltyProgramPointHistoryTypeEnum | null;
|
|
106
|
+
in?: LoyaltyProgramPointHistoryTypeEnum[] | null;
|
|
107
|
+
ne?: LoyaltyProgramPointHistoryTypeEnum | null;
|
|
108
|
+
nin?: LoyaltyProgramPointHistoryTypeEnum[] | null;
|
|
109
109
|
}
|
|
110
|
-
export type LoyaltyProgramPointHistoryTypeEnumFilterInput = {
|
|
111
|
-
eq?: LoyaltyProgramPointHistoryTypeEnum;
|
|
112
|
-
in?: LoyaltyProgramPointHistoryTypeEnum[];
|
|
113
|
-
ne?: LoyaltyProgramPointHistoryTypeEnum;
|
|
114
|
-
nin?: LoyaltyProgramPointHistoryTypeEnum[];
|
|
115
|
-
};
|
|
116
110
|
export type ListLoyaltyProgramPointHistoryInput = {
|
|
117
|
-
|
|
118
|
-
includeDeleted?: boolean;
|
|
119
|
-
loyaltyProgramId?: StringFilterInput;
|
|
120
|
-
sort?: string;
|
|
121
|
-
type?: LoyaltyProgramPointHistoryTypeEnumFilterInput;
|
|
111
|
+
type?: LoyaltyProgramPointHistoryTypeEnumFilterInput | null;
|
|
122
112
|
};
|
|
123
113
|
export type LoyaltyWidgetCallbacks = {
|
|
124
114
|
listSpendingMethodsByCartId: (cartId?: string | null) => Promise<LoyaltyProgramSpendingMethod[]>;
|
|
@@ -129,17 +119,30 @@ export type LoyaltyWidgetCallbacks = {
|
|
|
129
119
|
useLoyaltyPoints: (input: AddLoyaltyToCartInput) => Promise<boolean>;
|
|
130
120
|
removeLoyaltyPointsFromCart: () => Promise<void>;
|
|
131
121
|
getLoyaltyWidget: () => Promise<LoyaltyWidget>;
|
|
132
|
-
onWidgetClose: () => void;
|
|
133
122
|
getProducts: (ids: string[]) => Promise<Product[]>;
|
|
134
123
|
getCategories: (ids: string[]) => Promise<Category[]>;
|
|
135
124
|
getBrands: (ids: string[]) => Promise<Brand[]>;
|
|
136
125
|
getTags: (ids: string[]) => Promise<Tag[]>;
|
|
126
|
+
subscribeToMarketingNotifications: () => Promise<boolean>;
|
|
127
|
+
formatCurrency?: (price: number) => string;
|
|
137
128
|
};
|
|
138
129
|
export type IkasLoyaltyWidgetConfig = {
|
|
139
130
|
cartId?: string | null;
|
|
131
|
+
userId?: string | null;
|
|
140
132
|
cdnURL: string;
|
|
141
133
|
merchantId: string;
|
|
142
134
|
currency: string;
|
|
143
|
-
|
|
135
|
+
storeURL?: string | null;
|
|
144
136
|
callbacks: LoyaltyWidgetCallbacks;
|
|
137
|
+
position?: "fixed" | "absolute";
|
|
138
|
+
isPreviewMode?: boolean;
|
|
139
|
+
onViewModelInitialized?: (viewModel: LoyaltyWidgetViewModel) => void;
|
|
145
140
|
};
|
|
141
|
+
declare global {
|
|
142
|
+
interface Window {
|
|
143
|
+
startIkasLoyaltyWidget?: (config?: IkasLoyaltyWidgetConfig) => void;
|
|
144
|
+
openIkasStorefrontWidget?: () => void;
|
|
145
|
+
closeIkasStorefrontWidget?: () => void;
|
|
146
|
+
ikasLoyaltyWidgetConfig?: IkasLoyaltyWidgetConfig;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var E,R,T,_,N,C,D,A;!function(E){E.MAIN_SCREEN="MAIN_SCREEN",E.CREDIT_SPENDING_METHODS_SCREEN="CREDIT_SPENDING_METHODS_SCREEN",E.CREDIT_EARNING_METHODS_SCREEN="CREDIT_EARNING_METHODS_SCREEN",E.CREDIT_HISTORY_SCREEN="CREDIT_HISTORY_SCREEN",E.LOYALTY_LEVEL_SCREEN="LOYALTY_LEVEL_SCREEN",E.GIFT_PRODUCT_SELECTION_SCREEN="GIFT_PRODUCT_SELECTION_SCREEN"}(E||(E={})),function(E){E.MINI_MODE="MINI_MODE",E.WIDGET_MODE="WIDGET_MODE"}(R||(R={})),function(E){E.BUY_PRODUCT="BUY_PRODUCT",E.CUSTOMER_REGISTER="CUSTOMER_REGISTER",E.CUSTOMER_REVIEW="CUSTOMER_REVIEW",E.CUSTOMER_SEGMENT="CUSTOMER_SEGMENT",E.ENABLE_SUBSCRIPTION="ENABLE_SUBSCRIPTION",E.ORDER_CREATE="ORDER_CREATE"}(T||(T={})),function(E){E.DYNAMIC_ORDER_AMOUNT="DYNAMIC_ORDER_AMOUNT",E.DYNAMIC_ORDER_QUANTITY="DYNAMIC_ORDER_QUANTITY",E.STATIC="STATIC"}(_||(_={})),function(E){E.FIXED_AMOUNT="FIXED_AMOUNT",E.FREE_PRODUCT="FREE_PRODUCT",E.FREE_SHIPPING="FREE_SHIPPING",E.RATIO="RATIO"}(N||(N={})),function(E){E.CATEGORY="CATEGORY",E.DYNAMIC_CATEGORY="DYNAMIC_CATEGORY",E.PRODUCT_AND_VARIANT="PRODUCT_AND_VARIANT",E.PRODUCT_BRAND="PRODUCT_BRAND",E.PRODUCT_TAG="PRODUCT_TAG"}(C||(C={})),function(E){E.MONTH="MONTH",E.WEEK="WEEK",E.YEAR="YEAR"}(D||(D={})),function(E){E.EARN="EARN",E.SPEND="SPEND",E.REFUND="REFUND",E.REFILL="REFILL",E.MANUAL_EARN="MANUAL_EARN",E.MANUAL_DEDUCT="MANUAL_DEDUCT"}(A||(A={}));export{T as EarningMethodTypeEnum,C as LoyaltyProgramFilterTypeEnum,N as LoyaltyProgramMethodSpendingTypeEnum,_ as LoyaltyProgramPointEarningTypeEnum,A as LoyaltyProgramPointHistoryTypeEnum,E as LoyaltyWidgetScreenTypeEnum,D as PeriodTypeEnum,R as WidgetMode};
|