react-crud-mobile 1.3.251 → 1.3.253

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.251",
3
+ "version": "1.3.253",
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.417",
49
+ "react-crud-utils": "^0.1.418",
50
50
  "react-dom": "19.1.0",
51
51
  "react-native": "0.81.4",
52
52
  "react-native-draggable-flatlist": "^4.0.3",
@@ -541,6 +541,20 @@ export default function UIElement(props: ElementType) {
541
541
  {scope.isType('order') && (
542
542
  <UIOrder {...props} scope={scope} crud={crud} />
543
543
  )}
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
+
544
558
  {scope.isType('chart') && (
545
559
  <ElChart {...props} scope={scope} crud={crud} />
546
560
  )}
@@ -560,7 +574,6 @@ export default function UIElement(props: ElementType) {
560
574
  style={getStyle('inner')}
561
575
  />
562
576
  )}
563
- <UIModal {...props} scope={scope} crud={crud} />
564
577
  </>
565
578
  );
566
579
  };
@@ -26,12 +26,16 @@ interface UIModalType extends ChildType {
26
26
  dialog?: any;
27
27
  }
28
28
 
29
- //v1
30
- export default function UIModal({ scope, ...props }: UIModalType) {
31
- let [modalVisible, setModalVisible] = useState(true);
29
+ export default function UIModal({
30
+ scope,
31
+ open,
32
+ dialog,
33
+ ...props
34
+ }: UIModalType) {
35
+ let [modalVisible, setModalVisible] = useState(open === true);
32
36
  let [index, setIndex] = useState(0);
37
+ //v1
33
38
 
34
- const dialog = scope?.currentDialog;
35
39
  const label = scope.getLabel();
36
40
  const theme = scope.getTheme();
37
41
  const headerStyle = Utils.nvl(theme.styles?.defaults?.header, {});
@@ -55,8 +59,6 @@ export default function UIModal({ scope, ...props }: UIModalType) {
55
59
  let curr = scope.currentDialog?.crud;
56
60
  let main = ViewUtils.getCrud('view');
57
61
 
58
- if (!scope.isType('dialog') && !scope?.currentDialog) return <></>;
59
-
60
62
  if (!curr) {
61
63
  return <></>;
62
64
  }