@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 947 B
JavaScript
import{createElement as t,Fragment as e}from"../../external/preact/dist/preact.js";import{UIElement as n}from"../internal/UIElement/UIElement.js";import a from"./components/DonationComponent.js";import{TxVariants as s}from"../tx-variants.js";function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i extends n{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)}componentToRender(){return t(e,null,t(a,{...this.props,ref:this.handleRef,onChange:this.setState,onDonate:this.donate}))}constructor(t,e){super(t,e),o(this,"handleRef",t=>{this.componentRef=t}),this.donate=this.donate.bind(this)}}o(i,"type",s.donation),o(i,"defaultProps",{onCancel:()=>{},onDonate:()=>{}});export{i as default};
//# sourceMappingURL=Donation.js.map