@thecb/components 6.1.4-beta.4 → 6.1.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 +7 -38
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +7 -38
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/form-layouts/FormInput.js +1 -2
- package/src/components/molecules/payment-form-card/PaymentFormCard.state.js +2 -3
- package/src/components/molecules/periscope-dashboard-iframe/PeriscopeDashboardIframe.js +3 -2
- package/src/.DS_Store +0 -0
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"];
|
|
22546
22546
|
var InputField = styled.input.withConfig({
|
|
22547
22547
|
displayName: "FormInput__InputField",
|
|
22548
22548
|
componentId: "sc-l094r1-0"
|
|
@@ -22626,7 +22626,6 @@ var FormInput = function FormInput(_ref15) {
|
|
|
22626
22626
|
customHeight = _ref15.customHeight,
|
|
22627
22627
|
autocomplete = _ref15.autocomplete,
|
|
22628
22628
|
extraStyles = _ref15.extraStyles,
|
|
22629
|
-
removeFromValue = _ref15.removeFromValue,
|
|
22630
22629
|
props = _objectWithoutProperties(_ref15, _excluded2);
|
|
22631
22630
|
|
|
22632
22631
|
var _useState = useState(false),
|
|
@@ -22691,7 +22690,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
22691
22690
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
22692
22691
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
22693
22692
|
onChange: function onChange(e) {
|
|
22694
|
-
return
|
|
22693
|
+
return fieldActions.set(e);
|
|
22695
22694
|
},
|
|
22696
22695
|
type: type,
|
|
22697
22696
|
value: field.rawValue,
|
|
@@ -34723,24 +34722,6 @@ const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
|
34723
34722
|
const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
34724
34723
|
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
34725
34724
|
|
|
34726
|
-
/*
|
|
34727
|
-
07/22: experimental expiration date constraint
|
|
34728
|
-
should allow entry of expiration date using "/" character
|
|
34729
|
-
to accommodate browser autofill
|
|
34730
|
-
|
|
34731
|
-
not tested as validation function
|
|
34732
|
-
to validate exp date instead use combo of:
|
|
34733
|
-
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
34734
|
-
*/
|
|
34735
|
-
const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
34736
|
-
const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
34737
|
-
const onlyExpirationDate = createValidator(
|
|
34738
|
-
ONLY_EXPIRATION_DATE,
|
|
34739
|
-
ONLY_EXPIRATION_DATE_ERROR
|
|
34740
|
-
);
|
|
34741
|
-
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
|
|
34742
|
-
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
34743
|
-
|
|
34744
34725
|
const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
34745
34726
|
const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
34746
34727
|
const numberLessThan = createValidator(
|
|
@@ -35129,24 +35110,10 @@ const runValidator = (validator, value, form) => {
|
|
|
35129
35110
|
if (validatorFn === undefined) {
|
|
35130
35111
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
35131
35112
|
}
|
|
35132
|
-
console.log(
|
|
35133
|
-
"run validator (validator, value, form):",
|
|
35134
|
-
validator.type,
|
|
35135
|
-
validator.args,
|
|
35136
|
-
value,
|
|
35137
|
-
form
|
|
35138
|
-
);
|
|
35139
35113
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
35140
35114
|
};
|
|
35141
35115
|
|
|
35142
35116
|
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);
|
|
35150
35117
|
return validators
|
|
35151
35118
|
.map(v => runValidator(v, form[fieldName].rawValue, form))
|
|
35152
35119
|
.filter(x => x !== null);
|
|
@@ -42324,7 +42291,7 @@ var formConfig$8 = {
|
|
|
42324
42291
|
},
|
|
42325
42292
|
expirationDate: {
|
|
42326
42293
|
validators: [required(), hasLength(4, 4), isValidMonth(0), dateAfterToday("MMYY", "month", true)],
|
|
42327
|
-
constraints: [
|
|
42294
|
+
constraints: [onlyIntegers(), hasLength(0, 4)]
|
|
42328
42295
|
},
|
|
42329
42296
|
cvv: {
|
|
42330
42297
|
validators: [required(), hasLength(3, 4)],
|
|
@@ -43368,7 +43335,9 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
|
|
|
43368
43335
|
periscopeDataSuccess = _ref.periscopeDataSuccess,
|
|
43369
43336
|
periscopeDataFailure = _ref.periscopeDataFailure,
|
|
43370
43337
|
periscopeDataRequestSuccess = _ref.periscopeDataRequestSuccess,
|
|
43371
|
-
periscopeDataRequestFailure = _ref.periscopeDataRequestFailure
|
|
43338
|
+
periscopeDataRequestFailure = _ref.periscopeDataRequestFailure,
|
|
43339
|
+
_ref$timerMS = _ref.timerMS,
|
|
43340
|
+
timerMS = _ref$timerMS === void 0 ? 20000 : _ref$timerMS;
|
|
43372
43341
|
|
|
43373
43342
|
var _useState = useState(0),
|
|
43374
43343
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -43383,7 +43352,7 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
|
|
|
43383
43352
|
if (!periscopeDataSuccess) {
|
|
43384
43353
|
periscopeDataRequestFailure();
|
|
43385
43354
|
}
|
|
43386
|
-
},
|
|
43355
|
+
}, timerMS);
|
|
43387
43356
|
return function () {
|
|
43388
43357
|
return clearTimeout(time.timer);
|
|
43389
43358
|
};
|