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
|
@@ -1337,7 +1337,7 @@ function UIToast() {
|
|
|
1337
1337
|
|
|
1338
1338
|
var _excluded = ["scope", "open", "dialog"];
|
|
1339
1339
|
function UIModal(_ref) {
|
|
1340
|
-
var _theme$styles, _scope$currentDialog2, _main$
|
|
1340
|
+
var _theme$styles, _scope$currentDialog2, _main$dialog;
|
|
1341
1341
|
var scope = _ref.scope,
|
|
1342
1342
|
open = _ref.open,
|
|
1343
1343
|
dialog = _ref.dialog,
|
|
@@ -1348,7 +1348,6 @@ function UIModal(_ref) {
|
|
|
1348
1348
|
var _useState2 = React.useState(0),
|
|
1349
1349
|
index = _useState2[0],
|
|
1350
1350
|
setIndex = _useState2[1];
|
|
1351
|
-
var main = reactCrudUtils.ViewUtils.getCrud('view');
|
|
1352
1351
|
//v6
|
|
1353
1352
|
var label = scope.getLabel();
|
|
1354
1353
|
var theme = scope.getTheme();
|
|
@@ -1366,63 +1365,19 @@ function UIModal(_ref) {
|
|
|
1366
1365
|
event: {}
|
|
1367
1366
|
});
|
|
1368
1367
|
};
|
|
1369
|
-
|
|
1368
|
+
scope.toggleDialog = function (vis) {
|
|
1370
1369
|
modalVisible = vis;
|
|
1371
1370
|
setModalVisible(modalVisible);
|
|
1372
1371
|
};
|
|
1373
1372
|
scope.update = function () {
|
|
1374
1373
|
setIndex(++index);
|
|
1375
1374
|
};
|
|
1376
|
-
scope.dialogShow = function (args) {
|
|
1377
|
-
var parent = main.dialog;
|
|
1378
|
-
var crud = args.crud;
|
|
1379
|
-
var name = scope.getName('modal');
|
|
1380
|
-
var edit = args.edit === true;
|
|
1381
|
-
var def = {};
|
|
1382
|
-
var rowItem = null;
|
|
1383
|
-
if (crud.is('row')) {
|
|
1384
|
-
def.parent = crud.parent.parent;
|
|
1385
|
-
def.search = crud.parent;
|
|
1386
|
-
rowItem = crud.data;
|
|
1387
|
-
} else if (crud.is('search')) {
|
|
1388
|
-
def.parent = crud.parent;
|
|
1389
|
-
def.search = crud;
|
|
1390
|
-
}
|
|
1391
|
-
var data = reactCrudUtils.Utils.nvl(args.item, rowItem, {});
|
|
1392
|
-
var d = reactCrudUtils.CrudUtils.create('dialog', _extends({
|
|
1393
|
-
parent: crud,
|
|
1394
|
-
root: crud,
|
|
1395
|
-
name: name,
|
|
1396
|
-
data: data,
|
|
1397
|
-
edit: edit,
|
|
1398
|
-
scope: scope
|
|
1399
|
-
}, def));
|
|
1400
|
-
var dialog = {
|
|
1401
|
-
crud: d,
|
|
1402
|
-
parent: parent
|
|
1403
|
-
};
|
|
1404
|
-
main.dialog = dialog;
|
|
1405
|
-
scope.currentDialog = dialog;
|
|
1406
|
-
toggle(true);
|
|
1407
|
-
scope.update();
|
|
1408
|
-
};
|
|
1409
|
-
scope.dialogHide = function (args) {
|
|
1410
|
-
var _main$dialog;
|
|
1411
|
-
var old = scope.currentDialog;
|
|
1412
|
-
main.dialog = reactCrudUtils.Utils.nvl(old.parent, null);
|
|
1413
|
-
scope.currentDialog = null;
|
|
1414
|
-
toggle(false);
|
|
1415
|
-
if ((_main$dialog = main.dialog) != null && (_main$dialog = _main$dialog.crud) != null && _main$dialog.scope) {
|
|
1416
|
-
var _main$dialog2;
|
|
1417
|
-
(_main$dialog2 = main.dialog) == null || _main$dialog2.crud.scope.update();
|
|
1418
|
-
}
|
|
1419
|
-
scope.update();
|
|
1420
|
-
};
|
|
1421
1375
|
var curr = (_scope$currentDialog2 = scope.currentDialog) == null ? void 0 : _scope$currentDialog2.crud;
|
|
1376
|
+
var main = reactCrudUtils.ViewUtils.getCrud('view');
|
|
1422
1377
|
if (!curr) {
|
|
1423
1378
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1424
1379
|
}
|
|
1425
|
-
if (curr.uuid !== ((_main$
|
|
1380
|
+
if (curr.uuid !== ((_main$dialog = main.dialog) == null || (_main$dialog = _main$dialog.crud) == null ? void 0 : _main$dialog.uuid)) {
|
|
1426
1381
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1427
1382
|
}
|
|
1428
1383
|
var headerRight = reactCrudUtils.ComponentUtils.getDefine(props, 'header', 'right');
|
|
@@ -2124,15 +2079,16 @@ function UIElement(props) {
|
|
|
2124
2079
|
children: props.children
|
|
2125
2080
|
});
|
|
2126
2081
|
};
|
|
2127
|
-
scope.
|
|
2128
|
-
var
|
|
2129
|
-
|
|
2082
|
+
scope.dialogShow = function (args) {
|
|
2083
|
+
var _args$event;
|
|
2084
|
+
var main = reactCrudUtils.ViewUtils.getCrud('view');
|
|
2085
|
+
var parent = main.dialog;
|
|
2086
|
+
var crud = args.crud;
|
|
2130
2087
|
var name = scope.getName('modal');
|
|
2131
2088
|
var edit = args.edit === true;
|
|
2132
2089
|
var def = {};
|
|
2133
2090
|
var rowItem = null;
|
|
2134
|
-
var
|
|
2135
|
-
var parent = main.dialog;
|
|
2091
|
+
var component = args == null || (_args$event = args.event) == null ? void 0 : _args$event.component;
|
|
2136
2092
|
if (crud.is('row')) {
|
|
2137
2093
|
def.parent = crud.parent.parent;
|
|
2138
2094
|
def.search = crud.parent;
|
|
@@ -2142,26 +2098,36 @@ function UIElement(props) {
|
|
|
2142
2098
|
def.search = crud;
|
|
2143
2099
|
}
|
|
2144
2100
|
var data = reactCrudUtils.Utils.nvl(args.item, rowItem, {});
|
|
2145
|
-
var
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2101
|
+
var d = reactCrudUtils.CrudUtils.create('dialog', _extends({
|
|
2102
|
+
parent: crud,
|
|
2103
|
+
root: crud,
|
|
2104
|
+
name: name,
|
|
2105
|
+
data: data,
|
|
2106
|
+
edit: edit,
|
|
2107
|
+
scope: scope
|
|
2108
|
+
}, def));
|
|
2109
|
+
var dialog = {
|
|
2110
|
+
crud: d,
|
|
2111
|
+
parent: parent,
|
|
2112
|
+
component: component
|
|
2113
|
+
};
|
|
2114
|
+
main.dialog = dialog;
|
|
2115
|
+
scope.toggleDialog(true);
|
|
2116
|
+
scope.currentDialog = dialog;
|
|
2117
|
+
scope.update();
|
|
2118
|
+
};
|
|
2119
|
+
scope.dialogHide = function (args) {
|
|
2120
|
+
var _main$dialog;
|
|
2121
|
+
var main = reactCrudUtils.ViewUtils.getCrud('view');
|
|
2122
|
+
var old = scope.currentDialog;
|
|
2123
|
+
main.dialog = reactCrudUtils.Utils.nvl(old.parent, null);
|
|
2124
|
+
scope.currentDialog = null;
|
|
2125
|
+
if ((_main$dialog = main.dialog) != null && (_main$dialog = _main$dialog.crud) != null && _main$dialog.scope) {
|
|
2126
|
+
var _main$dialog2;
|
|
2127
|
+
(_main$dialog2 = main.dialog) == null || _main$dialog2.crud.scope.update();
|
|
2164
2128
|
}
|
|
2129
|
+
scope.toggleDialog(false);
|
|
2130
|
+
scope.update();
|
|
2165
2131
|
};
|
|
2166
2132
|
return /*#__PURE__*/jsxRuntime.jsx(CrudContext.Provider, {
|
|
2167
2133
|
value: {
|