react-crud-mobile 1.0.342 → 1.0.343

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,5 +1,5 @@
1
1
  {
2
- "version": "1.0.342",
2
+ "version": "1.0.343",
3
3
  "license": "MIT",
4
4
  "description": "Uma biblioteca de componentes para React Native",
5
5
  "main": "dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "@types/react-native": "^0.72.0",
51
51
  "babel-plugin-module-resolver": "^5.0.0",
52
52
  "react": "^18.3.1",
53
- "react-crud-utils": "^0.1.93",
53
+ "react-crud-utils": "^0.1.94",
54
54
  "react-dom": "^18.3.1",
55
55
  "react-native": "0.76.9",
56
56
  "react-native-screens": "^4.10.0",
@@ -13,6 +13,7 @@ import UIInclude from './core/UIInclude';
13
13
 
14
14
  const UI = {
15
15
  List: (props: ListType) => <UIElement {...props} type="list" />,
16
+ Row: (props: UserType) => <UIElement {...props} type="row" />,
16
17
  Value: (props: UserType) => <UIElement {...props} type="value" />,
17
18
  Label: (props: UserType) => <UIElement {...props} type="label" />,
18
19
  Repeat: (props: ListType) => (
@@ -22,6 +22,7 @@ import { Image, Linking, StyleSheet, Text, View } from 'react-native';
22
22
  import UIList from './core/UIList';
23
23
  import UIToggle from './core/UIToggle';
24
24
  import UIQuantity from './core/UIQuantity';
25
+ import UIModal from './core/UIModal';
25
26
 
26
27
  export default function UIElement(props: ElementType) {
27
28
  let [scope] = useState(ScopeUtils.create(props));
@@ -39,6 +40,7 @@ export default function UIElement(props: ElementType) {
39
40
 
40
41
  let router: any = {
41
42
  list: UIList,
43
+ dialog: UIModal,
42
44
  repeat: UIList,
43
45
  tabs: ElTabs,
44
46
  chart: ElChart,
@@ -12,22 +12,27 @@ import {
12
12
  import UIChildren from '../UIChildren';
13
13
 
14
14
  export default function UIModal(props: ChildType) {
15
- const [modalVisible, setModalVisible] = useState(false);
15
+ let [modalVisible, setModalVisible] = useState(false);
16
+
16
17
  const scope = props.scope;
17
18
  const label = scope.getLabel();
18
19
  const theme = useTheme();
19
20
 
20
- const handlePress = () => {
21
- setModalVisible(!modalVisible);
21
+ const style = (part: string, extra?: any) => {
22
+ return { ...styles[part], ...scope.getStyle(part), ...extra };
22
23
  };
23
24
 
24
- const onClick = ({ crud, value }: MethodType) => {
25
- scope.changeValue(value);
26
- handlePress();
25
+ const toggle = vis => {
26
+ modalVisible = vis;
27
+ setModalVisible(modalVisible);
27
28
  };
28
29
 
29
- const style = (part: string, extra?: any) => {
30
- return { ...styles[part], ...scope.getStyle(part), ...extra };
30
+ scope.show = () => {
31
+ toggle(true);
32
+ };
33
+
34
+ scope.hide = () => {
35
+ toggle(true);
31
36
  };
32
37
 
33
38
  return (