@ikas/storefront 6.1.0-beta.151 → 6.1.0-beta.152

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 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import"@ikas/storefront-config";import{formatCurrency as o}from"../../../../../../utils/currency.js";import{useTranslation as i}from"../../../../../../utils/i18n.js";import a from"./style.module.scss.js";import c from"../../../../components/svg/credit-balance.js";var l=n((function(n){var l,u,d=n.vm,m=i().t,v=r.useState(!1),f=v[0],C=v[1],h=null===(l=d.checkout.giftCardLines)||void 0===l?void 0:l.find((function(e){var t;return e.code===(null===(t=d.storeCreditBalance)||void 0===t?void 0:t.storeCredits[0].code)}));if(r.useEffect((function(){C(!!h)}),[h]),!(null===(u=d.storeCreditBalance)||void 0===u?void 0:u.amount))return null;var p=h?(null==h?void 0:h.amount)||0:d.finalPrice>d.storeCreditBalance.amount?d.storeCreditBalance.amount:d.finalPrice;return r.createElement("div",{className:a.StoreCredit},r.createElement("div",{className:a.StoreCreditBalance},r.createElement("div",{className:a.StoreCreditBalanceLeft},r.createElement("div",{style:{width:"24px",height:"24px"}},r.createElement(c,null)),r.createElement("div",null,r.createElement("span",{className:a.StoreCreditBalanceAmount},o(p,d.checkout.currencyCode,d.checkout.currencySymbol)),r.createElement("span",null,m("checkout-page:storeCreditBalance")))),r.createElement("div",{className:a.StoreCreditBalanceRight},r.createElement("div",null,r.createElement(s,{value:f,onChange:function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return C(r),r?(d.checkout.couponCode=(null===(e=d.storeCreditBalance)||void 0===e?void 0:e.storeCredits[0].code)||null,[4,d.onCouponCodeApply()]):[3,2];case 1:return t.sent(),[3,5];case 2:return[4,d.removeGiftCardLine((null==h?void 0:h.giftCardId)||"")];case 3:return t.sent(),[4,d.reInitPaymentMethod()];case 4:t.sent(),t.label=5;case 5:return[2]}}))}))}})))))})),s=function(e){var t=e.value,n=e.onChange;return r.createElement("div",{onClick:function(){n(!t)},className:[a.ToggleSwitch,t?a.ToggleSwitchActive:""].join(" ")},r.createElement("div",{className:[a.ToggleSwitchThumb,t?a.ToggleSwitchThumbActive:""].join(" ")}))};export{l as StoreCredit};
1
+ import{__awaiter as e,__generator as t}from'./../../../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import"@ikas/storefront-config";import{formatCurrency as o}from"../../../../../../utils/currency.js";import{useTranslation as i}from"../../../../../../utils/i18n.js";import a from"./style.module.scss.js";import l from"../../../../components/svg/credit-balance.js";var c=n((function(n){var c,d,u,m,v=n.vm,f=i().t,C=r.useState(!1),h=C[0],p=C[1],g=(null===(c=v.storeCreditBalance)||void 0===c?void 0:c.storeCredits)&&(null===(d=v.storeCreditBalance)||void 0===d?void 0:d.storeCredits.length)>0?null===(u=v.checkout.giftCardLines)||void 0===u?void 0:u.find((function(e){var t,r;return e.code===(null===(r=null===(t=v.storeCreditBalance)||void 0===t?void 0:t.storeCredits[0])||void 0===r?void 0:r.code)})):void 0;if(r.useEffect((function(){p(!!g)}),[g]),!(null===(m=v.storeCreditBalance)||void 0===m?void 0:m.amount))return null;var E=g?(null==g?void 0:g.amount)||0:v.finalPrice>v.storeCreditBalance.amount?v.storeCreditBalance.amount:v.finalPrice;return r.createElement("div",{className:a.StoreCredit},r.createElement("div",{className:a.StoreCreditBalance},r.createElement("div",{className:a.StoreCreditBalanceLeft},r.createElement("div",{style:{width:"24px",height:"24px"}},r.createElement(l,null)),r.createElement("div",null,r.createElement("span",{className:a.StoreCreditBalanceAmount},o(E,v.checkout.currencyCode,v.checkout.currencySymbol)),r.createElement("span",null,f("checkout-page:storeCreditBalance")))),r.createElement("div",{className:a.StoreCreditBalanceRight},r.createElement("div",null,r.createElement(s,{value:h,onChange:function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return p(r),r?(v.checkout.couponCode=(null===(e=v.storeCreditBalance)||void 0===e?void 0:e.storeCredits[0].code)||null,[4,v.onCouponCodeApply()]):[3,2];case 1:return t.sent(),[3,5];case 2:return[4,v.removeGiftCardLine((null==g?void 0:g.giftCardId)||"")];case 3:return t.sent(),[4,v.reInitPaymentMethod()];case 4:t.sent(),t.label=5;case 5:return[2]}}))}))}})))))})),s=function(e){var t=e.value,n=e.onChange;return r.createElement("div",{onClick:function(){n(!t)},className:[a.ToggleSwitch,t?a.ToggleSwitchActive:""].join(" ")},r.createElement("div",{className:[a.ToggleSwitchThumb,t?a.ToggleSwitchThumbActive:""].join(" ")}))};export{c as StoreCredit};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "6.1.0-beta.151",
3
+ "version": "6.1.0-beta.152",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -21,11 +21,11 @@
21
21
  "swiper": "11.0.6"
22
22
  },
23
23
  "devDependencies": {
24
- "@ikas/storefront-api": "^6.1.0-beta.151",
25
- "@ikas/storefront-config": "^6.1.0-beta.151",
26
- "@ikas/storefront-model-functions": "^6.1.0-beta.151",
27
- "@ikas/storefront-models": "^6.1.0-beta.151",
28
- "@ikas/storefront-providers": "^6.1.0-beta.151",
24
+ "@ikas/storefront-api": "^6.1.0-beta.152",
25
+ "@ikas/storefront-config": "^6.1.0-beta.152",
26
+ "@ikas/storefront-model-functions": "^6.1.0-beta.152",
27
+ "@ikas/storefront-models": "^6.1.0-beta.152",
28
+ "@ikas/storefront-providers": "^6.1.0-beta.152",
29
29
  "@ikas/localized-address": "1.0.0-beta.6",
30
30
  "@adyen/adyen-web": "^5.57.0",
31
31
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -60,11 +60,11 @@
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@ikas/localized-address": "1.0.0-beta.6",
63
- "@ikas/storefront-api": "^6.1.0-beta.151",
64
- "@ikas/storefront-config": "^6.1.0-beta.151",
65
- "@ikas/storefront-model-functions": "^6.1.0-beta.151",
66
- "@ikas/storefront-models": "^6.1.0-beta.151",
67
- "@ikas/storefront-providers": "^6.1.0-beta.151",
63
+ "@ikas/storefront-api": "^6.1.0-beta.152",
64
+ "@ikas/storefront-config": "^6.1.0-beta.152",
65
+ "@ikas/storefront-model-functions": "^6.1.0-beta.152",
66
+ "@ikas/storefront-models": "^6.1.0-beta.152",
67
+ "@ikas/storefront-providers": "^6.1.0-beta.152",
68
68
  "mobx": "^6.1.3",
69
69
  "mobx-react-lite": "^3.1.5",
70
70
  "next": "12.2.0",