@paypal/checkout-components 5.0.376 → 5.0.378-alpha-6f98b0f0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button.js +1 -1
- package/dist/test/button.js +1 -1
- package/package.json +1 -1
- package/src/funding/paylater/config.jsx +10 -6
- package/src/ui/buttons/props.js +1 -0
- package/src/ui/buttons/props.test.js +28 -0
- package/src/ui/buttons/styles/styleUtils.js +6 -2
- package/src/zoid/buttons/component.jsx +12 -0
- package/src/zoid/card-form/component.js +6 -0
package/package.json
CHANGED
|
@@ -29,17 +29,21 @@ function getLabelText(fundingEligibility: FundingEligibilityType): ?string {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
if (
|
|
32
|
-
paylater?.products?.payIn3?.eligible &&
|
|
33
|
-
|
|
32
|
+
(paylater?.products?.payIn3?.eligible &&
|
|
33
|
+
paylater?.products?.payIn3?.variant === "ES") ||
|
|
34
|
+
(paylater?.products?.paylater?.eligible &&
|
|
35
|
+
paylater?.products?.paylater?.variant === "ES")
|
|
34
36
|
) {
|
|
35
|
-
labelText = "Paga
|
|
37
|
+
labelText = "Paga a plazos";
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
if (
|
|
39
|
-
paylater?.products?.payIn3?.eligible &&
|
|
40
|
-
|
|
41
|
+
(paylater?.products?.payIn3?.eligible &&
|
|
42
|
+
paylater?.products?.payIn3?.variant === "IT") ||
|
|
43
|
+
(paylater?.products?.paylater?.eligible &&
|
|
44
|
+
paylater?.products?.paylater?.variant === "IT")
|
|
41
45
|
) {
|
|
42
|
-
labelText = "Paga
|
|
46
|
+
labelText = "Paga a rate";
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
if (paylater?.products?.payIn4?.eligible) {
|
package/src/ui/buttons/props.js
CHANGED
|
@@ -868,3 +868,31 @@ describe("getButtonColor", () => {
|
|
|
868
868
|
});
|
|
869
869
|
});
|
|
870
870
|
});
|
|
871
|
+
|
|
872
|
+
describe("HideSubmitButtonProps type validation", () => {
|
|
873
|
+
it("should allow hideSubmitButtonForCardForm as an optional boolean property", () => {
|
|
874
|
+
// This test ensures the Flow type definition accepts the new property
|
|
875
|
+
const validButtonProps = {
|
|
876
|
+
hideSubmitButtonForCardForm: true,
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
// This would fail Flow type checking if the property isn't properly defined
|
|
880
|
+
expect(typeof validButtonProps.hideSubmitButtonForCardForm).toBe("boolean");
|
|
881
|
+
});
|
|
882
|
+
|
|
883
|
+
it("should allow hideSubmitButtonForCardForm to be undefined", () => {
|
|
884
|
+
const validButtonProps = {
|
|
885
|
+
// hideSubmitButtonForCardForm is optional
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
expect(validButtonProps.hideSubmitButtonForCardForm).toBeUndefined();
|
|
889
|
+
});
|
|
890
|
+
|
|
891
|
+
it("should allow hideSubmitButtonForCardForm to be false", () => {
|
|
892
|
+
const validButtonProps = {
|
|
893
|
+
hideSubmitButtonForCardForm: false,
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
expect(validButtonProps.hideSubmitButtonForCardForm).toBe(false);
|
|
897
|
+
});
|
|
898
|
+
});
|
|
@@ -120,7 +120,9 @@ export function getResponsiveStyleVariables({
|
|
|
120
120
|
const shouldResizeLabel =
|
|
121
121
|
paylater?.products?.paylater?.variant === "DE" ||
|
|
122
122
|
paylater?.products?.payIn3?.variant === "IT" ||
|
|
123
|
-
paylater?.products?.
|
|
123
|
+
paylater?.products?.paylater?.variant === "IT" ||
|
|
124
|
+
paylater?.products?.payIn3?.variant === "ES" ||
|
|
125
|
+
paylater?.products?.paylater?.variant === "ES";
|
|
124
126
|
|
|
125
127
|
const textPercPercentage = shouldResizeLabel ? 32 : 36;
|
|
126
128
|
const labelPercPercentage = shouldResizeLabel ? 32 : 35;
|
|
@@ -174,7 +176,9 @@ export function getDisableMaxHeightResponsiveStyleVariables({
|
|
|
174
176
|
const shouldResizeLabel =
|
|
175
177
|
paylater?.products?.paylater?.variant === "DE" ||
|
|
176
178
|
paylater?.products?.payIn3?.variant === "IT" ||
|
|
177
|
-
paylater?.products?.
|
|
179
|
+
paylater?.products?.paylater?.variant === "IT" ||
|
|
180
|
+
paylater?.products?.payIn3?.variant === "ES" ||
|
|
181
|
+
paylater?.products?.paylater?.variant === "ES";
|
|
178
182
|
|
|
179
183
|
const labelHeight = getLabelHeight({
|
|
180
184
|
height: buttonHeight,
|
|
@@ -1298,6 +1298,18 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
1298
1298
|
required: false,
|
|
1299
1299
|
default: () => window.__TEST_WALLET__,
|
|
1300
1300
|
},
|
|
1301
|
+
|
|
1302
|
+
hideSubmitButtonForCardForm: {
|
|
1303
|
+
type: "boolean",
|
|
1304
|
+
required: false,
|
|
1305
|
+
queryParam: true,
|
|
1306
|
+
},
|
|
1307
|
+
},
|
|
1308
|
+
|
|
1309
|
+
exports: {
|
|
1310
|
+
submitCardForm: {
|
|
1311
|
+
type: "function",
|
|
1312
|
+
},
|
|
1301
1313
|
},
|
|
1302
1314
|
});
|
|
1303
1315
|
});
|