react-crud-mobile 1.3.115 → 1.3.117

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.
@@ -1356,6 +1356,7 @@ function UIModal(_ref) {
1356
1356
  index = _useState2[0],
1357
1357
  setIndex = _useState2[1];
1358
1358
  //v6
1359
+ var label = scope.getLabel();
1359
1360
  var theme = scope.getTheme();
1360
1361
  var headerStyle = reactCrudUtils.Utils.nvl((_theme$styles = theme.styles) == null || (_theme$styles = _theme$styles.defaults) == null ? void 0 : _theme$styles.header, {});
1361
1362
  var scrollRef = React.useRef(null);
@@ -1386,15 +1387,6 @@ function UIModal(_ref) {
1386
1387
  if (curr.uuid !== ((_main$dialog = main.dialog) == null || (_main$dialog = _main$dialog.crud) == null ? void 0 : _main$dialog.uuid)) {
1387
1388
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
1388
1389
  }
1389
- var dialogLabel = reactCrudUtils.Utils.nvl(dialog == null ? void 0 : dialog.label, scope.getLabel());
1390
- var _useState3 = React.useState(reactCrudUtils.ScopeUtils.create({
1391
- parent: scope,
1392
- crud: curr,
1393
- label: dialogLabel
1394
- })),
1395
- dialogScope = _useState3[0];
1396
- console.log(dialogLabel); //v2
1397
- var label = dialogScope.getLabel();
1398
1390
  var headerRight = reactCrudUtils.ComponentUtils.getDefine(props, 'header', 'right');
1399
1391
  var bottom = reactCrudUtils.ComponentUtils.getDefine(props, 'bottom');
1400
1392
  scope.put('scrollRef', scrollRef);
@@ -2006,7 +1998,7 @@ function UIElement(props) {
2006
1998
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
2007
1999
  };
2008
2000
  var Container = function Container() {
2009
- var _scope$currentDialog2, _scope$currentDialog3;
2001
+ var _scope$currentDialog2, _scope$currentDialog3, _scope$currentDialog4;
2010
2002
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2011
2003
  children: [isShowLabel() && /*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
2012
2004
  style: getStyle('outerLabel', {
@@ -2044,8 +2036,8 @@ function UIElement(props) {
2044
2036
  scope: scope,
2045
2037
  crud: crud
2046
2038
  })), ((_scope$currentDialog2 = scope.currentDialog) == null ? void 0 : _scope$currentDialog2.component) && /*#__PURE__*/jsxRuntime.jsx(UIModal, {
2047
- scope: scope,
2048
- crud: (_scope$currentDialog3 = scope.currentDialog) == null ? void 0 : _scope$currentDialog3.crud,
2039
+ scope: (_scope$currentDialog3 = scope.currentDialog) == null ? void 0 : _scope$currentDialog3.scope,
2040
+ crud: (_scope$currentDialog4 = scope.currentDialog) == null ? void 0 : _scope$currentDialog4.crud,
2049
2041
  open: true,
2050
2042
  dialog: scope.currentDialog
2051
2043
  }), scope.isType('chart') && /*#__PURE__*/jsxRuntime.jsx(ElChart, _extends({}, props, {
@@ -2095,7 +2087,6 @@ function UIElement(props) {
2095
2087
  });
2096
2088
  };
2097
2089
  scope.dialogShow = function (args) {
2098
- var _args$event, _args$event2;
2099
2090
  var main = reactCrudUtils.ViewUtils.getCrud('view');
2100
2091
  var parent = main.dialog;
2101
2092
  var crud = args.crud;
@@ -2103,8 +2094,8 @@ function UIElement(props) {
2103
2094
  var edit = args.edit === true;
2104
2095
  var def = {};
2105
2096
  var rowItem = null;
2106
- var label = args == null || (_args$event = args.event) == null ? void 0 : _args$event.title;
2107
- var component = args == null || (_args$event2 = args.event) == null ? void 0 : _args$event2.component;
2097
+ var event = reactCrudUtils.Utils.nvl(args == null ? void 0 : args.event, {});
2098
+ var component = event == null ? void 0 : event.component;
2108
2099
  if (crud.is('row')) {
2109
2100
  def.parent = crud.parent.parent;
2110
2101
  def.search = crud.parent;
@@ -2122,11 +2113,22 @@ function UIElement(props) {
2122
2113
  edit: edit,
2123
2114
  scope: scope
2124
2115
  }, def));
2116
+ var el = {};
2117
+ if (typeof event.dialog === 'object') {
2118
+ el = _extends({}, event.dialog);
2119
+ }
2120
+ if (event.header) el.header = event.header;
2121
+ if (event.label) el.label = event.label;
2122
+ if (event.title) el.title = event.title;
2123
+ var dialogScope = reactCrudUtils.ScopeUtils.create(_extends({
2124
+ parent: scope,
2125
+ crud: d
2126
+ }, el));
2125
2127
  var dialog = {
2126
2128
  crud: d,
2127
2129
  parent: parent,
2128
2130
  component: component,
2129
- label: label
2131
+ scope: dialogScope
2130
2132
  };
2131
2133
  main.dialog = dialog;
2132
2134
  scope.toggleDialog(true);