@thecb/components 6.1.4-beta.1 → 6.1.4-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 +18 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +18 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/form-layouts/FormInput.js +2 -1
- package/src/components/molecules/payment-form-card/PaymentFormCard.state.js +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -22550,7 +22550,7 @@ var fallbackValues$i = {
|
|
|
22550
22550
|
};
|
|
22551
22551
|
|
|
22552
22552
|
var _excluded$p = ["showErrors", "themeValues"],
|
|
22553
|
-
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocomplete", "extraStyles"];
|
|
22553
|
+
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocomplete", "extraStyles", "removeFromValue"];
|
|
22554
22554
|
var InputField = styled__default.input.withConfig({
|
|
22555
22555
|
displayName: "FormInput__InputField",
|
|
22556
22556
|
componentId: "sc-l094r1-0"
|
|
@@ -22634,6 +22634,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
22634
22634
|
customHeight = _ref15.customHeight,
|
|
22635
22635
|
autocomplete = _ref15.autocomplete,
|
|
22636
22636
|
extraStyles = _ref15.extraStyles,
|
|
22637
|
+
removeFromValue = _ref15.removeFromValue,
|
|
22637
22638
|
props = _objectWithoutProperties(_ref15, _excluded2);
|
|
22638
22639
|
|
|
22639
22640
|
var _useState = React.useState(false),
|
|
@@ -22698,7 +22699,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
22698
22699
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
22699
22700
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
22700
22701
|
onChange: function onChange(e) {
|
|
22701
|
-
return fieldActions.set(e);
|
|
22702
|
+
return console.log("e is", e) || fieldActions.set(e);
|
|
22702
22703
|
},
|
|
22703
22704
|
type: type,
|
|
22704
22705
|
value: field.rawValue,
|
|
@@ -35136,10 +35137,24 @@ const runValidator = (validator, value, form) => {
|
|
|
35136
35137
|
if (validatorFn === undefined) {
|
|
35137
35138
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
35138
35139
|
}
|
|
35140
|
+
console.log(
|
|
35141
|
+
"run validator (validator, value, form):",
|
|
35142
|
+
validator.type,
|
|
35143
|
+
validator.args,
|
|
35144
|
+
value,
|
|
35145
|
+
form
|
|
35146
|
+
);
|
|
35139
35147
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
35140
35148
|
};
|
|
35141
35149
|
|
|
35142
35150
|
const _computeErrors = (fieldName, form, validators) => {
|
|
35151
|
+
console.log("field name is", fieldName);
|
|
35152
|
+
console.log("form is", form);
|
|
35153
|
+
console.log("validators are", validators);
|
|
35154
|
+
const validatorsResult = validators.map(v =>
|
|
35155
|
+
runValidator(v, form[fieldName].rawValue, form)
|
|
35156
|
+
);
|
|
35157
|
+
console.log("validators result is", validatorsResult);
|
|
35143
35158
|
return validators
|
|
35144
35159
|
.map(v => runValidator(v, form[fieldName].rawValue, form))
|
|
35145
35160
|
.filter(x => x !== null);
|
|
@@ -42317,7 +42332,7 @@ var formConfig$8 = {
|
|
|
42317
42332
|
},
|
|
42318
42333
|
expirationDate: {
|
|
42319
42334
|
validators: [required(), hasLength(4, 4), isValidMonth(0), dateAfterToday("MMYY", "month", true)],
|
|
42320
|
-
constraints: [onlyExpirationDate(), hasLength(0,
|
|
42335
|
+
constraints: [onlyExpirationDate(), hasLength(0, 5)]
|
|
42321
42336
|
},
|
|
42322
42337
|
cvv: {
|
|
42323
42338
|
validators: [required(), hasLength(3, 4)],
|