react-crud-mobile 1.3.253 → 1.3.254

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.253",
3
+ "version": "1.3.254",
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.418",
49
+ "react-crud-utils": "^0.1.419",
50
50
  "react-dom": "19.1.0",
51
51
  "react-native": "0.81.4",
52
52
  "react-native-draggable-flatlist": "^4.0.3",
@@ -542,19 +542,6 @@ export default function UIElement(props: ElementType) {
542
542
  <UIOrder {...props} scope={scope} crud={crud} />
543
543
  )}
544
544
 
545
- {scope.isType('dialog') && (
546
- <UIModal {...props} scope={scope} crud={crud} />
547
- )}
548
-
549
- {scope.currentDialog?.component && (
550
- <UIModal
551
- scope={scope.currentDialog?.scope}
552
- crud={scope.currentDialog?.crud}
553
- open
554
- dialog={scope.currentDialog}
555
- />
556
- )}
557
-
558
545
  {scope.isType('chart') && (
559
546
  <ElChart {...props} scope={scope} crud={crud} />
560
547
  )}
@@ -574,6 +561,7 @@ export default function UIElement(props: ElementType) {
574
561
  style={getStyle('inner')}
575
562
  />
576
563
  )}
564
+ <UIModal {...props} scope={scope} crud={crud} />
577
565
  </>
578
566
  );
579
567
  };
@@ -26,14 +26,10 @@ interface UIModalType extends ChildType {
26
26
  dialog?: any;
27
27
  }
28
28
 
29
- export default function UIModal({
30
- scope,
31
- open,
32
- dialog,
33
- ...props
34
- }: UIModalType) {
35
- let [modalVisible, setModalVisible] = useState(open === true);
29
+ export default function UIModal({ scope, ...props }: UIModalType) {
30
+ let [modalVisible, setModalVisible] = useState(false);
36
31
  let [index, setIndex] = useState(0);
32
+ let dialog = scope.currentDialog;
37
33
  //v1
38
34
 
39
35
  const label = scope.getLabel();
@@ -48,7 +44,7 @@ export default function UIModal({
48
44
  };
49
45
 
50
46
  const onClose = () => {
51
- scope.close({ scope, crud: scope.currentDialog?.crud, event: {} });
47
+ scope.close({ scope, crud: dialog?.crud, event: {} });
52
48
  };
53
49
 
54
50
  scope.toggleDialog = vis => {
@@ -56,10 +52,10 @@ export default function UIModal({
56
52
  setModalVisible(modalVisible);
57
53
  };
58
54
 
59
- let curr = scope.currentDialog?.crud;
55
+ let curr = dialog?.crud;
60
56
  let main = ViewUtils.getCrud('view');
61
57
 
62
- if (!curr) {
58
+ if (!curr || dialog) {
63
59
  return <></>;
64
60
  }
65
61