@thecb/components 6.1.4-beta.2 → 6.1.4-beta.5
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 +22 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +22 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/form-layouts/FormInput.js +9 -2
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "6.1.4-beta.
|
|
3
|
+
"version": "6.1.4-beta.5",
|
|
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-beta.
|
|
89
|
+
"redux-freeform": "^5.6.0-beta.4"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -114,10 +114,17 @@ const FormInput = ({
|
|
|
114
114
|
customHeight,
|
|
115
115
|
autocomplete,
|
|
116
116
|
extraStyles,
|
|
117
|
+
removeFromValue, // regex of characters to remove before setting value
|
|
117
118
|
...props
|
|
118
119
|
}) => {
|
|
119
120
|
const [showPassword, setShowPassword] = useState(false);
|
|
120
121
|
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
|
+
};
|
|
121
128
|
|
|
122
129
|
return (
|
|
123
130
|
<Stack childGap="0.25rem">
|
|
@@ -199,7 +206,7 @@ const FormInput = ({
|
|
|
199
206
|
(field.dirty && field.hasErrors) ||
|
|
200
207
|
(field.hasErrors && showErrors)
|
|
201
208
|
}
|
|
202
|
-
onChange={
|
|
209
|
+
onChange={value => setValue(value)}
|
|
203
210
|
type={type}
|
|
204
211
|
value={field.rawValue}
|
|
205
212
|
pattern={isNum ? "[0-9]*" : ""}
|
|
@@ -225,7 +232,7 @@ const FormInput = ({
|
|
|
225
232
|
(field.dirty && field.hasErrors) ||
|
|
226
233
|
(field.hasErrors && showErrors)
|
|
227
234
|
}
|
|
228
|
-
onChange={e =>
|
|
235
|
+
onChange={e => setValue(e.target.value)}
|
|
229
236
|
type={type === "password" && showPassword ? "text" : type}
|
|
230
237
|
value={field.rawValue}
|
|
231
238
|
pattern={isNum ? "[0-9]*" : ""}
|