@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.esm.js CHANGED
@@ -22542,7 +22542,7 @@ var fallbackValues$i = {
22542
22542
  };
22543
22543
 
22544
22544
  var _excluded$p = ["showErrors", "themeValues"],
22545
- _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocomplete", "extraStyles"];
22545
+ _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocomplete", "extraStyles", "removeFromValue"];
22546
22546
  var InputField = styled.input.withConfig({
22547
22547
  displayName: "FormInput__InputField",
22548
22548
  componentId: "sc-l094r1-0"
@@ -22626,6 +22626,7 @@ var FormInput = function FormInput(_ref15) {
22626
22626
  customHeight = _ref15.customHeight,
22627
22627
  autocomplete = _ref15.autocomplete,
22628
22628
  extraStyles = _ref15.extraStyles,
22629
+ removeFromValue = _ref15.removeFromValue,
22629
22630
  props = _objectWithoutProperties(_ref15, _excluded2);
22630
22631
 
22631
22632
  var _useState = useState(false),
@@ -22690,7 +22691,7 @@ var FormInput = function FormInput(_ref15) {
22690
22691
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
22691
22692
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
22692
22693
  onChange: function onChange(e) {
22693
- return fieldActions.set(e);
22694
+ return console.log("e is", e) || fieldActions.set(e);
22694
22695
  },
22695
22696
  type: type,
22696
22697
  value: field.rawValue,
@@ -35128,10 +35129,24 @@ const runValidator = (validator, value, form) => {
35128
35129
  if (validatorFn === undefined) {
35129
35130
  throw new Error(runValidatorErrorMessage(validator.type));
35130
35131
  }
35132
+ console.log(
35133
+ "run validator (validator, value, form):",
35134
+ validator.type,
35135
+ validator.args,
35136
+ value,
35137
+ form
35138
+ );
35131
35139
  return validatorFn(value, validator.args, form) ? null : validator.error;
35132
35140
  };
35133
35141
 
35134
35142
  const _computeErrors = (fieldName, form, validators) => {
35143
+ console.log("field name is", fieldName);
35144
+ console.log("form is", form);
35145
+ console.log("validators are", validators);
35146
+ const validatorsResult = validators.map(v =>
35147
+ runValidator(v, form[fieldName].rawValue, form)
35148
+ );
35149
+ console.log("validators result is", validatorsResult);
35135
35150
  return validators
35136
35151
  .map(v => runValidator(v, form[fieldName].rawValue, form))
35137
35152
  .filter(x => x !== null);
@@ -42309,7 +42324,7 @@ var formConfig$8 = {
42309
42324
  },
42310
42325
  expirationDate: {
42311
42326
  validators: [required(), hasLength(4, 4), isValidMonth(0), dateAfterToday("MMYY", "month", true)],
42312
- constraints: [onlyExpirationDate(), hasLength(0, 4)]
42327
+ constraints: [onlyExpirationDate(), hasLength(0, 5)]
42313
42328
  },
42314
42329
  cvv: {
42315
42330
  validators: [required(), hasLength(3, 4)],