react-crud-mobile 1.3.94 → 1.3.96
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 +39 -73
- 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 +39 -73
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/elements/UIElement.tsx +36 -22
- package/src/elements/core/UIModal.tsx +2 -55
|
@@ -1328,7 +1328,7 @@ function UIToast() {
|
|
|
1328
1328
|
|
|
1329
1329
|
var _excluded = ["scope", "open", "dialog"];
|
|
1330
1330
|
function UIModal(_ref) {
|
|
1331
|
-
var _theme$styles, _scope$currentDialog2, _main$
|
|
1331
|
+
var _theme$styles, _scope$currentDialog2, _main$dialog;
|
|
1332
1332
|
var scope = _ref.scope,
|
|
1333
1333
|
open = _ref.open,
|
|
1334
1334
|
dialog = _ref.dialog,
|
|
@@ -1339,7 +1339,6 @@ function UIModal(_ref) {
|
|
|
1339
1339
|
var _useState2 = useState(0),
|
|
1340
1340
|
index = _useState2[0],
|
|
1341
1341
|
setIndex = _useState2[1];
|
|
1342
|
-
var main = ViewUtils.getCrud('view');
|
|
1343
1342
|
//v6
|
|
1344
1343
|
var label = scope.getLabel();
|
|
1345
1344
|
var theme = scope.getTheme();
|
|
@@ -1357,63 +1356,19 @@ function UIModal(_ref) {
|
|
|
1357
1356
|
event: {}
|
|
1358
1357
|
});
|
|
1359
1358
|
};
|
|
1360
|
-
|
|
1359
|
+
scope.toggleDialog = function (vis) {
|
|
1361
1360
|
modalVisible = vis;
|
|
1362
1361
|
setModalVisible(modalVisible);
|
|
1363
1362
|
};
|
|
1364
1363
|
scope.update = function () {
|
|
1365
1364
|
setIndex(++index);
|
|
1366
1365
|
};
|
|
1367
|
-
scope.dialogShow = function (args) {
|
|
1368
|
-
var parent = main.dialog;
|
|
1369
|
-
var crud = args.crud;
|
|
1370
|
-
var name = scope.getName('modal');
|
|
1371
|
-
var edit = args.edit === true;
|
|
1372
|
-
var def = {};
|
|
1373
|
-
var rowItem = null;
|
|
1374
|
-
if (crud.is('row')) {
|
|
1375
|
-
def.parent = crud.parent.parent;
|
|
1376
|
-
def.search = crud.parent;
|
|
1377
|
-
rowItem = crud.data;
|
|
1378
|
-
} else if (crud.is('search')) {
|
|
1379
|
-
def.parent = crud.parent;
|
|
1380
|
-
def.search = crud;
|
|
1381
|
-
}
|
|
1382
|
-
var data = Utils.nvl(args.item, rowItem, {});
|
|
1383
|
-
var d = CrudUtils.create('dialog', _extends({
|
|
1384
|
-
parent: crud,
|
|
1385
|
-
root: crud,
|
|
1386
|
-
name: name,
|
|
1387
|
-
data: data,
|
|
1388
|
-
edit: edit,
|
|
1389
|
-
scope: scope
|
|
1390
|
-
}, def));
|
|
1391
|
-
var dialog = {
|
|
1392
|
-
crud: d,
|
|
1393
|
-
parent: parent
|
|
1394
|
-
};
|
|
1395
|
-
main.dialog = dialog;
|
|
1396
|
-
scope.currentDialog = dialog;
|
|
1397
|
-
toggle(true);
|
|
1398
|
-
scope.update();
|
|
1399
|
-
};
|
|
1400
|
-
scope.dialogHide = function (args) {
|
|
1401
|
-
var _main$dialog;
|
|
1402
|
-
var old = scope.currentDialog;
|
|
1403
|
-
main.dialog = Utils.nvl(old.parent, null);
|
|
1404
|
-
scope.currentDialog = null;
|
|
1405
|
-
toggle(false);
|
|
1406
|
-
if ((_main$dialog = main.dialog) != null && (_main$dialog = _main$dialog.crud) != null && _main$dialog.scope) {
|
|
1407
|
-
var _main$dialog2;
|
|
1408
|
-
(_main$dialog2 = main.dialog) == null || _main$dialog2.crud.scope.update();
|
|
1409
|
-
}
|
|
1410
|
-
scope.update();
|
|
1411
|
-
};
|
|
1412
1366
|
var curr = (_scope$currentDialog2 = scope.currentDialog) == null ? void 0 : _scope$currentDialog2.crud;
|
|
1367
|
+
var main = ViewUtils.getCrud('view');
|
|
1413
1368
|
if (!curr) {
|
|
1414
1369
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
1415
1370
|
}
|
|
1416
|
-
if (curr.uuid !== ((_main$
|
|
1371
|
+
if (curr.uuid !== ((_main$dialog = main.dialog) == null || (_main$dialog = _main$dialog.crud) == null ? void 0 : _main$dialog.uuid)) {
|
|
1417
1372
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
1418
1373
|
}
|
|
1419
1374
|
var headerRight = ComponentUtils.getDefine(props, 'header', 'right');
|
|
@@ -2115,15 +2070,16 @@ function UIElement(props) {
|
|
|
2115
2070
|
children: props.children
|
|
2116
2071
|
});
|
|
2117
2072
|
};
|
|
2118
|
-
scope.
|
|
2119
|
-
var
|
|
2120
|
-
|
|
2073
|
+
scope.dialogShow = function (args) {
|
|
2074
|
+
var _args$event;
|
|
2075
|
+
var main = ViewUtils.getCrud('view');
|
|
2076
|
+
var parent = main.dialog;
|
|
2077
|
+
var crud = args.crud;
|
|
2121
2078
|
var name = scope.getName('modal');
|
|
2122
2079
|
var edit = args.edit === true;
|
|
2123
2080
|
var def = {};
|
|
2124
2081
|
var rowItem = null;
|
|
2125
|
-
var
|
|
2126
|
-
var parent = main.dialog;
|
|
2082
|
+
var component = args == null || (_args$event = args.event) == null ? void 0 : _args$event.component;
|
|
2127
2083
|
if (crud.is('row')) {
|
|
2128
2084
|
def.parent = crud.parent.parent;
|
|
2129
2085
|
def.search = crud.parent;
|
|
@@ -2133,26 +2089,36 @@ function UIElement(props) {
|
|
|
2133
2089
|
def.search = crud;
|
|
2134
2090
|
}
|
|
2135
2091
|
var data = Utils.nvl(args.item, rowItem, {});
|
|
2136
|
-
var
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2092
|
+
var d = CrudUtils.create('dialog', _extends({
|
|
2093
|
+
parent: crud,
|
|
2094
|
+
root: crud,
|
|
2095
|
+
name: name,
|
|
2096
|
+
data: data,
|
|
2097
|
+
edit: edit,
|
|
2098
|
+
scope: scope
|
|
2099
|
+
}, def));
|
|
2100
|
+
var dialog = {
|
|
2101
|
+
crud: d,
|
|
2102
|
+
parent: parent,
|
|
2103
|
+
component: component
|
|
2104
|
+
};
|
|
2105
|
+
main.dialog = dialog;
|
|
2106
|
+
scope.toggleDialog(true);
|
|
2107
|
+
scope.currentDialog = dialog;
|
|
2108
|
+
scope.update();
|
|
2109
|
+
};
|
|
2110
|
+
scope.dialogHide = function (args) {
|
|
2111
|
+
var _main$dialog;
|
|
2112
|
+
var main = ViewUtils.getCrud('view');
|
|
2113
|
+
var old = scope.currentDialog;
|
|
2114
|
+
main.dialog = Utils.nvl(old.parent, null);
|
|
2115
|
+
scope.currentDialog = null;
|
|
2116
|
+
if ((_main$dialog = main.dialog) != null && (_main$dialog = _main$dialog.crud) != null && _main$dialog.scope) {
|
|
2117
|
+
var _main$dialog2;
|
|
2118
|
+
(_main$dialog2 = main.dialog) == null || _main$dialog2.crud.scope.update();
|
|
2155
2119
|
}
|
|
2120
|
+
scope.toggleDialog(false);
|
|
2121
|
+
scope.update();
|
|
2156
2122
|
};
|
|
2157
2123
|
return /*#__PURE__*/jsx(CrudContext.Provider, {
|
|
2158
2124
|
value: {
|