@ikas/storefront 4.0.26 → 4.0.27
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 o,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import*as e from"react";import{observer as t}from"mobx-react-lite";import'./../../../../ext/@stripe/react-stripe-js/dist/react-stripe.umd.js';import{loadStripe as i}from'./../../../../ext/@stripe/stripe-js/dist/stripe.esm.js';import{CheckoutForm as s}from"./checkout-form.js";import{r as n}from"../../../../_virtual/react-stripe.umd.js";var l=t((function(t){var l,p,
|
|
1
|
+
import{__awaiter as o,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import*as e from"react";import{observer as t}from"mobx-react-lite";import'./../../../../ext/@stripe/react-stripe-js/dist/react-stripe.umd.js';import{loadStripe as i}from'./../../../../ext/@stripe/stripe-js/dist/stripe.esm.js';import{CheckoutForm as s}from"./checkout-form.js";import{r as n}from"../../../../_virtual/react-stripe.umd.js";var l=t((function(t){var l,a,p,c,d,u,m,v,b,f=t.vm;if(!f.stripeResponse)return null;var x=e.useState(null),E=x[0],z=x[1];e.useEffect((function(){!function(){o(this,void 0,void 0,(function(){var o;return r(this,(function(r){switch(r.label){case 0:return f.stripeResponse?[4,i(f.stripeResponse.apiKey,{stripeAccount:f.stripeResponse.accountId})]:[3,2];case 1:o=r.sent(),z(o),r.label=2;case 2:return[2]}}))}))}()}),[f.stripeResponse]);var C={clientSecret:f.stripeResponse.clientSecret,appearance:{variables:{borderRadius:"8px"},labels:"floating",rules:{".Input":{lineHeight:"16px",boxShadow:"0 0 0 1px transparent",transition:"padding .1s, border-color .5s, box-shadow .5s",padding:"8px 16px",border:"1px solid ".concat((null===(l=f.customizationProps)||void 0===l?void 0:l.borderColor)||"#E5E4E9")},".Input::placeholder":{fontSize:"14px",color:(null===(a=f.customizationProps)||void 0===a?void 0:a.secondaryTextColor)||"#8A8B94"},".Input:focus":{boxShadow:"0 0 0 1px ".concat((null===(p=f.customizationProps)||void 0===p?void 0:p.buttonBgColor)||"##272727"),borderColor:(null===(c=f.customizationProps)||void 0===c?void 0:c.buttonBgColor)||"##272727"},".Input--invalid":{boxShadow:"0 0 0 1px ".concat((null===(d=f.customizationProps)||void 0===d?void 0:d.errorColor)||"#FB4E4E"),borderColor:(null===(u=f.customizationProps)||void 0===u?void 0:u.errorColor)||"#FB4E4E",color:(null===(m=f.customizationProps)||void 0===m?void 0:m.errorColor)||"#FB4E4E"},".Label":{fontSize:"14px",color:(null===(v=f.customizationProps)||void 0===v?void 0:v.secondaryTextColor)||"#8A8B94"},".Error":{fontSize:"12px",marginTop:"8px",color:(null===(b=f.customizationProps)||void 0===b?void 0:b.errorColor)||"#FB4E4E"}}}};return e.createElement(e.Fragment,null,e.createElement(n.exports.Elements,{stripe:E,options:C},e.createElement(s,{callbackUrl:f.stripeResponse.callbackUrl,vm:f})))}));export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasPaymentMethodType as a,IkasPaymentGatewayTransactionFeeType as n,IkasPaymentGatewayAdditionalPriceType as o,IkasPaymentGatewayType as r}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import{CreditCardForm as m}from"../../../components/credit-card-form/index.js";import{Installments as i}from"./installments/index.js";import d from"../../../components/select-box/index.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{formatCurrency as s}from"../../../../../utils/currency.js";import{useTranslation as c}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";import u from"next/dynamic";import y from"../../../components/credit-card-form/model.js";import x from"../../../components/master-pass/credit-card-form/index.js";import{Klarna as f}from"../../../components/klarna/index.js";import{Toggle as v}from"../../../components/toggle/index.js";import j from"../../../components/select-box/style.module.scss.js";import g from"../../../components/master-pass/payment-gateway/svg/master-card.js";import E from"../../../components/master-pass/payment-gateway/svg/troy.js";import h from"../../../components/master-pass/payment-gateway/svg/visa.js";var C=u((function(){return import("../../../components/stripe/index.js").then((function(e){return e.
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasPaymentMethodType as a,IkasPaymentGatewayTransactionFeeType as n,IkasPaymentGatewayAdditionalPriceType as o,IkasPaymentGatewayType as r}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import{CreditCardForm as m}from"../../../components/credit-card-form/index.js";import{Installments as i}from"./installments/index.js";import d from"../../../components/select-box/index.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{formatCurrency as s}from"../../../../../utils/currency.js";import{useTranslation as c}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";import u from"next/dynamic";import y from"../../../components/credit-card-form/model.js";import x from"../../../components/master-pass/credit-card-form/index.js";import{Klarna as f}from"../../../components/klarna/index.js";import{Toggle as v}from"../../../components/toggle/index.js";import j from"../../../components/select-box/style.module.scss.js";import g from"../../../components/master-pass/payment-gateway/svg/master-card.js";import E from"../../../components/master-pass/payment-gateway/svg/troy.js";import h from"../../../components/master-pass/payment-gateway/svg/visa.js";var C=u((function(){return import("../../../components/stripe/index.js").then((function(e){return e.default}))})),w=t((function(t){var u=t.vm,w=c().t,P=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},k=function(t){return e.createElement("div",{className:l.AdditionalPrice},t.children)},I=function(e){return 0===e.amount?"":"".concat(e.amountType===n.AMOUNT?s(e.amount,u.checkout.currencyCode,u.checkout.currencySymbol):" %"+e.amount).concat(e.type===o.DECREMENT?" "+w("checkout-page:paymentMethodDiscount"):" "+w("checkout-page:paymentMethodAdditionalPrice"))},N=function(e){var t;return"STRIPE"===e.code&&(null===(t=e.settings)||void 0===t?void 0:t.find((function(e){return"allow_custom_flow"===e.label&&"1"===e.value})))};return e.createElement(e.Fragment,null,!!u.mpVM.cards.length&&u.mpVM.cards.map((function(t,n){var o,m=u.paymentGateways.find((function(e){return e.id===t.paymentGatewayId})),s=e.createElement("button",{className:l.MasterPassSelectBoxDeleteButton,onClick:function(e){e.stopPropagation(),u.mpVM.deleteCard({store:u.store,checkout:u.checkout,card:t})}},w("checkout-page:masterPass.paymentGatewaySelectBox.delete")),c=function(e){return t.Value1.startsWith(e)},p=c("4"),x=c("5")||c("6"),f=c("9"),v=e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("span",{className:l.MasterPassSelectBoxLabelLogo},p&&e.createElement(h,null),x&&e.createElement(g,null),f&&e.createElement(E,null)),t.Name," ",t.Value1),j=(null==m?void 0:m.id)&&m.paymentMethodType===a.CREDIT_CARD&&m.type===r.INTERNAL?u.installmentInfo&&e.createElement(i,{vm:u}):void 0;return e.createElement(d,{key:n,isSelected:(null===(o=u.mpVM.selectedCard)||void 0===o?void 0:o.UniqueId)===t.UniqueId,label:v,rightContent:s,bottomContent:j,onClick:function(){var e;(null===(e=u.mpVM.selectedCard)||void 0===e?void 0:e.UniqueId)!==t.UniqueId&&(u.checkout.selectedPaymentGateway=null,u.cardData=new y,u.installmentInfo=void 0,u.mpVM.selectedCard=t,t.Value1&&t.paymentGatewayId&&u.checkout.totalFinalPrice&&u.retrieveInstallmentInfo({input:{binNumber:t.Value1.slice(0,6),paymentGatewayId:t.paymentGatewayId,price:u.checkout.totalFinalPrice}}))}})})),u.paymentGateways.filter((function(e){return"in-store"!==u.deliveryMethod||e.paymentMethodType!==a.CASH_ON_DELIVERY&&e.paymentMethodType!==a.CREDIT_CARD_ON_DELIVERY})).map((function(t,n){var o;if(function(e){return"KLARNA"===e.code}(t))return null;var s=t.paymentMethodType===a.CREDIT_CARD&&t.type===r.INTERNAL?e.createElement(e.Fragment,null,N(t)?e.createElement(C,{vm:u,pg:t}):e.createElement("div",null,e.createElement(m,{vm:u}),u.isPaymentGatewayHasMasterPass&&e.createElement(x,{vm:u}),u.installmentInfo&&e.createElement(i,{vm:u}))):t.description?e.createElement(e.Fragment,null,t.type===r.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(p,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0;return e.createElement(d,{key:t.id,label:t.paymentMethodType===a.CREDIT_CARD&&t.type===r.INTERNAL?N(t)?" ":w("checkout-page:creditCard"):t.name,isSelected:u.selectedPaymentGatewayIndex===n,rightContent:(null===(o=t.additionalPrices)||void 0===o?void 0:o.length)?e.createElement(k,null,I(t.additionalPrices[0])):e.createElement(P,null,!!t.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:s,onClick:function(){u.selectedPaymentGatewayIndex!==n&&(u.setPaymentGateway(n),u.mpVM.selectedCard=void 0)}})})),u.klarnaPaymentGateway&&function(){var t,a=u.selectedPaymentGatewayIndex===u.klarnaPaymentGatewayIndex;return u.klarnaPaymentGateway?e.createElement("div",{className:j.SelectBoxContainer},e.createElement("div",{className:"".concat(j.SelectBox," ").concat(a?j.Selected:""),onClick:function(){u.setPaymentGateway(u.klarnaPaymentGatewayIndex),u.mpVM.selectedCard=void 0}},e.createElement("div",{className:j.TopContent},e.createElement(v,{value:a,label:u.klarnaPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:j.RightContent},(null===(t=u.klarnaPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(k,null,I(u.klarnaPaymentGateway.additionalPrices[0])):e.createElement(P,null,!!u.klarnaPaymentGateway.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:u.klarnaPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?j.BottomContent:""," ").concat(a?"":l.Hidden)},e.createElement(f,{vm:u})))):null}())}));export{w as PaymentGateways};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.27",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"libphonenumber-js": "^1.10.6"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@ikas/storefront-api": "^4.0.
|
|
27
|
-
"@ikas/storefront-config": "^4.0.
|
|
28
|
-
"@ikas/storefront-model-functions": "^4.0.
|
|
29
|
-
"@ikas/storefront-models": "^4.0.
|
|
30
|
-
"@ikas/storefront-providers": "^4.0.
|
|
26
|
+
"@ikas/storefront-api": "^4.0.27",
|
|
27
|
+
"@ikas/storefront-config": "^4.0.27",
|
|
28
|
+
"@ikas/storefront-model-functions": "^4.0.27",
|
|
29
|
+
"@ikas/storefront-models": "^4.0.27",
|
|
30
|
+
"@ikas/storefront-providers": "^4.0.27",
|
|
31
31
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
32
32
|
"@rollup/plugin-json": "^4.1.0",
|
|
33
33
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"query-string": "^6.13.8"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@ikas/storefront-api": "^4.0.
|
|
57
|
-
"@ikas/storefront-config": "^4.0.
|
|
58
|
-
"@ikas/storefront-model-functions": "^4.0.
|
|
59
|
-
"@ikas/storefront-models": "^4.0.
|
|
60
|
-
"@ikas/storefront-providers": "^4.0.
|
|
56
|
+
"@ikas/storefront-api": "^4.0.27",
|
|
57
|
+
"@ikas/storefront-config": "^4.0.27",
|
|
58
|
+
"@ikas/storefront-model-functions": "^4.0.27",
|
|
59
|
+
"@ikas/storefront-models": "^4.0.27",
|
|
60
|
+
"@ikas/storefront-providers": "^4.0.27",
|
|
61
61
|
"mobx": "^6.1.3",
|
|
62
62
|
"mobx-react-lite": "^3.1.5",
|
|
63
63
|
"next": "12.2.0",
|