@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 1.56 kB
JavaScript
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import o from"./components/BoletoInput/BoletoInput.js";import{cleanCPFCNPJ as r}from"../internal/SocialSecurityNumberBrazil/utils.js";import i from"./components/BoletoVoucherResult/BoletoVoucherResult.js";import{CoreProvider as s}from"../../core/Context/CoreProvider.js";import{TxVariants as n}from"../tx-variants.js";function a(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class l extends e{get isValid(){return!!this.state.isValid}formatData(){const{data:t={}}=this.state,{billingAddress:e,shopperEmail:o,firstName:i,lastName:s,socialSecurityNumber:n=""}=t;return{paymentMethod:{type:this.type},...e&&{billingAddress:e},...o&&{shopperEmail:o},...i&&s&&{shopperName:{firstName:i,lastName:s}},...n&&{socialSecurityNumber:r(n)}}}render(){return t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},this.props.reference?t(i,{ref:this.handleRef,icon:this.icon,...this.props,onActionHandled:this.onActionHandled}):t(o,{setComponentRef:this.handleRef,...this.props,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton}))}constructor(...t){super(...t),a(this,"handleRef",(t=>{this.componentRef=t}))}}a(l,"type",n.boletobancario),a(l,"txVariants",[n.boletobancario,n.boletobancario_itau,n.boletobancario_santander,n.primeiropay_boleto]);export{l as BoletoElement,l as default};
//# sourceMappingURL=Boleto.js.map