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