@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "6.1.4-beta.6",
3
+ "version": "6.1.4",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -86,6 +86,6 @@
86
86
  "ramda": "^0.27.0",
87
87
  "react-aria-modal": "^4.0.0",
88
88
  "react-pose": "^4.0.10",
89
- "redux-freeform": "^5.6.0"
89
+ "redux-freeform": "^5.5.0"
90
90
  }
91
91
  }
@@ -114,17 +114,10 @@ const FormInput = ({
114
114
  customHeight,
115
115
  autocomplete,
116
116
  extraStyles,
117
- removeFromValue, // regex of characters to remove before setting value
118
117
  ...props
119
118
  }) => {
120
119
  const [showPassword, setShowPassword] = useState(false);
121
120
  const { isMobile } = useContext(ThemeContext);
122
- const setValue = value => {
123
- if (removeFromValue !== undefined) {
124
- return fieldActions.set(value.replace(removeFromValue, ""));
125
- }
126
- return fieldActions.set(value);
127
- };
128
121
 
129
122
  return (
130
123
  <Stack childGap="0.25rem">
@@ -206,7 +199,7 @@ const FormInput = ({
206
199
  (field.dirty && field.hasErrors) ||
207
200
  (field.hasErrors && showErrors)
208
201
  }
209
- onChange={value => setValue(value)}
202
+ onChange={e => fieldActions.set(e)}
210
203
  type={type}
211
204
  value={field.rawValue}
212
205
  pattern={isNum ? "[0-9]*" : ""}
@@ -232,7 +225,7 @@ const FormInput = ({
232
225
  (field.dirty && field.hasErrors) ||
233
226
  (field.hasErrors && showErrors)
234
227
  }
235
- onChange={e => setValue(e.target.value)}
228
+ onChange={e => fieldActions.set(e.target.value)}
236
229
  type={type === "password" && showPassword ? "text" : type}
237
230
  value={field.rawValue}
238
231
  pattern={isNum ? "[0-9]*" : ""}
@@ -140,7 +140,6 @@ const PaymentFormCard = ({
140
140
  formatter={expirationDateFormat}
141
141
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
142
142
  isNum
143
- removeFromValue={/\//} // removes "/" from browser autofill
144
143
  autocomplete="cc-exp"
145
144
  />
146
145
  <FormInput
@@ -6,8 +6,7 @@ import {
6
6
  matchesRegex,
7
7
  validateWhen,
8
8
  dateAfterToday,
9
- isValidMonth,
10
- onlyExpirationDate
9
+ isValidMonth
11
10
  } from "redux-freeform";
12
11
 
13
12
  //TODO: Will make zip code able to have more than 5 digits once we add in the FormattedInput because it will have issues with format of 60606-1111.
@@ -31,7 +30,7 @@ const formConfig = {
31
30
  isValidMonth(0),
32
31
  dateAfterToday("MMYY", "month", true)
33
32
  ],
34
- constraints: [onlyExpirationDate(), hasLength(0, 4)]
33
+ constraints: [onlyIntegers(), hasLength(0, 4)]
35
34
  },
36
35
  cvv: {
37
36
  validators: [required(), hasLength(3, 4)],
@@ -41,7 +41,8 @@ const PeriscopeDashboardIframe = ({
41
41
  periscopeDataSuccess,
42
42
  periscopeDataFailure,
43
43
  periscopeDataRequestSuccess,
44
- periscopeDataRequestFailure
44
+ periscopeDataRequestFailure,
45
+ timerMS = 20000
45
46
  }) => {
46
47
  const [height, setHeight] = useState(0);
47
48
  let time = { timer: null };
@@ -51,7 +52,7 @@ const PeriscopeDashboardIframe = ({
51
52
  if (!periscopeDataSuccess) {
52
53
  periscopeDataRequestFailure();
53
54
  }
54
- }, 10000);
55
+ }, timerMS);
55
56
  return () => clearTimeout(time.timer);
56
57
  }, [periscopeDataSuccess]);
57
58
 
package/src/.DS_Store DELETED
Binary file