frontend-plus-react 0.1.5 → 0.1.7

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.js CHANGED
@@ -786,7 +786,7 @@ var useApiCall = () => {
786
786
  };
787
787
 
788
788
  // src/components/grid/GenericDataGrid.tsx
789
- import { CircularProgress, Typography as Typography5, Box as Box5, Alert, useTheme as useTheme3, Button as Button3 } from "@mui/material";
789
+ import { CircularProgress, Typography as Typography5, Box as Box7, Alert, useTheme as useTheme3 } from "@mui/material";
790
790
 
791
791
  // src/utils/functions.tsx
792
792
  var JSON4all = __toESM(require_json4all(), 1);
@@ -986,9 +986,18 @@ var useRedirectPath = () => {
986
986
 
987
987
  // src/utils/functions.tsx
988
988
  var cambiarGuionesBajosPorEspacios = (texto) => texto.replace(/_/g, " ");
989
-
990
- // src/components/grid/GenericDataGrid.tsx
991
- import AddIcon from "@mui/icons-material/Add";
989
+ var getDetailTableAndFixedFieldsForDetailTableAbr = (tableDefinition, detailTableAbr, row) => {
990
+ const detailTable = tableDefinition.detailTables.find((dt) => dt.abr === detailTableAbr);
991
+ let fixedFields = [];
992
+ detailTable.fields.forEach((field) => {
993
+ if (typeof field === "string") {
994
+ fixedFields.push({ fieldName: field, value: row[field] });
995
+ } else {
996
+ fixedFields.push({ fieldName: field.target, value: row[field.source] });
997
+ }
998
+ });
999
+ return { detailTable, fixedFields };
1000
+ };
992
1001
 
993
1002
  // src/components/ConfirmDialog.tsx
994
1003
  import Dialog from "@mui/material/Dialog";
@@ -1022,7 +1031,8 @@ var ConfirmDialog = ({ open, onClose, title, message }) => {
1022
1031
  import { Box, IconButton, Tooltip, Typography } from "@mui/material";
1023
1032
  import SearchIcon from "@mui/icons-material/Search";
1024
1033
  import SearchOffIcon from "@mui/icons-material/SearchOff";
1025
- import { jsx as jsx3 } from "react/jsx-runtime";
1034
+ import MoreVertIcon from "@mui/icons-material/MoreVert";
1035
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1026
1036
  var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
1027
1037
  const { column } = props;
1028
1038
  const isPrimaryKey = fieldDef.isPk;
@@ -1045,7 +1055,7 @@ var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
1045
1055
  sx: {
1046
1056
  fontWeight: "bold",
1047
1057
  textDecoration: isPrimaryKey ? "underline" : "none",
1048
- fontSize: "0.875rem"
1058
+ fontSize: "o.930rem"
1049
1059
  // Puedes ajustar el tamaño si es necesario
1050
1060
  },
1051
1061
  children: column.name
@@ -1054,17 +1064,30 @@ var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
1054
1064
  }
1055
1065
  );
1056
1066
  };
1057
- var actionsColumnHeaderCellRenderer = (props, isFilterRowVisible, toggleFilterVisibility) => /* @__PURE__ */ jsx3(
1058
- IconButton,
1059
- {
1060
- color: "inherit",
1061
- onClick: toggleFilterVisibility,
1062
- size: "small",
1063
- title: isFilterRowVisible ? "Ocultar filtros" : "Mostrar filtros",
1064
- sx: { p: 0.5 },
1065
- children: isFilterRowVisible ? /* @__PURE__ */ jsx3(SearchOffIcon, { sx: { fontSize: 20 } }) : /* @__PURE__ */ jsx3(SearchIcon, { sx: { fontSize: 20 } })
1066
- }
1067
- );
1067
+ var actionsColumnHeaderCellRenderer = (props, isFilterRowVisible, toggleFilterVisibility) => /* @__PURE__ */ jsxs3(Box, { sx: { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 0.2 }, children: [
1068
+ /* @__PURE__ */ jsx3(
1069
+ IconButton,
1070
+ {
1071
+ color: "inherit",
1072
+ onClick: toggleFilterVisibility,
1073
+ size: "small",
1074
+ title: isFilterRowVisible ? "Ocultar filtros" : "Mostrar filtros",
1075
+ sx: { p: 0.25 },
1076
+ children: isFilterRowVisible ? /* @__PURE__ */ jsx3(SearchOffIcon, { sx: { fontSize: 18 } }) : /* @__PURE__ */ jsx3(SearchIcon, { sx: { fontSize: 18 } })
1077
+ }
1078
+ ),
1079
+ /* @__PURE__ */ jsx3(
1080
+ IconButton,
1081
+ {
1082
+ onClick: () => {
1083
+ },
1084
+ size: "small",
1085
+ title: "Opciones de esta tabla",
1086
+ sx: { p: 0.25 },
1087
+ children: /* @__PURE__ */ jsx3(MoreVertIcon, { sx: { fontSize: 20, variant: "filled", size: "small" } })
1088
+ }
1089
+ )
1090
+ ] });
1068
1091
  var detailColumnCellHeaderRenderer = (props, detailTable) => /* @__PURE__ */ jsx3(Tooltip, { title: detailTable.label, children: /* @__PURE__ */ jsx3(Typography, { variant: "caption", sx: { fontSize: "0.75rem", fontWeight: "bold" }, children: detailTable.abr.toUpperCase() }) });
1069
1092
 
1070
1093
  // src/components/grid/FilterInputRender.tsx
@@ -1085,6 +1108,7 @@ function FilterInputRenderer({
1085
1108
  }),
