react-crud-mobile 1.3.178 → 1.3.179

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.178",
3
+ "version": "1.3.179",
4
4
  "license": "MIT",
5
5
  "description": "Uma biblioteca de componentes para React Native",
6
6
  "main": "dist/index.js",
@@ -802,6 +802,7 @@ const styles = StyleSheet.create({
802
802
  label: {
803
803
  fontWeight: 400,
804
804
  fontSize: 12,
805
+ paddingVertical: 3,
805
806
  color: 'labelColor',
806
807
  },
807
808
  inner: { width: '100%' },
@@ -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
+ };
@@ -48,8 +48,6 @@ export default function UIList(props: ChildType) {
48
48
  .toLowerCase()
49
49
  .trim() as string;
50
50
 
51
- console.log(query);
52
-
53
51
  if (query.length > 1) {
54
52
  let filters: any[] = [];
55
53
  let filterBy = Utils.nvl(original.filterBy, 'label');
@@ -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
+ });
@@ -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
+ }