react-crud-mobile 1.0.392 → 1.0.394

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.
Files changed (32) hide show
  1. package/dist/react-crud-mobile.cjs.development.js +15 -3
  2. package/dist/react-crud-mobile.cjs.development.js.map +1 -1
  3. package/dist/react-crud-mobile.cjs.production.min.js +1 -1
  4. package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
  5. package/dist/react-crud-mobile.esm.js +15 -3
  6. package/dist/react-crud-mobile.esm.js.map +1 -1
  7. package/package.json +71 -71
  8. package/src/elements/UI.tsx +65 -65
  9. package/src/elements/UIChildren.tsx +126 -126
  10. package/src/elements/UIComplete.tsx +14 -14
  11. package/src/elements/UIElement.tsx +496 -496
  12. package/src/elements/UITag.tsx +13 -13
  13. package/src/elements/charts/ElChart.tsx +10 -10
  14. package/src/elements/core/UIAutoComplete.tsx +17 -17
  15. package/src/elements/core/UIButton.tsx +73 -73
  16. package/src/elements/core/UIIcon.tsx +17 -17
  17. package/src/elements/core/UIInclude.tsx +40 -40
  18. package/src/elements/core/UIInput.tsx +69 -69
  19. package/src/elements/core/UILink.tsx +17 -17
  20. package/src/elements/core/UIList.tsx +117 -102
  21. package/src/elements/core/UIListItem.tsx +32 -32
  22. package/src/elements/core/UIListRow.tsx +29 -29
  23. package/src/elements/core/UIModal.tsx +111 -111
  24. package/src/elements/core/UIOption.tsx +17 -17
  25. package/src/elements/core/UIQuantity.tsx +97 -97
  26. package/src/elements/core/UIRadio.tsx +17 -17
  27. package/src/elements/core/UISelect.tsx +122 -122
  28. package/src/elements/core/UISwitch.tsx +26 -26
  29. package/src/elements/core/UIToggle.tsx +102 -102
  30. package/src/elements/index.ts +1 -1
  31. package/src/elements/tabs/ElTabs.tsx +178 -178
  32. package/src/index.ts +1 -1