1086
1109
  sx: {
1087
1110
  width: "100%",
1111
+ height: 25,
1088
1112
  margin: "0",
1089
1113
  border: "1px solid #ccc",
1090
1114
  borderRadius: "4px",
@@ -1099,35 +1123,38 @@ function FilterInputRenderer({
1099
1123
  var FilterInputRender_default = FilterInputRenderer;
1100
1124
 
1101
1125
  // src/components/grid/renderers/summaryCellRenderers.tsx
1126
+ import { Box as Box2 } from "@mui/material";
1102
1127
  import { jsx as jsx5 } from "react/jsx-runtime";
1103
1128
  var defaultColumnSummaryCellRenderer = (props, fixedFields, isFilterRowVisible, filters, setFilters) => {
1104
1129
  const { column } = props;
1105
1130
  const fixedFieldEntry = fixedFields?.find((f) => f.fieldName === column.key);
1106
1131
  if (fixedFieldEntry && fixedFieldEntry.until === void 0 || !isFilterRowVisible) return null;
1107
- return /* @__PURE__ */ jsx5(
1132
+ return /* @__PURE__ */ jsx5(Box2, { children: /* @__PURE__ */ jsx5(
1108
1133
  FilterInputRender_default,
1109
1134
  {
1110
1135
  column,
1111
1136
  filters,
1112
1137
  setFilters
1113
1138
  }
1114
- );
1139
+ ) });
1115
1140
  };
1116
1141
  var actionsColumnSummaryCellRenderer = (props) => null;
1117
1142
  var detailColumnCellSummaryRenderer = (props) => null;
1118
1143
 
1119
1144
  // src/components/grid/renderers/cellRenderers.tsx
1120
- import { Box as Box4, Button as Button2, IconButton as IconButton2, Tooltip as Tooltip3, Typography as Typography4, useTheme } from "@mui/material";
1145
+ import { Box as Box5, Button as Button2, IconButton as IconButton2, Tooltip as Tooltip3, Typography as Typography4, useTheme } from "@mui/material";
1121
1146
  import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
1122
1147
  import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
1148
+ import ViewHeadlineIcon from "@mui/icons-material/ViewHeadline";
1123
1149
  import DeleteIcon from "@mui/icons-material/Delete";
1150
+ import AddIcon from "@mui/icons-material/Add";
1124
1151
 
1125
1152
  // src/components/grid/ExampleClientSideComponent.tsx
1126
- import { Box as Box2, Typography as Typography2 } from "@mui/material";
1153
+ import { Box as Box3, Typography as Typography2 } from "@mui/material";
1127
1154
  import { jsx as jsx6 } from "react/jsx-runtime";
1128
1155
  var ExampleClientSideComponent = ({ row, column, fieldDefinition }) => {
1129
1156
  const value = row[column.key];
1130
- return /* @__PURE__ */ jsx6(Box2, { sx: {
1157
+ return /* @__PURE__ */ jsx6(Box3, { sx: {
1131
1158
  padding: 0.5,
1132
1159
  width: "100%",
1133
1160
  height: "100%",
@@ -1139,13 +1166,13 @@ var ExampleClientSideComponent = ({ row, column, fieldDefinition }) => {
1139
1166
  var ExampleClientSideComponent_default = ExampleClientSideComponent;
1140
1167
 
1141
1168
  // src/components/grid/FallbackClientSideRenderer.tsx
1142
- import { Box as Box3, Typography as Typography3, Tooltip as Tooltip2 } from "@mui/material";
1169
+ import { Box as Box4, Typography as Typography3, Tooltip as Tooltip2 } from "@mui/material";
1143
1170
  import WarningAmberIcon from "@mui/icons-material/WarningAmber";
1144
- import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
1171
+ import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
1145
1172
  var FallbackClientSideRenderer = ({ column, row, fieldDefinition }) => {
1146
1173
  const clientSideName = fieldDefinition?.clientSide || "Desconocido";
1147
- return /* @__PURE__ */ jsx7(Tooltip2, { title: `Componente clientSide '${clientSideName}' no implementado. Mostrando valor por defecto.`, children: /* @__PURE__ */ jsxs3(
1148
- Box3,
1174
+ return /* @__PURE__ */ jsx7(Tooltip2, { title: `Componente clientSide '${clientSideName}' no implementado. Mostrando valor por defecto.`, children: /* @__PURE__ */ jsxs4(
1175
+ Box4,
1149
1176
  {
1150
1177
  sx: {
1151
1178
  display: "flex",
@@ -1205,17 +1232,9 @@ var allColumnsCellRenderer = (props) => {
1205
1232
  const detailTableAbr = row[DETAIL_ROW_INDICATOR];
1206
1233
  const detailColumn = column;
1207
1234
  if (column.customType === "detail" && detailColumn.detailTable.abr === detailTableAbr) {
1208
- const detailTable = detailColumn.tableDefinition.detailTables.find((dt) => dt.abr === detailTableAbr);
1209
- let fixedFields = [];
1210
- detailTable.fields.forEach((field) => {
1211
- if (typeof field === "string") {
1212
- fixedFields.push({ fieldName: field, value: row[field] });
1213
- } else {
1214
- fixedFields.push({ fieldName: field.target, value: row[field.source] });
1215
- }
1216
- });
1235
+ const { detailTable, fixedFields } = getDetailTableAndFixedFieldsForDetailTableAbr(detailColumn.tableDefinition, detailTableAbr, row);
1217
1236
  return /* @__PURE__ */ jsx8(
1218
- Box4,
1237
+ Box5,
1219
1238
  {
1220
1239
  sx: {
1221
1240
  // Se eliminó el padding para que la sub-grilla se extienda por completo
@@ -1230,7 +1249,7 @@ var allColumnsCellRenderer = (props) => {
1230
1249
  onClick: (e) => e.stopPropagation(),
1231
1250
  onKeyDown: (e) => e.stopPropagation(),
1232
1251
  onDoubleClick: (e) => e.stopPropagation(),
1233
- children: /* @__PURE__ */ jsx8(GenericDataGrid_default, { tableName: detailTable.table, fixedFields })
1252
+ children: /* @__PURE__ */ jsx8(GenericDataGrid_default, { tableName: detailTable.table, fixedFields, gridStyles: { height: 322 } })
1234
1253
  }
1235
1254
  );
1236
1255
  }
@@ -1263,7 +1282,7 @@ var allColumnsCellRenderer = (props) => {
1263
1282
  }
1264
1283
  }
1265
1284
  const value = row[props.column.key];
1266
- return /* @__PURE__ */ jsx8(Tooltip3, { title: cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key ? cellFeedback?.message : "", children: /* @__PURE__ */ jsx8(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) }) }) });
1285
+ return /* @__PURE__ */ jsx8(Tooltip3, { title: cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key ? cellFeedback?.message : "", children: /* @__PURE__ */ jsx8(Box5, { sx: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", backgroundColor: cellBackgroundColor, transition: "background-color 0.3s ease-in-out", display: "flex", alignItems: "center", paddingLeft: "8px", boxSizing: "border-box" }, children: /* @__PURE__ */ jsx8(Typography4, { variant: "body2", sx: { fontSize: "0.875rem", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", width: "100%" }, children: value === null || value === void 0 ? "" : String(value) }) }) });
1267
1286
  }
1268
1287
  case "detail": {
1269
1288
  const detailColumn = column;
@@ -1271,10 +1290,9 @@ var allColumnsCellRenderer = (props) => {
1271
1290
  const isExpanded = tableData.some(
1272
1291
  (r) => r[DETAIL_ROW_INDICATOR] === detailTable.abr && getPrimaryKeyValues(r, primaryKey) === getPrimaryKeyValues({ ...row, [DETAIL_ROW_INDICATOR]: detailTable.abr }, primaryKey)
1273
1292
  );
1274
- return /* @__PURE__ */ jsx8(Tooltip3, { title: detailTable.label, children: /* @__PURE__ */ jsx8(Box4, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx8(
1293
+ return /* @__PURE__ */ jsx8(Tooltip3, { title: detailTable.label, children: /* @__PURE__ */ jsx8(Box5, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx8(
1275
1294
  IconButton2,
1276
1295
  {
1277
- size: "small",
1278
1296
  onClick: (event) => {
1279
1297
  let rows = [...tableData];
1280
1298
  const rowId = getPrimaryKeyValues({ ...row, [DETAIL_ROW_INDICATOR]: detailTable.abr }, primaryKey);
@@ -1292,17 +1310,51 @@ var allColumnsCellRenderer = (props) => {
1292
1310
  }
1293
1311
  event.stopPropagation();
1294
1312
  },
1295
- title: isExpanded ? "Contraer detalle" : "Expandir detalle",
1296
- sx: { p: 0.5 },
1297
1313
  children: isExpanded ? /* @__PURE__ */ jsx8(KeyboardArrowUpIcon, { sx: { fontSize: 20 } }) : /* @__PURE__ */ jsx8(KeyboardArrowDownIcon, { sx: { fontSize: 20 } })
1298
1314
  }
1299
1315
  ) }) });
1300
1316
  }
1301
1317
  case "action": {
1302
1318
  const actionColumn = column;
1303
- const { tableDefinition, handleDeleteRow } = actionColumn;
1304
- if (!tableDefinition.allow?.delete) return void 0;
1305
- 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 } }) }) });
1319
+ const { tableDefinition, handleDeleteRow, handleAddRow } = actionColumn;
1320
+ const gridActionButtons = [
1321
+ {
1322
+ action: "insert",
1323
+ handler: handleAddRow,
1324
+ icon: AddIcon,
1325
+ title: "Agregar registro",
1326
+ color: "success"
1327
+ },
1328
+ {
1329
+ action: "delete",
1330
+ handler: handleDeleteRow,
1331
+ icon: DeleteIcon,
1332
+ title: "Eliminar registro",
1333
+ color: "error"
1334
+ },
1335
+ {
1336
+ action: "vertical-edit",
1337
+ handler: () => {
1338
+ },
1339
+ // implementar funcion
1340
+ icon: ViewHeadlineIcon,
1341
+ title: "Editar registro en forma de ficha",
1342
+ color: "primary"
1343
+ }
1344
+ ];
1345
+ return /* @__PURE__ */ jsx8(Box5, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", gap: 0.5 }, children: gridActionButtons.map((actionDef) => tableDefinition.allow[actionDef.action] ? /* @__PURE__ */ jsx8(
1346
+ Button2,
1347
+ {
1348
+ variant: "outlined",
1349
+ color: actionDef.color,
1350
+ size: "small",
1351
+ onClick: () => actionDef.handler(row),
1352
+ title: actionDef.title,
1353
+ sx: { width: 22, minWidth: 22, height: 22, "& .MuiButton-startIcon": { m: 0 } },
1354
+ children: /* @__PURE__ */ jsx8(actionDef.icon, { sx: { fontSize: 18 } })
1355
+ },
1356
+ actionDef.action
1357
+ ) : null) });
1306
1358
  }
1307
1359
  default:
1308
1360
  return void 0;
@@ -1432,7 +1484,7 @@ function InputRenderer({
1432
1484
  newRow: rowToSend,
1433
1485
  oldRow: oldRowData,
1434
1486
  status
1435
- }, { reportOnSnackbar: false });
1487
+ });
1436
1488
  let finalRowIdForFeedback;
1437
1489
  let persistedRowData;
1438
1490
  if (response.row && isNewRow) {
@@ -1459,7 +1511,6 @@ function InputRenderer({
1459
1511
  const isPrimaryKeyColumn = tableDefinition.primaryKey.includes(column.key);
1460
1512
  finalRowIdForFeedback = isPrimaryKeyColumn ? getPrimaryKeyValues(potentialUpdatedRow, tableDefinition.primaryKey) : currentRowIdBeforeUpdate;
1461
1513
  onRowChange({ ...response.row }, true);
1462
- onClose(true, focusNextCell);
1463
1514
  }
1464
1515
  findChangedValues(oldRowData, response.row).forEach(
1465
1516
  (key) => setCellFeedback({ rowId: finalRowIdForFeedback, columnKey: key, type: "success" })
@@ -1485,15 +1536,12 @@ function InputRenderer({
1485
1536
  initialRowId
1486
1537
  ]);
1487
1538
  const handleKeyDown = useCallback3((event) => {
1488
- console.log("entra");
1489
- if (event.key === "Enter") {
1539
+ if (["Enter", "Tab", "ArrowDown", "ArrowUp", "ArrowRight"].includes(event.key)) {
1490
1540
  handleCommit(editingValue, true, true);
1491
1541
  event.preventDefault();
1492
1542
  if (onEnterPress) {
1493
- onEnterPress(rowIdx, column.key);
1543
+ onEnterPress(rowIdx, column.key, event.key);
1494
1544
  }
1495
- } else if (event.key === "Tab") {
1496
- handleCommit(editingValue, true, true);
1497
1545
  }
1498
1546
  }, [handleCommit, editingValue, column.key, rowIdx, onEnterPress]);
1499
1547
  const handleBlur = useCallback3(() => {
@@ -1528,6 +1576,7 @@ function InputRenderer({
1528
1576
  var InputRenderer_default = InputRenderer;
1529
1577
 
1530
1578
  // src/components/grid/renderers/editCellRenderers.tsx
1579
+ import { Box as Box6, Tooltip as Tooltip4 } from "@mui/material";
1531
1580
  import { jsx as jsx10 } from "react/jsx-runtime";
1532
1581
  var allColumnsEditCellRenderer = (props, allColumns) => {
1533
1582
  const column = props.column;
@@ -1552,20 +1601,21 @@ var allColumnsEditCellRenderer = (props, allColumns) => {
1552
1601
  if (!isFieldEditableByUI) {
1553
1602
  return void 0;
1554
1603
  }
1555
- return /* @__PURE__ */ jsx10(
1604
+ const rowId = getPrimaryKeyValues(props.row, primaryKey);
1605
+ return /* @__PURE__ */ jsx10(Tooltip4, { title: cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key ? cellFeedback?.message : "", children: /* @__PURE__ */ jsx10(Box6, { children: /* @__PURE__ */ jsx10(
1556
1606
  InputRenderer_default,
1557
1607
  {
1558
1608
  ...props,
1559
1609
  tableDefinition,
1560
1610
  setCellFeedback,
1561
1611
  cellFeedback,
1562
- onEnterPress: (rowIndex, columnKey) => handleEnterKeyPressInEditor(rowIndex, columnKey, allColumns),
1612
+ onEnterPress: (rowIndex, columnKey, key) => handleEnterKeyPressInEditor(rowIndex, columnKey, key, allColumns),
1563
1613
  setTableData,
1564
1614
  setLocalCellChanges,
1565
1615
  localCellChanges,
1566
1616
  primaryKey
1567
1617
  }
1568
- );
1618
+ ) }) });
1569
1619
  }
1570
1620
  return void 0;
1571
1621
  }
@@ -1602,7 +1652,7 @@ function EmptyRowsRenderer() {
1602
1652
  }
1603
1653
 
1604
1654
  // src/components/grid/GenericDataGrid.tsx
1605
- import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
1655
+ import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
1606
1656
  var getPrimaryKeyValues = (row, primaryKey) => {
1607
1657
  if (row[DETAIL_ROW_INDICATOR]) {
1608
1658
  primaryKey = primaryKey.concat(DETAIL_ROW_INDICATOR);
@@ -1615,8 +1665,10 @@ var NEW_ROW_INDICATOR = "$new";
1615
1665
  var DETAIL_ROW_INDICATOR = "$detail";
1616
1666
  var GenericDataGrid = ({
1617
1667
  tableName,
1618
- fixedFields
1668
+ fixedFields,
1669
+ gridStyles
1619
1670
  }) => {
1671
+ const isOpenMenu = useIsDrawerOpen();
1620
1672
  const [tableDefinition, setTableDefinition] = useState4(null);
1621
1673
  const [tableData, setTableData] = useState4([]);
1622
1674
  const [isFilterRowVisible, setIsFilterRowVisible] = useState4(false);
@@ -1830,12 +1882,12 @@ var GenericDataGrid = ({
1830
1882
  }
1831
1883
  return rows;
1832
1884
  }, [tableData, filters, isFilterRowVisible]);
1833
- const handleEnterKeyPressInEditor = useCallback4((rowIndex, columnKey, currentColumns) => {
1885
+ const handleEnterKeyPressInEditor = useCallback4((rowIndex, columnKey, key, currentColumns) => {
1834
1886
  if (dataGridRef.current && tableDefinition) {
1835
1887
  const currentColumnIndex = currentColumns.findIndex((col) => col.key === columnKey);
1836
1888
  const editableColumns = currentColumns.filter((col) => {
1837
1889
  const fieldDefinition = tableDefinition.fields.find((f) => f.name === col.key);
1838
- return col.key !== "filterToggle" && col.key !== "deleteAction" && (fieldDefinition?.editable !== false && !fieldDefinition?.clientSide);
1890
+ return col.key !== "actionsColumn" && col.customType != "detail" && (fieldDefinition?.editable !== false && !fieldDefinition?.clientSide);
1839
1891
  });
1840
1892
  if (currentColumnIndex !== -1 && editableColumns.length > 0) {
1841
1893
  const editableColumnKeys = editableColumns.map((col) => col.key);
@@ -1852,7 +1904,7 @@ var GenericDataGrid = ({
1852
1904
  }
1853
1905
  const nextColumnKey = editableColumnKeys[nextEditableColumnIndex];
1854
1906
  const nextColumnIndex = currentColumns.findIndex((col) => col.key === nextColumnKey);
1855
- dataGridRef.current.selectCell({ rowIdx: nextRowIndex, idx: nextColumnIndex }, { enableEditor: true, shouldFocusCell: true });
1907
+ dataGridRef.current?.selectCell({ rowIdx: nextRowIndex, idx: nextColumnIndex }, { enableEditor: true, shouldFocusCell: true });
1856
1908
  }
1857
1909
  }
1858
1910
  }
@@ -1892,13 +1944,20 @@ var GenericDataGrid = ({
1892
1944
  renderSummaryCell: (props) => defaultColumnSummaryCellRenderer(props, fixedFields, isFilterRowVisible, filters, setFilters)
1893
1945
  };
1894
1946
  });
1947
+ const availableActions = [
1948
+ tableDefinition.allow?.insert,
1949
+ tableDefinition.allow?.delete,
1950
+ tableDefinition.allow?.["vertical-edit"]
1951
+ ].filter(Boolean).length;
1952
+ const actionColumnWidth = availableActions === 0 ? 30 : 12 + availableActions * 25;
1895
1953
  const actionsColumn = {
1896
- key: "filterToggle",
1954
+ key: "actionsColumn",
1897
1955
  customType: "action",
1898
1956
  tableDefinition,
1899
1957
  handleDeleteRow,
1958
+ handleAddRow,
1900
1959
  name: "filterCol",
1901
- width: 50,
1960
+ width: actionColumnWidth,
1902
1961
  editable: false,
1903
1962
  resizable: false,
1904
1963
  sortable: false,
@@ -1922,7 +1981,8 @@ var GenericDataGrid = ({
1922
1981
  resizable: false,
1923
1982
  sortable: false,
1924
1983
  editable: false,
1925
- width: 50,
1984
+ width: 30,
1985
+ minWidth: 30,
1926
1986
  renderHeaderCell: (props) => detailColumnCellHeaderRenderer(props, detailTable),
1927
1987
  renderSummaryCell: (props) => detailColumnCellSummaryRenderer(props)
1928
1988
  });
@@ -1944,6 +2004,8 @@ var GenericDataGrid = ({
1944
2004
  }
1945
2005
  return void 0;
1946
2006
  },
2007
+ editorOptions: { closeOnExternalRowChange: false },
2008
+ //con esto no se pierde el foco
1947
2009
  renderEditCell: (props) => allColumnsEditCellRenderer(props, allColumns),
1948
2010
  renderCell: (props) => allColumnsCellRenderer(props)
1949
2011
  }));
@@ -1962,6 +2024,7 @@ var GenericDataGrid = ({
1962
2024
  setTableData,
1963
2025
  localCellChanges,
1964
2026
  handleDeleteRow,
2027
+ handleAddRow,
1965
2028
  fixedFields,
1966
2029
  tableData
1967
2030
  ]);
@@ -1977,6 +2040,11 @@ var GenericDataGrid = ({
1977
2040
  }
1978
2041
  });
1979
2042
  };
2043
+ const handleCellKeyDown = (args, event) => {
2044
+ if (["Tab", "Enter"].includes(event.key)) {
2045
+ event.preventGridDefault();
2046
+ }
2047
+ };
1980
2048
  const handleCellClick = useCallback4((args) => {
1981
2049
  deselectAllOtherGrids(dataGridRef.current?.element);
1982
2050
  args.selectCell(true);
@@ -1988,29 +2056,20 @@ var GenericDataGrid = ({
1988
2056
  console.log("Is editable:", isEditable);
1989
2057
  }, [tableDefinition, fixedFields]);
1990
2058
  if (loading) {
1991
- return /* @__PURE__ */ jsxs4(Box5, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: [
2059
+ return /* @__PURE__ */ jsxs5(Box7, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: [
1992
2060
  /* @__PURE__ */ jsx12(CircularProgress, {}),
1993
2061
  /* @__PURE__ */ jsx12(Typography5, { variant: "h6", sx: { ml: 2 }, children: "Cargando tabla..." })
1994
2062
  ] });
1995
2063
  }
1996
2064
  if (error) {
1997
- return /* @__PURE__ */ jsx12(Box5, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsx12(Alert, { severity: "error", children: error.message }) });
2065
+ return /* @__PURE__ */ jsx12(Box7, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsx12(Alert, { severity: "error", children: error.message }) });
1998
2066
  }
1999
2067
  if (!tableDefinition) {
2000
- return /* @__PURE__ */ jsx12(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." }) });
2068
+ return /* @__PURE__ */ jsx12(Box7, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsx12(Alert, { severity: "warning", children: "No se pudo cargar la definici\xF3n de la tabla." }) });
2001
2069
  }
2002
- return /* @__PURE__ */ jsxs4(Box5, { sx: { pt: 2, display: "flex", flexDirection: "column", height: "100%", boxSizing: "border-box" }, children: [
2003
- tableDefinition.allow?.insert && /* @__PURE__ */ jsx12(Box5, { sx: { display: "flex", px: 2, pb: 1 }, children: /* @__PURE__ */ jsx12(
2004
- Button3,
2005
- {
2006
- variant: "contained",
2007
- onClick: handleAddRow,
2008
- startIcon: /* @__PURE__ */ jsx12(AddIcon, {}),
2009
- children: "Nuevo Registro"
2010
- }
2011
- ) }),
2070
+ return /* @__PURE__ */ jsxs5(Box7, { sx: { pt: 2, display: "flex", flexDirection: "column", height: "100%", boxSizing: "border-box" }, children: [
2012
2071
  /* @__PURE__ */ jsx12(
2013
- Box5,
2072
+ Box7,
2014
2073
  {
2015
2074
  sx: {
2016
2075
  backgroundColor: theme.palette.primary.main,
@@ -2024,15 +2083,15 @@ var GenericDataGrid = ({
2024
2083
  ml: 2,
2025
2084
  mr: 2
2026
2085
  },
2027
- children: /* @__PURE__ */ jsxs4(Typography5, { variant: "subtitle1", component: "div", children: [
2086
+ children: /* @__PURE__ */ jsxs5(Typography5, { variant: "subtitle2", component: "div", children: [
2028
2087
  cambiarGuionesBajosPorEspacios(tableDefinition.title || tableDefinition.name),
2029
- " - mostrando ",
2030
- getFilteredRowCount() === getRowCount() ? `${getRowCount()} registros` : `${getFilteredRowCount()} registros filtrados`
2088
+ " - ",
2089
+ getFilteredRowCount() === getRowCount() ? `${getRowCount()} registros` : `${getFilteredRowCount()} (F)`
2031
2090
  ] })
2032
2091
  }
2033
2092
  ),
2034
2093
  /* @__PURE__ */ jsx12(
2035
- Box5,
2094
+ Box7,
2036
2095
  {
2037
2096
  sx: {
2038
2097
  flexGrow: 1,
@@ -2046,6 +2105,7 @@ var GenericDataGrid = ({
2046
2105
  children: /* @__PURE__ */ jsx12(
2047
2106
  DataGrid,
2048
2107
  {
2108
+ className: "rdg-light",
2049
2109
  ref: dataGridRef,
2050
2110
  columns,
2051
2111
  rows: filteredRows.map((row) => ({
@@ -2058,13 +2118,14 @@ var GenericDataGrid = ({
2058
2118
  onSelectedCellChange: handleSelectedCellChange,
2059
2119
  onRowsChange: handleRowsChange,
2060
2120
  selectedRows,
2061
- rowHeight: (row) => row[DETAIL_ROW_INDICATOR] ? 400 : 35,
2062
- style: { height: "100%", width: "100%", boxSizing: "border-box" },
2063
- headerRowHeight: 35,
2121
+ rowHeight: (row) => row[DETAIL_ROW_INDICATOR] ? 400 : 30,
2122
+ style: { ...{ height: "100%", width: "100%", boxSizing: "border-box" }, ...gridStyles },
2123
+ headerRowHeight: 30,
2064
2124
  topSummaryRows: isFilterRowVisible ? [{ id: "filterRow" }] : void 0,
2065
- summaryRowHeight: isFilterRowVisible ? 35 : 0,
2125
+ summaryRowHeight: isFilterRowVisible ? 30 : 0,
2066
2126
  renderers: { noRowsFallback: /* @__PURE__ */ jsx12(EmptyRowsRenderer, {}) },
2067
- onCellClick: handleCellClick
2127
+ onCellClick: handleCellClick,
2128
+ onCellKeyDown: handleCellKeyDown
2068
2129
  }
2069
2130
  )
2070
2131
  }
@@ -2090,10 +2151,10 @@ import { BrowserRouter, Routes, Route, useLocation as useLocation4, Navigate as
2090
2151
  import { useEffect as useEffect3 } from "react";
2091
2152
  import { Outlet } from "react-router-dom";
2092
2153
  import {
2093
- Box as Box8,
2154
+ Box as Box9,
2094
2155
  AppBar,
2095
2156
  Toolbar,
2096
- Typography as Typography8,
2157
+ Typography as Typography7,
2097
2158
  Button as Button4,
2098
2159
  Drawer,
2099
2160
  CssBaseline,
@@ -2183,57 +2244,21 @@ import MenuIcon from "@mui/icons-material/Menu";
2183
2244
  import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
2184
2245
 
2185
2246
  // src/components/SideMenu.tsx
2186
- import { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Divider, Box as Box7, Typography as Typography7, Collapse } from "@mui/material";
2247
+ import { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Divider, Box as Box8, Typography as Typography6, Collapse } from "@mui/material";
2187
2248
  import ExpandLess from "@mui/icons-material/ExpandLess";
2188
2249
  import ExpandMore from "@mui/icons-material/ExpandMore";
2189
2250
  import TableChartIcon from "@mui/icons-material/TableChart";
2190
2251
  import FolderIcon from "@mui/icons-material/Folder";
2191
2252
  import DnsIcon from "@mui/icons-material/Dns";
2192
2253
  import HomeIcon from "@mui/icons-material/Home";
2193
- import WarningAmberIcon3 from "@mui/icons-material/WarningAmber";
2254
+ import WarningAmberIcon2 from "@mui/icons-material/WarningAmber";
2194
2255
  import DesktopWindowsIcon from "@mui/icons-material/DesktopWindows";
2195
2256
  import UnfoldMoreIcon from "@mui/icons-material/UnfoldMore";
2196
2257
  import UnfoldLessIcon from "@mui/icons-material/UnfoldLess";
2197
2258
  import { useNavigate as useNavigate2, useLocation } from "react-router-dom";
2198
2259
  import { blue, orange, teal, red, grey } from "@mui/material/colors";
2199
-
2200
- // src/pages/WScreens.tsx
2201
- import { Box as Box6, Typography as Typography6, Paper } from "@mui/material";
2202
- import ConstructionIcon from "@mui/icons-material/Construction";
2203
- import WarningAmberIcon2 from "@mui/icons-material/WarningAmber";
2204
- import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
2205
- var MyCustomDashboard = ({ screenName }) => {
2206
- 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: [
2207
- /* @__PURE__ */ jsxs5(Typography6, { variant: "h5", component: "h1", gutterBottom: true, children: [
2208
- "\xA1Bienvenido a tu WScreen: ",
2209
- screenName,
2210
- "!"
2211
- ] }),
2212
- /* @__PURE__ */ jsx14(Typography6, { variant: "body1", color: "text.secondary", children: "Esta es una pantalla de interfaz de usuario personalizada." }),
2213
- /* @__PURE__ */ jsx14(Box6, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx14(ConstructionIcon, { sx: { fontSize: 80, color: "primary.main" } }) })
2214
- ] }) });
2215
- };
2216
- var FallbackWScreen = ({ screenName }) => {
2217
- 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: [
2218
- /* @__PURE__ */ jsx14(Typography6, { variant: "h5", component: "h1", gutterBottom: true, color: "warning.dark", children: "WScreen No Implementada" }),
2219
- /* @__PURE__ */ jsxs5(Typography6, { variant: "body1", color: "warning.dark", children: [
2220
- 'No se encontr\xF3 un componente implementado para la **WScreen**: **`"$',
2221
- screenName,
2222
- '"`**. Por favor, verifica el `menuType` en la definici\xF3n del men\xFA o aseg\xFArate de que el componente est\xE9 correctamente importado y mapeado en el frontend.'
2223
- ] }),
2224
- /* @__PURE__ */ jsx14(Box6, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx14(WarningAmberIcon2, { sx: { fontSize: 80, color: "warning.dark" } }) })
2225
- ] }) });
2226
- };
2227
- var wScreens = {
2228
- "MyCustomDashboard": MyCustomDashboard
2229
- // Agrega más componentes de wScreen aquí:
2230
- // 'AnotherWScreen': AnotherWScreenComponent,
2231
- };
2232
- var WScreens_default = FallbackWScreen;
2233
-
2234
- // src/components/SideMenu.tsx
2235
- import { Fragment, jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
2236
- var MenuListItem = ({ item, level, onMenuItemClick }) => {
2260
+ import { Fragment, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
2261
+ var MenuListItem = ({ item, level, onMenuItemClick, allWScreens }) => {
2237
2262
  const navigate = useNavigate2();
2238
2263
  const location = useLocation();
2239
2264
  const open = useSubMenuOpenState(item.name);
@@ -2254,7 +2279,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
2254
2279
  } else if (item.menuType === "proc") {
2255
2280
  path = `/procedures/${item.name}`;
2256
2281
  } else {
2257
- const WScreenComponent = wScreens[item.menuType];
2282
+ const WScreenComponent = allWScreens[item.menuType];
2258
2283
  if (WScreenComponent !== void 0) {
2259
2284
  path = `/wScreens/${item.menuType}`;
2260
2285
  } else {
@@ -2273,17 +2298,17 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
2273
2298
  const getIcon = (item2) => {
2274
2299
  switch (item2.menuType) {
2275
2300
  case "table":
2276
- return /* @__PURE__ */ jsx15(TableChartIcon, { sx: { color: blue[700] } });
2301
+ return /* @__PURE__ */ jsx14(TableChartIcon, { sx: { color: blue[700] } });
2277
2302
  case "proc":
2278
- return /* @__PURE__ */ jsx15(DnsIcon, { sx: { color: teal[700] } });
2303
+ return /* @__PURE__ */ jsx14(DnsIcon, { sx: { color: teal[700] } });
2279
2304
  case "menu":
2280
- return /* @__PURE__ */ jsx15(FolderIcon, { sx: { color: orange[800] } });
2305
+ return /* @__PURE__ */ jsx14(FolderIcon, { sx: { color: orange[800] } });
2281
2306
  default:
2282
- const WScreenComponent = wScreens[item2.menuType];
2307
+ const WScreenComponent = allWScreens[item2.menuType];
2283
2308
  if (WScreenComponent !== void 0) {
2284
- return /* @__PURE__ */ jsx15(DesktopWindowsIcon, { sx: { color: grey[700] } });
2309
+ return /* @__PURE__ */ jsx14(DesktopWindowsIcon, { sx: { color: grey[700] } });
2285
2310
  }
2286
- return /* @__PURE__ */ jsx15(WarningAmberIcon3, { sx: { color: red[500] } });
2311
+ return /* @__PURE__ */ jsx14(WarningAmberIcon2, { sx: { color: red[500] } });
2287
2312
  }
2288
2313
  };
2289
2314
  const currentPath = location.pathname;
@@ -2303,24 +2328,25 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
2303
2328
  sx: { pl: level * 2 },
2304
2329
  selected: isSelected,
2305
2330
  children: [
2306
- /* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: getIcon(item) }),
2307
- /* @__PURE__ */ jsx15(ListItemText, { primary: item.label || item.name }),
2308
- item.menuType === "menu" ? open ? /* @__PURE__ */ jsx15(ExpandLess, {}) : /* @__PURE__ */ jsx15(ExpandMore, {}) : null
2331
+ /* @__PURE__ */ jsx14(ListItemIcon, { sx: { minWidth: "38px" }, children: getIcon(item) }),
2332
+ /* @__PURE__ */ jsx14(ListItemText, { primary: item.label || item.name }),
2333
+ item.menuType === "menu" ? open ? /* @__PURE__ */ jsx14(ExpandLess, {}) : /* @__PURE__ */ jsx14(ExpandMore, {}) : null
2309
2334
  ]
2310
2335
  }
2311
2336
  ),
2312
- 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(
2337
+ item.menuType === "menu" && /* @__PURE__ */ jsx14(Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: /* @__PURE__ */ jsx14(List, { component: "div", disablePadding: true, children: item.menuContent.map((subItem) => /* @__PURE__ */ jsx14(
2313
2338
  MenuListItem,
2314
2339
  {
2315
2340
  item: subItem,
2316
2341
  level: level + 1,
2317
- onMenuItemClick
2342
+ onMenuItemClick,
2343
+ allWScreens
2318
2344
  },
2319
2345
  subItem.name
2320
2346
  )) }) })
2321
2347
  ] });
2322
2348
  };
2323
- var SideMenu = ({ onMenuItemClick }) => {
2349
+ var SideMenu = ({ onMenuItemClick, allWScreens }) => {
2324
2350
  const { clientContext } = useApp();
2325
2351
  const navigate = useNavigate2();
2326
2352
  const location = useLocation();
@@ -2339,27 +2365,28 @@ var SideMenu = ({ onMenuItemClick }) => {
2339
2365
  dispatch(setAllSubMenusOpen(!isMostlyOpen));
2340
2366
  };
2341
2367
  if (!clientContext || !clientContext.menu) {
2342
- return /* @__PURE__ */ jsx15(Box7, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx15(Typography7, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
2368
+ return /* @__PURE__ */ jsx14(Box8, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx14(Typography6, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
2343
2369
  }
2344
2370
  const isHomeSelected = location.pathname === "/home";
2345
- return /* @__PURE__ */ jsxs6(Box7, { sx: { width: "100%", flexShrink: 0 }, children: [
2346
- clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs6(ListItemButton, { onClick: handleToggleAllSubMenus, children: [
2347
- /* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: isMostlyOpen ? /* @__PURE__ */ jsx15(UnfoldLessIcon, {}) : /* @__PURE__ */ jsx15(UnfoldMoreIcon, {}) }),
2348
- /* @__PURE__ */ jsx15(ListItemText, { primary: isMostlyOpen ? "colapsar " : "expandir" })
2371
+ return /* @__PURE__ */ jsxs6(Box8, { sx: { width: "100%", flexShrink: 0 }, children: [
2372
+ clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */ jsx14(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs6(ListItemButton, { onClick: handleToggleAllSubMenus, children: [
2373
+ /* @__PURE__ */ jsx14(ListItemIcon, { sx: { minWidth: "38px" }, children: isMostlyOpen ? /* @__PURE__ */ jsx14(UnfoldLessIcon, {}) : /* @__PURE__ */ jsx14(UnfoldMoreIcon, {}) }),
2374
+ /* @__PURE__ */ jsx14(ListItemText, { primary: isMostlyOpen ? "colapsar " : "expandir" })
2349
2375
  ] }) }),
2350
- /* @__PURE__ */ jsx15(Divider, {}),
2376
+ /* @__PURE__ */ jsx14(Divider, {}),
2351
2377
  /* @__PURE__ */ jsxs6(List, { children: [
2352
- /* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs6(ListItemButton, { onClick: handleHomeClick, selected: isHomeSelected, children: [
2353
- /* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: /* @__PURE__ */ jsx15(HomeIcon, {}) }),
2354
- /* @__PURE__ */ jsx15(ListItemText, { primary: "Inicio" })
2378
+ /* @__PURE__ */ jsx14(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs6(ListItemButton, { onClick: handleHomeClick, selected: isHomeSelected, children: [
2379
+ /* @__PURE__ */ jsx14(ListItemIcon, { sx: { minWidth: "38px" }, children: /* @__PURE__ */ jsx14(HomeIcon, {}) }),
2380
+ /* @__PURE__ */ jsx14(ListItemText, { primary: "Inicio" })
2355
2381
  ] }) }),
2356
- /* @__PURE__ */ jsx15(Divider, {}),
2357
- clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx15(
2382
+ /* @__PURE__ */ jsx14(Divider, {}),
2383
+ clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx14(
2358
2384
  MenuListItem,
2359
2385
  {
2360
2386
  item: menuItem,
2361
2387
  level: 1,
2362
- onMenuItemClick
2388
+ onMenuItemClick,
2389
+ allWScreens
2363
2390
  },
2364
2391
  menuItem.name
2365
2392
  ))
@@ -2397,9 +2424,10 @@ var useLogout = () => {
2397
2424
  var useLogout_default = useLogout;
2398
2425
 
2399
2426
  // src/components/MainLayout.tsx
2400
- import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
2427
+ import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
2401
2428
  var drawerWidth = 240;
2402
- var MainLayout = () => {
2429
+ var MainLayout = (props) => {
2430
+ const { allWScreens } = props;
2403
2431
  const { clientContext } = useApp();
2404
2432
  const logout = useLogout_default();
2405
2433
  const isDrawerOpen = useIsDrawerOpen();
@@ -2420,12 +2448,12 @@ var MainLayout = () => {
2420
2448
  }
2421
2449
  };
2422
2450
  if (!clientContext) {
2423
- 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..." }) });
2451
+ return /* @__PURE__ */ jsx15(Box9, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx15(Typography7, { children: "Cargando dise\xF1o de la aplicaci\xF3n..." }) });
2424
2452
  }
2425
2453
  const appBarOffset = theme.mixins.toolbar;
2426
- return /* @__PURE__ */ jsxs7(Box8, { sx: { display: "flex", height: "100vh" }, children: [
2427
- /* @__PURE__ */ jsx16(CssBaseline, {}),
2428
- /* @__PURE__ */ jsx16(
2454
+ return /* @__PURE__ */ jsxs7(Box9, { sx: { display: "flex", height: "100vh" }, children: [
2455
+ /* @__PURE__ */ jsx15(CssBaseline, {}),
2456
+ /* @__PURE__ */ jsx15(
2429
2457
  AppBar,
2430
2458
  {
2431
2459
  position: "fixed",
@@ -2445,7 +2473,7 @@ var MainLayout = () => {
2445
2473
  }
2446
2474
  },
2447
2475
  children: /* @__PURE__ */ jsxs7(Toolbar, { children: [
2448
- /* @__PURE__ */ jsx16(
2476
+ /* @__PURE__ */ jsx15(
2449
2477
  IconButton3,
2450
2478
  {
2451
2479
  color: "inherit",
@@ -2455,17 +2483,17 @@ var MainLayout = () => {
2455
2483
  sx: {
2456
2484
  marginRight: 2.2
2457
2485
  },
2458
- children: isDrawerOpen ? /* @__PURE__ */ jsx16(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx16(MenuIcon, {})
2486
+ children: isDrawerOpen ? /* @__PURE__ */ jsx15(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx15(MenuIcon, {})
2459
2487
  }
2460
2488
  ),
2461
- /* @__PURE__ */ jsx16(Typography8, { variant: "h6", noWrap: true, component: "div", sx: { flexGrow: 1 }, children: isDrawerOpen ? "" : clientContext.config.title }),
2462
- /* @__PURE__ */ jsx16(Typography8, { variant: "subtitle1", component: "div", sx: { mr: 2 }, children: clientContext.username }),
2463
- /* @__PURE__ */ jsx16(
2489
+ /* @__PURE__ */ jsx15(Typography7, { variant: "h6", noWrap: true, component: "div", sx: { flexGrow: 1 }, children: isDrawerOpen ? "" : clientContext.config.title }),
2490
+ /* @__PURE__ */ jsx15(Typography7, { variant: "subtitle1", component: "div", sx: { mr: 2 }, children: clientContext.username }),
2491
+ /* @__PURE__ */ jsx15(
2464
2492
  Button4,
2465
2493
  {
2466
2494
  color: "inherit",
2467
2495
  onClick: logout,
2468
- startIcon: /* @__PURE__ */ jsx16(LogoutIcon, {}),
2496
+ startIcon: /* @__PURE__ */ jsx15(LogoutIcon, {}),
2469
2497
  children: "Salir"
2470
2498
  }
2471
2499
  )
@@ -2489,7 +2517,7 @@ var MainLayout = () => {
2489
2517
  }
2490
2518
  },
2491
2519
  children: [
2492
- /* @__PURE__ */ jsx16(
2520
+ /* @__PURE__ */ jsx15(
2493
2521
  Toolbar,
2494
2522
  {
2495
2523
  sx: {
@@ -2503,12 +2531,12 @@ var MainLayout = () => {
2503
2531
  children: isDrawerOpen ? clientContext.config.title : ""
2504
2532
  }
2505
2533
  ),
2506
- /* @__PURE__ */ jsx16(SideMenu_default, { onMenuItemClick: handleDrawerCloseMobile })
2534
+ /* @__PURE__ */ jsx15(SideMenu_default, { onMenuItemClick: handleDrawerCloseMobile, allWScreens })
2507
2535
  ]
2508
2536
  }
2509
2537
  ),
2510
- /* @__PURE__ */ jsx16(
2511
- Box8,
2538
+ /* @__PURE__ */ jsx15(
2539
+ Box9,
2512
2540
  {
2513
2541
  component: "main",
2514
2542
  sx: {
@@ -2535,7 +2563,7 @@ var MainLayout = () => {
2535
2563
  flexDirection: "column",
2536
2564
  width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
2537
2565
  },
2538
- children: /* @__PURE__ */ jsx16(Outlet, {})
2566
+ children: /* @__PURE__ */ jsx15(Outlet, {})
2539
2567
  }
2540
2568
  )
2541
2569
  ] });
@@ -2543,9 +2571,9 @@ var MainLayout = () => {
2543
2571
  var MainLayout_default = MainLayout;
2544
2572
 
2545
2573
  // src/components/SessionExpiredMessage.tsx
2546
- import { Box as Box9, Typography as Typography9, Button as Button5, Modal } from "@mui/material";
2574
+ import { Box as Box10, Typography as Typography8, Button as Button5, Modal } from "@mui/material";
2547
2575
  import { useNavigate as useNavigate4 } from "react-router-dom";
2548
- import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
2576
+ import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
2549
2577
  var style = {
2550
2578
  position: "absolute",
2551
2579
  top: "50%",
@@ -2567,7 +2595,7 @@ var SessionExpiredMessage = () => {
2567
2595
  setIsLoggedIn(false);
2568
2596
  navigate("/login", { replace: true });
2569
2597
  };
2570
- return /* @__PURE__ */ jsx17(
2598
+ return /* @__PURE__ */ jsx16(
2571
2599
  Modal,
2572
2600
  {
2573
2601
  open: showSessionExpiredMessage,
@@ -2587,10 +2615,10 @@ var SessionExpiredMessage = () => {
2587
2615
  }
2588
2616
  }
2589
2617
  },
2590
- children: /* @__PURE__ */ jsxs8(Box9, { sx: style, children: [
2591
- /* @__PURE__ */ jsx17(Typography9, { id: "session-expired-modal-title", variant: "h6", component: "h2", gutterBottom: true, children: "\xA1Sesi\xF3n Expirada!" }),
2592
- /* @__PURE__ */ jsx17(Typography9, { id: "session-expired-modal-description", sx: { mt: 2, mb: 3 }, children: "Tu sesi\xF3n ha expirado por inactividad o por seguridad. Por favor, inicia sesi\xF3n de nuevo." }),
2593
- /* @__PURE__ */ jsx17(Button5, { variant: "contained", color: "primary", onClick: handleClose, children: "Ir al Login" })
2618
+ children: /* @__PURE__ */ jsxs8(Box10, { sx: style, children: [
2619
+ /* @__PURE__ */ jsx16(Typography8, { id: "session-expired-modal-title", variant: "h6", component: "h2", gutterBottom: true, children: "\xA1Sesi\xF3n Expirada!" }),
2620
+ /* @__PURE__ */ jsx16(Typography8, { 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." }),
2621
+ /* @__PURE__ */ jsx16(Button5, { variant: "contained", color: "primary", onClick: handleClose, children: "Ir al Login" })
2594
2622
  ] })
2595
2623
  }
2596
2624
  );
@@ -2598,27 +2626,27 @@ var SessionExpiredMessage = () => {
2598
2626
  var SessionExpiredMessage_default = SessionExpiredMessage;
2599
2627
 
2600
2628
  // src/pages/HomePage.tsx
2601
- import { Box as Box10, Typography as Typography10 } from "@mui/material";
2602
- import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
2629
+ import { Box as Box11, Typography as Typography9 } from "@mui/material";
2630
+ import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
2603
2631
  var HomePage = () => {
2604
2632
  const { clientContext } = useApp();
2605
- return /* @__PURE__ */ jsxs9(Box10, { sx: { p: 3 }, children: [
2606
- /* @__PURE__ */ jsx18(Typography10, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${clientContext?.username}` }),
2607
- /* @__PURE__ */ jsx18(Typography10, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
2633
+ return /* @__PURE__ */ jsxs9(Box11, { sx: { p: 3 }, children: [
2634
+ /* @__PURE__ */ jsx17(Typography9, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${clientContext?.username}` }),
2635
+ /* @__PURE__ */ jsx17(Typography9, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
2608
2636
  ] });
2609
2637
  };
2610
2638
  var HomePage_default = HomePage;
2611
2639
 
2612
2640
  // src/pages/LogoutPage.tsx
2613
2641
  import { useEffect as useEffect4 } from "react";
2614
- import { Box as Box11, Typography as Typography11, CircularProgress as CircularProgress2 } from "@mui/material";
2615
- import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
2642
+ import { Box as Box12, Typography as Typography10, CircularProgress as CircularProgress2 } from "@mui/material";
2643
+ import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
2616
2644
  var LogoutPage = () => {
2617
2645
  const logout = useLogout_default();
2618
2646
  useEffect4(() => {
2619
2647
  logout();
2620
2648
  }, [logout]);
2621
- return /* @__PURE__ */ jsxs10(Box11, { sx: {
2649
+ return /* @__PURE__ */ jsxs10(Box12, { sx: {
2622
2650
  display: "flex",
2623
2651
  flexDirection: "column",
2624
2652
  justifyContent: "center",
@@ -2626,21 +2654,21 @@ var LogoutPage = () => {
2626
2654
  height: "100vh",
2627
2655
  textAlign: "center"
2628
2656
  }, children: [
2629
- /* @__PURE__ */ jsx19(CircularProgress2, { size: 60 }),
2630
- /* @__PURE__ */ jsx19(Typography11, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
2657
+ /* @__PURE__ */ jsx18(CircularProgress2, { size: 60 }),
2658
+ /* @__PURE__ */ jsx18(Typography10, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
2631
2659
  ] });
2632
2660
  };
2633
2661
  var LogoutPage_default = LogoutPage;
2634
2662
 
2635
2663
  // src/pages/LoginPage.tsx
2636
2664
  import { useState as useState6 } from "react";
2637
- import { Button as Button6, TextField, Typography as Typography12, Alert as Alert2, AlertTitle, Box as Box12, CircularProgress as CircularProgress3 } from "@mui/material";
2665
+ import { Button as Button6, TextField, Typography as Typography11, Alert as Alert2, AlertTitle, Box as Box13, CircularProgress as CircularProgress3 } from "@mui/material";
2638
2666
  import { useForm, Controller } from "react-hook-form";
2639
2667
  import { zodResolver } from "@hookform/resolvers/zod";
2640
2668
  import * as z from "zod";
2641
2669
  import { useNavigate as useNavigate5 } from "react-router-dom";
2642
2670
  import { useDispatch as useDispatch4 } from "react-redux";
2643
- import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
2671
+ import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
2644
2672
  var loginSchema = z.object({
2645
2673
  username: z.string().min(1, "El usuario es requerido"),
2646
2674
  // Añadir validación básica
@@ -2696,8 +2724,8 @@ var LoginPage = () => {
2696
2724
  setIsSubmitting(false);
2697
2725
  }
2698
2726
  };
2699
- return /* @__PURE__ */ jsx20(
2700
- Box12,
2727
+ return /* @__PURE__ */ jsx19(
2728
+ Box13,
2701
2729
  {
2702
2730
  display: "flex",
2703
2731
  alignItems: "center",
@@ -2705,7 +2733,7 @@ var LoginPage = () => {
2705
2733
  minHeight: "100vh",
2706
2734
  bgcolor: "#f5f5f5",
2707
2735
  children: /* @__PURE__ */ jsxs11(
2708
- Box12,
2736
+ Box13,
2709
2737
  {
2710
2738
  width: "100%",
2711
2739
  maxWidth: "400px",
@@ -2714,16 +2742,16 @@ var LoginPage = () => {
2714
2742
  borderRadius: 8,
2715
2743
  boxShadow: 3,
2716
2744
  children: [
2717
- /* @__PURE__ */ jsx20(Typography12, { variant: "h5", align: "center", gutterBottom: true, children: "Iniciar Sesi\xF3n" }),
2745
+ /* @__PURE__ */ jsx19(Typography11, { variant: "h5", align: "center", gutterBottom: true, children: "Iniciar Sesi\xF3n" }),
2718
2746
  /* @__PURE__ */ jsxs11("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
2719
2747
  /* @__PURE__ */ jsxs11("div", { children: [
2720
- /* @__PURE__ */ jsx20("label", { htmlFor: "username", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
2721
- /* @__PURE__ */ jsx20(
2748
+ /* @__PURE__ */ jsx19("label", { htmlFor: "username", children: /* @__PURE__ */ jsx19(Typography11, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
2749
+ /* @__PURE__ */ jsx19(
2722
2750
  Controller,
2723
2751
  {
2724
2752
  name: "username",
2725
2753
  control,
2726
- render: ({ field }) => /* @__PURE__ */ jsx20(
2754
+ render: ({ field }) => /* @__PURE__ */ jsx19(
2727
2755
  TextField,
2728
2756
  {
2729
2757
  ...field,
@@ -2740,13 +2768,13 @@ var LoginPage = () => {
2740
2768
  )
2741
2769
  ] }),
2742
2770
  /* @__PURE__ */ jsxs11("div", { children: [
2743
- /* @__PURE__ */ jsx20("label", { htmlFor: "password", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
2744
- /* @__PURE__ */ jsx20(
2771
+ /* @__PURE__ */ jsx19("label", { htmlFor: "password", children: /* @__PURE__ */ jsx19(Typography11, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
2772
+ /* @__PURE__ */ jsx19(
2745
2773
  Controller,
2746
2774
  {
2747
2775
  name: "password",
2748
2776
  control,
2749
- render: ({ field }) => /* @__PURE__ */ jsx20(
2777
+ render: ({ field }) => /* @__PURE__ */ jsx19(
2750
2778
  TextField,
2751
2779
  {
2752
2780
  ...field,
@@ -2762,14 +2790,14 @@ var LoginPage = () => {
2762
2790
  }
2763
2791
  )
2764
2792
  ] }),
2765
- /* @__PURE__ */ jsx20(Button6, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
2766
- /* @__PURE__ */ jsx20(CircularProgress3, { size: 20, sx: { mr: 1 } }),
2793
+ /* @__PURE__ */ jsx19(Button6, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
2794
+ /* @__PURE__ */ jsx19(CircularProgress3, { size: 20, sx: { mr: 1 } }),
2767
2795
  "Iniciando sesi\xF3n..."
2768
2796
  ] }) : "Iniciar Sesi\xF3n" })
2769
2797
  ] }),
2770
2798
  loginError && /* @__PURE__ */ jsxs11(Alert2, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
2771
2799
  " ",
2772
- /* @__PURE__ */ jsx20(AlertTitle, { children: "Error" }),
2800
+ /* @__PURE__ */ jsx19(AlertTitle, { children: "Error" }),
2773
2801
  loginError
2774
2802
  ] })
2775
2803
  ]
@@ -2793,23 +2821,23 @@ import {
2793
2821
  Checkbox,
2794
2822
  FormControlLabel,
2795
2823
  FormHelperText,
2796
- Typography as Typography14,
2797
- Box as Box14,
2824
+ Typography as Typography13,
2825
+ Box as Box15,
2798
2826
  CircularProgress as CircularProgress4,
2799
2827
  Alert as Alert3,
2800
2828
  Divider as Divider2,
2801
- Paper as Paper3
2829
+ Paper as Paper2
2802
2830
  } from "@mui/material";
2803
2831
 
2804
2832
  // src/pages/procedure-results/SuccessDisplay.tsx
2805
- import { Box as Box13, Typography as Typography13, Paper as Paper2 } from "@mui/material";
2806
- import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
2833
+ import { Box as Box14, Typography as Typography12, Paper } from "@mui/material";
2834
+ import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
2807
2835
  var SuccessDisplay = ({ data }) => {
2808
- return /* @__PURE__ */ jsxs12(Paper2, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
2809
- /* @__PURE__ */ jsx21(Typography13, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
2810
- /* @__PURE__ */ jsx21(Typography13, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
2811
- /* @__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) }) }),
2812
- /* @__PURE__ */ jsx21(Typography13, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
2836
+ return /* @__PURE__ */ jsxs12(Paper, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
2837
+ /* @__PURE__ */ jsx20(Typography12, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
2838
+ /* @__PURE__ */ jsx20(Typography12, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
2839
+ /* @__PURE__ */ jsx20(Box14, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ jsx20("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
2840
+ /* @__PURE__ */ jsx20(Typography12, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
2813
2841
  ] });
2814
2842
  };
2815
2843
  var SuccessDisplay_default = SuccessDisplay;
@@ -2823,7 +2851,7 @@ var extendResultsOk = (newComponents) => {
2823
2851
  };
2824
2852
 
2825
2853
  // src/components/ProcedureForm.tsx
2826
- import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
2854
+ import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
2827
2855
  var ProcedureForm = () => {
2828
2856
  const { procedureName } = useParams();
2829
2857
  const { clientContext } = useApp();
@@ -3039,7 +3067,7 @@ var ProcedureForm = () => {
3039
3067
  };
3040
3068
  if (param.options && param.options.length > 0) {
3041
3069
  return /* @__PURE__ */ jsxs13(FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
3042
- /* @__PURE__ */ jsx22(InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
3070
+ /* @__PURE__ */ jsx21(InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
3043
3071
  /* @__PURE__ */ jsxs13(
3044
3072
  Select,
3045
3073
  {
@@ -3051,14 +3079,14 @@ var ProcedureForm = () => {
3051
3079
  label: param.label || param.name,
3052
3080
  disabled: apiLoading,
3053
3081
  sx: { fontSize: "0.8rem" },
3054
- renderValue: (selected) => /* @__PURE__ */ jsx22(Typography14, { sx: { fontSize: "0.8rem" }, children: selected }),
3082
+ renderValue: (selected) => /* @__PURE__ */ jsx21(Typography13, { sx: { fontSize: "0.8rem" }, children: selected }),
3055
3083
  children: [
3056
- (!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ jsx22(MenuItem, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ jsx22("em", { children: "Seleccione..." }) }),
3057
- param.options.map((option) => /* @__PURE__ */ jsx22(MenuItem, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
3084
+ (!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ jsx21(MenuItem, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ jsx21("em", { children: "Seleccione..." }) }),
3085
+ param.options.map((option) => /* @__PURE__ */ jsx21(MenuItem, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
3058
3086
  ]
3059
3087
  }
3060
3088
  ),
3061
- (param.description || errorMessage) && /* @__PURE__ */ jsx22(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
3089
+ (param.description || errorMessage) && /* @__PURE__ */ jsx21(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
3062
3090
  ] });
3063
3091
  }
3064
3092
  switch (param.typeName) {
@@ -3067,18 +3095,18 @@ var ProcedureForm = () => {
3067
3095
  case "tsrange":
3068
3096
  case "time_range":
3069
3097
  case "daterange":
3070
- return /* @__PURE__ */ jsx22(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
3098
+ return /* @__PURE__ */ jsx21(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
3071
3099
  case "decimal":
3072
3100
  case "double":
3073
- return /* @__PURE__ */ jsx22(TextField2, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
3101
+ return /* @__PURE__ */ jsx21(TextField2, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
3074
3102
  case "integer":
3075
3103
  case "bigint":
3076
- return /* @__PURE__ */ jsx22(TextField2, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
3104
+ return /* @__PURE__ */ jsx21(TextField2, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
3077
3105
  case "boolean":
3078
- return /* @__PURE__ */ jsx22(
3106
+ return /* @__PURE__ */ jsx21(
3079
3107
  FormControlLabel,
3080
3108
  {
3081
- control: /* @__PURE__ */ jsx22(
3109
+ control: /* @__PURE__ */ jsx21(
3082
3110
  Checkbox,
3083
3111
  {
3084
3112
  checked: !!formValues[param.name],
@@ -3089,21 +3117,21 @@ var ProcedureForm = () => {
3089
3117
  size: "small"
3090
3118
  }
3091
3119
  ),
3092
- label: /* @__PURE__ */ jsx22(Typography14, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
3120
+ label: /* @__PURE__ */ jsx21(Typography13, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
3093
3121
  sx: { mt: 1, mb: 0 }
3094
3122
  }
3095
3123
  );
3096
3124
  case "date":
3097
3125
  case "timestamp":
3098
3126
  case "time":
3099
- 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" } } });
3127
+ return /* @__PURE__ */ jsx21(TextField2, { type: param.typeName === "date" ? "date" : param.typeName === "timestamp" ? "datetime-local" : "time", value: formValues[param.name] || "", ...commonProps, InputLabelProps: { shrink: true, sx: { fontSize: "0.8rem" } } });
3100
3128
  case "jsonb":
3101
3129
  case "jsona":
3102
- return /* @__PURE__ */ jsx22(TextField2, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
3130
+ return /* @__PURE__ */ jsx21(TextField2, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
3103
3131
  case "bytea":
3104
3132
  return /* @__PURE__ */ jsxs13(FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
3105
- /* @__PURE__ */ jsx22(Typography14, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
3106
- /* @__PURE__ */ jsx22(
3133
+ /* @__PURE__ */ jsx21(Typography13, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
3134
+ /* @__PURE__ */ jsx21(
3107
3135
  "input",
3108
3136
  {
3109
3137
  type: "file",
@@ -3117,34 +3145,34 @@ var ProcedureForm = () => {
3117
3145
  style: { padding: "6px 0", fontSize: "0.8rem" }
3118
3146
  }
3119
3147
  ),
3120
- (param.description || errorMessage) && /* @__PURE__ */ jsx22(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
3148
+ (param.description || errorMessage) && /* @__PURE__ */ jsx21(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
3121
3149
  ] });
3122
3150
  default:
3123
- return /* @__PURE__ */ jsx22(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
3151
+ return /* @__PURE__ */ jsx21(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
3124
3152
  }
3125
3153
  }, [formValues, handleChange, apiLoading, validationErrors]);
3126
3154
  const ResultDisplayContent = useMemo4(() => {
3127
3155
  if (!procedureResultData || !procedure?.resultOk) return null;
3128
3156
  const ComponentToRender = resultsOk[procedure.resultOk];
3129
3157
  if (ComponentToRender) {
3130
- return /* @__PURE__ */ jsx22(ComponentToRender, { data: procedureResultData });
3158
+ return /* @__PURE__ */ jsx21(ComponentToRender, { data: procedureResultData });
3131
3159
  } else {
3132
- return /* @__PURE__ */ jsxs13(Paper3, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
3133
- /* @__PURE__ */ jsxs13(Typography14, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
3160
+ return /* @__PURE__ */ jsxs13(Paper2, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
3161
+ /* @__PURE__ */ jsxs13(Typography13, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
3134
3162
  "el componente para resolver el resultOk: '",
3135
3163
  procedure.resultOk,
3136
3164
  "' definido en el procedure no existe o no est\xE1 mapeado."
3137
3165
  ] }),
3138
- /* @__PURE__ */ jsx22(Box14, { sx: {
3166
+ /* @__PURE__ */ jsx21(Box15, { sx: {
3139
3167
  bgcolor: "warning.dark",
3140
3168
  p: 1,
3141
3169
  borderRadius: 1
3142
- }, children: /* @__PURE__ */ jsx22("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(procedureResultData, null, 2) }) })
3170
+ }, children: /* @__PURE__ */ jsx21("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(procedureResultData, null, 2) }) })
3143
3171
  ] });
3144
3172
  }
3145
3173
  }, [procedureResultData, procedure]);
3146
3174
  if (!procedure) {
3147
- return /* @__PURE__ */ jsxs13(Box14, { sx: {
3175
+ return /* @__PURE__ */ jsxs13(Box15, { sx: {
3148
3176
  p: 2,
3149
3177
  width: "100%",
3150
3178
  boxSizing: "border-box",
@@ -3154,13 +3182,13 @@ var ProcedureForm = () => {
3154
3182
  boxShadow: 3,
3155
3183
  textAlign: "center"
3156
3184
  }, children: [
3157
- /* @__PURE__ */ jsx22(CircularProgress4, { sx: { mb: 2 } }),
3158
- /* @__PURE__ */ jsx22(Typography14, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
3185
+ /* @__PURE__ */ jsx21(CircularProgress4, { sx: { mb: 2 } }),
3186
+ /* @__PURE__ */ jsx21(Typography13, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
3159
3187
  ] });
3160
3188
  }
3161
3189
  return (
3162
3190
  // Esta es la Box más externa que ahora controlará el scroll
3163
- /* @__PURE__ */ jsxs13(Box14, { sx: {
3191
+ /* @__PURE__ */ jsxs13(Box15, { sx: {
3164
3192
  p: 2,
3165
3193
  ml: 1,
3166
3194
  mt: 2,
@@ -3177,16 +3205,16 @@ var ProcedureForm = () => {
3177
3205
  overflowX: "hidden"
3178
3206
  // Oculta el scroll horizontal si no es necesario para el contenedor principal
3179
3207
  }, children: [
3180
- /* @__PURE__ */ jsx22(Typography14, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
3208
+ /* @__PURE__ */ jsx21(Typography13, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
3181
3209
  Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs13(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
3182
3210
  "Por favor, corrige los errores en el formulario antes de enviar.",
3183
- /* @__PURE__ */ jsx22("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ jsx22("li", { children: err }, idx)) })
3211
+ /* @__PURE__ */ jsx21("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ jsx21("li", { children: err }, idx)) })
3184
3212
  ] }),
3185
- !Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ jsx22(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
3186
- !Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ jsx22(Alert3, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
3213
+ !Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ jsx21(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
3214
+ !Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ jsx21(Alert3, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
3187
3215
  /* @__PURE__ */ jsxs13("form", { onSubmit: handleSubmit, children: [
3188
- procedure.parameters.map((param) => /* @__PURE__ */ jsx22("div", { children: renderInputField(param) }, param.name)),
3189
- /* @__PURE__ */ jsx22(
3216
+ procedure.parameters.map((param) => /* @__PURE__ */ jsx21("div", { children: renderInputField(param) }, param.name)),
3217
+ /* @__PURE__ */ jsx21(
3190
3218
  Button7,
3191
3219
  {
3192
3220
  type: "submit",
@@ -3195,20 +3223,20 @@ var ProcedureForm = () => {
3195
3223
  disabled: apiLoading || Object.values(validationErrors).some((err) => err !== null),
3196
3224
  sx: { mt: 2 },
3197
3225
  size: "medium",
3198
- startIcon: apiLoading ? /* @__PURE__ */ jsx22(CircularProgress4, { size: 20, color: "inherit" }) : null,
3226
+ startIcon: apiLoading ? /* @__PURE__ */ jsx21(CircularProgress4, { size: 20, color: "inherit" }) : null,
3199
3227
  children: apiLoading ? "Ejecutando..." : procedure.proceedLabel || "Ejecutar"
3200
3228
  }
3201
3229
  )
3202
3230
  ] }),
3203
- ResultDisplayContent && /* @__PURE__ */ jsxs13(Box14, { sx: { mt: 2 }, children: [
3231
+ ResultDisplayContent && /* @__PURE__ */ jsxs13(Box15, { sx: { mt: 2 }, children: [
3204
3232
  " ",
3205
3233
  ResultDisplayContent
3206
3234
  ] }),
3207
- executionLog.length > 0 && /* @__PURE__ */ jsxs13(Box14, { sx: { mt: 3 }, children: [
3208
- /* @__PURE__ */ jsx22(Divider2, { sx: { mb: 2 } }),
3209
- /* @__PURE__ */ jsx22(Typography14, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
3210
- /* @__PURE__ */ jsx22(
3211
- Box14,
3235
+ executionLog.length > 0 && /* @__PURE__ */ jsxs13(Box15, { sx: { mt: 3 }, children: [
3236
+ /* @__PURE__ */ jsx21(Divider2, { sx: { mb: 2 } }),
3237
+ /* @__PURE__ */ jsx21(Typography13, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
3238
+ /* @__PURE__ */ jsx21(
3239
+ Box15,
3212
3240
  {
3213
3241
  sx: {
3214
3242
  bgcolor: "grey.100",
@@ -3221,8 +3249,8 @@ var ProcedureForm = () => {
3221
3249
  fontSize: "0.75rem",
3222
3250
  whiteSpace: "pre-wrap"
3223
3251
  },
3224
- children: executionLog.map((log, index) => /* @__PURE__ */ jsx22(
3225
- Typography14,
3252
+ children: executionLog.map((log, index) => /* @__PURE__ */ jsx21(
3253
+ Typography13,
3226
3254
  {
3227
3255
  component: "pre",
3228
3256
  sx: {
@@ -3249,7 +3277,7 @@ import { PersistGate } from "redux-persist/integration/react";
3249
3277
  // src/components/PrivateRoute.tsx
3250
3278
  import { useEffect as useEffect5 } from "react";
3251
3279
  import { Navigate, useLocation as useLocation2 } from "react-router-dom";
3252
- import { Fragment as Fragment3, jsx as jsx23 } from "react/jsx-runtime";
3280
+ import { Fragment as Fragment3, jsx as jsx22 } from "react/jsx-runtime";
3253
3281
  var PrivateRoute = ({ children }) => {
3254
3282
  const location = useLocation2();
3255
3283
  const dispatch = useAppDispatch();
@@ -3273,14 +3301,14 @@ var PrivateRoute = ({ children }) => {
3273
3301
  }, [isAuthenticated, isLoadingAuth, location, dispatch, clientContextStatus]);
3274
3302
  if (isLoadingAuth) {
3275
3303
  console.log(`[PrivateRoute] Returning loading state...`);
3276
- return /* @__PURE__ */ jsx23("p", { children: "Verificando autenticaci\xF3n..." });
3304
+ return /* @__PURE__ */ jsx22("p", { children: "Verificando autenticaci\xF3n..." });
3277
3305
  }
3278
3306
  if (!isAuthenticated) {
3279
3307
  console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
3280
- return /* @__PURE__ */ jsx23(Navigate, { to: "/login", replace: true });
3308
+ return /* @__PURE__ */ jsx22(Navigate, { to: "/login", replace: true });
3281
3309
  }
3282
3310
  console.log(`[PrivateRoute] User authenticated, rendering children.`);
3283
- return /* @__PURE__ */ jsx23(Fragment3, { children });
3311
+ return /* @__PURE__ */ jsx22(Fragment3, { children });
3284
3312
  };
3285
3313
  var PrivateRoute_default = PrivateRoute;
3286
3314
 
@@ -3314,25 +3342,25 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
3314
3342
 
3315
3343
  // src/pages/GenericDataGridPage.tsx
3316
3344
  import { useParams as useParams2 } from "react-router-dom";
3317
- import { Box as Box15, Alert as Alert4, Typography as Typography15 } from "@mui/material";
3318
- import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
3345
+ import { Box as Box16, Alert as Alert4, Typography as Typography14 } from "@mui/material";
3346
+ import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
3319
3347
  var GenericDataGridPage = () => {
3320
3348
  const { tableName } = useParams2();
3321
3349
  if (!tableName) {
3322
- return /* @__PURE__ */ jsx24(Box15, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs14(Alert4, { severity: "error", children: [
3323
- /* @__PURE__ */ jsx24(Typography15, { variant: "h6", children: "Error: Nombre de tabla no especificado en la URL." }),
3324
- /* @__PURE__ */ jsx24(Typography15, { variant: "body1", children: "Por favor, aseg\xFArate de que la URL contenga el nombre de la tabla (ej. `/data/users`)." })
3350
+ return /* @__PURE__ */ jsx23(Box16, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs14(Alert4, { severity: "error", children: [
3351
+ /* @__PURE__ */ jsx23(Typography14, { variant: "h6", children: "Error: Nombre de tabla no especificado en la URL." }),
3352
+ /* @__PURE__ */ jsx23(Typography14, { variant: "body1", children: "Por favor, aseg\xFArate de que la URL contenga el nombre de la tabla (ej. `/data/users`)." })
3325
3353
  ] }) });
3326
3354
  }
3327
- return /* @__PURE__ */ jsx24(GenericDataGrid_default, { tableName, fixedFields: [] });
3355
+ return /* @__PURE__ */ jsx23(GenericDataGrid_default, { tableName, fixedFields: [] });
3328
3356
  };
3329
3357
  var GenericDataGridPage_default = GenericDataGridPage;
3330
3358
 
3331
3359
  // src/pages/MenuTablePage.tsx
3332
3360
  import { useMemo as useMemo5 } from "react";
3333
3361
  import { useParams as useParams3 } from "react-router-dom";
3334
- import { Box as Box16, Alert as Alert5, Typography as Typography16 } from "@mui/material";
3335
- import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
3362
+ import { Box as Box17, Alert as Alert5, Typography as Typography15 } from "@mui/material";
3363
+ import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
3336
3364
  var MenuTablePage = () => {
3337
3365
  const { menuName } = useParams3();
3338
3366
  const { clientContext } = useApp();
@@ -3374,12 +3402,12 @@ var MenuTablePage = () => {
3374
3402
  };
3375
3403
  }, [menuName, clientContext]);
3376
3404
  if (!currentTableName) {
3377
- return /* @__PURE__ */ jsx25(Box16, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs15(Alert5, { severity: "error", children: [
3378
- /* @__PURE__ */ jsx25(Typography16, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
3379
- /* @__PURE__ */ jsx25(Typography16, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
3405
+ return /* @__PURE__ */ jsx24(Box17, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs15(Alert5, { severity: "error", children: [
3406
+ /* @__PURE__ */ jsx24(Typography15, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
3407
+ /* @__PURE__ */ jsx24(Typography15, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
3380
3408
  ] }) });
3381
3409
  }
3382
- return /* @__PURE__ */ jsx25(
3410
+ return /* @__PURE__ */ jsx24(
3383
3411
  GenericDataGrid_default,
3384
3412
  {
3385
3413
  tableName: currentTableName,
@@ -3389,8 +3417,42 @@ var MenuTablePage = () => {
3389
3417
  };
3390
3418
  var MenuTablePage_default = MenuTablePage;
3391
3419
 
3420
+ // src/pages/WScreens.tsx
3421
+ import { Box as Box18, Typography as Typography16, Paper as Paper3 } from "@mui/material";
3422
+ import ConstructionIcon from "@mui/icons-material/Construction";
3423
+ import WarningAmberIcon3 from "@mui/icons-material/WarningAmber";
3424
+ import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
3425
+ var MyCustomDashboard = ({ screenName }) => {
3426
+ return /* @__PURE__ */ jsx25(Box18, { sx: { p: 4, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsxs16(Paper3, { elevation: 3, sx: { p: 4, textAlign: "center", maxWidth: 600 }, children: [
3427
+ /* @__PURE__ */ jsxs16(Typography16, { variant: "h5", component: "h1", gutterBottom: true, children: [
3428
+ "\xA1Bienvenido a tu WScreen: ",
3429
+ screenName,
3430
+ "!"
3431
+ ] }),
3432
+ /* @__PURE__ */ jsx25(Typography16, { variant: "body1", color: "text.secondary", children: "Esta es una pantalla de interfaz de usuario personalizada." }),
3433
+ /* @__PURE__ */ jsx25(Box18, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx25(ConstructionIcon, { sx: { fontSize: 80, color: "primary.main" } }) })
3434
+ ] }) });
3435
+ };
3436
+ var FallbackWScreen = ({ screenName }) => {
3437
+ return /* @__PURE__ */ jsx25(Box18, { sx: { p: 4, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsxs16(Paper3, { elevation: 3, sx: { p: 4, textAlign: "center", maxWidth: 600, backgroundColor: "warning.light", border: "1px solid orange" }, children: [
3438
+ /* @__PURE__ */ jsx25(Typography16, { variant: "h5", component: "h1", gutterBottom: true, color: "warning.dark", children: "WScreen No Implementada" }),
3439
+ /* @__PURE__ */ jsxs16(Typography16, { variant: "body1", color: "warning.dark", children: [
3440
+ 'No se encontr\xF3 un componente implementado para la **WScreen**: **`"$',
3441
+ screenName,
3442
+ '"`**. 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.'
3443
+ ] }),
3444
+ /* @__PURE__ */ jsx25(Box18, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx25(WarningAmberIcon3, { sx: { fontSize: 80, color: "warning.dark" } }) })
3445
+ ] }) });
3446
+ };
3447
+ var wScreens = {
3448
+ "MyCustomDashboard": MyCustomDashboard
3449
+ // Agrega más componentes de wScreen aquí:
3450
+ // 'AnotherWScreen': AnotherWScreenComponent,
3451
+ };
3452
+ var WScreens_default = FallbackWScreen;
3453
+
3392
3454
  // src/App.tsx
3393
- import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
3455
+ import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
3394
3456
  var LocationTracker = () => {
3395
3457
  const location = useLocation4();
3396
3458
  const dispatch = useAppDispatch();
@@ -3399,14 +3461,14 @@ var LocationTracker = () => {
3399
3461
  }, [location, dispatch]);
3400
3462
  return null;
3401
3463
  };
3402
- function FrontendPlusReactRoutes({ myRoutes, myWScreens }) {
3464
+ function FrontendPlusReactRoutes({ myRoutes, allWScreens: myWScreens }) {
3403
3465
  const allWScreens = { ...wScreens, ...myWScreens || {} };
3404
- return /* @__PURE__ */ jsxs16(Routes, { children: [
3466
+ return /* @__PURE__ */ jsxs17(Routes, { children: [
3405
3467
  /* @__PURE__ */ jsx26(Route, { path: "/login", element: /* @__PURE__ */ jsx26(LoginPage_default, {}) }),
3406
3468
  /* @__PURE__ */ jsx26(Route, { path: "/logout", element: /* @__PURE__ */ jsx26(LogoutPage_default, {}) }),
3407
- /* @__PURE__ */ jsxs16(Route, { element: /* @__PURE__ */ jsxs16(PrivateRoute_default, { children: [
3469
+ /* @__PURE__ */ jsxs17(Route, { element: /* @__PURE__ */ jsxs17(PrivateRoute_default, { children: [
3408
3470
  /* @__PURE__ */ jsx26(InitialRedirectHandler_default, {}),
3409
- /* @__PURE__ */ jsx26(MainLayout_default, {})
3471
+ /* @__PURE__ */ jsx26(MainLayout_default, { allWScreens })
3410
3472
  ] }), children: [
3411
3473
  /* @__PURE__ */ jsx26(Route, { path: "/", element: /* @__PURE__ */ jsx26(HomePage_default, {}) }),
3412
3474
  /* @__PURE__ */ jsx26(Route, { path: "/home", element: /* @__PURE__ */ jsx26(HomePage_default, {}) }),
@@ -3417,7 +3479,7 @@ function FrontendPlusReactRoutes({ myRoutes, myWScreens }) {
3417
3479
  Route,
3418
3480
  {
3419
3481
  path: `/wScreens/${screenName}`,
3420
- element: React11.createElement(wScreens[screenName], { screenName })
3482
+ element: React11.createElement(allWScreens[screenName], { screenName })
3421
3483
  },
3422
3484
  screenName
3423
3485
  )),
@@ -3448,14 +3510,14 @@ var App = ({
3448
3510
  extendResultsOk(myResultsOk);
3449
3511
  }
3450
3512
  }, [myClientSides, myResultsOk]);
3451
- return /* @__PURE__ */ jsx26(Provider, { store, children: /* @__PURE__ */ jsx26(PersistGate, { loading: null, persistor, children: /* @__PURE__ */ jsxs16(BrowserRouter, { children: [
3513
+ return /* @__PURE__ */ jsx26(Provider, { store, children: /* @__PURE__ */ jsx26(PersistGate, { loading: null, persistor, children: /* @__PURE__ */ jsxs17(BrowserRouter, { children: [
3452
3514
  /* @__PURE__ */ jsx26(LocationTracker, {}),
3453
- /* @__PURE__ */ jsx26(AppProvider, { children: /* @__PURE__ */ jsxs16(SnackbarProvider, { children: [
3515
+ /* @__PURE__ */ jsx26(AppProvider, { children: /* @__PURE__ */ jsxs17(SnackbarProvider, { children: [
3454
3516
  /* @__PURE__ */ jsx26(
3455
3517
  FrontendPlusReactRoutes,
3456
3518
  {
3457
3519
  myRoutes,
3458
- myWScreens
3520
+ allWScreens: myWScreens
3459
3521
  }
3460
3522
  ),
3461
3523
  /* @__PURE__ */ jsx26(SessionExpiredMessage_default, {})