@thecb/components 7.11.0-beta.2 → 7.11.0-beta.4
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/index.cjs.js +5 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/partial-amount-form/PartialAmountForm.js +7 -1
- package/src/components/molecules/partial-amount-form/PartialAmountForm.state.js +1 -0
package/package.json
CHANGED
|
@@ -41,12 +41,18 @@ const PartialAmountForm = ({
|
|
|
41
41
|
const getPartialAmountFormErrors = (maximum, itemAmount) => {
|
|
42
42
|
let errorMessages = amountErrors;
|
|
43
43
|
if (blockPartialPaymentOverpay) {
|
|
44
|
+
console.log("item amount in form is", itemAmount);
|
|
44
45
|
let maxAmount = !maximum || itemAmount < maximum ? itemAmount : maximum;
|
|
45
46
|
const maxAmountError = `There is a maximum payment of ${displayCurrency(
|
|
46
47
|
maxAmount
|
|
47
48
|
)}`;
|
|
48
|
-
|
|
49
|
+
console.log("max amount in form is", maxAmount);
|
|
50
|
+
return {
|
|
51
|
+
...errorMessages,
|
|
52
|
+
[numberLessThanOrEqualTo.error]: maxAmountError
|
|
53
|
+
};
|
|
49
54
|
}
|
|
55
|
+
console.log("error messages are", errorMessages);
|
|
50
56
|
return errorMessages;
|
|
51
57
|
};
|
|
52
58
|
|
|
@@ -21,6 +21,7 @@ export const createPartialAmountFormState = (
|
|
|
21
21
|
if (blockPartialPaymentOverpay) {
|
|
22
22
|
paymentMax = !maximum || item.amount < maximum ? item.amount : maximum;
|
|
23
23
|
}
|
|
24
|
+
console.log("payment max is", paymentMax);
|
|
24
25
|
const validators = [
|
|
25
26
|
required(),
|
|
26
27
|
validateSum(
|