frontend-plus-react 0.1.7 → 0.1.9
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 +64 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +200 -0
- package/dist/index.d.ts +200 -0
- package/dist/index.js +219 -209
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2151,10 +2151,10 @@ import { BrowserRouter, Routes, Route, useLocation as useLocation4, Navigate as
|
|
|
2151
2151
|
import { useEffect as useEffect3 } from "react";
|
|
2152
2152
|
import { Outlet } from "react-router-dom";
|
|
2153
2153
|
import {
|
|
2154
|
-
Box as
|
|
2154
|
+
Box as Box10,
|
|
2155
2155
|
AppBar,
|
|
2156
2156
|
Toolbar,
|
|
2157
|
-
Typography as
|
|
2157
|
+
Typography as Typography8,
|
|
2158
2158
|
Button as Button4,
|
|
2159
2159
|
Drawer,
|
|
2160
2160
|
CssBaseline,
|
|
@@ -2244,21 +2244,60 @@ import MenuIcon from "@mui/icons-material/Menu";
|
|
|
2244
2244
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
2245
2245
|
|
|
2246
2246
|
// src/components/SideMenu.tsx
|
|
2247
|
-
import { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Divider, Box as
|
|
2247
|
+
import { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Divider, Box as Box9, Typography as Typography7, Collapse } from "@mui/material";
|
|
2248
2248
|
import ExpandLess from "@mui/icons-material/ExpandLess";
|
|
2249
2249
|
import ExpandMore from "@mui/icons-material/ExpandMore";
|
|
2250
2250
|
import TableChartIcon from "@mui/icons-material/TableChart";
|
|
2251
2251
|
import FolderIcon from "@mui/icons-material/Folder";
|
|
2252
2252
|
import DnsIcon from "@mui/icons-material/Dns";
|
|
2253
2253
|
import HomeIcon from "@mui/icons-material/Home";
|
|
2254
|
-
import
|
|
2254
|
+
import WarningAmberIcon3 from "@mui/icons-material/WarningAmber";
|
|
2255
2255
|
import DesktopWindowsIcon from "@mui/icons-material/DesktopWindows";
|
|
2256
2256
|
import UnfoldMoreIcon from "@mui/icons-material/UnfoldMore";
|
|
2257
2257
|
import UnfoldLessIcon from "@mui/icons-material/UnfoldLess";
|
|
2258
2258
|
import { useNavigate as useNavigate2, useLocation } from "react-router-dom";
|
|
2259
2259
|
import { blue, orange, teal, red, grey } from "@mui/material/colors";
|
|
2260
|
-
|
|
2261
|
-
|
|
2260
|
+
|
|
2261
|
+
// src/pages/WScreens.tsx
|
|
2262
|
+
import { Box as Box8, Typography as Typography6, Paper } from "@mui/material";
|
|
2263
|
+
import ConstructionIcon from "@mui/icons-material/Construction";
|
|
2264
|
+
import WarningAmberIcon2 from "@mui/icons-material/WarningAmber";
|
|
2265
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2266
|
+
var MyCustomDashboard = ({ screenName }) => {
|
|
2267
|
+
return /* @__PURE__ */ jsx14(Box8, { sx: { p: 4, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsxs6(Paper, { elevation: 3, sx: { p: 4, textAlign: "center", maxWidth: 600 }, children: [
|
|
2268
|
+
/* @__PURE__ */ jsxs6(Typography6, { variant: "h5", component: "h1", gutterBottom: true, children: [
|
|
2269
|
+
"\xA1Bienvenido a tu WScreen: ",
|
|
2270
|
+
screenName,
|
|
2271
|
+
"!"
|
|
2272
|
+
] }),
|
|
2273
|
+
/* @__PURE__ */ jsx14(Typography6, { variant: "body1", color: "text.secondary", children: "Esta es una pantalla de interfaz de usuario personalizada." }),
|
|
2274
|
+
/* @__PURE__ */ jsx14(Box8, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx14(ConstructionIcon, { sx: { fontSize: 80, color: "primary.main" } }) })
|
|
2275
|
+
] }) });
|
|
2276
|
+
};
|
|
2277
|
+
var FallbackWScreen = ({ screenName }) => {
|
|
2278
|
+
return /* @__PURE__ */ jsx14(Box8, { sx: { p: 4, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsxs6(Paper, { elevation: 3, sx: { p: 4, textAlign: "center", maxWidth: 600, backgroundColor: "warning.light", border: "1px solid orange" }, children: [
|
|
2279
|
+
/* @__PURE__ */ jsx14(Typography6, { variant: "h5", component: "h1", gutterBottom: true, color: "warning.dark", children: "WScreen No Implementada" }),
|
|
2280
|
+
/* @__PURE__ */ jsxs6(Typography6, { variant: "body1", color: "warning.dark", children: [
|
|
2281
|
+
'No se encontr\xF3 un componente implementado para la **WScreen**: **`"$',
|
|
2282
|
+
screenName,
|
|
2283
|
+
'"`**. Por favor, verifica el `menuType` en la definici\xF3n del men\xFA o aseg\xFArate de que el componente est\xE9 correctamente importado y mapeado en el frontend.'
|
|
2284
|
+
] }),
|
|
2285
|
+
/* @__PURE__ */ jsx14(Box8, { sx: { mt: 3 }, children: /* @__PURE__ */ jsx14(WarningAmberIcon2, { sx: { fontSize: 80, color: "warning.dark" } }) })
|
|
2286
|
+
] }) });
|
|
2287
|
+
};
|
|
2288
|
+
var wScreens = {
|
|
2289
|
+
"MyCustomDashboard": MyCustomDashboard
|
|
2290
|
+
// Agrega más componentes de wScreen aquí:
|
|
2291
|
+
// 'AnotherWScreen': AnotherWScreenComponent,
|
|
2292
|
+
};
|
|
2293
|
+
var extendWScreens = (newWScreens) => {
|
|
2294
|
+
wScreens = { ...wScreens, ...newWScreens };
|
|
2295
|
+
console.log("wScreens extendidos:", wScreens);
|
|
2296
|
+
};
|
|
2297
|
+
|
|
2298
|
+
// src/components/SideMenu.tsx
|
|
2299
|
+
import { Fragment, jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2300
|
+
var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
2262
2301
|
const navigate = useNavigate2();
|
|
2263
2302
|
const location = useLocation();
|
|
2264
2303
|
const open = useSubMenuOpenState(item.name);
|
|
@@ -2279,7 +2318,7 @@ var MenuListItem = ({ item, level, onMenuItemClick, allWScreens }) => {
|
|
|
2279
2318
|
} else if (item.menuType === "proc") {
|
|
2280
2319
|
path = `/procedures/${item.name}`;
|
|
2281
2320
|
} else {
|
|
2282
|
-
const WScreenComponent =
|
|
2321
|
+
const WScreenComponent = wScreens[item.menuType];
|
|
2283
2322
|
if (WScreenComponent !== void 0) {
|
|
2284
2323
|
path = `/wScreens/${item.menuType}`;
|
|
2285
2324
|
} else {
|
|
@@ -2298,17 +2337,17 @@ var MenuListItem = ({ item, level, onMenuItemClick, allWScreens }) => {
|
|
|
2298
2337
|
const getIcon = (item2) => {
|
|
2299
2338
|
switch (item2.menuType) {
|
|
2300
2339
|
case "table":
|
|
2301
|
-
return /* @__PURE__ */
|
|
2340
|
+
return /* @__PURE__ */ jsx15(TableChartIcon, { sx: { color: blue[700] } });
|
|
2302
2341
|
case "proc":
|
|
2303
|
-
return /* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ jsx15(DnsIcon, { sx: { color: teal[700] } });
|
|
2304
2343
|
case "menu":
|
|
2305
|
-
return /* @__PURE__ */
|
|
2344
|
+
return /* @__PURE__ */ jsx15(FolderIcon, { sx: { color: orange[800] } });
|
|
2306
2345
|
default:
|
|
2307
|
-
const WScreenComponent =
|
|
2346
|
+
const WScreenComponent = wScreens[item2.menuType];
|
|
2308
2347
|
if (WScreenComponent !== void 0) {
|
|
2309
|
-
return /* @__PURE__ */
|
|
2348
|
+
return /* @__PURE__ */ jsx15(DesktopWindowsIcon, { sx: { color: grey[700] } });
|
|
2310
2349
|
}
|
|
2311
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ jsx15(WarningAmberIcon3, { sx: { color: red[500] } });
|
|
2312
2351
|
}
|
|
2313
2352
|
};
|
|
2314
2353
|
const currentPath = location.pathname;
|
|
@@ -2320,33 +2359,32 @@ var MenuListItem = ({ item, level, onMenuItemClick, allWScreens }) => {
|
|
|
2320
2359
|
} else {
|
|
2321
2360
|
isSelected = currentPath.startsWith(`/wScreens/${item.menuType}`) || currentPath.startsWith(`/wScreens-fallback/${item.menuType}`);
|
|
2322
2361
|
}
|
|
2323
|
-
return /* @__PURE__ */
|
|
2324
|
-
/* @__PURE__ */
|
|
2362
|
+
return /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
2363
|
+
/* @__PURE__ */ jsxs7(
|
|
2325
2364
|
ListItemButton,
|
|
2326
2365
|
{
|
|
2327
2366
|
onClick: handleClick,
|
|
2328
2367
|
sx: { pl: level * 2 },
|
|
2329
2368
|
selected: isSelected,
|
|
2330
2369
|
children: [
|
|
2331
|
-
/* @__PURE__ */
|
|
2332
|
-
/* @__PURE__ */
|
|
2333
|
-
item.menuType === "menu" ? open ? /* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: getIcon(item) }),
|
|
2371
|
+
/* @__PURE__ */ jsx15(ListItemText, { primary: item.label || item.name }),
|
|
2372
|
+
item.menuType === "menu" ? open ? /* @__PURE__ */ jsx15(ExpandLess, {}) : /* @__PURE__ */ jsx15(ExpandMore, {}) : null
|
|
2334
2373
|
]
|
|
2335
2374
|
}
|
|
2336
2375
|
),
|
|
2337
|
-
item.menuType === "menu" && /* @__PURE__ */
|
|
2376
|
+
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(
|
|
2338
2377
|
MenuListItem,
|
|
2339
2378
|
{
|
|
2340
2379
|
item: subItem,
|
|
2341
2380
|
level: level + 1,
|
|
2342
|
-
onMenuItemClick
|
|
2343
|
-
allWScreens
|
|
2381
|
+
onMenuItemClick
|
|
2344
2382
|
},
|
|
2345
2383
|
subItem.name
|
|
2346
2384
|
)) }) })
|
|
2347
2385
|
] });
|
|
2348
2386
|
};
|
|
2349
|
-
var SideMenu = ({ onMenuItemClick
|
|
2387
|
+
var SideMenu = ({ onMenuItemClick }) => {
|
|
2350
2388
|
const { clientContext } = useApp();
|
|
2351
2389
|
const navigate = useNavigate2();
|
|
2352
2390
|
const location = useLocation();
|
|
@@ -2365,28 +2403,27 @@ var SideMenu = ({ onMenuItemClick, allWScreens }) => {
|
|
|
2365
2403
|
dispatch(setAllSubMenusOpen(!isMostlyOpen));
|
|
2366
2404
|
};
|
|
2367
2405
|
if (!clientContext || !clientContext.menu) {
|
|
2368
|
-
return /* @__PURE__ */
|
|
2406
|
+
return /* @__PURE__ */ jsx15(Box9, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx15(Typography7, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
|
|
2369
2407
|
}
|
|
2370
2408
|
const isHomeSelected = location.pathname === "/home";
|
|
2371
|
-
return /* @__PURE__ */
|
|
2372
|
-
clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */
|
|
2373
|
-
/* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2409
|
+
return /* @__PURE__ */ jsxs7(Box9, { sx: { width: "100%", flexShrink: 0 }, children: [
|
|
2410
|
+
clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs7(ListItemButton, { onClick: handleToggleAllSubMenus, children: [
|
|
2411
|
+
/* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: isMostlyOpen ? /* @__PURE__ */ jsx15(UnfoldLessIcon, {}) : /* @__PURE__ */ jsx15(UnfoldMoreIcon, {}) }),
|
|
2412
|
+
/* @__PURE__ */ jsx15(ListItemText, { primary: isMostlyOpen ? "colapsar " : "expandir" })
|
|
2375
2413
|
] }) }),
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
2378
|
-
/* @__PURE__ */
|
|
2379
|
-
/* @__PURE__ */
|
|
2380
|
-
/* @__PURE__ */
|
|
2414
|
+
/* @__PURE__ */ jsx15(Divider, {}),
|
|
2415
|
+
/* @__PURE__ */ jsxs7(List, { children: [
|
|
2416
|
+
/* @__PURE__ */ jsx15(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs7(ListItemButton, { onClick: handleHomeClick, selected: isHomeSelected, children: [
|
|
2417
|
+
/* @__PURE__ */ jsx15(ListItemIcon, { sx: { minWidth: "38px" }, children: /* @__PURE__ */ jsx15(HomeIcon, {}) }),
|
|
2418
|
+
/* @__PURE__ */ jsx15(ListItemText, { primary: "Inicio" })
|
|
2381
2419
|
] }) }),
|
|
2382
|
-
/* @__PURE__ */
|
|
2383
|
-
clientContext.menu.map((menuItem) => /* @__PURE__ */
|
|
2420
|
+
/* @__PURE__ */ jsx15(Divider, {}),
|
|
2421
|
+
clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx15(
|
|
2384
2422
|
MenuListItem,
|
|
2385
2423
|
{
|
|
2386
2424
|
item: menuItem,
|
|
2387
2425
|
level: 1,
|
|
2388
|
-
onMenuItemClick
|
|
2389
|
-
allWScreens
|
|
2426
|
+
onMenuItemClick
|
|
2390
2427
|
},
|
|
2391
2428
|
menuItem.name
|
|
2392
2429
|
))
|
|
@@ -2424,10 +2461,9 @@ var useLogout = () => {
|
|
|
2424
2461
|
var useLogout_default = useLogout;
|
|
2425
2462
|
|
|
2426
2463
|
// src/components/MainLayout.tsx
|
|
2427
|
-
import { jsx as
|
|
2464
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2428
2465
|
var drawerWidth = 240;
|
|
2429
|
-
var MainLayout = (
|
|
2430
|
-
const { allWScreens } = props;
|
|
2466
|
+
var MainLayout = () => {
|
|
2431
2467
|
const { clientContext } = useApp();
|
|
2432
2468
|
const logout = useLogout_default();
|
|
2433
2469
|
const isDrawerOpen = useIsDrawerOpen();
|
|
@@ -2448,12 +2484,12 @@ var MainLayout = (props) => {
|
|
|
2448
2484
|
}
|
|
2449
2485
|
};
|
|
2450
2486
|
if (!clientContext) {
|
|
2451
|
-
return /* @__PURE__ */
|
|
2487
|
+
return /* @__PURE__ */ jsx16(Box10, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx16(Typography8, { children: "Cargando dise\xF1o de la aplicaci\xF3n..." }) });
|
|
2452
2488
|
}
|
|
2453
2489
|
const appBarOffset = theme.mixins.toolbar;
|
|
2454
|
-
return /* @__PURE__ */
|
|
2455
|
-
/* @__PURE__ */
|
|
2456
|
-
/* @__PURE__ */
|
|
2490
|
+
return /* @__PURE__ */ jsxs8(Box10, { sx: { display: "flex", height: "100vh" }, children: [
|
|
2491
|
+
/* @__PURE__ */ jsx16(CssBaseline, {}),
|
|
2492
|
+
/* @__PURE__ */ jsx16(
|
|
2457
2493
|
AppBar,
|
|
2458
2494
|
{
|
|
2459
2495
|
position: "fixed",
|
|
@@ -2472,8 +2508,8 @@ var MainLayout = (props) => {
|
|
|
2472
2508
|
})
|
|
2473
2509
|
}
|
|
2474
2510
|
},
|
|
2475
|
-
children: /* @__PURE__ */
|
|
2476
|
-
/* @__PURE__ */
|
|
2511
|
+
children: /* @__PURE__ */ jsxs8(Toolbar, { children: [
|
|
2512
|
+
/* @__PURE__ */ jsx16(
|
|
2477
2513
|
IconButton3,
|
|
2478
2514
|
{
|
|
2479
2515
|
color: "inherit",
|
|
@@ -2483,24 +2519,24 @@ var MainLayout = (props) => {
|
|
|
2483
2519
|
sx: {
|
|
2484
2520
|
marginRight: 2.2
|
|
2485
2521
|
},
|
|
2486
|
-
children: isDrawerOpen ? /* @__PURE__ */
|
|
2522
|
+
children: isDrawerOpen ? /* @__PURE__ */ jsx16(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx16(MenuIcon, {})
|
|
2487
2523
|
}
|
|
2488
2524
|
),
|
|
2489
|
-
/* @__PURE__ */
|
|
2490
|
-
/* @__PURE__ */
|
|
2491
|
-
/* @__PURE__ */
|
|
2525
|
+
/* @__PURE__ */ jsx16(Typography8, { variant: "h6", noWrap: true, component: "div", sx: { flexGrow: 1 }, children: isDrawerOpen ? "" : clientContext.config.title }),
|
|
2526
|
+
/* @__PURE__ */ jsx16(Typography8, { variant: "subtitle1", component: "div", sx: { mr: 2 }, children: clientContext.username }),
|
|
2527
|
+
/* @__PURE__ */ jsx16(
|
|
2492
2528
|
Button4,
|
|
2493
2529
|
{
|
|
2494
2530
|
color: "inherit",
|
|
2495
2531
|
onClick: logout,
|
|
2496
|
-
startIcon: /* @__PURE__ */
|
|
2532
|
+
startIcon: /* @__PURE__ */ jsx16(LogoutIcon, {}),
|
|
2497
2533
|
children: "Salir"
|
|
2498
2534
|
}
|
|
2499
2535
|
)
|
|
2500
2536
|
] })
|
|
2501
2537
|
}
|
|
2502
2538
|
),
|
|
2503
|
-
/* @__PURE__ */
|
|
2539
|
+
/* @__PURE__ */ jsxs8(
|
|
2504
2540
|
Drawer,
|
|
2505
2541
|
{
|
|
2506
2542
|
variant: "persistent",
|
|
@@ -2517,7 +2553,7 @@ var MainLayout = (props) => {
|
|
|
2517
2553
|
}
|
|
2518
2554
|
},
|
|
2519
2555
|
children: [
|
|
2520
|
-
/* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ jsx16(
|
|
2521
2557
|
Toolbar,
|
|
2522
2558
|
{
|
|
2523
2559
|
sx: {
|
|
@@ -2531,12 +2567,12 @@ var MainLayout = (props) => {
|
|
|
2531
2567
|
children: isDrawerOpen ? clientContext.config.title : ""
|
|
2532
2568
|
}
|
|
2533
2569
|
),
|
|
2534
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ jsx16(SideMenu_default, { onMenuItemClick: handleDrawerCloseMobile })
|
|
2535
2571
|
]
|
|
2536
2572
|
}
|
|
2537
2573
|
),
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
|
|
2574
|
+
/* @__PURE__ */ jsx16(
|
|
2575
|
+
Box10,
|
|
2540
2576
|
{
|
|
2541
2577
|
component: "main",
|
|
2542
2578
|
sx: {
|
|
@@ -2563,7 +2599,7 @@ var MainLayout = (props) => {
|
|
|
2563
2599
|
flexDirection: "column",
|
|
2564
2600
|
width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
|
|
2565
2601
|
},
|
|
2566
|
-
children: /* @__PURE__ */
|
|
2602
|
+
children: /* @__PURE__ */ jsx16(Outlet, {})
|
|
2567
2603
|
}
|
|
2568
2604
|
)
|
|
2569
2605
|
] });
|
|
@@ -2571,9 +2607,9 @@ var MainLayout = (props) => {
|
|
|
2571
2607
|
var MainLayout_default = MainLayout;
|
|
2572
2608
|
|
|
2573
2609
|
// src/components/SessionExpiredMessage.tsx
|
|
2574
|
-
import { Box as
|
|
2610
|
+
import { Box as Box11, Typography as Typography9, Button as Button5, Modal } from "@mui/material";
|
|
2575
2611
|
import { useNavigate as useNavigate4 } from "react-router-dom";
|
|
2576
|
-
import { jsx as
|
|
2612
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2577
2613
|
var style = {
|
|
2578
2614
|
position: "absolute",
|
|
2579
2615
|
top: "50%",
|
|
@@ -2595,7 +2631,7 @@ var SessionExpiredMessage = () => {
|
|
|
2595
2631
|
setIsLoggedIn(false);
|
|
2596
2632
|
navigate("/login", { replace: true });
|
|
2597
2633
|
};
|
|
2598
|
-
return /* @__PURE__ */
|
|
2634
|
+
return /* @__PURE__ */ jsx17(
|
|
2599
2635
|
Modal,
|
|
2600
2636
|
{
|
|
2601
2637
|
open: showSessionExpiredMessage,
|
|
@@ -2615,10 +2651,10 @@ var SessionExpiredMessage = () => {
|
|
|
2615
2651
|
}
|
|
2616
2652
|
}
|
|
2617
2653
|
},
|
|
2618
|
-
children: /* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */
|
|
2620
|
-
/* @__PURE__ */
|
|
2621
|
-
/* @__PURE__ */
|
|
2654
|
+
children: /* @__PURE__ */ jsxs9(Box11, { sx: style, children: [
|
|
2655
|
+
/* @__PURE__ */ jsx17(Typography9, { id: "session-expired-modal-title", variant: "h6", component: "h2", gutterBottom: true, children: "\xA1Sesi\xF3n Expirada!" }),
|
|
2656
|
+
/* @__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." }),
|
|
2657
|
+
/* @__PURE__ */ jsx17(Button5, { variant: "contained", color: "primary", onClick: handleClose, children: "Ir al Login" })
|
|
2622
2658
|
] })
|
|
2623
2659
|
}
|
|
2624
2660
|
);
|
|
@@ -2626,27 +2662,27 @@ var SessionExpiredMessage = () => {
|
|
|
2626
2662
|
var SessionExpiredMessage_default = SessionExpiredMessage;
|
|
2627
2663
|
|
|
2628
2664
|
// src/pages/HomePage.tsx
|
|
2629
|
-
import { Box as
|
|
2630
|
-
import { jsx as
|
|
2665
|
+
import { Box as Box12, Typography as Typography10 } from "@mui/material";
|
|
2666
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2631
2667
|
var HomePage = () => {
|
|
2632
2668
|
const { clientContext } = useApp();
|
|
2633
|
-
return /* @__PURE__ */
|
|
2634
|
-
/* @__PURE__ */
|
|
2635
|
-
/* @__PURE__ */
|
|
2669
|
+
return /* @__PURE__ */ jsxs10(Box12, { sx: { p: 3 }, children: [
|
|
2670
|
+
/* @__PURE__ */ jsx18(Typography10, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${clientContext?.username}` }),
|
|
2671
|
+
/* @__PURE__ */ jsx18(Typography10, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
|
|
2636
2672
|
] });
|
|
2637
2673
|
};
|
|
2638
2674
|
var HomePage_default = HomePage;
|
|
2639
2675
|
|
|
2640
2676
|
// src/pages/LogoutPage.tsx
|
|
2641
2677
|
import { useEffect as useEffect4 } from "react";
|
|
2642
|
-
import { Box as
|
|
2643
|
-
import { jsx as
|
|
2678
|
+
import { Box as Box13, Typography as Typography11, CircularProgress as CircularProgress2 } from "@mui/material";
|
|
2679
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2644
2680
|
var LogoutPage = () => {
|
|
2645
2681
|
const logout = useLogout_default();
|
|
2646
2682
|
useEffect4(() => {
|
|
2647
2683
|
logout();
|
|
2648
2684
|
}, [logout]);
|
|
2649
|
-
return /* @__PURE__ */
|
|
2685
|
+
return /* @__PURE__ */ jsxs11(Box13, { sx: {
|
|
2650
2686
|
display: "flex",
|
|
2651
2687
|
flexDirection: "column",
|
|
2652
2688
|
justifyContent: "center",
|
|
@@ -2654,21 +2690,21 @@ var LogoutPage = () => {
|
|
|
2654
2690
|
height: "100vh",
|
|
2655
2691
|
textAlign: "center"
|
|
2656
2692
|
}, children: [
|
|
2657
|
-
/* @__PURE__ */
|
|
2658
|
-
/* @__PURE__ */
|
|
2693
|
+
/* @__PURE__ */ jsx19(CircularProgress2, { size: 60 }),
|
|
2694
|
+
/* @__PURE__ */ jsx19(Typography11, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
|
|
2659
2695
|
] });
|
|
2660
2696
|
};
|
|
2661
2697
|
var LogoutPage_default = LogoutPage;
|
|
2662
2698
|
|
|
2663
2699
|
// src/pages/LoginPage.tsx
|
|
2664
2700
|
import { useState as useState6 } from "react";
|
|
2665
|
-
import { Button as Button6, TextField, Typography as
|
|
2701
|
+
import { Button as Button6, TextField, Typography as Typography12, Alert as Alert2, AlertTitle, Box as Box14, CircularProgress as CircularProgress3 } from "@mui/material";
|
|
2666
2702
|
import { useForm, Controller } from "react-hook-form";
|
|
2667
2703
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
2668
2704
|
import * as z from "zod";
|
|
2669
2705
|
import { useNavigate as useNavigate5 } from "react-router-dom";
|
|
2670
2706
|
import { useDispatch as useDispatch4 } from "react-redux";
|
|
2671
|
-
import { Fragment as Fragment2, jsx as
|
|
2707
|
+
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2672
2708
|
var loginSchema = z.object({
|
|
2673
2709
|
username: z.string().min(1, "El usuario es requerido"),
|
|
2674
2710
|
// Añadir validación básica
|
|
@@ -2724,16 +2760,16 @@ var LoginPage = () => {
|
|
|
2724
2760
|
setIsSubmitting(false);
|
|
2725
2761
|
}
|
|
2726
2762
|
};
|
|
2727
|
-
return /* @__PURE__ */
|
|
2728
|
-
|
|
2763
|
+
return /* @__PURE__ */ jsx20(
|
|
2764
|
+
Box14,
|
|
2729
2765
|
{
|
|
2730
2766
|
display: "flex",
|
|
2731
2767
|
alignItems: "center",
|
|
2732
2768
|
justifyContent: "center",
|
|
2733
2769
|
minHeight: "100vh",
|
|
2734
2770
|
bgcolor: "#f5f5f5",
|
|
2735
|
-
children: /* @__PURE__ */
|
|
2736
|
-
|
|
2771
|
+
children: /* @__PURE__ */ jsxs12(
|
|
2772
|
+
Box14,
|
|
2737
2773
|
{
|
|
2738
2774
|
width: "100%",
|
|
2739
2775
|
maxWidth: "400px",
|
|
@@ -2742,16 +2778,16 @@ var LoginPage = () => {
|
|
|
2742
2778
|
borderRadius: 8,
|
|
2743
2779
|
boxShadow: 3,
|
|
2744
2780
|
children: [
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
/* @__PURE__ */
|
|
2747
|
-
/* @__PURE__ */
|
|
2748
|
-
/* @__PURE__ */
|
|
2749
|
-
/* @__PURE__ */
|
|
2781
|
+
/* @__PURE__ */ jsx20(Typography12, { variant: "h5", align: "center", gutterBottom: true, children: "Iniciar Sesi\xF3n" }),
|
|
2782
|
+
/* @__PURE__ */ jsxs12("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
2783
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
|
2784
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "username", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
|
|
2785
|
+
/* @__PURE__ */ jsx20(
|
|
2750
2786
|
Controller,
|
|
2751
2787
|
{
|
|
2752
2788
|
name: "username",
|
|
2753
2789
|
control,
|
|
2754
|
-
render: ({ field }) => /* @__PURE__ */
|
|
2790
|
+
render: ({ field }) => /* @__PURE__ */ jsx20(
|
|
2755
2791
|
TextField,
|
|
2756
2792
|
{
|
|
2757
2793
|
...field,
|
|
@@ -2767,14 +2803,14 @@ var LoginPage = () => {
|
|
|
2767
2803
|
}
|
|
2768
2804
|
)
|
|
2769
2805
|
] }),
|
|
2770
|
-
/* @__PURE__ */
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2806
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
|
2807
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "password", children: /* @__PURE__ */ jsx20(Typography12, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
|
|
2808
|
+
/* @__PURE__ */ jsx20(
|
|
2773
2809
|
Controller,
|
|
2774
2810
|
{
|
|
2775
2811
|
name: "password",
|
|
2776
2812
|
control,
|
|
2777
|
-
render: ({ field }) => /* @__PURE__ */
|
|
2813
|
+
render: ({ field }) => /* @__PURE__ */ jsx20(
|
|
2778
2814
|
TextField,
|
|
2779
2815
|
{
|
|
2780
2816
|
...field,
|
|
@@ -2790,14 +2826,14 @@ var LoginPage = () => {
|
|
|
2790
2826
|
}
|
|
2791
2827
|
)
|
|
2792
2828
|
] }),
|
|
2793
|
-
/* @__PURE__ */
|
|
2794
|
-
/* @__PURE__ */
|
|
2829
|
+
/* @__PURE__ */ jsx20(Button6, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
2830
|
+
/* @__PURE__ */ jsx20(CircularProgress3, { size: 20, sx: { mr: 1 } }),
|
|
2795
2831
|
"Iniciando sesi\xF3n..."
|
|
2796
2832
|
] }) : "Iniciar Sesi\xF3n" })
|
|
2797
2833
|
] }),
|
|
2798
|
-
loginError && /* @__PURE__ */
|
|
2834
|
+
loginError && /* @__PURE__ */ jsxs12(Alert2, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
|
|
2799
2835
|
" ",
|
|
2800
|
-
/* @__PURE__ */
|
|
2836
|
+
/* @__PURE__ */ jsx20(AlertTitle, { children: "Error" }),
|
|
2801
2837
|
loginError
|
|
2802
2838
|
] })
|
|
2803
2839
|
]
|
|
@@ -2821,23 +2857,23 @@ import {
|
|
|
2821
2857
|
Checkbox,
|
|
2822
2858
|
FormControlLabel,
|
|
2823
2859
|
FormHelperText,
|
|
2824
|
-
Typography as
|
|
2825
|
-
Box as
|
|
2860
|
+
Typography as Typography14,
|
|
2861
|
+
Box as Box16,
|
|
2826
2862
|
CircularProgress as CircularProgress4,
|
|
2827
2863
|
Alert as Alert3,
|
|
2828
2864
|
Divider as Divider2,
|
|
2829
|
-
Paper as
|
|
2865
|
+
Paper as Paper3
|
|
2830
2866
|
} from "@mui/material";
|
|
2831
2867
|
|
|
2832
2868
|
// src/pages/procedure-results/SuccessDisplay.tsx
|
|
2833
|
-
import { Box as
|
|
2834
|
-
import { jsx as
|
|
2869
|
+
import { Box as Box15, Typography as Typography13, Paper as Paper2 } from "@mui/material";
|
|
2870
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2835
2871
|
var SuccessDisplay = ({ data }) => {
|
|
2836
|
-
return /* @__PURE__ */
|
|
2837
|
-
/* @__PURE__ */
|
|
2838
|
-
/* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */
|
|
2840
|
-
/* @__PURE__ */
|
|
2872
|
+
return /* @__PURE__ */ jsxs13(Paper2, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
|
|
2873
|
+
/* @__PURE__ */ jsx21(Typography13, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
|
|
2874
|
+
/* @__PURE__ */ jsx21(Typography13, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
|
|
2875
|
+
/* @__PURE__ */ jsx21(Box15, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ jsx21("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
|
|
2876
|
+
/* @__PURE__ */ jsx21(Typography13, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
|
|
2841
2877
|
] });
|
|
2842
2878
|
};
|
|
2843
2879
|
var SuccessDisplay_default = SuccessDisplay;
|
|
@@ -2851,7 +2887,7 @@ var extendResultsOk = (newComponents) => {
|
|
|
2851
2887
|
};
|
|
2852
2888
|
|
|
2853
2889
|
// src/components/ProcedureForm.tsx
|
|
2854
|
-
import { jsx as
|
|
2890
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2855
2891
|
var ProcedureForm = () => {
|
|
2856
2892
|
const { procedureName } = useParams();
|
|
2857
2893
|
const { clientContext } = useApp();
|
|
@@ -3066,9 +3102,9 @@ var ProcedureForm = () => {
|
|
|
3066
3102
|
sx: { fontSize: "0.8rem" }
|
|
3067
3103
|
};
|
|
3068
3104
|
if (param.options && param.options.length > 0) {
|
|
3069
|
-
return /* @__PURE__ */
|
|
3070
|
-
/* @__PURE__ */
|
|
3071
|
-
/* @__PURE__ */
|
|
3105
|
+
return /* @__PURE__ */ jsxs14(FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
|
|
3106
|
+
/* @__PURE__ */ jsx22(InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
|
|
3107
|
+
/* @__PURE__ */ jsxs14(
|
|
3072
3108
|
Select,
|
|
3073
3109
|
{
|
|
3074
3110
|
labelId: `${param.name}-label`,
|
|
@@ -3079,14 +3115,14 @@ var ProcedureForm = () => {
|
|
|
3079
3115
|
label: param.label || param.name,
|
|
3080
3116
|
disabled: apiLoading,
|
|
3081
3117
|
sx: { fontSize: "0.8rem" },
|
|
3082
|
-
renderValue: (selected) => /* @__PURE__ */
|
|
3118
|
+
renderValue: (selected) => /* @__PURE__ */ jsx22(Typography14, { sx: { fontSize: "0.8rem" }, children: selected }),
|
|
3083
3119
|
children: [
|
|
3084
|
-
(!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */
|
|
3085
|
-
param.options.map((option) => /* @__PURE__ */
|
|
3120
|
+
(!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ jsx22(MenuItem, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ jsx22("em", { children: "Seleccione..." }) }),
|
|
3121
|
+
param.options.map((option) => /* @__PURE__ */ jsx22(MenuItem, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
|
|
3086
3122
|
]
|
|
3087
3123
|
}
|
|
3088
3124
|
),
|
|
3089
|
-
(param.description || errorMessage) && /* @__PURE__ */
|
|
3125
|
+
(param.description || errorMessage) && /* @__PURE__ */ jsx22(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
|
|
3090
3126
|
] });
|
|
3091
3127
|
}
|
|
3092
3128
|
switch (param.typeName) {
|
|
@@ -3095,18 +3131,18 @@ var ProcedureForm = () => {
|
|
|
3095
3131
|
case "tsrange":
|
|
3096
3132
|
case "time_range":
|
|
3097
3133
|
case "daterange":
|
|
3098
|
-
return /* @__PURE__ */
|
|
3134
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
|
|
3099
3135
|
case "decimal":
|
|
3100
3136
|
case "double":
|
|
3101
|
-
return /* @__PURE__ */
|
|
3137
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
|
|
3102
3138
|
case "integer":
|
|
3103
3139
|
case "bigint":
|
|
3104
|
-
return /* @__PURE__ */
|
|
3140
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
|
|
3105
3141
|
case "boolean":
|
|
3106
|
-
return /* @__PURE__ */
|
|
3142
|
+
return /* @__PURE__ */ jsx22(
|
|
3107
3143
|
FormControlLabel,
|
|
3108
3144
|
{
|
|
3109
|
-
control: /* @__PURE__ */
|
|
3145
|
+
control: /* @__PURE__ */ jsx22(
|
|
3110
3146
|
Checkbox,
|
|
3111
3147
|
{
|
|
3112
3148
|
checked: !!formValues[param.name],
|
|
@@ -3117,21 +3153,21 @@ var ProcedureForm = () => {
|
|
|
3117
3153
|
size: "small"
|
|
3118
3154
|
}
|
|
3119
3155
|
),
|
|
3120
|
-
label: /* @__PURE__ */
|
|
3156
|
+
label: /* @__PURE__ */ jsx22(Typography14, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
|
|
3121
3157
|
sx: { mt: 1, mb: 0 }
|
|
3122
3158
|
}
|
|
3123
3159
|
);
|
|
3124
3160
|
case "date":
|
|
3125
3161
|
case "timestamp":
|
|
3126
3162
|
case "time":
|
|
3127
|
-
return /* @__PURE__ */
|
|
3163
|
+
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" } } });
|
|
3128
3164
|
case "jsonb":
|
|
3129
3165
|
case "jsona":
|
|
3130
|
-
return /* @__PURE__ */
|
|
3166
|
+
return /* @__PURE__ */ jsx22(TextField2, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
|
|
3131
3167
|
case "bytea":
|
|
3132
|
-
return /* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
/* @__PURE__ */
|
|
3168
|
+
return /* @__PURE__ */ jsxs14(FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
|
|
3169
|
+
/* @__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 }),
|
|
3170
|
+
/* @__PURE__ */ jsx22(
|
|
3135
3171
|
"input",
|
|
3136
3172
|
{
|
|
3137
3173
|
type: "file",
|
|
@@ -3145,34 +3181,34 @@ var ProcedureForm = () => {
|
|
|
3145
3181
|
style: { padding: "6px 0", fontSize: "0.8rem" }
|
|
3146
3182
|
}
|
|
3147
3183
|
),
|
|
3148
|
-
(param.description || errorMessage) && /* @__PURE__ */
|
|
3184
|
+
(param.description || errorMessage) && /* @__PURE__ */ jsx22(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
|
|
3149
3185
|
] });
|
|
3150
3186
|
default:
|
|
3151
|
-
return /* @__PURE__ */
|
|
3187
|
+
return /* @__PURE__ */ jsx22(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
|
|
3152
3188
|
}
|
|
3153
3189
|
}, [formValues, handleChange, apiLoading, validationErrors]);
|
|
3154
3190
|
const ResultDisplayContent = useMemo4(() => {
|
|
3155
3191
|
if (!procedureResultData || !procedure?.resultOk) return null;
|
|
3156
3192
|
const ComponentToRender = resultsOk[procedure.resultOk];
|
|
3157
3193
|
if (ComponentToRender) {
|
|
3158
|
-
return /* @__PURE__ */
|
|
3194
|
+
return /* @__PURE__ */ jsx22(ComponentToRender, { data: procedureResultData });
|
|
3159
3195
|
} else {
|
|
3160
|
-
return /* @__PURE__ */
|
|
3161
|
-
/* @__PURE__ */
|
|
3196
|
+
return /* @__PURE__ */ jsxs14(Paper3, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
|
|
3197
|
+
/* @__PURE__ */ jsxs14(Typography14, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
|
|
3162
3198
|
"el componente para resolver el resultOk: '",
|
|
3163
3199
|
procedure.resultOk,
|
|
3164
3200
|
"' definido en el procedure no existe o no est\xE1 mapeado."
|
|
3165
3201
|
] }),
|
|
3166
|
-
/* @__PURE__ */
|
|
3202
|
+
/* @__PURE__ */ jsx22(Box16, { sx: {
|
|
3167
3203
|
bgcolor: "warning.dark",
|
|
3168
3204
|
p: 1,
|
|
3169
3205
|
borderRadius: 1
|
|
3170
|
-
}, children: /* @__PURE__ */
|
|
3206
|
+
}, children: /* @__PURE__ */ jsx22("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(procedureResultData, null, 2) }) })
|
|
3171
3207
|
] });
|
|
3172
3208
|
}
|
|
3173
3209
|
}, [procedureResultData, procedure]);
|
|
3174
3210
|
if (!procedure) {
|
|
3175
|
-
return /* @__PURE__ */
|
|
3211
|
+
return /* @__PURE__ */ jsxs14(Box16, { sx: {
|
|
3176
3212
|
p: 2,
|
|
3177
3213
|
width: "100%",
|
|
3178
3214
|
boxSizing: "border-box",
|
|
@@ -3182,13 +3218,13 @@ var ProcedureForm = () => {
|
|
|
3182
3218
|
boxShadow: 3,
|
|
3183
3219
|
textAlign: "center"
|
|
3184
3220
|
}, children: [
|
|
3185
|
-
/* @__PURE__ */
|
|
3186
|
-
/* @__PURE__ */
|
|
3221
|
+
/* @__PURE__ */ jsx22(CircularProgress4, { sx: { mb: 2 } }),
|
|
3222
|
+
/* @__PURE__ */ jsx22(Typography14, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
|
|
3187
3223
|
] });
|
|
3188
3224
|
}
|
|
3189
3225
|
return (
|
|
3190
3226
|
// Esta es la Box más externa que ahora controlará el scroll
|
|
3191
|
-
/* @__PURE__ */
|
|
3227
|
+
/* @__PURE__ */ jsxs14(Box16, { sx: {
|
|
3192
3228
|
p: 2,
|
|
3193
3229
|
ml: 1,
|
|
3194
3230
|
mt: 2,
|
|
@@ -3205,16 +3241,16 @@ var ProcedureForm = () => {
|
|
|
3205
3241
|
overflowX: "hidden"
|
|
3206
3242
|
// Oculta el scroll horizontal si no es necesario para el contenedor principal
|
|
3207
3243
|
}, children: [
|
|
3208
|
-
/* @__PURE__ */
|
|
3209
|
-
Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */
|
|
3244
|
+
/* @__PURE__ */ jsx22(Typography14, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
|
|
3245
|
+
Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs14(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
|
|
3210
3246
|
"Por favor, corrige los errores en el formulario antes de enviar.",
|
|
3211
|
-
/* @__PURE__ */
|
|
3247
|
+
/* @__PURE__ */ jsx22("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ jsx22("li", { children: err }, idx)) })
|
|
3212
3248
|
] }),
|
|
3213
|
-
!Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */
|
|
3214
|
-
!Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */
|
|
3215
|
-
/* @__PURE__ */
|
|
3216
|
-
procedure.parameters.map((param) => /* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
3249
|
+
!Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ jsx22(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
|
|
3250
|
+
!Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ jsx22(Alert3, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
|
|
3251
|
+
/* @__PURE__ */ jsxs14("form", { onSubmit: handleSubmit, children: [
|
|
3252
|
+
procedure.parameters.map((param) => /* @__PURE__ */ jsx22("div", { children: renderInputField(param) }, param.name)),
|
|
3253
|
+
/* @__PURE__ */ jsx22(
|
|
3218
3254
|
Button7,
|
|
3219
3255
|
{
|
|
3220
3256
|
type: "submit",
|
|
@@ -3223,20 +3259,20 @@ var ProcedureForm = () => {
|
|
|
3223
3259
|
disabled: apiLoading || Object.values(validationErrors).some((err) => err !== null),
|
|
3224
3260
|
sx: { mt: 2 },
|
|
3225
3261
|
size: "medium",
|
|
3226
|
-
startIcon: apiLoading ? /* @__PURE__ */
|
|
3262
|
+
startIcon: apiLoading ? /* @__PURE__ */ jsx22(CircularProgress4, { size: 20, color: "inherit" }) : null,
|
|
3227
3263
|
children: apiLoading ? "Ejecutando..." : procedure.proceedLabel || "Ejecutar"
|
|
3228
3264
|
}
|
|
3229
3265
|
)
|
|
3230
3266
|
] }),
|
|
3231
|
-
ResultDisplayContent && /* @__PURE__ */
|
|
3267
|
+
ResultDisplayContent && /* @__PURE__ */ jsxs14(Box16, { sx: { mt: 2 }, children: [
|
|
3232
3268
|
" ",
|
|
3233
3269
|
ResultDisplayContent
|
|
3234
3270
|
] }),
|
|
3235
|
-
executionLog.length > 0 && /* @__PURE__ */
|
|
3236
|
-
/* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3238
|
-
/* @__PURE__ */
|
|
3239
|
-
|
|
3271
|
+
executionLog.length > 0 && /* @__PURE__ */ jsxs14(Box16, { sx: { mt: 3 }, children: [
|
|
3272
|
+
/* @__PURE__ */ jsx22(Divider2, { sx: { mb: 2 } }),
|
|
3273
|
+
/* @__PURE__ */ jsx22(Typography14, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
|
|
3274
|
+
/* @__PURE__ */ jsx22(
|
|
3275
|
+
Box16,
|
|
3240
3276
|
{
|
|
3241
3277
|
sx: {
|
|
3242
3278
|
bgcolor: "grey.100",
|
|
@@ -3249,8 +3285,8 @@ var ProcedureForm = () => {
|
|
|
3249
3285
|
fontSize: "0.75rem",
|
|
3250
3286
|
whiteSpace: "pre-wrap"
|
|
3251
3287
|
},
|
|
3252
|
-
children: executionLog.map((log, index) => /* @__PURE__ */
|
|
3253
|
-
|
|
3288
|
+
children: executionLog.map((log, index) => /* @__PURE__ */ jsx22(
|
|
3289
|
+
Typography14,
|
|
3254
3290
|
{
|
|
3255
3291
|
component: "pre",
|
|
3256
3292
|
sx: {
|
|
@@ -3277,7 +3313,7 @@ import { PersistGate } from "redux-persist/integration/react";
|
|
|
3277
3313
|
// src/components/PrivateRoute.tsx
|
|
3278
3314
|
import { useEffect as useEffect5 } from "react";
|
|
3279
3315
|
import { Navigate, useLocation as useLocation2 } from "react-router-dom";
|
|
3280
|
-
import { Fragment as Fragment3, jsx as
|
|
3316
|
+
import { Fragment as Fragment3, jsx as jsx23 } from "react/jsx-runtime";
|
|
3281
3317
|
var PrivateRoute = ({ children }) => {
|
|
3282
3318
|
const location = useLocation2();
|
|
3283
3319
|
const dispatch = useAppDispatch();
|
|
@@ -3301,14 +3337,14 @@ var PrivateRoute = ({ children }) => {
|
|
|
3301
3337
|
}, [isAuthenticated, isLoadingAuth, location, dispatch, clientContextStatus]);
|
|
3302
3338
|
if (isLoadingAuth) {
|
|
3303
3339
|
console.log(`[PrivateRoute] Returning loading state...`);
|
|
3304
|
-
return /* @__PURE__ */
|
|
3340
|
+
return /* @__PURE__ */ jsx23("p", { children: "Verificando autenticaci\xF3n..." });
|
|
3305
3341
|
}
|
|
3306
3342
|
if (!isAuthenticated) {
|
|
3307
3343
|
console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
|
|
3308
|
-
return /* @__PURE__ */
|
|
3344
|
+
return /* @__PURE__ */ jsx23(Navigate, { to: "/login", replace: true });
|
|
3309
3345
|
}
|
|
3310
3346
|
console.log(`[PrivateRoute] User authenticated, rendering children.`);
|
|
3311
|
-
return /* @__PURE__ */
|
|
3347
|
+
return /* @__PURE__ */ jsx23(Fragment3, { children });
|
|
3312
3348
|
};
|
|
3313
3349
|
var PrivateRoute_default = PrivateRoute;
|
|
3314
3350
|
|
|
@@ -3342,25 +3378,25 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
|
|
|
3342
3378
|
|
|
3343
3379
|
// src/pages/GenericDataGridPage.tsx
|
|
3344
3380
|
import { useParams as useParams2 } from "react-router-dom";
|
|
3345
|
-
import { Box as
|
|
3346
|
-
import { jsx as
|
|
3381
|
+
import { Box as Box17, Alert as Alert4, Typography as Typography15 } from "@mui/material";
|
|
3382
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3347
3383
|
var GenericDataGridPage = () => {
|
|
3348
3384
|
const { tableName } = useParams2();
|
|
3349
3385
|
if (!tableName) {
|
|
3350
|
-
return /* @__PURE__ */
|
|
3351
|
-
/* @__PURE__ */
|
|
3352
|
-
/* @__PURE__ */
|
|
3386
|
+
return /* @__PURE__ */ jsx24(Box17, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs15(Alert4, { severity: "error", children: [
|
|
3387
|
+
/* @__PURE__ */ jsx24(Typography15, { variant: "h6", children: "Error: Nombre de tabla no especificado en la URL." }),
|
|
3388
|
+
/* @__PURE__ */ jsx24(Typography15, { variant: "body1", children: "Por favor, aseg\xFArate de que la URL contenga el nombre de la tabla (ej. `/data/users`)." })
|
|
3353
3389
|
] }) });
|
|
3354
3390
|
}
|
|
3355
|
-
return /* @__PURE__ */
|
|
3391
|
+
return /* @__PURE__ */ jsx24(GenericDataGrid_default, { tableName, fixedFields: [] });
|
|
3356
3392
|
};
|
|
3357
3393
|
var GenericDataGridPage_default = GenericDataGridPage;
|
|
3358
3394
|
|
|
3359
3395
|
// src/pages/MenuTablePage.tsx
|
|
3360
3396
|
import { useMemo as useMemo5 } from "react";
|
|
3361
3397
|
import { useParams as useParams3 } from "react-router-dom";
|
|
3362
|
-
import { Box as
|
|
3363
|
-
import { jsx as
|
|
3398
|
+
import { Box as Box18, Alert as Alert5, Typography as Typography16 } from "@mui/material";
|
|
3399
|
+
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3364
3400
|
var MenuTablePage = () => {
|
|
3365
3401
|
const { menuName } = useParams3();
|
|
3366
3402
|
const { clientContext } = useApp();
|
|
@@ -3402,12 +3438,12 @@ var MenuTablePage = () => {
|
|
|
3402
3438
|
};
|
|
3403
3439
|
}, [menuName, clientContext]);
|
|
3404
3440
|
if (!currentTableName) {
|
|
3405
|
-
return /* @__PURE__ */
|
|
3406
|
-
/* @__PURE__ */
|
|
3407
|
-
/* @__PURE__ */
|
|
3441
|
+
return /* @__PURE__ */ jsx25(Box18, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs16(Alert5, { severity: "error", children: [
|
|
3442
|
+
/* @__PURE__ */ jsx25(Typography16, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
|
|
3443
|
+
/* @__PURE__ */ jsx25(Typography16, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
|
|
3408
3444
|
] }) });
|
|
3409
3445
|
}
|
|
3410
|
-
return /* @__PURE__ */
|
|
3446
|
+
return /* @__PURE__ */ jsx25(
|
|
3411
3447
|
GenericDataGrid_default,
|
|
3412
3448
|
{
|
|
3413
3449
|
tableName: currentTableName,
|
|
@@ -3417,41 +3453,8 @@ var MenuTablePage = () => {
|
|
|
3417
3453
|
};
|
|
3418
3454
|
var MenuTablePage_default = MenuTablePage;
|
|
3419
3455
|
|
|
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
|
-
|
|
3454
3456
|
// src/App.tsx
|
|
3457
|
+
import { Box as Box19 } from "@mui/material";
|
|
3455
3458
|
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3456
3459
|
var LocationTracker = () => {
|
|
3457
3460
|
const location = useLocation4();
|
|
@@ -3461,25 +3464,30 @@ var LocationTracker = () => {
|
|
|
3461
3464
|
}, [location, dispatch]);
|
|
3462
3465
|
return null;
|
|
3463
3466
|
};
|
|
3464
|
-
function FrontendPlusReactRoutes({ myRoutes
|
|
3465
|
-
const allWScreens = { ...wScreens, ...myWScreens || {} };
|
|
3467
|
+
function FrontendPlusReactRoutes({ myRoutes }) {
|
|
3466
3468
|
return /* @__PURE__ */ jsxs17(Routes, { children: [
|
|
3467
3469
|
/* @__PURE__ */ jsx26(Route, { path: "/login", element: /* @__PURE__ */ jsx26(LoginPage_default, {}) }),
|
|
3468
3470
|
/* @__PURE__ */ jsx26(Route, { path: "/logout", element: /* @__PURE__ */ jsx26(LogoutPage_default, {}) }),
|
|
3469
3471
|
/* @__PURE__ */ jsxs17(Route, { element: /* @__PURE__ */ jsxs17(PrivateRoute_default, { children: [
|
|
3470
3472
|
/* @__PURE__ */ jsx26(InitialRedirectHandler_default, {}),
|
|
3471
|
-
/* @__PURE__ */ jsx26(MainLayout_default, {
|
|
3473
|
+
/* @__PURE__ */ jsx26(MainLayout_default, {})
|
|
3472
3474
|
] }), children: [
|
|
3473
3475
|
/* @__PURE__ */ jsx26(Route, { path: "/", element: /* @__PURE__ */ jsx26(HomePage_default, {}) }),
|
|
3474
3476
|
/* @__PURE__ */ jsx26(Route, { path: "/home", element: /* @__PURE__ */ jsx26(HomePage_default, {}) }),
|
|
3475
3477
|
/* @__PURE__ */ jsx26(Route, { path: "/table/:tableName", element: /* @__PURE__ */ jsx26(GenericDataGridPage_default, {}) }),
|
|
3476
3478
|
/* @__PURE__ */ jsx26(Route, { path: "/menu/:menuName", element: /* @__PURE__ */ jsx26(MenuTablePage_default, {}) }),
|
|
3477
3479
|
/* @__PURE__ */ jsx26(Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ jsx26(ProcedureForm_default, {}) }),
|
|
3478
|
-
Object.keys(
|
|
3480
|
+
Object.keys(wScreens).map((screenName) => /* @__PURE__ */ jsx26(
|
|
3479
3481
|
Route,
|
|
3480
3482
|
{
|
|
3481
3483
|
path: `/wScreens/${screenName}`,
|
|
3482
|
-
element: React11.createElement(
|
|
3484
|
+
element: React11.createElement(
|
|
3485
|
+
Box19,
|
|
3486
|
+
{
|
|
3487
|
+
sx: { pt: 3, pl: 4 }
|
|
3488
|
+
},
|
|
3489
|
+
React11.createElement(wScreens[screenName], { screenName })
|
|
3490
|
+
)
|
|
3483
3491
|
},
|
|
3484
3492
|
screenName
|
|
3485
3493
|
)),
|
|
@@ -3487,7 +3495,7 @@ function FrontendPlusReactRoutes({ myRoutes, allWScreens: myWScreens }) {
|
|
|
3487
3495
|
Route,
|
|
3488
3496
|
{
|
|
3489
3497
|
path: "/wScreens-fallback/:screenName",
|
|
3490
|
-
element: /* @__PURE__ */ jsx26(
|
|
3498
|
+
element: /* @__PURE__ */ jsx26(Box19, { sx: { p: 3 }, children: /* @__PURE__ */ jsx26(FallbackWScreen, { screenName: ":screenName" }) })
|
|
3491
3499
|
}
|
|
3492
3500
|
),
|
|
3493
3501
|
/* @__PURE__ */ jsx26(Route, { path: "*", element: /* @__PURE__ */ jsx26("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
|
|
@@ -3509,15 +3517,17 @@ var App = ({
|
|
|
3509
3517
|
if (myResultsOk) {
|
|
3510
3518
|
extendResultsOk(myResultsOk);
|
|
3511
3519
|
}
|
|
3512
|
-
|
|
3520
|
+
if (myWScreens) {
|
|
3521
|
+
extendWScreens(myWScreens);
|
|
3522
|
+
}
|
|
3523
|
+
}, [myClientSides, myResultsOk, myWScreens]);
|
|
3513
3524
|
return /* @__PURE__ */ jsx26(Provider, { store, children: /* @__PURE__ */ jsx26(PersistGate, { loading: null, persistor, children: /* @__PURE__ */ jsxs17(BrowserRouter, { children: [
|
|
3514
3525
|
/* @__PURE__ */ jsx26(LocationTracker, {}),
|
|
3515
3526
|
/* @__PURE__ */ jsx26(AppProvider, { children: /* @__PURE__ */ jsxs17(SnackbarProvider, { children: [
|
|
3516
3527
|
/* @__PURE__ */ jsx26(
|
|
3517
3528
|
FrontendPlusReactRoutes,
|
|
3518
3529
|
{
|
|
3519
|
-
myRoutes
|
|
3520
|
-
allWScreens: myWScreens
|
|
3530
|
+
myRoutes
|
|
3521
3531
|
}
|
|
3522
3532
|
),
|
|
3523
3533
|
/* @__PURE__ */ jsx26(SessionExpiredMessage_default, {})
|