@ikas/loyalty-widget-renderer 1.0.0-alpha.9 → 1.0.0-alpha.90
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 +34 -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 +18 -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 +61 -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 +8 -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, LoyaltyProgramPointHistoryPaginationResponse, 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[];
|
|
@@ -23,6 +29,27 @@ export declare class LoyaltyWidgetViewModel {
|
|
|
23
29
|
spendingMethods: LoyaltyProgramSpendingMethod[];
|
|
24
30
|
tiers: LoyaltyProgramTier[];
|
|
25
31
|
pointHistory: LoyaltyProgramPointHistory[];
|
|
32
|
+
pointHistoryPage: number;
|
|
33
|
+
pointHistoryLimit: number | null;
|
|
34
|
+
pointHistoryHasNext: boolean;
|
|
35
|
+
isPointHistoryLoadingMore: boolean;
|
|
26
36
|
callbacks?: LoyaltyWidgetCallbacks;
|
|
27
|
-
constructor(data: Partial<LoyaltyWidgetViewModel> | undefined, cdnURL: string, merchantId: string, currency: string,
|
|
37
|
+
constructor(data: Partial<LoyaltyWidgetViewModel> | undefined, cdnURL: string, merchantId: string, currency: string, storeURL?: string | null, isPreviewMode?: boolean, callbacks?: LoyaltyWidgetCallbacks);
|
|
38
|
+
get currentScreen(): LoyaltyWidgetScreenTypeEnum;
|
|
39
|
+
get isMainScreen(): boolean;
|
|
40
|
+
pushScreen(screen: LoyaltyWidgetScreenTypeEnum): void;
|
|
41
|
+
popScreen(): void;
|
|
42
|
+
resetNavigation(): void;
|
|
43
|
+
get shouldShowSpendingMethods(): boolean;
|
|
44
|
+
setWidgetMode(mode: WidgetMode): void;
|
|
45
|
+
closeMiniModeDescription(): void;
|
|
46
|
+
setPointHistoryFirstPage(response: LoyaltyProgramPointHistoryPaginationResponse | LoyaltyProgramPointHistory[] | null): void;
|
|
47
|
+
resetPointHistory(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Liste sonuna gelindiğinde bir sonraki sayfayı çekip mevcut listenin sonuna ekler.
|
|
50
|
+
* Devam eden bir istek varken ya da `hasNext` false iken yeni istek atılmaz; hata
|
|
51
|
+
* durumunda yüklenmiş kayıtlar ve sayfa bilgisi korunur, böylece tekrar denenebilir.
|
|
52
|
+
*/
|
|
53
|
+
loadMorePointHistory(): Promise<void>;
|
|
54
|
+
formatCurrency(price: number): string;
|
|
28
55
|
}
|
package/build/models/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__awaiter as t,__assign as i,__generator as o,__spreadArray as e}from'./../ext/tslib/tslib.es6.mjs.js';import{makeObservable as s,observable as r,computed as n,action as a}from"mobx";import{markDescriptionClosedForSession as d,markDescriptionPermanentlyClosed as h,isDescriptionClosedForCurrentSession as c,isDescriptionPermanentlyClosed as p}from"../utils.js";import{LoyaltyCustomerInfo as u}from"./loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as l}from"./loyalty-program-earning-method/index.js";import{normalizePointHistoryPage as y}from"./loyalty-program-point-history/index.js";import{LoyaltyProgramSpendingMethod as g}from"./loyalty-program-spending-method/index.js";import{LoyaltyWidget as m}from"./loyalty-widget/index.js";import{LoyaltyWidgetScreenTypeEnum as H,WidgetMode as f}from"./types/index.js";var M=function(){function M(t,o,e,d,h,y,M){var v;void 0===t&&(t={}),this.userRefreshTrigger=0,this.cartRefreshTrigger=0,this.navigationStack=[H.MAIN_SCREEN],this.currentWidgetMode=y?f.WIDGET_MODE:f.MINI_MODE,this.isMiniModeDescriptionClosed=c()||p(),this.isLoading=t.isLoading||!1,this.isActionLoading=t.isActionLoading||!1,this.loyaltyWidget=new m(t.loyaltyWidget),this.cdnURL=o,this.merchantId=e,this.storeUrl=h||t.storeUrl||"",this.currency=d,this.isPreviewMode=y||!1,this.cartId=t.cartId||null,this.ikasEventUser=t.ikasEventUser||null,this.user=t.user?new u(t.user):null,this.earningMethods=t.earningMethods?t.earningMethods.map(function(t){return new l(t)}):[],this.spendingMethods=t.spendingMethods?t.spendingMethods.map(function(t){return new g(t)}):[],this.tiers=t.tiers?t.tiers:[],this.categories=t.categories?t.categories:[],this.products=t.products?t.products:[],this.brands=t.brands?t.brands:[],this.tags=t.tags?t.tags:[],this.pointHistory=t.pointHistory?t.pointHistory:[],this.pointHistoryPage=t.pointHistoryPage||0,this.pointHistoryLimit=null!==(v=t.pointHistoryLimit)&&void 0!==v?v:null,this.pointHistoryHasNext=t.pointHistoryHasNext||!1,this.isPointHistoryLoadingMore=!1,this.callbacks=M||void 0,s(this,i(i({cartId:r},y?{}:{loyaltyWidget:r}),{isLoading:r,isActionLoading:r,cdnURL:r,merchantId:r,storeUrl:r,currency:r,navigationStack:r,currentScreen:n,isMainScreen:n,pushScreen:a.bound,popScreen:a.bound,resetNavigation:a.bound,setWidgetMode:a.bound,closeMiniModeDescription:a.bound,formatCurrency:a.bound,currentWidgetMode:r,isMiniModeDescriptionClosed:r,user:r,earningMethods:r,spendingMethods:r,tiers:r,categories:r,products:r,brands:r,tags:r,pointHistory:r,pointHistoryPage:r,pointHistoryLimit:r,pointHistoryHasNext:r,isPointHistoryLoadingMore:r,setPointHistoryFirstPage:a.bound,resetPointHistory:a.bound,loadMorePointHistory:a.bound,ikasEventUser:r,userRefreshTrigger:r,cartRefreshTrigger:r,shouldShowSpendingMethods:n}))}return Object.defineProperty(M.prototype,"currentScreen",{get:function(){return this.navigationStack[this.navigationStack.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isMainScreen",{get:function(){return this.currentScreen===H.MAIN_SCREEN},enumerable:!1,configurable:!0}),M.prototype.pushScreen=function(t){this.currentScreen!==t&&this.navigationStack.push(t)},M.prototype.popScreen=function(){this.navigationStack.length>1&&this.navigationStack.pop()},M.prototype.resetNavigation=function(){this.navigationStack=[H.MAIN_SCREEN]},Object.defineProperty(M.prototype,"shouldShowSpendingMethods",{get:function(){return!!this.user&&(!(this.user.totalPoint<=0)&&0!==this.spendingMethods.length)},enumerable:!1,configurable:!0}),M.prototype.setWidgetMode=function(t){var i,o;this.currentWidgetMode=t,t!==f.WIDGET_MODE||this.isPreviewMode||(this.isMiniModeDescriptionClosed=!0,d(),(null===(o=null===(i=this.loyaltyWidget)||void 0===i?void 0:i.miniMode)||void 0===o?void 0:o.hideDescriptionAfterClose)&&h())},M.prototype.closeMiniModeDescription=function(){var t,i;this.isMiniModeDescriptionClosed=!0,d(),(null===(i=null===(t=this.loyaltyWidget)||void 0===t?void 0:t.miniMode)||void 0===i?void 0:i.hideDescriptionAfterClose)&&h()},M.prototype.setPointHistoryFirstPage=function(t){var i=y(t,1);this.pointHistory=i.data,this.pointHistoryPage=i.page,this.pointHistoryLimit=i.limit,this.pointHistoryHasNext=i.hasNext,this.isPointHistoryLoadingMore=!1},M.prototype.resetPointHistory=function(){this.pointHistory=[],this.pointHistoryPage=0,this.pointHistoryLimit=null,this.pointHistoryHasNext=!1,this.isPointHistoryLoadingMore=!1},M.prototype.loadMorePointHistory=function(){return t(this,void 0,void 0,function(){var t,s,r,n,a,d;return o(this,function(o){switch(o.label){case 0:if(!this.callbacks)return[2];if(!this.pointHistoryHasNext)return[2];if(this.isPointHistoryLoadingMore)return[2];t=this.pointHistoryPage+1,this.isPointHistoryLoadingMore=!0,o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,this.callbacks.listLoyaltyProgramPointHistory({pagination:i({page:t},this.pointHistoryLimit?{limit:this.pointHistoryLimit}:{})})];case 2:return s=o.sent(),r=y(s,t),n=new Set(this.pointHistory.map(function(t){return t.id})),this.pointHistory=e(e([],this.pointHistory,!0),r.data.filter(function(t){return!n.has(t.id)}),!0),this.pointHistoryPage=r.page,this.pointHistoryLimit=null!==(d=r.limit)&&void 0!==d?d:this.pointHistoryLimit,this.pointHistoryHasNext=r.hasNext,[3,5];case 3:return a=o.sent(),console.error("Failed to fetch next point history page",a),[3,5];case 4:return this.isPointHistoryLoadingMore=!1,[7];case 5:return[2]}})})},M.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)},M}();export{M 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,12 @@
|
|
|
1
|
+
import type { LoyaltyProgramPointHistoryPaginationResponse } from "../types";
|
|
1
2
|
import { LoyaltyProgramPointHistoryTypeEnum } from "../types";
|
|
2
3
|
export declare class LoyaltyProgramPointHistory {
|
|
3
4
|
amount: number;
|
|
4
|
-
createdAt:
|
|
5
|
+
createdAt: any | null;
|
|
5
6
|
customerId: string;
|
|
7
|
+
customerReviewId: string | null;
|
|
6
8
|
deleted: boolean;
|
|
7
|
-
expireDate:
|
|
9
|
+
expireDate: any | null;
|
|
8
10
|
id: string;
|
|
9
11
|
loyaltyProgramCustomerId: string;
|
|
10
12
|
loyaltyProgramEarningMethodId: string | null;
|
|
@@ -12,6 +14,19 @@ export declare class LoyaltyProgramPointHistory {
|
|
|
12
14
|
loyaltyProgramSpendingMethodId: string | null;
|
|
13
15
|
orderId: string | null;
|
|
14
16
|
type: LoyaltyProgramPointHistoryTypeEnum;
|
|
15
|
-
|
|
17
|
+
productVariantId: string | null;
|
|
18
|
+
updatedAt: any | null;
|
|
16
19
|
constructor(data?: Partial<LoyaltyProgramPointHistory>);
|
|
17
20
|
}
|
|
21
|
+
export type NormalizedPointHistoryPage = {
|
|
22
|
+
data: LoyaltyProgramPointHistory[];
|
|
23
|
+
hasNext: boolean;
|
|
24
|
+
limit: number | null;
|
|
25
|
+
page: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* `listLoyaltyProgramPointHistory` sayfalı cevap döner. Widget bağımsız yayınlandığı
|
|
29
|
+
* için henüz güncellenmemiş bir host düz liste de gönderebilir; iki şekli de tek
|
|
30
|
+
* sayfa yapısına indiriyoruz.
|
|
31
|
+
*/
|
|
32
|
+
export declare const normalizePointHistoryPage: (response: LoyaltyProgramPointHistoryPaginationResponse | LoyaltyProgramPointHistory[] | null | undefined, requestedPage: number) => NormalizedPointHistoryPage;
|
|
@@ -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 a=function(a){void 0===a&&(a={}),this.amount=a.amount||0,this.createdAt=a.createdAt||null,this.customerId=a.customerId||"",this.customerReviewId=a.customerReviewId||null,this.deleted=a.deleted||!1,this.expireDate=a.expireDate||null,this.id=a.id||"",this.loyaltyProgramCustomerId=a.loyaltyProgramCustomerId||"",this.loyaltyProgramEarningMethodId=a.loyaltyProgramEarningMethodId||null,this.loyaltyProgramId=a.loyaltyProgramId||"",this.loyaltyProgramSpendingMethodId=a.loyaltyProgramSpendingMethodId||null,this.orderId=a.orderId||null,this.type=a.type||r.EARN,this.productVariantId=a.productVariantId||null,this.updatedAt=a.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})},d=function(t,e){return t?Array.isArray(t)?{data:t.map(function(t){return new a(t)}),hasNext:!1,limit:null,page:e}:{data:(t.data||[]).map(function(t){return new a(t)}),hasNext:!!t.hasNext,limit:"number"==typeof t.limit?t.limit:null,page:"number"==typeof t.page?t.page:e}:{data:[],hasNext:!1,limit:null,page:e}};export{a as LoyaltyProgramPointHistory,d as normalizePointHistoryPage};
|
|
@@ -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};
|