native-pytech 1.0.216 → 1.0.218

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.
@@ -3,6 +3,7 @@ declare const Formats: {
3
3
  numberToText: (value: number) => string;
4
4
  TextToNumber: (value: string) => number;
5
5
  textToDate: (value?: string) => Date | undefined;
6
+ textHourToDate: (value?: string) => Date | undefined;
6
7
  numberToTextCurrency: typeof numberToTextCurrency;
7
8
  capitalizeText: (string: string) => string;
8
9
  phoneToText: (phone: number | string) => string;
@@ -24,6 +24,28 @@ const textToDate = (value) => {
24
24
  : new Date(value);
25
25
  return Number.isNaN(date.getTime()) ? undefined : date;
26
26
  };
27
+ const textHourToDate = (value) => {
28
+ if (!value)
29
+ return undefined;
30
+ const match = value.trim().match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);
31
+ if (!match)
32
+ return undefined;
33
+ const hours = Number(match[1]);
34
+ const minutes = Number(match[2]);
35
+ const seconds = Number(match[3] ?? 0);
36
+ if (hours > 23 || minutes > 59 || seconds > 59)
37
+ return undefined;
38
+ const today = new Intl.DateTimeFormat('en-CA', {
39
+ timeZone: 'America/Argentina/Buenos_Aires',
40
+ }).format(new Date());
41
+ const time = [
42
+ String(hours).padStart(2, '0'),
43
+ String(minutes).padStart(2, '0'),
44
+ String(seconds).padStart(2, '0'),
45
+ ].join(':');
46
+ const date = new Date(`${today}T${time}-03:00`);
47
+ return Number.isNaN(date.getTime()) ? undefined : date;
48
+ };
27
49
  function numberToTextCurrency(value) {
28
50
  return new Intl.NumberFormat('es-AR', {
29
51
  style: 'currency',
@@ -81,6 +103,7 @@ const Formats = {
81
103
  numberToText,
82
104
  TextToNumber,
83
105
  textToDate,
106
+ textHourToDate,
84
107
  numberToTextCurrency,
85
108
  capitalizeText,
86
109
  phoneToText,
@@ -1,6 +1,6 @@
1
1
  import { LinearGradient } from 'expo-linear-gradient';
2
2
  import React, { memo, useCallback, useMemo } from 'react';
3
- import { Pressable, StyleSheet, View } from 'react-native';
3
+ import { Pressable, StyleSheet, View, Platform } from 'react-native';
4
4
  import { Ionicons } from '@expo/vector-icons';
5
5
  import colors from '../../constants';
6
6
  import Table from '../Table';
@@ -36,7 +36,10 @@ export default memo(({ children, childrenLeft, childrenRight, onPress, style, ba
36
36
  </>;
37
37
  const styleView = useMemo(() => [styles.Item_View, style], [style]);
38
38
  const childrenOption = onPress === undefined ? <View style={styleView}>{content}</View>
39
- : (backgroundColorPressed ? (<Pressable onPress={onPress} style={({ pressed }) => !pressed ? styleView : [styleView, { backgroundColor: backgroundColorPressed }]}>
39
+ : (backgroundColorPressed ? (<Pressable onPress={onPress} style={({ pressed, hovered }) => [
40
+ styleView,
41
+ (pressed || (Platform.OS === 'web' && hovered)) && { backgroundColor: backgroundColorPressed }
42
+ ]}>
40
43
  {content}
41
44
  </Pressable>) : (<PressableView onPress={onPress} colorScheme={colorScheme} styleView={styleView}>
42
45
  {content}
@@ -50,7 +53,10 @@ export default memo(({ children, childrenLeft, childrenRight, onPress, style, ba
50
53
  const PressableView = memo(({ children, onPress, colorScheme, styleView }) => {
51
54
  const { colorThemeType } = useTable();
52
55
  const backgroundColorPressed = colors.table[colorThemeType][colorScheme].background_pressed;
53
- return (<Pressable onPress={onPress} style={({ pressed }) => !pressed ? styleView : [styleView, { backgroundColor: backgroundColorPressed }]}>
56
+ return (<Pressable onPress={onPress} style={({ pressed, hovered }) => [
57
+ styleView,
58
+ (pressed || (Platform.OS === 'web' && hovered)) && { backgroundColor: backgroundColorPressed }
59
+ ]}>
54
60
  {children}
55
61
  </Pressable>);
56
62
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.216",
3
+ "version": "1.0.218",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,8 +27,8 @@
27
27
  "@supabase/supabase-js": "^2.106.1",
28
28
  "color2k": "^2.0.3",
29
29
  "date-fns": "^4.1.0",
30
- "expo": "~56.0.3",
31
- "expo-blur": "~56.0.3",
30
+ "expo": "~56.0.17",
31
+ "expo-blur": "~56.0.4",
32
32
  "expo-constants": "~56.0.14",
33
33
  "expo-device": "~56.0.4",
34
34
  "expo-font": "~56.0.5",
@@ -43,7 +43,7 @@
43
43
  "expo-status-bar": "~56.0.4",
44
44
  "expo-symbols": "~56.0.5",
45
45
  "expo-system-ui": "~56.0.5",
46
- "expo-web-browser": "~56.0.5",
46
+ "expo-web-browser": "~56.0.6",
47
47
  "react": "19.2.3",
48
48
  "react-dom": "19.2.3",
49
49
  "react-native": "0.85.3",
@@ -80,7 +80,7 @@
80
80
  }
81
81
  },
82
82
  "dependencies": {
83
- "expo": "~56.0.17",
83
+ "expo": "56.0.17",
84
84
  "react": "19.2.3",
85
85
  "react-native": "0.85.3"
86
86
  }