@ikas/loyalty-widget-renderer 1.0.0-alpha.61 → 1.0.0-alpha.62

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.
@@ -24,5 +24,6 @@ export declare class LoyaltyCustomerInfo {
24
24
  loyaltyProgramCustomerId: string;
25
25
  loyaltyProgramId: string;
26
26
  totalPoint: number;
27
+ nextTierRequiredPoint: number | null;
27
28
  constructor(data?: Partial<LoyaltyCustomerInfo>);
28
29
  }
@@ -1 +1 @@
1
- import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramPeriod as e}from"../common/index.js";var o=function(e){void 0===e&&(e={}),this.locale=e.locale||"",this.name=e.name||"",t(this,{locale:i,name:i})},r=function(r){void 0===r&&(r={}),this.id=r.id||"",this.name=r.name||"",this.pointsRequired=r.pointsRequired||null,this.tierPointMultiplier=r.tierPointMultiplier||null,this.loyaltyProgramId=r.loyaltyProgramId||"",this.customerSegmentId=r.customerSegmentId||null,this.createdAt=r.createdAt||null,this.updatedAt=r.updatedAt||null,this.deleted=r.deleted||!1,this.isActive=r.isActive||!1,this.period=r.period?new e(r.period):null,this.translations=r.translations?r.translations.map(function(t){return new o(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})},l=function(e){void 0===e&&(e={}),this.customerTier=e.customerTier?new r(e.customerTier):null,this.loyaltyProgramCustomerId=e.loyaltyProgramCustomerId||"",this.loyaltyProgramId=e.loyaltyProgramId||"",this.totalPoint=e.totalPoint||0,t(this,{customerTier:i,loyaltyProgramCustomerId:i,loyaltyProgramId:i,totalPoint:i})};export{l as LoyaltyCustomerInfo,r as LoyaltyProgramTier,o as LoyaltyProgramTierTranslation};
1
+ import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPeriod as i}from"../common/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||null,this.tierPointMultiplier=r.tierPointMultiplier||null,this.loyaltyProgramId=r.loyaltyProgramId||"",this.customerSegmentId=r.customerSegmentId||null,this.createdAt=r.createdAt||null,this.updatedAt=r.updatedAt||null,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)}):null,t(this,{id:e,name:e,pointsRequired:e,tierPointMultiplier:e,loyaltyProgramId:e,customerSegmentId:e,createdAt:e,updatedAt:e,deleted:e,isActive:e,period:e,translations:e})},l=function(i){void 0===i&&(i={}),this.customerTier=i.customerTier?new r(i.customerTier):null,this.loyaltyProgramCustomerId=i.loyaltyProgramCustomerId||"",this.loyaltyProgramId=i.loyaltyProgramId||"",this.totalPoint=i.totalPoint||0,this.nextTierRequiredPoint=void 0!==i.nextTierRequiredPoint&&null!==i.nextTierRequiredPoint?i.nextTierRequiredPoint:null,t(this,{customerTier:e,loyaltyProgramCustomerId:e,loyaltyProgramId:e,totalPoint:e,nextTierRequiredPoint:e})};export{l as LoyaltyCustomerInfo,r as LoyaltyProgramTier,o as LoyaltyProgramTierTranslation};
@@ -1 +1 @@
1
- import{observer as e}from"mobx-react";import t from"react";import'./../../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as l}from'./../../../../../ext/react-i18next/dist/es/useTranslation.js';import{BadgeLevel1 as n}from"../../../../../assets/badgeLevel1.js";import{BadgeLevel2 as r}from"../../../../../assets/badgeLevel2.js";import{BadgeLevel3 as a}from"../../../../../assets/badgeLevel3.js";import{BadgeLevel4 as o}from"../../../../../assets/badgeLevel4.js";import{BadgeIconTypeEnum as m}from"../../../../../models/loyalty-widget/types/index.js";import s from"../../../../components/count-up/index.js";import{Container as u,TopRow as c,LeftSection as i,BadgeIconContainer as d,PointsContainer as E,Label as p,PointsValue as f,CurrentPoints as g,TotalPoints as v,RightSection as L,LevelBadge as b,BadgeText as j,ProgressBarContainer as y,ProgressBarFill as x}from"./style.js";var _=e(function(e){var _=e.viewModel,h=l().t,T=_.loyaltyWidget,V=_.user,w=T.settings;if(!V)return null;var I=V.totalPoint,M=V.customerTier,N=(null==M?void 0:M.pointsRequired)||0,P=N>0?Math.min(I/N*100,100):0,W=t.useMemo(function(){var e=V.customerTier;return e?"🏆 ".concat(e.name):"🏆 "},[w.badgeIconLevel,V.customerTier]);return t.createElement(u,null,t.createElement(c,null,t.createElement(i,null,t.createElement(d,null,function(){switch(w.badgeIconLevel){case m.LEVEL_1:return t.createElement(n,null);case m.LEVEL_2:return t.createElement(r,null);case m.LEVEL_3:return t.createElement(a,null);case m.LEVEL_4:return t.createElement(o,null);default:return null}}()),t.createElement(E,null,t.createElement(p,null,h("header.earnedPoints")),t.createElement(f,null,t.createElement(g,null,t.createElement(s,{end:I})),N>0&&t.createElement(v,null,"/ ",N)))),t.createElement(L,null,w.badgeIconLevel!==m.NONE&&!!(null==M?void 0:M.name.length)&&t.createElement(b,null,t.createElement(j,null,W)))),N>0&&t.createElement(y,null,t.createElement(x,{$percentage:P,$color:_.loyaltyWidget.header.background.bgColor||void 0})))});export{_ as default};
1
+ import{observer as e}from"mobx-react";import t from"react";import'./../../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as l}from'./../../../../../ext/react-i18next/dist/es/useTranslation.js';import{BadgeLevel1 as n}from"../../../../../assets/badgeLevel1.js";import{BadgeLevel2 as r}from"../../../../../assets/badgeLevel2.js";import{BadgeLevel3 as a}from"../../../../../assets/badgeLevel3.js";import{BadgeLevel4 as o}from"../../../../../assets/badgeLevel4.js";import{BadgeIconTypeEnum as m}from"../../../../../models/loyalty-widget/types/index.js";import s from"../../../../components/count-up/index.js";import{Container as c,TopRow as u,LeftSection as i,BadgeIconContainer as d,PointsContainer as E,Label as f,PointsValue as p,CurrentPoints as g,TotalPoints as L,RightSection as v,LevelBadge as b,BadgeText as j,ProgressBarContainer as x,ProgressBarFill as y}from"./style.js";var _=e(function(e){var _=e.viewModel,h=l().t,T=_.loyaltyWidget,V=_.user,w=T.settings;if(!V)return null;var I=V.totalPoint,M=V.customerTier,P=V.nextTierRequiredPoint||0,N=P>0?Math.min(I/P*100,100):0,W=t.useMemo(function(){var e=V.customerTier;return e?"🏆 ".concat(e.name):"🏆 "},[w.badgeIconLevel,V.customerTier]);return t.createElement(c,null,t.createElement(u,null,t.createElement(i,null,t.createElement(d,null,function(){switch(w.badgeIconLevel){case m.LEVEL_1:return t.createElement(n,null);case m.LEVEL_2:return t.createElement(r,null);case m.LEVEL_3:return t.createElement(a,null);case m.LEVEL_4:return t.createElement(o,null);default:return null}}()),t.createElement(E,null,t.createElement(f,null,h("header.earnedPoints")),t.createElement(p,null,t.createElement(g,null,t.createElement(s,{end:I})),P>0&&t.createElement(L,null,"/ ",P)))),t.createElement(v,null,w.badgeIconLevel!==m.NONE&&!!(null==M?void 0:M.name.length)&&t.createElement(b,null,t.createElement(j,null,W)))),P>0&&t.createElement(x,null,t.createElement(y,{$percentage:N,$color:_.loyaltyWidget.header.background.bgColor||void 0})))});export{_ as default};