react-crud-mobile 1.3.159 → 1.3.161

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.159",
3
+ "version": "1.3.161",
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.387",
49
+ "react-crud-utils": "^0.1.388",
50
50
  "react-dom": "19.1.0",
51
51
  "react-native": "0.81.4",
52
52
  "react-native-draggable-flatlist": "^4.0.3",
@@ -21,6 +21,7 @@ import {
21
21
  ComponentUtils,
22
22
  CrudUtils,
23
23
  ViewUtils,
24
+ Scope,
24
25
  } from 'react-crud-utils';
25
26
  import UILink from './core/UILink';
26
27
  import UIIcon from './core/UIIcon';
@@ -637,6 +638,8 @@ export default function UIElement(props: ElementType) {
637
638
  type: 'dialog',
638
639
  };
639
640
 
641
+ let close = event.dialog?.close;
642
+
640
643
  if (typeof event.dialog === 'object') {
641
644
  el = { ...el, ...event.dialog };
642
645
  }
@@ -653,7 +656,7 @@ export default function UIElement(props: ElementType) {
653
656
  ...el,
654
657
  owner: scope,
655
658
  });
656
- let dialog = { crud: d, parent, component, scope: dialogScope };
659
+ let dialog = { crud: d, parent, component, scope: dialogScope, close };
657
660
 
658
661
  main.dialog = dialog;
659
662
  scope.toggleDialog(true);
@@ -668,6 +671,7 @@ export default function UIElement(props: ElementType) {
668
671
  scope.dialogHide = (args?: MethodType) => {
669
672
  let main = ViewUtils.getCrud('view');
670
673
  let old = scope.currentDialog;
674
+ let parentScope = old.scope.parent as Scope;
671
675
 
672
676
  main.dialog = Utils.nvl(old.parent, null);
673
677
  scope.currentDialog = null;
@@ -677,6 +681,13 @@ export default function UIElement(props: ElementType) {
677
681
  }
678
682
  scope.toggleDialog(false);
679
683
  scope.update();
684
+
685
+ const close = old.close;
686
+
687
+ if (parentScope && close) {
688
+ if (close?.debug) console.log('Fechando');
689
+ parentScope.call('close', { close });
690
+ }
680
691
  };
681
692
 
682
693
  return (