@ikas/loyalty-widget-renderer 1.0.0-alpha.44 → 1.0.0-alpha.45

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.
@@ -1,9 +1,9 @@
1
- import { LoyaltyWidget } from "./loyalty-widget";
2
- import { LoyaltyWidgetCallbacks, LoyaltyWidgetScreenTypeEnum, WidgetMode, Category, Product, Brand, Tag } from "./types";
3
- import { LoyaltyProgramSpendingMethod } from "./loyalty-program-spending-method";
4
- import { LoyaltyProgramEarningMethod } from "./loyalty-program-earning-method";
5
1
  import { LoyaltyCustomerInfo, LoyaltyProgramTier } from "./loyalty-customer-info";
2
+ import { LoyaltyProgramEarningMethod } from "./loyalty-program-earning-method";
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
9
  currentWidgetMode: WidgetMode;
@@ -1 +1 @@
1
- import{makeObservable as e,observable as t,action as i,computed as s}from"mobx";import{LoyaltyWidget as r}from"./loyalty-widget/index.js";import{WidgetMode as o,LoyaltyWidgetScreenTypeEnum as n}from"./types/index.js";import{LoyaltyProgramSpendingMethod as d}from"./loyalty-program-spending-method/index.js";import{LoyaltyProgramEarningMethod as c}from"./loyalty-program-earning-method/index.js";import{LoyaltyCustomerInfo as a}from"./loyalty-customer-info/index.js";var h=function(){function h(h,l,g,u,p,M,y,m){void 0===h&&(h={}),this.userRefreshTrigger=0,this.cartRefreshTrigger=0,this.selectedScreen=h.selectedScreen||n.MAIN_SCREEN,this.currentWidgetMode=y?o.WIDGET_MODE:o.MINI_MODE,this.isMiniModeDescriptionClosed=h.isMiniModeDescriptionClosed||!1,this.isLoading=h.isLoading||!1,this.isActionLoading=h.isActionLoading||!1,this.loyaltyWidget=new r(h.loyaltyWidget),this.cdnURL=l,this.merchantId=g,this.storeUrl=M||h.storeUrl||"",this.currency=u,this.locale=p,this.isPreviewMode=y||!1,this.cartId=h.cartId||null,this.cartId=h.cartId||null,this.ikasEventUser=h.ikasEventUser||null,this.user=h.user?new a(h.user):null,this.earningMethods=h.earningMethods?h.earningMethods.map(function(e){return new c(e)}):[],this.spendingMethods=h.spendingMethods?h.spendingMethods.map(function(e){return new d(e)}):[],this.tiers=h.tiers?h.tiers:[],this.categories=h.categories?h.categories:[],this.products=h.products?h.products:[],this.brands=h.brands?h.brands:[],this.tags=h.tags?h.tags:[],this.pointHistory=h.pointHistory?h.pointHistory:[],this.callbacks=m||void 0,e(this,{cartId:t,loyaltyWidget:t,isLoading:t,isActionLoading:t,cdnURL:t,merchantId:t,storeUrl:t,currency:t,locale:t,setWidgetMode:i.bound,closeMiniModeDescription:i.bound,formatCurrency:i.bound,selectedScreen:t,currentWidgetMode:t,isMiniModeDescriptionClosed:t,user:t,earningMethods:t,spendingMethods:t,tiers:t,categories:t,products:t,brands:t,tags:t,pointHistory:t,ikasEventUser:t,userRefreshTrigger:t,cartRefreshTrigger:t,shouldShowSpendingMethods:s})}return Object.defineProperty(h.prototype,"shouldShowSpendingMethods",{get:function(){return!!this.user&&(!(this.user.totalPoint<=0)&&0!==this.spendingMethods.length)},enumerable:!1,configurable:!0}),h.prototype.setWidgetMode=function(e){this.currentWidgetMode=e,e!==o.WIDGET_MODE||this.isPreviewMode||(this.isMiniModeDescriptionClosed=!0)},h.prototype.closeMiniModeDescription=function(){this.isMiniModeDescriptionClosed=!0},h.prototype.formatCurrency=function(e){var t;return(null===(t=this.callbacks)||void 0===t?void 0:t.formatCurrency)?this.callbacks.formatCurrency(e):"".concat(e.toFixed(2)," ").concat(this.currency)},h}();export{h as LoyaltyWidgetViewModel};
1
+ import{__assign as e}from'./../ext/tslib/tslib.es6.mjs.js';import{makeObservable as t,observable as i,action as s,computed as r}from"mobx";import{LoyaltyCustomerInfo as o}from"./loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as n}from"./loyalty-program-earning-method/index.js";import{LoyaltyProgramSpendingMethod as d}from"./loyalty-program-spending-method/index.js";import{LoyaltyWidget as c}from"./loyalty-widget/index.js";import{WidgetMode as a,LoyaltyWidgetScreenTypeEnum as h}from"./types/index.js";var l=function(){function l(l,g,u,p,M,m,y,f){void 0===l&&(l={}),this.userRefreshTrigger=0,this.cartRefreshTrigger=0,this.selectedScreen=l.selectedScreen||h.MAIN_SCREEN,this.currentWidgetMode=y?a.WIDGET_MODE:a.MINI_MODE,this.isMiniModeDescriptionClosed=l.isMiniModeDescriptionClosed||!1,this.isLoading=l.isLoading||!1,this.isActionLoading=l.isActionLoading||!1,this.loyaltyWidget=new c(l.loyaltyWidget),this.cdnURL=g,this.merchantId=u,this.storeUrl=m||l.storeUrl||"",this.currency=p,this.locale=M,this.isPreviewMode=y||!1,this.cartId=l.cartId||null,this.cartId=l.cartId||null,this.ikasEventUser=l.ikasEventUser||null,this.user=l.user?new o(l.user):null,this.earningMethods=l.earningMethods?l.earningMethods.map(function(e){return new n(e)}):[],this.spendingMethods=l.spendingMethods?l.spendingMethods.map(function(e){return new d(e)}):[],this.tiers=l.tiers?l.tiers:[],this.categories=l.categories?l.categories:[],this.products=l.products?l.products:[],this.brands=l.brands?l.brands:[],this.tags=l.tags?l.tags:[],this.pointHistory=l.pointHistory?l.pointHistory:[],this.callbacks=f||void 0,t(this,e(e({cartId:i},y?{}:{loyaltyWidget:i}),{isLoading:i,isActionLoading:i,cdnURL:i,merchantId:i,storeUrl:i,currency:i,locale: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(l.prototype,"shouldShowSpendingMethods",{get:function(){return!!this.user&&(!(this.user.totalPoint<=0)&&0!==this.spendingMethods.length)},enumerable:!1,configurable:!0}),l.prototype.setWidgetMode=function(e){this.currentWidgetMode=e,e!==a.WIDGET_MODE||this.isPreviewMode||(this.isMiniModeDescriptionClosed=!0)},l.prototype.closeMiniModeDescription=function(){this.isMiniModeDescriptionClosed=!0},l.prototype.formatCurrency=function(e){var t;return(null===(t=this.callbacks)||void 0===t?void 0:t.formatCurrency)?this.callbacks.formatCurrency(e):"".concat(e.toFixed(2)," ").concat(this.currency)},l}();export{l as LoyaltyWidgetViewModel};