frontend-plus-react 0.1.2 → 0.1.4
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 +439 -399
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +622 -582
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -784,11 +784,10 @@ var useApiCall = () => {
|
|
|
784
784
|
import {
|
|
785
785
|
CircularProgress,
|
|
786
786
|
Typography as Typography5,
|
|
787
|
-
Box as
|
|
787
|
+
Box as Box5,
|
|
788
788
|
Alert,
|
|
789
|
-
useTheme,
|
|
790
|
-
Button as
|
|
791
|
-
IconButton
|
|
789
|
+
useTheme as useTheme2,
|
|
790
|
+
Button as Button3
|
|
792
791
|
} from "@mui/material";
|
|
793
792
|
|
|
794
793
|
// src/utils/functions.tsx
|
|
@@ -991,17 +990,45 @@ var useRedirectPath = () => {
|
|
|
991
990
|
var cambiarGuionesBajosPorEspacios = (texto) => texto.replace(/_/g, " ");
|
|
992
991
|
|
|
993
992
|
// src/components/grid/GenericDataGrid.tsx
|
|
994
|
-
import SearchIcon from "@mui/icons-material/Search";
|
|
995
|
-
import SearchOffIcon from "@mui/icons-material/SearchOff";
|
|
996
993
|
import AddIcon from "@mui/icons-material/Add";
|
|
997
994
|
|
|
998
|
-
// src/components/
|
|
999
|
-
import
|
|
1000
|
-
import
|
|
1001
|
-
|
|
995
|
+
// src/components/ConfirmDialog.tsx
|
|
996
|
+
import Dialog from "@mui/material/Dialog";
|
|
997
|
+
import DialogTitle from "@mui/material/DialogTitle";
|
|
998
|
+
import DialogContent from "@mui/material/DialogContent";
|
|
999
|
+
import DialogContentText from "@mui/material/DialogContentText";
|
|
1000
|
+
import DialogActions from "@mui/material/DialogActions";
|
|
1001
|
+
import Button from "@mui/material/Button";
|
|
1002
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1003
|
+
var ConfirmDialog = ({ open, onClose, title, message }) => {
|
|
1004
|
+
return /* @__PURE__ */ jsxs2(
|
|
1005
|
+
Dialog,
|
|
1006
|
+
{
|
|
1007
|
+
open,
|
|
1008
|
+
onClose: () => onClose(false),
|
|
1009
|
+
"aria-labelledby": "confirm-dialog-title",
|
|
1010
|
+
"aria-describedby": "confirm-dialog-description",
|
|
1011
|
+
children: [
|
|
1012
|
+
/* @__PURE__ */ jsx2(DialogTitle, { id: "confirm-dialog-title", children: title }),
|
|
1013
|
+
/* @__PURE__ */ jsx2(DialogContent, { children: /* @__PURE__ */ jsx2(DialogContentText, { id: "confirm-dialog-description", children: message }) }),
|
|
1014
|
+
/* @__PURE__ */ jsxs2(DialogActions, { children: [
|
|
1015
|
+
/* @__PURE__ */ jsx2(Button, { onClick: () => onClose(false), color: "primary", children: "Cancelar" }),
|
|
1016
|
+
/* @__PURE__ */ jsx2(Button, { onClick: () => onClose(true), color: "error", autoFocus: true, children: "Confirmar" })
|
|
1017
|
+
] })
|
|
1018
|
+
]
|
|
1019
|
+
}
|
|
1020
|
+
);
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
// src/components/grid/renderers/headerCellRenderers.tsx
|
|
1024
|
+
import { Box, IconButton, Tooltip, Typography } from "@mui/material";
|
|
1025
|
+
import SearchIcon from "@mui/icons-material/Search";
|
|
1026
|
+
import SearchOffIcon from "@mui/icons-material/SearchOff";
|
|
1027
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1028
|
+
var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
|
|
1002
1029
|
const { column } = props;
|
|
1003
|
-
const isPrimaryKey =
|
|
1004
|
-
return /* @__PURE__ */
|
|
1030
|
+
const isPrimaryKey = fieldDef.isPk;
|
|
1031
|
+
return /* @__PURE__ */ jsx3(
|
|
1005
1032
|
Box,
|
|
1006
1033
|
{
|
|
1007
1034
|
sx: {
|
|
@@ -1013,7 +1040,7 @@ function PkHeaderRenderer(props) {
|
|
|
1013
1040
|
boxSizing: "border-box",
|
|
1014
1041
|
height: "100%"
|
|
1015
1042
|
},
|
|
1016
|
-
children: /* @__PURE__ */
|
|
1043
|
+
children: /* @__PURE__ */ jsx3(
|
|
1017
1044
|
Typography,
|
|
1018
1045
|
{
|
|
1019
1046
|
variant: "body2",
|
|
@@ -1028,73 +1055,29 @@ function PkHeaderRenderer(props) {
|
|
|
1028
1055
|
)
|
|
1029
1056
|
}
|
|
1030
1057
|
);
|
|
1031
|
-
}
|
|
1032
|
-
var PkHeaderRenderer_default = PkHeaderRenderer;
|
|
1033
|
-
|
|
1034
|
-
// src/components/grid/PkCellRenderer.tsx
|
|
1035
|
-
import { Typography as Typography2 } from "@mui/material";
|
|
1036
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1037
|
-
function PkCellRenderer(props) {
|
|
1038
|
-
const { column, row } = props;
|
|
1039
|
-
const isPrimaryKey = column.isPK;
|
|
1040
|
-
const rowAsRecord = row;
|
|
1041
|
-
const value = rowAsRecord[column.key];
|
|
1042
|
-
return /* @__PURE__ */ jsx3(
|
|
1043
|
-
Typography2,
|
|
1044
|
-
{
|
|
1045
|
-
variant: "body2",
|
|
1046
|
-
sx: {
|
|
1047
|
-
//fontWeight: isPrimaryKey ? 'bold' : 'normal',
|
|
1048
|
-
fontSize: "0.875rem",
|
|
1049
|
-
// Ajusta el tamaño si es necesario
|
|
1050
|
-
whiteSpace: "nowrap",
|
|
1051
|
-
overflow: "hidden",
|
|
1052
|
-
textOverflow: "ellipsis",
|
|
1053
|
-
width: "100%"
|
|
1054
|
-
},
|
|
1055
|
-
children: value === null || value === void 0 ? "" : String(value)
|
|
1056
|
-
}
|
|
1057
|
-
);
|
|
1058
|
-
}
|
|
1059
|
-
var PkCellRenderer_default = PkCellRenderer;
|
|
1060
|
-
|
|
1061
|
-
// src/components/ConfirmDialog.tsx
|
|
1062
|
-
import Dialog from "@mui/material/Dialog";
|
|
1063
|
-
import DialogTitle from "@mui/material/DialogTitle";
|
|
1064
|
-
import DialogContent from "@mui/material/DialogContent";
|
|
1065
|
-
import DialogContentText from "@mui/material/DialogContentText";
|
|
1066
|
-
import DialogActions from "@mui/material/DialogActions";
|
|
1067
|
-
import Button from "@mui/material/Button";
|
|
1068
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1069
|
-
var ConfirmDialog = ({ open, onClose, title, message }) => {
|
|
1070
|
-
return /* @__PURE__ */ jsxs2(
|
|
1071
|
-
Dialog,
|
|
1072
|
-
{
|
|
1073
|
-
open,
|
|
1074
|
-
onClose: () => onClose(false),
|
|
1075
|
-
"aria-labelledby": "confirm-dialog-title",
|
|
1076
|
-
"aria-describedby": "confirm-dialog-description",
|
|
1077
|
-
children: [
|
|
1078
|
-
/* @__PURE__ */ jsx4(DialogTitle, { id: "confirm-dialog-title", children: title }),
|
|
1079
|
-
/* @__PURE__ */ jsx4(DialogContent, { children: /* @__PURE__ */ jsx4(DialogContentText, { id: "confirm-dialog-description", children: message }) }),
|
|
1080
|
-
/* @__PURE__ */ jsxs2(DialogActions, { children: [
|
|
1081
|
-
/* @__PURE__ */ jsx4(Button, { onClick: () => onClose(false), color: "primary", children: "Cancelar" }),
|
|
1082
|
-
/* @__PURE__ */ jsx4(Button, { onClick: () => onClose(true), color: "error", autoFocus: true, children: "Confirmar" })
|
|
1083
|
-
] })
|
|
1084
|
-
]
|
|
1085
|
-
}
|
|
1086
|
-
);
|
|
1087
1058
|
};
|
|
1059
|
+
var actionsColumnHeaderCellRenderer = (props, isFilterRowVisible, toggleFilterVisibility) => /* @__PURE__ */ jsx3(
|
|
1060
|
+
IconButton,
|
|
1061
|
+
{
|
|
1062
|
+
color: "inherit",
|
|
1063
|
+
onClick: toggleFilterVisibility,
|
|
1064
|
+
size: "small",
|
|
1065
|
+
title: isFilterRowVisible ? "Ocultar filtros" : "Mostrar filtros",
|
|
1066
|
+
sx: { p: 0.5 },
|
|
1067
|
+
children: isFilterRowVisible ? /* @__PURE__ */ jsx3(SearchOffIcon, { sx: { fontSize: 20 } }) : /* @__PURE__ */ jsx3(SearchIcon, { sx: { fontSize: 20 } })
|
|
1068
|
+
}
|
|
1069
|
+
);
|
|
1070
|
+
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() }) });
|
|
1088
1071
|
|
|
1089
1072
|
// src/components/grid/FilterInputRender.tsx
|
|
1090
1073
|
import { InputBase } from "@mui/material";
|
|
1091
|
-
import { jsx as
|
|
1074
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1092
1075
|
function FilterInputRenderer({
|
|
1093
1076
|
column,
|
|
1094
1077
|
filters,
|
|
1095
1078
|
setFilters
|
|
1096
1079
|
}) {
|
|
1097
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ jsx4(
|
|
1098
1081
|
InputBase,
|
|
1099
1082
|
{
|
|
1100
1083
|
value: filters[column.key] || "",
|
|
@@ -1117,10 +1100,212 @@ function FilterInputRenderer({
|
|
|
1117
1100
|
}
|
|
1118
1101
|
var FilterInputRender_default = FilterInputRenderer;
|
|
1119
1102
|
|
|
1120
|
-
// src/components/grid/
|
|
1103
|
+
// src/components/grid/renderers/summaryCellRenderers.tsx
|
|
1104
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1105
|
+
var defaultColumnSummaryCellRenderer = (props, fixedFields, isFilterRowVisible, filters, setFilters) => {
|
|
1106
|
+
const { column } = props;
|
|
1107
|
+
const fixedFieldEntry = fixedFields?.find((f) => f.fieldName === column.key);
|
|
1108
|
+
if (fixedFieldEntry && fixedFieldEntry.until === void 0 || !isFilterRowVisible) return null;
|
|
1109
|
+
return /* @__PURE__ */ jsx5(
|
|
1110
|
+
FilterInputRender_default,
|
|
1111
|
+
{
|
|
1112
|
+
column,
|
|
1113
|
+
filters,
|
|
1114
|
+
setFilters
|
|
1115
|
+
}
|
|
1116
|
+
);
|
|
1117
|
+
};
|
|
1118
|
+
var actionsColumnSummaryCellRenderer = (props) => null;
|
|
1119
|
+
var detailColumnCellSummaryRenderer = (props) => null;
|
|
1120
|
+
|
|
1121
|
+
// src/components/grid/renderers/cellRenderers.tsx
|
|
1122
|
+
import { Box as Box4, Button as Button2, IconButton as IconButton2, Tooltip as Tooltip3, Typography as Typography4, useTheme } from "@mui/material";
|
|
1123
|
+
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
1124
|
+
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
|
|
1125
|
+
import DeleteIcon from "@mui/icons-material/Delete";
|
|
1126
|
+
|
|
1127
|
+
// src/components/grid/ExampleClientSideComponent.tsx
|
|
1128
|
+
import { Box as Box2, Typography as Typography2 } from "@mui/material";
|
|
1129
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1130
|
+
var ExampleClientSideComponent = ({ row, column, fieldDefinition }) => {
|
|
1131
|
+
const value = row[column.key];
|
|
1132
|
+
return /* @__PURE__ */ jsx6(Box2, { sx: {
|
|
1133
|
+
padding: 0.5,
|
|
1134
|
+
width: "100%",
|
|
1135
|
+
height: "100%",
|
|
1136
|
+
display: "flex",
|
|
1137
|
+
alignItems: "center",
|
|
1138
|
+
backgroundColor: value === "Special" ? "lightblue" : "transparent"
|
|
1139
|
+
}, children: /* @__PURE__ */ jsx6(Typography2, { variant: "body2", sx: { fontWeight: "bold" }, children: value ? `CS: ${value}` : "N/A" }) });
|
|
1140
|
+
};
|
|
1141
|
+
var ExampleClientSideComponent_default = ExampleClientSideComponent;
|
|
1142
|
+
|
|
1143
|
+
// src/components/grid/FallbackClientSideRenderer.tsx
|
|
1144
|
+
import { Box as Box3, Typography as Typography3, Tooltip as Tooltip2 } from "@mui/material";
|
|
1145
|
+
import WarningAmberIcon from "@mui/icons-material/WarningAmber";
|
|
1146
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1147
|
+
var FallbackClientSideRenderer = ({ column, row, fieldDefinition }) => {
|
|
1148
|
+
const value = row[column.key];
|
|
1149
|
+
const clientSideName = fieldDefinition?.clientSide || "Desconocido";
|
|
1150
|
+
return /* @__PURE__ */ jsx7(Tooltip2, { title: `Componente clientSide '${clientSideName}' no implementado. Mostrando valor por defecto.`, children: /* @__PURE__ */ jsxs3(
|
|
1151
|
+
Box3,
|
|
1152
|
+
{
|
|
1153
|
+
sx: {
|
|
1154
|
+
display: "flex",
|
|
1155
|
+
alignItems: "center",
|
|
1156
|
+
justifyContent: "space-between",
|
|
1157
|
+
// Para espaciar el valor y el icono
|
|
1158
|
+
gap: 1,
|
|
1159
|
+
// Espacio entre elementos
|
|
1160
|
+
width: "100%",
|
|
1161
|
+
height: "100%",
|
|
1162
|
+
paddingLeft: "8px",
|
|
1163
|
+
backgroundColor: "rgba(255, 193, 7, 0.1)",
|
|
1164
|
+
// Amarillo claro para advertencia
|
|
1165
|
+
border: "1px dashed rgba(255, 193, 7, 0.5)",
|
|
1166
|
+
boxSizing: "border-box",
|
|
1167
|
+
overflow: "hidden"
|
|
1168
|
+
// Evita que el contenido se desborde
|
|
1169
|
+
},
|
|
1170
|
+
children: [
|
|
1171
|
+
/* @__PURE__ */ jsx7(Typography3, { variant: "body2", noWrap: true, sx: { flexGrow: 1 }, children: value !== null && value !== void 0 ? String(value) : "*Vac\xEDo*" }),
|
|
1172
|
+
/* @__PURE__ */ jsx7(
|
|
1173
|
+
WarningAmberIcon,
|
|
1174
|
+
{
|
|
1175
|
+
sx: {
|
|
1176
|
+
fontSize: 18,
|
|
1177
|
+
color: "warning.main",
|
|
1178
|
+
marginRight: "4px"
|
|
1179
|
+
// Pequeño margen a la derecha del icono
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
)
|
|
1183
|
+
]
|
|
1184
|
+
}
|
|
1185
|
+
) });
|
|
1186
|
+
};
|
|
1187
|
+
var FallbackClientSideRenderer_default = FallbackClientSideRenderer;
|
|
1188
|
+
|
|
1189
|
+
// src/components/grid/clientSides.ts
|
|
1190
|
+
var clientSides = {
|
|
1191
|
+
"ExampleClientSideComponent": ExampleClientSideComponent_default,
|
|
1192
|
+
// Aseguramos el tipo aquí también
|
|
1193
|
+
"FallbackClientSideRenderer": FallbackClientSideRenderer_default
|
|
1194
|
+
// Y aquí
|
|
1195
|
+
};
|
|
1196
|
+
var extendClientSides = (newRenderers) => {
|
|
1197
|
+
clientSides = { ...clientSides, ...newRenderers };
|
|
1198
|
+
console.log("clientSides extendidos:", clientSides);
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
// src/components/grid/renderers/cellRenderers.tsx
|
|
1202
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1203
|
+
var allColumnsCellRenderer = (props) => {
|
|
1204
|
+
const theme = useTheme();
|
|
1205
|
+
const column = props.column;
|
|
1206
|
+
const { row, rowIdx } = props;
|
|
1207
|
+
if (row[DETAIL_ROW_INDICATOR]) {
|
|
1208
|
+
const detailTableAbr = row[DETAIL_ROW_INDICATOR];
|
|
1209
|
+
const detailColumn = column;
|
|
1210
|
+
if (column.customType === "detail" && detailColumn.detailTable.abr === detailTableAbr) {
|
|
1211
|
+
const detailTable = detailColumn.tableDefinition.detailTables.find((dt) => dt.abr === detailTableAbr);
|
|
1212
|
+
let fixedFields = [];
|
|
1213
|
+
detailTable.fields.forEach((field) => {
|
|
1214
|
+
if (typeof field === "string") {
|
|
1215
|
+
fixedFields.push({ fieldName: field, value: row[field] });
|
|
1216
|
+
} else {
|
|
1217
|
+
fixedFields.push({ fieldName: field.target, value: row[field.source] });
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
return /* @__PURE__ */ jsx8(Box4, { sx: {
|
|
1221
|
+
// Se eliminó el padding para que la sub-grilla se extienda por completo
|
|
1222
|
+
minHeight: "200px",
|
|
1223
|
+
width: "100%",
|
|
1224
|
+
height: "100%",
|
|
1225
|
+
//display: 'flex',
|
|
1226
|
+
//flexDirection: 'column',
|
|
1227
|
+
boxSizing: "border-box"
|
|
1228
|
+
}, children: /* @__PURE__ */ jsx8(GenericDataGrid_default, { tableName: detailTable.table, fixedFields }) });
|
|
1229
|
+
}
|
|
1230
|
+
return void 0;
|
|
1231
|
+
}
|
|
1232
|
+
switch (column.customType) {
|
|
1233
|
+
case "default": {
|
|
1234
|
+
const defaultColumn = column;
|
|
1235
|
+
const { fieldDef, tableDefinition, primaryKey, cellFeedback, fixedFields, localCellChanges } = defaultColumn;
|
|
1236
|
+
const rowId = getPrimaryKeyValues(row, primaryKey);
|
|
1237
|
+
if (fieldDef?.clientSide) {
|
|
1238
|
+
const ClientSideComponent = clientSides[fieldDef.clientSide];
|
|
1239
|
+
if (ClientSideComponent) {
|
|
1240
|
+
return /* @__PURE__ */ jsx8(ClientSideComponent, { ...props, fieldDefinition: fieldDef, tableDefinition, primaryKey });
|
|
1241
|
+
}
|
|
1242
|
+
return /* @__PURE__ */ jsx8(FallbackClientSideRenderer_default, { ...props, fieldDefinition: fieldDef, tableDefinition, primaryKey });
|
|
1243
|
+
}
|
|
1244
|
+
let cellBackgroundColor = "transparent";
|
|
1245
|
+
if (cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key) {
|
|
1246
|
+
cellBackgroundColor = cellFeedback.type === "error" ? theme.palette.error.light : theme.palette.success.light;
|
|
1247
|
+
} else {
|
|
1248
|
+
const isNewRowLocalCheck = row[NEW_ROW_INDICATOR];
|
|
1249
|
+
const isMandatory = tableDefinition.primaryKey.includes(props.column.key) || tableDefinition.fields.find((f) => f.name === props.column.key)?.nullable === false;
|
|
1250
|
+
const hasValue = row[props.column.key] !== null && row[props.column.key] !== void 0 && String(row[props.column.key]).trim() !== "";
|
|
1251
|
+
const isFixedFieldCurrent = fixedFields?.some((f) => f.fieldName === props.column.key);
|
|
1252
|
+
if (isFixedFieldCurrent) {
|
|
1253
|
+
cellBackgroundColor = theme.palette.action.selected;
|
|
1254
|
+
} else if (isNewRowLocalCheck && isMandatory && !hasValue || localCellChanges.has(rowId) && localCellChanges.get(rowId)?.has(props.column.key)) {
|
|
1255
|
+
cellBackgroundColor = theme.palette.info.light;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
const value = row[props.column.key];
|
|
1259
|
+
return /* @__PURE__ */ jsx8(Box4, { 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) }) });
|
|
1260
|
+
}
|
|
1261
|
+
case "detail": {
|
|
1262
|
+
const detailColumn = column;
|
|
1263
|
+
const { detailTable, primaryKey, tableData, setTableData, detailKey } = detailColumn;
|
|
1264
|
+
const isExpanded = tableData.some(
|
|
1265
|
+
(r) => r[DETAIL_ROW_INDICATOR] === detailTable.abr && getPrimaryKeyValues(r, primaryKey) === getPrimaryKeyValues({ ...row, [DETAIL_ROW_INDICATOR]: detailTable.abr }, primaryKey)
|
|
1266
|
+
);
|
|
1267
|
+
return /* @__PURE__ */ jsx8(Tooltip3, { title: detailTable.label, children: /* @__PURE__ */ jsx8(Box4, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx8(
|
|
1268
|
+
IconButton2,
|
|
1269
|
+
{
|
|
1270
|
+
size: "small",
|
|
1271
|
+
onClick: (event) => {
|
|
1272
|
+
let rows = [...tableData];
|
|
1273
|
+
const rowId = getPrimaryKeyValues({ ...row, [DETAIL_ROW_INDICATOR]: detailTable.abr }, primaryKey);
|
|
1274
|
+
if (isExpanded) {
|
|
1275
|
+
setTableData(rows.filter(
|
|
1276
|
+
(r) => !(r[DETAIL_ROW_INDICATOR] === detailTable.abr && getPrimaryKeyValues(r, primaryKey) === rowId)
|
|
1277
|
+
));
|
|
1278
|
+
} else {
|
|
1279
|
+
const parentRowIndex = rowIdx;
|
|
1280
|
+
rows.splice(parentRowIndex + 1, 0, {
|
|
1281
|
+
...row,
|
|
1282
|
+
[DETAIL_ROW_INDICATOR]: detailTable.abr
|
|
1283
|
+
});
|
|
1284
|
+
setTableData(rows);
|
|
1285
|
+
}
|
|
1286
|
+
event.stopPropagation();
|
|
1287
|
+
},
|
|
1288
|
+
title: isExpanded ? "Contraer detalle" : "Expandir detalle",
|
|
1289
|
+
sx: { p: 0.5 },
|
|
1290
|
+
children: isExpanded ? /* @__PURE__ */ jsx8(KeyboardArrowUpIcon, { sx: { fontSize: 20 } }) : /* @__PURE__ */ jsx8(KeyboardArrowDownIcon, { sx: { fontSize: 20 } })
|
|
1291
|
+
}
|
|
1292
|
+
) }) });
|
|
1293
|
+
}
|
|
1294
|
+
case "action": {
|
|
1295
|
+
const actionColumn = column;
|
|
1296
|
+
const { tableDefinition, handleDeleteRow } = actionColumn;
|
|
1297
|
+
if (!tableDefinition.allow?.delete) return void 0;
|
|
1298
|
+
return /* @__PURE__ */ jsx8(Box4, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx8(Button2, { variant: "outlined", color: "error", size: "small", onClick: () => handleDeleteRow(row), title: "Eliminar fila", sx: { minWidth: 35, height: 30, p: 0.5, "& .MuiButton-startIcon": { m: 0 } }, children: /* @__PURE__ */ jsx8(DeleteIcon, { sx: { fontSize: 18 } }) }) });
|
|
1299
|
+
}
|
|
1300
|
+
default:
|
|
1301
|
+
return void 0;
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
// src/components/grid/InputRenderer.tsx
|
|
1121
1306
|
import { useCallback as useCallback3, useMemo, useState as useState3 } from "react";
|
|
1122
1307
|
import InputBase2 from "@mui/material/InputBase";
|
|
1123
|
-
import { jsx as
|
|
1308
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1124
1309
|
function InputRenderer({
|
|
1125
1310
|
column,
|
|
1126
1311
|
row,
|
|
@@ -1139,7 +1324,7 @@ function InputRenderer({
|
|
|
1139
1324
|
const [editingValue, setEditingValue] = useState3(row[column.key]);
|
|
1140
1325
|
const { showSuccess, showError } = useSnackbar();
|
|
1141
1326
|
const initialRowId = useMemo(() => getPrimaryKeyValues(row, primaryKey), [row, primaryKey]);
|
|
1142
|
-
const { callApi
|
|
1327
|
+
const { callApi } = useApiCall();
|
|
1143
1328
|
const handleCommit = useCallback3(async (currentValue, closeEditor, focusNextCell) => {
|
|
1144
1329
|
const processedNewValue = typeof currentValue === "string" ? currentValue.trim() === "" ? null : currentValue.trim() : currentValue;
|
|
1145
1330
|
const potentialUpdatedRow = { ...row, [column.key]: processedNewValue };
|
|
@@ -1317,7 +1502,7 @@ function InputRenderer({
|
|
|
1317
1502
|
}, [handleCommit, editingValue]);
|
|
1318
1503
|
const fieldDefinition = tableDefinition.fields.find((f) => f.name === column.key);
|
|
1319
1504
|
const isFieldEditable = fieldDefinition?.editable !== false;
|
|
1320
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ jsx9(
|
|
1321
1506
|
InputBase2,
|
|
1322
1507
|
{
|
|
1323
1508
|
value: editingValue === null ? "" : editingValue,
|
|
@@ -1340,90 +1525,65 @@ function InputRenderer({
|
|
|
1340
1525
|
}
|
|
1341
1526
|
);
|
|
1342
1527
|
}
|
|
1343
|
-
var
|
|
1528
|
+
var InputRenderer_default = InputRenderer;
|
|
1344
1529
|
|
|
1345
|
-
// src/components/grid/
|
|
1346
|
-
import {
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
alignItems: "center",
|
|
1356
|
-
backgroundColor: value === "Special" ? "lightblue" : "transparent"
|
|
1357
|
-
}, children: /* @__PURE__ */ jsx7(Typography3, { variant: "body2", sx: { fontWeight: "bold" }, children: value ? `CS: ${value}` : "N/A" }) });
|
|
1358
|
-
};
|
|
1359
|
-
var ExampleClientSideComponent_default = ExampleClientSideComponent;
|
|
1360
|
-
|
|
1361
|
-
// src/components/grid/FallbackClientSideRenderer.tsx
|
|
1362
|
-
import { Box as Box3, Typography as Typography4, Tooltip } from "@mui/material";
|
|
1363
|
-
import WarningAmberIcon from "@mui/icons-material/WarningAmber";
|
|
1364
|
-
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1365
|
-
var FallbackClientSideRenderer = ({ column, row, fieldDefinition }) => {
|
|
1366
|
-
const value = row[column.key];
|
|
1367
|
-
const clientSideName = fieldDefinition?.clientSide || "Desconocido";
|
|
1368
|
-
return /* @__PURE__ */ jsx8(Tooltip, { title: `Componente clientSide '${clientSideName}' no implementado. Mostrando valor por defecto.`, children: /* @__PURE__ */ jsxs3(
|
|
1369
|
-
Box3,
|
|
1370
|
-
{
|
|
1371
|
-
sx: {
|
|
1372
|
-
display: "flex",
|
|
1373
|
-
alignItems: "center",
|
|
1374
|
-
justifyContent: "space-between",
|
|
1375
|
-
// Para espaciar el valor y el icono
|
|
1376
|
-
gap: 1,
|
|
1377
|
-
// Espacio entre elementos
|
|
1378
|
-
width: "100%",
|
|
1379
|
-
height: "100%",
|
|
1380
|
-
paddingLeft: "8px",
|
|
1381
|
-
backgroundColor: "rgba(255, 193, 7, 0.1)",
|
|
1382
|
-
// Amarillo claro para advertencia
|
|
1383
|
-
border: "1px dashed rgba(255, 193, 7, 0.5)",
|
|
1384
|
-
boxSizing: "border-box",
|
|
1385
|
-
overflow: "hidden"
|
|
1386
|
-
// Evita que el contenido se desborde
|
|
1387
|
-
},
|
|
1388
|
-
children: [
|
|
1389
|
-
/* @__PURE__ */ jsx8(Typography4, { variant: "body2", noWrap: true, sx: { flexGrow: 1 }, children: value !== null && value !== void 0 ? String(value) : "*Vac\xEDo*" }),
|
|
1390
|
-
/* @__PURE__ */ jsx8(
|
|
1391
|
-
WarningAmberIcon,
|
|
1392
|
-
{
|
|
1393
|
-
sx: {
|
|
1394
|
-
fontSize: 18,
|
|
1395
|
-
color: "warning.main",
|
|
1396
|
-
marginRight: "4px"
|
|
1397
|
-
// Pequeño margen a la derecha del icono
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
)
|
|
1401
|
-
]
|
|
1530
|
+
// src/components/grid/renderers/editCellRenderers.tsx
|
|
1531
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1532
|
+
var defaultColumnEditCellRenderer = (props, tableDefinition, fixedFields, primaryKey, setCellFeedback, setTableData, localCellChanges, setLocalCellChanges, handleEnterKeyPressInEditor, allColumns) => {
|
|
1533
|
+
const { column } = props;
|
|
1534
|
+
if (column.editable) {
|
|
1535
|
+
const fieldDefinition = tableDefinition.fields.find((f) => f.name === column.key);
|
|
1536
|
+
const isFixedField = fixedFields?.some((f) => f.fieldName === column.key);
|
|
1537
|
+
const isFieldEditableByUI = fieldDefinition?.editable !== false && !isFixedField;
|
|
1538
|
+
if (!isFieldEditableByUI) {
|
|
1539
|
+
return void 0;
|
|
1402
1540
|
}
|
|
1403
|
-
|
|
1541
|
+
return /* @__PURE__ */ jsx10(
|
|
1542
|
+
InputRenderer_default,
|
|
1543
|
+
{
|
|
1544
|
+
...props,
|
|
1545
|
+
tableDefinition,
|
|
1546
|
+
setCellFeedback,
|
|
1547
|
+
onEnterPress: (rowIndex, columnKey) => handleEnterKeyPressInEditor(rowIndex, columnKey, allColumns),
|
|
1548
|
+
setTableData,
|
|
1549
|
+
setLocalCellChanges,
|
|
1550
|
+
localCellChanges,
|
|
1551
|
+
primaryKey
|
|
1552
|
+
}
|
|
1553
|
+
);
|
|
1554
|
+
}
|
|
1404
1555
|
};
|
|
1405
|
-
var FallbackClientSideRenderer_default = FallbackClientSideRenderer;
|
|
1406
1556
|
|
|
1407
|
-
// src/components/grid/
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1557
|
+
// src/components/grid/renderers/emptyRowRenderer.tsx
|
|
1558
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1559
|
+
function EmptyRowsRenderer() {
|
|
1560
|
+
return /* @__PURE__ */ jsx11("div", { style: {
|
|
1561
|
+
// Posicionamiento absoluto respecto a la pantalla
|
|
1562
|
+
position: "fixed",
|
|
1563
|
+
top: "50%",
|
|
1564
|
+
// Centrado verticalmente
|
|
1565
|
+
left: "50%",
|
|
1566
|
+
// Centrado horizontalmente
|
|
1567
|
+
transform: "translate(-50%, -50%)",
|
|
1568
|
+
// Ajuste para el 50% del tamaño del div
|
|
1569
|
+
// Estilos de visualización
|
|
1570
|
+
backgroundColor: "rgba(255, 255, 255, 0.9)",
|
|
1571
|
+
border: "1px solid #ccc",
|
|
1572
|
+
borderRadius: "4px",
|
|
1573
|
+
padding: "16px 24px",
|
|
1574
|
+
boxShadow: "0 2px 10px rgba(0,0,0,0.1)"
|
|
1575
|
+
}, children: /* @__PURE__ */ jsx11("div", { style: { textAlign: "center" }, children: "No hay filas para mostrar" }) });
|
|
1576
|
+
}
|
|
1418
1577
|
|
|
1419
1578
|
// src/components/grid/GenericDataGrid.tsx
|
|
1420
|
-
import {
|
|
1579
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1421
1580
|
var getPrimaryKeyValues = (row, primaryKey) => {
|
|
1422
|
-
return primaryKey.map((key) => {
|
|
1581
|
+
return primaryKey.concat(DETAIL_ROW_INDICATOR).map((key) => {
|
|
1423
1582
|
return row[key] !== void 0 && row[key] !== null ? String(row[key]) : "NULL_OR_UNDEFINED";
|
|
1424
1583
|
}).join("|");
|
|
1425
1584
|
};
|
|
1426
|
-
var NEW_ROW_INDICATOR = "
|
|
1585
|
+
var NEW_ROW_INDICATOR = "$new";
|
|
1586
|
+
var DETAIL_ROW_INDICATOR = "$detail";
|
|
1427
1587
|
var GenericDataGrid = ({
|
|
1428
1588
|
tableName,
|
|
1429
1589
|
fixedFields
|
|
@@ -1435,7 +1595,7 @@ var GenericDataGrid = ({
|
|
|
1435
1595
|
const [selectedRows, setSelectedRows] = useState4(() => /* @__PURE__ */ new Set());
|
|
1436
1596
|
const [cellFeedback, setCellFeedback] = useState4(null);
|
|
1437
1597
|
const [localCellChanges, setLocalCellChanges] = useState4(/* @__PURE__ */ new Map());
|
|
1438
|
-
const theme =
|
|
1598
|
+
const theme = useTheme2();
|
|
1439
1599
|
const [openConfirmDialog, setOpenConfirmDialog] = useState4(false);
|
|
1440
1600
|
const [rowToDelete, setRowToDelete] = useState4(null);
|
|
1441
1601
|
const [exitingRowIds, setExitingRowIds] = useState4(/* @__PURE__ */ new Set());
|
|
@@ -1443,6 +1603,8 @@ var GenericDataGrid = ({
|
|
|
1443
1603
|
const feedbackTimerRef = useRef(null);
|
|
1444
1604
|
const dataGridRef = useRef(null);
|
|
1445
1605
|
const { callApi, loading, error } = useApiCall();
|
|
1606
|
+
const getRowCount = () => tableData.filter((row) => !row[DETAIL_ROW_INDICATOR]).length;
|
|
1607
|
+
const getFilteredRowCount = () => filteredRows.filter((row) => !row[DETAIL_ROW_INDICATOR]).length;
|
|
1446
1608
|
useEffect(() => {
|
|
1447
1609
|
setFilters({});
|
|
1448
1610
|
setIsFilterRowVisible(false);
|
|
@@ -1466,7 +1628,6 @@ var GenericDataGrid = ({
|
|
|
1466
1628
|
const data = await callApi("table_data", {
|
|
1467
1629
|
table: tableName,
|
|
1468
1630
|
fixedFields
|
|
1469
|
-
// Envía el array fixedFields directamente a la API
|
|
1470
1631
|
});
|
|
1471
1632
|
setTableData(data);
|
|
1472
1633
|
} catch (err) {
|
|
@@ -1483,7 +1644,7 @@ var GenericDataGrid = ({
|
|
|
1483
1644
|
if (feedbackTimerRef.current) {
|
|
1484
1645
|
clearTimeout(feedbackTimerRef.current);
|
|
1485
1646
|
}
|
|
1486
|
-
const timerDuration =
|
|
1647
|
+
const timerDuration = 3e3;
|
|
1487
1648
|
feedbackTimerRef.current = setTimeout(() => {
|
|
1488
1649
|
setCellFeedback(null);
|
|
1489
1650
|
}, timerDuration);
|
|
@@ -1637,37 +1798,25 @@ var GenericDataGrid = ({
|
|
|
1637
1798
|
const handleEnterKeyPressInEditor = useCallback4((rowIndex, columnKey, currentColumns) => {
|
|
1638
1799
|
if (dataGridRef.current && tableDefinition) {
|
|
1639
1800
|
const currentColumnIndex = currentColumns.findIndex((col) => col.key === columnKey);
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1801
|
+
const editableColumns = currentColumns.filter((col) => {
|
|
1802
|
+
const fieldDefinition = tableDefinition.fields.find((f) => f.name === col.key);
|
|
1803
|
+
return col.key !== "filterToggle" && col.key !== "deleteAction" && (fieldDefinition?.editable !== false && !fieldDefinition?.clientSide);
|
|
1804
|
+
});
|
|
1805
|
+
if (currentColumnIndex !== -1 && editableColumns.length > 0) {
|
|
1806
|
+
const editableColumnKeys = editableColumns.map((col) => col.key);
|
|
1807
|
+
let currentEditableColumnIndex = editableColumnKeys.indexOf(columnKey);
|
|
1808
|
+
if (currentEditableColumnIndex !== -1) {
|
|
1809
|
+
let nextEditableColumnIndex = currentEditableColumnIndex + 1;
|
|
1810
|
+
let nextRowIndex = rowIndex;
|
|
1811
|
+
if (nextEditableColumnIndex >= editableColumns.length) {
|
|
1812
|
+
nextEditableColumnIndex = 0;
|
|
1647
1813
|
nextRowIndex++;
|
|
1648
1814
|
if (nextRowIndex >= filteredRows.length) {
|
|
1649
1815
|
nextRowIndex = 0;
|
|
1650
|
-
nextColumnIndex = 0;
|
|
1651
|
-
if (filteredRows.length === 0 || rowIndex === filteredRows.length - 1 && currentColumnIndex === currentColumns.length - 1) {
|
|
1652
|
-
foundNextTarget = true;
|
|
1653
|
-
break;
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1657
|
-
const nextColumn = currentColumns[nextColumnIndex];
|
|
1658
|
-
if (nextColumn) {
|
|
1659
|
-
const fieldDefinition = tableDefinition.fields.find((f) => f.name === nextColumn.key);
|
|
1660
|
-
const isEditableField = fieldDefinition?.editable !== false;
|
|
1661
|
-
if (nextColumn.key !== "filterToggle" && nextColumn.key !== "deleteAction" && isEditableField) {
|
|
1662
|
-
foundNextTarget = true;
|
|
1663
|
-
} else {
|
|
1664
|
-
nextColumnIndex++;
|
|
1665
1816
|
}
|
|
1666
|
-
} else {
|
|
1667
|
-
nextColumnIndex++;
|
|
1668
1817
|
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1818
|
+
const nextColumnKey = editableColumnKeys[nextEditableColumnIndex];
|
|
1819
|
+
const nextColumnIndex = currentColumns.findIndex((col) => col.key === nextColumnKey);
|
|
1671
1820
|
dataGridRef.current.selectCell({ rowIdx: nextRowIndex, idx: nextColumnIndex }, { enableEditor: false, scrollIntoView: true });
|
|
1672
1821
|
}
|
|
1673
1822
|
}
|
|
@@ -1679,182 +1828,84 @@ var GenericDataGrid = ({
|
|
|
1679
1828
|
const fixedFieldEntry = fixedFields?.find((f) => f.fieldName === field.name);
|
|
1680
1829
|
return !(fixedFieldEntry && fixedFieldEntry.until === void 0);
|
|
1681
1830
|
});
|
|
1682
|
-
const defaultColumns = fieldsToShow.map((
|
|
1683
|
-
const isFixedField = fixedFields?.some((f) => f.fieldName ===
|
|
1684
|
-
const isFieldEditable =
|
|
1831
|
+
const defaultColumns = fieldsToShow.map((fieldDef) => {
|
|
1832
|
+
const isFixedField = fixedFields?.some((f) => f.fieldName === fieldDef.name);
|
|
1833
|
+
const isFieldEditable = fieldDef.editable !== false && !isFixedField;
|
|
1685
1834
|
return {
|
|
1686
|
-
key:
|
|
1687
|
-
|
|
1835
|
+
key: fieldDef.name,
|
|
1836
|
+
customType: "default",
|
|
1837
|
+
tableDefinition,
|
|
1838
|
+
fieldDef,
|
|
1839
|
+
cellFeedback,
|
|
1840
|
+
primaryKey,
|
|
1841
|
+
fixedFields,
|
|
1842
|
+
localCellChanges,
|
|
1843
|
+
name: fieldDef.label || cambiarGuionesBajosPorEspacios(fieldDef.name),
|
|
1688
1844
|
resizable: true,
|
|
1689
1845
|
sortable: true,
|
|
1846
|
+
//frozen: true,
|
|
1690
1847
|
editable: isFieldEditable,
|
|
1691
|
-
// Usar la nueva bandera de editable
|
|
1692
1848
|
flexGrow: 1,
|
|
1693
1849
|
minWidth: 60,
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
renderSummaryCell: ({ column }) => {
|
|
1697
|
-
const fixedFieldEntry = fixedFields?.find((f) => f.fieldName === column.key);
|
|
1698
|
-
if (fixedFieldEntry && fixedFieldEntry.until === void 0) return null;
|
|
1699
|
-
return isFilterRowVisible ? /* @__PURE__ */ jsx9(
|
|
1700
|
-
FilterInputRender_default,
|
|
1701
|
-
{
|
|
1702
|
-
column,
|
|
1703
|
-
filters,
|
|
1704
|
-
setFilters
|
|
1705
|
-
}
|
|
1706
|
-
) : null;
|
|
1707
|
-
},
|
|
1708
|
-
renderCell: (props) => {
|
|
1709
|
-
const rowId = getPrimaryKeyValues(props.row, primaryKey);
|
|
1710
|
-
const fieldDefinition = tableDefinition.fields.find((f) => f.name === props.column.key);
|
|
1711
|
-
if (fieldDefinition?.clientSide) {
|
|
1712
|
-
const ClientSideComponent = clientSides[fieldDefinition.clientSide];
|
|
1713
|
-
if (ClientSideComponent) {
|
|
1714
|
-
return /* @__PURE__ */ jsx9(
|
|
1715
|
-
ClientSideComponent,
|
|
1716
|
-
{
|
|
1717
|
-
...props,
|
|
1718
|
-
fieldDefinition,
|
|
1719
|
-
tableDefinition,
|
|
1720
|
-
primaryKey
|
|
1721
|
-
}
|
|
1722
|
-
);
|
|
1723
|
-
} else {
|
|
1724
|
-
return /* @__PURE__ */ jsx9(
|
|
1725
|
-
FallbackClientSideRenderer_default,
|
|
1726
|
-
{
|
|
1727
|
-
...props,
|
|
1728
|
-
fieldDefinition,
|
|
1729
|
-
tableDefinition,
|
|
1730
|
-
primaryKey
|
|
1731
|
-
}
|
|
1732
|
-
);
|
|
1733
|
-
}
|
|
1734
|
-
}
|
|
1735
|
-
let cellBackgroundColor = "transparent";
|
|
1736
|
-
if (cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key) {
|
|
1737
|
-
cellBackgroundColor = cellFeedback.type === "error" ? theme.palette.error.light : theme.palette.success.light;
|
|
1738
|
-
} else {
|
|
1739
|
-
const isNewRowLocalCheck = props.row[NEW_ROW_INDICATOR];
|
|
1740
|
-
const isMandatory = tableDefinition.primaryKey.includes(props.column.key) || tableDefinition.fields.find((f) => f.name === props.column.key)?.nullable === false;
|
|
1741
|
-
const hasValue = props.row[props.column.key] !== null && props.row[props.column.key] !== void 0 && String(props.row[props.column.key]).trim() !== "";
|
|
1742
|
-
const isFixedFieldCurrent = fixedFields?.some((f) => f.fieldName === props.column.key);
|
|
1743
|
-
if (isFixedFieldCurrent) {
|
|
1744
|
-
cellBackgroundColor = theme.palette.action.selected;
|
|
1745
|
-
} else if (isNewRowLocalCheck && isMandatory && !hasValue || localCellChanges.has(rowId) && localCellChanges.get(rowId)?.has(props.column.key)) {
|
|
1746
|
-
cellBackgroundColor = theme.palette.info.light;
|
|
1747
|
-
}
|
|
1748
|
-
}
|
|
1749
|
-
return /* @__PURE__ */ jsx9(
|
|
1750
|
-
Box4,
|
|
1751
|
-
{
|
|
1752
|
-
sx: {
|
|
1753
|
-
position: "absolute",
|
|
1754
|
-
top: 0,
|
|
1755
|
-
left: 0,
|
|
1756
|
-
width: "100%",
|
|
1757
|
-
height: "100%",
|
|
1758
|
-
backgroundColor: cellBackgroundColor,
|
|
1759
|
-
transition: "background-color 0.3s ease-in-out",
|
|
1760
|
-
display: "flex",
|
|
1761
|
-
alignItems: "center",
|
|
1762
|
-
paddingLeft: "8px",
|
|
1763
|
-
boxSizing: "border-box"
|
|
1764
|
-
},
|
|
1765
|
-
children: /* @__PURE__ */ jsx9(
|
|
1766
|
-
PkCellRenderer_default,
|
|
1767
|
-
{
|
|
1768
|
-
...props,
|
|
1769
|
-
column: { ...props.column, isPK: !!field.isPk }
|
|
1770
|
-
}
|
|
1771
|
-
)
|
|
1772
|
-
}
|
|
1773
|
-
);
|
|
1774
|
-
}
|
|
1850
|
+
renderHeaderCell: (props) => defaultColumnHeaderCellRenderer(props, fieldDef),
|
|
1851
|
+
renderSummaryCell: (props) => defaultColumnSummaryCellRenderer(props, fixedFields, isFilterRowVisible, filters, setFilters)
|
|
1775
1852
|
};
|
|
1776
1853
|
});
|
|
1777
|
-
const
|
|
1854
|
+
const actionsColumn = {
|
|
1778
1855
|
key: "filterToggle",
|
|
1779
|
-
|
|
1856
|
+
customType: "action",
|
|
1857
|
+
tableDefinition,
|
|
1858
|
+
handleDeleteRow,
|
|
1859
|
+
name: "filterCol",
|
|
1780
1860
|
width: 50,
|
|
1781
1861
|
resizable: false,
|
|
1782
1862
|
sortable: false,
|
|
1783
|
-
frozen: true,
|
|
1784
|
-
renderHeaderCell: () =>
|
|
1785
|
-
|
|
1786
|
-
{
|
|
1787
|
-
color: "inherit",
|
|
1788
|
-
onClick: toggleFilterVisibility,
|
|
1789
|
-
size: "small",
|
|
1790
|
-
title: isFilterRowVisible ? "Ocultar filtros" : "Mostrar filtros",
|
|
1791
|
-
sx: { p: 0.5 },
|
|
1792
|
-
children: isFilterRowVisible ? /* @__PURE__ */ jsx9(SearchOffIcon, { sx: { fontSize: 20 } }) : /* @__PURE__ */ jsx9(SearchIcon, { sx: { fontSize: 20 } })
|
|
1793
|
-
}
|
|
1794
|
-
),
|
|
1795
|
-
renderSummaryCell: () => null
|
|
1863
|
+
//frozen: true,
|
|
1864
|
+
renderHeaderCell: (props) => actionsColumnHeaderCellRenderer(props, isFilterRowVisible, toggleFilterVisibility),
|
|
1865
|
+
renderSummaryCell: (props) => actionsColumnSummaryCellRenderer(props)
|
|
1796
1866
|
};
|
|
1797
|
-
const
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1867
|
+
const detailColumns = [];
|
|
1868
|
+
if (tableDefinition.detailTables && tableDefinition.detailTables.length > 0) {
|
|
1869
|
+
tableDefinition.detailTables.forEach((detailTable) => {
|
|
1870
|
+
const detailKey = `detail_${detailTable.abr}`;
|
|
1871
|
+
detailColumns.push({
|
|
1872
|
+
key: detailKey,
|
|
1873
|
+
customType: "detail",
|
|
1874
|
+
tableDefinition,
|
|
1875
|
+
detailTable,
|
|
1876
|
+
primaryKey,
|
|
1877
|
+
tableData,
|
|
1878
|
+
setTableData,
|
|
1879
|
+
detailKey,
|
|
1880
|
+
name: detailTable.label || `Detalle ${detailTable.abr}`,
|
|
1881
|
+
resizable: false,
|
|
1882
|
+
sortable: false,
|
|
1883
|
+
width: 50,
|
|
1884
|
+
//frozen: true,
|
|
1885
|
+
renderHeaderCell: (props) => detailColumnCellHeaderRenderer(props, detailTable),
|
|
1886
|
+
renderSummaryCell: (props) => detailColumnCellSummaryRenderer(props)
|
|
1887
|
+
});
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
const allColumns = [
|
|
1891
|
+
actionsColumn,
|
|
1892
|
+
...detailColumns,
|
|
1893
|
+
...defaultColumns
|
|
1894
|
+
];
|
|
1895
|
+
return allColumns.map((col) => ({
|
|
1896
|
+
...col,
|
|
1897
|
+
colSpan: (args) => {
|
|
1898
|
+
if (args.type === "ROW") {
|
|
1899
|
+
const detailTableAbr = args.row[DETAIL_ROW_INDICATOR];
|
|
1900
|
+
if (col.key === `detail_${detailTableAbr}`) {
|
|
1901
|
+
return allColumns.length;
|
|
1824
1902
|
}
|
|
1825
|
-
) });
|
|
1826
|
-
}
|
|
1827
|
-
};
|
|
1828
|
-
const allColumns = [filterToggleColumn, deleteActionColumn, ...defaultColumns];
|
|
1829
|
-
return allColumns.map((col) => {
|
|
1830
|
-
if (col.editable) {
|
|
1831
|
-
const fieldDefinition = tableDefinition.fields.find((f) => f.name === col.key);
|
|
1832
|
-
const isFixedField = fixedFields?.some((f) => f.fieldName === col.key);
|
|
1833
|
-
const isFieldEditableByUI = fieldDefinition?.editable !== false && !isFixedField;
|
|
1834
|
-
if (!isFieldEditableByUI) {
|
|
1835
|
-
return { ...col, renderEditCell: void 0 };
|
|
1836
1903
|
}
|
|
1837
|
-
return
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
{
|
|
1843
|
-
...props,
|
|
1844
|
-
tableDefinition,
|
|
1845
|
-
setCellFeedback,
|
|
1846
|
-
onEnterPress: (rowIndex, columnKey) => handleEnterKeyPressInEditor(rowIndex, columnKey, allColumns),
|
|
1847
|
-
setTableData,
|
|
1848
|
-
setLocalCellChanges,
|
|
1849
|
-
localCellChanges,
|
|
1850
|
-
primaryKey
|
|
1851
|
-
}
|
|
1852
|
-
);
|
|
1853
|
-
}
|
|
1854
|
-
};
|
|
1855
|
-
}
|
|
1856
|
-
return col;
|
|
1857
|
-
});
|
|
1904
|
+
return void 0;
|
|
1905
|
+
},
|
|
1906
|
+
renderEditCell: (props) => defaultColumnEditCellRenderer(props, tableDefinition, fixedFields, primaryKey, setCellFeedback, setTableData, localCellChanges, setLocalCellChanges, handleEnterKeyPressInEditor, allColumns),
|
|
1907
|
+
renderCell: (props) => allColumnsCellRenderer(props)
|
|
1908
|
+
}));
|
|
1858
1909
|
}, [
|
|
1859
1910
|
tableDefinition,
|
|
1860
1911
|
isFilterRowVisible,
|
|
@@ -1866,15 +1917,13 @@ var GenericDataGrid = ({
|
|
|
1866
1917
|
theme.palette.error.light,
|
|
1867
1918
|
theme.palette.info.light,
|
|
1868
1919
|
theme.palette.action.selected,
|
|
1869
|
-
// Añade el color de campos fijos
|
|
1870
1920
|
handleEnterKeyPressInEditor,
|
|
1871
1921
|
setTableData,
|
|
1872
1922
|
localCellChanges,
|
|
1873
1923
|
handleDeleteRow,
|
|
1874
|
-
fixedFields
|
|
1875
|
-
|
|
1924
|
+
fixedFields,
|
|
1925
|
+
tableData
|
|
1876
1926
|
]);
|
|
1877
|
-
const showNoRowsMessage = filteredRows.length === 0 && !loading && !error;
|
|
1878
1927
|
const handleRowsChange = useCallback4((updatedRows) => {
|
|
1879
1928
|
setTableData(updatedRows);
|
|
1880
1929
|
}, []);
|
|
@@ -1887,41 +1936,54 @@ var GenericDataGrid = ({
|
|
|
1887
1936
|
console.log("Is editable:", isEditable);
|
|
1888
1937
|
}, [tableDefinition, fixedFields]);
|
|
1889
1938
|
if (loading) {
|
|
1890
|
-
return /* @__PURE__ */ jsxs4(
|
|
1891
|
-
/* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
1939
|
+
return /* @__PURE__ */ jsxs4(Box5, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: [
|
|
1940
|
+
/* @__PURE__ */ jsx12(CircularProgress, {}),
|
|
1941
|
+
/* @__PURE__ */ jsx12(Typography5, { variant: "h6", sx: { ml: 2 }, children: "Cargando tabla..." })
|
|
1893
1942
|
] });
|
|
1894
1943
|
}
|
|
1895
1944
|
if (error) {
|
|
1896
|
-
return /* @__PURE__ */
|
|
1945
|
+
return /* @__PURE__ */ jsx12(Box5, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsx12(Alert, { severity: "error", children: error.message }) });
|
|
1897
1946
|
}
|
|
1898
1947
|
if (!tableDefinition) {
|
|
1899
|
-
return /* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ jsx12(Box5, { 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." }) });
|
|
1900
1949
|
}
|
|
1901
|
-
return /* @__PURE__ */ jsxs4(
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
|
|
1904
|
-
Button2,
|
|
1950
|
+
return /* @__PURE__ */ jsxs4(Box5, { sx: { pt: 2, display: "flex", flexDirection: "column", height: "100%", boxSizing: "border-box" }, children: [
|
|
1951
|
+
tableDefinition.allow?.insert && /* @__PURE__ */ jsx12(Box5, { sx: { display: "flex", px: 2, pb: 1 }, children: /* @__PURE__ */ jsx12(
|
|
1952
|
+
Button3,
|
|
1905
1953
|
{
|
|
1906
1954
|
variant: "contained",
|
|
1907
1955
|
onClick: handleAddRow,
|
|
1908
|
-
startIcon: /* @__PURE__ */
|
|
1956
|
+
startIcon: /* @__PURE__ */ jsx12(AddIcon, {}),
|
|
1909
1957
|
children: "Nuevo Registro"
|
|
1910
1958
|
}
|
|
1911
1959
|
) }),
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1960
|
+
/* @__PURE__ */ jsx12(
|
|
1961
|
+
Box5,
|
|
1962
|
+
{
|
|
1963
|
+
sx: {
|
|
1964
|
+
backgroundColor: theme.palette.primary.main,
|
|
1965
|
+
color: theme.palette.primary.contrastText,
|
|
1966
|
+
padding: theme.spacing(1),
|
|
1967
|
+
textAlign: "left",
|
|
1968
|
+
fontWeight: "bold",
|
|
1969
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
1970
|
+
borderTopLeftRadius: theme.shape.borderRadius,
|
|
1971
|
+
borderTopRightRadius: theme.shape.borderRadius,
|
|
1972
|
+
ml: 2,
|
|
1973
|
+
mr: 2
|
|
1974
|
+
},
|
|
1975
|
+
children: /* @__PURE__ */ jsxs4(Typography5, { variant: "subtitle1", component: "div", children: [
|
|
1976
|
+
cambiarGuionesBajosPorEspacios(tableDefinition.title || tableDefinition.name),
|
|
1977
|
+
" - mostrando ",
|
|
1978
|
+
getFilteredRowCount() === getRowCount() ? `${getRowCount()} registros` : `${getFilteredRowCount()} registros filtrados`
|
|
1979
|
+
] })
|
|
1980
|
+
}
|
|
1981
|
+
),
|
|
1982
|
+
/* @__PURE__ */ jsx12(
|
|
1983
|
+
Box5,
|
|
1921
1984
|
{
|
|
1922
1985
|
sx: {
|
|
1923
|
-
flexGrow:
|
|
1924
|
-
height: showNoRowsMessage ? "150px" : "100%",
|
|
1986
|
+
flexGrow: 1,
|
|
1925
1987
|
boxSizing: "border-box",
|
|
1926
1988
|
position: "relative",
|
|
1927
1989
|
overflowX: "auto",
|
|
@@ -1929,54 +1991,32 @@ var GenericDataGrid = ({
|
|
|
1929
1991
|
px: 2,
|
|
1930
1992
|
pb: 2
|
|
1931
1993
|
},
|
|
1932
|
-
children:
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
showNoRowsMessage && /* @__PURE__ */ jsx9(
|
|
1956
|
-
Box4,
|
|
1957
|
-
{
|
|
1958
|
-
sx: {
|
|
1959
|
-
position: "absolute",
|
|
1960
|
-
top: isFilterRowVisible ? "70px" : "36px",
|
|
1961
|
-
left: (theme2) => theme2.spacing(2),
|
|
1962
|
-
right: (theme2) => theme2.spacing(2),
|
|
1963
|
-
bottom: (theme2) => theme2.spacing(2),
|
|
1964
|
-
display: "flex",
|
|
1965
|
-
justifyContent: "center",
|
|
1966
|
-
alignItems: "center",
|
|
1967
|
-
backgroundColor: "rgba(255, 255, 255, 0.9)",
|
|
1968
|
-
color: (theme2) => theme2.palette.text.secondary,
|
|
1969
|
-
border: (theme2) => `1px solid ${theme2.palette.divider}`,
|
|
1970
|
-
borderRadius: "4px",
|
|
1971
|
-
zIndex: 1
|
|
1972
|
-
},
|
|
1973
|
-
children: /* @__PURE__ */ jsx9(Typography5, { variant: "h6", children: "No hay filas para mostrar." })
|
|
1974
|
-
}
|
|
1975
|
-
)
|
|
1976
|
-
]
|
|
1994
|
+
children: /* @__PURE__ */ jsx12(
|
|
1995
|
+
DataGrid,
|
|
1996
|
+
{
|
|
1997
|
+
ref: dataGridRef,
|
|
1998
|
+
columns,
|
|
1999
|
+
rows: filteredRows.map((row) => ({
|
|
2000
|
+
...row,
|
|
2001
|
+
style: exitingRowIds.has(getPrimaryKeyValues(row, primaryKey)) ? { maxHeight: 0, opacity: 0, overflow: "hidden" } : { maxHeight: "35px", opacity: 1 }
|
|
2002
|
+
})),
|
|
2003
|
+
enableVirtualization: true,
|
|
2004
|
+
rowKeyGetter: (row) => getPrimaryKeyValues(row, primaryKey),
|
|
2005
|
+
onSelectedRowsChange: setSelectedRows,
|
|
2006
|
+
onRowsChange: handleRowsChange,
|
|
2007
|
+
selectedRows,
|
|
2008
|
+
rowHeight: (row) => row[DETAIL_ROW_INDICATOR] ? 400 : 35,
|
|
2009
|
+
style: { height: "100%", width: "100%", boxSizing: "border-box" },
|
|
2010
|
+
headerRowHeight: 35,
|
|
2011
|
+
topSummaryRows: isFilterRowVisible ? [{ id: "filterRow" }] : void 0,
|
|
2012
|
+
summaryRowHeight: isFilterRowVisible ? 35 : 0,
|
|
2013
|
+
onCellClick: handleCellClick,
|
|
2014
|
+
renderers: { noRowsFallback: /* @__PURE__ */ jsx12(EmptyRowsRenderer, {}) }
|
|
2015
|
+
}
|
|
2016
|
+
)
|
|
1977
2017
|
}
|
|
1978
2018
|
),
|
|
1979
|
-
/* @__PURE__ */
|
|
2019
|
+
/* @__PURE__ */ jsx12(
|
|
1980
2020
|
ConfirmDialog,
|
|
1981
2021
|
{
|
|
1982
2022
|
open: openConfirmDialog,
|
|
@@ -1997,15 +2037,15 @@ import { BrowserRouter, Routes, Route, useLocation as useLocation4, Navigate as
|
|
|
1997
2037
|
import { useEffect as useEffect3 } from "react";
|
|
1998
2038
|
import { Outlet } from "react-router-dom";
|
|
1999
2039
|
import {
|
|
2000
|
-
Box as
|
|
2040
|
+
Box as Box8,
|
|
2001
2041
|
AppBar,
|
|
2002
2042
|
Toolbar,
|
|
2003
2043
|
Typography as Typography8,
|
|
2004
|
-
Button as
|
|
2044
|
+
Button as Button4,
|
|
2005
2045
|
Drawer,
|
|
2006
2046
|
CssBaseline,
|
|
2007
|
-
IconButton as
|
|
2008
|
-
useTheme as
|
|
2047
|
+
IconButton as IconButton3,
|
|
2048
|
+
useTheme as useTheme3,
|
|
2009
2049
|
useMediaQuery
|
|
2010
2050
|
} from "@mui/material";
|
|
2011
2051
|
|
|
@@ -2013,7 +2053,7 @@ import {
|
|
|
2013
2053
|
import { createContext as createContext2, useContext as useContext2, useState as useState5, useEffect as useEffect2, useCallback as useCallback5, useMemo as useMemo3 } from "react";
|
|
2014
2054
|
import { useNavigate } from "react-router-dom";
|
|
2015
2055
|
import { useSelector as useSelector2, useDispatch as useDispatch2 } from "react-redux";
|
|
2016
|
-
import { jsx as
|
|
2056
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2017
2057
|
var AuthContext = createContext2(void 0);
|
|
2018
2058
|
var useApp = () => {
|
|
2019
2059
|
const context = useContext2(AuthContext);
|
|
@@ -2081,7 +2121,7 @@ var AppProvider = ({ children }) => {
|
|
|
2081
2121
|
showSessionExpiredMessage,
|
|
2082
2122
|
setShowSessionExpiredMessage
|
|
2083
2123
|
]);
|
|
2084
|
-
return /* @__PURE__ */
|
|
2124
|
+
return /* @__PURE__ */ jsx13(AuthContext.Provider, { value: authContextValue, children });
|
|
2085
2125
|
};
|
|
2086
2126
|
|
|
2087
2127
|
// src/components/MainLayout.tsx
|
|
@@ -2090,7 +2130,7 @@ import MenuIcon from "@mui/icons-material/Menu";
|
|
|
2090
2130
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
2091
2131
|
|
|
2092
2132
|
// src/components/SideMenu.tsx
|
|
2093
|
-
import { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Divider, Box as
|
|
2133
|
+
import { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Divider, Box as Box7, Typography as Typography7, Collapse } from "@mui/material";
|
|
2094
2134
|
import ExpandLess from "@mui/icons-material/ExpandLess";
|
|
2095
2135
|
import ExpandMore from "@mui/icons-material/ExpandMore";
|
|
2096
2136
|
import TableChartIcon from "@mui/icons-material/TableChart";
|
|
@@ -2105,30 +2145,30 @@ import { useNavigate as useNavigate2, useLocation } from "react-router-dom";
|
|
|
2105
2145
|
import { blue, orange, teal, red, grey } from "@mui/material/colors";
|
|
2106
2146
|
|
|
2107
2147
|
// src/pages/WScreens.tsx
|
|
2108
|
-
import { Box as
|
|
2148
|
+
import { Box as Box6, Typography as Typography6, Paper } from "@mui/material";
|
|
2109
2149
|
import ConstructionIcon from "@mui/icons-material/Construction";
|
|
2110
2150
|
import WarningAmberIcon2 from "@mui/icons-material/WarningAmber";
|
|
2111
|
-
import { jsx as
|
|
2151
|
+
import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2112
2152
|
var MyCustomDashboard = ({ screenName }) => {
|
|
2113
|
-
return /* @__PURE__ */
|
|
2153
|
+
return /* @__PURE__ */ jsx14(Box6, { sx: { p: 4, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsxs5(Paper, { elevation: 3, sx: { p: 4, textAlign: "center", maxWidth: 600 }, children: [
|
|
2114
2154
|
/* @__PURE__ */ jsxs5(Typography6, { variant: "h5", component: "h1", gutterBottom: true, children: [
|
|
2115
2155
|
"\xA1Bienvenido a tu WScreen: ",
|
|
2116
2156
|
screenName,
|
|
2117
2157
|
"!"
|
|
2118
2158
|
] }),
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ jsx14(Typography6, { variant: "body1", color: "text.secondary", children: "Esta es una pantalla de interfaz de usuario personalizada." }),
|
|
2160
|
+
/* @__PURE__ */ jsx14(Box6, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx14(ConstructionIcon, { sx: { fontSize: 80, color: "primary.main" } }) })
|
|
2121
2161
|
] }) });
|
|
2122
2162
|
};
|
|
2123
2163
|
var FallbackWScreen = ({ screenName }) => {
|
|
2124
|
-
return /* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ jsx14(Box6, { sx: { p: 4, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsxs5(Paper, { elevation: 3, sx: { p: 4, textAlign: "center", maxWidth: 600, backgroundColor: "warning.light", border: "1px solid orange" }, children: [
|
|
2165
|
+
/* @__PURE__ */ jsx14(Typography6, { variant: "h5", component: "h1", gutterBottom: true, color: "warning.dark", children: "WScreen No Implementada" }),
|
|
2126
2166
|
/* @__PURE__ */ jsxs5(Typography6, { variant: "body1", color: "warning.dark", children: [
|
|
2127
2167
|
'No se encontr\xF3 un componente implementado para la **WScreen**: **`"$',
|
|
2128
2168
|
screenName,
|
|
2129
2169
|
'"`**. 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.'
|
|
2130
2170
|
] }),
|
|
2131
|
-
/* @__PURE__ */
|
|
2171
|
+
/* @__PURE__ */ jsx14(Box6, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx14(WarningAmberIcon2, { sx: { fontSize: 80, color: "warning.dark" } }) })
|
|
2132
2172
|
] }) });
|
|
2133
2173
|
};
|
|
2134
2174
|
var wScreens = {
|
|
@@ -2139,7 +2179,7 @@ var wScreens = {
|
|
|
2139
2179
|
var WScreens_default = FallbackWScreen;
|
|
2140
2180
|
|
|
2141
2181
|
// src/components/SideMenu.tsx
|
|
2142
|
-
import { Fragment
|
|
2182
|
+
import { Fragment, jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2143
2183
|
var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
2144
2184
|
const navigate = useNavigate2();
|
|
2145
2185
|
const location = useLocation();
|
|
@@ -2180,17 +2220,17 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2180
2220
|
const getIcon = (item2) => {
|
|
2181
2221
|
switch (item2.menuType) {
|
|
2182
2222
|
case "table":
|
|
2183
|
-
return /* @__PURE__ */
|
|
2223
|
+
return /* @__PURE__ */ jsx15(TableChartIcon, { sx: { color: blue[700] } });
|
|
2184
2224
|
case "proc":
|
|
2185
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ jsx15(DnsIcon, { sx: { color: teal[700] } });
|
|
2186
2226
|
case "menu":
|
|
2187
|
-
return /* @__PURE__ */
|
|
2227
|
+
return /* @__PURE__ */ jsx15(FolderIcon, { sx: { color: orange[800] } });
|
|
2188
2228
|
default:
|
|
2189
2229
|
const WScreenComponent = wScreens[item2.menuType];
|
|
2190
2230
|
if (WScreenComponent !== void 0) {
|
|
2191
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ jsx15(DesktopWindowsIcon, { sx: { color: grey[700] } });
|
|
2192
2232
|
}
|
|
2193
|
-
return /* @__PURE__ */
|
|
2233
|
+
return /* @__PURE__ */ jsx15(WarningAmberIcon3, { sx: { color: red[500] } });
|
|
2194
2234
|
}
|
|
2195
2235
|
};
|
|
2196
2236
|
const currentPath = location.pathname;
|
|
@@ -2202,7 +2242,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2202
2242
|
} else {
|
|
2203
2243
|
isSelected = currentPath.startsWith(`/wScreens/${item.menuType}`) || currentPath.startsWith(`/wScreens-fallback/${item.menuType}`);
|
|
2204
2244
|
}
|
|
2205
|
-
return /* @__PURE__ */ jsxs6(
|
|
2245
|
+
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
2206
2246
|
/* @__PURE__ */ jsxs6(
|
|
2207
2247
|
ListItemButton,
|
|
2208
2248
|
{
|
|
@@ -2210,13 +2250,13 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2210
2250
|
sx: { pl: level * 2 },
|
|
2211
2251
|
selected: isSelected,
|
|
2212
2252
|
children: [
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
item.menuType === "menu" ? open ? /* @__PURE__ */
|
|
2253
|
+
/* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: getIcon(item) }),
|
|
2254
|
+
/* @__PURE__ */ jsx15(ListItemText, { primary: item.label || item.name }),
|
|
2255
|
+
item.menuType === "menu" ? open ? /* @__PURE__ */ jsx15(ExpandLess, {}) : /* @__PURE__ */ jsx15(ExpandMore, {}) : null
|
|
2216
2256
|
]
|
|
2217
2257
|
}
|
|
2218
2258
|
),
|
|
2219
|
-
item.menuType === "menu" && /* @__PURE__ */
|
|
2259
|
+
item.menuType === "menu" && /* @__PURE__ */ jsx15(Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: /* @__PURE__ */ jsx15(List, { component: "div", disablePadding: true, children: item.menuContent.map((subItem) => /* @__PURE__ */ jsx15(
|
|
2220
2260
|
MenuListItem,
|
|
2221
2261
|
{
|
|
2222
2262
|
item: subItem,
|
|
@@ -2246,22 +2286,22 @@ var SideMenu = ({ onMenuItemClick }) => {
|
|
|
2246
2286
|
dispatch(setAllSubMenusOpen(!isMostlyOpen));
|
|
2247
2287
|
};
|
|
2248
2288
|
if (!clientContext || !clientContext.menu) {
|
|
2249
|
-
return /* @__PURE__ */
|
|
2289
|
+
return /* @__PURE__ */ jsx15(Box7, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx15(Typography7, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
|
|
2250
2290
|
}
|
|
2251
2291
|
const isHomeSelected = location.pathname === "/home";
|
|
2252
|
-
return /* @__PURE__ */ jsxs6(
|
|
2253
|
-
clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */
|
|
2254
|
-
/* @__PURE__ */
|
|
2255
|
-
/* @__PURE__ */
|
|
2292
|
+
return /* @__PURE__ */ jsxs6(Box7, { sx: { width: "100%", flexShrink: 0 }, children: [
|
|
2293
|
+
clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs6(ListItemButton, { onClick: handleToggleAllSubMenus, children: [
|
|
2294
|
+
/* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: isMostlyOpen ? /* @__PURE__ */ jsx15(UnfoldLessIcon, {}) : /* @__PURE__ */ jsx15(UnfoldMoreIcon, {}) }),
|
|
2295
|
+
/* @__PURE__ */ jsx15(ListItemText, { primary: isMostlyOpen ? "colapsar " : "expandir" })
|
|
2256
2296
|
] }) }),
|
|
2257
|
-
/* @__PURE__ */
|
|
2297
|
+
/* @__PURE__ */ jsx15(Divider, {}),
|
|
2258
2298
|
/* @__PURE__ */ jsxs6(List, { children: [
|
|
2259
|
-
/* @__PURE__ */
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
/* @__PURE__ */
|
|
2299
|
+
/* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs6(ListItemButton, { onClick: handleHomeClick, selected: isHomeSelected, children: [
|
|
2300
|
+
/* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: /* @__PURE__ */ jsx15(HomeIcon, {}) }),
|
|
2301
|
+
/* @__PURE__ */ jsx15(ListItemText, { primary: "Inicio" })
|
|
2262
2302
|
] }) }),
|
|
2263
|
-
/* @__PURE__ */
|
|
2264
|
-
clientContext.menu.map((menuItem) => /* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ jsx15(Divider, {}),
|
|
2304
|
+
clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx15(
|
|
2265
2305
|
MenuListItem,
|
|
2266
2306
|
{
|
|
2267
2307
|
item: menuItem,
|
|
@@ -2304,14 +2344,14 @@ var useLogout = () => {
|
|
|
2304
2344
|
var useLogout_default = useLogout;
|
|
2305
2345
|
|
|
2306
2346
|
// src/components/MainLayout.tsx
|
|
2307
|
-
import { jsx as
|
|
2347
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2308
2348
|
var drawerWidth = 240;
|
|
2309
2349
|
var MainLayout = () => {
|
|
2310
2350
|
const { clientContext } = useApp();
|
|
2311
2351
|
const logout = useLogout_default();
|
|
2312
2352
|
const isDrawerOpen = useIsDrawerOpen();
|
|
2313
2353
|
const dispatch = useAppDispatch();
|
|
2314
|
-
const theme =
|
|
2354
|
+
const theme = useTheme3();
|
|
2315
2355
|
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
2316
2356
|
useEffect3(() => {
|
|
2317
2357
|
if (isMobile && isDrawerOpen) {
|
|
@@ -2327,12 +2367,12 @@ var MainLayout = () => {
|
|
|
2327
2367
|
}
|
|
2328
2368
|
};
|
|
2329
2369
|
if (!clientContext) {
|
|
2330
|
-
return /* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ jsx16(Box8, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx16(Typography8, { children: "Cargando dise\xF1o de la aplicaci\xF3n..." }) });
|
|
2331
2371
|
}
|
|
2332
2372
|
const appBarOffset = theme.mixins.toolbar;
|
|
2333
|
-
return /* @__PURE__ */ jsxs7(
|
|
2334
|
-
/* @__PURE__ */
|
|
2335
|
-
/* @__PURE__ */
|
|
2373
|
+
return /* @__PURE__ */ jsxs7(Box8, { sx: { display: "flex", height: "100vh" }, children: [
|
|
2374
|
+
/* @__PURE__ */ jsx16(CssBaseline, {}),
|
|
2375
|
+
/* @__PURE__ */ jsx16(
|
|
2336
2376
|
AppBar,
|
|
2337
2377
|
{
|
|
2338
2378
|
position: "fixed",
|
|
@@ -2352,8 +2392,8 @@ var MainLayout = () => {
|
|
|
2352
2392
|
}
|
|
2353
2393
|
},
|
|
2354
2394
|
children: /* @__PURE__ */ jsxs7(Toolbar, { children: [
|
|
2355
|
-
/* @__PURE__ */
|
|
2356
|
-
|
|
2395
|
+
/* @__PURE__ */ jsx16(
|
|
2396
|
+
IconButton3,
|
|
2357
2397
|
{
|
|
2358
2398
|
color: "inherit",
|
|
2359
2399
|
"aria-label": "open drawer",
|
|
@@ -2362,17 +2402,17 @@ var MainLayout = () => {
|
|
|
2362
2402
|
sx: {
|
|
2363
2403
|
marginRight: 2.2
|
|
2364
2404
|
},
|
|
2365
|
-
children: isDrawerOpen ? /* @__PURE__ */
|
|
2405
|
+
children: isDrawerOpen ? /* @__PURE__ */ jsx16(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx16(MenuIcon, {})
|
|
2366
2406
|
}
|
|
2367
2407
|
),
|
|
2368
|
-
/* @__PURE__ */
|
|
2369
|
-
/* @__PURE__ */
|
|
2370
|
-
/* @__PURE__ */
|
|
2371
|
-
|
|
2408
|
+
/* @__PURE__ */ jsx16(Typography8, { variant: "h6", noWrap: true, component: "div", sx: { flexGrow: 1 }, children: isDrawerOpen ? "" : clientContext.config.title }),
|
|
2409
|
+
/* @__PURE__ */ jsx16(Typography8, { variant: "subtitle1", component: "div", sx: { mr: 2 }, children: clientContext.username }),
|
|
2410
|
+
/* @__PURE__ */ jsx16(
|
|
2411
|
+
Button4,
|
|
2372
2412
|
{
|
|
2373
2413
|
color: "inherit",
|
|
2374
2414
|
onClick: logout,
|
|
2375
|
-
startIcon: /* @__PURE__ */
|
|
2415
|
+
startIcon: /* @__PURE__ */ jsx16(LogoutIcon, {}),
|
|
2376
2416
|
children: "Salir"
|
|
2377
2417
|
}
|
|
2378
2418
|
)
|
|
@@ -2396,7 +2436,7 @@ var MainLayout = () => {
|
|
|
2396
2436
|
}
|
|
2397
2437
|
},
|
|
2398
2438
|
children: [
|
|
2399
|
-
/* @__PURE__ */
|
|
2439
|
+
/* @__PURE__ */ jsx16(
|
|
2400
2440
|
Toolbar,
|
|
2401
2441
|
{
|
|
2402
2442
|
sx: {
|
|
@@ -2410,12 +2450,12 @@ var MainLayout = () => {
|
|
|
2410
2450
|
children: isDrawerOpen ? clientContext.config.title : ""
|
|
2411
2451
|
}
|
|
2412
2452
|
),
|
|
2413
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ jsx16(SideMenu_default, { onMenuItemClick: handleDrawerCloseMobile })
|
|
2414
2454
|
]
|
|
2415
2455
|
}
|
|
2416
2456
|
),
|
|
2417
|
-
/* @__PURE__ */
|
|
2418
|
-
|
|
2457
|
+
/* @__PURE__ */ jsx16(
|
|
2458
|
+
Box8,
|
|
2419
2459
|
{
|
|
2420
2460
|
component: "main",
|
|
2421
2461
|
sx: {
|
|
@@ -2442,7 +2482,7 @@ var MainLayout = () => {
|
|
|
2442
2482
|
flexDirection: "column",
|
|
2443
2483
|
width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
|
|
2444
2484
|
},
|
|
2445
|
-
children: /* @__PURE__ */
|
|
2485
|
+
children: /* @__PURE__ */ jsx16(Outlet, {})
|
|
2446
2486
|
}
|
|
2447
2487
|
)
|
|
2448
2488
|
] });
|
|
@@ -2450,9 +2490,9 @@ var MainLayout = () => {
|
|
|
2450
2490
|
var MainLayout_default = MainLayout;
|
|
2451
2491
|
|
|
2452
2492
|
// src/components/SessionExpiredMessage.tsx
|
|
2453
|
-
import { Box as
|
|
2493
|
+
import { Box as Box9, Typography as Typography9, Button as Button5, Modal } from "@mui/material";
|
|
2454
2494
|
import { useNavigate as useNavigate4 } from "react-router-dom";
|
|
2455
|
-
import { jsx as
|
|
2495
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2456
2496
|
var style = {
|
|
2457
2497
|
position: "absolute",
|
|
2458
2498
|
top: "50%",
|
|
@@ -2474,7 +2514,7 @@ var SessionExpiredMessage = () => {
|
|
|
2474
2514
|
setIsLoggedIn(false);
|
|
2475
2515
|
navigate("/login", { replace: true });
|
|
2476
2516
|
};
|
|
2477
|
-
return /* @__PURE__ */
|
|
2517
|
+
return /* @__PURE__ */ jsx17(
|
|
2478
2518
|
Modal,
|
|
2479
2519
|
{
|
|
2480
2520
|
open: showSessionExpiredMessage,
|
|
@@ -2494,10 +2534,10 @@ var SessionExpiredMessage = () => {
|
|
|
2494
2534
|
}
|
|
2495
2535
|
}
|
|
2496
2536
|
},
|
|
2497
|
-
children: /* @__PURE__ */ jsxs8(
|
|
2498
|
-
/* @__PURE__ */
|
|
2499
|
-
/* @__PURE__ */
|
|
2500
|
-
/* @__PURE__ */
|
|
2537
|
+
children: /* @__PURE__ */ jsxs8(Box9, { sx: style, children: [
|
|
2538
|
+
/* @__PURE__ */ jsx17(Typography9, { id: "session-expired-modal-title", variant: "h6", component: "h2", gutterBottom: true, children: "\xA1Sesi\xF3n Expirada!" }),
|
|
2539
|
+
/* @__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." }),
|
|
2540
|
+
/* @__PURE__ */ jsx17(Button5, { variant: "contained", color: "primary", onClick: handleClose, children: "Ir al Login" })
|
|
2501
2541
|
] })
|
|
2502
2542
|
}
|
|
2503
2543
|
);
|
|
@@ -2505,27 +2545,27 @@ var SessionExpiredMessage = () => {
|
|
|
2505
2545
|
var SessionExpiredMessage_default = SessionExpiredMessage;
|
|
2506
2546
|
|
|
2507
2547
|
// src/pages/HomePage.tsx
|
|
2508
|
-
import { Box as
|
|
2509
|
-
import { jsx as
|
|
2548
|
+
import { Box as Box10, Typography as Typography10 } from "@mui/material";
|
|
2549
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2510
2550
|
var HomePage = () => {
|
|
2511
2551
|
const { clientContext } = useApp();
|
|
2512
|
-
return /* @__PURE__ */ jsxs9(
|
|
2513
|
-
/* @__PURE__ */
|
|
2514
|
-
/* @__PURE__ */
|
|
2552
|
+
return /* @__PURE__ */ jsxs9(Box10, { sx: { p: 3 }, children: [
|
|
2553
|
+
/* @__PURE__ */ jsx18(Typography10, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${clientContext?.username}` }),
|
|
2554
|
+
/* @__PURE__ */ jsx18(Typography10, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
|
|
2515
2555
|
] });
|
|
2516
2556
|
};
|
|
2517
2557
|
var HomePage_default = HomePage;
|
|
2518
2558
|
|
|
2519
2559
|
// src/pages/LogoutPage.tsx
|
|
2520
2560
|
import { useEffect as useEffect4 } from "react";
|
|
2521
|
-
import { Box as
|
|
2522
|
-
import { jsx as
|
|
2561
|
+
import { Box as Box11, Typography as Typography11, CircularProgress as CircularProgress2 } from "@mui/material";
|
|
2562
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2523
2563
|
var LogoutPage = () => {
|
|
2524
2564
|
const logout = useLogout_default();
|
|
2525
2565
|
useEffect4(() => {
|
|
2526
2566
|
logout();
|
|
2527
2567
|
}, [logout]);
|
|
2528
|
-
return /* @__PURE__ */ jsxs10(
|
|
2568
|
+
return /* @__PURE__ */ jsxs10(Box11, { sx: {
|
|
2529
2569
|
display: "flex",
|
|
2530
2570
|
flexDirection: "column",
|
|
2531
2571
|
justifyContent: "center",
|
|
@@ -2533,21 +2573,21 @@ var LogoutPage = () => {
|
|
|
2533
2573
|
height: "100vh",
|
|
2534
2574
|
textAlign: "center"
|
|
2535
2575
|
}, children: [
|
|
2536
|
-
/* @__PURE__ */
|
|
2537
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ jsx19(CircularProgress2, { size: 60 }),
|
|
2577
|
+
/* @__PURE__ */ jsx19(Typography11, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
|
|
2538
2578
|
] });
|
|
2539
2579
|
};
|
|
2540
2580
|
var LogoutPage_default = LogoutPage;
|
|
2541
2581
|
|
|
2542
2582
|
// src/pages/LoginPage.tsx
|
|
2543
2583
|
import { useState as useState6 } from "react";
|
|
2544
|
-
import { Button as
|
|
2584
|
+
import { Button as Button6, TextField, Typography as Typography12, Alert as Alert2, AlertTitle, Box as Box12, CircularProgress as CircularProgress3 } from "@mui/material";
|
|
2545
2585
|
import { useForm, Controller } from "react-hook-form";
|
|
2546
2586
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
2547
2587
|
import * as z from "zod";
|
|
2548
2588
|
import { useNavigate as useNavigate5 } from "react-router-dom";
|
|
2549
2589
|
import { useDispatch as useDispatch4 } from "react-redux";
|
|
2550
|
-
import { Fragment as
|
|
2590
|
+
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2551
2591
|
var loginSchema = z.object({
|
|
2552
2592
|
username: z.string().min(1, "El usuario es requerido"),
|
|
2553
2593
|
// Añadir validación básica
|
|
@@ -2603,8 +2643,8 @@ var LoginPage = () => {
|
|
|
2603
2643
|
setIsSubmitting(false);
|
|
2604
2644
|
}
|
|
2605
2645
|
};
|
|
2606
|
-
return /* @__PURE__ */
|
|
2607
|
-
|
|
2646
|
+
return /* @__PURE__ */ jsx20(
|
|
2647
|
+
Box12,
|
|
2608
2648
|
{
|
|
2609
2649
|
display: "flex",
|
|
2610
2650
|
alignItems: "center",
|
|
@@ -2612,7 +2652,7 @@ var LoginPage = () => {
|
|
|
2612
2652
|
minHeight: "100vh",
|
|
2613
2653
|
bgcolor: "#f5f5f5",
|
|
2614
2654
|
children: /* @__PURE__ */ jsxs11(
|
|
2615
|
-
|
|
2655
|
+
Box12,
|
|
2616
2656
|
{
|
|
2617
2657
|
width: "100%",
|
|
2618
2658
|
maxWidth: "400px",
|
|
@@ -2621,16 +2661,16 @@ var LoginPage = () => {
|
|
|
2621
2661
|
borderRadius: 8,
|
|
2622
2662
|
boxShadow: 3,
|
|
2623
2663
|
children: [
|
|
2624
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ jsx20(Typography12, { variant: "h5", align: "center", gutterBottom: true, children: "Iniciar Sesi\xF3n" }),
|
|
2625
2665
|
/* @__PURE__ */ jsxs11("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
2626
2666
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2627
|
-
/* @__PURE__ */
|
|
2628
|
-
/* @__PURE__ */
|
|
2667
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "username", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
|
|
2668
|
+
/* @__PURE__ */ jsx20(
|
|
2629
2669
|
Controller,
|
|
2630
2670
|
{
|
|
2631
2671
|
name: "username",
|
|
2632
2672
|
control,
|
|
2633
|
-
render: ({ field }) => /* @__PURE__ */
|
|
2673
|
+
render: ({ field }) => /* @__PURE__ */ jsx20(
|
|
2634
2674
|
TextField,
|
|
2635
2675
|
{
|
|
2636
2676
|
...field,
|
|
@@ -2647,13 +2687,13 @@ var LoginPage = () => {
|
|
|
2647
2687
|
)
|
|
2648
2688
|
] }),
|
|
2649
2689
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2650
|
-
/* @__PURE__ */
|
|
2651
|
-
/* @__PURE__ */
|
|
2690
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "password", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
|
|
2691
|
+
/* @__PURE__ */ jsx20(
|
|
2652
2692
|
Controller,
|
|
2653
2693
|
{
|
|
2654
2694
|
name: "password",
|
|
2655
2695
|
control,
|
|
2656
|
-
render: ({ field }) => /* @__PURE__ */
|
|
2696
|
+
render: ({ field }) => /* @__PURE__ */ jsx20(
|
|
2657
2697
|
TextField,
|
|
2658
2698
|
{
|
|
2659
2699
|
...field,
|
|
@@ -2669,14 +2709,14 @@ var LoginPage = () => {
|
|
|
2669
2709
|
}
|
|
2670
2710
|
)
|
|
2671
2711
|
] }),
|
|
2672
|
-
/* @__PURE__ */
|
|
2673
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsx20(Button6, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
2713
|
+
/* @__PURE__ */ jsx20(CircularProgress3, { size: 20, sx: { mr: 1 } }),
|
|
2674
2714
|
"Iniciando sesi\xF3n..."
|
|
2675
2715
|
] }) : "Iniciar Sesi\xF3n" })
|
|
2676
2716
|
] }),
|
|
2677
2717
|
loginError && /* @__PURE__ */ jsxs11(Alert2, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
|
|
2678
2718
|
" ",
|
|
2679
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ jsx20(AlertTitle, { children: "Error" }),
|
|
2680
2720
|
loginError
|
|
2681
2721
|
] })
|
|
2682
2722
|
]
|
|
@@ -2692,7 +2732,7 @@ import React7, { useState as useState7, useCallback as useCallback7, useMemo as
|
|
|
2692
2732
|
import { useParams } from "react-router-dom";
|
|
2693
2733
|
import {
|
|
2694
2734
|
TextField as TextField2,
|
|
2695
|
-
Button as
|
|
2735
|
+
Button as Button7,
|
|
2696
2736
|
FormControl,
|
|
2697
2737
|
InputLabel,
|
|
2698
2738
|
Select,
|
|
@@ -2701,7 +2741,7 @@ import {
|
|
|
2701
2741
|
FormControlLabel,
|
|
2702
2742
|
FormHelperText,
|
|
2703
2743
|
Typography as Typography14,
|
|
2704
|
-
Box as
|
|
2744
|
+
Box as Box14,
|
|
2705
2745
|
CircularProgress as CircularProgress4,
|
|
2706
2746
|
Alert as Alert3,
|
|
2707
2747
|
Divider as Divider2,
|
|
@@ -2709,14 +2749,14 @@ import {
|
|
|
2709
2749
|
} from "@mui/material";
|
|
2710
2750
|
|
|
2711
2751
|
// src/pages/procedure-results/SuccessDisplay.tsx
|
|
2712
|
-
import { Box as
|
|
2713
|
-
import { jsx as
|
|
2752
|
+
import { Box as Box13, Typography as Typography13, Paper as Paper2 } from "@mui/material";
|
|
2753
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2714
2754
|
var SuccessDisplay = ({ data }) => {
|
|
2715
2755
|
return /* @__PURE__ */ jsxs12(Paper2, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
/* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ jsx21(Typography13, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
|
|
2757
|
+
/* @__PURE__ */ jsx21(Typography13, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
|
|
2758
|
+
/* @__PURE__ */ jsx21(Box13, { 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) }) }),
|
|
2759
|
+
/* @__PURE__ */ jsx21(Typography13, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
|
|
2720
2760
|
] });
|
|
2721
2761
|
};
|
|
2722
2762
|
var SuccessDisplay_default = SuccessDisplay;
|
|
@@ -2730,7 +2770,7 @@ var extendResultsOk = (newComponents) => {
|
|
|
2730
2770
|
};
|
|
2731
2771
|
|
|
2732
2772
|
// src/components/ProcedureForm.tsx
|
|
2733
|
-
import { jsx as
|
|
2773
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2734
2774
|
var ProcedureForm = () => {
|
|
2735
2775
|
const { procedureName } = useParams();
|
|
2736
2776
|
const { clientContext } = useApp();
|
|
@@ -2946,7 +2986,7 @@ var ProcedureForm = () => {
|
|
|
2946
2986
|
};
|
|
2947
2987
|
if (param.options && param.options.length > 0) {
|
|
2948
2988
|
return /* @__PURE__ */ jsxs13(FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
|
|
2949
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ jsx22(InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
|
|
2950
2990
|
/* @__PURE__ */ jsxs13(
|
|
2951
2991
|
Select,
|
|
2952
2992
|
{
|
|
@@ -2958,14 +2998,14 @@ var ProcedureForm = () => {
|
|
|
2958
2998
|
label: param.label || param.name,
|
|
2959
2999
|
disabled: apiLoading,
|
|
2960
3000
|
sx: { fontSize: "0.8rem" },
|
|
2961
|
-
renderValue: (selected) => /* @__PURE__ */
|
|
3001
|
+
renderValue: (selected) => /* @__PURE__ */ jsx22(Typography14, { sx: { fontSize: "0.8rem" }, children: selected }),
|
|
2962
3002
|
children: [
|
|
2963
|
-
(!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */
|
|
2964
|
-
param.options.map((option) => /* @__PURE__ */
|
|
3003
|
+
(!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ jsx22(MenuItem, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ jsx22("em", { children: "Seleccione..." }) }),
|
|
3004
|
+
param.options.map((option) => /* @__PURE__ */ jsx22(MenuItem, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
|
|
2965
3005
|
]
|
|
2966
3006
|
}
|
|
2967
3007
|
),
|
|
2968
|
-
(param.description || errorMessage) && /* @__PURE__ */
|
|
3008
|
+
(param.description || errorMessage) && /* @__PURE__ */ jsx22(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
|
|
2969
3009
|
] });
|
|
2970
3010
|
}
|
|
2971
3011
|
switch (param.typeName) {
|
|
@@ -2974,18 +3014,18 @@ var ProcedureForm = () => {
|
|
|
2974
3014
|
case "tsrange":
|
|
2975
3015
|
case "time_range":
|
|
2976
3016
|
case "daterange":
|
|
2977
|
-
return /* @__PURE__ */
|
|
3017
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
|
|
2978
3018
|
case "decimal":
|
|
2979
3019
|
case "double":
|
|
2980
|
-
return /* @__PURE__ */
|
|
3020
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
|
|
2981
3021
|
case "integer":
|
|
2982
3022
|
case "bigint":
|
|
2983
|
-
return /* @__PURE__ */
|
|
3023
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
|
|
2984
3024
|
case "boolean":
|
|
2985
|
-
return /* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ jsx22(
|
|
2986
3026
|
FormControlLabel,
|
|
2987
3027
|
{
|
|
2988
|
-
control: /* @__PURE__ */
|
|
3028
|
+
control: /* @__PURE__ */ jsx22(
|
|
2989
3029
|
Checkbox,
|
|
2990
3030
|
{
|
|
2991
3031
|
checked: !!formValues[param.name],
|
|
@@ -2996,21 +3036,21 @@ var ProcedureForm = () => {
|
|
|
2996
3036
|
size: "small"
|
|
2997
3037
|
}
|
|
2998
3038
|
),
|
|
2999
|
-
label: /* @__PURE__ */
|
|
3039
|
+
label: /* @__PURE__ */ jsx22(Typography14, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
|
|
3000
3040
|
sx: { mt: 1, mb: 0 }
|
|
3001
3041
|
}
|
|
3002
3042
|
);
|
|
3003
3043
|
case "date":
|
|
3004
3044
|
case "timestamp":
|
|
3005
3045
|
case "time":
|
|
3006
|
-
return /* @__PURE__ */
|
|
3046
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: param.typeName === "date" ? "date" : param.typeName === "timestamp" ? "datetime-local" : "time", value: formValues[param.name] || "", ...commonProps, InputLabelProps: { shrink: true, sx: { fontSize: "0.8rem" } } });
|
|
3007
3047
|
case "jsonb":
|
|
3008
3048
|
case "jsona":
|
|
3009
|
-
return /* @__PURE__ */
|
|
3049
|
+
return /* @__PURE__ */ jsx22(TextField2, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
|
|
3010
3050
|
case "bytea":
|
|
3011
3051
|
return /* @__PURE__ */ jsxs13(FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
|
|
3012
|
-
/* @__PURE__ */
|
|
3013
|
-
/* @__PURE__ */
|
|
3052
|
+
/* @__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 }),
|
|
3053
|
+
/* @__PURE__ */ jsx22(
|
|
3014
3054
|
"input",
|
|
3015
3055
|
{
|
|
3016
3056
|
type: "file",
|
|
@@ -3024,17 +3064,17 @@ var ProcedureForm = () => {
|
|
|
3024
3064
|
style: { padding: "6px 0", fontSize: "0.8rem" }
|
|
3025
3065
|
}
|
|
3026
3066
|
),
|
|
3027
|
-
(param.description || errorMessage) && /* @__PURE__ */
|
|
3067
|
+
(param.description || errorMessage) && /* @__PURE__ */ jsx22(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
|
|
3028
3068
|
] });
|
|
3029
3069
|
default:
|
|
3030
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
|
|
3031
3071
|
}
|
|
3032
3072
|
}, [formValues, handleChange, apiLoading, validationErrors]);
|
|
3033
3073
|
const ResultDisplayContent = useMemo4(() => {
|
|
3034
3074
|
if (!procedureResultData || !procedure?.resultOk) return null;
|
|
3035
3075
|
const ComponentToRender = resultsOk[procedure.resultOk];
|
|
3036
3076
|
if (ComponentToRender) {
|
|
3037
|
-
return /* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ jsx22(ComponentToRender, { data: procedureResultData });
|
|
3038
3078
|
} else {
|
|
3039
3079
|
return /* @__PURE__ */ jsxs13(Paper3, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
|
|
3040
3080
|
/* @__PURE__ */ jsxs13(Typography14, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
|
|
@@ -3042,16 +3082,16 @@ var ProcedureForm = () => {
|
|
|
3042
3082
|
procedure.resultOk,
|
|
3043
3083
|
"' definido en el procedure no existe o no est\xE1 mapeado."
|
|
3044
3084
|
] }),
|
|
3045
|
-
/* @__PURE__ */
|
|
3085
|
+
/* @__PURE__ */ jsx22(Box14, { sx: {
|
|
3046
3086
|
bgcolor: "warning.dark",
|
|
3047
3087
|
p: 1,
|
|
3048
3088
|
borderRadius: 1
|
|
3049
|
-
}, children: /* @__PURE__ */
|
|
3089
|
+
}, children: /* @__PURE__ */ jsx22("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(procedureResultData, null, 2) }) })
|
|
3050
3090
|
] });
|
|
3051
3091
|
}
|
|
3052
3092
|
}, [procedureResultData, procedure]);
|
|
3053
3093
|
if (!procedure) {
|
|
3054
|
-
return /* @__PURE__ */ jsxs13(
|
|
3094
|
+
return /* @__PURE__ */ jsxs13(Box14, { sx: {
|
|
3055
3095
|
p: 2,
|
|
3056
3096
|
width: "100%",
|
|
3057
3097
|
boxSizing: "border-box",
|
|
@@ -3061,13 +3101,13 @@ var ProcedureForm = () => {
|
|
|
3061
3101
|
boxShadow: 3,
|
|
3062
3102
|
textAlign: "center"
|
|
3063
3103
|
}, children: [
|
|
3064
|
-
/* @__PURE__ */
|
|
3065
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ jsx22(CircularProgress4, { sx: { mb: 2 } }),
|
|
3105
|
+
/* @__PURE__ */ jsx22(Typography14, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
|
|
3066
3106
|
] });
|
|
3067
3107
|
}
|
|
3068
3108
|
return (
|
|
3069
3109
|
// Esta es la Box más externa que ahora controlará el scroll
|
|
3070
|
-
/* @__PURE__ */ jsxs13(
|
|
3110
|
+
/* @__PURE__ */ jsxs13(Box14, { sx: {
|
|
3071
3111
|
p: 2,
|
|
3072
3112
|
ml: 1,
|
|
3073
3113
|
mt: 2,
|
|
@@ -3084,17 +3124,17 @@ var ProcedureForm = () => {
|
|
|
3084
3124
|
overflowX: "hidden"
|
|
3085
3125
|
// Oculta el scroll horizontal si no es necesario para el contenedor principal
|
|
3086
3126
|
}, children: [
|
|
3087
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx22(Typography14, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
|
|
3088
3128
|
Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs13(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
|
|
3089
3129
|
"Por favor, corrige los errores en el formulario antes de enviar.",
|
|
3090
|
-
/* @__PURE__ */
|
|
3130
|
+
/* @__PURE__ */ jsx22("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ jsx22("li", { children: err }, idx)) })
|
|
3091
3131
|
] }),
|
|
3092
|
-
!Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */
|
|
3093
|
-
!Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */
|
|
3132
|
+
!Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ jsx22(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
|
|
3133
|
+
!Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ jsx22(Alert3, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
|
|
3094
3134
|
/* @__PURE__ */ jsxs13("form", { onSubmit: handleSubmit, children: [
|
|
3095
|
-
procedure.parameters.map((param) => /* @__PURE__ */
|
|
3096
|
-
/* @__PURE__ */
|
|
3097
|
-
|
|
3135
|
+
procedure.parameters.map((param) => /* @__PURE__ */ jsx22("div", { children: renderInputField(param) }, param.name)),
|
|
3136
|
+
/* @__PURE__ */ jsx22(
|
|
3137
|
+
Button7,
|
|
3098
3138
|
{
|
|
3099
3139
|
type: "submit",
|
|
3100
3140
|
variant: "contained",
|
|
@@ -3102,20 +3142,20 @@ var ProcedureForm = () => {
|
|
|
3102
3142
|
disabled: apiLoading || Object.values(validationErrors).some((err) => err !== null),
|
|
3103
3143
|
sx: { mt: 2 },
|
|
3104
3144
|
size: "medium",
|
|
3105
|
-
startIcon: apiLoading ? /* @__PURE__ */
|
|
3145
|
+
startIcon: apiLoading ? /* @__PURE__ */ jsx22(CircularProgress4, { size: 20, color: "inherit" }) : null,
|
|
3106
3146
|
children: apiLoading ? "Ejecutando..." : procedure.proceedLabel || "Ejecutar"
|
|
3107
3147
|
}
|
|
3108
3148
|
)
|
|
3109
3149
|
] }),
|
|
3110
|
-
ResultDisplayContent && /* @__PURE__ */ jsxs13(
|
|
3150
|
+
ResultDisplayContent && /* @__PURE__ */ jsxs13(Box14, { sx: { mt: 2 }, children: [
|
|
3111
3151
|
" ",
|
|
3112
3152
|
ResultDisplayContent
|
|
3113
3153
|
] }),
|
|
3114
|
-
executionLog.length > 0 && /* @__PURE__ */ jsxs13(
|
|
3115
|
-
/* @__PURE__ */
|
|
3116
|
-
/* @__PURE__ */
|
|
3117
|
-
/* @__PURE__ */
|
|
3118
|
-
|
|
3154
|
+
executionLog.length > 0 && /* @__PURE__ */ jsxs13(Box14, { sx: { mt: 3 }, children: [
|
|
3155
|
+
/* @__PURE__ */ jsx22(Divider2, { sx: { mb: 2 } }),
|
|
3156
|
+
/* @__PURE__ */ jsx22(Typography14, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
|
|
3157
|
+
/* @__PURE__ */ jsx22(
|
|
3158
|
+
Box14,
|
|
3119
3159
|
{
|
|
3120
3160
|
sx: {
|
|
3121
3161
|
bgcolor: "grey.100",
|
|
@@ -3128,7 +3168,7 @@ var ProcedureForm = () => {
|
|
|
3128
3168
|
fontSize: "0.75rem",
|
|
3129
3169
|
whiteSpace: "pre-wrap"
|
|
3130
3170
|
},
|
|
3131
|
-
children: executionLog.map((log, index) => /* @__PURE__ */
|
|
3171
|
+
children: executionLog.map((log, index) => /* @__PURE__ */ jsx22(
|
|
3132
3172
|
Typography14,
|
|
3133
3173
|
{
|
|
3134
3174
|
component: "pre",
|
|
@@ -3156,7 +3196,7 @@ import { PersistGate } from "redux-persist/integration/react";
|
|
|
3156
3196
|
// src/components/PrivateRoute.tsx
|
|
3157
3197
|
import { useEffect as useEffect5 } from "react";
|
|
3158
3198
|
import { Navigate, useLocation as useLocation2 } from "react-router-dom";
|
|
3159
|
-
import { Fragment as
|
|
3199
|
+
import { Fragment as Fragment3, jsx as jsx23 } from "react/jsx-runtime";
|
|
3160
3200
|
var PrivateRoute = ({ children }) => {
|
|
3161
3201
|
const location = useLocation2();
|
|
3162
3202
|
const dispatch = useAppDispatch();
|
|
@@ -3180,14 +3220,14 @@ var PrivateRoute = ({ children }) => {
|
|
|
3180
3220
|
}, [isAuthenticated, isLoadingAuth, location, dispatch, clientContextStatus]);
|
|
3181
3221
|
if (isLoadingAuth) {
|
|
3182
3222
|
console.log(`[PrivateRoute] Returning loading state...`);
|
|
3183
|
-
return /* @__PURE__ */
|
|
3223
|
+
return /* @__PURE__ */ jsx23("p", { children: "Verificando autenticaci\xF3n..." });
|
|
3184
3224
|
}
|
|
3185
3225
|
if (!isAuthenticated) {
|
|
3186
3226
|
console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
|
|
3187
|
-
return /* @__PURE__ */
|
|
3227
|
+
return /* @__PURE__ */ jsx23(Navigate, { to: "/login", replace: true });
|
|
3188
3228
|
}
|
|
3189
3229
|
console.log(`[PrivateRoute] User authenticated, rendering children.`);
|
|
3190
|
-
return /* @__PURE__ */
|
|
3230
|
+
return /* @__PURE__ */ jsx23(Fragment3, { children });
|
|
3191
3231
|
};
|
|
3192
3232
|
var PrivateRoute_default = PrivateRoute;
|
|
3193
3233
|
|
|
@@ -3221,25 +3261,25 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
|
|
|
3221
3261
|
|
|
3222
3262
|
// src/pages/GenericDataGridPage.tsx
|
|
3223
3263
|
import { useParams as useParams2 } from "react-router-dom";
|
|
3224
|
-
import { Box as
|
|
3225
|
-
import { jsx as
|
|
3264
|
+
import { Box as Box15, Alert as Alert4, Typography as Typography15 } from "@mui/material";
|
|
3265
|
+
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3226
3266
|
var GenericDataGridPage = () => {
|
|
3227
3267
|
const { tableName } = useParams2();
|
|
3228
3268
|
if (!tableName) {
|
|
3229
|
-
return /* @__PURE__ */
|
|
3230
|
-
/* @__PURE__ */
|
|
3231
|
-
/* @__PURE__ */
|
|
3269
|
+
return /* @__PURE__ */ jsx24(Box15, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs14(Alert4, { severity: "error", children: [
|
|
3270
|
+
/* @__PURE__ */ jsx24(Typography15, { variant: "h6", children: "Error: Nombre de tabla no especificado en la URL." }),
|
|
3271
|
+
/* @__PURE__ */ jsx24(Typography15, { variant: "body1", children: "Por favor, aseg\xFArate de que la URL contenga el nombre de la tabla (ej. `/data/users`)." })
|
|
3232
3272
|
] }) });
|
|
3233
3273
|
}
|
|
3234
|
-
return /* @__PURE__ */
|
|
3274
|
+
return /* @__PURE__ */ jsx24(GenericDataGrid_default, { tableName, fixedFields: [] });
|
|
3235
3275
|
};
|
|
3236
3276
|
var GenericDataGridPage_default = GenericDataGridPage;
|
|
3237
3277
|
|
|
3238
3278
|
// src/pages/MenuTablePage.tsx
|
|
3239
3279
|
import { useMemo as useMemo5 } from "react";
|
|
3240
3280
|
import { useParams as useParams3 } from "react-router-dom";
|
|
3241
|
-
import { Box as
|
|
3242
|
-
import { jsx as
|
|
3281
|
+
import { Box as Box16, Alert as Alert5, Typography as Typography16 } from "@mui/material";
|
|
3282
|
+
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3243
3283
|
var MenuTablePage = () => {
|
|
3244
3284
|
const { menuName } = useParams3();
|
|
3245
3285
|
const { clientContext } = useApp();
|
|
@@ -3281,12 +3321,12 @@ var MenuTablePage = () => {
|
|
|
3281
3321
|
};
|
|
3282
3322
|
}, [menuName, clientContext]);
|
|
3283
3323
|
if (!currentTableName) {
|
|
3284
|
-
return /* @__PURE__ */
|
|
3285
|
-
/* @__PURE__ */
|
|
3286
|
-
/* @__PURE__ */
|
|
3324
|
+
return /* @__PURE__ */ jsx25(Box16, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs15(Alert5, { severity: "error", children: [
|
|
3325
|
+
/* @__PURE__ */ jsx25(Typography16, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
|
|
3326
|
+
/* @__PURE__ */ jsx25(Typography16, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
|
|
3287
3327
|
] }) });
|
|
3288
3328
|
}
|
|
3289
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ jsx25(
|
|
3290
3330
|
GenericDataGrid_default,
|
|
3291
3331
|
{
|
|
3292
3332
|
tableName: currentTableName,
|
|
@@ -3297,7 +3337,7 @@ var MenuTablePage = () => {
|
|
|
3297
3337
|
var MenuTablePage_default = MenuTablePage;
|
|
3298
3338
|
|
|
3299
3339
|
// src/App.tsx
|
|
3300
|
-
import { jsx as
|
|
3340
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3301
3341
|
var LocationTracker = () => {
|
|
3302
3342
|
const location = useLocation4();
|
|
3303
3343
|
const dispatch = useAppDispatch();
|
|
@@ -3309,18 +3349,18 @@ var LocationTracker = () => {
|
|
|
3309
3349
|
function FrontendPlusReactRoutes({ myRoutes, myWScreens }) {
|
|
3310
3350
|
const allWScreens = { ...wScreens, ...myWScreens || {} };
|
|
3311
3351
|
return /* @__PURE__ */ jsxs16(Routes, { children: [
|
|
3312
|
-
/* @__PURE__ */
|
|
3313
|
-
/* @__PURE__ */
|
|
3352
|
+
/* @__PURE__ */ jsx26(Route, { path: "/login", element: /* @__PURE__ */ jsx26(LoginPage_default, {}) }),
|
|
3353
|
+
/* @__PURE__ */ jsx26(Route, { path: "/logout", element: /* @__PURE__ */ jsx26(LogoutPage_default, {}) }),
|
|
3314
3354
|
/* @__PURE__ */ jsxs16(Route, { element: /* @__PURE__ */ jsxs16(PrivateRoute_default, { children: [
|
|
3315
|
-
/* @__PURE__ */
|
|
3316
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ jsx26(InitialRedirectHandler_default, {}),
|
|
3356
|
+
/* @__PURE__ */ jsx26(MainLayout_default, {})
|
|
3317
3357
|
] }), children: [
|
|
3318
|
-
/* @__PURE__ */
|
|
3319
|
-
/* @__PURE__ */
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
3322
|
-
/* @__PURE__ */
|
|
3323
|
-
Object.keys(allWScreens).map((screenName) => /* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsx26(Route, { path: "/", element: /* @__PURE__ */ jsx26(HomePage_default, {}) }),
|
|
3359
|
+
/* @__PURE__ */ jsx26(Route, { path: "/home", element: /* @__PURE__ */ jsx26(HomePage_default, {}) }),
|
|
3360
|
+
/* @__PURE__ */ jsx26(Route, { path: "/table/:tableName", element: /* @__PURE__ */ jsx26(GenericDataGridPage_default, {}) }),
|
|
3361
|
+
/* @__PURE__ */ jsx26(Route, { path: "/menu/:menuName", element: /* @__PURE__ */ jsx26(MenuTablePage_default, {}) }),
|
|
3362
|
+
/* @__PURE__ */ jsx26(Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ jsx26(ProcedureForm_default, {}) }),
|
|
3363
|
+
Object.keys(allWScreens).map((screenName) => /* @__PURE__ */ jsx26(
|
|
3324
3364
|
Route,
|
|
3325
3365
|
{
|
|
3326
3366
|
path: `/wScreens/${screenName}`,
|
|
@@ -3328,17 +3368,17 @@ function FrontendPlusReactRoutes({ myRoutes, myWScreens }) {
|
|
|
3328
3368
|
},
|
|
3329
3369
|
screenName
|
|
3330
3370
|
)),
|
|
3331
|
-
/* @__PURE__ */
|
|
3371
|
+
/* @__PURE__ */ jsx26(
|
|
3332
3372
|
Route,
|
|
3333
3373
|
{
|
|
3334
3374
|
path: "/wScreens-fallback/:screenName",
|
|
3335
|
-
element: /* @__PURE__ */
|
|
3375
|
+
element: /* @__PURE__ */ jsx26(WScreens_default, { screenName: ":screenName" })
|
|
3336
3376
|
}
|
|
3337
3377
|
),
|
|
3338
|
-
/* @__PURE__ */
|
|
3378
|
+
/* @__PURE__ */ jsx26(Route, { path: "*", element: /* @__PURE__ */ jsx26("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
|
|
3339
3379
|
] }),
|
|
3340
3380
|
myRoutes,
|
|
3341
|
-
/* @__PURE__ */
|
|
3381
|
+
/* @__PURE__ */ jsx26(Route, { path: "*", element: /* @__PURE__ */ jsx26(Navigate2, { to: "/", replace: true }) })
|
|
3342
3382
|
] });
|
|
3343
3383
|
}
|
|
3344
3384
|
var App = ({
|
|
@@ -3355,17 +3395,17 @@ var App = ({
|
|
|
3355
3395
|
extendResultsOk(myResultsOk);
|
|
3356
3396
|
}
|
|
3357
3397
|
}, [myClientSides, myResultsOk]);
|
|
3358
|
-
return /* @__PURE__ */
|
|
3359
|
-
/* @__PURE__ */
|
|
3360
|
-
/* @__PURE__ */
|
|
3361
|
-
/* @__PURE__ */
|
|
3398
|
+
return /* @__PURE__ */ jsx26(Provider, { store, children: /* @__PURE__ */ jsx26(PersistGate, { loading: null, persistor, children: /* @__PURE__ */ jsxs16(BrowserRouter, { children: [
|
|
3399
|
+
/* @__PURE__ */ jsx26(LocationTracker, {}),
|
|
3400
|
+
/* @__PURE__ */ jsx26(AppProvider, { children: /* @__PURE__ */ jsxs16(SnackbarProvider, { children: [
|
|
3401
|
+
/* @__PURE__ */ jsx26(
|
|
3362
3402
|
FrontendPlusReactRoutes,
|
|
3363
3403
|
{
|
|
3364
3404
|
myRoutes,
|
|
3365
3405
|
myWScreens
|
|
3366
3406
|
}
|
|
3367
3407
|
),
|
|
3368
|
-
/* @__PURE__ */
|
|
3408
|
+
/* @__PURE__ */ jsx26(SessionExpiredMessage_default, {})
|
|
3369
3409
|
] }) })
|
|
3370
3410
|
] }) }) });
|
|
3371
3411
|
};
|