@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 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", "removeFromValue"];
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),
@@ -22645,14 +22644,6 @@ var FormInput = function FormInput(_ref15) {
22645
22644
  var _useContext = React.useContext(styled.ThemeContext),
22646
22645
  isMobile = _useContext.isMobile;
22647
22646
 
22648
- var setValue = function setValue(value) {
22649
- if (removeFromValue !== undefined) {
22650
- return fieldActions.set(value.replace(removeFromValue, ""));
22651
- }
22652
-
22653
- return fieldActions.set(value);
22654
- };
22655
-
22656
22647
  return /*#__PURE__*/React__default.createElement(Stack, {
22657
22648
  childGap: "0.25rem"
22658
22649
  }, /*#__PURE__*/React__default.createElement(Box, {
@@ -22706,8 +22697,8 @@ var FormInput = function FormInput(_ref15) {
22706
22697
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
22707
22698
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
22708
22699
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
22709
- onChange: function onChange(value) {
22710
- return setValue(value);
22700
+ onChange: function onChange(e) {
22701
+ return fieldActions.set(e);
22711
22702
  },
22712
22703
  type: type,
22713
22704
  value: field.rawValue,
@@ -22726,7 +22717,7 @@ var FormInput = function FormInput(_ref15) {
22726
22717
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
22727
22718
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
22728
22719
  onChange: function onChange(e) {
22729
- return setValue(e.target.value);
22720
+ return fieldActions.set(e.target.value);
22730
22721
  },
22731
22722
  type: type === "password" && showPassword ? "text" : type,
22732
22723
  value: field.rawValue,
@@ -34739,24 +34730,6 @@ const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
34739
34730
  const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
34740
34731
  validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
34741
34732
 
34742
- /*
34743
- 07/22: experimental expiration date constraint
34744
- should allow entry of expiration date using "/" character
34745
- to accommodate browser autofill
34746
-
34747
- not tested as validation function
34748
- to validate exp date instead use combo of:
34749
- required(), hasLength(), isValidMonth(), dateAfterToday()
34750
- */
34751
- const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
34752
- const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
34753
- const onlyExpirationDate = createValidator(
34754
- ONLY_EXPIRATION_DATE,
34755
- ONLY_EXPIRATION_DATE_ERROR
34756
- );
34757
- validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
34758
- /^(\d?\d?\/?\d?\d?)?$/.test(value);
34759
-
34760
34733
  const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
34761
34734
  const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
34762
34735
  const numberLessThan = createValidator(
@@ -42274,8 +42247,6 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
42274
42247
  return e.key === "Enter" && handleSubmit(e);
42275
42248
  },
42276
42249
  isNum: true,
42277
- removeFromValue: /\// // removes "/" from browser autofill
42278
- ,
42279
42250
  autocomplete: "cc-exp"
42280
42251
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
42281
42252
  labelTextWhenNoError: "CVV",
@@ -42328,7 +42299,7 @@ var formConfig$8 = {
42328
42299
  },
42329
42300
  expirationDate: {
42330
42301
  validators: [required(), hasLength(4, 4), isValidMonth(0), dateAfterToday("MMYY", "month", true)],
42331
- constraints: [onlyExpirationDate(), hasLength(0, 4)]
42302
+ constraints: [onlyIntegers(), hasLength(0, 4)]
42332
42303
  },
42333
42304
  cvv: {
42334
42305
  validators: [required(), hasLength(3, 4)],
@@ -43372,7 +43343,9 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
43372
43343
  periscopeDataSuccess = _ref.periscopeDataSuccess,
43373
43344
  periscopeDataFailure = _ref.periscopeDataFailure,
43374
43345
  periscopeDataRequestSuccess = _ref.periscopeDataRequestSuccess,
43375
- periscopeDataRequestFailure = _ref.periscopeDataRequestFailure;
43346
+ periscopeDataRequestFailure = _ref.periscopeDataRequestFailure,
43347
+ _ref$timerMS = _ref.timerMS,
43348
+ timerMS = _ref$timerMS === void 0 ? 20000 : _ref$timerMS;
43376
43349
 
43377
43350
  var _useState = React.useState(0),
43378
43351
  _useState2 = _slicedToArray(_useState, 2),
@@ -43387,7 +43360,7 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
43387
43360
  if (!periscopeDataSuccess) {
43388
43361
  periscopeDataRequestFailure();
43389
43362
  }
43390
- }, 10000);
43363
+ }, timerMS);
43391
43364
  return function () {
43392
43365
  return clearTimeout(time.timer);
43393
43366
  };