airwallex-payment-elements
Advanced tools
Comparing version 0.0.32 to 0.0.33
@@ -14,2 +14,3 @@ import { LitElement } from 'lit-element'; | ||
theme: object; | ||
height: number; | ||
constructor(); | ||
@@ -61,2 +62,6 @@ static readonly properties: { | ||
}; | ||
height: { | ||
type: NumberConstructor; | ||
hasChanged(): boolean; | ||
}; | ||
}; | ||
@@ -63,0 +68,0 @@ static readonly styles: import("lit-element").CSSResult; |
@@ -9,2 +9,3 @@ import { css, html, LitElement } from 'lit-element'; | ||
this.theme = {}; | ||
this.height = 0; | ||
} | ||
@@ -23,3 +24,6 @@ static get properties() { | ||
errorUrl: { type: String, reflect: true }, | ||
theme: { type: Object, reflect: true } | ||
theme: { type: Object, reflect: true }, | ||
height: { type: Number, hasChanged() { | ||
return true; | ||
} } | ||
}; | ||
@@ -33,7 +37,2 @@ } | ||
} | ||
iframe { | ||
width: 100%; | ||
height: 1280px; | ||
margin: 4px; | ||
} | ||
`; | ||
@@ -52,3 +51,7 @@ } | ||
console.info(`Airwallex Checkout Message: [${JSON.stringify(event.data)}]`); | ||
this.handleEvent(event.data); | ||
const { style, ...rest } = event.data; | ||
this.height = style && style.height || 0; | ||
if (event.data.code !== 'AWX_CHECKOUT_STYLE') { | ||
this.handleEvent(rest); | ||
} | ||
if (event.data.code === 'AWX_CHECKOUT_SUCCESS') { | ||
@@ -77,2 +80,3 @@ const status = event.data.status ? `status=${event.data.status}` : ''; | ||
} | ||
this.requestUpdate(); | ||
} | ||
@@ -90,2 +94,9 @@ } | ||
return html ` | ||
<style> | ||
iframe { | ||
width: 100%; | ||
height: ${this.height + 8}px; | ||
margin: 4px; | ||
} | ||
</style> | ||
<iframe | ||
@@ -92,0 +103,0 @@ frameborder="0" |
@@ -14,2 +14,3 @@ import { LitElement } from 'lit-element'; | ||
theme: object; | ||
height: number; | ||
constructor(); | ||
@@ -61,2 +62,6 @@ static readonly properties: { | ||
}; | ||
height: { | ||
type: NumberConstructor; | ||
hasChanged(): boolean; | ||
}; | ||
}; | ||
@@ -63,0 +68,0 @@ static readonly styles: import("lit-element").CSSResult; |
{ | ||
"name": "airwallex-payment-elements", | ||
"version": "0.0.32", | ||
"version": "0.0.33", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
@@ -17,2 +17,3 @@ import { css, html, LitElement } from 'lit-element'; | ||
theme: object; | ||
height: number; | ||
constructor() { | ||
@@ -22,3 +23,3 @@ super(); | ||
this.currency = this.intentId = this.customerId = this.successUrl = this.cancelUrl = this.errorUrl = ''; | ||
this.theme = {}; | ||
this.theme = {}; this.height = 0; | ||
} | ||
@@ -37,3 +38,6 @@ static get properties() { | ||
errorUrl: { type: String, reflect: true }, | ||
theme: { type: Object, reflect: true } | ||
theme: { type: Object, reflect: true }, | ||
height: { type: Number, hasChanged() { | ||
return true; | ||
}} | ||
}; | ||
@@ -47,7 +51,2 @@ } | ||
} | ||
iframe { | ||
width: 100%; | ||
height: 1280px; | ||
margin: 4px; | ||
} | ||
`; | ||
@@ -66,3 +65,7 @@ } | ||
console.info(`Airwallex Checkout Message: [${JSON.stringify(event.data)}]`); | ||
this.handleEvent(event.data); | ||
const { style, ...rest } = event.data; | ||
this.height = style && style.height || 0; | ||
if (event.data.code !== 'AWX_CHECKOUT_STYLE') { | ||
this.handleEvent(rest); | ||
} | ||
if (event.data.code === 'AWX_CHECKOUT_SUCCESS') { | ||
@@ -87,4 +90,5 @@ const status = event.data.status ? `status=${event.data.status}` : ''; | ||
} else { | ||
// ❌Should never get here! | ||
// 🖐Do nothing, give me five! | ||
} | ||
this.requestUpdate(); | ||
} | ||
@@ -102,2 +106,9 @@ } | ||
return html` | ||
<style> | ||
iframe { | ||
width: 100%; | ||
height: ${this.height + 8}px; | ||
margin: 4px; | ||
} | ||
</style> | ||
<iframe | ||
@@ -104,0 +115,0 @@ frameborder="0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2852492
3123