@teamnhz/rn-ui-toolkit 1.5.2 → 1.5.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.
|
@@ -41,10 +41,6 @@ interface InputProps extends TextInputProps {
|
|
|
41
41
|
flagIcon?: string;
|
|
42
42
|
flagIconStyle?: object;
|
|
43
43
|
flagContainerStyle?: object;
|
|
44
|
-
iconTintColor?: string;
|
|
45
|
-
leftIconTintColor?: string;
|
|
46
|
-
rightIconTintColor?: string;
|
|
47
|
-
downArrowTintColor?: string;
|
|
48
44
|
}
|
|
49
45
|
declare const Input: React.FC<InputProps>;
|
|
50
46
|
export default Input;
|
|
@@ -4,7 +4,12 @@ import { useTranslation } from "react-i18next";
|
|
|
4
4
|
import { Colors, Typography, Scale, Images } from "../../styles";
|
|
5
5
|
import { defaultRegex } from "../../utils/regex";
|
|
6
6
|
import { messages } from "../../constants/messages";
|
|
7
|
-
const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, leftIcon, rightIcon, onLeftIconPress, onRightIconPress, style, containerStyle, inputStyle, errorTextStyle, leftIconStyle, rightIconStyle, leftIconWrapperStyle, rightIconWrapperStyle, type = "text", editable = true, error, value = "", customRegex, customErrorMessage, onChangeText, onValidation, onBlur: restOnBlur, onFocus: restOnFocus, multiline = false, maxLength, returnKeyType, countryCode, onPressCountryCode, countryCodeTextStyle, countryCodeWrapperStyle, isError = true, downArrowIcon, downArrowStyle, flagIcon, flagIconStyle, flagContainerStyle,
|
|
7
|
+
const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, leftIcon, rightIcon, onLeftIconPress, onRightIconPress, style, containerStyle, inputStyle, errorTextStyle, leftIconStyle, rightIconStyle, leftIconWrapperStyle, rightIconWrapperStyle, type = "text", editable = true, error, value = "", customRegex, customErrorMessage, onChangeText, onValidation, onBlur: restOnBlur, onFocus: restOnFocus, multiline = false, maxLength, returnKeyType, countryCode, onPressCountryCode, countryCodeTextStyle, countryCodeWrapperStyle, isError = true, downArrowIcon, downArrowStyle, flagIcon, flagIconStyle, flagContainerStyle,
|
|
8
|
+
// iconTintColor,
|
|
9
|
+
// leftIconTintColor,
|
|
10
|
+
// rightIconTintColor,
|
|
11
|
+
// downArrowTintColor,
|
|
12
|
+
...rest }) => {
|
|
8
13
|
const { t } = useTranslation();
|
|
9
14
|
const [secureText, setSecureText] = useState(type === "password");
|
|
10
15
|
const [internalError, setInternalError] = useState(null);
|
|
@@ -83,7 +88,7 @@ const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, left
|
|
|
83
88
|
multiline && styles.multilineContainer,
|
|
84
89
|
] },
|
|
85
90
|
leftIcon && (React.createElement(TouchableOpacity, { onPress: onLeftIconPress, disabled: !onLeftIconPress, style: [styles.iconWrapper, leftIconWrapperStyle] },
|
|
86
|
-
React.createElement(Image, { source: leftIcon, style: [styles.icon,
|
|
91
|
+
React.createElement(Image, { source: leftIcon, style: [styles.icon, leftIconStyle], resizeMode: "contain" }))),
|
|
87
92
|
flagIcon && countryCode && (React.createElement(TouchableOpacity, { onPress: onLeftIconPress, disabled: !onLeftIconPress, style: [
|
|
88
93
|
styles.iconWrapper,
|
|
89
94
|
{
|
|
@@ -103,7 +108,7 @@ const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, left
|
|
|
103
108
|
countryCode && (React.createElement(TouchableOpacity, { onPress: onPressCountryCode, disabled: !onPressCountryCode, style: [styles.countryCodeWrapper, countryCodeWrapperStyle] },
|
|
104
109
|
React.createElement(View, { style: styles.rowCenter },
|
|
105
110
|
React.createElement(Image, { source: downArrowIcon || Images.down_arrow // <-- Your default arrow
|
|
106
|
-
, style: [styles.downArrow, downArrowStyle]
|
|
111
|
+
, style: [styles.downArrow, downArrowStyle] }),
|
|
107
112
|
React.createElement(Text, { style: [styles.countryCodeText, countryCodeTextStyle] }, countryCode)))),
|
|
108
113
|
React.createElement(TextInput, { style: [
|
|
109
114
|
styles.input,
|
|
@@ -114,8 +119,10 @@ const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, left
|
|
|
114
119
|
? inputPlaceholderTextColor
|
|
115
120
|
: Colors.textGrey, editable: editable, secureTextEntry: secureText, keyboardType: keyboardType, value: value, onChangeText: handleChangeText, onFocus: handleFocus, onBlur: handleBlur, multiline: multiline, maxLength: maxLength, returnKeyType: returnKeyType, ...rest }),
|
|
116
121
|
type === "password" && !rightIcon ? (React.createElement(TouchableOpacity, { onPress: () => setSecureText(!secureText), style: [styles.iconWrapper, rightIconWrapperStyle] },
|
|
117
|
-
React.createElement(Image, { source: secureText ? Images.Eyeoff : Images.Eyeon, style: [styles.icon,
|
|
118
|
-
|
|
122
|
+
React.createElement(Image, { source: secureText ? Images.Eyeoff : Images.Eyeon, style: [styles.icon, rightIconStyle],
|
|
123
|
+
// tintColor= { rightIconTintColor || iconTintColor }
|
|
124
|
+
resizeMode: "contain" }))) : (rightIcon && (React.createElement(TouchableOpacity, { onPress: onRightIconPress, disabled: !onRightIconPress, style: [styles.iconWrapper, rightIconWrapperStyle] },
|
|
125
|
+
React.createElement(Image, { source: rightIcon, style: [styles.icon, rightIconStyle], resizeMode: "contain" }))))),
|
|
119
126
|
showError && isError && (React.createElement(Text, { style: [styles.errorText, errorTextStyle] }, showError))));
|
|
120
127
|
};
|
|
121
128
|
export default Input;
|