@ikas/loyalty-widget-renderer 1.0.0-alpha.74 → 1.0.0-alpha.76

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.
@@ -95,6 +95,8 @@ declare const locales: {
95
95
  history: {
96
96
  earnedTitle: string;
97
97
  spentTitle: string;
98
+ refundTitle: string;
99
+ refillTitle: string;
98
100
  };
99
101
  screens: {
100
102
  creditEarningMethods: string;
@@ -210,6 +212,8 @@ declare const locales: {
210
212
  history: {
211
213
  earnedTitle: string;
212
214
  spentTitle: string;
215
+ refundTitle: string;
216
+ refillTitle: string;
213
217
  };
214
218
  screens: {
215
219
  creditEarningMethods: string;
@@ -325,6 +329,8 @@ declare const locales: {
325
329
  history: {
326
330
  earnedTitle: string;
327
331
  spentTitle: string;
332
+ refundTitle: string;
333
+ refillTitle: string;
328
334
  };
329
335
  screens: {
330
336
  creditEarningMethods: string;
@@ -440,6 +446,8 @@ declare const locales: {
440
446
  history: {
441
447
  earnedTitle: string;
442
448
  spentTitle: string;
449
+ refundTitle: string;
450
+ refillTitle: string;
443
451
  };
444
452
  screens: {
445
453
  creditEarningMethods: string;
@@ -555,6 +563,8 @@ declare const locales: {
555
563
  history: {
556
564
  earnedTitle: string;
557
565
  spentTitle: string;
566
+ refundTitle: string;
567
+ refillTitle: string;
558
568
  };
559
569
  screens: {
560
570
  creditEarningMethods: string;
@@ -86,7 +86,9 @@ export type ListLoyaltyProgramTierInput = {
86
86
  };
87
87
  export declare enum LoyaltyProgramPointHistoryTypeEnum {
88
88
  EARN = "EARN",
89
- SPEND = "SPEND"
89
+ SPEND = "SPEND",
90
+ REFUND = "REFUND",
91
+ REFILL = "REFILL"
90
92
  }
91
93
  export interface LoyaltyProgramPointHistoryTypeEnumFilterInput {
92
94
  eq?: LoyaltyProgramPointHistoryTypeEnum | null;
@@ -1 +1 @@
1
- var E,R,T,_,N,C,D,I;!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"}(C||(C={})),function(E){E.MONTH="MONTH",E.WEEK="WEEK",E.YEAR="YEAR"}(D||(D={})),function(E){E.EARN="EARN",E.SPEND="SPEND"}(I||(I={}));export{T as EarningMethodTypeEnum,C as LoyaltyProgramFilterTypeEnum,N as LoyaltyProgramMethodSpendingTypeEnum,_ as LoyaltyProgramPointEarningTypeEnum,I as LoyaltyProgramPointHistoryTypeEnum,E as LoyaltyWidgetScreenTypeEnum,D as PeriodTypeEnum,R as WidgetMode};
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};
@@ -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 n}from'./../../../ext/react-i18next/dist/es/useTranslation.js';import{XClose as r}from"../../../assets/icons/x-close.js";import{ChevronLeft as l}from"../../../assets/icons/chevron-left.js";import{LoyaltyProgramPointHistoryTypeEnum as o}from"../../../models/types/index.js";import a from"../../components/count-up/index.js";import{Container as m,Header as c,IconButton as i,Title as s,Content as u,PointsSection as d,PointsTitle as E,PointsValue as p,HistoryList as f,HistoryItem as y,HistoryItemLeft as x,HistoryItemTitle as g,HistoryItemDate as h,HistoryItemAmount as j,Divider as v}from"./style.js";var k=e(function(e){var k=e.viewModel,T=e.onBack,w=e.onClose,C=n(),R=C.t,b=C.i18n,A=k.user,B=k.pointHistory;return t.createElement(m,null,t.createElement(c,null,t.createElement(i,{onClick:T},t.createElement(l,null)),t.createElement(s,null,R("screens.creditHistory")),t.createElement(i,{onClick:w},t.createElement(r,null))),t.createElement(u,null,A&&t.createElement(d,{$borderRadius:k.loyaltyWidget.settings.cartBorderRadius},t.createElement(E,null,R("header.earnedPoints")),t.createElement(p,null,t.createElement(a,{end:A.totalPoint}))),t.createElement(f,null,B.map(function(e,n){var r=e.type===o.EARN;return t.createElement(t.Fragment,{key:e.id},t.createElement(y,null,t.createElement(x,null,t.createElement(g,null,R(r?"history.earnedTitle":"history.spentTitle")),t.createElement(h,null,function(e){if(!e)return"";try{return new Intl.DateTimeFormat(b.language,{day:"numeric",month:"long",year:"numeric"}).format(new Date(e))}catch(t){return e}}(e.createdAt))),t.createElement(j,{$isEarn:r},r?"":"-",e.amount)),n<B.length-1&&t.createElement(v,null))}))))});export{k 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 r}from'./../../../ext/react-i18next/dist/es/useTranslation.js';import{XClose as n}from"../../../assets/icons/x-close.js";import{ChevronLeft as l}from"../../../assets/icons/chevron-left.js";import{LoyaltyProgramPointHistoryTypeEnum as a}from"../../../models/types/index.js";import o from"../../components/count-up/index.js";import{Container as i,Header as s,IconButton as c,Title as m,Content as u,PointsSection as d,PointsTitle as E,PointsValue as f,HistoryList as p,HistoryItem as y,HistoryItemLeft as h,HistoryItemTitle as x,HistoryItemDate as g,HistoryItemAmount as j,Divider as R}from"./style.js";var T=e(function(e){var T=e.viewModel,v=e.onBack,F=e.onClose,k=r(),w=k.t,D=k.i18n,L=T.user,N=T.pointHistory;return t.createElement(i,null,t.createElement(s,null,t.createElement(c,{onClick:v},t.createElement(l,null)),t.createElement(m,null,w("screens.creditHistory")),t.createElement(c,{onClick:F},t.createElement(n,null))),t.createElement(u,null,L&&t.createElement(d,{$borderRadius:T.loyaltyWidget.settings.cartBorderRadius},t.createElement(E,null,w("header.earnedPoints")),t.createElement(f,null,t.createElement(o,{end:L.totalPoint}))),t.createElement(p,null,N.map(function(e,r){var n=e.type===a.EARN||e.type===a.REFILL;return t.createElement(t.Fragment,{key:e.id},t.createElement(y,null,t.createElement(h,null,t.createElement(x,null,function(){switch(e.type){case a.EARN:return w("history.earnedTitle");case a.SPEND:return w("history.spentTitle");case a.REFUND:return w("history.refundTitle");case a.REFILL:return w("history.refillTitle");default:return w("history.earnedTitle")}}()),t.createElement(g,null,function(e){if(!e)return"";try{return new Intl.DateTimeFormat(D.language,{day:"numeric",month:"long",year:"numeric"}).format(new Date(e))}catch(t){return e}}(e.createdAt))),t.createElement(j,{$isEarn:n},n?"":"-",e.amount)),r<N.length-1&&t.createElement(R,null))}))))});export{T as default};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{observer as n}from"mobx-react";import r from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as o}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import{ArrowRight as i}from"../../../../assets/icons/arrow-right.js";import{CheckCircle as c}from"../../../../assets/icons/check-circle.js";import{CheckFillIllustration as s}from"../../../../assets/widget-icons/illustraions/check-fill.js";import{CampaignTypeEnum as a}from"../../../../models/loyalty-customer-info/index.js";import{WidgetIconTypeEnum as l}from"../../../../models/loyalty-widget/types/index.js";import{Container as u,IconWrapper as m,ContentWrapper as d,TextRow as p,ButtonsRow as f,ActionButton as E,Loader as y,ArrowIcon as _}from"./style.js";var v=n(function(n){var v=n.viewModel,h=n.line,T=o().t,g=v.loyaltyWidget.settings.widgetIconType,j=r.useState(!1),w=j[0],b=j[1];return r.createElement(u,null,r.createElement(m,{$iconType:g},function(){switch(g){case l.ILLUSTRATION:return r.createElement(s,null);case l.NORMAL:case l.NONE:default:return r.createElement(c,null)}}()),r.createElement(d,null,r.createElement(p,null,function(){var e=v.formatCurrency(h.discountAmount);switch(h.campaignType){case a.FIXED_AMOUNT:return T("main_screen.appliedDiscount.fixedAmount",{amount:e});case a.FREE_SHIPPING:return T("main_screen.appliedDiscount.freeShipping");case a.RATIO:return T("main_screen.appliedDiscount.ratio",{amount:"%".concat(h.discountAmount)});case a.BUY_X_THEN_GET_Y:return T("main_screen.appliedDiscount.freeProduct");default:return T("main_screen.appliedDiscount.generic",{amount:e})}}()),r.createElement(f,null,r.createElement(E,{$color:"#697586",$disabled:w,onClick:function(){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:if(!(null===(e=v.callbacks)||void 0===e?void 0:e.removeLoyaltyPointsFromCart))return[3,4];b(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,v.callbacks.removeLoyaltyPointsFromCart()];case 2:return t.sent(),[3,4];case 3:return b(!1),[7];case 4:return[2]}})})}},w&&r.createElement(y,null),T("main_screen.appliedDiscount.remove")),r.createElement(E,{$color:"#121926",$disabled:w,onClick:function(){v.storeUrl&&v.cartId&&(window.location.href="".concat(v.storeUrl,"/checkout?id=").concat(v.cartId,"&step=info"))}},T("main_screen.appliedDiscount.goToCheckout"),r.createElement(_,null,r.createElement(i,null))))))});export{v as default};
1
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{observer as r}from"mobx-react";import n from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as o}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import{ArrowRight as i}from"../../../../assets/icons/arrow-right.js";import{CheckCircle as c}from"../../../../assets/icons/check-circle.js";import{CheckFillIllustration as s}from"../../../../assets/widget-icons/illustraions/check-fill.js";import{CampaignTypeEnum as a}from"../../../../models/loyalty-customer-info/index.js";import{WidgetIconTypeEnum as l}from"../../../../models/loyalty-widget/types/index.js";import{Container as u,IconWrapper as m,ContentWrapper as d,TextRow as p,ButtonsRow as f,ActionButton as E,Loader as y,ArrowIcon as _}from"./style.js";var g=r(function(r){var g=r.viewModel,h=r.line,v=o().t,T=g.loyaltyWidget.settings.widgetIconType,j=n.useState(!1),w=j[0],b=j[1];return n.createElement(u,null,n.createElement(m,{$iconType:T},function(){switch(T){case l.ILLUSTRATION:return n.createElement(s,null);case l.NORMAL:case l.NONE:default:return n.createElement(c,null)}}()),n.createElement(d,null,n.createElement(p,null,function(){var e=g.formatCurrency(h.discountAmount);switch(h.campaignType){case a.FIXED_AMOUNT:return v("main_screen.appliedDiscount.fixedAmount",{amount:e});case a.FREE_SHIPPING:return v("main_screen.appliedDiscount.freeShipping");case a.RATIO:return v("main_screen.appliedDiscount.ratio",{amount:"%".concat(h.discountAmount)});case a.BUY_X_THEN_GET_Y:return v("main_screen.appliedDiscount.freeProduct");default:return v("main_screen.appliedDiscount.generic",{amount:e})}}()),n.createElement(f,null,n.createElement(E,{$color:"#697586",$disabled:w,onClick:function(){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:if(!(null===(e=g.callbacks)||void 0===e?void 0:e.removeLoyaltyPointsFromCart))return[3,4];b(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,g.callbacks.removeLoyaltyPointsFromCart()];case 2:return t.sent(),g.cartRefreshTrigger++,g.userRefreshTrigger++,[3,4];case 3:return b(!1),[7];case 4:return[2]}})})}},w&&n.createElement(y,null),v("main_screen.appliedDiscount.remove")),n.createElement(E,{$color:"#121926",$disabled:w,onClick:function(){g.storeUrl&&g.cartId&&(window.location.href="".concat(g.storeUrl,"/checkout?id=").concat(g.cartId,"&step=info"))}},v("main_screen.appliedDiscount.goToCheckout"),n.createElement(_,null,n.createElement(i,null))))))});export{g as default};