@thecb/components 8.4.10 → 8.4.11-beta.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/index.cjs.js +25 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +25 -19
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/partial-amount-form/PartialAmountForm.state.js +38 -22
- package/src/components/molecules/partial-amount-form/index.js +9 -2
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- /package/src/components/atoms/icons/{ExternalLinkIcon.js → ExternalLinkicon.js} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -47801,24 +47801,7 @@ var createPartialAmountFormState = function createPartialAmountFormState(lineIte
|
|
|
47801
47801
|
var minimum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
47802
47802
|
var blockPartialPaymentOverpay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
47803
47803
|
var formConfig = lineItems.reduce(function (acc, item) {
|
|
47804
|
-
var validators =
|
|
47805
|
-
return lineItem != item;
|
|
47806
|
-
}).reduce(function (acc, curr) {
|
|
47807
|
-
return [].concat(_toConsumableArray(acc), [curr.id]);
|
|
47808
|
-
}, []))];
|
|
47809
|
-
|
|
47810
|
-
if (!!maximum) {
|
|
47811
|
-
validators.push(validateSum(numberLessThanOrEqualTo(maximum), lineItems.filter(function (lineItem) {
|
|
47812
|
-
return lineItem != item;
|
|
47813
|
-
}).reduce(function (acc, curr) {
|
|
47814
|
-
return [].concat(_toConsumableArray(acc), [curr.id]);
|
|
47815
|
-
}, [])));
|
|
47816
|
-
}
|
|
47817
|
-
|
|
47818
|
-
if (blockPartialPaymentOverpay) {
|
|
47819
|
-
validators.push(numberLessThanOrEqualTo(item.amount));
|
|
47820
|
-
}
|
|
47821
|
-
|
|
47804
|
+
var validators = createPartialAmountFormValidators(lineItems, maximum, minimum, blockPartialPaymentOverpay);
|
|
47822
47805
|
return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, item.id, {
|
|
47823
47806
|
validators: validators,
|
|
47824
47807
|
constraints: [onlyNaturals()],
|
|
@@ -47837,6 +47820,29 @@ var createPartialAmountFormState = function createPartialAmountFormState(lineIte
|
|
|
47837
47820
|
partialAmountFormMapDispatchToProps: mapDispatchToProps
|
|
47838
47821
|
};
|
|
47839
47822
|
};
|
|
47823
|
+
var createPartialAmountFormValidators = function createPartialAmountFormValidators(lineItems, maximum) {
|
|
47824
|
+
var minimum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
47825
|
+
var blockPartialPaymentOverpay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
47826
|
+
var validators = [required(), validateSum(numberGreaterThanOrEqualTo(minimum), lineItems.filter(function (lineItem) {
|
|
47827
|
+
return lineItem != item;
|
|
47828
|
+
}).reduce(function (acc, curr) {
|
|
47829
|
+
return [].concat(_toConsumableArray(acc), [curr.id]);
|
|
47830
|
+
}, []))];
|
|
47831
|
+
|
|
47832
|
+
if (!!maximum) {
|
|
47833
|
+
validators.push(validateSum(numberLessThanOrEqualTo(maximum), lineItems.filter(function (lineItem) {
|
|
47834
|
+
return lineItem != item;
|
|
47835
|
+
}).reduce(function (acc, curr) {
|
|
47836
|
+
return [].concat(_toConsumableArray(acc), [curr.id]);
|
|
47837
|
+
}, [])));
|
|
47838
|
+
}
|
|
47839
|
+
|
|
47840
|
+
if (blockPartialPaymentOverpay) {
|
|
47841
|
+
validators.push(numberLessThanOrEqualTo(item.amount));
|
|
47842
|
+
}
|
|
47843
|
+
|
|
47844
|
+
return validators;
|
|
47845
|
+
};
|
|
47840
47846
|
|
|
47841
47847
|
var arrowColor = WHITE;
|
|
47842
47848
|
var numberColor = MATISSE_BLUE;
|
|
@@ -50676,6 +50682,7 @@ exports.XCircleIconSmall = XCircleIconSmall;
|
|
|
50676
50682
|
exports.cardRegistry = cardRegistry;
|
|
50677
50683
|
exports.constants = index$5;
|
|
50678
50684
|
exports.createPartialAmountFormState = createPartialAmountFormState;
|
|
50685
|
+
exports.createPartialAmountFormValidators = createPartialAmountFormValidators;
|
|
50679
50686
|
exports.util = index$4;
|
|
50680
50687
|
exports.withWindowSize = withWindowSize;
|
|
50681
50688
|
//# sourceMappingURL=index.cjs.js.map
|