react-crud-mobile 1.3.248 → 1.3.250

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.
@@ -4,5 +4,5 @@ interface UIModalType extends ChildType {
4
4
  open?: boolean;
5
5
  dialog?: any;
6
6
  }
7
- export default function UIModal({ scope, open, dialog, ...props }: UIModalType): import("react").JSX.Element;
7
+ export default function UIModal({ scope, ...props }: UIModalType): import("react").JSX.Element;
8
8
  export {};
@@ -1373,20 +1373,17 @@ function UIToast() {
1373
1373
  });
1374
1374
  }
1375
1375
 
1376
- var _excluded = ["scope", "open", "dialog"];
1376
+ var _excluded = ["scope"];
1377
1377
  function UIModal(_ref) {
1378
1378
  var _theme$styles, _scope$currentDialog2, _main$dialog;
1379
1379
  var scope = _ref.scope,
1380
- open = _ref.open,
1381
- dialog = _ref.dialog,
1382
1380
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
1383
- var _useState = React.useState(open === true),
1381
+ var _useState = React.useState(true),
1384
1382
  modalVisible = _useState[0],
1385
1383
  setModalVisible = _useState[1];
1386
1384
  var _useState2 = React.useState(0),
1387
- index = _useState2[0],
1388
- setIndex = _useState2[1];
1389
- //v1
1385
+ index = _useState2[0];
1386
+ var dialog = scope == null ? void 0 : scope.currentDialog;
1390
1387
  var label = scope.getLabel();
1391
1388
  var theme = scope.getTheme();
1392
1389
  var headerStyle = reactCrudUtils.Utils.nvl((_theme$styles = theme.styles) == null || (_theme$styles = _theme$styles.defaults) == null ? void 0 : _theme$styles.header, {});
@@ -1407,11 +1404,9 @@ function UIModal(_ref) {
1407
1404
  modalVisible = vis;
1408
1405
  setModalVisible(modalVisible);
1409
1406
  };
1410
- scope.update = function () {
1411
- setIndex(++index);
1412
- };
1413
1407
  var curr = (_scope$currentDialog2 = scope.currentDialog) == null ? void 0 : _scope$currentDialog2.crud;
1414
1408
  var main = reactCrudUtils.ViewUtils.getCrud('view');
1409
+ if (!scope.isType('dialog') && !(scope != null && scope.currentDialog)) return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
1415
1410
  if (!curr) {
1416
1411
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
1417
1412
  }
@@ -2140,7 +2135,6 @@ function UIElement(props) {
2140
2135
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
2141
2136
  };
2142
2137
  var Container = function Container() {
2143
- var _scope$currentDialog2, _scope$currentDialog3, _scope$currentDialog4;
2144
2138
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2145
2139
  children: [isShowLabel() && /*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
2146
2140
  style: getStyle('outerLabel', {
@@ -2178,15 +2172,7 @@ function UIElement(props) {
2178
2172
  })), scope.isType('order') && /*#__PURE__*/jsxRuntime.jsx(UIOrder, _extends({}, props, {
2179
2173
  scope: scope,
2180
2174
  crud: crud
2181
- })), scope.isType('dialog') && /*#__PURE__*/jsxRuntime.jsx(UIModal, _extends({}, props, {
2182
- scope: scope,
2183
- crud: crud
2184
- })), ((_scope$currentDialog2 = scope.currentDialog) == null ? void 0 : _scope$currentDialog2.component) && /*#__PURE__*/jsxRuntime.jsx(UIModal, {
2185
- scope: (_scope$currentDialog3 = scope.currentDialog) == null ? void 0 : _scope$currentDialog3.scope,
2186
- crud: (_scope$currentDialog4 = scope.currentDialog) == null ? void 0 : _scope$currentDialog4.crud,
2187
- open: true,
2188
- dialog: scope.currentDialog
2189
- }), scope.isType('chart') && /*#__PURE__*/jsxRuntime.jsx(ElChart, _extends({}, props, {
2175
+ })), scope.isType('chart') && /*#__PURE__*/jsxRuntime.jsx(ElChart, _extends({}, props, {
2190
2176
  scope: scope,
2191
2177
  crud: crud
2192
2178
  })), scope.isType('tabs') && /*#__PURE__*/jsxRuntime.jsx(ElTabs, _extends({}, props, {
@@ -2199,6 +2185,9 @@ function UIElement(props) {
2199
2185
  scope: scope,
2200
2186
  crud: crud,
2201
2187
  style: getStyle('inner')
2188
+ })), /*#__PURE__*/jsxRuntime.jsx(UIModal, _extends({}, props, {
2189
+ scope: scope,
2190
+ crud: crud
2202
2191
  }))]
2203
2192
  });
2204
2193
  };