react-crud-mobile 1.3.162 → 1.3.164

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-crud-mobile",
3
- "version": "1.3.162",
3
+ "version": "1.3.164",
4
4
  "license": "MIT",
5
5
  "description": "Uma biblioteca de componentes para React Native",
6
6
  "main": "dist/index.js",
@@ -46,7 +46,7 @@
46
46
  "@react-native-vector-icons/material-icons": "^0.0.1",
47
47
  "expo-status-bar": "~3.0.8",
48
48
  "react": "19.1.0",
49
- "react-crud-utils": "^0.1.389",
49
+ "react-crud-utils": "^0.1.390",
50
50
  "react-dom": "19.1.0",
51
51
  "react-native": "0.81.4",
52
52
  "react-native-draggable-flatlist": "^4.0.3",
@@ -1,17 +1,17 @@
1
- import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
-
3
- export default function UIAutoComplete(props: any) {
4
- const handlePress = () => {
5
- Linking.openURL('https://reactnative.dev/');
6
- };
7
-
8
- return (
9
- <TouchableOpacity onPress={handlePress}>
10
- <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
- </TouchableOpacity>
12
- );
13
- }
14
-
15
- const styles = {
16
- link: {},
17
- };
1
+ import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
+
3
+ export default function UIAutoComplete(props: any) {
4
+ const handlePress = () => {
5
+ Linking.openURL('https://reactnative.dev/');
6
+ };
7
+
8
+ return (
9
+ <TouchableOpacity onPress={handlePress}>
10
+ <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
+ </TouchableOpacity>
12
+ );
13
+ }
14
+
15
+ const styles = {
16
+ link: {},
17
+ };
@@ -1,17 +1,17 @@
1
- import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
-
3
- export default function UILink(props: any) {
4
- const handlePress = () => {
5
- Linking.openURL('https://reactnative.dev/');
6
- };
7
-
8
- return (
9
- <TouchableOpacity onPress={handlePress}>
10
- <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
- </TouchableOpacity>
12
- );
13
- }
14
-
15
- const styles = {
16
- link: {},
17
- };
1
+ import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
+
3
+ export default function UILink(props: any) {
4
+ const handlePress = () => {
5
+ Linking.openURL('https://reactnative.dev/');
6
+ };
7
+
8
+ return (
9
+ <TouchableOpacity onPress={handlePress}>
10
+ <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
+ </TouchableOpacity>
12
+ );
13
+ }
14
+
15
+ const styles = {
16
+ link: {},
17
+ };
@@ -1,32 +1,32 @@
1
- import { useState } from 'react';
2
- import { ChildType, Utils } from 'react-crud-utils';
3
- import { FlatList, StyleSheet, Switch, Text, View } from 'react-native';
4
-
5
- interface UIListItemType extends ChildType {
6
- data: any;
7
- }
8
-
9
- export default function UIListItem(props: UIListItemType) {
10
- const scope = props.scope;
11
- const crud = props.crud;
12
-
13
- return <View style={styles.item}></View>;
14
- }
15
-
16
- const styles = StyleSheet.create({
17
- container: {
18
- flex: 1,
19
- padding: 20,
20
- backgroundColor: '#fff',
21
- },
22
- item: {
23
- padding: 15,
24
- marginVertical: 8,
25
- backgroundColor: '#f9c2ff',
26
- borderRadius: 8,
27
- },
28
- text: {
29
- fontSize: 18,
30
- fontWeight: 'bold',
31
- },
32
- });
1
+ import { useState } from 'react';
2
+ import { ChildType, Utils } from 'react-crud-utils';
3
+ import { FlatList, StyleSheet, Switch, Text, View } from 'react-native';
4
+
5
+ interface UIListItemType extends ChildType {
6
+ data: any;
7
+ }
8
+
9
+ export default function UIListItem(props: UIListItemType) {
10
+ const scope = props.scope;
11
+ const crud = props.crud;
12
+
13
+ return <View style={styles.item}></View>;
14
+ }
15
+
16
+ const styles = StyleSheet.create({
17
+ container: {
18
+ flex: 1,
19
+ padding: 20,
20
+ backgroundColor: '#fff',
21
+ },
22
+ item: {
23
+ padding: 15,
24
+ marginVertical: 8,
25
+ backgroundColor: '#f9c2ff',
26
+ borderRadius: 8,
27
+ },
28
+ text: {
29
+ fontSize: 18,
30
+ fontWeight: 'bold',
31
+ },
32
+ });
@@ -110,24 +110,14 @@ export default function UIModal({
110
110
  return <View style={style('modalContent')}>{children}</View>;
111
111
  }
112
112
  return (
113
- <View
114
- style={{
115
- flex: 1,
116
- paddingLeft: 15,
117
- paddingRight: 15,
118
- paddingTop: 10,
119
- paddingBottom: 10,
120
- }}
113
+ <ScrollView
114
+ contentContainerStyle={{ flexGrow: 1, paddingBottom: 50 }}
115
+ style={style('modalContent')}
116
+ nestedScrollEnabled={true}
117
+ ref={scrollRef}
121
118
  >
122
- <ScrollView
123
- contentContainerStyle={{ flexGrow: 1, paddingBottom: 50 }}
124
- style={style('modalContent')}
125
- nestedScrollEnabled={true}
126
- ref={scrollRef}
127
- >
128
- {children}
129
- </ScrollView>
130
- </View>
119
+ {children}
120
+ </ScrollView>
131
121
  );
132
122
  };
