react-crud-mobile 1.3.264 → 1.3.266

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.264",
3
+ "version": "1.3.266",
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.423",
49
+ "react-crud-utils": "^0.1.424",
50
50
  "react-dom": "19.1.0",
51
51
  "react-native": "0.81.4",
52
52
  "react-native-draggable-flatlist": "^4.0.3",
@@ -692,12 +692,9 @@ export default function UIElement(props: ElementType) {
692
692
  };
693
693
 
694
694
  main.dialog = dialog;
695
- scope.toggleDialog(true);
696
695
  scope.currentDialog = dialog;
697
696
 
698
- dialogScope.currentDialog = dialog;
699
- dialogScope.toggleDialog(true);
700
-
697
+ if (parent) parent.update?.();
701
698
  scope.update();
702
699
  };
703
700
 
@@ -714,14 +711,17 @@ export default function UIElement(props: ElementType) {
714
711
  if (main.dialog?.crud?.scope) {
715
712
  main.dialog?.crud.scope.update();
716
713
  }
717
- scope.toggleDialog(false);
718
714
  scope.update();
719
715
 
720
- const close = old.close;
716
+ if (parentScope) {
717
+ const close = old.close;
718
+
719
+ parentScope.update();
721
720
 
722
- if (parentScope && close) {
723
- if (close?.debug) console.log('Fechando');
724
- parentScope.call('close', { close });
721
+ if (close) {
722
+ if (close?.debug) console.log('Fechando');
723
+ parentScope.call('close', { close });
724
+ }
725
725
  }
726
726
  };
727
727
 
@@ -30,7 +30,6 @@ export default function UIModal(props: UIModalType) {
30
30
  let owner = props.scope;
31
31
  let [index, setIndex] = useState(0);
32
32
  let dialog = owner.currentDialog;
33
- let [modalVisible, setModalVisible] = useState(!Utils.isEmpty(dialog));
34
33
 
35
34
  //v2
36
35
 
@@ -47,10 +46,7 @@ export default function UIModal(props: UIModalType) {
47
46
 
48
47
  if (dialog.debug) console.log(dialog);
49
48
 
50
- if (curr.uuid !== main.dialog?.crud?.uuid) {
51
- return <></>;
52
- }
53
-
49
+ const modalVisible = curr.uuid === main.dialog?.crud?.uuid;
54
50
  const scope = dialog.scope;
55
51
  const label = scope.getLabel();
56
52
  const theme = scope.getTheme();
@@ -69,11 +65,6 @@ export default function UIModal(props: UIModalType) {
69
65
  scope.close({ scope, crud: dialog?.crud, event: {} });
70
66
  };
71
67
 
72
- scope.toggleDialog = vis => {
73
- modalVisible = vis;
74
- setModalVisible(modalVisible);
75
- };
76
-
77
68
  scope.put('scrollRef', scrollRef);
78
69
 
79
70
  const original = owner.original;