frontend-plus-react 0.1.5 → 0.1.6
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/index.cjs +144 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +220 -159
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/index.d.cts +0 -204
- package/dist/index.d.ts +0 -204
package/dist/index.js
CHANGED
|
@@ -786,7 +786,7 @@ var useApiCall = () => {
|
|
|
786
786
|
};
|
|
787
787
|
|
|
788
788
|
// src/components/grid/GenericDataGrid.tsx
|
|
789
|
-
import { CircularProgress, Typography as Typography5, Box as
|
|
789
|
+
import { CircularProgress, Typography as Typography5, Box as Box7, Alert, useTheme as useTheme3 } from "@mui/material";
|
|
790
790
|
|
|
791
791
|
// src/utils/functions.tsx
|
|
792
792
|
var JSON4all = __toESM(require_json4all(), 1);
|
|
@@ -986,9 +986,18 @@ var useRedirectPath = () => {
|
|
|
986
986
|
|
|
987
987
|
// src/utils/functions.tsx
|
|
988
988
|
var cambiarGuionesBajosPorEspacios = (texto) => texto.replace(/_/g, " ");
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
989
|
+
var getDetailTableAndFixedFieldsForDetailTableAbr = (tableDefinition, detailTableAbr, row) => {
|
|
990
|
+
const detailTable = tableDefinition.detailTables.find((dt) => dt.abr === detailTableAbr);
|
|
991
|
+
let fixedFields = [];
|
|
992
|
+
detailTable.fields.forEach((field) => {
|
|
993
|
+
if (typeof field === "string") {
|
|
994
|
+
fixedFields.push({ fieldName: field, value: row[field] });
|
|
995
|
+
} else {
|
|
996
|
+
fixedFields.push({ fieldName: field.target, value: row[field.source] });
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
return { detailTable, fixedFields };
|
|
1000
|
+
};
|
|
992
1001
|
|
|
993
1002
|
// src/components/ConfirmDialog.tsx
|
|
994
1003
|
import Dialog from "@mui/material/Dialog";
|
|
@@ -1022,7 +1031,8 @@ var ConfirmDialog = ({ open, onClose, title, message }) => {
|
|
|
1022
1031
|
import { Box, IconButton, Tooltip, Typography } from "@mui/material";
|
|
1023
1032
|
import SearchIcon from "@mui/icons-material/Search";
|
|
1024
1033
|
import SearchOffIcon from "@mui/icons-material/SearchOff";
|
|
1025
|
-
import
|
|
1034
|
+
import MoreVertIcon from "@mui/icons-material/MoreVert";
|
|
1035
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1026
1036
|
var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
|
|
1027
1037
|
const { column } = props;
|
|
1028
1038
|
const isPrimaryKey = fieldDef.isPk;
|
|
@@ -1045,7 +1055,7 @@ var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
|
|
|
1045
1055
|
sx: {
|
|
1046
1056
|
fontWeight: "bold",
|
|
1047
1057
|
textDecoration: isPrimaryKey ? "underline" : "none",
|
|
1048
|
-
fontSize: "
|
|
1058
|
+
fontSize: "o.930rem"
|
|
1049
1059
|
// Puedes ajustar el tamaño si es necesario
|
|
1050
1060
|
},
|
|
1051
1061
|
children: column.name
|
|
@@ -1054,17 +1064,30 @@ var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
|
|
|
1054
1064
|
}
|
|
1055
1065
|
);
|
|
1056
1066
|
};
|
|
1057
|
-
var actionsColumnHeaderCellRenderer = (props, isFilterRowVisible, toggleFilterVisibility) => /* @__PURE__ */
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1067
|
+
var actionsColumnHeaderCellRenderer = (props, isFilterRowVisible, toggleFilterVisibility) => /* @__PURE__ */ jsxs3(Box, { sx: { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 0.2 }, children: [
|
|
1068
|
+
/* @__PURE__ */ jsx3(
|
|
1069
|
+
IconButton,
|
|
1070
|
+
{
|
|
1071
|
+
color: "inherit",
|
|
1072
|
+
onClick: toggleFilterVisibility,
|
|
1073
|
+
size: "small",
|
|
1074
|
+
title: isFilterRowVisible ? "Ocultar filtros" : "Mostrar filtros",
|
|
1075
|
+
sx: { p: 0.25 },
|
|
1076
|
+
children: isFilterRowVisible ? /* @__PURE__ */ jsx3(SearchOffIcon, { sx: { fontSize: 18 } }) : /* @__PURE__ */ jsx3(SearchIcon, { sx: { fontSize: 18 } })
|
|
1077
|
+
}
|
|
1078
|
+
),
|
|
1079
|
+
/* @__PURE__ */ jsx3(
|
|
1080
|
+
IconButton,
|
|
1081
|
+
{
|
|
1082
|
+
onClick: () => {
|
|
1083
|
+
},
|
|
1084
|
+
size: "small",
|
|
1085
|
+
title: "Opciones de esta tabla",
|
|
1086
|
+
sx: { p: 0.25 },
|
|
1087
|
+
children: /* @__PURE__ */ jsx3(MoreVertIcon, { sx: { fontSize: 20, variant: "filled", size: "small" } })
|
|
1088
|
+
}
|
|
1089
|
+
)
|
|
1090
|
+
] });
|
|
1068
1091
|
var detailColumnCellHeaderRenderer = (props, detailTable) => /* @__PURE__ */ jsx3(Tooltip, { title: detailTable.label, children: /* @__PURE__ */ jsx3(Typography, { variant: "caption", sx: { fontSize: "0.75rem", fontWeight: "bold" }, children: detailTable.abr.toUpperCase() }) });
|
|
1069
1092
|
|
|
1070
1093
|
// src/components/grid/FilterInputRender.tsx
|
|
@@ -1085,6 +1108,7 @@ function FilterInputRenderer({
|
|
|
1085
1108
|
}),
|
|
1086
1109
|
sx: {
|
|
1087
1110
|
width: "100%",
|
|
1111
|
+
height: 25,
|
|
1088
1112
|
margin: "0",
|
|
1089
1113
|
border: "1px solid #ccc",
|
|
1090
1114
|
borderRadius: "4px",
|
|
@@ -1099,35 +1123,38 @@ function FilterInputRenderer({
|
|
|
1099
1123
|
var FilterInputRender_default = FilterInputRenderer;
|
|
1100
1124
|
|
|
1101
1125
|
// src/components/grid/renderers/summaryCellRenderers.tsx
|
|
1126
|
+
import { Box as Box2 } from "@mui/material";
|
|
1102
1127
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1103
1128
|
var defaultColumnSummaryCellRenderer = (props, fixedFields, isFilterRowVisible, filters, setFilters) => {
|
|
1104
1129
|
const { column } = props;
|
|
1105
1130
|
const fixedFieldEntry = fixedFields?.find((f) => f.fieldName === column.key);
|
|
1106
1131
|
if (fixedFieldEntry && fixedFieldEntry.until === void 0 || !isFilterRowVisible) return null;
|
|
1107
|
-
return /* @__PURE__ */ jsx5(
|
|
1132
|
+
return /* @__PURE__ */ jsx5(Box2, { children: /* @__PURE__ */ jsx5(
|
|
1108
1133
|
FilterInputRender_default,
|
|
1109
1134
|
{
|
|
1110
1135
|
column,
|
|
1111
1136
|
filters,
|
|
1112
1137
|
setFilters
|
|
1113
1138
|
}
|
|
1114
|
-
);
|
|
1139
|
+
) });
|
|
1115
1140
|
};
|
|
1116
1141
|
var actionsColumnSummaryCellRenderer = (props) => null;
|
|
1117
1142
|
var detailColumnCellSummaryRenderer = (props) => null;
|
|
1118
1143
|
|
|
1119
1144
|
// src/components/grid/renderers/cellRenderers.tsx
|
|
1120
|
-
import { Box as
|
|
1145
|
+
import { Box as Box5, Button as Button2, IconButton as IconButton2, Tooltip as Tooltip3, Typography as Typography4, useTheme } from "@mui/material";
|
|
1121
1146
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
1122
1147
|
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
|
|
1148
|
+
import ViewHeadlineIcon from "@mui/icons-material/ViewHeadline";
|
|
1123
1149
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
1150
|
+
import AddIcon from "@mui/icons-material/Add";
|
|
1124
1151
|
|
|
1125
1152
|
// src/components/grid/ExampleClientSideComponent.tsx
|
|
1126
|
-
import { Box as
|
|
1153
|
+
import { Box as Box3, Typography as Typography2 } from "@mui/material";
|
|
1127
1154
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1128
1155
|
var ExampleClientSideComponent = ({ row, column, fieldDefinition }) => {
|
|
1129
1156
|
const value = row[column.key];
|
|
1130
|
-
return /* @__PURE__ */ jsx6(
|
|
1157
|
+
return /* @__PURE__ */ jsx6(Box3, { sx: {
|
|
1131
1158
|
padding: 0.5,
|
|
1132
1159
|
width: "100%",
|
|
1133
1160
|
height: "100%",
|
|
@@ -1139,13 +1166,13 @@ var ExampleClientSideComponent = ({ row, column, fieldDefinition }) => {
|
|
|
1139
1166
|
var ExampleClientSideComponent_default = ExampleClientSideComponent;
|
|
1140
1167
|
|
|
1141
1168
|
// src/components/grid/FallbackClientSideRenderer.tsx
|
|
1142
|
-
import { Box as
|
|
1169
|
+
import { Box as Box4, Typography as Typography3, Tooltip as Tooltip2 } from "@mui/material";
|
|
1143
1170
|
import WarningAmberIcon from "@mui/icons-material/WarningAmber";
|
|
1144
|
-
import { jsx as jsx7, jsxs as
|
|
1171
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1145
1172
|
var FallbackClientSideRenderer = ({ column, row, fieldDefinition }) => {
|
|
1146
1173
|
const clientSideName = fieldDefinition?.clientSide || "Desconocido";
|
|
1147
|
-
return /* @__PURE__ */ jsx7(Tooltip2, { title: `Componente clientSide '${clientSideName}' no implementado. Mostrando valor por defecto.`, children: /* @__PURE__ */
|
|
1148
|
-
|
|
1174
|
+
return /* @__PURE__ */ jsx7(Tooltip2, { title: `Componente clientSide '${clientSideName}' no implementado. Mostrando valor por defecto.`, children: /* @__PURE__ */ jsxs4(
|
|
1175
|
+
Box4,
|
|
1149
1176
|
{
|
|
1150
1177
|
sx: {
|
|
1151
1178
|
display: "flex",
|
|
@@ -1205,17 +1232,9 @@ var allColumnsCellRenderer = (props) => {
|
|
|
1205
1232
|
const detailTableAbr = row[DETAIL_ROW_INDICATOR];
|
|
1206
1233
|
const detailColumn = column;
|
|
1207
1234
|
if (column.customType === "detail" && detailColumn.detailTable.abr === detailTableAbr) {
|
|
1208
|
-
const detailTable = detailColumn.tableDefinition
|
|
1209
|
-
let fixedFields = [];
|
|
1210
|
-
detailTable.fields.forEach((field) => {
|
|
1211
|
-
if (typeof field === "string") {
|
|
1212
|
-
fixedFields.push({ fieldName: field, value: row[field] });
|
|
1213
|
-
} else {
|
|
1214
|
-
fixedFields.push({ fieldName: field.target, value: row[field.source] });
|
|
1215
|
-
}
|
|
1216
|
-
});
|
|
1235
|
+
const { detailTable, fixedFields } = getDetailTableAndFixedFieldsForDetailTableAbr(detailColumn.tableDefinition, detailTableAbr, row);
|
|
1217
1236
|
return /* @__PURE__ */ jsx8(
|
|
1218
|
-
|
|
1237
|
+
Box5,
|
|
1219
1238
|
{
|
|
1220
1239
|
sx: {
|
|
1221
1240
|
// Se eliminó el padding para que la sub-grilla se extienda por completo
|
|
@@ -1230,7 +1249,7 @@ var allColumnsCellRenderer = (props) => {
|
|
|
1230
1249
|
onClick: (e) => e.stopPropagation(),
|
|
1231
1250
|
onKeyDown: (e) => e.stopPropagation(),
|
|
1232
1251
|
onDoubleClick: (e) => e.stopPropagation(),
|
|
1233
|
-
children: /* @__PURE__ */ jsx8(GenericDataGrid_default, { tableName: detailTable.table, fixedFields })
|
|
1252
|
+
children: /* @__PURE__ */ jsx8(GenericDataGrid_default, { tableName: detailTable.table, fixedFields, gridStyles: { height: 322 } })
|
|
1234
1253
|
}
|
|
1235
1254
|
);
|
|
1236
1255
|
}
|
|
@@ -1263,7 +1282,7 @@ var allColumnsCellRenderer = (props) => {
|
|
|
1263
1282
|
}
|
|
1264
1283
|
}
|
|
1265
1284
|
const value = row[props.column.key];
|
|
1266
|
-
return /* @__PURE__ */ jsx8(Tooltip3, { title: cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key ? cellFeedback?.message : "", children: /* @__PURE__ */ jsx8(
|
|
1285
|
+
return /* @__PURE__ */ jsx8(Tooltip3, { title: cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key ? cellFeedback?.message : "", children: /* @__PURE__ */ jsx8(Box5, { sx: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", backgroundColor: cellBackgroundColor, transition: "background-color 0.3s ease-in-out", display: "flex", alignItems: "center", paddingLeft: "8px", boxSizing: "border-box" }, children: /* @__PURE__ */ jsx8(Typography4, { variant: "body2", sx: { fontSize: "0.875rem", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", width: "100%" }, children: value === null || value === void 0 ? "" : String(value) }) }) });
|
|
1267
1286
|
}
|
|
1268
1287
|
case "detail": {
|
|
1269
1288
|
const detailColumn = column;
|
|
@@ -1271,10 +1290,9 @@ var allColumnsCellRenderer = (props) => {
|
|
|
1271
1290
|
const isExpanded = tableData.some(
|
|
1272
1291
|
(r) => r[DETAIL_ROW_INDICATOR] === detailTable.abr && getPrimaryKeyValues(r, primaryKey) === getPrimaryKeyValues({ ...row, [DETAIL_ROW_INDICATOR]: detailTable.abr }, primaryKey)
|
|
1273
1292
|
);
|
|
1274
|
-
return /* @__PURE__ */ jsx8(Tooltip3, { title: detailTable.label, children: /* @__PURE__ */ jsx8(
|
|
1293
|
+
return /* @__PURE__ */ jsx8(Tooltip3, { title: detailTable.label, children: /* @__PURE__ */ jsx8(Box5, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx8(
|
|
1275
1294
|
IconButton2,
|
|
1276
1295
|
{
|
|
1277
|
-
size: "small",
|
|
1278
1296
|
onClick: (event) => {
|
|
1279
1297
|
let rows = [...tableData];
|
|
1280
1298
|
const rowId = getPrimaryKeyValues({ ...row, [DETAIL_ROW_INDICATOR]: detailTable.abr }, primaryKey);
|
|
@@ -1292,17 +1310,51 @@ var allColumnsCellRenderer = (props) => {
|
|
|
1292
1310
|
}
|
|
1293
1311
|
event.stopPropagation();
|
|
1294
1312
|
},
|
|
1295
|
-
title: isExpanded ? "Contraer detalle" : "Expandir detalle",
|
|
1296
|
-
sx: { p: 0.5 },
|
|
1297
1313
|
children: isExpanded ? /* @__PURE__ */ jsx8(KeyboardArrowUpIcon, { sx: { fontSize: 20 } }) : /* @__PURE__ */ jsx8(KeyboardArrowDownIcon, { sx: { fontSize: 20 } })
|
|
1298
1314
|
}
|
|
1299
1315
|
) }) });
|
|
1300
1316
|
}
|
|
1301
1317
|
case "action": {
|
|
1302
1318
|
const actionColumn = column;
|
|
1303
|
-
const { tableDefinition, handleDeleteRow } = actionColumn;
|
|
1304
|
-
|
|
1305
|
-
|
|
1319
|
+
const { tableDefinition, handleDeleteRow, handleAddRow } = actionColumn;
|
|
1320
|
+
const gridActionButtons = [
|
|
1321
|
+
{
|
|
1322
|
+
action: "insert",
|
|
1323
|
+
handler: handleAddRow,
|
|
1324
|
+
icon: AddIcon,
|
|
1325
|
+
title: "Agregar registro",
|
|
1326
|
+
color: "success"
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
action: "delete",
|
|
1330
|
+
handler: handleDeleteRow,
|
|
1331
|
+
icon: DeleteIcon,
|
|
1332
|
+
title: "Eliminar registro",
|
|
1333
|
+
color: "error"
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
action: "vertical-edit",
|
|
1337
|
+
handler: () => {
|
|
1338
|
+
},
|
|
1339
|
+
// implementar funcion
|
|
1340
|
+
icon: ViewHeadlineIcon,
|
|
1341
|
+
title: "Editar registro en forma de ficha",
|
|
1342
|
+
color: "primary"
|
|
1343
|
+
}
|
|
1344
|
+
];
|
|
1345
|
+
return /* @__PURE__ */ jsx8(Box5, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", gap: 0.5 }, children: gridActionButtons.map((actionDef) => tableDefinition.allow[actionDef.action] ? /* @__PURE__ */ jsx8(
|
|
1346
|
+
Button2,
|
|
1347
|
+
{
|
|
1348
|
+
variant: "outlined",
|
|
1349
|
+
color: actionDef.color,
|
|
1350
|
+
size: "small",
|
|
1351
|
+
onClick: () => actionDef.handler(row),
|
|
1352
|
+
title: actionDef.title,
|
|
1353
|
+
sx: { width: 22, minWidth: 22, height: 22, "& .MuiButton-startIcon": { m: 0 } },
|
|
1354
|
+
children: /* @__PURE__ */ jsx8(actionDef.icon, { sx: { fontSize: 18 } })
|
|
1355
|
+
},
|
|
1356
|
+
actionDef.action
|
|
1357
|
+
) : null) });
|
|
1306
1358
|
}
|
|
1307
1359
|
default:
|
|
1308
1360
|
return void 0;
|
|
@@ -1432,7 +1484,7 @@ function InputRenderer({
|
|
|
1432
1484
|
newRow: rowToSend,
|
|
1433
1485
|
oldRow: oldRowData,
|
|
1434
1486
|
status
|
|
1435
|
-
}
|
|
1487
|
+
});
|
|
1436
1488
|
let finalRowIdForFeedback;
|
|
1437
1489
|
let persistedRowData;
|
|
1438
1490
|
if (response.row && isNewRow) {
|
|
@@ -1459,7 +1511,6 @@ function InputRenderer({
|
|
|
1459
1511
|
const isPrimaryKeyColumn = tableDefinition.primaryKey.includes(column.key);
|
|
1460
1512
|
finalRowIdForFeedback = isPrimaryKeyColumn ? getPrimaryKeyValues(potentialUpdatedRow, tableDefinition.primaryKey) : currentRowIdBeforeUpdate;
|
|
1461
1513
|
onRowChange({ ...response.row }, true);
|
|
1462
|
-
onClose(true, focusNextCell);
|
|
1463
1514
|
}
|
|
1464
1515
|
findChangedValues(oldRowData, response.row).forEach(
|
|
1465
1516
|
(key) => setCellFeedback({ rowId: finalRowIdForFeedback, columnKey: key, type: "success" })
|
|
@@ -1485,15 +1536,12 @@ function InputRenderer({
|
|
|
1485
1536
|
initialRowId
|
|
1486
1537
|
]);
|
|
1487
1538
|
const handleKeyDown = useCallback3((event) => {
|
|
1488
|
-
|
|
1489
|
-
if (event.key === "Enter") {
|
|
1539
|
+
if (["Enter", "Tab", "ArrowDown", "ArrowUp", "ArrowRight"].includes(event.key)) {
|
|
1490
1540
|
handleCommit(editingValue, true, true);
|
|
1491
1541
|
event.preventDefault();
|
|
1492
1542
|
if (onEnterPress) {
|
|
1493
|
-
onEnterPress(rowIdx, column.key);
|
|
1543
|
+
onEnterPress(rowIdx, column.key, event.key);
|
|
1494
1544
|
}
|
|
1495
|
-
} else if (event.key === "Tab") {
|
|
1496
|
-
handleCommit(editingValue, true, true);
|
|
1497
1545
|
}
|
|
1498
1546
|
}, [handleCommit, editingValue, column.key, rowIdx, onEnterPress]);
|
|
1499
1547
|
const handleBlur = useCallback3(() => {
|
|
@@ -1528,6 +1576,7 @@ function InputRenderer({
|
|
|
1528
1576
|
var InputRenderer_default = InputRenderer;
|
|
1529
1577
|
|
|
1530
1578
|
// src/components/grid/renderers/editCellRenderers.tsx
|
|
1579
|
+
import { Box as Box6, Tooltip as Tooltip4 } from "@mui/material";
|
|
1531
1580
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1532
1581
|
var allColumnsEditCellRenderer = (props, allColumns) => {
|
|
1533
1582
|
const column = props.column;
|
|
@@ -1552,20 +1601,21 @@ var allColumnsEditCellRenderer = (props, allColumns) => {
|
|
|
1552
1601
|
if (!isFieldEditableByUI) {
|
|
1553
1602
|
return void 0;
|
|
1554
1603
|
}
|
|
1555
|
-
|
|
1604
|
+
const rowId = getPrimaryKeyValues(props.row, primaryKey);
|
|
1605
|
+
return /* @__PURE__ */ jsx10(Tooltip4, { title: cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key ? cellFeedback?.message : "", children: /* @__PURE__ */ jsx10(Box6, { children: /* @__PURE__ */ jsx10(
|
|
1556
1606
|
InputRenderer_default,
|
|
1557
1607
|
{
|
|
1558
1608
|
...props,
|
|
1559
1609
|
tableDefinition,
|
|
1560
1610
|
setCellFeedback,
|
|
1561
1611
|
cellFeedback,
|
|
1562
|
-
onEnterPress: (rowIndex, columnKey) => handleEnterKeyPressInEditor(rowIndex, columnKey, allColumns),
|
|
1612
|
+
onEnterPress: (rowIndex, columnKey, key) => handleEnterKeyPressInEditor(rowIndex, columnKey, key, allColumns),
|
|
1563
1613
|
setTableData,
|
|
1564
1614
|
setLocalCellChanges,
|
|
1565
1615
|
localCellChanges,
|
|
1566
1616
|
primaryKey
|
|
1567
1617
|
}
|
|
1568
|
-
);
|
|
1618
|
+
) }) });
|
|
1569
1619
|
}
|
|
1570
1620
|
return void 0;
|
|
1571
1621
|
}
|
|
@@ -1602,7 +1652,7 @@ function EmptyRowsRenderer() {
|
|
|
1602
1652
|
}
|
|
1603
1653
|
|
|
1604
1654
|
// src/components/grid/GenericDataGrid.tsx
|
|
1605
|
-
import { jsx as jsx12, jsxs as
|
|
1655
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1606
1656
|
var getPrimaryKeyValues = (row, primaryKey) => {
|
|
1607
1657
|
if (row[DETAIL_ROW_INDICATOR]) {
|
|
1608
1658
|
primaryKey = primaryKey.concat(DETAIL_ROW_INDICATOR);
|
|
@@ -1615,8 +1665,10 @@ var NEW_ROW_INDICATOR = "$new";
|
|
|
1615
1665
|
var DETAIL_ROW_INDICATOR = "$detail";
|
|
1616
1666
|
var GenericDataGrid = ({
|
|
1617
1667
|
tableName,
|
|
1618
|
-
fixedFields
|
|
1668
|
+
fixedFields,
|
|
1669
|
+
gridStyles
|
|
1619
1670
|
}) => {
|
|
1671
|
+
const isOpenMenu = useIsDrawerOpen();
|
|
1620
1672
|
const [tableDefinition, setTableDefinition] = useState4(null);
|
|
1621
1673
|
const [tableData, setTableData] = useState4([]);
|
|
1622
1674
|
const [isFilterRowVisible, setIsFilterRowVisible] = useState4(false);
|
|
@@ -1830,12 +1882,12 @@ var GenericDataGrid = ({
|
|
|
1830
1882
|
}
|
|
1831
1883
|
return rows;
|
|
1832
1884
|
}, [tableData, filters, isFilterRowVisible]);
|
|
1833
|
-
const handleEnterKeyPressInEditor = useCallback4((rowIndex, columnKey, currentColumns) => {
|
|
1885
|
+
const handleEnterKeyPressInEditor = useCallback4((rowIndex, columnKey, key, currentColumns) => {
|
|
1834
1886
|
if (dataGridRef.current && tableDefinition) {
|
|
1835
1887
|
const currentColumnIndex = currentColumns.findIndex((col) => col.key === columnKey);
|
|
1836
1888
|
const editableColumns = currentColumns.filter((col) => {
|
|
1837
1889
|
const fieldDefinition = tableDefinition.fields.find((f) => f.name === col.key);
|
|
1838
|
-
return col.key !== "
|
|
1890
|
+
return col.key !== "actionsColumn" && col.customType != "detail" && (fieldDefinition?.editable !== false && !fieldDefinition?.clientSide);
|
|
1839
1891
|
});
|
|
1840
1892
|
if (currentColumnIndex !== -1 && editableColumns.length > 0) {
|
|
1841
1893
|
const editableColumnKeys = editableColumns.map((col) => col.key);
|
|
@@ -1852,7 +1904,7 @@ var GenericDataGrid = ({
|
|
|
1852
1904
|
}
|
|
1853
1905
|
const nextColumnKey = editableColumnKeys[nextEditableColumnIndex];
|
|
1854
1906
|
const nextColumnIndex = currentColumns.findIndex((col) => col.key === nextColumnKey);
|
|
1855
|
-
dataGridRef.current
|
|
1907
|
+
dataGridRef.current?.selectCell({ rowIdx: nextRowIndex, idx: nextColumnIndex }, { enableEditor: true, shouldFocusCell: true });
|
|
1856
1908
|
}
|
|
1857
1909
|
}
|
|
1858
1910
|
}
|
|
@@ -1892,13 +1944,20 @@ var GenericDataGrid = ({
|
|
|
1892
1944
|
renderSummaryCell: (props) => defaultColumnSummaryCellRenderer(props, fixedFields, isFilterRowVisible, filters, setFilters)
|
|
1893
1945
|
};
|
|
1894
1946
|
});
|
|
1947
|
+
const availableActions = [
|
|
1948
|
+
tableDefinition.allow?.insert,
|
|
1949
|
+
tableDefinition.allow?.delete,
|
|
1950
|
+
tableDefinition.allow?.["vertical-edit"]
|
|
1951
|
+
].filter(Boolean).length;
|
|
1952
|
+
const actionColumnWidth = availableActions === 0 ? 30 : 12 + availableActions * 25;
|
|
1895
1953
|
const actionsColumn = {
|
|
1896
|
-
key: "
|
|
1954
|
+
key: "actionsColumn",
|
|
1897
1955
|
customType: "action",
|
|
1898
1956
|
tableDefinition,
|
|
1899
1957
|
handleDeleteRow,
|
|
1958
|
+
handleAddRow,
|
|
1900
1959
|
name: "filterCol",
|
|
1901
|
-
width:
|
|
1960
|
+
width: actionColumnWidth,
|
|
1902
1961
|
editable: false,
|
|
1903
1962
|
resizable: false,
|
|
1904
1963
|
sortable: false,
|
|
@@ -1922,7 +1981,8 @@ var GenericDataGrid = ({
|
|
|
1922
1981
|
resizable: false,
|
|
1923
1982
|
sortable: false,
|
|
1924
1983
|
editable: false,
|
|
1925
|
-
width:
|
|
1984
|
+
width: 30,
|
|
1985
|
+
minWidth: 30,
|
|
1926
1986
|
renderHeaderCell: (props) => detailColumnCellHeaderRenderer(props, detailTable),
|
|
1927
1987
|
renderSummaryCell: (props) => detailColumnCellSummaryRenderer(props)
|
|
1928
1988
|
});
|
|
@@ -1944,6 +2004,8 @@ var GenericDataGrid = ({
|
|
|
1944
2004
|
}
|
|
1945
2005
|
return void 0;
|
|
1946
2006
|
},
|
|
2007
|
+
editorOptions: { closeOnExternalRowChange: false },
|
|
2008
|
+
//con esto no se pierde el foco
|
|
1947
2009
|
renderEditCell: (props) => allColumnsEditCellRenderer(props, allColumns),
|
|
1948
2010
|
renderCell: (props) => allColumnsCellRenderer(props)
|
|
1949
2011
|
}));
|
|
@@ -1962,6 +2024,7 @@ var GenericDataGrid = ({
|
|
|
1962
2024
|
setTableData,
|
|
1963
2025
|
localCellChanges,
|
|
1964
2026
|
handleDeleteRow,
|
|
2027
|
+
handleAddRow,
|
|
1965
2028
|
fixedFields,
|
|
1966
2029
|
tableData
|
|
1967
2030
|
]);
|
|
@@ -1977,6 +2040,11 @@ var GenericDataGrid = ({
|
|
|
1977
2040
|
}
|
|
1978
2041
|
});
|
|
1979
2042
|
};
|
|
2043
|
+
const handleCellKeyDown = (args, event) => {
|
|
2044
|
+
if (["Tab", "Enter"].includes(event.key)) {
|
|
2045
|
+
event.preventGridDefault();
|
|
2046
|
+
}
|
|
2047
|
+
};
|
|
1980
2048
|
const handleCellClick = useCallback4((args) => {
|
|
1981
2049
|
deselectAllOtherGrids(dataGridRef.current?.element);
|
|
1982
2050
|
args.selectCell(true);
|
|
@@ -1988,29 +2056,20 @@ var GenericDataGrid = ({
|
|
|
1988
2056
|
console.log("Is editable:", isEditable);
|
|
1989
2057
|
}, [tableDefinition, fixedFields]);
|
|
1990
2058
|
if (loading) {
|
|
1991
|
-
return /* @__PURE__ */
|
|
2059
|
+
return /* @__PURE__ */ jsxs5(Box7, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: [
|
|
1992
2060
|
/* @__PURE__ */ jsx12(CircularProgress, {}),
|
|
1993
2061
|
/* @__PURE__ */ jsx12(Typography5, { variant: "h6", sx: { ml: 2 }, children: "Cargando tabla..." })
|
|
1994
2062
|
] });
|
|
1995
2063
|
}
|
|
1996
2064
|
if (error) {
|
|
1997
|
-
return /* @__PURE__ */ jsx12(
|
|
2065
|
+
return /* @__PURE__ */ jsx12(Box7, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsx12(Alert, { severity: "error", children: error.message }) });
|
|
1998
2066
|
}
|
|
1999
2067
|
if (!tableDefinition) {
|
|
2000
|
-
return /* @__PURE__ */ jsx12(
|
|
2068
|
+
return /* @__PURE__ */ jsx12(Box7, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsx12(Alert, { severity: "warning", children: "No se pudo cargar la definici\xF3n de la tabla." }) });
|
|
2001
2069
|
}
|
|
2002
|
-
return /* @__PURE__ */
|
|
2003
|
-
tableDefinition.allow?.insert && /* @__PURE__ */ jsx12(Box5, { sx: { display: "flex", px: 2, pb: 1 }, children: /* @__PURE__ */ jsx12(
|
|
2004
|
-
Button3,
|
|
2005
|
-
{
|
|
2006
|
-
variant: "contained",
|
|
2007
|
-
onClick: handleAddRow,
|
|
2008
|
-
startIcon: /* @__PURE__ */ jsx12(AddIcon, {}),
|
|
2009
|
-
children: "Nuevo Registro"
|
|
2010
|
-
}
|
|
2011
|
-
) }),
|
|
2070
|
+
return /* @__PURE__ */ jsxs5(Box7, { sx: { pt: 2, display: "flex", flexDirection: "column", height: "100%", boxSizing: "border-box" }, children: [
|
|
2012
2071
|
/* @__PURE__ */ jsx12(
|
|
2013
|
-
|
|
2072
|
+
Box7,
|
|
2014
2073
|
{
|
|
2015
2074
|
sx: {
|
|
2016
2075
|
backgroundColor: theme.palette.primary.main,
|
|
@@ -2024,15 +2083,15 @@ var GenericDataGrid = ({
|
|
|
2024
2083
|
ml: 2,
|
|
2025
2084
|
mr: 2
|
|
2026
2085
|
},
|
|
2027
|
-
children: /* @__PURE__ */
|
|
2086
|
+
children: /* @__PURE__ */ jsxs5(Typography5, { variant: "subtitle2", component: "div", children: [
|
|
2028
2087
|
cambiarGuionesBajosPorEspacios(tableDefinition.title || tableDefinition.name),
|
|
2029
|
-
" -
|
|
2030
|
-
getFilteredRowCount() === getRowCount() ? `${getRowCount()} registros` : `${getFilteredRowCount()}
|
|
2088
|
+
" - ",
|
|
2089
|
+
getFilteredRowCount() === getRowCount() ? `${getRowCount()} registros` : `${getFilteredRowCount()} (F)`
|
|
2031
2090
|
] })
|
|
2032
2091
|
}
|
|
2033
2092
|
),
|
|
2034
2093
|
/* @__PURE__ */ jsx12(
|
|
2035
|
-
|
|
2094
|
+
Box7,
|
|
2036
2095
|
{
|
|
2037
2096
|
sx: {
|
|
2038
2097
|
flexGrow: 1,
|
|
@@ -2046,6 +2105,7 @@ var GenericDataGrid = ({
|
|
|
2046
2105
|
children: /* @__PURE__ */ jsx12(
|
|
2047
2106
|
DataGrid,
|
|
2048
2107
|
{
|
|
2108
|
+
className: "rdg-light",
|
|
2049
2109
|
ref: dataGridRef,
|
|
2050
2110
|
columns,
|
|
2051
2111
|
rows: filteredRows.map((row) => ({
|
|
@@ -2058,13 +2118,14 @@ var GenericDataGrid = ({
|
|
|
2058
2118
|
onSelectedCellChange: handleSelectedCellChange,
|
|
2059
2119
|
onRowsChange: handleRowsChange,
|
|
2060
2120
|
selectedRows,
|
|
2061
|
-
rowHeight: (row) => row[DETAIL_ROW_INDICATOR] ? 400 :
|
|
2062
|
-
style: { height: "100%", width: "100%", boxSizing: "border-box" },
|
|
2063
|
-
headerRowHeight:
|
|
2121
|
+
rowHeight: (row) => row[DETAIL_ROW_INDICATOR] ? 400 : 30,
|
|
2122
|
+
style: { ...{ height: "100%", width: "100%", boxSizing: "border-box" }, ...gridStyles },
|
|
2123
|
+
headerRowHeight: 30,
|
|
2064
2124
|
topSummaryRows: isFilterRowVisible ? [{ id: "filterRow" }] : void 0,
|
|
2065
|
-
summaryRowHeight: isFilterRowVisible ?
|
|
2125
|
+
summaryRowHeight: isFilterRowVisible ? 30 : 0,
|
|
2066
2126
|
renderers: { noRowsFallback: /* @__PURE__ */ jsx12(EmptyRowsRenderer, {}) },
|
|
2067
|
-
onCellClick: handleCellClick
|
|
2127
|
+
onCellClick: handleCellClick,
|
|
2128
|
+
onCellKeyDown: handleCellKeyDown
|
|
2068
2129
|
}
|
|
2069
2130
|
)
|
|
2070
2131
|
}
|
|
@@ -2090,7 +2151,7 @@ import { BrowserRouter, Routes, Route, useLocation as useLocation4, Navigate as
|
|
|
2090
2151
|
import { useEffect as useEffect3 } from "react";
|
|
2091
2152
|
import { Outlet } from "react-router-dom";
|
|
2092
2153
|
import {
|
|
2093
|
-
Box as
|
|
2154
|
+
Box as Box10,
|
|
2094
2155
|
AppBar,
|
|
2095
2156
|
Toolbar,
|
|
2096
2157
|
Typography as Typography8,
|
|
@@ -2183,7 +2244,7 @@ import MenuIcon from "@mui/icons-material/Menu";
|
|
|
2183
2244
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
2184
2245
|
|
|
2185
2246
|
// src/components/SideMenu.tsx
|
|
2186
|
-
import { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Divider, Box as
|
|
2247
|
+
import { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Divider, Box as Box9, Typography as Typography7, Collapse } from "@mui/material";
|
|
2187
2248
|
import ExpandLess from "@mui/icons-material/ExpandLess";
|
|
2188
2249
|
import ExpandMore from "@mui/icons-material/ExpandMore";
|
|
2189
2250
|
import TableChartIcon from "@mui/icons-material/TableChart";
|
|
@@ -2198,30 +2259,30 @@ import { useNavigate as useNavigate2, useLocation } from "react-router-dom";
|
|
|
2198
2259
|
import { blue, orange, teal, red, grey } from "@mui/material/colors";
|
|
2199
2260
|
|
|
2200
2261
|
// src/pages/WScreens.tsx
|
|
2201
|
-
import { Box as
|
|
2262
|
+
import { Box as Box8, Typography as Typography6, Paper } from "@mui/material";
|
|
2202
2263
|
import ConstructionIcon from "@mui/icons-material/Construction";
|
|
2203
2264
|
import WarningAmberIcon2 from "@mui/icons-material/WarningAmber";
|
|
2204
|
-
import { jsx as jsx14, jsxs as
|
|
2265
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2205
2266
|
var MyCustomDashboard = ({ screenName }) => {
|
|
2206
|
-
return /* @__PURE__ */ jsx14(
|
|
2207
|
-
/* @__PURE__ */
|
|
2267
|
+
return /* @__PURE__ */ jsx14(Box8, { sx: { p: 4, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsxs6(Paper, { elevation: 3, sx: { p: 4, textAlign: "center", maxWidth: 600 }, children: [
|
|
2268
|
+
/* @__PURE__ */ jsxs6(Typography6, { variant: "h5", component: "h1", gutterBottom: true, children: [
|
|
2208
2269
|
"\xA1Bienvenido a tu WScreen: ",
|
|
2209
2270
|
screenName,
|
|
2210
2271
|
"!"
|
|
2211
2272
|
] }),
|
|
2212
2273
|
/* @__PURE__ */ jsx14(Typography6, { variant: "body1", color: "text.secondary", children: "Esta es una pantalla de interfaz de usuario personalizada." }),
|
|
2213
|
-
/* @__PURE__ */ jsx14(
|
|
2274
|
+
/* @__PURE__ */ jsx14(Box8, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx14(ConstructionIcon, { sx: { fontSize: 80, color: "primary.main" } }) })
|
|
2214
2275
|
] }) });
|
|
2215
2276
|
};
|
|
2216
2277
|
var FallbackWScreen = ({ screenName }) => {
|
|
2217
|
-
return /* @__PURE__ */ jsx14(
|
|
2278
|
+
return /* @__PURE__ */ jsx14(Box8, { sx: { p: 4, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsxs6(Paper, { elevation: 3, sx: { p: 4, textAlign: "center", maxWidth: 600, backgroundColor: "warning.light", border: "1px solid orange" }, children: [
|
|
2218
2279
|
/* @__PURE__ */ jsx14(Typography6, { variant: "h5", component: "h1", gutterBottom: true, color: "warning.dark", children: "WScreen No Implementada" }),
|
|
2219
|
-
/* @__PURE__ */
|
|
2280
|
+
/* @__PURE__ */ jsxs6(Typography6, { variant: "body1", color: "warning.dark", children: [
|
|
2220
2281
|
'No se encontr\xF3 un componente implementado para la **WScreen**: **`"$',
|
|
2221
2282
|
screenName,
|
|
2222
2283
|
'"`**. Por favor, verifica el `menuType` en la definici\xF3n del men\xFA o aseg\xFArate de que el componente est\xE9 correctamente importado y mapeado en el frontend.'
|
|
2223
2284
|
] }),
|
|
2224
|
-
/* @__PURE__ */ jsx14(
|
|
2285
|
+
/* @__PURE__ */ jsx14(Box8, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx14(WarningAmberIcon2, { sx: { fontSize: 80, color: "warning.dark" } }) })
|
|
2225
2286
|
] }) });
|
|
2226
2287
|
};
|
|
2227
2288
|
var wScreens = {
|
|
@@ -2232,7 +2293,7 @@ var wScreens = {
|
|
|
2232
2293
|
var WScreens_default = FallbackWScreen;
|
|
2233
2294
|
|
|
2234
2295
|
// src/components/SideMenu.tsx
|
|
2235
|
-
import { Fragment, jsx as jsx15, jsxs as
|
|
2296
|
+
import { Fragment, jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2236
2297
|
var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
2237
2298
|
const navigate = useNavigate2();
|
|
2238
2299
|
const location = useLocation();
|
|
@@ -2295,8 +2356,8 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2295
2356
|
} else {
|
|
2296
2357
|
isSelected = currentPath.startsWith(`/wScreens/${item.menuType}`) || currentPath.startsWith(`/wScreens-fallback/${item.menuType}`);
|
|
2297
2358
|
}
|
|
2298
|
-
return /* @__PURE__ */
|
|
2299
|
-
/* @__PURE__ */
|
|
2359
|
+
return /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
2360
|
+
/* @__PURE__ */ jsxs7(
|
|
2300
2361
|
ListItemButton,
|
|
2301
2362
|
{
|
|
2302
2363
|
onClick: handleClick,
|
|
@@ -2339,17 +2400,17 @@ var SideMenu = ({ onMenuItemClick }) => {
|
|
|
2339
2400
|
dispatch(setAllSubMenusOpen(!isMostlyOpen));
|
|
2340
2401
|
};
|
|
2341
2402
|
if (!clientContext || !clientContext.menu) {
|
|
2342
|
-
return /* @__PURE__ */ jsx15(
|
|
2403
|
+
return /* @__PURE__ */ jsx15(Box9, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx15(Typography7, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
|
|
2343
2404
|
}
|
|
2344
2405
|
const isHomeSelected = location.pathname === "/home";
|
|
2345
|
-
return /* @__PURE__ */
|
|
2346
|
-
clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */
|
|
2406
|
+
return /* @__PURE__ */ jsxs7(Box9, { sx: { width: "100%", flexShrink: 0 }, children: [
|
|
2407
|
+
clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs7(ListItemButton, { onClick: handleToggleAllSubMenus, children: [
|
|
2347
2408
|
/* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: isMostlyOpen ? /* @__PURE__ */ jsx15(UnfoldLessIcon, {}) : /* @__PURE__ */ jsx15(UnfoldMoreIcon, {}) }),
|
|
2348
2409
|
/* @__PURE__ */ jsx15(ListItemText, { primary: isMostlyOpen ? "colapsar " : "expandir" })
|
|
2349
2410
|
] }) }),
|
|
2350
2411
|
/* @__PURE__ */ jsx15(Divider, {}),
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */
|
|
2412
|
+
/* @__PURE__ */ jsxs7(List, { children: [
|
|
2413
|
+
/* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs7(ListItemButton, { onClick: handleHomeClick, selected: isHomeSelected, children: [
|
|
2353
2414
|
/* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: /* @__PURE__ */ jsx15(HomeIcon, {}) }),
|
|
2354
2415
|
/* @__PURE__ */ jsx15(ListItemText, { primary: "Inicio" })
|
|
2355
2416
|
] }) }),
|
|
@@ -2397,7 +2458,7 @@ var useLogout = () => {
|
|
|
2397
2458
|
var useLogout_default = useLogout;
|
|
2398
2459
|
|
|
2399
2460
|
// src/components/MainLayout.tsx
|
|
2400
|
-
import { jsx as jsx16, jsxs as
|
|
2461
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2401
2462
|
var drawerWidth = 240;
|
|
2402
2463
|
var MainLayout = () => {
|
|
2403
2464
|
const { clientContext } = useApp();
|
|
@@ -2420,10 +2481,10 @@ var MainLayout = () => {
|
|
|
2420
2481
|
}
|
|
2421
2482
|
};
|
|
2422
2483
|
if (!clientContext) {
|
|
2423
|
-
return /* @__PURE__ */ jsx16(
|
|
2484
|
+
return /* @__PURE__ */ jsx16(Box10, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx16(Typography8, { children: "Cargando dise\xF1o de la aplicaci\xF3n..." }) });
|
|
2424
2485
|
}
|
|
2425
2486
|
const appBarOffset = theme.mixins.toolbar;
|
|
2426
|
-
return /* @__PURE__ */
|
|
2487
|
+
return /* @__PURE__ */ jsxs8(Box10, { sx: { display: "flex", height: "100vh" }, children: [
|
|
2427
2488
|
/* @__PURE__ */ jsx16(CssBaseline, {}),
|
|
2428
2489
|
/* @__PURE__ */ jsx16(
|
|
2429
2490
|
AppBar,
|
|
@@ -2444,7 +2505,7 @@ var MainLayout = () => {
|
|
|
2444
2505
|
})
|
|
2445
2506
|
}
|
|
2446
2507
|
},
|
|
2447
|
-
children: /* @__PURE__ */
|
|
2508
|
+
children: /* @__PURE__ */ jsxs8(Toolbar, { children: [
|
|
2448
2509
|
/* @__PURE__ */ jsx16(
|
|
2449
2510
|
IconButton3,
|
|
2450
2511
|
{
|
|
@@ -2472,7 +2533,7 @@ var MainLayout = () => {
|
|
|
2472
2533
|
] })
|
|
2473
2534
|
}
|
|
2474
2535
|
),
|
|
2475
|
-
/* @__PURE__ */
|
|
2536
|
+
/* @__PURE__ */ jsxs8(
|
|
2476
2537
|
Drawer,
|
|
2477
2538
|
{
|
|
2478
2539
|
variant: "persistent",
|
|
@@ -2508,7 +2569,7 @@ var MainLayout = () => {
|
|
|
2508
2569
|
}
|
|
2509
2570
|
),
|
|
2510
2571
|
/* @__PURE__ */ jsx16(
|
|
2511
|
-
|
|
2572
|
+
Box10,
|
|
2512
2573
|
{
|
|
2513
2574
|
component: "main",
|
|
2514
2575
|
sx: {
|
|
@@ -2543,9 +2604,9 @@ var MainLayout = () => {
|
|
|
2543
2604
|
var MainLayout_default = MainLayout;
|
|
2544
2605
|
|
|
2545
2606
|
// src/components/SessionExpiredMessage.tsx
|
|
2546
|
-
import { Box as
|
|
2607
|
+
import { Box as Box11, Typography as Typography9, Button as Button5, Modal } from "@mui/material";
|
|
2547
2608
|
import { useNavigate as useNavigate4 } from "react-router-dom";
|
|
2548
|
-
import { jsx as jsx17, jsxs as
|
|
2609
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2549
2610
|
var style = {
|
|
2550
2611
|
position: "absolute",
|
|
2551
2612
|
top: "50%",
|
|
@@ -2587,7 +2648,7 @@ var SessionExpiredMessage = () => {
|
|
|
2587
2648
|
}
|
|
2588
2649
|
}
|
|
2589
2650
|
},
|
|
2590
|
-
children: /* @__PURE__ */
|
|
2651
|
+
children: /* @__PURE__ */ jsxs9(Box11, { sx: style, children: [
|
|
2591
2652
|
/* @__PURE__ */ jsx17(Typography9, { id: "session-expired-modal-title", variant: "h6", component: "h2", gutterBottom: true, children: "\xA1Sesi\xF3n Expirada!" }),
|
|
2592
2653
|
/* @__PURE__ */ jsx17(Typography9, { id: "session-expired-modal-description", sx: { mt: 2, mb: 3 }, children: "Tu sesi\xF3n ha expirado por inactividad o por seguridad. Por favor, inicia sesi\xF3n de nuevo." }),
|
|
2593
2654
|
/* @__PURE__ */ jsx17(Button5, { variant: "contained", color: "primary", onClick: handleClose, children: "Ir al Login" })
|
|
@@ -2598,11 +2659,11 @@ var SessionExpiredMessage = () => {
|
|
|
2598
2659
|
var SessionExpiredMessage_default = SessionExpiredMessage;
|
|
2599
2660
|
|
|
2600
2661
|
// src/pages/HomePage.tsx
|
|
2601
|
-
import { Box as
|
|
2602
|
-
import { jsx as jsx18, jsxs as
|
|
2662
|
+
import { Box as Box12, Typography as Typography10 } from "@mui/material";
|
|
2663
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2603
2664
|
var HomePage = () => {
|
|
2604
2665
|
const { clientContext } = useApp();
|
|
2605
|
-
return /* @__PURE__ */
|
|
2666
|
+
return /* @__PURE__ */ jsxs10(Box12, { sx: { p: 3 }, children: [
|
|
2606
2667
|
/* @__PURE__ */ jsx18(Typography10, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${clientContext?.username}` }),
|
|
2607
2668
|
/* @__PURE__ */ jsx18(Typography10, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
|
|
2608
2669
|
] });
|
|
@@ -2611,14 +2672,14 @@ var HomePage_default = HomePage;
|
|
|
2611
2672
|
|
|
2612
2673
|
// src/pages/LogoutPage.tsx
|
|
2613
2674
|
import { useEffect as useEffect4 } from "react";
|
|
2614
|
-
import { Box as
|
|
2615
|
-
import { jsx as jsx19, jsxs as
|
|
2675
|
+
import { Box as Box13, Typography as Typography11, CircularProgress as CircularProgress2 } from "@mui/material";
|
|
2676
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2616
2677
|
var LogoutPage = () => {
|
|
2617
2678
|
const logout = useLogout_default();
|
|
2618
2679
|
useEffect4(() => {
|
|
2619
2680
|
logout();
|
|
2620
2681
|
}, [logout]);
|
|
2621
|
-
return /* @__PURE__ */
|
|
2682
|
+
return /* @__PURE__ */ jsxs11(Box13, { sx: {
|
|
2622
2683
|
display: "flex",
|
|
2623
2684
|
flexDirection: "column",
|
|
2624
2685
|
justifyContent: "center",
|
|
@@ -2634,13 +2695,13 @@ var LogoutPage_default = LogoutPage;
|
|
|
2634
2695
|
|
|
2635
2696
|
// src/pages/LoginPage.tsx
|
|
2636
2697
|
import { useState as useState6 } from "react";
|
|
2637
|
-
import { Button as Button6, TextField, Typography as Typography12, Alert as Alert2, AlertTitle, Box as
|
|
2698
|
+
import { Button as Button6, TextField, Typography as Typography12, Alert as Alert2, AlertTitle, Box as Box14, CircularProgress as CircularProgress3 } from "@mui/material";
|
|
2638
2699
|
import { useForm, Controller } from "react-hook-form";
|
|
2639
2700
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
2640
2701
|
import * as z from "zod";
|
|
2641
2702
|
import { useNavigate as useNavigate5 } from "react-router-dom";
|
|
2642
2703
|
import { useDispatch as useDispatch4 } from "react-redux";
|
|
2643
|
-
import { Fragment as Fragment2, jsx as jsx20, jsxs as
|
|
2704
|
+
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2644
2705
|
var loginSchema = z.object({
|
|
2645
2706
|
username: z.string().min(1, "El usuario es requerido"),
|
|
2646
2707
|
// Añadir validación básica
|
|
@@ -2697,15 +2758,15 @@ var LoginPage = () => {
|
|
|
2697
2758
|
}
|
|
2698
2759
|
};
|
|
2699
2760
|
return /* @__PURE__ */ jsx20(
|
|
2700
|
-
|
|
2761
|
+
Box14,
|
|
2701
2762
|
{
|
|
2702
2763
|
display: "flex",
|
|
2703
2764
|
alignItems: "center",
|
|
2704
2765
|
justifyContent: "center",
|
|
2705
2766
|
minHeight: "100vh",
|
|
2706
2767
|
bgcolor: "#f5f5f5",
|
|
2707
|
-
children: /* @__PURE__ */
|
|
2708
|
-
|
|
2768
|
+
children: /* @__PURE__ */ jsxs12(
|
|
2769
|
+
Box14,
|
|
2709
2770
|
{
|
|
2710
2771
|
width: "100%",
|
|
2711
2772
|
maxWidth: "400px",
|
|
@@ -2715,8 +2776,8 @@ var LoginPage = () => {
|
|
|
2715
2776
|
boxShadow: 3,
|
|
2716
2777
|
children: [
|
|
2717
2778
|
/* @__PURE__ */ jsx20(Typography12, { variant: "h5", align: "center", gutterBottom: true, children: "Iniciar Sesi\xF3n" }),
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
/* @__PURE__ */
|
|
2779
|
+
/* @__PURE__ */ jsxs12("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
2780
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
|
2720
2781
|
/* @__PURE__ */ jsx20("label", { htmlFor: "username", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
|
|
2721
2782
|
/* @__PURE__ */ jsx20(
|
|
2722
2783
|
Controller,
|
|
@@ -2739,7 +2800,7 @@ var LoginPage = () => {
|
|
|
2739
2800
|
}
|
|
2740
2801
|
)
|
|
2741
2802
|
] }),
|
|
2742
|
-
/* @__PURE__ */
|
|
2803
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
|
2743
2804
|
/* @__PURE__ */ jsx20("label", { htmlFor: "password", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
|
|
2744
2805
|
/* @__PURE__ */ jsx20(
|
|
2745
2806
|
Controller,
|
|
@@ -2762,12 +2823,12 @@ var LoginPage = () => {
|
|
|
2762
2823
|
}
|
|
2763
2824
|
)
|
|
2764
2825
|
] }),
|
|
2765
|
-
/* @__PURE__ */ jsx20(Button6, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */
|
|
2826
|
+
/* @__PURE__ */ jsx20(Button6, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
2766
2827
|
/* @__PURE__ */ jsx20(CircularProgress3, { size: 20, sx: { mr: 1 } }),
|
|
2767
2828
|
"Iniciando sesi\xF3n..."
|
|
2768
2829
|
] }) : "Iniciar Sesi\xF3n" })
|
|
2769
2830
|
] }),
|
|
2770
|
-
loginError && /* @__PURE__ */
|
|
2831
|
+
loginError && /* @__PURE__ */ jsxs12(Alert2, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
|
|
2771
2832
|
" ",
|
|
2772
2833
|
/* @__PURE__ */ jsx20(AlertTitle, { children: "Error" }),
|
|
2773
2834
|
loginError
|
|
@@ -2794,7 +2855,7 @@ import {
|
|
|
2794
2855
|
FormControlLabel,
|
|
2795
2856
|
FormHelperText,
|
|
2796
2857
|
Typography as Typography14,
|
|
2797
|
-
Box as
|
|
2858
|
+
Box as Box16,
|
|
2798
2859
|
CircularProgress as CircularProgress4,
|
|
2799
2860
|
Alert as Alert3,
|
|
2800
2861
|
Divider as Divider2,
|
|
@@ -2802,13 +2863,13 @@ import {
|
|
|
2802
2863
|
} from "@mui/material";
|
|
2803
2864
|
|
|
2804
2865
|
// src/pages/procedure-results/SuccessDisplay.tsx
|
|
2805
|
-
import { Box as
|
|
2806
|
-
import { jsx as jsx21, jsxs as
|
|
2866
|
+
import { Box as Box15, Typography as Typography13, Paper as Paper2 } from "@mui/material";
|
|
2867
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2807
2868
|
var SuccessDisplay = ({ data }) => {
|
|
2808
|
-
return /* @__PURE__ */
|
|
2869
|
+
return /* @__PURE__ */ jsxs13(Paper2, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
|
|
2809
2870
|
/* @__PURE__ */ jsx21(Typography13, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
|
|
2810
2871
|
/* @__PURE__ */ jsx21(Typography13, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
|
|
2811
|
-
/* @__PURE__ */ jsx21(
|
|
2872
|
+
/* @__PURE__ */ jsx21(Box15, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ jsx21("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
|
|
2812
2873
|
/* @__PURE__ */ jsx21(Typography13, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
|
|
2813
2874
|
] });
|
|
2814
2875
|
};
|
|
@@ -2823,7 +2884,7 @@ var extendResultsOk = (newComponents) => {
|
|
|
2823
2884
|
};
|
|
2824
2885
|
|
|
2825
2886
|
// src/components/ProcedureForm.tsx
|
|
2826
|
-
import { jsx as jsx22, jsxs as
|
|
2887
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2827
2888
|
var ProcedureForm = () => {
|
|
2828
2889
|
const { procedureName } = useParams();
|
|
2829
2890
|
const { clientContext } = useApp();
|
|
@@ -3038,9 +3099,9 @@ var ProcedureForm = () => {
|
|
|
3038
3099
|
sx: { fontSize: "0.8rem" }
|
|
3039
3100
|
};
|
|
3040
3101
|
if (param.options && param.options.length > 0) {
|
|
3041
|
-
return /* @__PURE__ */
|
|
3102
|
+
return /* @__PURE__ */ jsxs14(FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
|
|
3042
3103
|
/* @__PURE__ */ jsx22(InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
|
|
3043
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ jsxs14(
|
|
3044
3105
|
Select,
|
|
3045
3106
|
{
|
|
3046
3107
|
labelId: `${param.name}-label`,
|
|
@@ -3101,7 +3162,7 @@ var ProcedureForm = () => {
|
|
|
3101
3162
|
case "jsona":
|
|
3102
3163
|
return /* @__PURE__ */ jsx22(TextField2, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
|
|
3103
3164
|
case "bytea":
|
|
3104
|
-
return /* @__PURE__ */
|
|
3165
|
+
return /* @__PURE__ */ jsxs14(FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
|
|
3105
3166
|
/* @__PURE__ */ jsx22(Typography14, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
|
|
3106
3167
|
/* @__PURE__ */ jsx22(
|
|
3107
3168
|
"input",
|
|
@@ -3129,13 +3190,13 @@ var ProcedureForm = () => {
|
|
|
3129
3190
|
if (ComponentToRender) {
|
|
3130
3191
|
return /* @__PURE__ */ jsx22(ComponentToRender, { data: procedureResultData });
|
|
3131
3192
|
} else {
|
|
3132
|
-
return /* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */
|
|
3193
|
+
return /* @__PURE__ */ jsxs14(Paper3, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
|
|
3194
|
+
/* @__PURE__ */ jsxs14(Typography14, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
|
|
3134
3195
|
"el componente para resolver el resultOk: '",
|
|
3135
3196
|
procedure.resultOk,
|
|
3136
3197
|
"' definido en el procedure no existe o no est\xE1 mapeado."
|
|
3137
3198
|
] }),
|
|
3138
|
-
/* @__PURE__ */ jsx22(
|
|
3199
|
+
/* @__PURE__ */ jsx22(Box16, { sx: {
|
|
3139
3200
|
bgcolor: "warning.dark",
|
|
3140
3201
|
p: 1,
|
|
3141
3202
|
borderRadius: 1
|
|
@@ -3144,7 +3205,7 @@ var ProcedureForm = () => {
|
|
|
3144
3205
|
}
|
|
3145
3206
|
}, [procedureResultData, procedure]);
|
|
3146
3207
|
if (!procedure) {
|
|
3147
|
-
return /* @__PURE__ */
|
|
3208
|
+
return /* @__PURE__ */ jsxs14(Box16, { sx: {
|
|
3148
3209
|
p: 2,
|
|
3149
3210
|
width: "100%",
|
|
3150
3211
|
boxSizing: "border-box",
|
|
@@ -3160,7 +3221,7 @@ var ProcedureForm = () => {
|
|
|
3160
3221
|
}
|
|
3161
3222
|
return (
|
|
3162
3223
|
// Esta es la Box más externa que ahora controlará el scroll
|
|
3163
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ jsxs14(Box16, { sx: {
|
|
3164
3225
|
p: 2,
|
|
3165
3226
|
ml: 1,
|
|
3166
3227
|
mt: 2,
|
|
@@ -3178,13 +3239,13 @@ var ProcedureForm = () => {
|
|
|
3178
3239
|
// Oculta el scroll horizontal si no es necesario para el contenedor principal
|
|
3179
3240
|
}, children: [
|
|
3180
3241
|
/* @__PURE__ */ jsx22(Typography14, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
|
|
3181
|
-
Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */
|
|
3242
|
+
Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs14(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
|
|
3182
3243
|
"Por favor, corrige los errores en el formulario antes de enviar.",
|
|
3183
3244
|
/* @__PURE__ */ jsx22("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ jsx22("li", { children: err }, idx)) })
|
|
3184
3245
|
] }),
|
|
3185
3246
|
!Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ jsx22(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
|
|
3186
3247
|
!Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ jsx22(Alert3, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
|
|
3187
|
-
/* @__PURE__ */
|
|
3248
|
+
/* @__PURE__ */ jsxs14("form", { onSubmit: handleSubmit, children: [
|
|
3188
3249
|
procedure.parameters.map((param) => /* @__PURE__ */ jsx22("div", { children: renderInputField(param) }, param.name)),
|
|
3189
3250
|
/* @__PURE__ */ jsx22(
|
|
3190
3251
|
Button7,
|
|
@@ -3200,15 +3261,15 @@ var ProcedureForm = () => {
|
|
|
3200
3261
|
}
|
|
3201
3262
|
)
|
|
3202
3263
|
] }),
|
|
3203
|
-
ResultDisplayContent && /* @__PURE__ */
|
|
3264
|
+
ResultDisplayContent && /* @__PURE__ */ jsxs14(Box16, { sx: { mt: 2 }, children: [
|
|
3204
3265
|
" ",
|
|
3205
3266
|
ResultDisplayContent
|
|
3206
3267
|
] }),
|
|
3207
|
-
executionLog.length > 0 && /* @__PURE__ */
|
|
3268
|
+
executionLog.length > 0 && /* @__PURE__ */ jsxs14(Box16, { sx: { mt: 3 }, children: [
|
|
3208
3269
|
/* @__PURE__ */ jsx22(Divider2, { sx: { mb: 2 } }),
|
|
3209
3270
|
/* @__PURE__ */ jsx22(Typography14, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
|
|
3210
3271
|
/* @__PURE__ */ jsx22(
|
|
3211
|
-
|
|
3272
|
+
Box16,
|
|
3212
3273
|
{
|
|
3213
3274
|
sx: {
|
|
3214
3275
|
bgcolor: "grey.100",
|
|
@@ -3314,12 +3375,12 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
|
|
|
3314
3375
|
|
|
3315
3376
|
// src/pages/GenericDataGridPage.tsx
|
|
3316
3377
|
import { useParams as useParams2 } from "react-router-dom";
|
|
3317
|
-
import { Box as
|
|
3318
|
-
import { jsx as jsx24, jsxs as
|
|
3378
|
+
import { Box as Box17, Alert as Alert4, Typography as Typography15 } from "@mui/material";
|
|
3379
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3319
3380
|
var GenericDataGridPage = () => {
|
|
3320
3381
|
const { tableName } = useParams2();
|
|
3321
3382
|
if (!tableName) {
|
|
3322
|
-
return /* @__PURE__ */ jsx24(
|
|
3383
|
+
return /* @__PURE__ */ jsx24(Box17, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs15(Alert4, { severity: "error", children: [
|
|
3323
3384
|
/* @__PURE__ */ jsx24(Typography15, { variant: "h6", children: "Error: Nombre de tabla no especificado en la URL." }),
|
|
3324
3385
|
/* @__PURE__ */ jsx24(Typography15, { variant: "body1", children: "Por favor, aseg\xFArate de que la URL contenga el nombre de la tabla (ej. `/data/users`)." })
|
|
3325
3386
|
] }) });
|
|
@@ -3331,8 +3392,8 @@ var GenericDataGridPage_default = GenericDataGridPage;
|
|
|
3331
3392
|
// src/pages/MenuTablePage.tsx
|
|
3332
3393
|
import { useMemo as useMemo5 } from "react";
|
|
3333
3394
|
import { useParams as useParams3 } from "react-router-dom";
|
|
3334
|
-
import { Box as
|
|
3335
|
-
import { jsx as jsx25, jsxs as
|
|
3395
|
+
import { Box as Box18, Alert as Alert5, Typography as Typography16 } from "@mui/material";
|
|
3396
|
+
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3336
3397
|
var MenuTablePage = () => {
|
|
3337
3398
|
const { menuName } = useParams3();
|
|
3338
3399
|
const { clientContext } = useApp();
|
|
@@ -3374,7 +3435,7 @@ var MenuTablePage = () => {
|
|
|
3374
3435
|
};
|
|
3375
3436
|
}, [menuName, clientContext]);
|
|
3376
3437
|
if (!currentTableName) {
|
|
3377
|
-
return /* @__PURE__ */ jsx25(
|
|
3438
|
+
return /* @__PURE__ */ jsx25(Box18, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs16(Alert5, { severity: "error", children: [
|
|
3378
3439
|
/* @__PURE__ */ jsx25(Typography16, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
|
|
3379
3440
|
/* @__PURE__ */ jsx25(Typography16, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
|
|
3380
3441
|
] }) });
|
|
@@ -3390,7 +3451,7 @@ var MenuTablePage = () => {
|
|
|
3390
3451
|
var MenuTablePage_default = MenuTablePage;
|
|
3391
3452
|
|
|
3392
3453
|
// src/App.tsx
|
|
3393
|
-
import { jsx as jsx26, jsxs as
|
|
3454
|
+
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3394
3455
|
var LocationTracker = () => {
|
|
3395
3456
|
const location = useLocation4();
|
|
3396
3457
|
const dispatch = useAppDispatch();
|
|
@@ -3401,10 +3462,10 @@ var LocationTracker = () => {
|
|
|
3401
3462
|
};
|
|
3402
3463
|
function FrontendPlusReactRoutes({ myRoutes, myWScreens }) {
|
|
3403
3464
|
const allWScreens = { ...wScreens, ...myWScreens || {} };
|
|
3404
|
-
return /* @__PURE__ */
|
|
3465
|
+
return /* @__PURE__ */ jsxs17(Routes, { children: [
|
|
3405
3466
|
/* @__PURE__ */ jsx26(Route, { path: "/login", element: /* @__PURE__ */ jsx26(LoginPage_default, {}) }),
|
|
3406
3467
|
/* @__PURE__ */ jsx26(Route, { path: "/logout", element: /* @__PURE__ */ jsx26(LogoutPage_default, {}) }),
|
|
3407
|
-
/* @__PURE__ */
|
|
3468
|
+
/* @__PURE__ */ jsxs17(Route, { element: /* @__PURE__ */ jsxs17(PrivateRoute_default, { children: [
|
|
3408
3469
|
/* @__PURE__ */ jsx26(InitialRedirectHandler_default, {}),
|
|
3409
3470
|
/* @__PURE__ */ jsx26(MainLayout_default, {})
|
|
3410
3471
|
] }), children: [
|
|
@@ -3448,9 +3509,9 @@ var App = ({
|
|
|
3448
3509
|
extendResultsOk(myResultsOk);
|
|
3449
3510
|
}
|
|
3450
3511
|
}, [myClientSides, myResultsOk]);
|
|
3451
|
-
return /* @__PURE__ */ jsx26(Provider, { store, children: /* @__PURE__ */ jsx26(PersistGate, { loading: null, persistor, children: /* @__PURE__ */
|
|
3512
|
+
return /* @__PURE__ */ jsx26(Provider, { store, children: /* @__PURE__ */ jsx26(PersistGate, { loading: null, persistor, children: /* @__PURE__ */ jsxs17(BrowserRouter, { children: [
|
|
3452
3513
|
/* @__PURE__ */ jsx26(LocationTracker, {}),
|
|
3453
|
-
/* @__PURE__ */ jsx26(AppProvider, { children: /* @__PURE__ */
|
|
3514
|
+
/* @__PURE__ */ jsx26(AppProvider, { children: /* @__PURE__ */ jsxs17(SnackbarProvider, { children: [
|
|
3454
3515
|
/* @__PURE__ */ jsx26(
|
|
3455
3516
|
FrontendPlusReactRoutes,
|
|
3456
3517
|
{
|