native-pytech 1.0.205 → 1.0.207
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/libs/components/Gradient/components/Gradient/index.d.ts +1 -1
- package/dist/libs/components/Gradient/components/Gradient/index.js +13 -2
- package/dist/libs/table/src/components/OptionComponents/textInput.d.ts +1 -1
- package/dist/libs/table/src/components/OptionComponents/textInput.js +8 -2
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type Props from './types';
|
|
2
|
-
declare const _default: import("react").MemoExoticComponent<({ text, color, type, icon, ionIconName, }: Props) => import("react").JSX.Element>;
|
|
2
|
+
declare const _default: import("react").MemoExoticComponent<({ text, color, type, icon, ionIconName, sizeDiameter }: Props) => import("react").JSX.Element>;
|
|
3
3
|
export default _default;
|
|
@@ -3,8 +3,19 @@ import { StyleSheet, Text } from 'react-native';
|
|
|
3
3
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
4
4
|
import { Ionicons } from '@expo/vector-icons';
|
|
5
5
|
import colors, { sizes } from '../../constants';
|
|
6
|
-
export default memo(({ text, color = 'default', type = 'small', icon, ionIconName, }) => {
|
|
7
|
-
const typeSizes = useMemo(() =>
|
|
6
|
+
export default memo(({ text, color = 'default', type = 'small', icon, ionIconName, sizeDiameter }) => {
|
|
7
|
+
const typeSizes = useMemo(() => {
|
|
8
|
+
if (!sizeDiameter)
|
|
9
|
+
return sizes[type];
|
|
10
|
+
return {
|
|
11
|
+
diameter: sizeDiameter,
|
|
12
|
+
fontSize: {
|
|
13
|
+
1: sizeDiameter * 0.53,
|
|
14
|
+
2: sizeDiameter * 0.48,
|
|
15
|
+
3: sizeDiameter * 0.43
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}, [type]);
|
|
8
19
|
const iconSize = typeSizes.diameter * 0.5;
|
|
9
20
|
const textComponent = useMemo(() => {
|
|
10
21
|
const cantLetras = text?.length;
|
|
@@ -3,7 +3,7 @@ export declare const selectAll: (input: TextInput | any, value: string | null) =
|
|
|
3
3
|
/**
|
|
4
4
|
Pone el color del texto según el tema y agrega unos estilos para que ocupen todo el ancho.
|
|
5
5
|
*/
|
|
6
|
-
declare const _default: import("react").MemoExoticComponent<({ value, numberOfLines, onFocus, onBlur, onChangeText, mask, ...props }: {
|
|
6
|
+
declare const _default: import("react").MemoExoticComponent<({ value, numberOfLines, onFocus, onBlur, onChangeText, mask, autoFocus, ...props }: {
|
|
7
7
|
/**
|
|
8
8
|
Valor inicial del input.
|
|
9
9
|
*/
|
|
@@ -13,7 +13,7 @@ export const selectAll = (input, value) => {
|
|
|
13
13
|
/**
|
|
14
14
|
Pone el color del texto según el tema y agrega unos estilos para que ocupen todo el ancho.
|
|
15
15
|
*/
|
|
16
|
-
export default memo(({ value, numberOfLines = 1, onFocus, onBlur, onChangeText, mask, ...props }) => {
|
|
16
|
+
export default memo(({ value, numberOfLines = 1, onFocus, onBlur, onChangeText, mask, autoFocus, ...props }) => {
|
|
17
17
|
const { colorScheme } = useApp();
|
|
18
18
|
const Theme = colors.theme[colorScheme];
|
|
19
19
|
const inputRef = useRef(null);
|
|
@@ -28,6 +28,12 @@ export default memo(({ value, numberOfLines = 1, onFocus, onBlur, onChangeText,
|
|
|
28
28
|
if (isFocused)
|
|
29
29
|
selectAll(inputRef.current, rawValue);
|
|
30
30
|
}, [isFocused]);
|
|
31
|
+
// Autofocus en Web tiene que hacer esto, sino no funciona
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!autoFocus || Platform.OS !== 'web')
|
|
34
|
+
return;
|
|
35
|
+
setTimeout(() => inputRef.current?.focus(), 100);
|
|
36
|
+
}, [autoFocus]);
|
|
31
37
|
return (<TextInput style={[styles.textInput, { color: Theme.text }]} ref={inputRef} numberOfLines={numberOfLines} multiline={Platform.OS === 'android'} value={displayValue == null ? '' : displayValue} selectTextOnFocus={true} onFocus={(e) => {
|
|
32
38
|
setIsFocused(true);
|
|
33
39
|
onFocus?.(e);
|
|
@@ -37,7 +43,7 @@ export default memo(({ value, numberOfLines = 1, onFocus, onBlur, onChangeText,
|
|
|
37
43
|
}} onChangeText={(text) => {
|
|
38
44
|
setRawValue(text === '' ? null : text);
|
|
39
45
|
onChangeText?.(text);
|
|
40
|
-
}} clearButtonMode='while-editing' {...props}/>);
|
|
46
|
+
}} clearButtonMode='while-editing' autoFocus={autoFocus} {...props}/>);
|
|
41
47
|
});
|
|
42
48
|
const styles = StyleSheet.create({
|
|
43
49
|
textInput: {
|