react-crud-mobile 1.3.259 → 1.3.261

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.259",
3
+ "version": "1.3.261",
4
4
  "license": "MIT",
5
5
  "description": "Uma biblioteca de componentes para React Native",
6
6
  "main": "dist/index.js",
@@ -26,17 +26,34 @@ interface UIModalType extends ChildType {
26
26
  dialog?: any;
27
27
  }
28
28
 
29
- export default function UIModal({ scope, ...props }: UIModalType) {
29
+ export default function UIModal(props: UIModalType) {
30
+ let owner = props.scope;
30
31
  let [index, setIndex] = useState(0);
31
- let dialog = scope.currentDialog;
32
+ let dialog = owner.currentDialog;
32
33
  let [modalVisible, setModalVisible] = useState(!Utils.isEmpty(dialog));
33
34
 
34
35
  //v1
35
36
 
37
+ let curr = dialog?.crud;
38
+ let main = ViewUtils.getCrud('view');
39
+
40
+ if (!dialog) {
41
+ return <></>;
42
+ }
43
+
44
+ if (dialog.debug) console.log(dialog);
45
+
46
+ if (curr.uuid !== main.dialog?.crud?.uuid) {
47
+ return <></>;
48
+ }
49
+
50
+ const scope = dialog.scope;
36
51
  const label = scope.getLabel();
37
52
  const theme = scope.getTheme();
38
53
  const headerStyle = Utils.nvl(theme.styles?.defaults?.header, {});
39
54
  const scrollRef = useRef(null);
55
+ const headerRight = ComponentUtils.getDefine(props, 'header', 'right');
56
+ const bottom = ComponentUtils.getDefine(props, 'bottom');
40
57
 
41
58
  const style = (part: string, extra?: any) => {
42
59
  let st = { ...styles[part], ...extra };
@@ -53,25 +70,9 @@ export default function UIModal({ scope, ...props }: UIModalType) {
53
70
  setModalVisible(modalVisible);
54
71
  };
55
72
 
56
- let curr = dialog?.crud;
57
- let main = ViewUtils.getCrud('view');
58
-
59
- if (!dialog) {
60
- return <></>;
61
- }
62
-
63
- if (dialog.debug) console.log(dialog);
64
-
65
- if (curr.uuid !== main.dialog?.crud?.uuid) {
66
- return <></>;
67
- }
68
-
69
- const headerRight = ComponentUtils.getDefine(props, 'header', 'right');
70
- const bottom = ComponentUtils.getDefine(props, 'bottom');
71
-
72
73
  scope.put('scrollRef', scrollRef);
73
74
 
74
- const original = scope.original;
75
+ const original = owner.original;
75
76
 
76
77
  ComponentUtils.setViewScope(scope);
77
78