package/package.json CHANGED
@@ -1,71 +1,71 @@
1
- {
2
- "version": "1.0.392",
3
- "license": "MIT",
4
- "description": "Uma biblioteca de componentes para React Native",
5
- "main": "dist/index.js",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "react-native": "src/index.ts",
9
- "scripts": {
10
- "start": "tsdx watch",
11
- "build": "tsdx build",
12
- "test": "tsdx test --passWithNoTests",
13
- "lint": "tsdx lint",
14
- "prepare": "tsdx build",
15
- "deploy": "npm version patch && npm publish"
16
- },
17
- "husky": {
18
- "hooks": {
19
- "pre-commit": "tsdx lint"
20
- }
21
- },
22
- "prettier": {
23
- "printWidth": 80,
24
- "semi": true,
25
- "singleQuote": true,
26
- "trailingComma": "es5"
27
- },
28
- "name": "react-crud-mobile",
29
- "author": "juarez",
30
- "keywords": [
31
- "react-native",
32
- "components",
33
- "library",
34
- "ui"
35
- ],
36
- "peerDependencies": {
37
- "react": "^18.3.1",
38
- "react-dom": "^18.3.1",
39
- "react-native": "0.76.9"
40
- },
41
- "dependencies": {
42
- "@babel/core": "^7.24.0",
43
- "@babel/preset-env": "^7.24.0",
44
- "@babel/preset-react": "^7.26.3",
45
- "@babel/preset-typescript": "^7.24.0",
46
- "@expo/vector-icons": "^14.0.4",
47
- "@react-native-vector-icons/ionicons": "^7.4.0",
48
- "@react-native-vector-icons/material-icons": "^0.0.1",
49
- "@types/react": "^18.0.38",
50
- "@types/react-native": "^0.72.0",
51
- "babel-plugin-module-resolver": "^5.0.0",
52
- "react": "^18.3.1",
53
- "react-crud-utils": "^0.1.114",
54
- "react-dom": "^18.3.1",
55
- "react-native": "0.76.9",
56
- "react-native-safe-area-context": "^5.4.0",
57
- "react-native-screens": "^4.10.0",
58
- "react-native-vector-icons": "^10.2.0",
59
- "tsdx": "^0.14.1",
60
- "tslib": "^2.8.1",
61
- "tsup": "^7.3.0",
62
- "typescript": "^5.4.0"
63
- },
64
- "files": [
65
- "dist",
66
- "src"
67
- ],
68
- "devDependencies": {
69
- "metro": "^0.82.1"
70
- }
71
- }
1
+ {
2
+ "version": "1.0.394",
3
+ "license": "MIT",
4
+ "description": "Uma biblioteca de componentes para React Native",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "react-native": "src/index.ts",
9
+ "scripts": {
10
+ "start": "tsdx watch",
11
+ "build": "tsdx build",
12
+ "test": "tsdx test --passWithNoTests",
13
+ "lint": "tsdx lint",
14
+ "prepare": "tsdx build",
15
+ "deploy": "npm version patch && npm publish"
16
+ },
17
+ "husky": {
18
+ "hooks": {
19
+ "pre-commit": "tsdx lint"
20
+ }
21
+ },
22
+ "prettier": {
23
+ "printWidth": 80,
24
+ "semi": true,
25
+ "singleQuote": true,
26
+ "trailingComma": "es5"
27
+ },
28
+ "name": "react-crud-mobile",
29
+ "author": "juarez",
30
+ "keywords": [
31
+ "react-native",
32
+ "components",
33
+ "library",
34
+ "ui"
35
+ ],
36
+ "peerDependencies": {
37
+ "react": "^18.3.1",
38
+ "react-dom": "^18.3.1",
39
+ "react-native": "0.76.9"
40
+ },
41
+ "dependencies": {
42
+ "@babel/core": "^7.24.0",
43
+ "@babel/preset-env": "^7.24.0",
44
+ "@babel/preset-react": "^7.26.3",
45
+ "@babel/preset-typescript": "^7.24.0",
46
+ "@expo/vector-icons": "^14.0.4",
47
+ "@react-native-vector-icons/ionicons": "^7.4.0",
48
+ "@react-native-vector-icons/material-icons": "^0.0.1",
49
+ "@types/react": "^18.0.38",
50
+ "@types/react-native": "^0.72.0",
51
+ "babel-plugin-module-resolver": "^5.0.0",
52
+ "react": "^18.3.1",
53
+ "react-crud-utils": "^0.1.115",
54
+ "react-dom": "^18.3.1",
55
+ "react-native": "0.76.9",
56
+ "react-native-safe-area-context": "^5.4.0",
57
+ "react-native-screens": "^4.10.0",
58
+ "react-native-vector-icons": "^10.2.0",
59
+ "tsdx": "^0.14.1",
60
+ "tslib": "^2.8.1",
61
+ "tsup": "^7.3.0",
62
+ "typescript": "^5.4.0"
63
+ },
64
+ "files": [
65
+ "dist",
66
+ "src"
67
+ ],
68
+ "devDependencies": {
69
+ "metro": "^0.82.1"
70
+ }
71
+ }
@@ -1,65 +1,65 @@
1
- import { ListType } from 'react-crud-utils';
2
- import { UserType } from 'react-crud-utils';
3
- import { InputType } from 'react-crud-utils';
4
- import { ChartType } from 'react-crud-utils';
5
- import { ContainerType } from 'react-crud-utils';
6
- import { ListInputType } from 'react-crud-utils';
7
- import UIElement from './UIElement';
8
- import { TabsType } from 'react-crud-utils';
9
- import { DefineType } from 'react-crud-utils';
10
- import { ButtonType } from 'react-crud-utils';
11
- import { LinkType } from 'react-crud-utils';
12
- import UIInclude from './core/UIInclude';
13
-
14
- const UI = {
15
- List: (props: ListType) => <UIElement {...props} type="list" />,
16
- Row: (props: UserType) => <UIElement {...props} type="row" />,
17
- Value: (props: UserType) => <UIElement {...props} type="value" />,
18
- Label: (props: UserType) => <UIElement {...props} type="label" />,
19
- Repeat: (props: ListType) => (
20
- <UIElement {...props} type="repeat" props={{ search: false }} />
21
- ),
22
- Define: (props: DefineType) => <UIElement {...props} type="define" />,
23
- Include: (props: DefineType) => <UIInclude {...props} />,
24
- Column: ({ type = 'column', ...props }: UserType) => (
25
- <UIElement {...props} type="column" />
26
- ),
27
- Input: (props: InputType) => <UIElement {...props} />,
28
- Text: (props: InputType) => <UIElement {...props} type="text" />,
29
- Email: (props: InputType) => <UIElement {...props} type="email" />,
30
- Button: (props: ButtonType) => <UIElement {...props} type="button" />,
31
- Link: (props: LinkType) => <UIElement {...props} type="link" />,
32
- Icon: (props: ButtonType) => <UIElement {...props} type="icon" />,
33
- Output: (props: ContainerType) => <UIElement {...props} type="output" />,
34
- Form: (props: ContainerType) => <UIElement {...props} type="form" />,
35
- Crud: (props: ContainerType) => <UIElement {...props} type="crud" />,
36
- View: (props: ContainerType) => (
37
- <UIElement {...props} type="view" transient />
38
- ),
39
- Bottom: (props: ContainerType) => <UIElement {...props} type="bottom" />,
40
- Dialog: (props: ContainerType) => <UIElement {...props} type="dialog" />,
41
- Content: (props: ContainerType) => <UIElement {...props} type="content" />,
42
- Top: (props: ContainerType) => <UIElement {...props} type="top" />,
43
- Card: (props: ContainerType) => <UIElement {...props} type="card" />,
44
- Tab: (props: ContainerType) => <UIElement {...props} type="tab" />,
45
- Tabs: (props: TabsType) => <UIElement {...props} type="tabs" />,
46
- Step: (props: ContainerType) => (
47
- <UIElement {...props} type="tab" layout="step" />
48
- ),
49
- Stepper: (props: TabsType) => (
50
- <UIElement {...props} type="tabs" layout="stepper" />
51
- ),
52
- Money: (props: InputType) => <UIElement {...props} type="money" />,
53
- Chart: (props: ChartType) => <UIElement {...props} type="chart" />,
54
- Password: (props: InputType) => <UIElement {...props} type="password" />,
55
- Complete: (props: InputType) => <UIElement {...props} type="complete" />,
56
- Checkbox: (props: InputType) => <UIElement {...props} type="switch" />,
57
- Switch: (props: InputType) => <UIElement {...props} type="switch" />,
58
- Radio: (props: ListInputType) => <UIElement {...props} type="radio" />,
59
- Select: (props: ListInputType) => <UIElement {...props} type="select" />,
60
- Toggle: (props: ListInputType) => <UIElement {...props} type="toggle" />,
61
- Entity: (props: ListInputType) => <UIElement {...props} type="entity" />,
62
- Element: (props: ListInputType) => <UIElement {...props} type="element" />,
63
- Quantity: (props: ListInputType) => <UIElement {...props} type="quantity" />,
64
- };
65
- export default UI;
1
+ import { ListType } from 'react-crud-utils';
2
+ import { UserType } from 'react-crud-utils';
3
+ import { InputType } from 'react-crud-utils';
4
+ import { ChartType } from 'react-crud-utils';
5
+ import { ContainerType } from 'react-crud-utils';
6
+ import { ListInputType } from 'react-crud-utils';
7
+ import UIElement from './UIElement';
8
+ import { TabsType } from 'react-crud-utils';
9
+ import { DefineType } from 'react-crud-utils';
10
+ import { ButtonType } from 'react-crud-utils';
11
+ import { LinkType } from 'react-crud-utils';
12
+ import UIInclude from './core/UIInclude';
13
+
14
+ const UI = {
15
+ List: (props: ListType) => <UIElement {...props} type="list" />,
16
+ Row: (props: UserType) => <UIElement {...props} type="row" />,
17
+ Value: (props: UserType) => <UIElement {...props} type="value" />,
18
+ Label: (props: UserType) => <UIElement {...props} type="label" />,
19
+ Repeat: (props: ListType) => (
20
+ <UIElement {...props} type="repeat" props={{ search: false }} />
21
+ ),
22
+ Define: (props: DefineType) => <UIElement {...props} type="define" />,
23
+ Include: (props: DefineType) => <UIInclude {...props} />,
24
+ Column: ({ type = 'column', ...props }: UserType) => (
25
+ <UIElement {...props} type="column" />
26
+ ),
27
+ Input: (props: InputType) => <UIElement {...props} />,
28
+ Text: (props: InputType) => <UIElement {...props} type="text" />,
29
+ Email: (props: InputType) => <UIElement {...props} type="email" />,
30
+ Button: (props: ButtonType) => <UIElement {...props} type="button" />,
31
+ Link: (props: LinkType) => <UIElement {...props} type="link" />,
32
+ Icon: (props: ButtonType) => <UIElement {...props} type="icon" />,
33
+ Output: (props: ContainerType) => <UIElement {...props} type="output" />,
34
+ Form: (props: ContainerType) => <UIElement {...props} type="form" />,
35
+ Crud: (props: ContainerType) => <UIElement {...props} type="crud" />,
36
+ View: (props: ContainerType) => (
37
+ <UIElement {...props} type="view" transient />
38
+ ),
39
+ Bottom: (props: ContainerType) => <UIElement {...props} type="bottom" />,
40
+ Dialog: (props: ContainerType) => <UIElement {...props} type="dialog" />,
41
+ Content: (props: ContainerType) => <UIElement {...props} type="content" />,
42
+ Top: (props: ContainerType) => <UIElement {...props} type="top" />,
43
+ Card: (props: ContainerType) => <UIElement {...props} type="card" />,
44
+ Tab: (props: ContainerType) => <UIElement {...props} type="tab" />,
45
+ Tabs: (props: TabsType) => <UIElement {...props} type="tabs" />,
46
+ Step: (props: ContainerType) => (
47
+ <UIElement {...props} type="tab" layout="step" />
48
+ ),
49
+ Stepper: (props: TabsType) => (
50
+ <UIElement {...props} type="tabs" layout="stepper" />
51
+ ),
52
+ Money: (props: InputType) => <UIElement {...props} type="money" />,
53
+ Chart: (props: ChartType) => <UIElement {...props} type="chart" />,
54
+ Password: (props: InputType) => <UIElement {...props} type="password" />,
55
+ Complete: (props: InputType) => <UIElement {...props} type="complete" />,
56
+ Checkbox: (props: InputType) => <UIElement {...props} type="switch" />,
57
+ Switch: (props: InputType) => <UIElement {...props} type="switch" />,
58
+ Radio: (props: ListInputType) => <UIElement {...props} type="radio" />,
59
+ Select: (props: ListInputType) => <UIElement {...props} type="select" />,
60
+ Toggle: (props: ListInputType) => <UIElement {...props} type="toggle" />,
61
+ Entity: (props: ListInputType) => <UIElement {...props} type="entity" />,
62
+ Element: (props: ListInputType) => <UIElement {...props} type="element" />,
63
+ Quantity: (props: ListInputType) => <UIElement {...props} type="quantity" />,
64
+ };
65
+ export default UI;
@@ -1,126 +1,126 @@
1
- import React, { useState } from 'react';
2
- import UIElement from './UIElement';
3
- import { Crud, Scope, ScopeUtils, Utils } from 'react-crud-utils';
4
- import { StyleSheet, View } from 'react-native';
5
-
6
- interface UIChildrenType {
7
- scope: Scope;
8
- crud?: Crud;
9
- validateScope?: String;
10
- children?: any;
11
- elements?: any;
12
- transient?: boolean;
13
- part?: string;
14
- childProps?: any;
15
- }
16
-
17
- export default function UIChildren(props: UIChildrenType) {
18
- let [scope] = useState(Utils.nvl(props.scope, ScopeUtils.create(props)));
19
- let crud = Utils.nvl(props.crud, scope.crud);
20
- let validateScope = Utils.nvl(props.validateScope, 'global');
21
- let name = Utils.nvl(props.part, 'child');
22
-
23
- if (scope.isInput()) {
24
- return <></>;
25
- }
26
-
27
- let Paint = ({ child }: any) => {
28
- if (!child) {
29
- return <></>;
30
- }
31
- if (typeof child === 'string') {
32
- return <>{child}</>;
33
- }
34
-
35
- let Custom = child.type;
36
- let pps = { ...child.props };
37
-
38
- delete pps.children;
39
-
40
- if (typeof Custom === 'string') {
41
- if (Utils.isEmpty(child.props.children)) {
42
- return <Custom {...pps} />;
43
- }
44
- return (
45
- <Custom {...pps}>
46
- <UIChildren
47
- transient
48
- validateScope={validateScope}
49
- {...child.props}
50
- scope={scope}
51
- crud={crud}
52
- ></UIChildren>
53
- </Custom>
54
- );
55
- } else if (typeof Custom === 'function') {
56
- return (
57
- <Custom
58
- validateScope={validateScope}
59
- {...child.props}
60
- parent={scope}
61
- crud={crud}
62
- ></Custom>
63
- );
64
- }
65
-
66
- if (!Utils.isEmpty(child.props.children)) {
67
- return (
68
- <UIChildren
69
- validateScope={validateScope}
70
- {...child.props}
71
- scope={scope}
72
- crud={crud}
73
- transient
74
- ></UIChildren>
75
- );
76
- }
77
- return <></>;
78
- };
79
-
80
- const Draw = () => {
81
- if (props.elements) {
82
- return (
83
- <>
84
- {Object.entries(props.elements).map((t: any, k) => {
85
- return <UIElement crud={crud} {...t[1]} />;
86
- })}
87
- </>
88
- );
89
- }
90
- return (
91
- <>
92
- {React.Children.map(props.children, child => {
93
- return <Paint child={child}></Paint>;
94
- })}
95
- </>
96
- );
97
- };
98
-
99
- if (props.transient) {
100
- return <Draw />;
101
- }
102
-
103
- if (Utils.isEmpty(props.children) && Utils.isEmpty(props.elements)) {
104
- return <></>;
105
- }
106
-
107
- const getStyle = (part?: string) => {
108
- let key = Utils.nvl(part, 'root');
109
- let def = styles[key];
110
-
111
- return { ...def, ...scope.getStyle(part) };
112
- };
113
-
114
- return (
115
- <>
116
- <View style={getStyle(name)}>
117
- <Draw />
118
- </View>
119
- </>
120
- );
121
- }
122
-
123
- const styles = StyleSheet.create({
124
- child: { width: '100%' },
125
- inner: { width: '100%' },
126
- });
1
+ import React, { useState } from 'react';
2
+ import UIElement from './UIElement';
3
+ import { Crud, Scope, ScopeUtils, Utils } from 'react-crud-utils';
4
+ import { StyleSheet, View } from 'react-native';
5
+
6
+ interface UIChildrenType {
7
+ scope: Scope;
8
+ crud?: Crud;
9
+ validateScope?: String;
10
+ children?: any;
11
+ elements?: any;
12
+ transient?: boolean;
13
+ part?: string;
14
+ childProps?: any;
15
+ }
16
+
17
+ export default function UIChildren(props: UIChildrenType) {
18
+ let [scope] = useState(Utils.nvl(props.scope, ScopeUtils.create(props)));
19
+ let crud = Utils.nvl(props.crud, scope.crud);
20
+ let validateScope = Utils.nvl(props.validateScope, 'global');
21
+ let name = Utils.nvl(props.part, 'child');
22
+
23
+ if (scope.isInput()) {
24
+ return <></>;
25
+ }
26
+
27
+ let Paint = ({ child }: any) => {
28
+ if (!child) {
29
+ return <></>;
30
+ }
31
+ if (typeof child === 'string') {
32
+ return <>{child}</>;
33
+ }
34
+
35
+ let Custom = child.type;
36
+ let pps = { ...child.props };
37
+
38
+ delete pps.children;
39
+
40
+ if (typeof Custom === 'string') {
41
+ if (Utils.isEmpty(child.props.children)) {
42
+ return <Custom {...pps} />;
43
+ }
44
+ return (
45
+ <Custom {...pps}>
46
+ <UIChildren
47
+ transient
48
+ validateScope={validateScope}
49
+ {...child.props}
50
+ scope={scope}
51
+ crud={crud}
52
+ ></UIChildren>
53
+ </Custom>
54
+ );
55
+ } else if (typeof Custom === 'function') {
56
+ return (
57
+ <Custom
58
+ validateScope={validateScope}
59
+ {...child.props}
60
+ parent={scope}
61
+ crud={crud}
62
+ ></Custom>
63
+ );
64
+ }
65
+
66
+ if (!Utils.isEmpty(child.props.children)) {
67
+ return (
68
+ <UIChildren
69
+ validateScope={validateScope}
70
+ {...child.props}
71
+ scope={scope}
72
+ crud={crud}
73
+ transient
74
+ ></UIChildren>
75
+ );
76
+ }
77
+ return <></>;
78
+ };
79
+
80
+ const Draw = () => {
81
+ if (props.elements) {
82
+ return (
83
+ <>
84
+ {Object.entries(props.elements).map((t: any, k) => {
85
+ return <UIElement crud={crud} {...t[1]} />;
86
+ })}
87
+ </>
88
+ );
89
+ }
90
+ return (
91
+ <>
92
+ {React.Children.map(props.children, child => {
93
+ return <Paint child={child}></Paint>;
94
+ })}
95
+ </>
96
+ );
97
+ };
98
+
99
+ if (props.transient) {
100
+ return <Draw />;
101
+ }
102
+
103
+ if (Utils.isEmpty(props.children) && Utils.isEmpty(props.elements)) {
104
+ return <></>;
105
+ }
106
+
107
+ const getStyle = (part?: string) => {
108
+ let key = Utils.nvl(part, 'root');
109
+ let def = styles[key];
110
+
111
+ return { ...def, ...scope.getStyle(part) };
112
+ };
113
+
114
+ return (
115
+ <>
116
+ <View style={getStyle(name)}>
117
+ <Draw />
118
+ </View>
119
+ </>
120
+ );
121
+ }
122
+
123
+ const styles = StyleSheet.create({
124
+ child: { width: '100%' },
125
+ inner: { width: '100%' },
126
+ });
@@ -1,14 +1,14 @@
1
- import { ChildType } from 'react-crud-utils';
2
- import AutoComplete from './core/UIAutoComplete';
3
-
4
- export default function UIComplete({
5
- defaultsInput,
6
- defaultsUI,
7
- scope,
8
- }: ChildType) {
9
- return (
10
- <>
11
- <AutoComplete {...defaultsInput} {...defaultsUI} />
12
- </>
13
- );
14
- }
1
+ import { ChildType } from 'react-crud-utils';
2
+ import AutoComplete from './core/UIAutoComplete';
3
+
4
+ export default function UIComplete({
5
+ defaultsInput,
6
+ defaultsUI,
7
+ scope,
8
+ }: ChildType) {
9
+ return (
10
+ <>
11
+ <AutoComplete {...defaultsInput} {...defaultsUI} />
12
+ </>
13
+ );
14
+ }