react-crud-mobile 1.3.86 → 1.3.87
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/dist/react-crud-mobile.cjs.development.js +50 -53
- package/dist/react-crud-mobile.cjs.development.js.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js +50 -53
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/UIElement.tsx +39 -46
- package/src/elements/core/UIModal.tsx +7 -7
|
@@ -1337,7 +1337,7 @@ function UIToast() {
|
|
|
1337
1337
|
|
|
1338
1338
|
var _excluded = ["scope", "open", "dialog"];
|
|
1339
1339
|
function UIModal(_ref) {
|
|
1340
|
-
var _theme$styles, _main$dialog2;
|
|
1340
|
+
var _theme$styles, _scope$currentDialog2, _main$dialog2;
|
|
1341
1341
|
var scope = _ref.scope,
|
|
1342
1342
|
open = _ref.open,
|
|
1343
1343
|
dialog = _ref.dialog,
|
|
@@ -1359,9 +1359,10 @@ function UIModal(_ref) {
|
|
|
1359
1359
|
return _extends({}, scope.getStyle(part, st));
|
|
1360
1360
|
};
|
|
1361
1361
|
var onClose = function onClose() {
|
|
1362
|
+
var _scope$currentDialog;
|
|
1362
1363
|
scope.close({
|
|
1363
1364
|
scope: scope,
|
|
1364
|
-
crud: scope.currentDialog,
|
|
1365
|
+
crud: (_scope$currentDialog = scope.currentDialog) == null ? void 0 : _scope$currentDialog.crud,
|
|
1365
1366
|
event: {}
|
|
1366
1367
|
});
|
|
1367
1368
|
};
|
|
@@ -1397,7 +1398,9 @@ function UIModal(_ref) {
|
|
|
1397
1398
|
scope: scope
|
|
1398
1399
|
}, def));
|
|
1399
1400
|
main.dialog = d;
|
|
1400
|
-
scope.currentDialog =
|
|
1401
|
+
scope.currentDialog = {
|
|
1402
|
+
crud: d
|
|
1403
|
+
};
|
|
1401
1404
|
toggle(true);
|
|
1402
1405
|
scope.update();
|
|
1403
1406
|
};
|
|
@@ -1412,7 +1415,7 @@ function UIModal(_ref) {
|
|
|
1412
1415
|
}
|
|
1413
1416
|
scope.update();
|
|
1414
1417
|
};
|
|
1415
|
-
var curr = scope.currentDialog;
|
|
1418
|
+
var curr = (_scope$currentDialog2 = scope.currentDialog) == null ? void 0 : _scope$currentDialog2.crud;
|
|
1416
1419
|
if (!curr) {
|
|
1417
1420
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1418
1421
|
}
|
|
@@ -1427,17 +1430,17 @@ function UIModal(_ref) {
|
|
|
1427
1430
|
var defaults = {
|
|
1428
1431
|
color: color
|
|
1429
1432
|
};
|
|
1430
|
-
var key =
|
|
1433
|
+
var key = curr.name + "-" + index;
|
|
1431
1434
|
var Content = function Content() {
|
|
1432
1435
|
if (dialog != null && dialog.component) {
|
|
1433
1436
|
var Aux = dialog == null ? void 0 : dialog.component;
|
|
1434
1437
|
return /*#__PURE__*/jsxRuntime.jsx(Aux, {
|
|
1435
|
-
crud:
|
|
1438
|
+
crud: curr
|
|
1436
1439
|
});
|
|
1437
1440
|
}
|
|
1438
1441
|
return /*#__PURE__*/jsxRuntime.jsx(UIChildren, {
|
|
1439
1442
|
scope: scope,
|
|
1440
|
-
crud:
|
|
1443
|
+
crud: curr,
|
|
1441
1444
|
children: props.children
|
|
1442
1445
|
});
|
|
1443
1446
|
};
|
|
@@ -1466,7 +1469,7 @@ function UIModal(_ref) {
|
|
|
1466
1469
|
children: label
|
|
1467
1470
|
}), !reactCrudUtils.Utils.isEmpty(headerRight) && /*#__PURE__*/jsxRuntime.jsx(UIChildren, {
|
|
1468
1471
|
scope: scope,
|
|
1469
|
-
crud:
|
|
1472
|
+
crud: curr,
|
|
1470
1473
|
"transient": true,
|
|
1471
1474
|
children: headerRight
|
|
1472
1475
|
})]
|
|
@@ -1723,11 +1726,8 @@ function UIElement(props) {
|
|
|
1723
1726
|
index = _useState2[0],
|
|
1724
1727
|
setIndex = _useState2[1];
|
|
1725
1728
|
var _useState3 = React.useState(null),
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
var _useState4 = React.useState(null),
|
|
1729
|
-
error = _useState4[0],
|
|
1730
|
-
setError = _useState4[1];
|
|
1729
|
+
error = _useState3[0],
|
|
1730
|
+
setError = _useState3[1];
|
|
1731
1731
|
scope.compile(props);
|
|
1732
1732
|
crud = scope.crud;
|
|
1733
1733
|
var options = scope.getOptions();
|
|
@@ -2031,6 +2031,7 @@ function UIElement(props) {
|
|
|
2031
2031
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
2032
2032
|
};
|
|
2033
2033
|
var Container = function Container() {
|
|
2034
|
+
var _scope$currentDialog, _scope$currentDialog2;
|
|
2034
2035
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2035
2036
|
children: [isShowLabel() && /*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
|
|
2036
2037
|
style: getStyle('outerLabel', {
|
|
@@ -2067,12 +2068,11 @@ function UIElement(props) {
|
|
|
2067
2068
|
})), scope.isType('dialog') && /*#__PURE__*/jsxRuntime.jsx(UIModal, _extends({}, props, {
|
|
2068
2069
|
scope: scope,
|
|
2069
2070
|
crud: crud
|
|
2070
|
-
})),
|
|
2071
|
+
})), ((_scope$currentDialog = scope.currentDialog) == null ? void 0 : _scope$currentDialog.component) && /*#__PURE__*/jsxRuntime.jsx(UIModal, _extends({}, props, {
|
|
2071
2072
|
scope: scope,
|
|
2072
|
-
crud:
|
|
2073
|
+
crud: (_scope$currentDialog2 = scope.currentDialog) == null ? void 0 : _scope$currentDialog2.crud,
|
|
2073
2074
|
open: true,
|
|
2074
|
-
dialog:
|
|
2075
|
-
children: dialog.component
|
|
2075
|
+
dialog: scope.currentDialog
|
|
2076
2076
|
})), scope.isType('chart') && /*#__PURE__*/jsxRuntime.jsx(ElChart, _extends({}, props, {
|
|
2077
2077
|
scope: scope,
|
|
2078
2078
|
crud: crud
|
|
@@ -2120,42 +2120,39 @@ function UIElement(props) {
|
|
|
2120
2120
|
});
|
|
2121
2121
|
};
|
|
2122
2122
|
scope.dialogOpen = function (args) {
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
};
|
|
2157
|
-
setDialog(dialog);
|
|
2158
|
-
}
|
|
2123
|
+
var crud = args.crud,
|
|
2124
|
+
event = args.event;
|
|
2125
|
+
var name = scope.getName('modal');
|
|
2126
|
+
var edit = args.edit === true;
|
|
2127
|
+
var def = {};
|
|
2128
|
+
var rowItem = null;
|
|
2129
|
+
var main = reactCrudUtils.ViewUtils.getCrud('view');
|
|
2130
|
+
if (crud.is('row')) {
|
|
2131
|
+
def.parent = crud.parent.parent;
|
|
2132
|
+
def.search = crud.parent;
|
|
2133
|
+
rowItem = crud.data;
|
|
2134
|
+
} else if (crud.is('search')) {
|
|
2135
|
+
def.parent = crud.parent;
|
|
2136
|
+
def.search = crud;
|
|
2137
|
+
}
|
|
2138
|
+
var data = reactCrudUtils.Utils.nvl(args.item, rowItem, {});
|
|
2139
|
+
var component = event == null ? void 0 : event.component;
|
|
2140
|
+
if (component) {
|
|
2141
|
+
var d = reactCrudUtils.CrudUtils.create('dialog', _extends({
|
|
2142
|
+
parent: crud,
|
|
2143
|
+
root: crud,
|
|
2144
|
+
name: name,
|
|
2145
|
+
dialog: main.dialog,
|
|
2146
|
+
data: data,
|
|
2147
|
+
edit: edit,
|
|
2148
|
+
scope: scope
|
|
2149
|
+
}, def));
|
|
2150
|
+
main.dialog = d;
|
|
2151
|
+
scope.currentDialog = {
|
|
2152
|
+
component: component,
|
|
2153
|
+
crud: d
|
|
2154
|
+
};
|
|
2155
|
+
scope.update();
|
|
2159
2156
|
}
|
|
2160
2157
|
};
|
|
2161
2158
|
return /*#__PURE__*/jsxRuntime.jsx(CrudContext.Provider, {
|