133
123
 
@@ -227,5 +217,9 @@ const styles = StyleSheet.create({
227
217
  modalContent: {
228
218
  flex: 1,
229
219
  backgroundColor: 'background',
220
+ paddingLeft: 15,
221
+ paddingRight: 15,
222
+ paddingTop: 10,
223
+ paddingBottom: 10,
230
224
  },
231
225
  });
@@ -1,17 +1,17 @@
1
- import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
-
3
- export default function UIOption(props: any) {
4
- const handlePress = () => {
5
- Linking.openURL('https://reactnative.dev/');
6
- };
7
-
8
- return (
9
- <TouchableOpacity onPress={handlePress}>
10
- <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
- </TouchableOpacity>
12
- );
13
- }
14
-
15
- const styles = {
16
- link: {},
17
- };
1
+ import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
+
3
+ export default function UIOption(props: any) {
4
+ const handlePress = () => {
5
+ Linking.openURL('https://reactnative.dev/');
6
+ };
7
+
8
+ return (
9
+ <TouchableOpacity onPress={handlePress}>
10
+ <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
+ </TouchableOpacity>
12
+ );
13
+ }
14
+
15
+ const styles = {
16
+ link: {},
17
+ };
@@ -1,17 +1,17 @@
1
- import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
-
3
- export default function UIRadio(props: any) {
4
- const handlePress = () => {
5
- Linking.openURL('https://reactnative.dev/');
6
- };
7
-
8
- return (
9
- <TouchableOpacity onPress={handlePress}>
10
- <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
- </TouchableOpacity>
12
- );
13
- }
14
-
15
- const styles = {
16
- link: {},
17
- };
1
+ import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
+
3
+ export default function UIRadio(props: any) {
4
+ const handlePress = () => {
5
+ Linking.openURL('https://reactnative.dev/');
6
+ };
7
+
8
+ return (
9
+ <TouchableOpacity onPress={handlePress}>
10
+ <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
+ </TouchableOpacity>
12
+ );
13
+ }
14
+
15
+ const styles = {
16
+ link: {},
17
+ };
@@ -1,61 +1,61 @@
1
- import { useState } from 'react';
2
- import { ChildType, ComponentUtils, Utils } from 'react-crud-utils';
3
- import { Switch } from 'react-native';
4
- import Slider from '@react-native-community/slider';
5
-
6
- export default function UISlider(props: ChildType) {
7
- const scope = props.scope;
8
- const initial = Utils.nvl(scope.getValue(), 0);
9
- const [value, setValue] = useState(initial);
10
-
11
- //redeploy 0
12
-
13
- let onChange = v => {
14
- v = Utils.nvl(v, 0);
15
-
16
- console.log(v);
17
-
18
- scope.changeValue(v);
19
-
20
- setValue(v);
21
- };
22
-
23
- let step = scope.attr('step', 1);
24
- let min = scope.attr('min', 0);
25
- let max = scope.attr('min', 100);
26
-
27
- let onSlideScroll = (scrollEnabled: boolean) => {
28
- let viewScope = ComponentUtils.getViewScope();
29
-
30
- if (scope.original.debug) {
31
- console.log(viewScope);
32
- }
33
-
34
- if (viewScope) {
35
- let scrollRef = viewScope.get('scrollRef');
36
-
37
- if (scrollRef) scrollRef.current?.setNativeProps?.({ scrollEnabled });
38
- }
39
- };
40
- return (
41
- <>
42
- <Slider
43
- minimumValue={min}
44
- maximumValue={max}
45
- step={step}
46
- minimumTrackTintColor="#1EB1FC"
47
- maximumTrackTintColor="#d3d3d3"
48
- thumbTintColor="#1EB1FC"
49
- value={value}
50
- onSlidingStart={() => onSlideScroll(false)}
51
- onSlidingComplete={() => onSlideScroll(true)}
52
- style={{ width: '100%', height: 40, ...scope.getStyle('element') }}
53
- onValueChange={onChange} // Alterna o estado
54
- />
55
- </>
56
- );
57
- }
58
-
59
- const styles = {
60
- link: {},
61
- };
1
+ import { useState } from 'react';
2
+ import { ChildType, ComponentUtils, Utils } from 'react-crud-utils';
3
+ import { Switch } from 'react-native';
4
+ import Slider from '@react-native-community/slider';
5
+
6
+ export default function UISlider(props: ChildType) {
7
+ const scope = props.scope;
8
+ const initial = Utils.nvl(scope.getValue(), 0);
9
+ const [value, setValue] = useState(initial);
10
+
11
+ //redeploy 0
12
+
13
+ let onChange = v => {
14
+ v = Utils.nvl(v, 0);
15
+
16
+ console.log(v);
17
+
18
+ scope.changeValue(v);
19
+
20
+ setValue(v);
21
+ };
22
+
23
+ let step = scope.attr('step', 1);
24
+ let min = scope.attr('min', 0);
25
+ let max = scope.attr('min', 100);
26
+
27
+ let onSlideScroll = (scrollEnabled: boolean) => {
28
+ let viewScope = ComponentUtils.getViewScope();
29
+
30
+ if (scope.original.debug) {
31
+ console.log(viewScope);
32
+ }
33
+
34
+ if (viewScope) {
35
+ let scrollRef = viewScope.get('scrollRef');
36
+
37
+ if (scrollRef) scrollRef.current?.setNativeProps?.({ scrollEnabled });
38
+ }
39
+ };
40
+ return (
41
+ <>
42
+ <Slider
43
+ minimumValue={min}
44
+ maximumValue={max}
45
+ step={step}
46
+ minimumTrackTintColor="#1EB1FC"
47
+ maximumTrackTintColor="#d3d3d3"
48
+ thumbTintColor="#1EB1FC"
49
+ value={value}
50
+ onSlidingStart={() => onSlideScroll(false)}
51
+ onSlidingComplete={() => onSlideScroll(true)}
52
+ style={{ width: '100%', height: 40, ...scope.getStyle('element') }}
53
+ onValueChange={onChange} // Alterna o estado
54
+ />
55
+ </>
56
+ );
57
+ }
58
+
59
+ const styles = {
60
+ link: {},
61
+ };
@@ -1,5 +1,5 @@
1
- import { StatusBar } from 'expo-status-bar';
2
-
3
- export default function UIStatusBar() {
4
- return <StatusBar style="dark" backgroundColor="#f5f5f5" />;
5
- }
1
+ import { StatusBar } from 'expo-status-bar';
2
+
3
+ export default function UIStatusBar() {
4
+ return <StatusBar style="dark" backgroundColor="#f5f5f5" />;
5
+ }
@@ -1,27 +1,27 @@
1
- import { useState } from 'react';
2
- import { ChildType, Utils } from 'react-crud-utils';
3
- import { Switch } from 'react-native';
4
-
5
- export default function UISwitch(props: ChildType) {
6
- const scope = props.scope;
7
- const initial = Utils.nvl(scope.getValue(), false) as boolean;
8
- const [value, setValue] = useState(initial);
9
-
10
- let onChange = v => {
11
- scope.changeValue(v);
12
-
13
- setValue(v);
14
- };
15
-
16
- return (
17
- <Switch
18
- value={value}
19
- style={scope.getStyle('element')}
20
- onValueChange={onChange} // Alterna o estado
21
- />
22
- );
23
- }
24
-
25
- const styles = {
26
- link: {},
27
- };
1
+ import { useState } from 'react';
2
+ import { ChildType, Utils } from 'react-crud-utils';
3
+ import { Switch } from 'react-native';
4
+
5
+ export default function UISwitch(props: ChildType) {
6
+ const scope = props.scope;
7
+ const initial = Utils.nvl(scope.getValue(), false) as boolean;
8
+ const [value, setValue] = useState(initial);
9
+
10
+ let onChange = v => {
11
+ scope.changeValue(v);
12
+
13
+ setValue(v);
14
+ };
15
+
16
+ return (
17
+ <Switch
18
+ value={value}
19
+ style={scope.getStyle('element')}
20
+ onValueChange={onChange} // Alterna o estado
21
+ />
22
+ );
23
+ }
24
+
25
+ const styles = {
26
+ link: {},
27
+ };
@@ -1,39 +1,39 @@
1
- import { useEffect, useState } from 'react';
2
- import { Scope } from 'react-crud-utils';
3
- import { Dimensions, Platform } from 'react-native';
4
-
5
- export function useIsVisible(ref: any, scope: Scope) {
6
- const [isVisible, setIsVisible] = useState(scope.visible === true);
7
-
8
- useEffect(() => {
9
- const checkVisibility = () => {
10
- if (!ref.current || isVisible || !scope.original?.useIsInView) return;
11
-
12
- if (Platform.OS === 'web') {
13
- const rect = ref.current.getBoundingClientRect?.();
14
-
15
- if (rect && typeof window !== 'undefined') {
16
- const windowHeight = window.innerHeight;
17
- const visible = rect.top < windowHeight && rect.bottom > 0;
18
-
19
- if (visible) scope.visible = visible;
20
-
21
- setIsVisible(visible);
22
- }
23
- } else {
24
- ref.current.measureInWindow?.((x, y, width, height) => {
25
- const windowHeight = Dimensions.get('window').height;
26
- const visible = y < windowHeight && y + height > 0;
27
-
28
- if (visible) scope.visible = visible;
29
- setIsVisible(visible);
30
- });
31
- }
32
- };
33
-
34
- const interval = setInterval(checkVisibility, 300); // roda a cada 300ms
35
- return () => clearInterval(interval);
36
- }, [ref]);
37
-
38
- return isVisible;
39
- }
1
+ import { useEffect, useState } from 'react';
2
+ import { Scope } from 'react-crud-utils';
3
+ import { Dimensions, Platform } from 'react-native';
4
+
5
+ export function useIsVisible(ref: any, scope: Scope) {
6
+ const [isVisible, setIsVisible] = useState(scope.visible === true);
7
+
8
+ useEffect(() => {
9
+ const checkVisibility = () => {
10
+ if (!ref.current || isVisible || !scope.original?.useIsInView) return;
11
+
12
+ if (Platform.OS === 'web') {
13
+ const rect = ref.current.getBoundingClientRect?.();
14
+
15
+ if (rect && typeof window !== 'undefined') {
16
+ const windowHeight = window.innerHeight;
17
+ const visible = rect.top < windowHeight && rect.bottom > 0;
18
+
19
+ if (visible) scope.visible = visible;
20
+
21
+ setIsVisible(visible);
22
+ }
23
+ } else {
24
+ ref.current.measureInWindow?.((x, y, width, height) => {
25
+ const windowHeight = Dimensions.get('window').height;
26
+ const visible = y < windowHeight && y + height > 0;
27
+
28
+ if (visible) scope.visible = visible;
29
+ setIsVisible(visible);
30
+ });
31
+ }
32
+ };
33
+
34
+ const interval = setInterval(checkVisibility, 300); // roda a cada 300ms
35
+ return () => clearInterval(interval);
36
+ }, [ref]);
37
+
38
+ return isVisible;
39
+ }
@@ -1,12 +1,12 @@
1
- //import { ThemeUtils, Utils } from 'react-crud-utils';
2
- //import { StatusBar } from 'react-native';
3
-
4
- export default class MobileUtils {
5
- static syncTheme() {
6
- // let current = ThemeUtils.getCurrentTheme();
7
- //let dec: any = { light: 'light-content', dark: 'dark-content' };
8
- //let name = Utils.nvl(dec[current?.theme], dec.light);
9
- //StatusBar.setBarStyle?.(name);
10
- //StatusBar.setBackgroundColor?.(current?.colors?.theme);
11
- }
12
- }
1
+ //import { ThemeUtils, Utils } from 'react-crud-utils';
2
+ //import { StatusBar } from 'react-native';
3
+
4
+ export default class MobileUtils {
5
+ static syncTheme() {
6
+ // let current = ThemeUtils.getCurrentTheme();
7
+ //let dec: any = { light: 'light-content', dark: 'dark-content' };
8
+ //let name = Utils.nvl(dec[current?.theme], dec.light);
9
+ //StatusBar.setBarStyle?.(name);
10
+ //StatusBar.setBackgroundColor?.(current?.colors?.theme);
11
+ }
12
+ }