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
|
@@ -1328,7 +1328,7 @@ function UIToast() {
|
|
|
1328
1328
|
|
|
1329
1329
|
var _excluded = ["scope", "open", "dialog"];
|
|
1330
1330
|
function UIModal(_ref) {
|
|
1331
|
-
var _theme$styles, _main$dialog2;
|
|
1331
|
+
var _theme$styles, _scope$currentDialog2, _main$dialog2;
|
|
1332
1332
|
var scope = _ref.scope,
|
|
1333
1333
|
open = _ref.open,
|
|
1334
1334
|
dialog = _ref.dialog,
|
|
@@ -1350,9 +1350,10 @@ function UIModal(_ref) {
|
|
|
1350
1350
|
return _extends({}, scope.getStyle(part, st));
|
|
1351
1351
|
};
|
|
1352
1352
|
var onClose = function onClose() {
|
|
1353
|
+
var _scope$currentDialog;
|
|
1353
1354
|
scope.close({
|
|
1354
1355
|
scope: scope,
|
|
1355
|
-
crud: scope.currentDialog,
|
|
1356
|
+
crud: (_scope$currentDialog = scope.currentDialog) == null ? void 0 : _scope$currentDialog.crud,
|
|
1356
1357
|
event: {}
|
|
1357
1358
|
});
|
|
1358
1359
|
};
|
|
@@ -1388,7 +1389,9 @@ function UIModal(_ref) {
|
|
|
1388
1389
|
scope: scope
|
|
1389
1390
|
}, def));
|
|
1390
1391
|
main.dialog = d;
|
|
1391
|
-
scope.currentDialog =
|
|
1392
|
+
scope.currentDialog = {
|
|
1393
|
+
crud: d
|
|
1394
|
+
};
|
|
1392
1395
|
toggle(true);
|
|
1393
1396
|
scope.update();
|
|
1394
1397
|
};
|
|
@@ -1403,7 +1406,7 @@ function UIModal(_ref) {
|
|
|
1403
1406
|
}
|
|
1404
1407
|
scope.update();
|
|
1405
1408
|
};
|
|
1406
|
-
var curr = scope.currentDialog;
|
|
1409
|
+
var curr = (_scope$currentDialog2 = scope.currentDialog) == null ? void 0 : _scope$currentDialog2.crud;
|
|
1407
1410
|
if (!curr) {
|
|
1408
1411
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
1409
1412
|
}
|
|
@@ -1418,17 +1421,17 @@ function UIModal(_ref) {
|
|
|
1418
1421
|
var defaults = {
|
|
1419
1422
|
color: color
|
|
1420
1423
|
};
|
|
1421
|
-
var key =
|
|
1424
|
+
var key = curr.name + "-" + index;
|
|
1422
1425
|
var Content = function Content() {
|
|
1423
1426
|
if (dialog != null && dialog.component) {
|
|
1424
1427
|
var Aux = dialog == null ? void 0 : dialog.component;
|
|
1425
1428
|
return /*#__PURE__*/jsx(Aux, {
|
|
1426
|
-
crud:
|
|
1429
|
+
crud: curr
|
|
1427
1430
|
});
|
|
1428
1431
|
}
|
|
1429
1432
|
return /*#__PURE__*/jsx(UIChildren, {
|
|
1430
1433
|
scope: scope,
|
|
1431
|
-
crud:
|
|
1434
|
+
crud: curr,
|
|
1432
1435
|
children: props.children
|
|
1433
1436
|
});
|
|
1434
1437
|
};
|
|
@@ -1457,7 +1460,7 @@ function UIModal(_ref) {
|
|
|
1457
1460
|
children: label
|
|
1458
1461
|
}), !Utils.isEmpty(headerRight) && /*#__PURE__*/jsx(UIChildren, {
|
|
1459
1462
|
scope: scope,
|
|
1460
|
-
crud:
|
|
1463
|
+
crud: curr,
|
|
1461
1464
|
"transient": true,
|
|
1462
1465
|
children: headerRight
|
|
1463
1466
|
})]
|
|
@@ -1714,11 +1717,8 @@ function UIElement(props) {
|
|
|
1714
1717
|
index = _useState2[0],
|
|
1715
1718
|
setIndex = _useState2[1];
|
|
1716
1719
|
var _useState3 = useState(null),
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
var _useState4 = useState(null),
|
|
1720
|
-
error = _useState4[0],
|
|
1721
|
-
setError = _useState4[1];
|
|
1720
|
+
error = _useState3[0],
|
|
1721
|
+
setError = _useState3[1];
|
|
1722
1722
|
scope.compile(props);
|
|
1723
1723
|
crud = scope.crud;
|
|
1724
1724
|
var options = scope.getOptions();
|
|
@@ -2022,6 +2022,7 @@ function UIElement(props) {
|
|
|
2022
2022
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
2023
2023
|
};
|
|
2024
2024
|
var Container = function Container() {
|
|
2025
|
+
var _scope$currentDialog, _scope$currentDialog2;
|
|
2025
2026
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
2026
2027
|
children: [isShowLabel() && /*#__PURE__*/jsxs(View, {
|
|
2027
2028
|
style: getStyle('outerLabel', {
|
|
@@ -2058,12 +2059,11 @@ function UIElement(props) {
|
|
|
2058
2059
|
})), scope.isType('dialog') && /*#__PURE__*/jsx(UIModal, _extends({}, props, {
|
|
2059
2060
|
scope: scope,
|
|
2060
2061
|
crud: crud
|
|
2061
|
-
})),
|
|
2062
|
+
})), ((_scope$currentDialog = scope.currentDialog) == null ? void 0 : _scope$currentDialog.component) && /*#__PURE__*/jsx(UIModal, _extends({}, props, {
|
|
2062
2063
|
scope: scope,
|
|
2063
|
-
crud:
|
|
2064
|
+
crud: (_scope$currentDialog2 = scope.currentDialog) == null ? void 0 : _scope$currentDialog2.crud,
|
|
2064
2065
|
open: true,
|
|
2065
|
-
dialog:
|
|
2066
|
-
children: dialog.component
|
|
2066
|
+
dialog: scope.currentDialog
|
|
2067
2067
|
})), scope.isType('chart') && /*#__PURE__*/jsx(ElChart, _extends({}, props, {
|
|
2068
2068
|
scope: scope,
|
|
2069
2069
|
crud: crud
|
|
@@ -2111,42 +2111,39 @@ function UIElement(props) {
|
|
|
2111
2111
|
});
|
|
2112
2112
|
};
|
|
2113
2113
|
scope.dialogOpen = function (args) {
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
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
|
-
setDialog(dialog);
|
|
2149
|
-
}
|
|
2114
|
+
var crud = args.crud,
|
|
2115
|
+
event = args.event;
|
|
2116
|
+
var name = scope.getName('modal');
|
|
2117
|
+
var edit = args.edit === true;
|
|
2118
|
+
var def = {};
|
|
2119
|
+
var rowItem = null;
|
|
2120
|
+
var main = ViewUtils.getCrud('view');
|
|
2121
|
+
if (crud.is('row')) {
|
|
2122
|
+
def.parent = crud.parent.parent;
|
|
2123
|
+
def.search = crud.parent;
|
|
2124
|
+
rowItem = crud.data;
|
|
2125
|
+
} else if (crud.is('search')) {
|
|
2126
|
+
def.parent = crud.parent;
|
|
2127
|
+
def.search = crud;
|
|
2128
|
+
}
|
|
2129
|
+
var data = Utils.nvl(args.item, rowItem, {});
|
|
2130
|
+
var component = event == null ? void 0 : event.component;
|
|
2131
|
+
if (component) {
|
|
2132
|
+
var d = CrudUtils.create('dialog', _extends({
|
|
2133
|
+
parent: crud,
|
|
2134
|
+
root: crud,
|
|
2135
|
+
name: name,
|
|
2136
|
+
dialog: main.dialog,
|
|
2137
|
+
data: data,
|
|
2138
|
+
edit: edit,
|
|
2139
|
+
scope: scope
|
|
2140
|
+
}, def));
|
|
2141
|
+
main.dialog = d;
|
|
2142
|
+
scope.currentDialog = {
|
|
2143
|
+
component: component,
|
|
2144
|
+
crud: d
|
|
2145
|
+
};
|
|
2146
|
+
scope.update();
|
|
2150
2147
|
}
|
|
2151
2148
|
};
|
|
2152
2149
|
return /*#__PURE__*/jsx(CrudContext.Provider, {
|