@ikas/loyalty-widget-renderer 1.0.0-alpha.1
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/_virtual/index.js +1 -0
- package/build/_virtual/index2.js +1 -0
- package/build/_virtual/index3.js +1 -0
- package/build/_virtual/react-is.development.js +1 -0
- package/build/_virtual/react-is.development2.js +1 -0
- package/build/_virtual/react-is.production.js +1 -0
- package/build/_virtual/react-is.production.min.js +1 -0
- package/build/_virtual/use-sync-external-store-shim.development.js +1 -0
- package/build/_virtual/use-sync-external-store-shim.production.js +1 -0
- package/build/assets/badgeLevel1.d.ts +2 -0
- package/build/assets/badgeLevel1.js +1 -0
- package/build/assets/badgeLevel2.d.ts +2 -0
- package/build/assets/badgeLevel2.js +1 -0
- package/build/assets/badgeLevel3.d.ts +2 -0
- package/build/assets/badgeLevel3.js +1 -0
- package/build/assets/badgeLevel4.d.ts +2 -0
- package/build/assets/badgeLevel4.js +1 -0
- package/build/assets/icons/check-circle-fill.d.ts +2 -0
- package/build/assets/icons/check-circle-fill.js +1 -0
- package/build/assets/icons/check.d.ts +2 -0
- package/build/assets/icons/check.js +1 -0
- package/build/assets/icons/chevron-left.d.ts +2 -0
- package/build/assets/icons/chevron-left.js +1 -0
- package/build/assets/icons/x-close.d.ts +2 -0
- package/build/assets/icons/x-close.js +1 -0
- package/build/assets/index.d.ts +27 -0
- package/build/assets/widget-icons/illustraions/approvedChatIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/approvedChatIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/bankCoin.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/bankCoin.js +1 -0
- package/build/assets/widget-icons/illustraions/bigSaleMedal.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/bigSaleMedal.js +1 -0
- package/build/assets/widget-icons/illustraions/bubbleChatIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/bubbleChatIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/giftIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/giftIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/medal.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/medal.js +1 -0
- package/build/assets/widget-icons/illustraions/shippingBox.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/shippingBox.js +1 -0
- package/build/assets/widget-icons/illustraions/shoppingCartIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/shoppingCartIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/tshirtIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/tshirtIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/usersIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/usersIllustration.js +1 -0
- package/build/assets/widget-icons/normal/bubbleChatDone.d.ts +2 -0
- package/build/assets/widget-icons/normal/bubbleChatDone.js +1 -0
- package/build/assets/widget-icons/normal/commentAdd01.d.ts +2 -0
- package/build/assets/widget-icons/normal/commentAdd01.js +1 -0
- package/build/assets/widget-icons/normal/couponPercent.d.ts +2 -0
- package/build/assets/widget-icons/normal/couponPercent.js +1 -0
- package/build/assets/widget-icons/normal/discountTag02.d.ts +2 -0
- package/build/assets/widget-icons/normal/discountTag02.js +1 -0
- package/build/assets/widget-icons/normal/gift.d.ts +2 -0
- package/build/assets/widget-icons/normal/gift.js +1 -0
- package/build/assets/widget-icons/normal/moneyAdd01.d.ts +2 -0
- package/build/assets/widget-icons/normal/moneyAdd01.js +1 -0
- package/build/assets/widget-icons/normal/packageDelivered.d.ts +2 -0
- package/build/assets/widget-icons/normal/packageDelivered.js +1 -0
- package/build/assets/widget-icons/normal/saveMoneyDollar.d.ts +2 -0
- package/build/assets/widget-icons/normal/saveMoneyDollar.js +1 -0
- package/build/assets/widget-icons/normal/shoppingBasketAdd02.d.ts +2 -0
- package/build/assets/widget-icons/normal/shoppingBasketAdd02.js +1 -0
- package/build/assets/widget-icons/normal/userAdd01.d.ts +2 -0
- package/build/assets/widget-icons/normal/userAdd01.js +1 -0
- package/build/ext/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js +1 -0
- package/build/ext/@emotion/memoize/dist/memoize.browser.esm.js +1 -0
- package/build/ext/@emotion/stylis/dist/stylis.browser.esm.js +1 -0
- package/build/ext/@emotion/unitless/dist/unitless.browser.esm.js +1 -0
- package/build/ext/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -0
- package/build/ext/hoist-non-react-statics/ext/react-is/cjs/react-is.development.js +9 -0
- package/build/ext/hoist-non-react-statics/ext/react-is/cjs/react-is.production.min.js +9 -0
- package/build/ext/hoist-non-react-statics/ext/react-is/index.js +1 -0
- package/build/ext/i18next/dist/esm/i18next.js +1 -0
- package/build/ext/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js +1 -0
- package/build/ext/react-i18next/dist/es/context.js +1 -0
- package/build/ext/react-i18next/dist/es/defaults.js +1 -0
- package/build/ext/react-i18next/dist/es/i18nInstance.js +1 -0
- package/build/ext/react-i18next/dist/es/initReactI18next.js +1 -0
- package/build/ext/react-i18next/dist/es/unescape.js +1 -0
- package/build/ext/react-i18next/dist/es/useTranslation.js +1 -0
- package/build/ext/react-i18next/dist/es/utils.js +1 -0
- package/build/ext/react-is/cjs/react-is.development.js +10 -0
- package/build/ext/react-is/cjs/react-is.production.js +10 -0
- package/build/ext/react-is/index.js +1 -0
- package/build/ext/styled-components/dist/styled-components.browser.esm.js +1 -0
- package/build/ext/tslib/tslib.es6.mjs.js +1 -0
- package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +10 -0
- package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +10 -0
- package/build/ext/use-sync-external-store/shim/index.js +1 -0
- package/build/ext/uuid/dist/esm-browser/md5.js +1 -0
- package/build/ext/uuid/dist/esm-browser/parse.js +1 -0
- package/build/ext/uuid/dist/esm-browser/regex.js +1 -0
- package/build/ext/uuid/dist/esm-browser/rng.js +1 -0
- package/build/ext/uuid/dist/esm-browser/sha1.js +1 -0
- package/build/ext/uuid/dist/esm-browser/stringify.js +1 -0
- package/build/ext/uuid/dist/esm-browser/v3.js +1 -0
- package/build/ext/uuid/dist/esm-browser/v35.js +1 -0
- package/build/ext/uuid/dist/esm-browser/v4.js +1 -0
- package/build/ext/uuid/dist/esm-browser/v5.js +1 -0
- package/build/ext/uuid/dist/esm-browser/validate.js +1 -0
- package/build/index.d.ts +12 -0
- package/build/index.js +1 -0
- package/build/models/base.d.ts +4 -0
- package/build/models/base.js +1 -0
- package/build/models/button/index.d.ts +7 -0
- package/build/models/button/index.js +1 -0
- package/build/models/category/index.d.ts +5 -0
- package/build/models/image/index.d.ts +12 -0
- package/build/models/image/index.js +1 -0
- package/build/models/index.d.ts +28 -0
- package/build/models/index.js +1 -0
- package/build/models/loyalty-customer-info/index.d.ts +28 -0
- package/build/models/loyalty-customer-info/index.js +1 -0
- package/build/models/loyalty-program-earning-method/index.d.ts +51 -0
- package/build/models/loyalty-program-earning-method/index.js +1 -0
- package/build/models/loyalty-program-point-history/index.d.ts +17 -0
- package/build/models/loyalty-program-point-history/index.js +1 -0
- package/build/models/loyalty-program-spending-method/index.d.ts +38 -0
- package/build/models/loyalty-program-spending-method/index.js +1 -0
- package/build/models/loyalty-widget/header/header-background/index.d.ts +9 -0
- package/build/models/loyalty-widget/header/header-background/index.js +1 -0
- package/build/models/loyalty-widget/header/index.d.ts +8 -0
- package/build/models/loyalty-widget/header/index.js +1 -0
- package/build/models/loyalty-widget/header-background/index.d.ts +9 -0
- package/build/models/loyalty-widget/index.d.ts +12 -0
- package/build/models/loyalty-widget/index.js +1 -0
- package/build/models/loyalty-widget/settings/index.d.ts +10 -0
- package/build/models/loyalty-widget/settings/index.js +1 -0
- package/build/models/loyalty-widget/types/index.d.ts +29 -0
- package/build/models/loyalty-widget/types/index.js +1 -0
- package/build/models/types/index.d.ts +145 -0
- package/build/models/types/index.js +1 -0
- package/build/renderer/components/button/index.d.ts +15 -0
- package/build/renderer/components/button/index.js +1 -0
- package/build/renderer/components/button/style.d.ts +15 -0
- package/build/renderer/components/button/style.js +1 -0
- package/build/renderer/components/index.d.ts +3 -0
- package/build/renderer/components/loyalty-method-card/index.d.ts +23 -0
- package/build/renderer/components/loyalty-method-card/index.js +1 -0
- package/build/renderer/components/loyalty-method-card/style.d.ts +22 -0
- package/build/renderer/components/loyalty-method-card/style.js +1 -0
- package/build/renderer/components/section-title/index.d.ts +8 -0
- package/build/renderer/components/section-title/index.js +1 -0
- package/build/renderer/components/section-title/style.d.ts +1 -0
- package/build/renderer/components/section-title/style.js +1 -0
- package/build/renderer/components/style/typography.d.ts +11 -0
- package/build/renderer/components/style/typography.js +1 -0
- package/build/renderer/index.d.ts +5 -0
- package/build/renderer/index.js +1 -0
- package/build/renderer/screens/credit-earning-methods-screen/index.d.ts +9 -0
- package/build/renderer/screens/credit-earning-methods-screen/index.js +1 -0
- package/build/renderer/screens/credit-earning-methods-screen/style.d.ts +5 -0
- package/build/renderer/screens/credit-earning-methods-screen/style.js +1 -0
- package/build/renderer/screens/credit-history-screen/index.d.ts +9 -0
- package/build/renderer/screens/credit-history-screen/index.js +1 -0
- package/build/renderer/screens/credit-history-screen/style.d.ts +17 -0
- package/build/renderer/screens/credit-history-screen/style.js +1 -0
- package/build/renderer/screens/credit-spending-methods-screen/index.d.ts +9 -0
- package/build/renderer/screens/credit-spending-methods-screen/index.js +1 -0
- package/build/renderer/screens/credit-spending-methods-screen/style.d.ts +8 -0
- package/build/renderer/screens/credit-spending-methods-screen/style.js +1 -0
- package/build/renderer/screens/loyalty-level-screen/index.d.ts +9 -0
- package/build/renderer/screens/loyalty-level-screen/index.js +1 -0
- package/build/renderer/screens/loyalty-level-screen/style.d.ts +32 -0
- package/build/renderer/screens/loyalty-level-screen/style.js +1 -0
- package/build/renderer/screens/main-screen/earning-methods-section/index.d.ts +14 -0
- package/build/renderer/screens/main-screen/earning-methods-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/auth-user-section/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/auth-user-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/auth-user-section/style.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/auth-user-section/style.js +1 -0
- package/build/renderer/screens/main-screen/header/index.d.ts +10 -0
- package/build/renderer/screens/main-screen/header/index.js +1 -0
- package/build/renderer/screens/main-screen/header/logo-section/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/logo-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/logo-section/style.d.ts +2 -0
- package/build/renderer/screens/main-screen/header/logo-section/style.js +1 -0
- package/build/renderer/screens/main-screen/header/style.d.ts +12 -0
- package/build/renderer/screens/main-screen/header/style.js +1 -0
- package/build/renderer/screens/main-screen/header/title-section/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/title-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/title-section/style.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/title-section/style.js +1 -0
- package/build/renderer/screens/main-screen/header/user-logged-section/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/user-logged-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/user-logged-section/style.d.ts +18 -0
- package/build/renderer/screens/main-screen/header/user-logged-section/style.js +1 -0
- package/build/renderer/screens/main-screen/index.d.ts +9 -0
- package/build/renderer/screens/main-screen/index.js +1 -0
- package/build/renderer/screens/main-screen/program-info-section/index.d.ts +8 -0
- package/build/renderer/screens/main-screen/program-info-section/index.js +1 -0
- package/build/renderer/screens/main-screen/program-info-section/style.d.ts +8 -0
- package/build/renderer/screens/main-screen/program-info-section/style.js +1 -0
- package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.d.ts +9 -0
- package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.js +1 -0
- package/build/renderer/screens/main-screen/spending-methods-section/index.d.ts +13 -0
- package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -0
- package/build/renderer/screens/main-screen/style.d.ts +5 -0
- package/build/renderer/screens/main-screen/style.js +1 -0
- package/build/renderer/style.d.ts +6 -0
- package/build/renderer/style.js +1 -0
- package/build/renderer/utils/i18n.d.ts +2 -0
- package/build/renderer/utils/i18n.js +1 -0
- package/build/renderer/utils/locales/en.json.js +1 -0
- package/build/renderer/utils/locales/tr.json.js +1 -0
- package/build/renderer/utils/loyalty-details.d.ts +12 -0
- package/build/renderer/utils/loyalty-details.js +1 -0
- package/build/renderer/utils/translations.d.ts +5 -0
- package/build/utils.d.ts +10 -0
- package/build/utils.js +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LoyaltyProgramPeriod } from "../types";
|
|
2
|
+
export declare class LoyaltyProgramTierTranslation {
|
|
3
|
+
locale: string;
|
|
4
|
+
name: string;
|
|
5
|
+
constructor(data?: Partial<LoyaltyProgramTierTranslation>);
|
|
6
|
+
}
|
|
7
|
+
export declare class LoyaltyProgramTier {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
pointsRequired: number;
|
|
11
|
+
tierPointMultiplier: number;
|
|
12
|
+
loyaltyProgramId: string;
|
|
13
|
+
customerSegmentId: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
deleted: boolean;
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
period: LoyaltyProgramPeriod | null;
|
|
19
|
+
translations: LoyaltyProgramTierTranslation[];
|
|
20
|
+
constructor(data?: Partial<LoyaltyProgramTier>);
|
|
21
|
+
}
|
|
22
|
+
export declare class LoyaltyCustomerInfo {
|
|
23
|
+
customerTierId: LoyaltyProgramTier | null;
|
|
24
|
+
loyaltyProgramCustomerId: string;
|
|
25
|
+
loyaltyProgramId: string;
|
|
26
|
+
totalPoint: number;
|
|
27
|
+
constructor(data?: Partial<LoyaltyCustomerInfo>);
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPeriod as i}from"../types/index.js";var o=function(i){void 0===i&&(i={}),this.locale=i.locale||"",this.name=i.name||"",t(this,{locale:e,name:e})},r=function(r){void 0===r&&(r={}),this.id=r.id||"",this.name=r.name||"",this.pointsRequired=r.pointsRequired||0,this.tierPointMultiplier=r.tierPointMultiplier||0,this.loyaltyProgramId=r.loyaltyProgramId||"",this.customerSegmentId=r.customerSegmentId||"",this.createdAt=r.createdAt||"",this.updatedAt=r.updatedAt||"",this.deleted=r.deleted||!1,this.isActive=r.isActive||!1,this.period=r.period?new i(r.period):null,this.translations=r.translations?r.translations.map(function(t){return new o(t)}):[],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.customerTierId=i.customerTierId?new r(i.customerTierId):null,this.loyaltyProgramCustomerId=i.loyaltyProgramCustomerId||"",this.loyaltyProgramId=i.loyaltyProgramId||"",this.totalPoint=i.totalPoint||0,t(this,{customerTierId:e,loyaltyProgramCustomerId:e,loyaltyProgramId:e,totalPoint:e})};export{s as LoyaltyCustomerInfo,r as LoyaltyProgramTier,o as LoyaltyProgramTierTranslation};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { EarningMethodTypeEnum, LoyaltyProgramPointEarningTypeEnum, LoyaltyProgramPeriod, LoyaltyProgramFilterTypeEnum } from "../types";
|
|
2
|
+
export declare class LoyaltyProgramPointLimit {
|
|
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
|
+
}
|
|
12
|
+
export declare class LoyaltyProgramEarningMethodOrderSettings {
|
|
13
|
+
maxOrderAmount: number;
|
|
14
|
+
minOrderAmount: number;
|
|
15
|
+
productFilters: LoyaltyProgramFilter[];
|
|
16
|
+
constructor(data?: Partial<LoyaltyProgramEarningMethodOrderSettings>);
|
|
17
|
+
}
|
|
18
|
+
export declare class LoyaltyProgramEarningMethodProductSettings {
|
|
19
|
+
maxProductQuantity: number;
|
|
20
|
+
minProductQuantity: number;
|
|
21
|
+
productFilters: LoyaltyProgramFilter[];
|
|
22
|
+
constructor(data?: Partial<LoyaltyProgramEarningMethodProductSettings>);
|
|
23
|
+
}
|
|
24
|
+
export declare class LoyaltyProgramMethodTranslation {
|
|
25
|
+
description: string;
|
|
26
|
+
locale: string;
|
|
27
|
+
constructor(data?: Partial<LoyaltyProgramMethodTranslation>);
|
|
28
|
+
}
|
|
29
|
+
export declare class LoyaltyProgramEarningMethod {
|
|
30
|
+
amountPerPointsEarned: number;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
deleted: boolean;
|
|
33
|
+
description: string;
|
|
34
|
+
earnedPointLimit: LoyaltyProgramPointLimit | null;
|
|
35
|
+
id: string;
|
|
36
|
+
isActive: boolean;
|
|
37
|
+
lastValidityDate: string;
|
|
38
|
+
loyaltyProgramId: string;
|
|
39
|
+
methodType: EarningMethodTypeEnum;
|
|
40
|
+
orderSettings: LoyaltyProgramEarningMethodOrderSettings | null;
|
|
41
|
+
pointEarningType: LoyaltyProgramPointEarningTypeEnum;
|
|
42
|
+
pointsEarned: number;
|
|
43
|
+
productSettings: LoyaltyProgramEarningMethodProductSettings | null;
|
|
44
|
+
quantityPerPointsEarned: number;
|
|
45
|
+
segmentId: string;
|
|
46
|
+
tierIds: string[];
|
|
47
|
+
translations: LoyaltyProgramMethodTranslation[];
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
validityPeriod: LoyaltyProgramPeriod | null;
|
|
50
|
+
constructor(data?: Partial<LoyaltyProgramEarningMethod>);
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeObservable as t,observable as i}from"mobx";import{EarningMethodTypeEnum as n,LoyaltyProgramPointEarningTypeEnum as e,LoyaltyProgramPeriod as r,LoyaltyProgramFilterTypeEnum as o}from"../types/index.js";var d=function(n){void 0===n&&(n={}),this.maxPointLimit=n.maxPointLimit||0,this.minPointLimit=n.minPointLimit||0,t(this,{maxPointLimit:i,minPointLimit:i})},s=function(n){void 0===n&&(n={}),this.type=n.type||o.CATEGORY,this.idList=n.idList||[],t(this,{type:i,idList:i})},a=function(n){void 0===n&&(n={}),this.maxOrderAmount=n.maxOrderAmount||0,this.minOrderAmount=n.minOrderAmount||0,this.productFilters=n.productFilters?n.productFilters.map(function(t){return new s(t)}):[],t(this,{maxOrderAmount:i,minOrderAmount:i,productFilters:i})},u=function(n){void 0===n&&(n={}),this.maxProductQuantity=n.maxProductQuantity||0,this.minProductQuantity=n.minProductQuantity||0,this.productFilters=n.productFilters?n.productFilters.map(function(t){return new s(t)}):[],t(this,{maxProductQuantity:i,minProductQuantity:i,productFilters:i})},m=function(n){void 0===n&&(n={}),this.description=n.description||"",this.locale=n.locale||"",t(this,{description:i,locale:i})},l=function(o){void 0===o&&(o={}),this.amountPerPointsEarned=o.amountPerPointsEarned||0,this.createdAt=o.createdAt||"",this.deleted=o.deleted||!1,this.description=o.description||"",this.earnedPointLimit=o.earnedPointLimit?new d(o.earnedPointLimit):null,this.id=o.id||"",this.isActive=o.isActive||!1,this.lastValidityDate=o.lastValidityDate||"",this.loyaltyProgramId=o.loyaltyProgramId||"",this.methodType=o.methodType||n.ORDER_CREATE,this.orderSettings=o.orderSettings?new a(o.orderSettings):null,this.pointEarningType=o.pointEarningType||e.STATIC,this.pointsEarned=o.pointsEarned||0,this.productSettings=o.productSettings?new u(o.productSettings):null,this.quantityPerPointsEarned=o.quantityPerPointsEarned||0,this.segmentId=o.segmentId||"",this.tierIds=o.tierIds||[],this.translations=o.translations?o.translations.map(function(t){return new m(t)}):[],this.updatedAt=o.updatedAt||"",this.validityPeriod=o.validityPeriod?new r(o.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{l as LoyaltyProgramEarningMethod,a as LoyaltyProgramEarningMethodOrderSettings,u as LoyaltyProgramEarningMethodProductSettings,s as LoyaltyProgramFilter,m as LoyaltyProgramMethodTranslation,d as LoyaltyProgramPointLimit};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LoyaltyProgramPointHistoryTypeEnum } from "../types";
|
|
2
|
+
export declare class LoyaltyProgramPointHistory {
|
|
3
|
+
amount: number;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
customerId: string;
|
|
6
|
+
deleted: boolean;
|
|
7
|
+
expireDate: string | null;
|
|
8
|
+
id: string;
|
|
9
|
+
loyaltyProgramCustomerId: string;
|
|
10
|
+
loyaltyProgramEarningMethodId: string | null;
|
|
11
|
+
loyaltyProgramId: string;
|
|
12
|
+
loyaltyProgramSpendingMethodId: string | null;
|
|
13
|
+
orderId: string | null;
|
|
14
|
+
type: LoyaltyProgramPointHistoryTypeEnum;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
constructor(data?: Partial<LoyaltyProgramPointHistory>);
|
|
17
|
+
}
|
|
@@ -0,0 +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||"",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||"",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};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LoyaltyProgramMethodSpendingTypeEnum, LoyaltyProgramFilterTypeEnum } 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
|
+
idList: string[];
|
|
9
|
+
type: LoyaltyProgramFilterTypeEnum;
|
|
10
|
+
constructor(data?: Partial<LoyaltyProgramFilter>);
|
|
11
|
+
}
|
|
12
|
+
export declare class LoyaltyProgramDiscountSettings {
|
|
13
|
+
discountAmount: number | null;
|
|
14
|
+
freeProductId: string | null;
|
|
15
|
+
point: number;
|
|
16
|
+
constructor(data?: Partial<LoyaltyProgramDiscountSettings>);
|
|
17
|
+
}
|
|
18
|
+
export declare class LoyaltyProgramMethodTranslation {
|
|
19
|
+
description: string | null;
|
|
20
|
+
locale: string | null;
|
|
21
|
+
constructor(data?: Partial<LoyaltyProgramMethodTranslation>);
|
|
22
|
+
}
|
|
23
|
+
export declare class LoyaltyProgramSpendingMethod {
|
|
24
|
+
createdAt: string;
|
|
25
|
+
deleted: boolean;
|
|
26
|
+
description: string | null;
|
|
27
|
+
discountSettings: LoyaltyProgramDiscountSettings | null;
|
|
28
|
+
id: string;
|
|
29
|
+
isActive: boolean;
|
|
30
|
+
isDynamic: boolean;
|
|
31
|
+
loyaltyProgramId: string;
|
|
32
|
+
pointUsageLimit: LoyaltyProgramPointLimit | null;
|
|
33
|
+
productFilters: LoyaltyProgramFilter[];
|
|
34
|
+
translations: LoyaltyProgramMethodTranslation[];
|
|
35
|
+
type: LoyaltyProgramMethodSpendingTypeEnum;
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
constructor(data?: Partial<LoyaltyProgramSpendingMethod>);
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramMethodSpendingTypeEnum as n,LoyaltyProgramFilterTypeEnum as s}from"../types/index.js";var o=function(n){void 0===n&&(n={}),this.maxPointLimit=n.maxPointLimit||null,this.minPointLimit=n.minPointLimit||null,t(this,{maxPointLimit:i,minPointLimit:i})},e=function(n){void 0===n&&(n={}),this.idList=n.idList||[],this.type=n.type||s.PRODUCT_AND_VARIANT,t(this,{idList:i,type:i})},d=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})},r=function(n){void 0===n&&(n={}),this.description=n.description||null,this.locale=n.locale||null,t(this,{description:i,locale:i})},l=function(s){void 0===s&&(s={}),this.createdAt=s.createdAt||"",this.deleted=s.deleted||!1,this.description=s.description||null,this.discountSettings=s.discountSettings?new d(s.discountSettings):null,this.id=s.id||"",this.isActive=s.isActive||!1,this.isDynamic=s.isDynamic||!1,this.loyaltyProgramId=s.loyaltyProgramId||"",this.pointUsageLimit=s.pointUsageLimit?new o(s.pointUsageLimit):null,this.productFilters=s.productFilters?s.productFilters.map(function(t){return new e(t)}):[],this.translations=s.translations?s.translations.map(function(t){return new r(t)}):[],this.type=s.type||n.FIXED_AMOUNT,this.updatedAt=s.updatedAt||"",t(this,{createdAt:i,deleted:i,description:i,discountSettings:i,id:i,isActive:i,isDynamic:i,loyaltyProgramId:i,pointUsageLimit:i,productFilters:i,translations:i,type:i,updatedAt:i})};export{d as LoyaltyProgramDiscountSettings,e as LoyaltyProgramFilter,r as LoyaltyProgramMethodTranslation,o as LoyaltyProgramPointLimit,l as LoyaltyProgramSpendingMethod};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel } from "models/base";
|
|
2
|
+
import { LoyaltyWidgetImage } from "models/image";
|
|
3
|
+
import { HeaderBackgroundTypeEnum } from "../../types";
|
|
4
|
+
export declare class LoyaltyWidgetHeaderBackground extends BaseModel {
|
|
5
|
+
bgColor: string | null;
|
|
6
|
+
image: LoyaltyWidgetImage | null;
|
|
7
|
+
type: HeaderBackgroundTypeEnum;
|
|
8
|
+
constructor(data: Partial<LoyaltyWidgetHeaderBackground>);
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__extends as o}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{makeObservable as r,observable as e}from"mobx";import{BaseModel as i}from"../../../base.js";import{LoyaltyWidgetImage as m}from"../../../image/index.js";import{HeaderBackgroundTypeEnum as t}from"../../types/index.js";var s=function(i){function s(o){var s=i.call(this,o)||this;return s.bgColor=o.bgColor||null,s.image=o.image?new m(o.image):null,s.type=o.type||t.COLOR,r(s,{bgColor:e,image:e,type:e}),s}return o(s,i),s}(i);export{s as LoyaltyWidgetHeaderBackground};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LoyaltyWidgetImage } from "models/image";
|
|
2
|
+
import { LoyaltyWidgetHeaderBackground } from "./header-background";
|
|
3
|
+
export declare class LoyaltyWidgetHeader {
|
|
4
|
+
logo: LoyaltyWidgetImage;
|
|
5
|
+
background: LoyaltyWidgetHeaderBackground;
|
|
6
|
+
textColor: string | null;
|
|
7
|
+
constructor(data?: Partial<LoyaltyWidgetHeader>);
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel } from "models/base";
|
|
2
|
+
import { LoyaltyWidgetImage } from "models/image";
|
|
3
|
+
import { HeaderBackgroundTypeEnum } from "../types";
|
|
4
|
+
export declare class LoyaltyWidgetHeaderBackground extends BaseModel {
|
|
5
|
+
bgColor: string | null;
|
|
6
|
+
image: LoyaltyWidgetImage | null;
|
|
7
|
+
type: HeaderBackgroundTypeEnum;
|
|
8
|
+
constructor(data: Partial<LoyaltyWidgetHeaderBackground>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LoyaltyWidgetImage } from "../image";
|
|
2
|
+
import { LoyaltyWidgetButton } from "../button";
|
|
3
|
+
import { LoyaltyWidgetHeader } from "./header";
|
|
4
|
+
import { LoyaltyWidgetSettings } from "./settings";
|
|
5
|
+
export declare class LoyaltyWidget {
|
|
6
|
+
id: string;
|
|
7
|
+
settings: LoyaltyWidgetSettings;
|
|
8
|
+
header: LoyaltyWidgetHeader;
|
|
9
|
+
button: LoyaltyWidgetButton;
|
|
10
|
+
miniModeLogo: LoyaltyWidgetImage;
|
|
11
|
+
constructor(data?: Partial<LoyaltyWidget>);
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeObservable as e,observable as i}from"mobx";import'./../../ext/uuid/dist/esm-browser/stringify.js';import'./../../ext/uuid/dist/esm-browser/v3.js';import o from'./../../ext/uuid/dist/esm-browser/v4.js';import'./../../ext/uuid/dist/esm-browser/v5.js';import{LoyaltyWidgetImage as t}from"../image/index.js";import{LoyaltyWidgetButton as s}from"../button/index.js";import{LoyaltyWidgetHeader as d}from"./header/index.js";import{LoyaltyWidgetSettings as n}from"./settings/index.js";var r=function(r){void 0===r&&(r={}),this.id=r.id||o(),this.header=r.header?new d(r.header):new d({}),this.settings=r.settings?new n(r.settings):new n({}),this.miniModeLogo=r.miniModeLogo?new t(r.miniModeLogo):new t({}),this.button=r.button?new s(r.button):new s({}),e(this,{id:i,miniModeLogo:i,button:i,header:i,settings:i})};export{r as LoyaltyWidget};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BadgeIconTypeEnum, LoyaltyWidgetLayoutTypeEnum, WidgetIconTypeEnum, WidgetPositionEnum } from "../types";
|
|
2
|
+
export declare class LoyaltyWidgetSettings {
|
|
3
|
+
position: WidgetPositionEnum;
|
|
4
|
+
type: LoyaltyWidgetLayoutTypeEnum;
|
|
5
|
+
primaryColor: string | null;
|
|
6
|
+
cartBorderRadius: number;
|
|
7
|
+
widgetIconType: WidgetIconTypeEnum;
|
|
8
|
+
badgeIconLevel: BadgeIconTypeEnum;
|
|
9
|
+
constructor(data?: Partial<LoyaltyWidgetSettings>);
|
|
10
|
+
}
|
|
@@ -0,0 +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.WIDGET,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,29 @@
|
|
|
1
|
+
export declare enum LoyaltyWidgetLayoutTypeEnum {
|
|
2
|
+
DRAWER = "DRAWER",
|
|
3
|
+
WIDGET = "WIDGET"
|
|
4
|
+
}
|
|
5
|
+
export declare enum BadgeIconTypeEnum {
|
|
6
|
+
LEVEL_1 = "LEVEL_1",
|
|
7
|
+
LEVEL_2 = "LEVEL_2",
|
|
8
|
+
LEVEL_3 = "LEVEL_3",
|
|
9
|
+
LEVEL_4 = "LEVEL_4",
|
|
10
|
+
NONE = "NONE"
|
|
11
|
+
}
|
|
12
|
+
export declare enum WidgetIconTypeEnum {
|
|
13
|
+
NORMAL = "NORMAL",
|
|
14
|
+
ILLUSTRATION = "ILLUSTRATION",
|
|
15
|
+
NONE = "NONE"
|
|
16
|
+
}
|
|
17
|
+
export declare enum WidgetPositionEnum {
|
|
18
|
+
LEFT = "LEFT",
|
|
19
|
+
RIGHT = "RIGHT"
|
|
20
|
+
}
|
|
21
|
+
export declare enum HeaderBackgroundTypeEnum {
|
|
22
|
+
COLOR = "COLOR",
|
|
23
|
+
GRADIENT = "GRADIENT",
|
|
24
|
+
IMAGE = "IMAGE"
|
|
25
|
+
}
|
|
26
|
+
export declare enum ImageTypeEnum {
|
|
27
|
+
SHOW = "LOGO",
|
|
28
|
+
NONE = "NONE"
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var E,L,N,O,R,n;!function(E){E.DRAWER="DRAWER",E.WIDGET="WIDGET"}(E||(E={})),function(E){E.LEVEL_1="LEVEL_1",E.LEVEL_2="LEVEL_2",E.LEVEL_3="LEVEL_3",E.LEVEL_4="LEVEL_4",E.NONE="NONE"}(L||(L={})),function(E){E.NORMAL="NORMAL",E.ILLUSTRATION="ILLUSTRATION",E.NONE="NONE"}(N||(N={})),function(E){E.LEFT="LEFT",E.RIGHT="RIGHT"}(O||(O={})),function(E){E.COLOR="COLOR",E.GRADIENT="GRADIENT",E.IMAGE="IMAGE"}(R||(R={})),function(E){E.SHOW="LOGO",E.NONE="NONE"}(n||(n={}));export{L as BadgeIconTypeEnum,R as HeaderBackgroundTypeEnum,n as ImageTypeEnum,E as LoyaltyWidgetLayoutTypeEnum,N as WidgetIconTypeEnum,O as WidgetPositionEnum};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { LoyaltyProgramSpendingMethod } from "../loyalty-program-spending-method";
|
|
2
|
+
import type { LoyaltyProgramEarningMethod } from "../loyalty-program-earning-method";
|
|
3
|
+
import type { LoyaltyCustomerInfo } from "../loyalty-customer-info";
|
|
4
|
+
import type { LoyaltyWidget } from "../loyalty-widget";
|
|
5
|
+
import type { LoyaltyProgramPointHistory } from "../loyalty-program-point-history";
|
|
6
|
+
export declare enum LoyaltyWidgetScreenTypeEnum {
|
|
7
|
+
MAIN_SCREEN = "MAIN_SCREEN",
|
|
8
|
+
CREDIT_SPENDING_METHODS_SCREEN = "CREDIT_SPENDING_METHODS_SCREEN",
|
|
9
|
+
CREDIT_EARNING_METHODS_SCREEN = "CREDIT_EARNING_METHODS_SCREEN",
|
|
10
|
+
CREDIT_HISTORY_SCREEN = "CREDIT_HISTORY_SCREEN",
|
|
11
|
+
LOYALTY_LEVEL_SCREEN = "LOYALTY_LEVEL_SCREEN"
|
|
12
|
+
}
|
|
13
|
+
export declare enum EarningMethodTypeEnum {
|
|
14
|
+
BUY_PRODUCT = "BUY_PRODUCT",
|
|
15
|
+
CUSTOMER_REGISTER = "CUSTOMER_REGISTER",
|
|
16
|
+
CUSTOMER_REVIEW = "CUSTOMER_REVIEW",
|
|
17
|
+
CUSTOMER_SEGMENT = "CUSTOMER_SEGMENT",
|
|
18
|
+
ENABLE_SUBSCRIPTION = "ENABLE_SUBSCRIPTION",
|
|
19
|
+
ORDER_CREATE = "ORDER_CREATE"
|
|
20
|
+
}
|
|
21
|
+
export declare enum LoyaltyProgramPointEarningTypeEnum {
|
|
22
|
+
DYNAMIC_ORDER_AMOUNT = "DYNAMIC_ORDER_AMOUNT",
|
|
23
|
+
DYNAMIC_ORDER_QUANTITY = "DYNAMIC_ORDER_QUANTITY",
|
|
24
|
+
STATIC = "STATIC"
|
|
25
|
+
}
|
|
26
|
+
export declare enum LoyaltyProgramMethodSpendingTypeEnum {
|
|
27
|
+
FIXED_AMOUNT = "FIXED_AMOUNT",
|
|
28
|
+
FREE_PRODUCT = "FREE_PRODUCT",
|
|
29
|
+
FREE_SHIPPING = "FREE_SHIPPING",
|
|
30
|
+
RATIO = "RATIO"
|
|
31
|
+
}
|
|
32
|
+
export declare enum LoyaltyProgramFilterTypeEnum {
|
|
33
|
+
CATEGORY = "CATEGORY",
|
|
34
|
+
DYNAMIC_CATEGORY = "DYNAMIC_CATEGORY",
|
|
35
|
+
PRODUCT_AND_VARIANT = "PRODUCT_AND_VARIANT",
|
|
36
|
+
PRODUCT_BRAND = "PRODUCT_BRAND",
|
|
37
|
+
PRODUCT_TAG = "PRODUCT_TAG"
|
|
38
|
+
}
|
|
39
|
+
export declare enum PeriodTypeEnum {
|
|
40
|
+
MONTH = "MONTH",
|
|
41
|
+
WEEK = "WEEK",
|
|
42
|
+
YEAR = "YEAR"
|
|
43
|
+
}
|
|
44
|
+
export declare class LoyaltyProgramPeriod {
|
|
45
|
+
period: string;
|
|
46
|
+
periodType: PeriodTypeEnum;
|
|
47
|
+
constructor(data?: Partial<LoyaltyProgramPeriod>);
|
|
48
|
+
}
|
|
49
|
+
export type Category = {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
export type Product = {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
};
|
|
57
|
+
export type Brand = {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
};
|
|
61
|
+
export type Tag = {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
};
|
|
65
|
+
export type AddLoyaltyToCartInput = {
|
|
66
|
+
amount?: number | null;
|
|
67
|
+
cartId: string;
|
|
68
|
+
loyaltyProgramId: string;
|
|
69
|
+
loyaltySpendingMethodId: string;
|
|
70
|
+
};
|
|
71
|
+
export type StringFilterInput = {
|
|
72
|
+
eq?: string;
|
|
73
|
+
ne?: string;
|
|
74
|
+
in?: string[];
|
|
75
|
+
nin?: string[];
|
|
76
|
+
contains?: string;
|
|
77
|
+
ncontains?: string;
|
|
78
|
+
startsWith?: string;
|
|
79
|
+
nstartsWith?: string;
|
|
80
|
+
endsWith?: string;
|
|
81
|
+
nendsWith?: string;
|
|
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
|
+
export type ListLoyaltyProgramTierInput = {
|
|
102
|
+
id?: StringFilterInput;
|
|
103
|
+
includeDeleted?: boolean;
|
|
104
|
+
loyaltyProgramId?: StringFilterInput;
|
|
105
|
+
};
|
|
106
|
+
export declare enum LoyaltyProgramPointHistoryTypeEnum {
|
|
107
|
+
EARN = "EARN",
|
|
108
|
+
SPEND = "SPEND"
|
|
109
|
+
}
|
|
110
|
+
export type LoyaltyProgramPointHistoryTypeEnumFilterInput = {
|
|
111
|
+
eq?: LoyaltyProgramPointHistoryTypeEnum;
|
|
112
|
+
in?: LoyaltyProgramPointHistoryTypeEnum[];
|
|
113
|
+
ne?: LoyaltyProgramPointHistoryTypeEnum;
|
|
114
|
+
nin?: LoyaltyProgramPointHistoryTypeEnum[];
|
|
115
|
+
};
|
|
116
|
+
export type ListLoyaltyProgramPointHistoryInput = {
|
|
117
|
+
customerId?: StringFilterInput;
|
|
118
|
+
includeDeleted?: boolean;
|
|
119
|
+
loyaltyProgramId?: StringFilterInput;
|
|
120
|
+
sort?: string;
|
|
121
|
+
type?: LoyaltyProgramPointHistoryTypeEnumFilterInput;
|
|
122
|
+
};
|
|
123
|
+
export type LoyaltyWidgetCallbacks = {
|
|
124
|
+
listSpendingMethodsByCartId: (cartId?: string | null) => Promise<LoyaltyProgramSpendingMethod[]>;
|
|
125
|
+
getLoyaltyCustomerInfo: () => Promise<LoyaltyCustomerInfo | null>;
|
|
126
|
+
listEarningMethods: () => Promise<LoyaltyProgramEarningMethod[]>;
|
|
127
|
+
listLoyaltyProgramTier: (input: ListLoyaltyProgramTierInput) => Promise<LoyaltyProgramTier[]>;
|
|
128
|
+
listLoyaltyProgramPointHistory: (input: ListLoyaltyProgramPointHistoryInput) => Promise<LoyaltyProgramPointHistory[]>;
|
|
129
|
+
useLoyaltyPoints: (input: AddLoyaltyToCartInput) => Promise<boolean>;
|
|
130
|
+
removeLoyaltyPointsFromCart: () => Promise<void>;
|
|
131
|
+
getLoyaltyWidget: () => Promise<LoyaltyWidget>;
|
|
132
|
+
onWidgetClose: () => void;
|
|
133
|
+
getProducts: (ids: string[]) => Promise<Product[]>;
|
|
134
|
+
getCategories: (ids: string[]) => Promise<Category[]>;
|
|
135
|
+
getBrands: (ids: string[]) => Promise<Brand[]>;
|
|
136
|
+
getTags: (ids: string[]) => Promise<Tag[]>;
|
|
137
|
+
};
|
|
138
|
+
export type IkasLoyaltyWidgetConfig = {
|
|
139
|
+
cartId?: string | null;
|
|
140
|
+
cdnURL: string;
|
|
141
|
+
merchantId: string;
|
|
142
|
+
currency: string;
|
|
143
|
+
locale: string;
|
|
144
|
+
callbacks: LoyaltyWidgetCallbacks;
|
|
145
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeObservable as E,observable as R}from"mobx";var T,_,N,C,O,A;!function(E){E.MAIN_SCREEN="MAIN_SCREEN",E.CREDIT_SPENDING_METHODS_SCREEN="CREDIT_SPENDING_METHODS_SCREEN",E.CREDIT_EARNING_METHODS_SCREEN="CREDIT_EARNING_METHODS_SCREEN",E.CREDIT_HISTORY_SCREEN="CREDIT_HISTORY_SCREEN",E.LOYALTY_LEVEL_SCREEN="LOYALTY_LEVEL_SCREEN"}(T||(T={})),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"}(_||(_={})),function(E){E.DYNAMIC_ORDER_AMOUNT="DYNAMIC_ORDER_AMOUNT",E.DYNAMIC_ORDER_QUANTITY="DYNAMIC_ORDER_QUANTITY",E.STATIC="STATIC"}(N||(N={})),function(E){E.FIXED_AMOUNT="FIXED_AMOUNT",E.FREE_PRODUCT="FREE_PRODUCT",E.FREE_SHIPPING="FREE_SHIPPING",E.RATIO="RATIO"}(C||(C={})),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"}(O||(O={})),function(E){E.MONTH="MONTH",E.WEEK="WEEK",E.YEAR="YEAR"}(A||(A={}));var D,I=function(T){void 0===T&&(T={}),this.period=T.period||"",this.periodType=T.periodType||A.MONTH,E(this,{period:R,periodType:R})};!function(E){E.EARN="EARN",E.SPEND="SPEND"}(D||(D={}));export{_ as EarningMethodTypeEnum,O as LoyaltyProgramFilterTypeEnum,C as LoyaltyProgramMethodSpendingTypeEnum,I as LoyaltyProgramPeriod,N as LoyaltyProgramPointEarningTypeEnum,D as LoyaltyProgramPointHistoryTypeEnum,T as LoyaltyWidgetScreenTypeEnum,A as PeriodTypeEnum};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LoyaltyWidgetButton } from "../../../models/button";
|
|
3
|
+
import type { FontSizeKey, PaddingSize } from "./style";
|
|
4
|
+
type Props = {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
button: LoyaltyWidgetButton;
|
|
8
|
+
fontSize: FontSizeKey;
|
|
9
|
+
paddingSize: PaddingSize;
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const Button: React.FC<Props>;
|
|
15
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"react";import{Button as t,Loader as e}from"./style.js";var r=function(r){var i=r.children,d=r.onClick,l=r.button,n=r.fontSize,a=r.paddingSize,u=r.fullWidth,b=void 0!==u&&u,s=r.disabled,f=void 0!==s&&s,C=r.isLoading,c=void 0!==C&&C;return o.createElement(t,{onClick:d,fullWidth:b,fontSize:n,paddingSize:a,borderRadius:l.buttonRadius,bgColor:l.bgColor,textColor:l.textColor,borderColor:l.borderColor,disabled:f||c},c&&o.createElement(e,null),i)};export{r as default};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type FontSizeKey = "textXSMedium" | "textSM" | "textSMMedium" | "textMDMedium" | "textLGSemiBold" | "displayXSSemiBold";
|
|
2
|
+
export type PaddingSize = "small" | "medium";
|
|
3
|
+
type ButtonProps = {
|
|
4
|
+
fullWidth: boolean;
|
|
5
|
+
fontSize: FontSizeKey;
|
|
6
|
+
paddingSize: PaddingSize;
|
|
7
|
+
borderRadius: number;
|
|
8
|
+
bgColor: string | null;
|
|
9
|
+
textColor: string | null;
|
|
10
|
+
borderColor: string | null;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const Button: import("styled-components").StyledComponent<"button", any, ButtonProps, never>;
|
|
14
|
+
export declare const Loader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import r,{keyframes as o}from'./../../../ext/styled-components/dist/styled-components.browser.esm.js';import{textXSMedium as e,textSM as t,textSMMedium as i,textMDMedium as d,textLGSemiBold as a,displayXSSemiBold as s}from"../style/typography.js";var l,u,p,c={textXSMedium:e,textSM:t,textSMMedium:i,textMDMedium:d,textLGSemiBold:a,displayXSSemiBold:s},m={small:"8px",medium:"10px 16px"},b=r.button(l||(l=n(["\n border: none;\n cursor: ",";\n transition: all 0.2s ease;\n opacity: ",";\n pointer-events: ",";\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 gap: 8px;\n\n &:hover {\n opacity: 0.9;\n }\n"],["\n border: none;\n cursor: ",";\n transition: all 0.2s ease;\n opacity: ",";\n pointer-events: ",";\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 gap: 8px;\n\n &:hover {\n opacity: 0.9;\n }\n"])),function(n){return n.disabled?"not-allowed":"pointer"},function(n){return n.disabled?.5:1},function(n){return n.disabled?"none":"auto"},function(n){return c[n.fontSize]},function(n){return m[n.paddingSize]},function(n){return n.borderRadius},function(n){return n.fullWidth?"100%":"auto"},function(n){var r;return null!==(r=n.bgColor)&&void 0!==r?r:"transparent"},function(n){var r;return null!==(r=n.textColor)&&void 0!==r?r:"inherit"},function(n){return n.borderColor?"1px solid ".concat(n.borderColor):"none"}),f=o(u||(u=n(["\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n"],["\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n"]))),x=r.div(p||(p=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 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 animation: "," 1s linear infinite;\n"])),f);export{b as Button,x as Loader};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
|
|
3
|
+
import { LoyaltyWidgetButton } from "models/button";
|
|
4
|
+
export type LoyaltyMethodCardProps = {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string | React.ReactNode;
|
|
7
|
+
icon: React.ReactNode;
|
|
8
|
+
action?: {
|
|
9
|
+
text: string;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
};
|
|
12
|
+
isCompleted?: boolean;
|
|
13
|
+
mode: "card" | "accordion";
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
padding?: string;
|
|
16
|
+
settings: {
|
|
17
|
+
borderRadius: number;
|
|
18
|
+
widgetIconType: WidgetIconTypeEnum;
|
|
19
|
+
button: LoyaltyWidgetButton;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
declare const LoyaltyMethodCard: React.FC<LoyaltyMethodCardProps>;
|
|
23
|
+
export default LoyaltyMethodCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useState as t}from"react";import{observer as n}from"mobx-react";import l from"../button/index.js";import{CheckCircleFill as i}from"../../../assets/icons/check-circle-fill.js";import{ChevronLeft as r}from"../../../assets/icons/chevron-left.js";import{Container as o,Header as c,IconWrapper as a,Content as m,Title as s,Description as d,ArrowButton as p,AccordionWrapper as u,AccordionInner as f}from"./style.js";var E=n(function(n){var E=n.title,x=n.description,g=n.icon,$=n.action,b=n.isCompleted,v=n.mode,y=n.children,C=n.padding,k=n.settings,j=t(!1),h=j[0],O=j[1],S=!b&&(null==$?void 0:$.text)&&(null==$?void 0:$.onClick);return e.createElement(o,{$borderRadius:k.borderRadius,$isCompleted:b,$padding:C},e.createElement(c,{onClick:function(){"accordion"===v&&O(!h)},style:{cursor:"accordion"===v?"pointer":"default"}},e.createElement(a,{$iconType:k.widgetIconType},g),e.createElement(m,null,e.createElement(s,null,E),e.createElement(d,null,x)),"card"===v?e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},b&&e.createElement(i,null),S&&e.createElement(l,{button:k.button,paddingSize:"small",fontSize:"textSMMedium",onClick:$.onClick},$.text)):e.createElement(p,{$isOpen:h},e.createElement(r,null))),"accordion"===v&&e.createElement(u,{$isOpen:h},e.createElement(f,{$isOpen:h},y)))});export{E as default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
|
|
2
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
$borderRadius: number;
|
|
4
|
+
$isCompleted?: boolean;
|
|
5
|
+
$padding?: string;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const Header: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
9
|
+
$iconType: WidgetIconTypeEnum;
|
|
10
|
+
}, never>;
|
|
11
|
+
export declare const Content: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const Description: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
|
+
export declare const AccordionWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
15
|
+
$isOpen: boolean;
|
|
16
|
+
}, never>;
|
|
17
|
+
export declare const AccordionInner: import("styled-components").StyledComponent<"div", any, {
|
|
18
|
+
$isOpen: boolean;
|
|
19
|
+
}, never>;
|
|
20
|
+
export declare const ArrowButton: import("styled-components").StyledComponent<"button", any, {
|
|
21
|
+
$isOpen: boolean;
|
|
22
|
+
}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{WidgetIconTypeEnum as e}from"../../../models/loyalty-widget/types/index.js";import t,{css as r}from'./../../../ext/styled-components/dist/styled-components.browser.esm.js';import{textSMMedium as i,textSM as o}from"../style/typography.js";var s,a,d,p,l,f,c,x,g,u,m,b=t.div(s||(s=n(["\n display: flex;\n padding: ",";\n flex-direction: column;\n align-items: flex-start;\n align-self: stretch;\n border-radius: ","px;\n border: 1px solid #eef2f6;\n background: #fff;\n opacity: ",";\n user-select: none;\n"],["\n display: flex;\n padding: ",";\n flex-direction: column;\n align-items: flex-start;\n align-self: stretch;\n border-radius: ","px;\n border: 1px solid #eef2f6;\n background: #fff;\n opacity: ",";\n user-select: none;\n"])),function(n){return n.$padding||"16px 14px"},function(n){return n.$borderRadius},function(n){return n.$isCompleted?"0.8":"1"}),y=t.div(a||(a=n(["\n display: flex;\n align-items: center;\n gap: 12px;\n align-self: stretch;\n width: 100%;\n"],["\n display: flex;\n align-items: center;\n gap: 12px;\n align-self: stretch;\n width: 100%;\n"]))),h=t.div(l||(l=n(["\n display: flex;\n width: 36px;\n height: 36px;\n\n justify-content: center;\n align-items: center;\n\n ","\n\n ","\n"],["\n display: flex;\n width: 36px;\n height: 36px;\n\n justify-content: center;\n align-items: center;\n\n ","\n\n ","\n"])),function(t){return t.$iconType===e.ILLUSTRATION&&r(d||(d=n(["\n border-radius: 40px;\n background: #f6f6f6;\n "],["\n border-radius: 40px;\n background: #f6f6f6;\n "])))},function(t){return t.$iconType===e.NORMAL&&r(p||(p=n(["\n border-radius: 8px;\n border: 1px solid #e3e8ef;\n background: #fff;\n box-shadow: 0 -3px 1px 0 rgba(238, 242, 246, 0.5) inset,\n 0 4px 1px 0 rgba(38, 69, 109, 0), 0 2px 1px 0 rgba(38, 69, 109, 0.01),\n 0 1px 1px 0 rgba(38, 69, 109, 0.02), 0 1px 1px 0 rgba(38, 69, 109, 0.03);\n\n svg {\n color: #4b5565;\n }\n "],["\n border-radius: 8px;\n border: 1px solid #e3e8ef;\n background: #fff;\n box-shadow: 0 -3px 1px 0 rgba(238, 242, 246, 0.5) inset,\n 0 4px 1px 0 rgba(38, 69, 109, 0), 0 2px 1px 0 rgba(38, 69, 109, 0.01),\n 0 1px 1px 0 rgba(38, 69, 109, 0.02), 0 1px 1px 0 rgba(38, 69, 109, 0.03);\n\n svg {\n color: #4b5565;\n }\n "])))}),w=t.div(f||(f=n(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n flex: 1 0 0;\n"],["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n flex: 1 0 0;\n"]))),v=t.div(c||(c=n(["\n color: #121926;\n ","\n"],["\n color: #121926;\n ","\n"])),i),j=t.div(x||(x=n(["\n color: #121926;\n ","\n"],["\n color: #121926;\n ","\n"])),o),$=t.div(g||(g=n(["\n display: grid;\n grid-template-rows: ",";\n transition: grid-template-rows 300ms ease-in-out;\n width: 100%;\n"],["\n display: grid;\n grid-template-rows: ",";\n transition: grid-template-rows 300ms ease-in-out;\n width: 100%;\n"])),function(n){return n.$isOpen?"1fr":"0fr"}),k=t.div(u||(u=n(["\n overflow: hidden;\n color: #4b5565;\n ","\n\n /* Spacing: We need 20px from header. */\n padding-top: ",";\n\n /* Optional: fade content in/out */\n opacity: ",";\n transition: opacity 300ms ease-in-out, padding-top 300ms ease-in-out;\n"],["\n overflow: hidden;\n color: #4b5565;\n ","\n\n /* Spacing: We need 20px from header. */\n padding-top: ",";\n\n /* Optional: fade content in/out */\n opacity: ",";\n transition: opacity 300ms ease-in-out, padding-top 300ms ease-in-out;\n"])),o,function(n){return n.$isOpen?"20px":"0px"},function(n){return n.$isOpen?1:0}),O=t.button(m||(m=n(["\n border: none;\n background: none;\n cursor: pointer;\n transform: rotate(",");\n transition: transform 0.2s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #9aa4b2;\n padding: 4px;\n"],["\n border: none;\n background: none;\n cursor: pointer;\n transform: rotate(",");\n transition: transform 0.2s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #9aa4b2;\n padding: 4px;\n"])),function(n){return n.$isOpen?"270deg":"180deg"});export{k as AccordionInner,$ as AccordionWrapper,O as ArrowButton,b as Container,w as Content,j as Description,y as Header,h as IconWrapper,v as Title};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{Title as r}from"./style.js";var t=function(t){var a=t.children,s=t.style,l=t.className;return e.createElement(r,{style:s,className:l},a)};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import o from'./../../../ext/styled-components/dist/styled-components.browser.esm.js';import{textSMMedium as s}from"../style/typography.js";var m,p=o.div(m||(m=n(["\n ","\n margin: 0;\n padding: 16px 24px;\n"],["\n ","\n margin: 0;\n padding: 16px 24px;\n"])),s);export{p as Title};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const textXSMedium: import("styled-components").FlattenSimpleInterpolation;
|
|
2
|
+
declare const textSM: import("styled-components").FlattenSimpleInterpolation;
|
|
3
|
+
declare const textSMMedium: import("styled-components").FlattenSimpleInterpolation;
|
|
4
|
+
declare const textSMSemiBold: import("styled-components").FlattenSimpleInterpolation;
|
|
5
|
+
declare const textMDMedium: import("styled-components").FlattenSimpleInterpolation;
|
|
6
|
+
declare const textLGMedium: import("styled-components").FlattenSimpleInterpolation;
|
|
7
|
+
declare const textLGSemiBold: import("styled-components").FlattenSimpleInterpolation;
|
|
8
|
+
declare const textXLSemiBold: import("styled-components").FlattenSimpleInterpolation;
|
|
9
|
+
declare const displayXSSemiBold: import("styled-components").FlattenSimpleInterpolation;
|
|
10
|
+
declare const Badge: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
11
|
+
export { textXSMedium, textSM, textSMMedium, textSMSemiBold, textMDMedium, textLGMedium, textLGSemiBold, textXLSemiBold, displayXSSemiBold, Badge, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import t,{css as e}from'./../../../ext/styled-components/dist/styled-components.browser.esm.js';var o,i,l,f,s,p,h,x,g,r,a=e(o||(o=n(["\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px; /* 150% */\n letter-spacing: -0.24px;\n"],["\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px; /* 150% */\n letter-spacing: -0.24px;\n"]))),m=e(i||(i=n(["\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n"],["\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n"]))),d=e(l||(l=n(["\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px; /* 142.857% */\n"],["\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px; /* 142.857% */\n"]))),y=e(f||(f=n(["\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n"],["\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n"]))),c=e(s||(s=n(["\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n"],["\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n"]))),w=e(p||(p=n(["\n font-size: 18px;\n font-style: normal;\n font-weight: 500;\n line-height: 28px;\n"],["\n font-size: 18px;\n font-style: normal;\n font-weight: 500;\n line-height: 28px;\n"]))),z=e(h||(h=n(["\n font-size: 18px;\n font-style: normal;\n font-weight: 600;\n line-height: 28px;\n"],["\n font-size: 18px;\n font-style: normal;\n font-weight: 600;\n line-height: 28px;\n"]))),b=e(x||(x=n(["\n font-size: 20px;\n font-style: normal;\n font-weight: 600;\n line-height: 30px;\n"],["\n font-size: 20px;\n font-style: normal;\n font-weight: 600;\n line-height: 30px;\n"]))),u=e(g||(g=n(["\n font-size: 24px;\n font-style: normal;\n font-weight: 600;\n line-height: 32px;\n"],["\n font-size: 24px;\n font-style: normal;\n font-weight: 600;\n line-height: 32px;\n"]))),j=t.span(r||(r=n(["\n display: flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n gap: 6px;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n"],["\n display: flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n gap: 6px;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n"])),m);export{j as Badge,u as displayXSSemiBold,w as textLGMedium,z as textLGSemiBold,c as textMDMedium,m as textSM,d as textSMMedium,y as textSMSemiBold,b as textXLSemiBold,a as textXSMedium};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e,__generator as t,__spreadArray as r}from'./../ext/tslib/tslib.es6.mjs.js';import n,{useState as o,useRef as s,useEffect as i}from"react";import{observer as c}from"mobx-react";import"./utils/i18n.js";import{LoyaltyWidgetScreenTypeEnum as a,EarningMethodTypeEnum as l,LoyaltyProgramFilterTypeEnum as d,LoyaltyProgramMethodSpendingTypeEnum as u}from"../models/types/index.js";import f from"./screens/main-screen/index.js";import m from"./screens/credit-spending-methods-screen/index.js";import p from"./screens/credit-earning-methods-screen/index.js";import E from"./screens/credit-history-screen/index.js";import y from"./screens/loyalty-level-screen/index.js";import{LoyaltyWidgetViewModel as g}from"../models/index.js";import{LoyaltyWidget as h}from"../models/loyalty-widget/index.js";import{LoyaltyProgramSpendingMethod as C}from"../models/loyalty-program-spending-method/index.js";import{LoyaltyCustomerInfo as v}from"../models/loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as R}from"../models/loyalty-program-earning-method/index.js";import{LoyaltyProgramPointHistory as b}from"../models/loyalty-program-point-history/index.js";import{Container as S,Drawer as I,ScreenWrapper as k}from"./style.js";var A=c(function(){var c=o(function(){var e=window.ikasLoyaltyWidgetConfig;return new g({cartId:e?e.cartId:null},e.cdnURL,e.merchantId,e.currency,e.locale,e.callbacks)})[0],A=s(!0);i(function(){e(void 0,void 0,void 0,function(){var e,n,o,s,i,a,f,m,p,E,y,g,S,I;return t(this,function(t){switch(t.label){case 0:if(!c.callbacks)return[3,6];t.label=1;case 1:return t.trys.push([1,4,5,6]),e=[c.callbacks.getLoyaltyWidget(),c.callbacks.listEarningMethods(),c.callbacks.listLoyaltyProgramTier({includeDeleted:!1})],c.cartId&&(e.push(c.callbacks.listSpendingMethodsByCartId(c.cartId)),e.push(c.callbacks.getLoyaltyCustomerInfo()),e.push(c.callbacks.listLoyaltyProgramPointHistory({}))),[4,Promise.all(e)];case 2:return n=t.sent(),o=n[0],s=n[1],i=n[2],a=[],f=null,m=[],c.cartId&&(a=n[3],f=n[4],m=n[5]),c.loyaltyWidget=new h(o),c.earningMethods=s.map(function(e){return new R(e)}),c.tiers=i||[],c.cartId&&(c.spendingMethods=a.map(function(e){return new C(e)}),c.user=f?new v(f):null,c.pointHistory=m?m.map(function(e){return new b(e)}):[]),p=new Set,E=new Set,y=new Set,g=new Set,c.earningMethods.forEach(function(e){var t,n;e.methodType===l.ORDER_CREATE&&r(r([],(null===(t=e.orderSettings)||void 0===t?void 0:t.productFilters)||[],!0),(null===(n=e.productSettings)||void 0===n?void 0:n.productFilters)||[],!0).forEach(function(e){e.type===d.PRODUCT_AND_VARIANT?e.idList.forEach(function(e){return p.add(e)}):e.type===d.CATEGORY?e.idList.forEach(function(e){return E.add(e)}):e.type===d.PRODUCT_BRAND?e.idList.forEach(function(e){return y.add(e)}):e.type===d.PRODUCT_TAG&&e.idList.forEach(function(e){return g.add(e)})})}),c.spendingMethods&&c.spendingMethods.forEach(function(e){var t,r;e.type===u.FREE_PRODUCT&&(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)&&p.add(e.discountSettings.freeProductId),null===(r=e.productFilters)||void 0===r||r.forEach(function(e){e.type===d.PRODUCT_AND_VARIANT?e.idList.forEach(function(e){return p.add(e)}):e.type===d.CATEGORY?e.idList.forEach(function(e){return E.add(e)}):e.type===d.PRODUCT_BRAND?e.idList.forEach(function(e){return y.add(e)}):e.type===d.PRODUCT_TAG&&e.idList.forEach(function(e){return g.add(e)})})}),S=[],p.size>0&&c.callbacks.getProducts&&S.push(c.callbacks.getProducts(Array.from(p)).then(function(e){return c.products=e})),E.size>0&&c.callbacks.getCategories&&S.push(c.callbacks.getCategories(Array.from(E)).then(function(e){return c.categories=e})),y.size>0&&c.callbacks.getBrands&&S.push(c.callbacks.getBrands(Array.from(y)).then(function(e){return c.brands=e})),g.size>0&&c.callbacks.getTags&&S.push(c.callbacks.getTags(Array.from(g)).then(function(e){return c.tags=e})),[4,Promise.all(S)];case 3:return t.sent(),[3,6];case 4:return I=t.sent(),console.error("Failed to initialize loyalty data",I),[3,6];case 5:return A.current=!1,[7];case 6:return[2]}})})},[]),i(function(){if(!A.current){e(void 0,void 0,void 0,function(){var e,r,n,o,s;return t(this,function(t){switch(t.label){case 0:if(!c.callbacks)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.all([c.callbacks.listSpendingMethodsByCartId(c.cartId),c.callbacks.getLoyaltyCustomerInfo(),c.callbacks.listLoyaltyProgramPointHistory({})])];case 2:return e=t.sent(),r=e[0],n=e[1],o=e[2],c.spendingMethods=r.map(function(e){return new C(e)}),c.user=n?new v(n):null,c.pointHistory=o?o.map(function(e){return new b(e)}):[],[3,4];case 3:return s=t.sent(),console.error("Failed to fetch cart dependent data",s),[3,4];case 4:return[2]}})})}},[c.cartId]);var N=function(e){c.selectedScreen=e},_=function(){var e;(null===(e=c.callbacks)||void 0===e?void 0:e.onWidgetClose)&&c.callbacks.onWidgetClose()},T=c.selectedScreen===a.MAIN_SCREEN,w=o(null),M=w[0],L=w[1];i(function(){c.selectedScreen!==a.MAIN_SCREEN&&L(c.selectedScreen)},[c.selectedScreen]);var P=T?M:c.selectedScreen;return n.createElement(S,null,n.createElement(I,null,n.createElement(k,{$isActive:T,$isMain:!0},n.createElement(f,{viewModel:c,onClose:_,onNavigate:N})),n.createElement(k,{$isActive:!T,$isMain:!1},function(){switch(P){case a.CREDIT_SPENDING_METHODS_SCREEN:return n.createElement(m,{viewModel:c,onBack:function(){return N(a.MAIN_SCREEN)},onClose:_});case a.CREDIT_EARNING_METHODS_SCREEN:return n.createElement(p,{viewModel:c,onBack:function(){return N(a.MAIN_SCREEN)},onClose:_});case a.CREDIT_HISTORY_SCREEN:return n.createElement(E,{viewModel:c,onBack:function(){return N(a.MAIN_SCREEN)},onClose:_});case a.LOYALTY_LEVEL_SCREEN:return n.createElement(y,{viewModel:c,onBack:function(){return N(a.MAIN_SCREEN)},onClose:_});default:return null}}())))});export{A as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LoyaltyWidgetViewModel } from "models";
|
|
3
|
+
type Props = {
|
|
4
|
+
viewModel: LoyaltyWidgetViewModel;
|
|
5
|
+
onBack: () => void;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare const CreditEarningMethodsScreen: React.FC<Props>;
|
|
9
|
+
export default CreditEarningMethodsScreen;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{observer as t}from"mobx-react";import'./../../../ext/i18next/dist/esm/i18next.js';import'./../../../ext/react-i18next/dist/es/context.js';import'./../../../ext/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js';import{useTranslation as n}from'./../../../ext/react-i18next/dist/es/useTranslation.js';import o from"../main-screen/earning-methods-section/index.js";import{ChevronLeft as r}from"../../../assets/icons/chevron-left.js";import{XClose as i}from"../../../assets/icons/x-close.js";import{Container as s,Header as l,IconButton as m,Title as c,Content as a}from"./style.js";import{EarningMethodTypeEnum as d}from"../../../models/types/index.js";var u=t(function(t){var u=t.viewModel,p=t.onBack,E=t.onClose,f=n().t;return e.createElement(s,null,e.createElement(l,null,e.createElement(m,{onClick:p},e.createElement(r,null)),e.createElement(c,null,f("screens.creditEarningMethods")),e.createElement(m,{onClick:E},e.createElement(i,null))),e.createElement(a,null,e.createElement(o,{containerStyle:{paddingRight:16,paddingLeft:16},viewModel:u,getActionProps:function(e){return e.methodType===d.CUSTOMER_REGISTER?{actionText:f("common.create"),onClick:function(){}}:e.methodType===d.ENABLE_SUBSCRIPTION?{actionText:f("common.allow"),onClick:function(){}}:null}})))});export{u as default};
|