sapo-components-ui-rn 1.1.76 → 1.1.78
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/components/TextInput/TextInput.d.ts +0 -4
- package/dist/index.esm.js +12 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TextInput/TextInput.tsx +1 -11
- package/src/components/TextInput/TextInputDefault.tsx +4 -3
- package/src/components/TextInput/TextInputFlat.tsx +3 -3
- package/src/components/TextInput/TextInputNumber.tsx +1 -1
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ import type { ThemeProp } from "../../types";
|
|
|
22
22
|
import { forwardRef } from "../../utils/forwardRef";
|
|
23
23
|
import { roundLayoutSize } from "../../utils/roundLayoutSize";
|
|
24
24
|
import TextInputNumber from "./TextInputNumber";
|
|
25
|
+
import View from "../View";
|
|
25
26
|
|
|
26
27
|
const BLUR_ANIMATION_DURATION = 180;
|
|
27
28
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
@@ -38,10 +39,6 @@ export type Props = React.ComponentPropsWithRef<typeof NativeTextInput> & {
|
|
|
38
39
|
type?: "integer" | "float";
|
|
39
40
|
formatDecimal?: 1 | 2 | 3;
|
|
40
41
|
required?: boolean;
|
|
41
|
-
labelScaleValue?: number;
|
|
42
|
-
labelStyle?: StyleProp<TextStyle>;
|
|
43
|
-
textErrorStyle?: StyleProp<TextStyle>;
|
|
44
|
-
height?: number;
|
|
45
42
|
/**
|
|
46
43
|
* If true, user won't be able to interact with the component.
|
|
47
44
|
*/
|
|
@@ -241,9 +238,6 @@ const TextInput = forwardRef<TextInputHandles, Props>(
|
|
|
241
238
|
minValue,
|
|
242
239
|
type,
|
|
243
240
|
required = false,
|
|
244
|
-
labelStyle,
|
|
245
|
-
textErrorStyle,
|
|
246
|
-
height,
|
|
247
241
|
...rest
|
|
248
242
|
}: Props,
|
|
249
243
|
ref
|
|
@@ -561,10 +555,6 @@ const TextInput = forwardRef<TextInputHandles, Props>(
|
|
|
561
555
|
minValue={minValue}
|
|
562
556
|
formatDecimal={rest.formatDecimal}
|
|
563
557
|
type={type}
|
|
564
|
-
labelStyle={labelStyle}
|
|
565
|
-
textErrorStyle={textErrorStyle}
|
|
566
|
-
contentStyle={contentStyle}
|
|
567
|
-
height={height}
|
|
568
558
|
/>
|
|
569
559
|
);
|
|
570
560
|
}
|
|
@@ -89,9 +89,9 @@ const TextInputDefault = ({
|
|
|
89
89
|
setInputValue("");
|
|
90
90
|
onChangeText?.("");
|
|
91
91
|
} else {
|
|
92
|
-
setInputValue(value || "");
|
|
92
|
+
if (inputValue !== value) setInputValue(value || "");
|
|
93
93
|
}
|
|
94
|
-
}, [value]);
|
|
94
|
+
}, [value, inputValue]);
|
|
95
95
|
|
|
96
96
|
const handleChangeText = (text: string) => {
|
|
97
97
|
setInputValue(text);
|
|
@@ -282,7 +282,7 @@ const TextInputDefault = ({
|
|
|
282
282
|
};
|
|
283
283
|
|
|
284
284
|
return (
|
|
285
|
-
<View style={
|
|
285
|
+
<View style={viewStyle}>
|
|
286
286
|
<View
|
|
287
287
|
row
|
|
288
288
|
alignCenter={!multiline}
|
|
@@ -472,6 +472,7 @@ const styles = StyleSheet.create({
|
|
|
472
472
|
clearButton: {
|
|
473
473
|
justifyContent: "center",
|
|
474
474
|
paddingHorizontal: CONSTANTS.SPACE_8,
|
|
475
|
+
// alignItems: "center",
|
|
475
476
|
},
|
|
476
477
|
vError: {
|
|
477
478
|
paddingTop: CONSTANTS.SPACE_4,
|
|
@@ -93,9 +93,9 @@ const TextInputFlat = ({
|
|
|
93
93
|
setInputValue("");
|
|
94
94
|
onChangeText?.("");
|
|
95
95
|
} else {
|
|
96
|
-
setInputValue(value || "");
|
|
96
|
+
if (inputValue !== value) setInputValue(value || "");
|
|
97
97
|
}
|
|
98
|
-
}, [value]);
|
|
98
|
+
}, [value, inputValue]);
|
|
99
99
|
|
|
100
100
|
const handleChangeText = (text: string) => {
|
|
101
101
|
setInputValue(text);
|
|
@@ -380,7 +380,7 @@ const TextInputFlat = ({
|
|
|
380
380
|
};
|
|
381
381
|
|
|
382
382
|
return (
|
|
383
|
-
<View
|
|
383
|
+
<View>
|
|
384
384
|
<View
|
|
385
385
|
style={{
|
|
386
386
|
flexDirection: "row",
|