frontend-plus-react 0.1.3 → 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 -401
- 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 -584
- 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,18 +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
|
-
import DeleteIcon from "@mui/icons-material/Delete";
|
|
998
994
|
|
|
999
|
-
// src/components/
|
|
1000
|
-
import
|
|
1001
|
-
import
|
|
1002
|
-
|
|
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) => {
|
|
1003
1029
|
const { column } = props;
|
|
1004
|
-
const isPrimaryKey =
|
|
1005
|
-
return /* @__PURE__ */
|
|
1030
|
+
const isPrimaryKey = fieldDef.isPk;
|
|
1031
|
+
return /* @__PURE__ */ jsx3(
|
|
1006
1032
|
Box,
|
|
1007
1033
|
{
|
|
1008
1034
|
sx: {
|
|
@@ -1014,7 +1040,7 @@ function PkHeaderRenderer(props) {
|
|
|
1014
1040
|
boxSizing: "border-box",
|
|
1015
1041
|
height: "100%"
|
|
1016
1042
|
},
|
|
1017
|
-
children: /* @__PURE__ */
|
|
1043
|
+
children: /* @__PURE__ */ jsx3(
|
|
1018
1044
|
Typography,
|
|
1019
1045
|
{
|
|
1020
1046
|
variant: "body2",
|
|
@@ -1029,73 +1055,29 @@ function PkHeaderRenderer(props) {
|
|
|
1029
1055
|
)
|
|
1030
1056
|
}
|
|
1031
1057
|
);
|
|
1032
|
-
}
|
|
1033
|
-
var PkHeaderRenderer_default = PkHeaderRenderer;
|
|
1034
|
-
|
|
1035
|
-
// src/components/grid/PkCellRenderer.tsx
|
|
1036
|
-
import { Typography as Typography2 } from "@mui/material";
|
|
1037
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1038
|
-
function PkCellRenderer(props) {
|
|
1039
|
-
const { column, row } = props;
|
|
1040
|
-
const isPrimaryKey = column.isPK;
|
|
1041
|
-
const rowAsRecord = row;
|
|
1042
|
-
const value = rowAsRecord[column.key];
|
|
1043
|
-
return /* @__PURE__ */ jsx3(
|
|
1044
|
-
Typography2,
|
|
1045
|
-
{
|
|
1046
|
-
variant: "body2",
|
|
1047
|
-
sx: {
|
|
1048
|
-
//fontWeight: isPrimaryKey ? 'bold' : 'normal',
|
|
1049
|
-
fontSize: "0.875rem",
|
|
1050
|
-
// Ajusta el tamaño si es necesario
|
|
1051
|
-
whiteSpace: "nowrap",
|
|
1052
|
-
overflow: "hidden",
|
|
1053
|
-
textOverflow: "ellipsis",
|
|
1054
|
-
width: "100%"
|
|
1055
|
-
},
|
|
1056
|
-
children: value === null || value === void 0 ? "" : String(value)
|
|
1057
|
-
}
|
|
1058
|
-
);
|
|
1059
|
-
}
|
|
1060
|
-
var PkCellRenderer_default = PkCellRenderer;
|
|
1061
|
-
|
|
1062
|
-
// src/components/ConfirmDialog.tsx
|
|
1063
|
-
import Dialog from "@mui/material/Dialog";
|
|
1064
|
-
import DialogTitle from "@mui/material/DialogTitle";
|
|
1065
|
-
import DialogContent from "@mui/material/DialogContent";
|
|
1066
|
-
import DialogContentText from "@mui/material/DialogContentText";
|
|
1067
|
-
import DialogActions from "@mui/material/DialogActions";
|
|
1068
|
-
import Button from "@mui/material/Button";
|
|
1069
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1070
|
-
var ConfirmDialog = ({ open, onClose, title, message }) => {
|
|
1071
|
-
return /* @__PURE__ */ jsxs2(
|
|
1072
|
-
Dialog,
|
|
1073
|
-
{
|
|
1074
|
-
open,
|
|
1075
|
-
onClose: () => onClose(false),
|
|
1076
|
-
"aria-labelledby": "confirm-dialog-title",
|
|
1077
|
-
"aria-describedby": "confirm-dialog-description",
|
|
1078
|
-
children: [
|
|
1079
|
-
/* @__PURE__ */ jsx4(DialogTitle, { id: "confirm-dialog-title", children: title }),
|
|
1080
|
-
/* @__PURE__ */ jsx4(DialogContent, { children: /* @__PURE__ */ jsx4(DialogContentText, { id: "confirm-dialog-description", children: message }) }),
|
|
1081
|
-
/* @__PURE__ */ jsxs2(DialogActions, { children: [
|
|
1082
|
-
/* @__PURE__ */ jsx4(Button, { onClick: () => onClose(false), color: "primary", children: "Cancelar" }),
|
|
1083
|
-
/* @__PURE__ */ jsx4(Button, { onClick: () => onClose(true), color: "error", autoFocus: true, children: "Confirmar" })
|
|
1084
|
-
] })
|
|
1085
|
-
]
|
|
1086
|
-
}
|
|
1087
|
-
);
|
|
1088
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() }) });
|
|
1089
1071
|
|
|
1090
1072
|
// src/components/grid/FilterInputRender.tsx
|
|
1091
1073
|
import { InputBase } from "@mui/material";
|
|
1092
|
-
import { jsx as
|
|
1074
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1093
1075
|
function FilterInputRenderer({
|
|
1094
1076
|
column,
|
|
1095
1077
|
filters,
|
|
1096
1078
|
setFilters
|
|
1097
1079
|
}) {
|
|
1098
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ jsx4(
|
|
1099
1081
|
InputBase,
|
|
1100
1082
|
{
|
|
1101
1083
|
value: filters[column.key] || "",
|
|
@@ -1118,10 +1100,212 @@ function FilterInputRenderer({
|
|
|
1118
1100
|
}
|
|
1119
1101
|
var FilterInputRender_default = FilterInputRenderer;
|
|
1120
1102
|
|
|
1121
|
-
// 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
|
|
1122
1306
|
import { useCallback as useCallback3, useMemo, useState as useState3 } from "react";
|
|
1123
1307
|
import InputBase2 from "@mui/material/InputBase";
|
|
1124
|
-
import { jsx as
|
|
1308
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1125
1309
|
function InputRenderer({
|
|
1126
1310
|
column,
|
|
1127
1311
|
row,
|
|
@@ -1140,7 +1324,7 @@ function InputRenderer({
|
|
|
1140
1324
|
const [editingValue, setEditingValue] = useState3(row[column.key]);
|
|
1141
1325
|
const { showSuccess, showError } = useSnackbar();
|
|
1142
1326
|
const initialRowId = useMemo(() => getPrimaryKeyValues(row, primaryKey), [row, primaryKey]);
|
|
1143
|
-
const { callApi
|
|
1327
|
+
const { callApi } = useApiCall();
|
|
1144
1328
|
const handleCommit = useCallback3(async (currentValue, closeEditor, focusNextCell) => {
|
|
1145
1329
|
const processedNewValue = typeof currentValue === "string" ? currentValue.trim() === "" ? null : currentValue.trim() : currentValue;
|
|
1146
1330
|
const potentialUpdatedRow = { ...row, [column.key]: processedNewValue };
|
|
@@ -1318,7 +1502,7 @@ function InputRenderer({
|
|
|
1318
1502
|
}, [handleCommit, editingValue]);
|
|
1319
1503
|
const fieldDefinition = tableDefinition.fields.find((f) => f.name === column.key);
|
|
1320
1504
|
const isFieldEditable = fieldDefinition?.editable !== false;
|
|
1321
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ jsx9(
|
|
1322
1506
|
InputBase2,
|
|
1323
1507
|
{
|
|
1324
1508
|
value: editingValue === null ? "" : editingValue,
|
|
@@ -1341,90 +1525,65 @@ function InputRenderer({
|
|
|
1341
1525
|
}
|
|
1342
1526
|
);
|
|
1343
1527
|
}
|
|
1344
|
-
var
|
|
1528
|
+
var InputRenderer_default = InputRenderer;
|
|
1345
1529
|
|
|
1346
|
-
// src/components/grid/
|
|
1347
|
-
import {
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
alignItems: "center",
|
|
1357
|
-
backgroundColor: value === "Special" ? "lightblue" : "transparent"
|
|
1358
|
-
}, children: /* @__PURE__ */ jsx7(Typography3, { variant: "body2", sx: { fontWeight: "bold" }, children: value ? `CS: ${value}` : "N/A" }) });
|
|
1359
|
-
};
|
|
1360
|
-
var ExampleClientSideComponent_default = ExampleClientSideComponent;
|
|
1361
|
-
|
|
1362
|
-
// src/components/grid/FallbackClientSideRenderer.tsx
|
|
1363
|
-
import { Box as Box3, Typography as Typography4, Tooltip } from "@mui/material";
|
|
1364
|
-
import WarningAmberIcon from "@mui/icons-material/WarningAmber";
|
|
1365
|
-
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1366
|
-
var FallbackClientSideRenderer = ({ column, row, fieldDefinition }) => {
|
|
1367
|
-
const value = row[column.key];
|
|
1368
|
-
const clientSideName = fieldDefinition?.clientSide || "Desconocido";
|
|
1369
|
-
return /* @__PURE__ */ jsx8(Tooltip, { title: `Componente clientSide '${clientSideName}' no implementado. Mostrando valor por defecto.`, children: /* @__PURE__ */ jsxs3(
|
|
1370
|
-
Box3,
|
|
1371
|
-
{
|
|
1372
|
-
sx: {
|
|
1373
|
-
display: "flex",
|
|
1374
|
-
alignItems: "center",
|
|
1375
|
-
justifyContent: "space-between",
|
|
1376
|
-
// Para espaciar el valor y el icono
|
|
1377
|
-
gap: 1,
|
|
1378
|
-
// Espacio entre elementos
|
|
1379
|
-
width: "100%",
|
|
1380
|
-
height: "100%",
|
|
1381
|
-
paddingLeft: "8px",
|
|
1382
|
-
backgroundColor: "rgba(255, 193, 7, 0.1)",
|
|
1383
|
-
// Amarillo claro para advertencia
|
|
1384
|
-
border: "1px dashed rgba(255, 193, 7, 0.5)",
|
|
1385
|
-
boxSizing: "border-box",
|
|
1386
|
-
overflow: "hidden"
|
|
1387
|
-
// Evita que el contenido se desborde
|
|
1388
|
-
},
|
|
1389
|
-
children: [
|
|
1390
|
-
/* @__PURE__ */ jsx8(Typography4, { variant: "body2", noWrap: true, sx: { flexGrow: 1 }, children: value !== null && value !== void 0 ? String(value) : "*Vac\xEDo*" }),
|
|
1391
|
-
/* @__PURE__ */ jsx8(
|
|
1392
|
-
WarningAmberIcon,
|
|
1393
|
-
{
|
|
1394
|
-
sx: {
|
|
1395
|
-
fontSize: 18,
|
|
1396
|
-
color: "warning.main",
|
|
1397
|
-
marginRight: "4px"
|
|
1398
|
-
// Pequeño margen a la derecha del icono
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
)
|
|
1402
|
-
]
|
|
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;
|
|
1403
1540
|
}
|
|
1404
|
-
|
|
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
|
+
}
|
|
1405
1555
|
};
|
|
1406
|
-
var FallbackClientSideRenderer_default = FallbackClientSideRenderer;
|
|
1407
1556
|
|
|
1408
|
-
// src/components/grid/
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
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
|
+
}
|
|
1419
1577
|
|
|
1420
1578
|
// src/components/grid/GenericDataGrid.tsx
|
|
1421
|
-
import {
|
|
1579
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1422
1580
|
var getPrimaryKeyValues = (row, primaryKey) => {
|
|
1423
|
-
return primaryKey.map((key) => {
|
|
1581
|
+
return primaryKey.concat(DETAIL_ROW_INDICATOR).map((key) => {
|
|
1424
1582
|
return row[key] !== void 0 && row[key] !== null ? String(row[key]) : "NULL_OR_UNDEFINED";
|
|
1425
1583
|
}).join("|");
|
|
1426
1584
|
};
|
|
1427
|
-
var NEW_ROW_INDICATOR = "
|
|
1585
|
+
var NEW_ROW_INDICATOR = "$new";
|
|
1586
|
+
var DETAIL_ROW_INDICATOR = "$detail";
|
|
1428
1587
|
var GenericDataGrid = ({
|
|
1429
1588
|
tableName,
|
|
1430
1589
|
fixedFields
|
|
@@ -1436,7 +1595,7 @@ var GenericDataGrid = ({
|
|
|
1436
1595
|
const [selectedRows, setSelectedRows] = useState4(() => /* @__PURE__ */ new Set());
|
|
1437
1596
|
const [cellFeedback, setCellFeedback] = useState4(null);
|
|
1438
1597
|
const [localCellChanges, setLocalCellChanges] = useState4(/* @__PURE__ */ new Map());
|
|
1439
|
-
const theme =
|
|
1598
|
+
const theme = useTheme2();
|
|
1440
1599
|
const [openConfirmDialog, setOpenConfirmDialog] = useState4(false);
|
|
1441
1600
|
const [rowToDelete, setRowToDelete] = useState4(null);
|
|
1442
1601
|
const [exitingRowIds, setExitingRowIds] = useState4(/* @__PURE__ */ new Set());
|
|
@@ -1444,6 +1603,8 @@ var GenericDataGrid = ({
|
|
|
1444
1603
|
const feedbackTimerRef = useRef(null);
|
|
1445
1604
|
const dataGridRef = useRef(null);
|
|
1446
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;
|
|
1447
1608
|
useEffect(() => {
|
|
1448
1609
|
setFilters({});
|
|
1449
1610
|
setIsFilterRowVisible(false);
|
|
@@ -1467,7 +1628,6 @@ var GenericDataGrid = ({
|
|
|
1467
1628
|
const data = await callApi("table_data", {
|
|
1468
1629
|
table: tableName,
|
|
1469
1630
|
fixedFields
|
|
1470
|
-
// Envía el array fixedFields directamente a la API
|
|
1471
1631
|
});
|
|
1472
1632
|
setTableData(data);
|
|
1473
1633
|
} catch (err) {
|
|
@@ -1484,7 +1644,7 @@ var GenericDataGrid = ({
|
|
|
1484
1644
|
if (feedbackTimerRef.current) {
|
|
1485
1645
|
clearTimeout(feedbackTimerRef.current);
|
|
1486
1646
|
}
|
|
1487
|
-
const timerDuration =
|
|
1647
|
+
const timerDuration = 3e3;
|
|
1488
1648
|
feedbackTimerRef.current = setTimeout(() => {
|
|
1489
1649
|
setCellFeedback(null);
|
|
1490
1650
|
}, timerDuration);
|
|
@@ -1638,37 +1798,25 @@ var GenericDataGrid = ({
|
|
|
1638
1798
|
const handleEnterKeyPressInEditor = useCallback4((rowIndex, columnKey, currentColumns) => {
|
|
1639
1799
|
if (dataGridRef.current && tableDefinition) {
|
|
1640
1800
|
const currentColumnIndex = currentColumns.findIndex((col) => col.key === columnKey);
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
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;
|
|
1648
1813
|
nextRowIndex++;
|
|
1649
1814
|
if (nextRowIndex >= filteredRows.length) {
|
|
1650
1815
|
nextRowIndex = 0;
|
|
1651
|
-
nextColumnIndex = 0;
|
|
1652
|
-
if (filteredRows.length === 0 || rowIndex === filteredRows.length - 1 && currentColumnIndex === currentColumns.length - 1) {
|
|
1653
|
-
foundNextTarget = true;
|
|
1654
|
-
break;
|
|
1655
|
-
}
|
|
1656
1816
|
}
|
|
1657
1817
|
}
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1660
|
-
const fieldDefinition = tableDefinition.fields.find((f) => f.name === nextColumn.key);
|
|
1661
|
-
const isEditableField = fieldDefinition?.editable !== false;
|
|
1662
|
-
if (nextColumn.key !== "filterToggle" && nextColumn.key !== "deleteAction" && isEditableField) {
|
|
1663
|
-
foundNextTarget = true;
|
|
1664
|
-
} else {
|
|
1665
|
-
nextColumnIndex++;
|
|
1666
|
-
}
|
|
1667
|
-
} else {
|
|
1668
|
-
nextColumnIndex++;
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
if (foundNextTarget) {
|
|
1818
|
+
const nextColumnKey = editableColumnKeys[nextEditableColumnIndex];
|
|
1819
|
+
const nextColumnIndex = currentColumns.findIndex((col) => col.key === nextColumnKey);
|
|
1672
1820
|
dataGridRef.current.selectCell({ rowIdx: nextRowIndex, idx: nextColumnIndex }, { enableEditor: false, scrollIntoView: true });
|
|
1673
1821
|
}
|
|
1674
1822
|
}
|
|
@@ -1680,183 +1828,84 @@ var GenericDataGrid = ({
|
|
|
1680
1828
|
const fixedFieldEntry = fixedFields?.find((f) => f.fieldName === field.name);
|
|
1681
1829
|
return !(fixedFieldEntry && fixedFieldEntry.until === void 0);
|
|
1682
1830
|
});
|
|
1683
|
-
const defaultColumns = fieldsToShow.map((
|
|
1684
|
-
const isFixedField = fixedFields?.some((f) => f.fieldName ===
|
|
1685
|
-
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;
|
|
1686
1834
|
return {
|
|
1687
|
-
key:
|
|
1688
|
-
|
|
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),
|
|
1689
1844
|
resizable: true,
|
|
1690
1845
|
sortable: true,
|
|
1846
|
+
//frozen: true,
|
|
1691
1847
|
editable: isFieldEditable,
|
|
1692
|
-
// Usar la nueva bandera de editable
|
|
1693
1848
|
flexGrow: 1,
|
|
1694
1849
|
minWidth: 60,
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
renderSummaryCell: ({ column }) => {
|
|
1698
|
-
const fixedFieldEntry = fixedFields?.find((f) => f.fieldName === column.key);
|
|
1699
|
-
if (fixedFieldEntry && fixedFieldEntry.until === void 0) return null;
|
|
1700
|
-
return isFilterRowVisible ? /* @__PURE__ */ jsx9(
|
|
1701
|
-
FilterInputRender_default,
|
|
1702
|
-
{
|
|
1703
|
-
column,
|
|
1704
|
-
filters,
|
|
1705
|
-
setFilters
|
|
1706
|
-
}
|
|
1707
|
-
) : null;
|
|
1708
|
-
},
|
|
1709
|
-
renderCell: (props) => {
|
|
1710
|
-
const rowId = getPrimaryKeyValues(props.row, primaryKey);
|
|
1711
|
-
const fieldDefinition = tableDefinition.fields.find((f) => f.name === props.column.key);
|
|
1712
|
-
if (fieldDefinition?.clientSide) {
|
|
1713
|
-
const ClientSideComponent = clientSides[fieldDefinition.clientSide];
|
|
1714
|
-
if (ClientSideComponent) {
|
|
1715
|
-
return /* @__PURE__ */ jsx9(
|
|
1716
|
-
ClientSideComponent,
|
|
1717
|
-
{
|
|
1718
|
-
...props,
|
|
1719
|
-
fieldDefinition,
|
|
1720
|
-
tableDefinition,
|
|
1721
|
-
primaryKey
|
|
1722
|
-
}
|
|
1723
|
-
);
|
|
1724
|
-
} else {
|
|
1725
|
-
return /* @__PURE__ */ jsx9(
|
|
1726
|
-
FallbackClientSideRenderer_default,
|
|
1727
|
-
{
|
|
1728
|
-
...props,
|
|
1729
|
-
fieldDefinition,
|
|
1730
|
-
tableDefinition,
|
|
1731
|
-
primaryKey
|
|
1732
|
-
}
|
|
1733
|
-
);
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
let cellBackgroundColor = "transparent";
|
|
1737
|
-
if (cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key) {
|
|
1738
|
-
cellBackgroundColor = cellFeedback.type === "error" ? theme.palette.error.light : theme.palette.success.light;
|
|
1739
|
-
} else {
|
|
1740
|
-
const isNewRowLocalCheck = props.row[NEW_ROW_INDICATOR];
|
|
1741
|
-
const isMandatory = tableDefinition.primaryKey.includes(props.column.key) || tableDefinition.fields.find((f) => f.name === props.column.key)?.nullable === false;
|
|
1742
|
-
const hasValue = props.row[props.column.key] !== null && props.row[props.column.key] !== void 0 && String(props.row[props.column.key]).trim() !== "";
|
|
1743
|
-
const isFixedFieldCurrent = fixedFields?.some((f) => f.fieldName === props.column.key);
|
|
1744
|
-
if (isFixedFieldCurrent) {
|
|
1745
|
-
cellBackgroundColor = theme.palette.action.selected;
|
|
1746
|
-
} else if (isNewRowLocalCheck && isMandatory && !hasValue || localCellChanges.has(rowId) && localCellChanges.get(rowId)?.has(props.column.key)) {
|
|
1747
|
-
cellBackgroundColor = theme.palette.info.light;
|
|
1748
|
-
}
|
|
1749
|
-
}
|
|
1750
|
-
return /* @__PURE__ */ jsx9(
|
|
1751
|
-
Box4,
|
|
1752
|
-
{
|
|
1753
|
-
sx: {
|
|
1754
|
-
position: "absolute",
|
|
1755
|
-
top: 0,
|
|
1756
|
-
left: 0,
|
|
1757
|
-
width: "100%",
|
|
1758
|
-
height: "100%",
|
|
1759
|
-
backgroundColor: cellBackgroundColor,
|
|
1760
|
-
transition: "background-color 0.3s ease-in-out",
|
|
1761
|
-
display: "flex",
|
|
1762
|
-
alignItems: "center",
|
|
1763
|
-
paddingLeft: "8px",
|
|
1764
|
-
boxSizing: "border-box"
|
|
1765
|
-
},
|
|
1766
|
-
children: /* @__PURE__ */ jsx9(
|
|
1767
|
-
PkCellRenderer_default,
|
|
1768
|
-
{
|
|
1769
|
-
...props,
|
|
1770
|
-
column: { ...props.column, isPK: !!field.isPk }
|
|
1771
|
-
}
|
|
1772
|
-
)
|
|
1773
|
-
}
|
|
1774
|
-
);
|
|
1775
|
-
}
|
|
1850
|
+
renderHeaderCell: (props) => defaultColumnHeaderCellRenderer(props, fieldDef),
|
|
1851
|
+
renderSummaryCell: (props) => defaultColumnSummaryCellRenderer(props, fixedFields, isFilterRowVisible, filters, setFilters)
|
|
1776
1852
|
};
|
|
1777
1853
|
});
|
|
1778
|
-
const
|
|
1854
|
+
const actionsColumn = {
|
|
1779
1855
|
key: "filterToggle",
|
|
1780
|
-
|
|
1856
|
+
customType: "action",
|
|
1857
|
+
tableDefinition,
|
|
1858
|
+
handleDeleteRow,
|
|
1859
|
+
name: "filterCol",
|
|
1781
1860
|
width: 50,
|
|
1782
1861
|
resizable: false,
|
|
1783
1862
|
sortable: false,
|
|
1784
|
-
frozen: true,
|
|
1785
|
-
renderHeaderCell: () =>
|
|
1786
|
-
|
|
1787
|
-
{
|
|
1788
|
-
color: "inherit",
|
|
1789
|
-
onClick: toggleFilterVisibility,
|
|
1790
|
-
size: "small",
|
|
1791
|
-
title: isFilterRowVisible ? "Ocultar filtros" : "Mostrar filtros",
|
|
1792
|
-
sx: { p: 0.5 },
|
|
1793
|
-
children: isFilterRowVisible ? /* @__PURE__ */ jsx9(SearchOffIcon, { sx: { fontSize: 20 } }) : /* @__PURE__ */ jsx9(SearchIcon, { sx: { fontSize: 20 } })
|
|
1794
|
-
}
|
|
1795
|
-
),
|
|
1796
|
-
renderSummaryCell: () => null
|
|
1863
|
+
//frozen: true,
|
|
1864
|
+
renderHeaderCell: (props) => actionsColumnHeaderCellRenderer(props, isFilterRowVisible, toggleFilterVisibility),
|
|
1865
|
+
renderSummaryCell: (props) => actionsColumnSummaryCellRenderer(props)
|
|
1797
1866
|
};
|
|
1798
|
-
const
|
|
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
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
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;
|
|
1826
1902
|
}
|
|
1827
|
-
) });
|
|
1828
|
-
}
|
|
1829
|
-
};
|
|
1830
|
-
const allColumns = [filterToggleColumn, deleteActionColumn, ...defaultColumns];
|
|
1831
|
-
return allColumns.map((col) => {
|
|
1832
|
-
if (col.editable) {
|
|
1833
|
-
const fieldDefinition = tableDefinition.fields.find((f) => f.name === col.key);
|
|
1834
|
-
const isFixedField = fixedFields?.some((f) => f.fieldName === col.key);
|
|
1835
|
-
const isFieldEditableByUI = fieldDefinition?.editable !== false && !isFixedField;
|
|
1836
|
-
if (!isFieldEditableByUI) {
|
|
1837
|
-
return { ...col, renderEditCell: void 0 };
|
|
1838
1903
|
}
|
|
1839
|
-
return
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
{
|
|
1845
|
-
...props,
|
|
1846
|
-
tableDefinition,
|
|
1847
|
-
setCellFeedback,
|
|
1848
|
-
onEnterPress: (rowIndex, columnKey) => handleEnterKeyPressInEditor(rowIndex, columnKey, allColumns),
|
|
1849
|
-
setTableData,
|
|
1850
|
-
setLocalCellChanges,
|
|
1851
|
-
localCellChanges,
|
|
1852
|
-
primaryKey
|
|
1853
|
-
}
|
|
1854
|
-
);
|
|
1855
|
-
}
|
|
1856
|
-
};
|
|
1857
|
-
}
|
|
1858
|
-
return col;
|
|
1859
|
-
});
|
|
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
|
+
}));
|
|
1860
1909
|
}, [
|
|
1861
1910
|
tableDefinition,
|
|
1862
1911
|
isFilterRowVisible,
|
|
@@ -1868,15 +1917,13 @@ var GenericDataGrid = ({
|
|
|
1868
1917
|
theme.palette.error.light,
|
|
1869
1918
|
theme.palette.info.light,
|
|
1870
1919
|
theme.palette.action.selected,
|
|
1871
|
-
// Añade el color de campos fijos
|
|
1872
1920
|
handleEnterKeyPressInEditor,
|
|
1873
1921
|
setTableData,
|
|
1874
1922
|
localCellChanges,
|
|
1875
1923
|
handleDeleteRow,
|
|
1876
|
-
fixedFields
|
|
1877
|
-
|
|
1924
|
+
fixedFields,
|
|
1925
|
+
tableData
|
|
1878
1926
|
]);
|
|
1879
|
-
const showNoRowsMessage = filteredRows.length === 0 && !loading && !error;
|
|
1880
1927
|
const handleRowsChange = useCallback4((updatedRows) => {
|
|
1881
1928
|
setTableData(updatedRows);
|
|
1882
1929
|
}, []);
|
|
@@ -1889,41 +1936,54 @@ var GenericDataGrid = ({
|
|
|
1889
1936
|
console.log("Is editable:", isEditable);
|
|
1890
1937
|
}, [tableDefinition, fixedFields]);
|
|
1891
1938
|
if (loading) {
|
|
1892
|
-
return /* @__PURE__ */ jsxs4(
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
/* @__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..." })
|
|
1895
1942
|
] });
|
|
1896
1943
|
}
|
|
1897
1944
|
if (error) {
|
|
1898
|
-
return /* @__PURE__ */
|
|
1945
|
+
return /* @__PURE__ */ jsx12(Box5, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsx12(Alert, { severity: "error", children: error.message }) });
|
|
1899
1946
|
}
|
|
1900
1947
|
if (!tableDefinition) {
|
|
1901
|
-
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." }) });
|
|
1902
1949
|
}
|
|
1903
|
-
return /* @__PURE__ */ jsxs4(
|
|
1904
|
-
/* @__PURE__ */
|
|
1905
|
-
|
|
1906
|
-
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,
|
|
1907
1953
|
{
|
|
1908
1954
|
variant: "contained",
|
|
1909
1955
|
onClick: handleAddRow,
|
|
1910
|
-
startIcon: /* @__PURE__ */
|
|
1956
|
+
startIcon: /* @__PURE__ */ jsx12(AddIcon, {}),
|
|
1911
1957
|
children: "Nuevo Registro"
|
|
1912
1958
|
}
|
|
1913
1959
|
) }),
|
|
1914
|
-
/* @__PURE__ */
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
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,
|
|
1923
1984
|
{
|
|
1924
1985
|
sx: {
|
|
1925
|
-
flexGrow:
|
|
1926
|
-
height: showNoRowsMessage ? "150px" : "100%",
|
|
1986
|
+
flexGrow: 1,
|
|
1927
1987
|
boxSizing: "border-box",
|
|
1928
1988
|
position: "relative",
|
|
1929
1989
|
overflowX: "auto",
|
|
@@ -1931,54 +1991,32 @@ var GenericDataGrid = ({
|
|
|
1931
1991
|
px: 2,
|
|
1932
1992
|
pb: 2
|
|
1933
1993
|
},
|
|
1934
|
-
children:
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
showNoRowsMessage && /* @__PURE__ */ jsx9(
|
|
1958
|
-
Box4,
|
|
1959
|
-
{
|
|
1960
|
-
sx: {
|
|
1961
|
-
position: "absolute",
|
|
1962
|
-
top: isFilterRowVisible ? "70px" : "36px",
|
|
1963
|
-
left: (theme2) => theme2.spacing(2),
|
|
1964
|
-
right: (theme2) => theme2.spacing(2),
|
|
1965
|
-
bottom: (theme2) => theme2.spacing(2),
|
|
1966
|
-
display: "flex",
|
|
1967
|
-
justifyContent: "center",
|
|
1968
|
-
alignItems: "center",
|
|
1969
|
-
backgroundColor: "rgba(255, 255, 255, 0.9)",
|
|
1970
|
-
color: (theme2) => theme2.palette.text.secondary,
|
|
1971
|
-
border: (theme2) => `1px solid ${theme2.palette.divider}`,
|
|
1972
|
-
borderRadius: "4px",
|
|
1973
|
-
zIndex: 1
|
|
1974
|
-
},
|
|
1975
|
-
children: /* @__PURE__ */ jsx9(Typography5, { variant: "h6", children: "No hay filas para mostrar." })
|
|
1976
|
-
}
|
|
1977
|
-
)
|
|
1978
|
-
]
|
|
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
|
+
)
|
|
1979
2017
|
}
|
|
1980
2018
|
),
|
|
1981
|
-
/* @__PURE__ */
|
|
2019
|
+
/* @__PURE__ */ jsx12(
|
|
1982
2020
|
ConfirmDialog,
|
|
1983
2021
|
{
|
|
1984
2022
|
open: openConfirmDialog,
|
|
@@ -1999,15 +2037,15 @@ import { BrowserRouter, Routes, Route, useLocation as useLocation4, Navigate as
|
|
|
1999
2037
|
import { useEffect as useEffect3 } from "react";
|
|
2000
2038
|
import { Outlet } from "react-router-dom";
|
|
2001
2039
|
import {
|
|
2002
|
-
Box as
|
|
2040
|
+
Box as Box8,
|
|
2003
2041
|
AppBar,
|
|
2004
2042
|
Toolbar,
|
|
2005
2043
|
Typography as Typography8,
|
|
2006
|
-
Button as
|
|
2044
|
+
Button as Button4,
|
|
2007
2045
|
Drawer,
|
|
2008
2046
|
CssBaseline,
|
|
2009
|
-
IconButton as
|
|
2010
|
-
useTheme as
|
|
2047
|
+
IconButton as IconButton3,
|
|
2048
|
+
useTheme as useTheme3,
|
|
2011
2049
|
useMediaQuery
|
|
2012
2050
|
} from "@mui/material";
|
|
2013
2051
|
|
|
@@ -2015,7 +2053,7 @@ import {
|
|
|
2015
2053
|
import { createContext as createContext2, useContext as useContext2, useState as useState5, useEffect as useEffect2, useCallback as useCallback5, useMemo as useMemo3 } from "react";
|
|
2016
2054
|
import { useNavigate } from "react-router-dom";
|
|
2017
2055
|
import { useSelector as useSelector2, useDispatch as useDispatch2 } from "react-redux";
|
|
2018
|
-
import { jsx as
|
|
2056
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2019
2057
|
var AuthContext = createContext2(void 0);
|
|
2020
2058
|
var useApp = () => {
|
|
2021
2059
|
const context = useContext2(AuthContext);
|
|
@@ -2083,7 +2121,7 @@ var AppProvider = ({ children }) => {
|
|
|
2083
2121
|
showSessionExpiredMessage,
|
|
2084
2122
|
setShowSessionExpiredMessage
|
|
2085
2123
|
]);
|
|
2086
|
-
return /* @__PURE__ */
|
|
2124
|
+
return /* @__PURE__ */ jsx13(AuthContext.Provider, { value: authContextValue, children });
|
|
2087
2125
|
};
|
|
2088
2126
|
|
|
2089
2127
|
// src/components/MainLayout.tsx
|
|
@@ -2092,7 +2130,7 @@ import MenuIcon from "@mui/icons-material/Menu";
|
|
|
2092
2130
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
2093
2131
|
|
|
2094
2132
|
// src/components/SideMenu.tsx
|
|
2095
|
-
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";
|
|
2096
2134
|
import ExpandLess from "@mui/icons-material/ExpandLess";
|
|
2097
2135
|
import ExpandMore from "@mui/icons-material/ExpandMore";
|
|
2098
2136
|
import TableChartIcon from "@mui/icons-material/TableChart";
|
|
@@ -2107,30 +2145,30 @@ import { useNavigate as useNavigate2, useLocation } from "react-router-dom";
|
|
|
2107
2145
|
import { blue, orange, teal, red, grey } from "@mui/material/colors";
|
|
2108
2146
|
|
|
2109
2147
|
// src/pages/WScreens.tsx
|
|
2110
|
-
import { Box as
|
|
2148
|
+
import { Box as Box6, Typography as Typography6, Paper } from "@mui/material";
|
|
2111
2149
|
import ConstructionIcon from "@mui/icons-material/Construction";
|
|
2112
2150
|
import WarningAmberIcon2 from "@mui/icons-material/WarningAmber";
|
|
2113
|
-
import { jsx as
|
|
2151
|
+
import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2114
2152
|
var MyCustomDashboard = ({ screenName }) => {
|
|
2115
|
-
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: [
|
|
2116
2154
|
/* @__PURE__ */ jsxs5(Typography6, { variant: "h5", component: "h1", gutterBottom: true, children: [
|
|
2117
2155
|
"\xA1Bienvenido a tu WScreen: ",
|
|
2118
2156
|
screenName,
|
|
2119
2157
|
"!"
|
|
2120
2158
|
] }),
|
|
2121
|
-
/* @__PURE__ */
|
|
2122
|
-
/* @__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" } }) })
|
|
2123
2161
|
] }) });
|
|
2124
2162
|
};
|
|
2125
2163
|
var FallbackWScreen = ({ screenName }) => {
|
|
2126
|
-
return /* @__PURE__ */
|
|
2127
|
-
/* @__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" }),
|
|
2128
2166
|
/* @__PURE__ */ jsxs5(Typography6, { variant: "body1", color: "warning.dark", children: [
|
|
2129
2167
|
'No se encontr\xF3 un componente implementado para la **WScreen**: **`"$',
|
|
2130
2168
|
screenName,
|
|
2131
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.'
|
|
2132
2170
|
] }),
|
|
2133
|
-
/* @__PURE__ */
|
|
2171
|
+
/* @__PURE__ */ jsx14(Box6, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx14(WarningAmberIcon2, { sx: { fontSize: 80, color: "warning.dark" } }) })
|
|
2134
2172
|
] }) });
|
|
2135
2173
|
};
|
|
2136
2174
|
var wScreens = {
|
|
@@ -2141,7 +2179,7 @@ var wScreens = {
|
|
|
2141
2179
|
var WScreens_default = FallbackWScreen;
|
|
2142
2180
|
|
|
2143
2181
|
// src/components/SideMenu.tsx
|
|
2144
|
-
import { Fragment
|
|
2182
|
+
import { Fragment, jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2145
2183
|
var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
2146
2184
|
const navigate = useNavigate2();
|
|
2147
2185
|
const location = useLocation();
|
|
@@ -2182,17 +2220,17 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2182
2220
|
const getIcon = (item2) => {
|
|
2183
2221
|
switch (item2.menuType) {
|
|
2184
2222
|
case "table":
|
|
2185
|
-
return /* @__PURE__ */
|
|
2223
|
+
return /* @__PURE__ */ jsx15(TableChartIcon, { sx: { color: blue[700] } });
|
|
2186
2224
|
case "proc":
|
|
2187
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ jsx15(DnsIcon, { sx: { color: teal[700] } });
|
|
2188
2226
|
case "menu":
|
|
2189
|
-
return /* @__PURE__ */
|
|
2227
|
+
return /* @__PURE__ */ jsx15(FolderIcon, { sx: { color: orange[800] } });
|
|
2190
2228
|
default:
|
|
2191
2229
|
const WScreenComponent = wScreens[item2.menuType];
|
|
2192
2230
|
if (WScreenComponent !== void 0) {
|
|
2193
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ jsx15(DesktopWindowsIcon, { sx: { color: grey[700] } });
|
|
2194
2232
|
}
|
|
2195
|
-
return /* @__PURE__ */
|
|
2233
|
+
return /* @__PURE__ */ jsx15(WarningAmberIcon3, { sx: { color: red[500] } });
|
|
2196
2234
|
}
|
|
2197
2235
|
};
|
|
2198
2236
|
const currentPath = location.pathname;
|
|
@@ -2204,7 +2242,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2204
2242
|
} else {
|
|
2205
2243
|
isSelected = currentPath.startsWith(`/wScreens/${item.menuType}`) || currentPath.startsWith(`/wScreens-fallback/${item.menuType}`);
|
|
2206
2244
|
}
|
|
2207
|
-
return /* @__PURE__ */ jsxs6(
|
|
2245
|
+
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
2208
2246
|
/* @__PURE__ */ jsxs6(
|
|
2209
2247
|
ListItemButton,
|
|
2210
2248
|
{
|
|
@@ -2212,13 +2250,13 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2212
2250
|
sx: { pl: level * 2 },
|
|
2213
2251
|
selected: isSelected,
|
|
2214
2252
|
children: [
|
|
2215
|
-
/* @__PURE__ */
|
|
2216
|
-
/* @__PURE__ */
|
|
2217
|
-
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
|
|
2218
2256
|
]
|
|
2219
2257
|
}
|
|
2220
2258
|
),
|
|
2221
|
-
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(
|
|
2222
2260
|
MenuListItem,
|
|
2223
2261
|
{
|
|
2224
2262
|
item: subItem,
|
|
@@ -2248,22 +2286,22 @@ var SideMenu = ({ onMenuItemClick }) => {
|
|
|
2248
2286
|
dispatch(setAllSubMenusOpen(!isMostlyOpen));
|
|
2249
2287
|
};
|
|
2250
2288
|
if (!clientContext || !clientContext.menu) {
|
|
2251
|
-
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..." }) });
|
|
2252
2290
|
}
|
|
2253
2291
|
const isHomeSelected = location.pathname === "/home";
|
|
2254
|
-
return /* @__PURE__ */ jsxs6(
|
|
2255
|
-
clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */
|
|
2256
|
-
/* @__PURE__ */
|
|
2257
|
-
/* @__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" })
|
|
2258
2296
|
] }) }),
|
|
2259
|
-
/* @__PURE__ */
|
|
2297
|
+
/* @__PURE__ */ jsx15(Divider, {}),
|
|
2260
2298
|
/* @__PURE__ */ jsxs6(List, { children: [
|
|
2261
|
-
/* @__PURE__ */
|
|
2262
|
-
/* @__PURE__ */
|
|
2263
|
-
/* @__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" })
|
|
2264
2302
|
] }) }),
|
|
2265
|
-
/* @__PURE__ */
|
|
2266
|
-
clientContext.menu.map((menuItem) => /* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ jsx15(Divider, {}),
|
|
2304
|
+
clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx15(
|
|
2267
2305
|
MenuListItem,
|
|
2268
2306
|
{
|
|
2269
2307
|
item: menuItem,
|
|
@@ -2306,14 +2344,14 @@ var useLogout = () => {
|
|
|
2306
2344
|
var useLogout_default = useLogout;
|
|
2307
2345
|
|
|
2308
2346
|
// src/components/MainLayout.tsx
|
|
2309
|
-
import { jsx as
|
|
2347
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2310
2348
|
var drawerWidth = 240;
|
|
2311
2349
|
var MainLayout = () => {
|
|
2312
2350
|
const { clientContext } = useApp();
|
|
2313
2351
|
const logout = useLogout_default();
|
|
2314
2352
|
const isDrawerOpen = useIsDrawerOpen();
|
|
2315
2353
|
const dispatch = useAppDispatch();
|
|
2316
|
-
const theme =
|
|
2354
|
+
const theme = useTheme3();
|
|
2317
2355
|
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
2318
2356
|
useEffect3(() => {
|
|
2319
2357
|
if (isMobile && isDrawerOpen) {
|
|
@@ -2329,12 +2367,12 @@ var MainLayout = () => {
|
|
|
2329
2367
|
}
|
|
2330
2368
|
};
|
|
2331
2369
|
if (!clientContext) {
|
|
2332
|
-
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..." }) });
|
|
2333
2371
|
}
|
|
2334
2372
|
const appBarOffset = theme.mixins.toolbar;
|
|
2335
|
-
return /* @__PURE__ */ jsxs7(
|
|
2336
|
-
/* @__PURE__ */
|
|
2337
|
-
/* @__PURE__ */
|
|
2373
|
+
return /* @__PURE__ */ jsxs7(Box8, { sx: { display: "flex", height: "100vh" }, children: [
|
|
2374
|
+
/* @__PURE__ */ jsx16(CssBaseline, {}),
|
|
2375
|
+
/* @__PURE__ */ jsx16(
|
|
2338
2376
|
AppBar,
|
|
2339
2377
|
{
|
|
2340
2378
|
position: "fixed",
|
|
@@ -2354,8 +2392,8 @@ var MainLayout = () => {
|
|
|
2354
2392
|
}
|
|
2355
2393
|
},
|
|
2356
2394
|
children: /* @__PURE__ */ jsxs7(Toolbar, { children: [
|
|
2357
|
-
/* @__PURE__ */
|
|
2358
|
-
|
|
2395
|
+
/* @__PURE__ */ jsx16(
|
|
2396
|
+
IconButton3,
|
|
2359
2397
|
{
|
|
2360
2398
|
color: "inherit",
|
|
2361
2399
|
"aria-label": "open drawer",
|
|
@@ -2364,17 +2402,17 @@ var MainLayout = () => {
|
|
|
2364
2402
|
sx: {
|
|
2365
2403
|
marginRight: 2.2
|
|
2366
2404
|
},
|
|
2367
|
-
children: isDrawerOpen ? /* @__PURE__ */
|
|
2405
|
+
children: isDrawerOpen ? /* @__PURE__ */ jsx16(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx16(MenuIcon, {})
|
|
2368
2406
|
}
|
|
2369
2407
|
),
|
|
2370
|
-
/* @__PURE__ */
|
|
2371
|
-
/* @__PURE__ */
|
|
2372
|
-
/* @__PURE__ */
|
|
2373
|
-
|
|
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,
|
|
2374
2412
|
{
|
|
2375
2413
|
color: "inherit",
|
|
2376
2414
|
onClick: logout,
|
|
2377
|
-
startIcon: /* @__PURE__ */
|
|
2415
|
+
startIcon: /* @__PURE__ */ jsx16(LogoutIcon, {}),
|
|
2378
2416
|
children: "Salir"
|
|
2379
2417
|
}
|
|
2380
2418
|
)
|
|
@@ -2398,7 +2436,7 @@ var MainLayout = () => {
|
|
|
2398
2436
|
}
|
|
2399
2437
|
},
|
|
2400
2438
|
children: [
|
|
2401
|
-
/* @__PURE__ */
|
|
2439
|
+
/* @__PURE__ */ jsx16(
|
|
2402
2440
|
Toolbar,
|
|
2403
2441
|
{
|
|
2404
2442
|
sx: {
|
|
@@ -2412,12 +2450,12 @@ var MainLayout = () => {
|
|
|
2412
2450
|
children: isDrawerOpen ? clientContext.config.title : ""
|
|
2413
2451
|
}
|
|
2414
2452
|
),
|
|
2415
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ jsx16(SideMenu_default, { onMenuItemClick: handleDrawerCloseMobile })
|
|
2416
2454
|
]
|
|
2417
2455
|
}
|
|
2418
2456
|
),
|
|
2419
|
-
/* @__PURE__ */
|
|
2420
|
-
|
|
2457
|
+
/* @__PURE__ */ jsx16(
|
|
2458
|
+
Box8,
|
|
2421
2459
|
{
|
|
2422
2460
|
component: "main",
|
|
2423
2461
|
sx: {
|
|
@@ -2444,7 +2482,7 @@ var MainLayout = () => {
|
|
|
2444
2482
|
flexDirection: "column",
|
|
2445
2483
|
width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
|
|
2446
2484
|
},
|
|
2447
|
-
children: /* @__PURE__ */
|
|
2485
|
+
children: /* @__PURE__ */ jsx16(Outlet, {})
|
|
2448
2486
|
}
|
|
2449
2487
|
)
|
|
2450
2488
|
] });
|
|
@@ -2452,9 +2490,9 @@ var MainLayout = () => {
|
|
|
2452
2490
|
var MainLayout_default = MainLayout;
|
|
2453
2491
|
|
|
2454
2492
|
// src/components/SessionExpiredMessage.tsx
|
|
2455
|
-
import { Box as
|
|
2493
|
+
import { Box as Box9, Typography as Typography9, Button as Button5, Modal } from "@mui/material";
|
|
2456
2494
|
import { useNavigate as useNavigate4 } from "react-router-dom";
|
|
2457
|
-
import { jsx as
|
|
2495
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2458
2496
|
var style = {
|
|
2459
2497
|
position: "absolute",
|
|
2460
2498
|
top: "50%",
|
|
@@ -2476,7 +2514,7 @@ var SessionExpiredMessage = () => {
|
|
|
2476
2514
|
setIsLoggedIn(false);
|
|
2477
2515
|
navigate("/login", { replace: true });
|
|
2478
2516
|
};
|
|
2479
|
-
return /* @__PURE__ */
|
|
2517
|
+
return /* @__PURE__ */ jsx17(
|
|
2480
2518
|
Modal,
|
|
2481
2519
|
{
|
|
2482
2520
|
open: showSessionExpiredMessage,
|
|
@@ -2496,10 +2534,10 @@ var SessionExpiredMessage = () => {
|
|
|
2496
2534
|
}
|
|
2497
2535
|
}
|
|
2498
2536
|
},
|
|
2499
|
-
children: /* @__PURE__ */ jsxs8(
|
|
2500
|
-
/* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__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" })
|
|
2503
2541
|
] })
|
|
2504
2542
|
}
|
|
2505
2543
|
);
|
|
@@ -2507,27 +2545,27 @@ var SessionExpiredMessage = () => {
|
|
|
2507
2545
|
var SessionExpiredMessage_default = SessionExpiredMessage;
|
|
2508
2546
|
|
|
2509
2547
|
// src/pages/HomePage.tsx
|
|
2510
|
-
import { Box as
|
|
2511
|
-
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";
|
|
2512
2550
|
var HomePage = () => {
|
|
2513
2551
|
const { clientContext } = useApp();
|
|
2514
|
-
return /* @__PURE__ */ jsxs9(
|
|
2515
|
-
/* @__PURE__ */
|
|
2516
|
-
/* @__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." })
|
|
2517
2555
|
] });
|
|
2518
2556
|
};
|
|
2519
2557
|
var HomePage_default = HomePage;
|
|
2520
2558
|
|
|
2521
2559
|
// src/pages/LogoutPage.tsx
|
|
2522
2560
|
import { useEffect as useEffect4 } from "react";
|
|
2523
|
-
import { Box as
|
|
2524
|
-
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";
|
|
2525
2563
|
var LogoutPage = () => {
|
|
2526
2564
|
const logout = useLogout_default();
|
|
2527
2565
|
useEffect4(() => {
|
|
2528
2566
|
logout();
|
|
2529
2567
|
}, [logout]);
|
|
2530
|
-
return /* @__PURE__ */ jsxs10(
|
|
2568
|
+
return /* @__PURE__ */ jsxs10(Box11, { sx: {
|
|
2531
2569
|
display: "flex",
|
|
2532
2570
|
flexDirection: "column",
|
|
2533
2571
|
justifyContent: "center",
|
|
@@ -2535,21 +2573,21 @@ var LogoutPage = () => {
|
|
|
2535
2573
|
height: "100vh",
|
|
2536
2574
|
textAlign: "center"
|
|
2537
2575
|
}, children: [
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ jsx19(CircularProgress2, { size: 60 }),
|
|
2577
|
+
/* @__PURE__ */ jsx19(Typography11, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
|
|
2540
2578
|
] });
|
|
2541
2579
|
};
|
|
2542
2580
|
var LogoutPage_default = LogoutPage;
|
|
2543
2581
|
|
|
2544
2582
|
// src/pages/LoginPage.tsx
|
|
2545
2583
|
import { useState as useState6 } from "react";
|
|
2546
|
-
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";
|
|
2547
2585
|
import { useForm, Controller } from "react-hook-form";
|
|
2548
2586
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
2549
2587
|
import * as z from "zod";
|
|
2550
2588
|
import { useNavigate as useNavigate5 } from "react-router-dom";
|
|
2551
2589
|
import { useDispatch as useDispatch4 } from "react-redux";
|
|
2552
|
-
import { Fragment as
|
|
2590
|
+
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2553
2591
|
var loginSchema = z.object({
|
|
2554
2592
|
username: z.string().min(1, "El usuario es requerido"),
|
|
2555
2593
|
// Añadir validación básica
|
|
@@ -2605,8 +2643,8 @@ var LoginPage = () => {
|
|
|
2605
2643
|
setIsSubmitting(false);
|
|
2606
2644
|
}
|
|
2607
2645
|
};
|
|
2608
|
-
return /* @__PURE__ */
|
|
2609
|
-
|
|
2646
|
+
return /* @__PURE__ */ jsx20(
|
|
2647
|
+
Box12,
|
|
2610
2648
|
{
|
|
2611
2649
|
display: "flex",
|
|
2612
2650
|
alignItems: "center",
|
|
@@ -2614,7 +2652,7 @@ var LoginPage = () => {
|
|
|
2614
2652
|
minHeight: "100vh",
|
|
2615
2653
|
bgcolor: "#f5f5f5",
|
|
2616
2654
|
children: /* @__PURE__ */ jsxs11(
|
|
2617
|
-
|
|
2655
|
+
Box12,
|
|
2618
2656
|
{
|
|
2619
2657
|
width: "100%",
|
|
2620
2658
|
maxWidth: "400px",
|
|
@@ -2623,16 +2661,16 @@ var LoginPage = () => {
|
|
|
2623
2661
|
borderRadius: 8,
|
|
2624
2662
|
boxShadow: 3,
|
|
2625
2663
|
children: [
|
|
2626
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ jsx20(Typography12, { variant: "h5", align: "center", gutterBottom: true, children: "Iniciar Sesi\xF3n" }),
|
|
2627
2665
|
/* @__PURE__ */ jsxs11("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
2628
2666
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2629
|
-
/* @__PURE__ */
|
|
2630
|
-
/* @__PURE__ */
|
|
2667
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "username", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
|
|
2668
|
+
/* @__PURE__ */ jsx20(
|
|
2631
2669
|
Controller,
|
|
2632
2670
|
{
|
|
2633
2671
|
name: "username",
|
|
2634
2672
|
control,
|
|
2635
|
-
render: ({ field }) => /* @__PURE__ */
|
|
2673
|
+
render: ({ field }) => /* @__PURE__ */ jsx20(
|
|
2636
2674
|
TextField,
|
|
2637
2675
|
{
|
|
2638
2676
|
...field,
|
|
@@ -2649,13 +2687,13 @@ var LoginPage = () => {
|
|
|
2649
2687
|
)
|
|
2650
2688
|
] }),
|
|
2651
2689
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2652
|
-
/* @__PURE__ */
|
|
2653
|
-
/* @__PURE__ */
|
|
2690
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "password", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
|
|
2691
|
+
/* @__PURE__ */ jsx20(
|
|
2654
2692
|
Controller,
|
|
2655
2693
|
{
|
|
2656
2694
|
name: "password",
|
|
2657
2695
|
control,
|
|
2658
|
-
render: ({ field }) => /* @__PURE__ */
|
|
2696
|
+
render: ({ field }) => /* @__PURE__ */ jsx20(
|
|
2659
2697
|
TextField,
|
|
2660
2698
|
{
|
|
2661
2699
|
...field,
|
|
@@ -2671,14 +2709,14 @@ var LoginPage = () => {
|
|
|
2671
2709
|
}
|
|
2672
2710
|
)
|
|
2673
2711
|
] }),
|
|
2674
|
-
/* @__PURE__ */
|
|
2675
|
-
/* @__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 } }),
|
|
2676
2714
|
"Iniciando sesi\xF3n..."
|
|
2677
2715
|
] }) : "Iniciar Sesi\xF3n" })
|
|
2678
2716
|
] }),
|
|
2679
2717
|
loginError && /* @__PURE__ */ jsxs11(Alert2, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
|
|
2680
2718
|
" ",
|
|
2681
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ jsx20(AlertTitle, { children: "Error" }),
|
|
2682
2720
|
loginError
|
|
2683
2721
|
] })
|
|
2684
2722
|
]
|
|
@@ -2694,7 +2732,7 @@ import React7, { useState as useState7, useCallback as useCallback7, useMemo as
|
|
|
2694
2732
|
import { useParams } from "react-router-dom";
|
|
2695
2733
|
import {
|
|
2696
2734
|
TextField as TextField2,
|
|
2697
|
-
Button as
|
|
2735
|
+
Button as Button7,
|
|
2698
2736
|
FormControl,
|
|
2699
2737
|
InputLabel,
|
|
2700
2738
|
Select,
|
|
@@ -2703,7 +2741,7 @@ import {
|
|
|
2703
2741
|
FormControlLabel,
|
|
2704
2742
|
FormHelperText,
|
|
2705
2743
|
Typography as Typography14,
|
|
2706
|
-
Box as
|
|
2744
|
+
Box as Box14,
|
|
2707
2745
|
CircularProgress as CircularProgress4,
|
|
2708
2746
|
Alert as Alert3,
|
|
2709
2747
|
Divider as Divider2,
|
|
@@ -2711,14 +2749,14 @@ import {
|
|
|
2711
2749
|
} from "@mui/material";
|
|
2712
2750
|
|
|
2713
2751
|
// src/pages/procedure-results/SuccessDisplay.tsx
|
|
2714
|
-
import { Box as
|
|
2715
|
-
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";
|
|
2716
2754
|
var SuccessDisplay = ({ data }) => {
|
|
2717
2755
|
return /* @__PURE__ */ jsxs12(Paper2, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
/* @__PURE__ */
|
|
2720
|
-
/* @__PURE__ */
|
|
2721
|
-
/* @__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." })
|
|
2722
2760
|
] });
|
|
2723
2761
|
};
|
|
2724
2762
|
var SuccessDisplay_default = SuccessDisplay;
|
|
@@ -2732,7 +2770,7 @@ var extendResultsOk = (newComponents) => {
|
|
|
2732
2770
|
};
|
|
2733
2771
|
|
|
2734
2772
|
// src/components/ProcedureForm.tsx
|
|
2735
|
-
import { jsx as
|
|
2773
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2736
2774
|
var ProcedureForm = () => {
|
|
2737
2775
|
const { procedureName } = useParams();
|
|
2738
2776
|
const { clientContext } = useApp();
|
|
@@ -2948,7 +2986,7 @@ var ProcedureForm = () => {
|
|
|
2948
2986
|
};
|
|
2949
2987
|
if (param.options && param.options.length > 0) {
|
|
2950
2988
|
return /* @__PURE__ */ jsxs13(FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
|
|
2951
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ jsx22(InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
|
|
2952
2990
|
/* @__PURE__ */ jsxs13(
|
|
2953
2991
|
Select,
|
|
2954
2992
|
{
|
|
@@ -2960,14 +2998,14 @@ var ProcedureForm = () => {
|
|
|
2960
2998
|
label: param.label || param.name,
|
|
2961
2999
|
disabled: apiLoading,
|
|
2962
3000
|
sx: { fontSize: "0.8rem" },
|
|
2963
|
-
renderValue: (selected) => /* @__PURE__ */
|
|
3001
|
+
renderValue: (selected) => /* @__PURE__ */ jsx22(Typography14, { sx: { fontSize: "0.8rem" }, children: selected }),
|
|
2964
3002
|
children: [
|
|
2965
|
-
(!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */
|
|
2966
|
-
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))
|
|
2967
3005
|
]
|
|
2968
3006
|
}
|
|
2969
3007
|
),
|
|
2970
|
-
(param.description || errorMessage) && /* @__PURE__ */
|
|
3008
|
+
(param.description || errorMessage) && /* @__PURE__ */ jsx22(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
|
|
2971
3009
|
] });
|
|
2972
3010
|
}
|
|
2973
3011
|
switch (param.typeName) {
|
|
@@ -2976,18 +3014,18 @@ var ProcedureForm = () => {
|
|
|
2976
3014
|
case "tsrange":
|
|
2977
3015
|
case "time_range":
|
|
2978
3016
|
case "daterange":
|
|
2979
|
-
return /* @__PURE__ */
|
|
3017
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
|
|
2980
3018
|
case "decimal":
|
|
2981
3019
|
case "double":
|
|
2982
|
-
return /* @__PURE__ */
|
|
3020
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
|
|
2983
3021
|
case "integer":
|
|
2984
3022
|
case "bigint":
|
|
2985
|
-
return /* @__PURE__ */
|
|
3023
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
|
|
2986
3024
|
case "boolean":
|
|
2987
|
-
return /* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ jsx22(
|
|
2988
3026
|
FormControlLabel,
|
|
2989
3027
|
{
|
|
2990
|
-
control: /* @__PURE__ */
|
|
3028
|
+
control: /* @__PURE__ */ jsx22(
|
|
2991
3029
|
Checkbox,
|
|
2992
3030
|
{
|
|
2993
3031
|
checked: !!formValues[param.name],
|
|
@@ -2998,21 +3036,21 @@ var ProcedureForm = () => {
|
|
|
2998
3036
|
size: "small"
|
|
2999
3037
|
}
|
|
3000
3038
|
),
|
|
3001
|
-
label: /* @__PURE__ */
|
|
3039
|
+
label: /* @__PURE__ */ jsx22(Typography14, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
|
|
3002
3040
|
sx: { mt: 1, mb: 0 }
|
|
3003
3041
|
}
|
|
3004
3042
|
);
|
|
3005
3043
|
case "date":
|
|
3006
3044
|
case "timestamp":
|
|
3007
3045
|
case "time":
|
|
3008
|
-
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" } } });
|
|
3009
3047
|
case "jsonb":
|
|
3010
3048
|
case "jsona":
|
|
3011
|
-
return /* @__PURE__ */
|
|
3049
|
+
return /* @__PURE__ */ jsx22(TextField2, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
|
|
3012
3050
|
case "bytea":
|
|
3013
3051
|
return /* @__PURE__ */ jsxs13(FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
|
|
3014
|
-
/* @__PURE__ */
|
|
3015
|
-
/* @__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(
|
|
3016
3054
|
"input",
|
|
3017
3055
|
{
|
|
3018
3056
|
type: "file",
|
|
@@ -3026,17 +3064,17 @@ var ProcedureForm = () => {
|
|
|
3026
3064
|
style: { padding: "6px 0", fontSize: "0.8rem" }
|
|
3027
3065
|
}
|
|
3028
3066
|
),
|
|
3029
|
-
(param.description || errorMessage) && /* @__PURE__ */
|
|
3067
|
+
(param.description || errorMessage) && /* @__PURE__ */ jsx22(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
|
|
3030
3068
|
] });
|
|
3031
3069
|
default:
|
|
3032
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
|
|
3033
3071
|
}
|
|
3034
3072
|
}, [formValues, handleChange, apiLoading, validationErrors]);
|
|
3035
3073
|
const ResultDisplayContent = useMemo4(() => {
|
|
3036
3074
|
if (!procedureResultData || !procedure?.resultOk) return null;
|
|
3037
3075
|
const ComponentToRender = resultsOk[procedure.resultOk];
|
|
3038
3076
|
if (ComponentToRender) {
|
|
3039
|
-
return /* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ jsx22(ComponentToRender, { data: procedureResultData });
|
|
3040
3078
|
} else {
|
|
3041
3079
|
return /* @__PURE__ */ jsxs13(Paper3, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
|
|
3042
3080
|
/* @__PURE__ */ jsxs13(Typography14, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
|
|
@@ -3044,16 +3082,16 @@ var ProcedureForm = () => {
|
|
|
3044
3082
|
procedure.resultOk,
|
|
3045
3083
|
"' definido en el procedure no existe o no est\xE1 mapeado."
|
|
3046
3084
|
] }),
|
|
3047
|
-
/* @__PURE__ */
|
|
3085
|
+
/* @__PURE__ */ jsx22(Box14, { sx: {
|
|
3048
3086
|
bgcolor: "warning.dark",
|
|
3049
3087
|
p: 1,
|
|
3050
3088
|
borderRadius: 1
|
|
3051
|
-
}, children: /* @__PURE__ */
|
|
3089
|
+
}, children: /* @__PURE__ */ jsx22("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(procedureResultData, null, 2) }) })
|
|
3052
3090
|
] });
|
|
3053
3091
|
}
|
|
3054
3092
|
}, [procedureResultData, procedure]);
|
|
3055
3093
|
if (!procedure) {
|
|
3056
|
-
return /* @__PURE__ */ jsxs13(
|
|
3094
|
+
return /* @__PURE__ */ jsxs13(Box14, { sx: {
|
|
3057
3095
|
p: 2,
|
|
3058
3096
|
width: "100%",
|
|
3059
3097
|
boxSizing: "border-box",
|
|
@@ -3063,13 +3101,13 @@ var ProcedureForm = () => {
|
|
|
3063
3101
|
boxShadow: 3,
|
|
3064
3102
|
textAlign: "center"
|
|
3065
3103
|
}, children: [
|
|
3066
|
-
/* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ jsx22(CircularProgress4, { sx: { mb: 2 } }),
|
|
3105
|
+
/* @__PURE__ */ jsx22(Typography14, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
|
|
3068
3106
|
] });
|
|
3069
3107
|
}
|
|
3070
3108
|
return (
|
|
3071
3109
|
// Esta es la Box más externa que ahora controlará el scroll
|
|
3072
|
-
/* @__PURE__ */ jsxs13(
|
|
3110
|
+
/* @__PURE__ */ jsxs13(Box14, { sx: {
|
|
3073
3111
|
p: 2,
|
|
3074
3112
|
ml: 1,
|
|
3075
3113
|
mt: 2,
|
|
@@ -3086,17 +3124,17 @@ var ProcedureForm = () => {
|
|
|
3086
3124
|
overflowX: "hidden"
|
|
3087
3125
|
// Oculta el scroll horizontal si no es necesario para el contenedor principal
|
|
3088
3126
|
}, children: [
|
|
3089
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx22(Typography14, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
|
|
3090
3128
|
Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs13(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
|
|
3091
3129
|
"Por favor, corrige los errores en el formulario antes de enviar.",
|
|
3092
|
-
/* @__PURE__ */
|
|
3130
|
+
/* @__PURE__ */ jsx22("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ jsx22("li", { children: err }, idx)) })
|
|
3093
3131
|
] }),
|
|
3094
|
-
!Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */
|
|
3095
|
-
!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 }),
|
|
3096
3134
|
/* @__PURE__ */ jsxs13("form", { onSubmit: handleSubmit, children: [
|
|
3097
|
-
procedure.parameters.map((param) => /* @__PURE__ */
|
|
3098
|
-
/* @__PURE__ */
|
|
3099
|
-
|
|
3135
|
+
procedure.parameters.map((param) => /* @__PURE__ */ jsx22("div", { children: renderInputField(param) }, param.name)),
|
|
3136
|
+
/* @__PURE__ */ jsx22(
|
|
3137
|
+
Button7,
|
|
3100
3138
|
{
|
|
3101
3139
|
type: "submit",
|
|
3102
3140
|
variant: "contained",
|
|
@@ -3104,20 +3142,20 @@ var ProcedureForm = () => {
|
|
|
3104
3142
|
disabled: apiLoading || Object.values(validationErrors).some((err) => err !== null),
|
|
3105
3143
|
sx: { mt: 2 },
|
|
3106
3144
|
size: "medium",
|
|
3107
|
-
startIcon: apiLoading ? /* @__PURE__ */
|
|
3145
|
+
startIcon: apiLoading ? /* @__PURE__ */ jsx22(CircularProgress4, { size: 20, color: "inherit" }) : null,
|
|
3108
3146
|
children: apiLoading ? "Ejecutando..." : procedure.proceedLabel || "Ejecutar"
|
|
3109
3147
|
}
|
|
3110
3148
|
)
|
|
3111
3149
|
] }),
|
|
3112
|
-
ResultDisplayContent && /* @__PURE__ */ jsxs13(
|
|
3150
|
+
ResultDisplayContent && /* @__PURE__ */ jsxs13(Box14, { sx: { mt: 2 }, children: [
|
|
3113
3151
|
" ",
|
|
3114
3152
|
ResultDisplayContent
|
|
3115
3153
|
] }),
|
|
3116
|
-
executionLog.length > 0 && /* @__PURE__ */ jsxs13(
|
|
3117
|
-
/* @__PURE__ */
|
|
3118
|
-
/* @__PURE__ */
|
|
3119
|
-
/* @__PURE__ */
|
|
3120
|
-
|
|
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,
|
|
3121
3159
|
{
|
|
3122
3160
|
sx: {
|
|
3123
3161
|
bgcolor: "grey.100",
|
|
@@ -3130,7 +3168,7 @@ var ProcedureForm = () => {
|
|
|
3130
3168
|
fontSize: "0.75rem",
|
|
3131
3169
|
whiteSpace: "pre-wrap"
|
|
3132
3170
|
},
|
|
3133
|
-
children: executionLog.map((log, index) => /* @__PURE__ */
|
|
3171
|
+
children: executionLog.map((log, index) => /* @__PURE__ */ jsx22(
|
|
3134
3172
|
Typography14,
|
|
3135
3173
|
{
|
|
3136
3174
|
component: "pre",
|
|
@@ -3158,7 +3196,7 @@ import { PersistGate } from "redux-persist/integration/react";
|
|
|
3158
3196
|
// src/components/PrivateRoute.tsx
|
|
3159
3197
|
import { useEffect as useEffect5 } from "react";
|
|
3160
3198
|
import { Navigate, useLocation as useLocation2 } from "react-router-dom";
|
|
3161
|
-
import { Fragment as
|
|
3199
|
+
import { Fragment as Fragment3, jsx as jsx23 } from "react/jsx-runtime";
|
|
3162
3200
|
var PrivateRoute = ({ children }) => {
|
|
3163
3201
|
const location = useLocation2();
|
|
3164
3202
|
const dispatch = useAppDispatch();
|
|
@@ -3182,14 +3220,14 @@ var PrivateRoute = ({ children }) => {
|
|
|
3182
3220
|
}, [isAuthenticated, isLoadingAuth, location, dispatch, clientContextStatus]);
|
|
3183
3221
|
if (isLoadingAuth) {
|
|
3184
3222
|
console.log(`[PrivateRoute] Returning loading state...`);
|
|
3185
|
-
return /* @__PURE__ */
|
|
3223
|
+
return /* @__PURE__ */ jsx23("p", { children: "Verificando autenticaci\xF3n..." });
|
|
3186
3224
|
}
|
|
3187
3225
|
if (!isAuthenticated) {
|
|
3188
3226
|
console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
|
|
3189
|
-
return /* @__PURE__ */
|
|
3227
|
+
return /* @__PURE__ */ jsx23(Navigate, { to: "/login", replace: true });
|
|
3190
3228
|
}
|
|
3191
3229
|
console.log(`[PrivateRoute] User authenticated, rendering children.`);
|
|
3192
|
-
return /* @__PURE__ */
|
|
3230
|
+
return /* @__PURE__ */ jsx23(Fragment3, { children });
|
|
3193
3231
|
};
|
|
3194
3232
|
var PrivateRoute_default = PrivateRoute;
|
|
3195
3233
|
|
|
@@ -3223,25 +3261,25 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
|
|
|
3223
3261
|
|
|
3224
3262
|
// src/pages/GenericDataGridPage.tsx
|
|
3225
3263
|
import { useParams as useParams2 } from "react-router-dom";
|
|
3226
|
-
import { Box as
|
|
3227
|
-
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";
|
|
3228
3266
|
var GenericDataGridPage = () => {
|
|
3229
3267
|
const { tableName } = useParams2();
|
|
3230
3268
|
if (!tableName) {
|
|
3231
|
-
return /* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3233
|
-
/* @__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`)." })
|
|
3234
3272
|
] }) });
|
|
3235
3273
|
}
|
|
3236
|
-
return /* @__PURE__ */
|
|
3274
|
+
return /* @__PURE__ */ jsx24(GenericDataGrid_default, { tableName, fixedFields: [] });
|
|
3237
3275
|
};
|
|
3238
3276
|
var GenericDataGridPage_default = GenericDataGridPage;
|
|
3239
3277
|
|
|
3240
3278
|
// src/pages/MenuTablePage.tsx
|
|
3241
3279
|
import { useMemo as useMemo5 } from "react";
|
|
3242
3280
|
import { useParams as useParams3 } from "react-router-dom";
|
|
3243
|
-
import { Box as
|
|
3244
|
-
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";
|
|
3245
3283
|
var MenuTablePage = () => {
|
|
3246
3284
|
const { menuName } = useParams3();
|
|
3247
3285
|
const { clientContext } = useApp();
|
|
@@ -3283,12 +3321,12 @@ var MenuTablePage = () => {
|
|
|
3283
3321
|
};
|
|
3284
3322
|
}, [menuName, clientContext]);
|
|
3285
3323
|
if (!currentTableName) {
|
|
3286
|
-
return /* @__PURE__ */
|
|
3287
|
-
/* @__PURE__ */
|
|
3288
|
-
/* @__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." })
|
|
3289
3327
|
] }) });
|
|
3290
3328
|
}
|
|
3291
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ jsx25(
|
|
3292
3330
|
GenericDataGrid_default,
|
|
3293
3331
|
{
|
|
3294
3332
|
tableName: currentTableName,
|
|
@@ -3299,7 +3337,7 @@ var MenuTablePage = () => {
|
|
|
3299
3337
|
var MenuTablePage_default = MenuTablePage;
|
|
3300
3338
|
|
|
3301
3339
|
// src/App.tsx
|
|
3302
|
-
import { jsx as
|
|
3340
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3303
3341
|
var LocationTracker = () => {
|
|
3304
3342
|
const location = useLocation4();
|
|
3305
3343
|
const dispatch = useAppDispatch();
|
|
@@ -3311,18 +3349,18 @@ var LocationTracker = () => {
|
|
|
3311
3349
|
function FrontendPlusReactRoutes({ myRoutes, myWScreens }) {
|
|
3312
3350
|
const allWScreens = { ...wScreens, ...myWScreens || {} };
|
|
3313
3351
|
return /* @__PURE__ */ jsxs16(Routes, { children: [
|
|
3314
|
-
/* @__PURE__ */
|
|
3315
|
-
/* @__PURE__ */
|
|
3352
|
+
/* @__PURE__ */ jsx26(Route, { path: "/login", element: /* @__PURE__ */ jsx26(LoginPage_default, {}) }),
|
|
3353
|
+
/* @__PURE__ */ jsx26(Route, { path: "/logout", element: /* @__PURE__ */ jsx26(LogoutPage_default, {}) }),
|
|
3316
3354
|
/* @__PURE__ */ jsxs16(Route, { element: /* @__PURE__ */ jsxs16(PrivateRoute_default, { children: [
|
|
3317
|
-
/* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ jsx26(InitialRedirectHandler_default, {}),
|
|
3356
|
+
/* @__PURE__ */ jsx26(MainLayout_default, {})
|
|
3319
3357
|
] }), children: [
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
3322
|
-
/* @__PURE__ */
|
|
3323
|
-
/* @__PURE__ */
|
|
3324
|
-
/* @__PURE__ */
|
|
3325
|
-
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(
|
|
3326
3364
|
Route,
|
|
3327
3365
|
{
|
|
3328
3366
|
path: `/wScreens/${screenName}`,
|
|
@@ -3330,17 +3368,17 @@ function FrontendPlusReactRoutes({ myRoutes, myWScreens }) {
|
|
|
3330
3368
|
},
|
|
3331
3369
|
screenName
|
|
3332
3370
|
)),
|
|
3333
|
-
/* @__PURE__ */
|
|
3371
|
+
/* @__PURE__ */ jsx26(
|
|
3334
3372
|
Route,
|
|
3335
3373
|
{
|
|
3336
3374
|
path: "/wScreens-fallback/:screenName",
|
|
3337
|
-
element: /* @__PURE__ */
|
|
3375
|
+
element: /* @__PURE__ */ jsx26(WScreens_default, { screenName: ":screenName" })
|
|
3338
3376
|
}
|
|
3339
3377
|
),
|
|
3340
|
-
/* @__PURE__ */
|
|
3378
|
+
/* @__PURE__ */ jsx26(Route, { path: "*", element: /* @__PURE__ */ jsx26("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
|
|
3341
3379
|
] }),
|
|
3342
3380
|
myRoutes,
|
|
3343
|
-
/* @__PURE__ */
|
|
3381
|
+
/* @__PURE__ */ jsx26(Route, { path: "*", element: /* @__PURE__ */ jsx26(Navigate2, { to: "/", replace: true }) })
|
|
3344
3382
|
] });
|
|
3345
3383
|
}
|
|
3346
3384
|
var App = ({
|
|
@@ -3357,17 +3395,17 @@ var App = ({
|
|
|
3357
3395
|
extendResultsOk(myResultsOk);
|
|
3358
3396
|
}
|
|
3359
3397
|
}, [myClientSides, myResultsOk]);
|
|
3360
|
-
return /* @__PURE__ */
|
|
3361
|
-
/* @__PURE__ */
|
|
3362
|
-
/* @__PURE__ */
|
|
3363
|
-
/* @__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(
|
|
3364
3402
|
FrontendPlusReactRoutes,
|
|
3365
3403
|
{
|
|
3366
3404
|
myRoutes,
|
|
3367
3405
|
myWScreens
|
|
3368
3406
|
}
|
|
3369
3407
|
),
|
|
3370
|
-
/* @__PURE__ */
|
|
3408
|
+
/* @__PURE__ */ jsx26(SessionExpiredMessage_default, {})
|
|
3371
3409
|
] }) })
|
|
3372
3410
|
] }) }) });
|
|
3373
3411
|
};
|