@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 1.07 kB
JavaScript
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import{CoreProvider as n}from"../../core/Context/CoreProvider.js";import o from"./components/DonationComponent.js";import{TxVariants as s}from"../tx-variants.js";function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class r extends e{get data(){return this.state.data}get isValid(){return this.state.isValid}setState(t){this.state={...this.state,...t}}donate(){const{data:t,isValid:e}=this;this.props.onDonate({data:t,isValid:e},this)}render(){return t(n,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(o,{...this.props,ref:this.handleRef,onChange:this.setState,onDonate:this.donate}))}constructor(t,e){super(t,e),a(this,"handleRef",(t=>{this.componentRef=t})),this.donate=this.donate.bind(this)}}a(r,"type",s.donation),a(r,"defaultProps",{onCancel:()=>{},onDonate:()=>{}});export{r as default};
//# sourceMappingURL=Donation.js.map