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.
@@ -1371,9 +1371,6 @@ function UIModal(props) {
1371
1371
  index = _useState[0],
1372
1372
  setIndex = _useState[1];
1373
1373
  var dialog = owner.currentDialog;
1374
- var _useState2 = useState(!Utils.isEmpty(dialog)),
1375
- modalVisible = _useState2[0],
1376
- setModalVisible = _useState2[1];
1377
1374
  //v2
1378
1375
  var curr = dialog == null ? void 0 : dialog.crud;
1379
1376
  var main = ViewUtils.getCrud('view');
@@ -1384,9 +1381,7 @@ function UIModal(props) {
1384
1381
  setIndex(++index);
1385
1382
  };
1386
1383
  if (dialog.debug) console.log(dialog);
1387
- if (curr.uuid !== ((_main$dialog = main.dialog) == null || (_main$dialog = _main$dialog.crud) == null ? void 0 : _main$dialog.uuid)) {
1388
- return /*#__PURE__*/jsx(Fragment, {});
1389
- }
1384
+ var modalVisible = curr.uuid === ((_main$dialog = main.dialog) == null || (_main$dialog = _main$dialog.crud) == null ? void 0 : _main$dialog.uuid);
1390
1385
  var scope = dialog.scope;
1391
1386
  var label = scope.getLabel();
1392
1387
  var theme = scope.getTheme();
@@ -1405,10 +1400,6 @@ function UIModal(props) {
1405
1400
  event: {}
1406
1401
  });
1407
1402
  };
1408
- scope.toggleDialog = function (vis) {
1409
- modalVisible = vis;
1410
- setModalVisible(modalVisible);
1411
- };
1412
1403
  scope.put('scrollRef', scrollRef);
1413
1404
  var original = owner.original;
1414
1405
  ComponentUtils.setViewScope(scope);
@@ -2288,10 +2279,8 @@ function UIElement(props) {
2288
2279
  debug: event.debug
2289
2280
  };
2290
2281
  main.dialog = dialog;
2291
- scope.toggleDialog(true);
2292
2282
  scope.currentDialog = dialog;
2293
- dialogScope.currentDialog = dialog;
2294
- dialogScope.toggleDialog(true);
2283
+ if (parent) parent.update == null || parent.update();
2295
2284
  scope.update();
2296
2285
  };
2297
2286
  scope.dialogHide = function (args) {
@@ -2306,14 +2295,16 @@ function UIElement(props) {
2306
2295
  var _main$dialog2;
2307
2296
  (_main$dialog2 = main.dialog) == null || _main$dialog2.crud.scope.update();
2308
2297
  }
2309
- scope.toggleDialog(false);
2310
2298
  scope.update();
2311
- var close = old.close;
2312
- if (parentScope && close) {
2313
- if (close != null && close.debug) console.log('Fechando');
2314
- parentScope.call('close', {
2315
- close: close
2316
- });
2299
+ if (parentScope) {
2300
+ var close = old.close;
2301
+ parentScope.update();
2302
+ if (close) {
2303
+ if (close != null && close.debug) console.log('Fechando');
2304
+ parentScope.call('close', {
2305
+ close: close
2306
+ });
2307
+ }
2317
2308
  }
2318
2309
  };
2319
2310
  return /*#__PURE__*/jsx(CrudContext.Provider, {