@thecb/components 6.1.4-beta.6 → 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 +9 -36
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +9 -36
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/form-layouts/FormInput.js +2 -9
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +0 -1
- 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),
|
|
@@ -22637,14 +22636,6 @@ var FormInput = function FormInput(_ref15) {
|
|
|
22637
22636
|
var _useContext = useContext(ThemeContext),
|
|
22638
22637
|
isMobile = _useContext.isMobile;
|
|
22639
22638
|
|
|
22640
|
-
var setValue = function setValue(value) {
|
|
22641
|
-
if (removeFromValue !== undefined) {
|
|
22642
|
-
return fieldActions.set(value.replace(removeFromValue, ""));
|
|
22643
|
-
}
|
|
22644
|
-
|
|
22645
|
-
return fieldActions.set(value);
|
|
22646
|
-
};
|
|
22647
|
-
|
|
22648
22639
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
22649
22640
|
childGap: "0.25rem"
|
|
22650
22641
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
@@ -22698,8 +22689,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
22698
22689
|
"aria-labelledby": createIdFromString(labelTextWhenNoError),
|
|
22699
22690
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
22700
22691
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
22701
|
-
onChange: function onChange(
|
|
22702
|
-
return
|
|
22692
|
+
onChange: function onChange(e) {
|
|
22693
|
+
return fieldActions.set(e);
|
|
22703
22694
|
},
|
|
22704
22695
|
type: type,
|
|
22705
22696
|
value: field.rawValue,
|
|
@@ -22718,7 +22709,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
22718
22709
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
22719
22710
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
22720
22711
|
onChange: function onChange(e) {
|
|
22721
|
-
return
|
|
22712
|
+
return fieldActions.set(e.target.value);
|
|
22722
22713
|
},
|
|
22723
22714
|
type: type === "password" && showPassword ? "text" : type,
|
|
22724
22715
|
value: field.rawValue,
|
|
@@ -34731,24 +34722,6 @@ const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
|
34731
34722
|
const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
34732
34723
|
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
34733
34724
|
|
|
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
34725
|
const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
34753
34726
|
const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
34754
34727
|
const numberLessThan = createValidator(
|
|
@@ -42266,8 +42239,6 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
42266
42239
|
return e.key === "Enter" && handleSubmit(e);
|
|
42267
42240
|
},
|
|
42268
42241
|
isNum: true,
|
|
42269
|
-
removeFromValue: /\// // removes "/" from browser autofill
|
|
42270
|
-
,
|
|
42271
42242
|
autocomplete: "cc-exp"
|
|
42272
42243
|
}), /*#__PURE__*/React.createElement(FormInput$1, {
|
|
42273
42244
|
labelTextWhenNoError: "CVV",
|
|
@@ -42320,7 +42291,7 @@ var formConfig$8 = {
|
|
|
42320
42291
|
},
|
|
42321
42292
|
expirationDate: {
|
|
42322
42293
|
validators: [required(), hasLength(4, 4), isValidMonth(0), dateAfterToday("MMYY", "month", true)],
|
|
42323
|
-
constraints: [
|
|
42294
|
+
constraints: [onlyIntegers(), hasLength(0, 4)]
|
|
42324
42295
|
},
|
|
42325
42296
|
cvv: {
|
|
42326
42297
|
validators: [required(), hasLength(3, 4)],
|
|
@@ -43364,7 +43335,9 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
|
|
|
43364
43335
|
periscopeDataSuccess = _ref.periscopeDataSuccess,
|
|
43365
43336
|
periscopeDataFailure = _ref.periscopeDataFailure,
|
|
43366
43337
|
periscopeDataRequestSuccess = _ref.periscopeDataRequestSuccess,
|
|
43367
|
-
periscopeDataRequestFailure = _ref.periscopeDataRequestFailure
|
|
43338
|
+
periscopeDataRequestFailure = _ref.periscopeDataRequestFailure,
|
|
43339
|
+
_ref$timerMS = _ref.timerMS,
|
|
43340
|
+
timerMS = _ref$timerMS === void 0 ? 20000 : _ref$timerMS;
|
|
43368
43341
|
|
|
43369
43342
|
var _useState = useState(0),
|
|
43370
43343
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -43379,7 +43352,7 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
|
|
|
43379
43352
|
if (!periscopeDataSuccess) {
|
|
43380
43353
|
periscopeDataRequestFailure();
|
|
43381
43354
|
}
|
|
43382
|
-
},
|
|
43355
|
+
}, timerMS);
|
|
43383
43356
|
return function () {
|
|
43384
43357
|
return clearTimeout(time.timer);
|
|
43385
43358
|
};
|