@ikas/loyalty-widget-renderer 1.0.0-alpha.8 → 1.0.0-alpha.80
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 +5 -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/normal/informationCircle.d.ts +2 -0
- package/build/assets/widget-icons/normal/informationCircle.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 +633 -0
- package/build/locales.js +1 -0
- 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 +16 -6
- 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 +3 -3
- package/build/models/loyalty-program-point-history/index.js +1 -1
- package/build/models/loyalty-program-spending-method/index.d.ts +7 -20
- package/build/models/loyalty-program-spending-method/index.js +1 -1
- package/build/models/loyalty-widget/header/header-background/index.d.ts +1 -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/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 +7 -0
- package/build/models/mini-mode/index.js +1 -0
- package/build/models/types/index.d.ts +25 -41
- 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/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 +5 -1
- 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/loyalty-level-screen/index.js +1 -1
- package/build/renderer/screens/loyalty-level-screen/style.d.ts +10 -2
- 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 +1 -0
- 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 +18 -2
- 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.js +1 -1
- package/build/renderer/utils/object-utils.d.ts +2 -0
- package/build/renderer/utils/object-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 +31 -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/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
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
|
selectedScreen: 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,9 @@ 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 shouldShowSpendingMethods(): boolean;
|
|
35
|
+
setWidgetMode(mode: WidgetMode): void;
|
|
36
|
+
closeMiniModeDescription(): void;
|
|
37
|
+
formatCurrency(price: number): string;
|
|
28
38
|
}
|
package/build/models/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as
|
|
1
|
+
import{__assign as t}from'./../ext/tslib/tslib.es6.mjs.js';import{makeObservable as e,observable as i,action as s,computed as r}from"mobx";import{markDescriptionClosedForSession as o,isDescriptionClosedForCurrentSession as n}from"../utils.js";import{LoyaltyCustomerInfo as d}from"./loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as c}from"./loyalty-program-earning-method/index.js";import{LoyaltyProgramSpendingMethod as a}from"./loyalty-program-spending-method/index.js";import{LoyaltyWidget as h}from"./loyalty-widget/index.js";import{WidgetMode as l,LoyaltyWidgetScreenTypeEnum as u}from"./types/index.js";var g=function(){function g(o,g,p,M,m,y,f){void 0===o&&(o={}),this.userRefreshTrigger=0,this.cartRefreshTrigger=0,this.selectedScreen=o.selectedScreen||u.MAIN_SCREEN,this.currentWidgetMode=y?l.WIDGET_MODE:l.MINI_MODE,this.isMiniModeDescriptionClosed=n(),this.isLoading=o.isLoading||!1,this.isActionLoading=o.isActionLoading||!1,this.loyaltyWidget=new h(o.loyaltyWidget),this.cdnURL=g,this.merchantId=p,this.storeUrl=m||o.storeUrl||"",this.currency=M,this.isPreviewMode=y||!1,this.cartId=o.cartId||null,this.cartId=o.cartId||null,this.ikasEventUser=o.ikasEventUser||null,this.user=o.user?new d(o.user):null,this.earningMethods=o.earningMethods?o.earningMethods.map(function(t){return new c(t)}):[],this.spendingMethods=o.spendingMethods?o.spendingMethods.map(function(t){return new a(t)}):[],this.tiers=o.tiers?o.tiers:[],this.categories=o.categories?o.categories:[],this.products=o.products?o.products:[],this.brands=o.brands?o.brands:[],this.tags=o.tags?o.tags:[],this.pointHistory=o.pointHistory?o.pointHistory:[],this.callbacks=f||void 0,e(this,t(t({cartId:i},y?{}:{loyaltyWidget:i}),{isLoading:i,isActionLoading:i,cdnURL:i,merchantId:i,storeUrl:i,currency:i,setWidgetMode:s.bound,closeMiniModeDescription:s.bound,formatCurrency:s.bound,selectedScreen:i,currentWidgetMode:i,isMiniModeDescriptionClosed:i,user:i,earningMethods:i,spendingMethods:i,tiers:i,categories:i,products:i,brands:i,tags:i,pointHistory:i,ikasEventUser:i,userRefreshTrigger:i,cartRefreshTrigger:i,shouldShowSpendingMethods:r}))}return Object.defineProperty(g.prototype,"shouldShowSpendingMethods",{get:function(){return!!this.user&&(!(this.user.totalPoint<=0)&&0!==this.spendingMethods.length)},enumerable:!1,configurable:!0}),g.prototype.setWidgetMode=function(t){this.currentWidgetMode=t,t!==l.WIDGET_MODE||this.isPreviewMode||(this.isMiniModeDescriptionClosed=!0,o())},g.prototype.closeMiniModeDescription=function(){this.isMiniModeDescriptionClosed=!0,o()},g.prototype.formatCurrency=function(t){var e;return(null===(e=this.callbacks)||void 0===e?void 0:e.formatCurrency)?this.callbacks.formatCurrency(t):"".concat(t.toFixed(2)," ").concat(this.currency)},g}();export{g 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
|
|
1
|
+
import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramPeriod as e}from"../common/index.js";var n,o,r=function(e){void 0===e&&(e={}),this.locale=e.locale||"",this.name=e.name||"",t(this,{locale:i,name:i})},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 e(n.period):null,this.translations=n.translations?n.translations.map(function(t){return new r(t)}):null,t(this,{id:i,name:i,pointsRequired:i,tierPointMultiplier:i,loyaltyProgramId:i,customerSegmentId:i,createdAt:i,updatedAt:i,deleted:i,isActive:i,period:i,translations:i})},s=function(e){void 0===e&&(e={}),this.campaignType=e.campaignType||null,this.discountAmount=e.discountAmount||0,this.discountAmountType=e.discountAmountType||o.AMOUNT,this.discountPercentage=e.discountPercentage||null,this.loyaltySpendingMethodId=e.loyaltySpendingMethodId||"",this.pointUsed=e.pointUsed||0,t(this,{campaignType:i,discountAmount:i,discountAmountType:i,discountPercentage:i,loyaltySpendingMethodId:i,pointUsed:i})},d=function(e){void 0===e&&(e={}),this.customerTier=e.customerTier?new l(e.customerTier):null,this.loyaltyProgramCustomerId=e.loyaltyProgramCustomerId||"",this.loyaltyProgramId=e.loyaltyProgramId||"",this.totalPoint=e.totalPoint||0,this.nextTierRequiredPoint=void 0!==e.nextTierRequiredPoint&&null!==e.nextTierRequiredPoint?e.nextTierRequiredPoint:null,this.cartLoyaltyLines=e.cartLoyaltyLines?e.cartLoyaltyLines.map(function(t){return new s(t)}):null,t(this,{customerTier:i,loyaltyProgramCustomerId:i,loyaltyProgramId:i,totalPoint:i,nextTierRequiredPoint:i,cartLoyaltyLines:i})};!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"mobx";import{EarningMethodTypeEnum as n,LoyaltyProgramPointEarningTypeEnum as e
|
|
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,10 @@
|
|
|
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
6
|
deleted: boolean;
|
|
7
|
-
expireDate:
|
|
7
|
+
expireDate: any | null;
|
|
8
8
|
id: string;
|
|
9
9
|
loyaltyProgramCustomerId: string;
|
|
10
10
|
loyaltyProgramEarningMethodId: string | null;
|
|
@@ -12,6 +12,6 @@ export declare class LoyaltyProgramPointHistory {
|
|
|
12
12
|
loyaltyProgramSpendingMethodId: string | null;
|
|
13
13
|
orderId: string | null;
|
|
14
14
|
type: LoyaltyProgramPointHistoryTypeEnum;
|
|
15
|
-
updatedAt:
|
|
15
|
+
updatedAt: any | null;
|
|
16
16
|
constructor(data?: Partial<LoyaltyProgramPointHistory>);
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
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||
|
|
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.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.updatedAt=d.updatedAt||null,t(this,{amount:e,createdAt:e,customerId:e,deleted:e,expireDate:e,id:e,loyaltyProgramCustomerId:e,loyaltyProgramEarningMethodId:e,loyaltyProgramId:e,loyaltyProgramSpendingMethodId:e,orderId:e,type:e,updatedAt:e})};export{d as LoyaltyProgramPointHistory};
|
|
@@ -1,38 +1,25 @@
|
|
|
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;
|
|
15
6
|
point: number;
|
|
16
7
|
constructor(data?: Partial<LoyaltyProgramDiscountSettings>);
|
|
17
8
|
}
|
|
18
|
-
export declare class LoyaltyProgramMethodTranslation {
|
|
19
|
-
description: string | null;
|
|
20
|
-
locale: string | null;
|
|
21
|
-
constructor(data?: Partial<LoyaltyProgramMethodTranslation>);
|
|
22
|
-
}
|
|
23
9
|
export declare class LoyaltyProgramSpendingMethod {
|
|
24
|
-
createdAt:
|
|
10
|
+
createdAt: any | null;
|
|
25
11
|
deleted: boolean;
|
|
26
12
|
description: string | null;
|
|
27
13
|
discountSettings: LoyaltyProgramDiscountSettings | null;
|
|
28
14
|
id: string;
|
|
29
15
|
isActive: boolean;
|
|
16
|
+
isAvailable: boolean | null;
|
|
30
17
|
isDynamic: boolean;
|
|
31
18
|
loyaltyProgramId: string;
|
|
32
19
|
pointUsageLimit: LoyaltyProgramPointLimit | null;
|
|
33
|
-
productFilters: LoyaltyProgramFilter[];
|
|
34
|
-
translations: LoyaltyProgramMethodTranslation[];
|
|
20
|
+
productFilters: LoyaltyProgramFilter[] | null;
|
|
21
|
+
translations: LoyaltyProgramMethodTranslation[] | null;
|
|
35
22
|
type: LoyaltyProgramMethodSpendingTypeEnum;
|
|
36
|
-
updatedAt:
|
|
23
|
+
updatedAt: any | null;
|
|
37
24
|
constructor(data?: Partial<LoyaltyProgramSpendingMethod>);
|
|
38
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramMethodSpendingTypeEnum as n
|
|
1
|
+
import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramMethodSpendingTypeEnum as n}from"../types/index.js";import{LoyaltyProgramPointLimit as s,LoyaltyProgramFilter as e,LoyaltyProgramMethodTranslation as o}from"../common/index.js";var l=function(n){void 0===n&&(n={}),this.discountAmount=n.discountAmount||null,this.freeProductId=n.freeProductId||null,this.point=n.point||0,t(this,{discountAmount:i,freeProductId:i,point:i})},d=function(d){void 0===d&&(d={}),this.createdAt=d.createdAt||null,this.deleted=d.deleted||!1,this.description=d.description||null,this.discountSettings=d.discountSettings?new l(d.discountSettings):null,this.id=d.id||"",this.isActive=d.isActive||!1,this.isAvailable=void 0!==d.isAvailable&&null!==d.isAvailable?d.isAvailable:null,this.isDynamic=d.isDynamic||!1,this.loyaltyProgramId=d.loyaltyProgramId||"",this.pointUsageLimit=d.pointUsageLimit?new s(d.pointUsageLimit):null,this.productFilters=d.productFilters?d.productFilters.map(function(t){return new e(t)}):null,this.translations=d.translations?d.translations.map(function(t){return new o(t)}):null,this.type=d.type||n.FIXED_AMOUNT,this.updatedAt=d.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{l as LoyaltyProgramDiscountSettings,d as LoyaltyProgramSpendingMethod};
|
|
@@ -1,7 +1,6 @@
|
|
|
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;
|
|
6
5
|
image: LoyaltyWidgetImage | null;
|
|
7
6
|
type: HeaderBackgroundTypeEnum;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{makeObservable as i,observable as o}from"mobx";import{LoyaltyWidgetImage as e}from"../../../image/index.js";import{HeaderBackgroundTypeEnum as t}from"../../types/index.js";var m=function(m){this.bgColor=m.bgColor||null,this.image=m.image?new e(m.image):null,this.type=m.type||t.COLOR,i(this,{bgColor:o,image:o,type:o})};export{m as LoyaltyWidgetHeaderBackground};
|
|
@@ -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"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.
|
|
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 @@
|
|
|
1
|
+
import{makeObservable as o,observable as i}from"mobx";import{LoyaltyWidgetImage as m}from"../image/index.js";var r=function(r){this.logo=r.logo?new m(r.logo):new m({}),this.emoji=r.emoji||"🚀",this.bgColor=r.bgColor||"#FFF",o(this,{logo:i,emoji:i,bgColor:i})};export{r as MiniMode};
|
|
@@ -1,8 +1,9 @@
|
|
|
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",
|
|
@@ -10,6 +11,10 @@ export declare enum LoyaltyWidgetScreenTypeEnum {
|
|
|
10
11
|
CREDIT_HISTORY_SCREEN = "CREDIT_HISTORY_SCREEN",
|
|
11
12
|
LOYALTY_LEVEL_SCREEN = "LOYALTY_LEVEL_SCREEN"
|
|
12
13
|
}
|
|
14
|
+
export declare enum WidgetMode {
|
|
15
|
+
MINI_MODE = "MINI_MODE",
|
|
16
|
+
WIDGET_MODE = "WIDGET_MODE"
|
|
17
|
+
}
|
|
13
18
|
export declare enum EarningMethodTypeEnum {
|
|
14
19
|
BUY_PRODUCT = "BUY_PRODUCT",
|
|
15
20
|
CUSTOMER_REGISTER = "CUSTOMER_REGISTER",
|
|
@@ -41,11 +46,6 @@ export declare enum PeriodTypeEnum {
|
|
|
41
46
|
WEEK = "WEEK",
|
|
42
47
|
YEAR = "YEAR"
|
|
43
48
|
}
|
|
44
|
-
export declare class LoyaltyProgramPeriod {
|
|
45
|
-
period: string;
|
|
46
|
-
periodType: PeriodTypeEnum;
|
|
47
|
-
constructor(data?: Partial<LoyaltyProgramPeriod>);
|
|
48
|
-
}
|
|
49
49
|
export type Category = {
|
|
50
50
|
id: string;
|
|
51
51
|
name: string;
|
|
@@ -80,45 +80,24 @@ export type StringFilterInput = {
|
|
|
80
80
|
endsWith?: string;
|
|
81
81
|
nendsWith?: string;
|
|
82
82
|
};
|
|
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
83
|
export type ListLoyaltyProgramTierInput = {
|
|
102
84
|
id?: StringFilterInput;
|
|
103
|
-
includeDeleted?: boolean;
|
|
104
85
|
loyaltyProgramId?: StringFilterInput;
|
|
105
86
|
};
|
|
106
87
|
export declare enum LoyaltyProgramPointHistoryTypeEnum {
|
|
107
88
|
EARN = "EARN",
|
|
108
|
-
SPEND = "SPEND"
|
|
89
|
+
SPEND = "SPEND",
|
|
90
|
+
REFUND = "REFUND",
|
|
91
|
+
REFILL = "REFILL"
|
|
92
|
+
}
|
|
93
|
+
export interface LoyaltyProgramPointHistoryTypeEnumFilterInput {
|
|
94
|
+
eq?: LoyaltyProgramPointHistoryTypeEnum | null;
|
|
95
|
+
in?: LoyaltyProgramPointHistoryTypeEnum[] | null;
|
|
96
|
+
ne?: LoyaltyProgramPointHistoryTypeEnum | null;
|
|
97
|
+
nin?: LoyaltyProgramPointHistoryTypeEnum[] | null;
|
|
109
98
|
}
|
|
110
|
-
export type LoyaltyProgramPointHistoryTypeEnumFilterInput = {
|
|
111
|
-
eq?: LoyaltyProgramPointHistoryTypeEnum;
|
|
112
|
-
in?: LoyaltyProgramPointHistoryTypeEnum[];
|
|
113
|
-
ne?: LoyaltyProgramPointHistoryTypeEnum;
|
|
114
|
-
nin?: LoyaltyProgramPointHistoryTypeEnum[];
|
|
115
|
-
};
|
|
116
99
|
export type ListLoyaltyProgramPointHistoryInput = {
|
|
117
|
-
|
|
118
|
-
includeDeleted?: boolean;
|
|
119
|
-
loyaltyProgramId?: StringFilterInput;
|
|
120
|
-
sort?: string;
|
|
121
|
-
type?: LoyaltyProgramPointHistoryTypeEnumFilterInput;
|
|
100
|
+
type?: LoyaltyProgramPointHistoryTypeEnumFilterInput | null;
|
|
122
101
|
};
|
|
123
102
|
export type LoyaltyWidgetCallbacks = {
|
|
124
103
|
listSpendingMethodsByCartId: (cartId?: string | null) => Promise<LoyaltyProgramSpendingMethod[]>;
|
|
@@ -129,17 +108,22 @@ export type LoyaltyWidgetCallbacks = {
|
|
|
129
108
|
useLoyaltyPoints: (input: AddLoyaltyToCartInput) => Promise<boolean>;
|
|
130
109
|
removeLoyaltyPointsFromCart: () => Promise<void>;
|
|
131
110
|
getLoyaltyWidget: () => Promise<LoyaltyWidget>;
|
|
132
|
-
onWidgetClose: () => void;
|
|
133
111
|
getProducts: (ids: string[]) => Promise<Product[]>;
|
|
134
112
|
getCategories: (ids: string[]) => Promise<Category[]>;
|
|
135
113
|
getBrands: (ids: string[]) => Promise<Brand[]>;
|
|
136
114
|
getTags: (ids: string[]) => Promise<Tag[]>;
|
|
115
|
+
subscribeToMarketingNotifications: () => Promise<boolean>;
|
|
116
|
+
formatCurrency?: (price: number) => string;
|
|
137
117
|
};
|
|
138
118
|
export type IkasLoyaltyWidgetConfig = {
|
|
139
119
|
cartId?: string | null;
|
|
120
|
+
userId?: string | null;
|
|
140
121
|
cdnURL: string;
|
|
141
122
|
merchantId: string;
|
|
142
123
|
currency: string;
|
|
143
|
-
|
|
124
|
+
storeURL?: string | null;
|
|
144
125
|
callbacks: LoyaltyWidgetCallbacks;
|
|
126
|
+
position?: "fixed" | "absolute";
|
|
127
|
+
isPreviewMode?: boolean;
|
|
128
|
+
onViewModelInitialized?: (viewModel: LoyaltyWidgetViewModel) => void;
|
|
145
129
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var E,R,T,_,N,D,I,C;!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||(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"}(D||(D={})),function(E){E.MONTH="MONTH",E.WEEK="WEEK",E.YEAR="YEAR"}(I||(I={})),function(E){E.EARN="EARN",E.SPEND="SPEND",E.REFUND="REFUND",E.REFILL="REFILL"}(C||(C={}));export{T as EarningMethodTypeEnum,D as LoyaltyProgramFilterTypeEnum,N as LoyaltyProgramMethodSpendingTypeEnum,_ as LoyaltyProgramPointEarningTypeEnum,C as LoyaltyProgramPointHistoryTypeEnum,E as LoyaltyWidgetScreenTypeEnum,I as PeriodTypeEnum,R as WidgetMode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as e}from'./../../../ext/tslib/tslib.es6.mjs.js';import t,{useRef as n,useState as r,useEffect as o}from"react";import i from"styled-components";var a,s=i.div(a||(a=e(["\n height: ",";\n overflow: hidden;\n transition: height ","ms ease-in-out;\n"],["\n height: ",";\n overflow: hidden;\n transition: height ","ms ease-in-out;\n"])),function(e){var t=e.$height;return"auto"===t?"auto":"".concat(t,"px")},function(e){return e.$duration}),u=function(e){var i=e.children,a=e.duration,u=void 0===a?300:a,c=e.className,l=e.style,d=n(null),h=r("auto"),f=h[0],m=h[1];return o(function(){if(d.current){var e=new ResizeObserver(function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];r.target===d.current&&m(r.borderBoxSize[0].blockSize)}});return e.observe(d.current),function(){e.disconnect()}}},[]),t.createElement(s,{$height:f,$duration:u,className:c,style:l},t.createElement("div",{ref:d},i))};export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"react";import{Button as t,Loader as
|
|
1
|
+
import{observer as o}from"mobx-react";import e from"react";import{Button as t,LoaderWrapper as r,Loader as i}from"./style.js";var l=o(function(o){var l=o.children,d=o.onClick,a=o.button,n=o.fontSize,s=o.paddingSize,b=o.fullWidth,m=void 0!==b&&b,u=o.disabled,c=void 0!==u&&u,f=o.isLoading,C=void 0!==f&&f;return e.createElement(t,{onClick:d,fullWidth:m,fontSize:n,paddingSize:s,borderRadius:a.buttonRadius,bgColor:a.bgColor,textColor:a.textColor,borderColor:a.borderColor,disabled:c||C},e.createElement(r,{className:C?"visible":""},e.createElement(i,null)),l)});export{l as default};
|
|
@@ -11,5 +11,6 @@ type ButtonProps = {
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
};
|
|
13
13
|
export declare const Button: import("styled-components").StyledComponent<"button", any, ButtonProps, never>;
|
|
14
|
+
export declare const LoaderWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
15
|
export declare const Loader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
16
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import t,{keyframes as e}from"styled-components";import{textXSMedium as r,textSM as i,textSMMedium as o,textMDMedium as a,textLGSemiBold as d,displayXSSemiBold as s}from"../style/typography.js";var p,l,u,c,m={textXSMedium:r,textSM:i,textSMMedium:o,textMDMedium:a,textLGSemiBold:d,displayXSSemiBold:s},x={small:"8px",medium:"10px 16px"},g=t.button(p||(p=n(["\n border: none;\n cursor: ",";\n transition: all 0.2s ease;\n opacity: ",";\n /* pointer-events removed to allow cursor: not-allowed */\n\n ","\n\n padding: ",";\n border-radius: ","px;\n width: ",";\n background-color: ",";\n color: ",";\n border: ",";\n\n display: flex;\n align-items: center;\n justify-content: center;\n justify-content: center;\n /* gap: 8px; Removed to handle spacing via LoaderWrapper transition */\n\n &:hover {\n opacity: ",";\n }\n"],["\n border: none;\n cursor: ",";\n transition: all 0.2s ease;\n opacity: ",";\n /* pointer-events removed to allow cursor: not-allowed */\n\n ","\n\n padding: ",";\n border-radius: ","px;\n width: ",";\n background-color: ",";\n color: ",";\n border: ",";\n\n display: flex;\n align-items: center;\n justify-content: center;\n justify-content: center;\n /* gap: 8px; Removed to handle spacing via LoaderWrapper transition */\n\n &:hover {\n opacity: ",";\n }\n"])),function(n){return n.disabled?"not-allowed":"pointer"},function(n){return n.disabled?.5:1},function(n){return m[n.fontSize]},function(n){return x[n.paddingSize]},function(n){return n.borderRadius},function(n){return n.fullWidth?"100%":"auto"},function(n){var t;return null!==(t=n.bgColor)&&void 0!==t?t:"transparent"},function(n){var t;return null!==(t=n.textColor)&&void 0!==t?t:"inherit"},function(n){return n.borderColor?"1px solid ".concat(n.borderColor):"none"},function(n){return n.disabled?.5:.9}),h=e(l||(l=n(["\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n"],["\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n"]))),f=t.div(u||(u=n(["\n display: flex;\n align-items: center;\n overflow: hidden;\n max-width: 0;\n opacity: 0;\n margin-right: 0;\n transition:\n max-width 0.3s ease-in-out,\n opacity 0.3s ease-in-out,\n margin-right 0.3s ease-in-out;\n\n &.visible {\n max-width: 20px; /* 14px width + extra space */\n opacity: 1;\n margin-right: 4px; /* Adjust gap here instead of parent gap */\n }\n"],["\n display: flex;\n align-items: center;\n overflow: hidden;\n max-width: 0;\n opacity: 0;\n margin-right: 0;\n transition:\n max-width 0.3s ease-in-out,\n opacity 0.3s ease-in-out,\n margin-right 0.3s ease-in-out;\n\n &.visible {\n max-width: 20px; /* 14px width + extra space */\n opacity: 1;\n margin-right: 4px; /* Adjust gap here instead of parent gap */\n }\n"]))),b=t.div(c||(c=n(["\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid currentColor;\n border-radius: 50%;\n width: 14px;\n height: 14px;\n min-width: 14px;\n animation: "," 1s linear infinite;\n"],["\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid currentColor;\n border-radius: 50%;\n width: 14px;\n height: 14px;\n min-width: 14px;\n animation: "," 1s linear infinite;\n"])),h);export{g as Button,b as Loader,f as LoaderWrapper};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r,{useState as n,useRef as t,useEffect as e}from"react";var u=function(u){var a=u.end,c=u.duration,i=void 0===c?1e3:c,o=n(a),m=o[0],l=o[1],f=t(null),v=t(a);return e(function(){var r;v.current=m,f.current=null;var n=function(t){f.current||(f.current=t);var e=Math.min((t-f.current)/i,1),u=1-Math.pow(1-e,4),c=Math.round(v.current+(a-v.current)*u);l(c),e<1&&(r=requestAnimationFrame(n))};return r=requestAnimationFrame(n),function(){return cancelAnimationFrame(r)}},[a,i]),r.createElement(r.Fragment,null,m)};export{u as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type FlexibleValueContainerProps = {
|
|
3
|
+
children: React.ReactNode | ((isWrapped: boolean) => React.ReactNode);
|
|
4
|
+
gap?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A container that switches flex-direction to 'column' if its children wrap
|
|
10
|
+
* when in 'row' layout.
|
|
11
|
+
*
|
|
12
|
+
* Uses a hidden clone ("Detector") to constantly monitor if a standard row layout
|
|
13
|
+
* would wrap given the current width constraint.
|
|
14
|
+
*/
|
|
15
|
+
export declare const FlexibleValueContainer: React.FC<FlexibleValueContainerProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import e,{useRef as t,useState as i,useLayoutEffect as r}from"react";import o from"styled-components";var a,s,p=o.div(a||(a=n(["\n display: flex;\n flex-direction: ",";\n align-items: ",";\n gap: ","px;\n flex-wrap: wrap;\n position: relative;\n width: 100%; /* Ensure it takes available width to properly constrain the detector */\n"],["\n display: flex;\n flex-direction: ",";\n align-items: ",";\n gap: ","px;\n flex-wrap: wrap;\n position: relative;\n width: 100%; /* Ensure it takes available width to properly constrain the detector */\n"])),function(n){return n.$isWrapped?"column":"row"},function(n){return n.$isWrapped?"flex-start":"center"},function(n){return n.$gap}),l=o.div(s||(s=n(["\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: ","px;\n align-items: center;\n\n /* Positioning to match the container's width constraint */\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n\n /* Hide from view and interaction */\n visibility: hidden;\n pointer-events: none;\n z-index: -100;\n opacity: 0;\n"],["\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: ","px;\n align-items: center;\n\n /* Positioning to match the container's width constraint */\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n\n /* Hide from view and interaction */\n visibility: hidden;\n pointer-events: none;\n z-index: -100;\n opacity: 0;\n"])),function(n){return n.$gap}),c=function(n){var o=n.children,a=n.gap,s=void 0===a?6:a,c=n.className,d=n.style,f=t(null),u=i(!1),m=u[0],v=u[1];r(function(){var n=function(){if(f.current){var n=f.current,e=Array.from(n.children);if(e.length<2)v(!1);else{var t=e[0].offsetTop,i=e[e.length-1].offsetTop;v(i>t+2)}}};n();var e=new ResizeObserver(n);return f.current&&e.observe(f.current),function(){return e.disconnect()}},[o]);var w="function"==typeof o?o(m):o,h="function"==typeof o?o(!1):o;return e.createElement(p,{className:c,style:d,$isWrapped:m,$gap:s},w,e.createElement(l,{ref:f,$gap:s,"aria-hidden":"true"},h))};export{c as FlexibleValueContainer};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
|
|
3
2
|
import { LoyaltyWidgetButton } from "models/button";
|
|
3
|
+
import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
|
|
4
4
|
export type LoyaltyMethodCardProps = {
|
|
5
5
|
title: string;
|
|
6
6
|
description: string | React.ReactNode;
|
|
@@ -8,6 +8,7 @@ export type LoyaltyMethodCardProps = {
|
|
|
8
8
|
action?: {
|
|
9
9
|
text: string;
|
|
10
10
|
onClick: () => void;
|
|
11
|
+
loading?: boolean;
|
|
11
12
|
};
|
|
12
13
|
isCompleted?: boolean;
|
|
13
14
|
mode: "card" | "accordion";
|