@momo-kits/foundation 0.169.16-beta.2 → 0.169.16-beta.21
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/Input/ErrorView.tsx +1 -1
- package/Input/InputMoneyView.tsx +6 -14
- package/package.json +1 -1
package/Input/ErrorView.tsx
CHANGED
package/Input/InputMoneyView.tsx
CHANGED
|
@@ -53,8 +53,8 @@ type InputMoneyViewProps = Pick<
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* Presentational body of InputMoney: bordered field, currency suffix (
|
|
57
|
-
*
|
|
56
|
+
* Presentational body of InputMoney: bordered field, currency suffix (shown
|
|
57
|
+
* once there is a value) and the clear/trailing icons.
|
|
58
58
|
*/
|
|
59
59
|
export const InputMoneyView = ({
|
|
60
60
|
size,
|
|
@@ -101,13 +101,8 @@ export const InputMoneyView = ({
|
|
|
101
101
|
fontSize: scaledFontSize,
|
|
102
102
|
fontFamily: inputFontFamily,
|
|
103
103
|
};
|
|
104
|
-
const
|
|
105
|
-
const shouldShowCurrency = !!displayValue || hasCurrencyInPlaceholder;
|
|
104
|
+
const hasValue = displayValue.length > 0;
|
|
106
105
|
const shouldShowClearIcon = !!(showClearIcon && focused && displayValue);
|
|
107
|
-
let inputPlaceholder = placeholder;
|
|
108
|
-
if (hasCurrencyInPlaceholder) {
|
|
109
|
-
inputPlaceholder = placeholder.slice(0, -currency.length);
|
|
110
|
-
}
|
|
111
106
|
return (
|
|
112
107
|
<View
|
|
113
108
|
style={[
|
|
@@ -148,18 +143,15 @@ export const InputMoneyView = ({
|
|
|
148
143
|
onChangeText={onChangeText}
|
|
149
144
|
onFocus={onFocus}
|
|
150
145
|
onBlur={onBlur}
|
|
151
|
-
placeholder={
|
|
146
|
+
placeholder={placeholder}
|
|
152
147
|
selectionColor={theme.colors.primary}
|
|
153
148
|
placeholderTextColor={placeholderColor}
|
|
154
149
|
keyboardType={'numeric'}
|
|
155
150
|
maxLength={undefined}
|
|
156
151
|
/>
|
|
157
|
-
{
|
|
152
|
+
{hasValue && (
|
|
158
153
|
<Text
|
|
159
|
-
style={[
|
|
160
|
-
textStyle,
|
|
161
|
-
{ color: displayValue ? textColor : placeholderColor },
|
|
162
|
-
]}
|
|
154
|
+
style={[textStyle, { color: textColor }]}
|
|
163
155
|
allowFontScaling={false}
|
|
164
156
|
>
|
|
165
157
|
{currency}
|