@paypal/checkout-components
Advanced tools
Comparing version 5.0.331 to 5.0.332-alpha-0373ea8.0
{ | ||
"name": "@paypal/checkout-components", | ||
"version": "5.0.331", | ||
"version": "5.0.332-alpha-0373ea8.0", | ||
"description": "PayPal Checkout components, for integrating checkout products.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -443,3 +443,3 @@ /* eslint-disable eslint-comments/disable-enable-pair */ | ||
export type ButtonMessageInputs = {| | ||
amount?: number | void, | ||
amount?: number | string | void, | ||
offer?: $ReadOnlyArray<$Values<typeof MESSAGE_OFFER>> | void, | ||
@@ -785,3 +785,2 @@ color?: $Values<typeof MESSAGE_COLOR> | void, | ||
const { | ||
amount, | ||
color = MESSAGE_COLOR.BLACK, | ||
@@ -792,4 +791,9 @@ position, | ||
let offer = message.offer; | ||
let amount = message.amount; | ||
if (typeof amount !== "undefined") { | ||
if (typeof amount !== "number") { | ||
if (typeof amount === "string") { | ||
amount = Number(amount); | ||
} | ||
if (typeof amount !== "number" || isNaN(amount)) { | ||
throw new TypeError( | ||
@@ -796,0 +800,0 @@ `Expected message.amount to be a number, got: ${amount}` |
@@ -55,2 +55,5 @@ /* @flow */ | ||
|}, | ||
styleOptions?: {| | ||
disablePrerender?: boolean, | ||
|}, | ||
env?: string, | ||
@@ -134,5 +137,9 @@ locale?: string, | ||
const height = props.style?.height ?? props.style?.input?.height ?? null; | ||
return (<CardPrerender nonce={props.nonce} height={height} />).render( | ||
dom({ doc }) | ||
); | ||
return ( | ||
<CardPrerender | ||
nonce={props.nonce} | ||
height={height} | ||
isDisabled={Boolean(props.styleOptions?.disablePrerender)} | ||
/> | ||
).render(dom({ doc })); | ||
}; | ||
@@ -301,2 +308,15 @@ | ||
styleOptions: { | ||
type: "object", | ||
required: false, | ||
queryParam: true, | ||
value: ({ props }) => { | ||
return { | ||
...props.parent.props.styleOptions, | ||
// $FlowFixMe | ||
...props.styleOptions, | ||
}; | ||
}, | ||
}, | ||
onChange: { | ||
@@ -303,0 +323,0 @@ type: "function", |
/* @flow */ | ||
/** @jsx node */ | ||
import { node, type ChildType } from "@krakenjs/jsx-pragmatic/src"; | ||
import { node, type NullableChildType } from "@krakenjs/jsx-pragmatic/src"; | ||
@@ -9,2 +9,3 @@ type PrerenderedCardProps = {| | ||
height: ?number, | ||
isDisabled: ?boolean, | ||
|}; | ||
@@ -17,3 +18,7 @@ | ||
height, | ||
}: PrerenderedCardProps): ChildType { | ||
isDisabled, | ||
}: PrerenderedCardProps): NullableChildType { | ||
if (isDisabled) { | ||
return null; | ||
} | ||
return ( | ||
@@ -20,0 +25,0 @@ <html> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
1213323
16798
1