@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.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"];
|
|
22554
22554
|
var InputField = styled__default.input.withConfig({
|
|
22555
22555
|
displayName: "FormInput__InputField",
|
|
22556
22556
|
componentId: "sc-l094r1-0"
|
|
@@ -22634,7 +22634,6 @@ var FormInput = function FormInput(_ref15) {
|
|
|
22634
22634
|
customHeight = _ref15.customHeight,
|
|
22635
22635
|
autocomplete = _ref15.autocomplete,
|
|
22636
22636
|
extraStyles = _ref15.extraStyles,
|
|
22637
|
-
removeFromValue = _ref15.removeFromValue,
|
|
22638
22637
|
props = _objectWithoutProperties(_ref15, _excluded2);
|
|
22639
22638
|
|
|
22640
22639
|
var _useState = React.useState(false),
|
|
@@ -22699,7 +22698,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
22699
22698
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
22700
22699
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
22701
22700
|
onChange: function onChange(e) {
|
|
22702
|
-
return
|
|
22701
|
+
return fieldActions.set(e);
|
|
22703
22702
|
},
|
|
22704
22703
|
type: type,
|
|
22705
22704
|
value: field.rawValue,
|
|
@@ -34731,24 +34730,6 @@ const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
|
34731
34730
|
const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
34732
34731
|
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
34733
34732
|
|
|
34734
|
-
/*
|
|
34735
|
-
07/22: experimental expiration date constraint
|
|
34736
|
-
should allow entry of expiration date using "/" character
|
|
34737
|
-
to accommodate browser autofill
|
|
34738
|
-
|
|
34739
|
-
not tested as validation function
|
|
34740
|
-
to validate exp date instead use combo of:
|
|
34741
|
-
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
34742
|
-
*/
|
|
34743
|
-
const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
34744
|
-
const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
34745
|
-
const onlyExpirationDate = createValidator(
|
|
34746
|
-
ONLY_EXPIRATION_DATE,
|
|
34747
|
-
ONLY_EXPIRATION_DATE_ERROR
|
|
34748
|
-
);
|
|
34749
|
-
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
|
|
34750
|
-
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
34751
|
-
|
|
34752
34733
|
const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
34753
34734
|
const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
34754
34735
|
const numberLessThan = createValidator(
|
|
@@ -35137,24 +35118,10 @@ const runValidator = (validator, value, form) => {
|
|
|
35137
35118
|
if (validatorFn === undefined) {
|
|
35138
35119
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
35139
35120
|
}
|
|
35140
|
-
console.log(
|
|
35141
|
-
"run validator (validator, value, form):",
|
|
35142
|
-
validator.type,
|
|
35143
|
-
validator.args,
|
|
35144
|
-
value,
|
|
35145
|
-
form
|
|
35146
|
-
);
|
|
35147
35121
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
35148
35122
|
};
|
|
35149
35123
|
|
|
35150
35124
|
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);
|
|
35158
35125
|
return validators
|
|
35159
35126
|
.map(v => runValidator(v, form[fieldName].rawValue, form))
|
|
35160
35127
|
.filter(x => x !== null);
|
|
@@ -42332,7 +42299,7 @@ var formConfig$8 = {
|
|
|
42332
42299
|
},
|
|
42333
42300
|
expirationDate: {
|
|
42334
42301
|
validators: [required(), hasLength(4, 4), isValidMonth(0), dateAfterToday("MMYY", "month", true)],
|
|
42335
|
-
constraints: [
|
|
42302
|
+
constraints: [onlyIntegers(), hasLength(0, 4)]
|
|
42336
42303
|
},
|
|
42337
42304
|
cvv: {
|
|
42338
42305
|
validators: [required(), hasLength(3, 4)],
|
|
@@ -43376,7 +43343,9 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
|
|
|
43376
43343
|
periscopeDataSuccess = _ref.periscopeDataSuccess,
|
|
43377
43344
|
periscopeDataFailure = _ref.periscopeDataFailure,
|
|
43378
43345
|
periscopeDataRequestSuccess = _ref.periscopeDataRequestSuccess,
|
|
43379
|
-
periscopeDataRequestFailure = _ref.periscopeDataRequestFailure
|
|
43346
|
+
periscopeDataRequestFailure = _ref.periscopeDataRequestFailure,
|
|
43347
|
+
_ref$timerMS = _ref.timerMS,
|
|
43348
|
+
timerMS = _ref$timerMS === void 0 ? 20000 : _ref$timerMS;
|
|
43380
43349
|
|
|
43381
43350
|
var _useState = React.useState(0),
|
|
43382
43351
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -43391,7 +43360,7 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
|
|
|
43391
43360
|
if (!periscopeDataSuccess) {
|
|
43392
43361
|
periscopeDataRequestFailure();
|
|
43393
43362
|
}
|
|
43394
|
-
},
|
|
43363
|
+
}, timerMS);
|
|
43395
43364
|
return function () {
|
|
43396
43365
|
return clearTimeout(time.timer);
|
|
43397
43366
|
};
|