frontend-plus-react 0.1.6 → 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.cjs +49 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +204 -203
- 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 Box9,
|
|
2155
2155
|
AppBar,
|
|
2156
2156
|
Toolbar,
|
|
2157
|
-
Typography as
|
|
2157
|
+
Typography as Typography7,
|
|
2158
2158
|
Button as Button4,
|
|
2159
2159
|
Drawer,
|
|
2160
2160
|
CssBaseline,
|
|
@@ -2244,57 +2244,21 @@ 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 Box8, Typography as Typography6, 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 WarningAmberIcon2 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
|
-
|
|
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 WScreens_default = FallbackWScreen;
|
|
2294
|
-
|
|
2295
|
-
// src/components/SideMenu.tsx
|
|
2296
|
-
import { Fragment, jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2297
|
-
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 }) => {
|
|
2298
2262
|
const navigate = useNavigate2();
|
|
2299
2263
|
const location = useLocation();
|
|
2300
2264
|
const open = useSubMenuOpenState(item.name);
|
|
@@ -2315,7 +2279,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2315
2279
|
} else if (item.menuType === "proc") {
|
|
2316
2280
|
path = `/procedures/${item.name}`;
|
|
2317
2281
|
} else {
|
|
2318
|
-
const WScreenComponent =
|
|
2282
|
+
const WScreenComponent = allWScreens[item.menuType];
|
|
2319
2283
|
if (WScreenComponent !== void 0) {
|
|
2320
2284
|
path = `/wScreens/${item.menuType}`;
|
|
2321
2285
|
} else {
|
|
@@ -2334,17 +2298,17 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2334
2298
|
const getIcon = (item2) => {
|
|
2335
2299
|
switch (item2.menuType) {
|
|
2336
2300
|
case "table":
|
|
2337
|
-
return /* @__PURE__ */
|
|
2301
|
+
return /* @__PURE__ */ jsx14(TableChartIcon, { sx: { color: blue[700] } });
|
|
2338
2302
|
case "proc":
|
|
2339
|
-
return /* @__PURE__ */
|
|
2303
|
+
return /* @__PURE__ */ jsx14(DnsIcon, { sx: { color: teal[700] } });
|
|
2340
2304
|
case "menu":
|
|
2341
|
-
return /* @__PURE__ */
|
|
2305
|
+
return /* @__PURE__ */ jsx14(FolderIcon, { sx: { color: orange[800] } });
|
|
2342
2306
|
default:
|
|
2343
|
-
const WScreenComponent =
|
|
2307
|
+
const WScreenComponent = allWScreens[item2.menuType];
|
|
2344
2308
|
if (WScreenComponent !== void 0) {
|
|
2345
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ jsx14(DesktopWindowsIcon, { sx: { color: grey[700] } });
|
|
2346
2310
|
}
|
|
2347
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ jsx14(WarningAmberIcon2, { sx: { color: red[500] } });
|
|
2348
2312
|
}
|
|
2349
2313
|
};
|
|
2350
2314
|
const currentPath = location.pathname;
|
|
@@ -2356,32 +2320,33 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
|
|
|
2356
2320
|
} else {
|
|
2357
2321
|
isSelected = currentPath.startsWith(`/wScreens/${item.menuType}`) || currentPath.startsWith(`/wScreens-fallback/${item.menuType}`);
|
|
2358
2322
|
}
|
|
2359
|
-
return /* @__PURE__ */
|
|
2360
|
-
/* @__PURE__ */
|
|
2323
|
+
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
2324
|
+
/* @__PURE__ */ jsxs6(
|
|
2361
2325
|
ListItemButton,
|
|
2362
2326
|
{
|
|
2363
2327
|
onClick: handleClick,
|
|
2364
2328
|
sx: { pl: level * 2 },
|
|
2365
2329
|
selected: isSelected,
|
|
2366
2330
|
children: [
|
|
2367
|
-
/* @__PURE__ */
|
|
2368
|
-
/* @__PURE__ */
|
|
2369
|
-
item.menuType === "menu" ? open ? /* @__PURE__ */
|
|
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
|
|
2370
2334
|
]
|
|
2371
2335
|
}
|
|
2372
2336
|
),
|
|
2373
|
-
item.menuType === "menu" && /* @__PURE__ */
|
|
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(
|
|
2374
2338
|
MenuListItem,
|
|
2375
2339
|
{
|
|
2376
2340
|
item: subItem,
|
|
2377
2341
|
level: level + 1,
|
|
2378
|
-
onMenuItemClick
|
|
2342
|
+
onMenuItemClick,
|
|
2343
|
+
allWScreens
|
|
2379
2344
|
},
|
|
2380
2345
|
subItem.name
|
|
2381
2346
|
)) }) })
|
|
2382
2347
|
] });
|
|
2383
2348
|
};
|
|
2384
|
-
var SideMenu = ({ onMenuItemClick }) => {
|
|
2349
|
+
var SideMenu = ({ onMenuItemClick, allWScreens }) => {
|
|
2385
2350
|
const { clientContext } = useApp();
|
|
2386
2351
|
const navigate = useNavigate2();
|
|
2387
2352
|
const location = useLocation();
|
|
@@ -2400,27 +2365,28 @@ var SideMenu = ({ onMenuItemClick }) => {
|
|
|
2400
2365
|
dispatch(setAllSubMenusOpen(!isMostlyOpen));
|
|
2401
2366
|
};
|
|
2402
2367
|
if (!clientContext || !clientContext.menu) {
|
|
2403
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ jsx14(Box8, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx14(Typography6, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
|
|
2404
2369
|
}
|
|
2405
2370
|
const isHomeSelected = location.pathname === "/home";
|
|
2406
|
-
return /* @__PURE__ */
|
|
2407
|
-
clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */
|
|
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" })
|
|
2410
2375
|
] }) }),
|
|
2411
|
-
/* @__PURE__ */
|
|
2412
|
-
/* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2414
|
-
/* @__PURE__ */
|
|
2415
|
-
/* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ jsx14(Divider, {}),
|
|
2377
|
+
/* @__PURE__ */ jsxs6(List, { children: [
|
|
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" })
|
|
2416
2381
|
] }) }),
|
|
2417
|
-
/* @__PURE__ */
|
|
2418
|
-
clientContext.menu.map((menuItem) => /* @__PURE__ */
|
|
2382
|
+
/* @__PURE__ */ jsx14(Divider, {}),
|
|
2383
|
+
clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx14(
|
|
2419
2384
|
MenuListItem,
|
|
2420
2385
|
{
|
|
2421
2386
|
item: menuItem,
|
|
2422
2387
|
level: 1,
|
|
2423
|
-
onMenuItemClick
|
|
2388
|
+
onMenuItemClick,
|
|
2389
|
+
allWScreens
|
|
2424
2390
|
},
|
|
2425
2391
|
menuItem.name
|
|
2426
2392
|
))
|
|
@@ -2458,9 +2424,10 @@ var useLogout = () => {
|
|
|
2458
2424
|
var useLogout_default = useLogout;
|
|
2459
2425
|
|
|
2460
2426
|
// src/components/MainLayout.tsx
|
|
2461
|
-
import { jsx as
|
|
2427
|
+
import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2462
2428
|
var drawerWidth = 240;
|
|
2463
|
-
var MainLayout = () => {
|
|
2429
|
+
var MainLayout = (props) => {
|
|
2430
|
+
const { allWScreens } = props;
|
|
2464
2431
|
const { clientContext } = useApp();
|
|
2465
2432
|
const logout = useLogout_default();
|
|
2466
2433
|
const isDrawerOpen = useIsDrawerOpen();
|
|
@@ -2481,12 +2448,12 @@ var MainLayout = () => {
|
|
|
2481
2448
|
}
|
|
2482
2449
|
};
|
|
2483
2450
|
if (!clientContext) {
|
|
2484
|
-
return /* @__PURE__ */
|
|
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..." }) });
|
|
2485
2452
|
}
|
|
2486
2453
|
const appBarOffset = theme.mixins.toolbar;
|
|
2487
|
-
return /* @__PURE__ */
|
|
2488
|
-
/* @__PURE__ */
|
|
2489
|
-
/* @__PURE__ */
|
|
2454
|
+
return /* @__PURE__ */ jsxs7(Box9, { sx: { display: "flex", height: "100vh" }, children: [
|
|
2455
|
+
/* @__PURE__ */ jsx15(CssBaseline, {}),
|
|
2456
|
+
/* @__PURE__ */ jsx15(
|
|
2490
2457
|
AppBar,
|
|
2491
2458
|
{
|
|
2492
2459
|
position: "fixed",
|
|
@@ -2505,8 +2472,8 @@ var MainLayout = () => {
|
|
|
2505
2472
|
})
|
|
2506
2473
|
}
|
|
2507
2474
|
},
|
|
2508
|
-
children: /* @__PURE__ */
|
|
2509
|
-
/* @__PURE__ */
|
|
2475
|
+
children: /* @__PURE__ */ jsxs7(Toolbar, { children: [
|
|
2476
|
+
/* @__PURE__ */ jsx15(
|
|
2510
2477
|
IconButton3,
|
|
2511
2478
|
{
|
|
2512
2479
|
color: "inherit",
|
|
@@ -2516,24 +2483,24 @@ var MainLayout = () => {
|
|
|
2516
2483
|
sx: {
|
|
2517
2484
|
marginRight: 2.2
|
|
2518
2485
|
},
|
|
2519
|
-
children: isDrawerOpen ? /* @__PURE__ */
|
|
2486
|
+
children: isDrawerOpen ? /* @__PURE__ */ jsx15(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx15(MenuIcon, {})
|
|
2520
2487
|
}
|
|
2521
2488
|
),
|
|
2522
|
-
/* @__PURE__ */
|
|
2523
|
-
/* @__PURE__ */
|
|
2524
|
-
/* @__PURE__ */
|
|
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(
|
|
2525
2492
|
Button4,
|
|
2526
2493
|
{
|
|
2527
2494
|
color: "inherit",
|
|
2528
2495
|
onClick: logout,
|
|
2529
|
-
startIcon: /* @__PURE__ */
|
|
2496
|
+
startIcon: /* @__PURE__ */ jsx15(LogoutIcon, {}),
|
|
2530
2497
|
children: "Salir"
|
|
2531
2498
|
}
|
|
2532
2499
|
)
|
|
2533
2500
|
] })
|
|
2534
2501
|
}
|
|
2535
2502
|
),
|
|
2536
|
-
/* @__PURE__ */
|
|
2503
|
+
/* @__PURE__ */ jsxs7(
|
|
2537
2504
|
Drawer,
|
|
2538
2505
|
{
|
|
2539
2506
|
variant: "persistent",
|
|
@@ -2550,7 +2517,7 @@ var MainLayout = () => {
|
|
|
2550
2517
|
}
|
|
2551
2518
|
},
|
|
2552
2519
|
children: [
|
|
2553
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ jsx15(
|
|
2554
2521
|
Toolbar,
|
|
2555
2522
|
{
|
|
2556
2523
|
sx: {
|
|
@@ -2564,12 +2531,12 @@ var MainLayout = () => {
|
|
|
2564
2531
|
children: isDrawerOpen ? clientContext.config.title : ""
|
|
2565
2532
|
}
|
|
2566
2533
|
),
|
|
2567
|
-
/* @__PURE__ */
|
|
2534
|
+
/* @__PURE__ */ jsx15(SideMenu_default, { onMenuItemClick: handleDrawerCloseMobile, allWScreens })
|
|
2568
2535
|
]
|
|
2569
2536
|
}
|
|
2570
2537
|
),
|
|
2571
|
-
/* @__PURE__ */
|
|
2572
|
-
|
|
2538
|
+
/* @__PURE__ */ jsx15(
|
|
2539
|
+
Box9,
|
|
2573
2540
|
{
|
|
2574
2541
|
component: "main",
|
|
2575
2542
|
sx: {
|
|
@@ -2596,7 +2563,7 @@ var MainLayout = () => {
|
|
|
2596
2563
|
flexDirection: "column",
|
|
2597
2564
|
width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
|
|
2598
2565
|
},
|
|
2599
|
-
children: /* @__PURE__ */
|
|
2566
|
+
children: /* @__PURE__ */ jsx15(Outlet, {})
|
|
2600
2567
|
}
|
|
2601
2568
|
)
|
|
2602
2569
|
] });
|
|
@@ -2604,9 +2571,9 @@ var MainLayout = () => {
|
|
|
2604
2571
|
var MainLayout_default = MainLayout;
|
|
2605
2572
|
|
|
2606
2573
|
// src/components/SessionExpiredMessage.tsx
|
|
2607
|
-
import { Box as
|
|
2574
|
+
import { Box as Box10, Typography as Typography8, Button as Button5, Modal } from "@mui/material";
|
|
2608
2575
|
import { useNavigate as useNavigate4 } from "react-router-dom";
|
|
2609
|
-
import { jsx as
|
|
2576
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2610
2577
|
var style = {
|
|
2611
2578
|
position: "absolute",
|
|
2612
2579
|
top: "50%",
|
|
@@ -2628,7 +2595,7 @@ var SessionExpiredMessage = () => {
|
|
|
2628
2595
|
setIsLoggedIn(false);
|
|
2629
2596
|
navigate("/login", { replace: true });
|
|
2630
2597
|
};
|
|
2631
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ jsx16(
|
|
2632
2599
|
Modal,
|
|
2633
2600
|
{
|
|
2634
2601
|
open: showSessionExpiredMessage,
|
|
@@ -2648,10 +2615,10 @@ var SessionExpiredMessage = () => {
|
|
|
2648
2615
|
}
|
|
2649
2616
|
}
|
|
2650
2617
|
},
|
|
2651
|
-
children: /* @__PURE__ */
|
|
2652
|
-
/* @__PURE__ */
|
|
2653
|
-
/* @__PURE__ */
|
|
2654
|
-
/* @__PURE__ */
|
|
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" })
|
|
2655
2622
|
] })
|
|
2656
2623
|
}
|
|
2657
2624
|
);
|
|
@@ -2659,27 +2626,27 @@ var SessionExpiredMessage = () => {
|
|
|
2659
2626
|
var SessionExpiredMessage_default = SessionExpiredMessage;
|
|
2660
2627
|
|
|
2661
2628
|
// src/pages/HomePage.tsx
|
|
2662
|
-
import { Box as
|
|
2663
|
-
import { jsx as
|
|
2629
|
+
import { Box as Box11, Typography as Typography9 } from "@mui/material";
|
|
2630
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2664
2631
|
var HomePage = () => {
|
|
2665
2632
|
const { clientContext } = useApp();
|
|
2666
|
-
return /* @__PURE__ */
|
|
2667
|
-
/* @__PURE__ */
|
|
2668
|
-
/* @__PURE__ */
|
|
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." })
|
|
2669
2636
|
] });
|
|
2670
2637
|
};
|
|
2671
2638
|
var HomePage_default = HomePage;
|
|
2672
2639
|
|
|
2673
2640
|
// src/pages/LogoutPage.tsx
|
|
2674
2641
|
import { useEffect as useEffect4 } from "react";
|
|
2675
|
-
import { Box as
|
|
2676
|
-
import { jsx as
|
|
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";
|
|
2677
2644
|
var LogoutPage = () => {
|
|
2678
2645
|
const logout = useLogout_default();
|
|
2679
2646
|
useEffect4(() => {
|
|
2680
2647
|
logout();
|
|
2681
2648
|
}, [logout]);
|
|
2682
|
-
return /* @__PURE__ */
|
|
2649
|
+
return /* @__PURE__ */ jsxs10(Box12, { sx: {
|
|
2683
2650
|
display: "flex",
|
|
2684
2651
|
flexDirection: "column",
|
|
2685
2652
|
justifyContent: "center",
|
|
@@ -2687,21 +2654,21 @@ var LogoutPage = () => {
|
|
|
2687
2654
|
height: "100vh",
|
|
2688
2655
|
textAlign: "center"
|
|
2689
2656
|
}, children: [
|
|
2690
|
-
/* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */
|
|
2657
|
+
/* @__PURE__ */ jsx18(CircularProgress2, { size: 60 }),
|
|
2658
|
+
/* @__PURE__ */ jsx18(Typography10, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
|
|
2692
2659
|
] });
|
|
2693
2660
|
};
|
|
2694
2661
|
var LogoutPage_default = LogoutPage;
|
|
2695
2662
|
|
|
2696
2663
|
// src/pages/LoginPage.tsx
|
|
2697
2664
|
import { useState as useState6 } from "react";
|
|
2698
|
-
import { Button as Button6, TextField, Typography as
|
|
2665
|
+
import { Button as Button6, TextField, Typography as Typography11, Alert as Alert2, AlertTitle, Box as Box13, CircularProgress as CircularProgress3 } from "@mui/material";
|
|
2699
2666
|
import { useForm, Controller } from "react-hook-form";
|
|
2700
2667
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
2701
2668
|
import * as z from "zod";
|
|
2702
2669
|
import { useNavigate as useNavigate5 } from "react-router-dom";
|
|
2703
2670
|
import { useDispatch as useDispatch4 } from "react-redux";
|
|
2704
|
-
import { Fragment as Fragment2, jsx as
|
|
2671
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2705
2672
|
var loginSchema = z.object({
|
|
2706
2673
|
username: z.string().min(1, "El usuario es requerido"),
|
|
2707
2674
|
// Añadir validación básica
|
|
@@ -2757,16 +2724,16 @@ var LoginPage = () => {
|
|
|
2757
2724
|
setIsSubmitting(false);
|
|
2758
2725
|
}
|
|
2759
2726
|
};
|
|
2760
|
-
return /* @__PURE__ */
|
|
2761
|
-
|
|
2727
|
+
return /* @__PURE__ */ jsx19(
|
|
2728
|
+
Box13,
|
|
2762
2729
|
{
|
|
2763
2730
|
display: "flex",
|
|
2764
2731
|
alignItems: "center",
|
|
2765
2732
|
justifyContent: "center",
|
|
2766
2733
|
minHeight: "100vh",
|
|
2767
2734
|
bgcolor: "#f5f5f5",
|
|
2768
|
-
children: /* @__PURE__ */
|
|
2769
|
-
|
|
2735
|
+
children: /* @__PURE__ */ jsxs11(
|
|
2736
|
+
Box13,
|
|
2770
2737
|
{
|
|
2771
2738
|
width: "100%",
|
|
2772
2739
|
maxWidth: "400px",
|
|
@@ -2775,16 +2742,16 @@ var LoginPage = () => {
|
|
|
2775
2742
|
borderRadius: 8,
|
|
2776
2743
|
boxShadow: 3,
|
|
2777
2744
|
children: [
|
|
2778
|
-
/* @__PURE__ */
|
|
2779
|
-
/* @__PURE__ */
|
|
2780
|
-
/* @__PURE__ */
|
|
2781
|
-
/* @__PURE__ */
|
|
2782
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ jsx19(Typography11, { variant: "h5", align: "center", gutterBottom: true, children: "Iniciar Sesi\xF3n" }),
|
|
2746
|
+
/* @__PURE__ */ jsxs11("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
2747
|
+
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2748
|
+
/* @__PURE__ */ jsx19("label", { htmlFor: "username", children: /* @__PURE__ */ jsx19(Typography11, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
|
|
2749
|
+
/* @__PURE__ */ jsx19(
|
|
2783
2750
|
Controller,
|
|
2784
2751
|
{
|
|
2785
2752
|
name: "username",
|
|
2786
2753
|
control,
|
|
2787
|
-
render: ({ field }) => /* @__PURE__ */
|
|
2754
|
+
render: ({ field }) => /* @__PURE__ */ jsx19(
|
|
2788
2755
|
TextField,
|
|
2789
2756
|
{
|
|
2790
2757
|
...field,
|
|
@@ -2800,14 +2767,14 @@ var LoginPage = () => {
|
|
|
2800
2767
|
}
|
|
2801
2768
|
)
|
|
2802
2769
|
] }),
|
|
2803
|
-
/* @__PURE__ */
|
|
2804
|
-
/* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
2770
|
+
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2771
|
+
/* @__PURE__ */ jsx19("label", { htmlFor: "password", children: /* @__PURE__ */ jsx19(Typography11, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
|
|
2772
|
+
/* @__PURE__ */ jsx19(
|
|
2806
2773
|
Controller,
|
|
2807
2774
|
{
|
|
2808
2775
|
name: "password",
|
|
2809
2776
|
control,
|
|
2810
|
-
render: ({ field }) => /* @__PURE__ */
|
|
2777
|
+
render: ({ field }) => /* @__PURE__ */ jsx19(
|
|
2811
2778
|
TextField,
|
|
2812
2779
|
{
|
|
2813
2780
|
...field,
|
|
@@ -2823,14 +2790,14 @@ var LoginPage = () => {
|
|
|
2823
2790
|
}
|
|
2824
2791
|
)
|
|
2825
2792
|
] }),
|
|
2826
|
-
/* @__PURE__ */
|
|
2827
|
-
/* @__PURE__ */
|
|
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 } }),
|
|
2828
2795
|
"Iniciando sesi\xF3n..."
|
|
2829
2796
|
] }) : "Iniciar Sesi\xF3n" })
|
|
2830
2797
|
] }),
|
|
2831
|
-
loginError && /* @__PURE__ */
|
|
2798
|
+
loginError && /* @__PURE__ */ jsxs11(Alert2, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
|
|
2832
2799
|
" ",
|
|
2833
|
-
/* @__PURE__ */
|
|
2800
|
+
/* @__PURE__ */ jsx19(AlertTitle, { children: "Error" }),
|
|
2834
2801
|
loginError
|
|
2835
2802
|
] })
|
|
2836
2803
|
]
|
|
@@ -2854,23 +2821,23 @@ import {
|
|
|
2854
2821
|
Checkbox,
|
|
2855
2822
|
FormControlLabel,
|
|
2856
2823
|
FormHelperText,
|
|
2857
|
-
Typography as
|
|
2858
|
-
Box as
|
|
2824
|
+
Typography as Typography13,
|
|
2825
|
+
Box as Box15,
|
|
2859
2826
|
CircularProgress as CircularProgress4,
|
|
2860
2827
|
Alert as Alert3,
|
|
2861
2828
|
Divider as Divider2,
|
|
2862
|
-
Paper as
|
|
2829
|
+
Paper as Paper2
|
|
2863
2830
|
} from "@mui/material";
|
|
2864
2831
|
|
|
2865
2832
|
// src/pages/procedure-results/SuccessDisplay.tsx
|
|
2866
|
-
import { Box as
|
|
2867
|
-
import { jsx as
|
|
2833
|
+
import { Box as Box14, Typography as Typography12, Paper } from "@mui/material";
|
|
2834
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2868
2835
|
var SuccessDisplay = ({ data }) => {
|
|
2869
|
-
return /* @__PURE__ */
|
|
2870
|
-
/* @__PURE__ */
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
/* @__PURE__ */
|
|
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." })
|
|
2874
2841
|
] });
|
|
2875
2842
|
};
|
|
2876
2843
|
var SuccessDisplay_default = SuccessDisplay;
|
|
@@ -2884,7 +2851,7 @@ var extendResultsOk = (newComponents) => {
|
|
|
2884
2851
|
};
|
|
2885
2852
|
|
|
2886
2853
|
// src/components/ProcedureForm.tsx
|
|
2887
|
-
import { jsx as
|
|
2854
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2888
2855
|
var ProcedureForm = () => {
|
|
2889
2856
|
const { procedureName } = useParams();
|
|
2890
2857
|
const { clientContext } = useApp();
|
|
@@ -3099,9 +3066,9 @@ var ProcedureForm = () => {
|
|
|
3099
3066
|
sx: { fontSize: "0.8rem" }
|
|
3100
3067
|
};
|
|
3101
3068
|
if (param.options && param.options.length > 0) {
|
|
3102
|
-
return /* @__PURE__ */
|
|
3103
|
-
/* @__PURE__ */
|
|
3104
|
-
/* @__PURE__ */
|
|
3069
|
+
return /* @__PURE__ */ jsxs13(FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
|
|
3070
|
+
/* @__PURE__ */ jsx21(InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
|
|
3071
|
+
/* @__PURE__ */ jsxs13(
|
|
3105
3072
|
Select,
|
|
3106
3073
|
{
|
|
3107
3074
|
labelId: `${param.name}-label`,
|
|
@@ -3112,14 +3079,14 @@ var ProcedureForm = () => {
|
|
|
3112
3079
|
label: param.label || param.name,
|
|
3113
3080
|
disabled: apiLoading,
|
|
3114
3081
|
sx: { fontSize: "0.8rem" },
|
|
3115
|
-
renderValue: (selected) => /* @__PURE__ */
|
|
3082
|
+
renderValue: (selected) => /* @__PURE__ */ jsx21(Typography13, { sx: { fontSize: "0.8rem" }, children: selected }),
|
|
3116
3083
|
children: [
|
|
3117
|
-
(!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */
|
|
3118
|
-
param.options.map((option) => /* @__PURE__ */
|
|
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))
|
|
3119
3086
|
]
|
|
3120
3087
|
}
|
|
3121
3088
|
),
|
|
3122
|
-
(param.description || errorMessage) && /* @__PURE__ */
|
|
3089
|
+
(param.description || errorMessage) && /* @__PURE__ */ jsx21(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
|
|
3123
3090
|
] });
|
|
3124
3091
|
}
|
|
3125
3092
|
switch (param.typeName) {
|
|
@@ -3128,18 +3095,18 @@ var ProcedureForm = () => {
|
|
|
3128
3095
|
case "tsrange":
|
|
3129
3096
|
case "time_range":
|
|
3130
3097
|
case "daterange":
|
|
3131
|
-
return /* @__PURE__ */
|
|
3098
|
+
return /* @__PURE__ */ jsx21(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
|
|
3132
3099
|
case "decimal":
|
|
3133
3100
|
case "double":
|
|
3134
|
-
return /* @__PURE__ */
|
|
3101
|
+
return /* @__PURE__ */ jsx21(TextField2, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
|
|
3135
3102
|
case "integer":
|
|
3136
3103
|
case "bigint":
|
|
3137
|
-
return /* @__PURE__ */
|
|
3104
|
+
return /* @__PURE__ */ jsx21(TextField2, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
|
|
3138
3105
|
case "boolean":
|
|
3139
|
-
return /* @__PURE__ */
|
|
3106
|
+
return /* @__PURE__ */ jsx21(
|
|
3140
3107
|
FormControlLabel,
|
|
3141
3108
|
{
|
|
3142
|
-
control: /* @__PURE__ */
|
|
3109
|
+
control: /* @__PURE__ */ jsx21(
|
|
3143
3110
|
Checkbox,
|
|
3144
3111
|
{
|
|
3145
3112
|
checked: !!formValues[param.name],
|
|
@@ -3150,21 +3117,21 @@ var ProcedureForm = () => {
|
|
|
3150
3117
|
size: "small"
|
|
3151
3118
|
}
|
|
3152
3119
|
),
|
|
3153
|
-
label: /* @__PURE__ */
|
|
3120
|
+
label: /* @__PURE__ */ jsx21(Typography13, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
|
|
3154
3121
|
sx: { mt: 1, mb: 0 }
|
|
3155
3122
|
}
|
|
3156
3123
|
);
|
|
3157
3124
|
case "date":
|
|
3158
3125
|
case "timestamp":
|
|
3159
3126
|
case "time":
|
|
3160
|
-
return /* @__PURE__ */
|
|
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" } } });
|
|
3161
3128
|
case "jsonb":
|
|
3162
3129
|
case "jsona":
|
|
3163
|
-
return /* @__PURE__ */
|
|
3130
|
+
return /* @__PURE__ */ jsx21(TextField2, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
|
|
3164
3131
|
case "bytea":
|
|
3165
|
-
return /* @__PURE__ */
|
|
3166
|
-
/* @__PURE__ */
|
|
3167
|
-
/* @__PURE__ */
|
|
3132
|
+
return /* @__PURE__ */ jsxs13(FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
|
|
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(
|
|
3168
3135
|
"input",
|
|
3169
3136
|
{
|
|
3170
3137
|
type: "file",
|
|
@@ -3178,34 +3145,34 @@ var ProcedureForm = () => {
|
|
|
3178
3145
|
style: { padding: "6px 0", fontSize: "0.8rem" }
|
|
3179
3146
|
}
|
|
3180
3147
|
),
|
|
3181
|
-
(param.description || errorMessage) && /* @__PURE__ */
|
|
3148
|
+
(param.description || errorMessage) && /* @__PURE__ */ jsx21(FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
|
|
3182
3149
|
] });
|
|
3183
3150
|
default:
|
|
3184
|
-
return /* @__PURE__ */
|
|
3151
|
+
return /* @__PURE__ */ jsx21(TextField2, { type: "text", value: formValues[param.name] || "", ...commonProps });
|
|
3185
3152
|
}
|
|
3186
3153
|
}, [formValues, handleChange, apiLoading, validationErrors]);
|
|
3187
3154
|
const ResultDisplayContent = useMemo4(() => {
|
|
3188
3155
|
if (!procedureResultData || !procedure?.resultOk) return null;
|
|
3189
3156
|
const ComponentToRender = resultsOk[procedure.resultOk];
|
|
3190
3157
|
if (ComponentToRender) {
|
|
3191
|
-
return /* @__PURE__ */
|
|
3158
|
+
return /* @__PURE__ */ jsx21(ComponentToRender, { data: procedureResultData });
|
|
3192
3159
|
} else {
|
|
3193
|
-
return /* @__PURE__ */
|
|
3194
|
-
/* @__PURE__ */
|
|
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: [
|
|
3195
3162
|
"el componente para resolver el resultOk: '",
|
|
3196
3163
|
procedure.resultOk,
|
|
3197
3164
|
"' definido en el procedure no existe o no est\xE1 mapeado."
|
|
3198
3165
|
] }),
|
|
3199
|
-
/* @__PURE__ */
|
|
3166
|
+
/* @__PURE__ */ jsx21(Box15, { sx: {
|
|
3200
3167
|
bgcolor: "warning.dark",
|
|
3201
3168
|
p: 1,
|
|
3202
3169
|
borderRadius: 1
|
|
3203
|
-
}, children: /* @__PURE__ */
|
|
3170
|
+
}, children: /* @__PURE__ */ jsx21("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(procedureResultData, null, 2) }) })
|
|
3204
3171
|
] });
|
|
3205
3172
|
}
|
|
3206
3173
|
}, [procedureResultData, procedure]);
|
|
3207
3174
|
if (!procedure) {
|
|
3208
|
-
return /* @__PURE__ */
|
|
3175
|
+
return /* @__PURE__ */ jsxs13(Box15, { sx: {
|
|
3209
3176
|
p: 2,
|
|
3210
3177
|
width: "100%",
|
|
3211
3178
|
boxSizing: "border-box",
|
|
@@ -3215,13 +3182,13 @@ var ProcedureForm = () => {
|
|
|
3215
3182
|
boxShadow: 3,
|
|
3216
3183
|
textAlign: "center"
|
|
3217
3184
|
}, children: [
|
|
3218
|
-
/* @__PURE__ */
|
|
3219
|
-
/* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ jsx21(CircularProgress4, { sx: { mb: 2 } }),
|
|
3186
|
+
/* @__PURE__ */ jsx21(Typography13, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
|
|
3220
3187
|
] });
|
|
3221
3188
|
}
|
|
3222
3189
|
return (
|
|
3223
3190
|
// Esta es la Box más externa que ahora controlará el scroll
|
|
3224
|
-
/* @__PURE__ */
|
|
3191
|
+
/* @__PURE__ */ jsxs13(Box15, { sx: {
|
|
3225
3192
|
p: 2,
|
|
3226
3193
|
ml: 1,
|
|
3227
3194
|
mt: 2,
|
|
@@ -3238,16 +3205,16 @@ var ProcedureForm = () => {
|
|
|
3238
3205
|
overflowX: "hidden"
|
|
3239
3206
|
// Oculta el scroll horizontal si no es necesario para el contenedor principal
|
|
3240
3207
|
}, children: [
|
|
3241
|
-
/* @__PURE__ */
|
|
3242
|
-
Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */
|
|
3208
|
+
/* @__PURE__ */ jsx21(Typography13, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
|
|
3209
|
+
Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs13(Alert3, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
|
|
3243
3210
|
"Por favor, corrige los errores en el formulario antes de enviar.",
|
|
3244
|
-
/* @__PURE__ */
|
|
3211
|
+
/* @__PURE__ */ jsx21("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ jsx21("li", { children: err }, idx)) })
|
|
3245
3212
|
] }),
|
|
3246
|
-
!Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */
|
|
3247
|
-
!Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */
|
|
3248
|
-
/* @__PURE__ */
|
|
3249
|
-
procedure.parameters.map((param) => /* @__PURE__ */
|
|
3250
|
-
/* @__PURE__ */
|
|
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 }),
|
|
3215
|
+
/* @__PURE__ */ jsxs13("form", { onSubmit: handleSubmit, children: [
|
|
3216
|
+
procedure.parameters.map((param) => /* @__PURE__ */ jsx21("div", { children: renderInputField(param) }, param.name)),
|
|
3217
|
+
/* @__PURE__ */ jsx21(
|
|
3251
3218
|
Button7,
|
|
3252
3219
|
{
|
|
3253
3220
|
type: "submit",
|
|
@@ -3256,20 +3223,20 @@ var ProcedureForm = () => {
|
|
|
3256
3223
|
disabled: apiLoading || Object.values(validationErrors).some((err) => err !== null),
|
|
3257
3224
|
sx: { mt: 2 },
|
|
3258
3225
|
size: "medium",
|
|
3259
|
-
startIcon: apiLoading ? /* @__PURE__ */
|
|
3226
|
+
startIcon: apiLoading ? /* @__PURE__ */ jsx21(CircularProgress4, { size: 20, color: "inherit" }) : null,
|
|
3260
3227
|
children: apiLoading ? "Ejecutando..." : procedure.proceedLabel || "Ejecutar"
|
|
3261
3228
|
}
|
|
3262
3229
|
)
|
|
3263
3230
|
] }),
|
|
3264
|
-
ResultDisplayContent && /* @__PURE__ */
|
|
3231
|
+
ResultDisplayContent && /* @__PURE__ */ jsxs13(Box15, { sx: { mt: 2 }, children: [
|
|
3265
3232
|
" ",
|
|
3266
3233
|
ResultDisplayContent
|
|
3267
3234
|
] }),
|
|
3268
|
-
executionLog.length > 0 && /* @__PURE__ */
|
|
3269
|
-
/* @__PURE__ */
|
|
3270
|
-
/* @__PURE__ */
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
|
|
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,
|
|
3273
3240
|
{
|
|
3274
3241
|
sx: {
|
|
3275
3242
|
bgcolor: "grey.100",
|
|
@@ -3282,8 +3249,8 @@ var ProcedureForm = () => {
|
|
|
3282
3249
|
fontSize: "0.75rem",
|
|
3283
3250
|
whiteSpace: "pre-wrap"
|
|
3284
3251
|
},
|
|
3285
|
-
children: executionLog.map((log, index) => /* @__PURE__ */
|
|
3286
|
-
|
|
3252
|
+
children: executionLog.map((log, index) => /* @__PURE__ */ jsx21(
|
|
3253
|
+
Typography13,
|
|
3287
3254
|
{
|
|
3288
3255
|
component: "pre",
|
|
3289
3256
|
sx: {
|
|
@@ -3310,7 +3277,7 @@ import { PersistGate } from "redux-persist/integration/react";
|
|
|
3310
3277
|
// src/components/PrivateRoute.tsx
|
|
3311
3278
|
import { useEffect as useEffect5 } from "react";
|
|
3312
3279
|
import { Navigate, useLocation as useLocation2 } from "react-router-dom";
|
|
3313
|
-
import { Fragment as Fragment3, jsx as
|
|
3280
|
+
import { Fragment as Fragment3, jsx as jsx22 } from "react/jsx-runtime";
|
|
3314
3281
|
var PrivateRoute = ({ children }) => {
|
|
3315
3282
|
const location = useLocation2();
|
|
3316
3283
|
const dispatch = useAppDispatch();
|
|
@@ -3334,14 +3301,14 @@ var PrivateRoute = ({ children }) => {
|
|
|
3334
3301
|
}, [isAuthenticated, isLoadingAuth, location, dispatch, clientContextStatus]);
|
|
3335
3302
|
if (isLoadingAuth) {
|
|
3336
3303
|
console.log(`[PrivateRoute] Returning loading state...`);
|
|
3337
|
-
return /* @__PURE__ */
|
|
3304
|
+
return /* @__PURE__ */ jsx22("p", { children: "Verificando autenticaci\xF3n..." });
|
|
3338
3305
|
}
|
|
3339
3306
|
if (!isAuthenticated) {
|
|
3340
3307
|
console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
|
|
3341
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ jsx22(Navigate, { to: "/login", replace: true });
|
|
3342
3309
|
}
|
|
3343
3310
|
console.log(`[PrivateRoute] User authenticated, rendering children.`);
|
|
3344
|
-
return /* @__PURE__ */
|
|
3311
|
+
return /* @__PURE__ */ jsx22(Fragment3, { children });
|
|
3345
3312
|
};
|
|
3346
3313
|
var PrivateRoute_default = PrivateRoute;
|
|
3347
3314
|
|
|
@@ -3375,25 +3342,25 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
|
|
|
3375
3342
|
|
|
3376
3343
|
// src/pages/GenericDataGridPage.tsx
|
|
3377
3344
|
import { useParams as useParams2 } from "react-router-dom";
|
|
3378
|
-
import { Box as
|
|
3379
|
-
import { jsx as
|
|
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";
|
|
3380
3347
|
var GenericDataGridPage = () => {
|
|
3381
3348
|
const { tableName } = useParams2();
|
|
3382
3349
|
if (!tableName) {
|
|
3383
|
-
return /* @__PURE__ */
|
|
3384
|
-
/* @__PURE__ */
|
|
3385
|
-
/* @__PURE__ */
|
|
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`)." })
|
|
3386
3353
|
] }) });
|
|
3387
3354
|
}
|
|
3388
|
-
return /* @__PURE__ */
|
|
3355
|
+
return /* @__PURE__ */ jsx23(GenericDataGrid_default, { tableName, fixedFields: [] });
|
|
3389
3356
|
};
|
|
3390
3357
|
var GenericDataGridPage_default = GenericDataGridPage;
|
|
3391
3358
|
|
|
3392
3359
|
// src/pages/MenuTablePage.tsx
|
|
3393
3360
|
import { useMemo as useMemo5 } from "react";
|
|
3394
3361
|
import { useParams as useParams3 } from "react-router-dom";
|
|
3395
|
-
import { Box as
|
|
3396
|
-
import { jsx as
|
|
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";
|
|
3397
3364
|
var MenuTablePage = () => {
|
|
3398
3365
|
const { menuName } = useParams3();
|
|
3399
3366
|
const { clientContext } = useApp();
|
|
@@ -3435,12 +3402,12 @@ var MenuTablePage = () => {
|
|
|
3435
3402
|
};
|
|
3436
3403
|
}, [menuName, clientContext]);
|
|
3437
3404
|
if (!currentTableName) {
|
|
3438
|
-
return /* @__PURE__ */
|
|
3439
|
-
/* @__PURE__ */
|
|
3440
|
-
/* @__PURE__ */
|
|
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." })
|
|
3441
3408
|
] }) });
|
|
3442
3409
|
}
|
|
3443
|
-
return /* @__PURE__ */
|
|
3410
|
+
return /* @__PURE__ */ jsx24(
|
|
3444
3411
|
GenericDataGrid_default,
|
|
3445
3412
|
{
|
|
3446
3413
|
tableName: currentTableName,
|
|
@@ -3450,6 +3417,40 @@ var MenuTablePage = () => {
|
|
|
3450
3417
|
};
|
|
3451
3418
|
var MenuTablePage_default = MenuTablePage;
|
|
3452
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
|
+
|
|
3453
3454
|
// src/App.tsx
|
|
3454
3455
|
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3455
3456
|
var LocationTracker = () => {
|
|
@@ -3460,14 +3461,14 @@ var LocationTracker = () => {
|
|
|
3460
3461
|
}, [location, dispatch]);
|
|
3461
3462
|
return null;
|
|
3462
3463
|
};
|
|
3463
|
-
function FrontendPlusReactRoutes({ myRoutes, myWScreens }) {
|
|
3464
|
+
function FrontendPlusReactRoutes({ myRoutes, allWScreens: myWScreens }) {
|
|
3464
3465
|
const allWScreens = { ...wScreens, ...myWScreens || {} };
|
|
3465
3466
|
return /* @__PURE__ */ jsxs17(Routes, { children: [
|
|
3466
3467
|
/* @__PURE__ */ jsx26(Route, { path: "/login", element: /* @__PURE__ */ jsx26(LoginPage_default, {}) }),
|
|
3467
3468
|
/* @__PURE__ */ jsx26(Route, { path: "/logout", element: /* @__PURE__ */ jsx26(LogoutPage_default, {}) }),
|
|
3468
3469
|
/* @__PURE__ */ jsxs17(Route, { element: /* @__PURE__ */ jsxs17(PrivateRoute_default, { children: [
|
|
3469
3470
|
/* @__PURE__ */ jsx26(InitialRedirectHandler_default, {}),
|
|
3470
|
-
/* @__PURE__ */ jsx26(MainLayout_default, {})
|
|
3471
|
+
/* @__PURE__ */ jsx26(MainLayout_default, { allWScreens })
|
|
3471
3472
|
] }), children: [
|
|
3472
3473
|
/* @__PURE__ */ jsx26(Route, { path: "/", element: /* @__PURE__ */ jsx26(HomePage_default, {}) }),
|
|
3473
3474
|
/* @__PURE__ */ jsx26(Route, { path: "/home", element: /* @__PURE__ */ jsx26(HomePage_default, {}) }),
|
|
@@ -3478,7 +3479,7 @@ function FrontendPlusReactRoutes({ myRoutes, myWScreens }) {
|
|
|
3478
3479
|
Route,
|
|
3479
3480
|
{
|
|
3480
3481
|
path: `/wScreens/${screenName}`,
|
|
3481
|
-
element: React11.createElement(
|
|
3482
|
+
element: React11.createElement(allWScreens[screenName], { screenName })
|
|
3482
3483
|
},
|
|
3483
3484
|
screenName
|
|
3484
3485
|
)),
|
|
@@ -3516,7 +3517,7 @@ var App = ({
|
|
|
3516
3517
|
FrontendPlusReactRoutes,
|
|
3517
3518
|
{
|
|
3518
3519
|
myRoutes,
|
|
3519
|
-
myWScreens
|
|
3520
|
+
allWScreens: myWScreens
|
|
3520
3521
|
}
|
|
3521
3522
|
),
|
|
3522
3523
|
/* @__PURE__ */ jsx26(SessionExpiredMessage_default, {})
|