react-crud-mobile 1.0.117 → 1.0.119

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.
@@ -1,13 +1,13 @@
1
- import React, { useState } from "react";
2
- import { Utils } from "react-crud-utils";
3
-
4
- interface UITagType {
5
- name: string;
6
- [otherOptions: string]: unknown;
7
- }
8
-
9
- export default function UITag(props: UITagType) {
10
- let Aux = Utils.nvl(props.name, "span");
11
-
12
- return <Aux {...props} />;
13
- }
1
+ import React, { useState } from "react";
2
+ import { Utils } from "react-crud-utils";
3
+
4
+ interface UITagType {
5
+ name: string;
6
+ [otherOptions: string]: unknown;
7
+ }
8
+
9
+ export default function UITag(props: UITagType) {
10
+ let Aux = Utils.nvl(props.name, "span");
11
+
12
+ return <Aux {...props} />;
13
+ }
@@ -1,10 +1,10 @@
1
- import React from "react";
2
- import { ChildType, Scope, Utils } from "react-crud-utils";
3
-
4
- export default function ElChart(props: ChildType) {
5
- let scope: Scope = props.scope;
6
- let items: any = scope.getItems();
7
- let columns = Utils.asList(scope.original.columns);
8
-
9
- return <div className="ui-chart-data"></div>;
10
- }
1
+ import React from "react";
2
+ import { ChildType, Scope, Utils } from "react-crud-utils";
3
+
4
+ export default function ElChart(props: ChildType) {
5
+ let scope: Scope = props.scope;
6
+ let items: any = scope.getItems();
7
+ let columns = Utils.asList(scope.original.columns);
8
+
9
+ return <div className="ui-chart-data"></div>;
10
+ }
@@ -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,76 +1,76 @@
1
- import { Ionicons } from '@expo/vector-icons';
2
- import { ChildType } from 'react-crud-utils';
3
- import { Text, TouchableHighlight, View } from 'react-native';
4
-
5
- export default function UIButton(props: ChildType) {
6
- let scope = props.scope;
7
- let element = scope.original;
8
-
9
- let color = element.color;
10
- let label = element.label;
11
- let icon = element.icon;
12
-
13
- if (!color) color = '#55a46f';
14
-
15
- const styles: any = {
16
- text: {
17
- color: '#ffffff',
18
- lineHeight: 30,
19
- fontWeight: '500',
20
- textAlign: 'center',
21
- ...element.textStyle,
22
- },
23
- inner: {
24
- flex: 1,
25
- flexDirection: 'row',
26
- flexWrap: 'wrap',
27
- textAlign: 'center',
28
- alignItems: 'center',
29
- margin: 'auto',
30
- ...element.textStyle,
31
- },
32
- icon: {
33
- color: '#fff',
34
- fontSize: 18,
35
- paddingRight: 10,
36
- },
37
- button: {
38
- padding: 5,
39
- alignItems: 'center',
40
- paddingLeft: 10,
41
- paddingRight: 10,
42
- minWidth: 200,
43
- margin: 5,
44
- textAlign: 'center',
45
- verticalAling: 'middle',
46
- lineHeight: 30,
47
- borderRadius: 20,
48
- backgroundColor: color,
49
- color: '#ffffff',
50
- ...element.buttonStyle,
51
- },
52
- };
53
-
54
- const onClick = (e: any) => {
55
- if (typeof element.click === 'function') {
56
- element.click(e);
57
- }
58
- };
59
-
60
- return (
61
- <TouchableHighlight
62
- underlayColor={'transparent'}
63
- onPress={onClick}
64
- style={styles.button}
65
- >
66
- <View style={styles.inner}>
67
- {icon && (
68
- <>
69
- <Ionicons size={30} style={styles.icon} name={icon} />
70
- </>
71
- )}
72
- <Text style={styles.text}>{label}</Text>
73
- </View>
74
- </TouchableHighlight>
75
- );
76
- }
1
+ import { Ionicons } from '@expo/vector-icons';
2
+ import { ChildType } from 'react-crud-utils';
3
+ import { Text, TouchableHighlight, View } from 'react-native';
4
+
5
+ export default function UIButton(props: ChildType) {
6
+ let scope = props.scope;
7
+ let element = scope.original;
8
+
9
+ let color = element.color;
10
+ let label = element.label;
11
+ let icon = element.icon;
12
+
13
+ if (!color) color = '#55a46f';
14
+
15
+ const styles: any = {
16
+ text: {
17
+ color: '#ffffff',
18
+ lineHeight: 30,
19
+ fontWeight: '500',
20
+ textAlign: 'center',
21
+ ...element.textStyle,
22
+ },
23
+ inner: {
24
+ flex: 1,
25
+ flexDirection: 'row',
26
+ flexWrap: 'wrap',
27
+ textAlign: 'center',
28
+ alignItems: 'center',
29
+ margin: 'auto',
30
+ ...element.textStyle,
31
+ },
32
+ icon: {
33
+ color: '#fff',
34
+ fontSize: 18,
35
+ paddingRight: 10,
36
+ },
37
+ button: {
38
+ padding: 5,
39
+ alignItems: 'center',
40
+ paddingLeft: 10,
41
+ paddingRight: 10,
42
+ minWidth: 200,
43
+ margin: 5,
44
+ textAlign: 'center',
45
+ verticalAling: 'middle',
46
+ lineHeight: 30,
47
+ borderRadius: 20,
48
+ backgroundColor: color,
49
+ color: '#ffffff',
50
+ ...element.buttonStyle,
51
+ },
52
+ };
53
+
54
+ const onClick = (e: any) => {
55
+ if (typeof element.click === 'function') {
56
+ element.click(e);
57
+ }
58
+ };
59
+
60
+ return (
61
+ <TouchableHighlight
62
+ underlayColor={'transparent'}
63
+ onPress={onClick}
64
+ style={styles.button}
65
+ >
66
+ <View style={styles.inner}>
67
+ {icon && (
68
+ <>
69
+ <Ionicons size={30} style={styles.icon} name={icon} />
70
+ </>
71
+ )}
72
+ <Text style={styles.text}>{label}</Text>
73
+ </View>
74
+ </TouchableHighlight>
75
+ );
76
+ }
@@ -1,17 +1,17 @@
1
- import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
-
3
- export default function UIIcon(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 UIIcon(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,40 +1,40 @@
1
- import UIChildren from '../UIChildren';
2
- import { ComponentUtils, DefineType, Utils } from 'react-crud-utils';
3
-
4
- export default function UIInclude(props: DefineType) {
5
- if (props.rendered === false) {
6
- return <></>;
7
- }
8
-
9
- let includes = ComponentUtils.getDefine(props, props.name, props.position);
10
-
11
- if (Utils.isEmpty(includes)) {
12
- includes = props.default;
13
- }
14
-
15
- if (!Utils.isEmpty(includes)) {
16
- let Aux = (tagProp: any) => {
17
- let Tag: any = props.tag;
18
-
19
- if (!Utils.isEmpty(Tag)) {
20
- return <Tag {...tagProp}>{tagProp.children}</Tag>;
21
- }
22
- return <>{tagProp.children}</>;
23
- };
24
-
25
- return (
26
- <Aux {...props.tagProps}>
27
- <UIChildren
28
- transient
29
- {...props}
30
- scope={props.scope}
31
- crud={props.crud}
32
- part={props.name}
33
- >
34
- {includes}
35
- </UIChildren>
36
- </Aux>
37
- );
38
- }
39
- return <>{includes}</>;
40
- }
1
+ import UIChildren from '../UIChildren';
2
+ import { ComponentUtils, DefineType, Utils } from 'react-crud-utils';
3
+
4
+ export default function UIInclude(props: DefineType) {
5
+ if (props.rendered === false) {
6
+ return <></>;
7
+ }
8
+
9
+ let includes = ComponentUtils.getDefine(props, props.name, props.position);
10
+
11
+ if (Utils.isEmpty(includes)) {
12
+ includes = props.default;
13
+ }
14
+
15
+ if (!Utils.isEmpty(includes)) {
16
+ let Aux = (tagProp: any) => {
17
+ let Tag: any = props.tag;
18
+
19
+ if (!Utils.isEmpty(Tag)) {
20
+ return <Tag {...tagProp}>{tagProp.children}</Tag>;
21
+ }
22
+ return <>{tagProp.children}</>;
23
+ };
24
+
25
+ return (
26
+ <Aux {...props.tagProps}>
27
+ <UIChildren
28
+ transient
29
+ {...props}
30
+ scope={props.scope}
31
+ crud={props.crud}
32
+ part={props.name}
33
+ >
34
+ {includes}
35
+ </UIChildren>
36
+ </Aux>
37
+ );
38
+ }
39
+ return <>{includes}</>;
40
+ }
@@ -1,41 +1,41 @@
1
- import { useState } from 'react';
2
- import { ChildType, Utils } from 'react-crud-utils';
3
- import { StyleSheet, TextInput } from 'react-native';
4
-
5
- export default function UIInput(props: ChildType) {
6
- let scope = props.scope;
7
- let initial = Utils.nvl(scope.getValue(), '');
8
-
9
- let label = scope.getLabel();
10
- let placeholder = scope.getPart('placeholder', null, label);
11
-
12
- const [value, setValue] = useState(initial);
13
-
14
- let onChange = v => {
15
- scope.changeValue(v);
16
-
17
- setValue(v);
18
- };
19
-
20
- return (
21
- <TextInput
22
- style={styles.input}
23
- onChangeText={onChange}
24
- value={value}
25
- placeholder={placeholder}
26
- />
27
- );
28
- }
29
-
30
- const styles = StyleSheet.create({
31
- input: {
32
- borderRadius: 20,
33
- padding: 10,
34
- paddingLeft: 20,
35
- paddingRight: 20,
36
- height: 40,
37
- borderWidth: 1,
38
- borderColor: '#a9a9a9',
39
- width: '100%',
40
- },
41
- });
1
+ import { useState } from 'react';
2
+ import { ChildType, Utils } from 'react-crud-utils';
3
+ import { StyleSheet, TextInput } from 'react-native';
4
+
5
+ export default function UIInput(props: ChildType) {
6
+ let scope = props.scope;
7
+ let initial = Utils.nvl(scope.getValue(), '');
8
+
9
+ let label = scope.getLabel();
10
+ let placeholder = scope.getPart('placeholder', null, label);
11
+
12
+ const [value, setValue] = useState(initial);
13
+
14
+ let onChange = v => {
15
+ scope.changeValue(v);
16
+
17
+ setValue(v);
18
+ };
19
+
20
+ return (
21
+ <TextInput
22
+ style={styles.input}
23
+ onChangeText={onChange}
24
+ value={value}
25
+ placeholder={placeholder}
26
+ />
27
+ );
28
+ }
29
+
30
+ const styles = StyleSheet.create({
31
+ input: {
32
+ borderRadius: 20,
33
+ padding: 10,
34
+ paddingLeft: 20,
35
+ paddingRight: 20,
36
+ height: 40,
37
+ borderWidth: 1,
38
+ borderColor: '#a9a9a9',
39
+ width: '100%',
40
+ },
41
+ });
@@ -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,36 +1,39 @@
1
- import React from 'react';
2
- import { ChildType, Utils } from 'react-crud-utils';
3
- import { StyleSheet, Text, View } from 'react-native';
4
-
5
- export default function UIList(props: ChildType) {
6
- const scope = props.scope;
7
- const items = Utils.nvl(scope.getItems(), []);
8
-
9
- return (
10
- <View style={styles.container}>
11
- {items.map((item: any, i: number) => (
12
- <View key={`k-${i}`} style={styles.item}>
13
- <Text style={styles.text}>{item.name}</Text>
14
- </View>
15
- ))}
16
- </View>
17
- );
18
- }
19
-
20
- const styles = StyleSheet.create({
21
- container: {
22
- flex: 1,
23
- width: '100%',
24
- },
25
- item: {
26
- padding: 15,
27
- marginVertical: 8,
28
- backgroundColor: '#f9c2ff',
29
- borderRadius: 8,
30
- width: '100%',
31
- },
32
- text: {
33
- fontSize: 18,
34
- fontWeight: 'bold',
35
- },
36
- });
1
+ import React from 'react';
2
+ import { ChildType, Utils } from 'react-crud-utils';
3
+ import { StyleSheet, Text, View } from 'react-native';
4
+ import UIListRow from './UIListRow';
5
+
6
+ export default function UIList(props: ChildType) {
7
+ const scope = props.scope;
8
+ const items = Utils.nvl(scope.getItems(), []);
9
+
10
+ return (
11
+ <View style={styles.container}>
12
+ {items.map((item: any, i: number) => (
13
+ <View key={`k-${i}`} style={styles.item}>
14
+ <UIListRow scope={scope} item={item} index={i}>
15
+ {props.children}
16
+ </UIListRow>
17
+ </View>
18
+ ))}
19
+ </View>
20
+ );
21
+ }
22
+
23
+ const styles = StyleSheet.create({
24
+ container: {
25
+ flex: 1,
26
+ width: '100%',
27
+ },
28
+ item: {
29
+ padding: 15,
30
+ marginVertical: 8,
31
+ backgroundColor: '#f9c2ff',
32
+ borderRadius: 8,
33
+ width: '100%',
34
+ },
35
+ text: {
36
+ fontSize: 18,
37
+ fontWeight: 'bold',
38
+ },
39
+ });
@@ -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
+ });
@@ -0,0 +1,29 @@
1
+ import React, { useState } from 'react';
2
+ import { ChildType, ScopeUtils, Utils } from 'react-crud-utils';
3
+ import UIChildren from '../UIChildren';
4
+
5
+ interface UIListRowType extends ChildType {
6
+ item: any;
7
+ index: number;
8
+ }
9
+
10
+ export default function UIListRow(props: UIListRowType) {
11
+ const parent = props.scope;
12
+ const item = props.item;
13
+ const row = {
14
+ parent,
15
+ crud: parent.crud,
16
+ index: props.index,
17
+ type: 'row',
18
+ data: item,
19
+ };
20
+ let [scope] = useState(ScopeUtils.create(row));
21
+
22
+ return (
23
+ <>
24
+ <UIChildren scope={scope} crud={scope.crud}>
25
+ {props.children}
26
+ </UIChildren>
27
+ </>
28
+ );
29
+ }