wcz-layout 6.2.2 → 6.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/Button.d.ts +3 -0
- package/dist/src/components/Button.js +9 -0
- package/dist/src/components/Button.js.map +1 -0
- package/dist/src/components/Dialog.js +3 -6
- package/dist/src/components/Dialog.js.map +1 -1
- package/dist/src/components/Layout.js +7 -6
- package/dist/src/components/Layout.js.map +1 -1
- package/dist/src/components/dataGrid/TableContainer.js +4 -0
- package/dist/src/components/dataGrid/TableContainer.js.map +1 -1
- package/dist/src/components/layout/LayoutDialog.d.ts +1 -1
- package/dist/src/components/layout/LayoutDialog.js +1 -6
- package/dist/src/components/layout/LayoutDialog.js.map +1 -1
- package/dist/src/models/KeycloakExtendedConfig.js.map +1 -1
- package/dist/src/next/Fetches.d.ts +5 -0
- package/dist/src/next/Fetches.js +61 -0
- package/dist/src/next/Fetches.js.map +1 -0
- package/dist/src/utils/Translations.d.ts +40 -0
- package/dist/src/utils/Translations.js +41 -0
- package/dist/src/utils/Translations.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/Layout.tsx +6 -4
- package/src/components/dataGrid/TableContainer.tsx +4 -0
- package/src/components/layout/LayoutDialog.tsx +2 -7
- package/dist/src/contexts/LayoutLocalizationProvider.d.ts +0 -2
- package/dist/src/contexts/LayoutLocalizationProvider.js +0 -15
- package/dist/src/contexts/LayoutLocalizationProvider.js.map +0 -1
- package/dist/src/hooks/UseDialog.d.ts +0 -14
- package/dist/src/hooks/UseDialog.js +0 -7
- package/dist/src/hooks/UseDialog.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button as MaterialButton } from "@mui/material";
|
|
3
|
+
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
|
4
|
+
export const Button = props => {
|
|
5
|
+
const isFetching = !!useIsFetching();
|
|
6
|
+
const isMutating = !!useIsMutating();
|
|
7
|
+
return _jsx(MaterialButton, { ...props, disabled: isFetching || isMutating || props.disabled });
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAe,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGrE,MAAM,CAAC,MAAM,MAAM,GAA0B,KAAK,CAAC,EAAE;IACjD,MAAM,UAAU,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC;IACrC,MAAM,UAAU,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC;IAErC,OAAO,KAAC,cAAc,OAAK,KAAK,EAAE,QAAQ,EAAE,UAAU,IAAI,UAAU,IAAI,KAAK,CAAC,QAAQ,GAAI,CAAC;AAC/F,CAAC,CAAC","sourcesContent":["import { Button as MaterialButton, ButtonProps } from \"@mui/material\";\r\nimport { useIsFetching, useIsMutating } from \"@tanstack/react-query\";\r\nimport React from \"react\";\r\n\r\nexport const Button: React.FC<ButtonProps> = props => {\r\n const isFetching = !!useIsFetching();\r\n const isMutating = !!useIsMutating();\r\n\r\n return <MaterialButton {...props} disabled={isFetching || isMutating || props.disabled} />;\r\n};"]}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Close } from "@mui/icons-material";
|
|
3
|
-
import { AppBar,
|
|
3
|
+
import { AppBar, DialogActions, DialogContent, DialogTitle, Grid, IconButton, Dialog as MaterialDialog, Toolbar, Typography, useMediaQuery } from "@mui/material";
|
|
4
4
|
import { useTheme } from "@mui/material/styles";
|
|
5
|
-
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
|
6
5
|
import { Fragment } from "react";
|
|
7
6
|
import { LayoutSnackbar } from "./LayoutSnackbar";
|
|
8
7
|
export const Dialog = ({ open, onClose, title, subtitle, children, color, maxWidth, actions, disablePadding, disableAutoClose }) => {
|
|
9
8
|
const theme = useTheme();
|
|
10
9
|
const fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
|
11
|
-
const isFetching = !!useIsFetching();
|
|
12
|
-
const isMutating = !!useIsMutating();
|
|
13
10
|
return (_jsxs(MaterialDialog, { open: open, onClose: disableAutoClose ? undefined : onClose, fullScreen: fullScreen, fullWidth: true, maxWidth: maxWidth, children: [fullScreen ?
|
|
14
|
-
|
|
11
|
+
_jsx(Fragment, { children: _jsx(AppBar, { sx: { position: "relative", bgcolor: `${color}.main` }, children: _jsxs(Toolbar, { children: [_jsxs(Typography, { sx: { flex: 1 }, variant: "h6", children: [title, subtitle && _jsx(Typography, { variant: "body2", sx: { opacity: 0.5 }, children: subtitle })] }), _jsx(IconButton, { edge: "start", onClick: onClose, children: _jsx(Close, { sx: { color: `${color}.contrastText` } }) })] }) }) })
|
|
15
12
|
:
|
|
16
|
-
|
|
13
|
+
_jsx(Fragment, { children: _jsxs(Grid, { container: true, justifyContent: "space-between", sx: { bgcolor: `${color}.main`, color: `${color}.contrastText` }, children: [_jsx(Grid, { item: true, xs: true, children: _jsxs(DialogTitle, { children: [title, subtitle && _jsx(Typography, { variant: "body2", sx: { opacity: 0.5 }, children: subtitle })] }) }), _jsx(Grid, { item: true, xs: 2, sx: { p: 1, textAlign: "right" }, children: _jsx(IconButton, { onClick: onClose, children: _jsx(Close, { fontSize: "small", sx: { color: `${color}.contrastText` } }) }) })] }) }), disablePadding ? children : _jsx(DialogContent, { children: children }), actions &&
|
|
17
14
|
_jsx(DialogActions, { children: actions.map(action => action) }), _jsx(LayoutSnackbar, {})] }));
|
|
18
15
|
};
|
|
19
16
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAc,
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAc,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,IAAI,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9K,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAelD,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,EAAE,EAAE;IACtJ,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE/D,OAAO,CACH,MAAC,cAAc,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,QAAC,QAAQ,EAAE,QAAQ,aAC5H,UAAU,CAAC,CAAC;gBACT,KAAC,QAAQ,cACL,KAAC,MAAM,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,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AErE,OAAO;gBACJ,KAAC,aAAa,cACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,GAClB,EAGpB,KAAC,cAAc,KAAG,IACL,CACpB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Close } from \"@mui/icons-material\";\r\nimport { AppBar, Breakpoint, DialogActions, DialogContent, DialogTitle, Grid, IconButton, Dialog as MaterialDialog, Toolbar, Typography, useMediaQuery } from \"@mui/material\";\r\nimport { useTheme } from \"@mui/material/styles\";\r\nimport { Fragment, ReactNode } from \"react\";\r\nimport { LayoutSnackbar } from \"./LayoutSnackbar\";\r\n\r\ninterface DialogProps {\r\n children?: ReactNode,\r\n title: string | ReactNode;\r\n subtitle?: string | ReactNode;\r\n open: boolean;\r\n onClose: () => void;\r\n color?: \"success\" | \"info\" | \"warning\" | \"error\" | \"primary\" | \"secondary\" | \"inherit\" | \"default\";\r\n maxWidth?: Breakpoint;\r\n actions?: ReactNode[];\r\n disablePadding?: boolean;\r\n disableAutoClose?: boolean;\r\n}\r\n\r\nexport const Dialog: React.FC<DialogProps> = ({ open, onClose, title, subtitle, children, color, maxWidth, actions, disablePadding, disableAutoClose }) => {\r\n const theme = useTheme();\r\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"sm\"));\r\n\r\n return (\r\n <MaterialDialog open={open} onClose={disableAutoClose ? undefined : onClose} fullScreen={fullScreen} fullWidth maxWidth={maxWidth}>\r\n {fullScreen ?\r\n <Fragment>\r\n <AppBar sx={{ position: \"relative\", bgcolor: `${color}.main` }}>\r\n <Toolbar>\r\n <Typography sx={{ flex: 1 }} variant=\"h6\">\r\n {title}\r\n {subtitle && <Typography variant=\"body2\" sx={{ opacity: 0.5 }}>{subtitle}</Typography>}\r\n </Typography>\r\n <IconButton edge=\"start\" onClick={onClose}>\r\n <Close sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Toolbar>\r\n </AppBar>\r\n </Fragment>\r\n :\r\n <Fragment>\r\n <Grid container justifyContent=\"space-between\" sx={{ bgcolor: `${color}.main`, color: `${color}.contrastText` }}>\r\n <Grid item xs>\r\n <DialogTitle>\r\n {title}\r\n {subtitle && <Typography variant=\"body2\" sx={{ opacity: 0.5 }}>{subtitle}</Typography>}\r\n </DialogTitle>\r\n </Grid>\r\n\r\n <Grid item xs={2} sx={{ p: 1, textAlign: \"right\" }}>\r\n <IconButton onClick={onClose}>\r\n <Close fontSize=\"small\" sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n </Fragment>\r\n }\r\n\r\n {disablePadding ? children : <DialogContent>{children}</DialogContent>}\r\n\r\n {actions &&\r\n <DialogActions>\r\n {actions.map(action => action)}\r\n </DialogActions>\r\n }\r\n\r\n <LayoutSnackbar />\r\n </MaterialDialog>\r\n );\r\n};\r\n"]}
|
|
@@ -58,7 +58,7 @@ const getAllRoutesWithPath = (routes) => {
|
|
|
58
58
|
return result;
|
|
59
59
|
};
|
|
60
60
|
export const Layout = ({ routes, colors, appVersion, user, notifications, setNotifications, children }) => {
|
|
61
|
-
var _a, _b;
|
|
61
|
+
var _a, _b, _c, _d, _e;
|
|
62
62
|
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
63
63
|
const [mode, setMode] = useLocalStorageState("mui-mode", { defaultValue: "system" });
|
|
64
64
|
const [leftDrawerOpen, setLeftDrawerOpen] = useState(false);
|
|
@@ -82,12 +82,13 @@ export const Layout = ({ routes, colors, appVersion, user, notifications, setNot
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
+
const resolvedMode = mode === "system" ? (prefersDarkMode ? "dark" : "light") : mode;
|
|
85
86
|
const theme = createTheme({
|
|
86
87
|
palette: {
|
|
87
|
-
mode:
|
|
88
|
-
primary: colors.primary,
|
|
89
|
-
secondary: colors.secondary,
|
|
90
|
-
background:
|
|
88
|
+
mode: resolvedMode,
|
|
89
|
+
primary: { main: ((_a = colors.primary) === null || _a === void 0 ? void 0 : _a[resolvedMode]) || ((_b = colors.primary) === null || _b === void 0 ? void 0 : _b.main), },
|
|
90
|
+
secondary: { main: ((_c = colors.secondary) === null || _c === void 0 ? void 0 : _c[resolvedMode]) || ((_d = colors.secondary) === null || _d === void 0 ? void 0 : _d.main), },
|
|
91
|
+
background: resolvedMode === "light" && colors.background ? { default: colors.background.default, paper: colors.background.paper, } : {},
|
|
91
92
|
},
|
|
92
93
|
components: {
|
|
93
94
|
MuiCssBaseline: {
|
|
@@ -116,7 +117,7 @@ export const Layout = ({ routes, colors, appVersion, user, notifications, setNot
|
|
|
116
117
|
},
|
|
117
118
|
},
|
|
118
119
|
}, i18n.language === "cs" ? datePickersCsCz : datePickersEnUs, i18n.language === "cs" ? dataGridCsCz : dataGridEnUs, i18n.language === "cs" ? csCZ : enUS);
|
|
119
|
-
const title = (
|
|
120
|
+
const title = (_e = route.pageTitle) !== null && _e !== void 0 ? _e : route.title;
|
|
120
121
|
useEffect(() => {
|
|
121
122
|
if (title)
|
|
122
123
|
document.title = title;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/components/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,IAAI,SAAS,EAAwC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAClL,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,kCAAkC,C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EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAI,IAC5G,CACnB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Menu } from \"@mui/icons-material\";\r\nimport { Box, Chip, CssBaseline, IconButton, LinearProgress, AppBar as MuiAppBar, AppBarProps as MuiAppBarProps, Theme, Toolbar, Typography, useMediaQuery } from \"@mui/material\";\r\nimport { grey } from \"@mui/material/colors\";\r\nimport { csCZ, enUS } from \"@mui/material/locale\";\r\nimport { ThemeProvider, createTheme, styled } from \"@mui/material/styles\";\r\nimport { csCZ as dataGridCsCz, enUS as dataGridEnUs } from \"@mui/x-data-grid-premium/locales\";\r\nimport { csCZ as datePickersCsCz, enUS as datePickersEnUs } from \"@mui/x-date-pickers-pro/locales\";\r\nimport { useIsFetching, useIsMutating } from \"@tanstack/react-query\";\r\nimport React, { Dispatch, SetStateAction, useEffect, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { matchPath, useLocation } from \"react-router-dom\";\r\nimport { LayoutPaletteColorOptions } from \"../models/LayoutPaletteColorOptions\";\r\nimport { LayoutRoute } from \"../models/LayoutRoute\";\r\nimport Notification from \"../models/Notification\";\r\nimport { User } from \"../models/User\";\r\nimport { environment } from \"../utils/Helpers\";\r\nimport { doLogin, initKeycloak, keycloak } from \"../utils/UserService\";\r\nimport { AccountMenu } from \"./layout/AccountMenu\";\r\nimport { DevelopmentBanner } from \"./layout/DevelopmentBanner\";\r\nimport { NavigationDrawer } from \"./layout/NavigationDrawer\";\r\nimport { NotificationMenu } from \"./layout/NotificationMenu\";\r\nimport { Unauthorized } from \"./layout/Unauthorized\";\r\nimport useLocalStorageState from \"use-local-storage-state\";\r\n\r\n//Drawer\r\nconst drawerWidth = 240;\r\nconst DrawerHeader = styled(\"div\")(({ theme }) => ({\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-end\",\r\n padding: theme.spacing(0, 1),\r\n // necessary for content to be below app bar\r\n ...theme.mixins.toolbar,\r\n}));\r\n\r\n//AppBar\r\ninterface AppBarProps extends MuiAppBarProps {\r\n open?: boolean;\r\n}\r\n\r\nconst AppBar = styled(MuiAppBar, {\r\n shouldForwardProp: (prop) => prop !== \"open\",\r\n})<AppBarProps>(({ theme, open }) => ({\r\n zIndex: theme.zIndex.drawer + 1,\r\n transition: theme.transitions.create([\"width\", \"margin\"], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.leavingScreen,\r\n }),\r\n ...(open && {\r\n marginLeft: drawerWidth,\r\n width: `calc(100% - ${drawerWidth}px)`,\r\n transition: theme.transitions.create([\"width\", \"margin\"], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.enteringScreen,\r\n }),\r\n }),\r\n}));\r\n\r\nconst getAllRoutesWithPath = (routes: LayoutRoute[]): LayoutRoute[] => {\r\n let result: LayoutRoute[] = [];\r\n for (const route of routes) {\r\n if (route.path) {\r\n result.push(route);\r\n }\r\n if (route.children) {\r\n result = result.concat(getAllRoutesWithPath(route.children));\r\n }\r\n }\r\n return result;\r\n};\r\n\r\ninterface LayoutProps {\r\n routes: LayoutRoute[];\r\n appVersion: string;\r\n colors: LayoutPaletteColorOptions;\r\n children: React.ReactNode;\r\n user: User;\r\n notifications: Notification[] | undefined;\r\n setNotifications: Dispatch<SetStateAction<Notification[] | undefined>>;\r\n}\r\n\r\nexport const Layout: React.FC<LayoutProps> = ({ routes, colors, appVersion, user, notifications, setNotifications, children }) => {\r\n const prefersDarkMode: boolean = useMediaQuery(\"(prefers-color-scheme: dark)\");\r\n const [mode, setMode] = useLocalStorageState<\"light\" | \"dark\" | \"system\">(\"mui-mode\", { defaultValue: \"system\" });\r\n const [leftDrawerOpen, setLeftDrawerOpen] = useState<boolean>(false);\r\n const { i18n } = useTranslation();\r\n const isFetching = !!useIsFetching();\r\n const isMutating = !!useIsMutating();\r\n const location = useLocation();\r\n const navigationRoutes = getAllRoutesWithPath(routes);\r\n const route = navigationRoutes.find(r => matchPath(r.path!, location.pathname))!;\r\n\r\n useEffect(() => {\r\n if (route.authenticated !== false && !user.isLoggedIn)\r\n initKeycloak();\r\n }, [route, user]);\r\n\r\n keycloak.onTokenExpired = async () => {\r\n try {\r\n await keycloak.updateToken(30);\r\n } catch {\r\n if (route.authenticated !== false) {\r\n await doLogin();\r\n }\r\n }\r\n };\r\n\r\n const theme: Theme = createTheme({\r\n palette: {\r\n mode: mode === \"system\" ? prefersDarkMode ? \"dark\" : \"light\" : mode,\r\n primary: colors.primary,\r\n secondary: colors.secondary,\r\n background: colors.background ?? {},\r\n },\r\n components: {\r\n MuiCssBaseline: {\r\n styleOverrides: (theme) => ({\r\n body: {\r\n \"&::-webkit-scrollbar, & *::-webkit-scrollbar\": {\r\n width: \"0.7em\",\r\n height: \"0.7em\",\r\n },\r\n \"&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[900] : grey[200],\r\n borderRadius: \"5px\",\r\n },\r\n \"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[800] : grey[400],\r\n borderRadius: \"10px\",\r\n },\r\n \"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[700] : grey[500],\r\n },\r\n \"&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner\": {\r\n backgroundColor: \"transparent\",\r\n },\r\n },\r\n }),\r\n },\r\n },\r\n },\r\n i18n.language === \"cs\" ? datePickersCsCz : datePickersEnUs,\r\n i18n.language === \"cs\" ? dataGridCsCz : dataGridEnUs,\r\n i18n.language === \"cs\" ? csCZ : enUS\r\n );\r\n\r\n const title = route.pageTitle ?? route.title;\r\n\r\n useEffect(() => {\r\n if (title) document.title = title;\r\n }, [title]);\r\n\r\n const toggleNavigationDrawer = () => setLeftDrawerOpen(!leftDrawerOpen);\r\n\r\n const hasNavigationRoutes: boolean = navigationRoutes.filter(route => route.showInMenu && !route.disabled).length > 1;\r\n\r\n return (\r\n <ThemeProvider theme={theme}>\r\n <Box sx={{ display: \"flex\", position: \"sticky\" }}>\r\n <CssBaseline />\r\n <AppBar position=\"fixed\" open={leftDrawerOpen}>\r\n <Toolbar>\r\n <IconButton color=\"inherit\" onClick={toggleNavigationDrawer} edge=\"start\" sx={{ marginRight: 2, ...((leftDrawerOpen || !hasNavigationRoutes) && { display: \"none\" }) }} >\r\n <Menu />\r\n </IconButton>\r\n\r\n <Typography variant=\"h6\" noWrap component=\"div\" sx={{ flexGrow: 1 }}>{title}</Typography>\r\n\r\n {environment !== \"production\" && <Chip sx={theme => ({ mr: 1, bgcolor: \"secondary.main\", color: theme.palette.primary.contrastText })} label={environment} />}\r\n\r\n <NotificationMenu notifications={notifications} setNotifications={setNotifications} />\r\n <AccountMenu mode={mode} setMode={setMode} user={user} />\r\n </Toolbar>\r\n </AppBar>\r\n\r\n <NavigationDrawer routes={navigationRoutes} appVersion={appVersion} open={leftDrawerOpen} setOpen={setLeftDrawerOpen} hasRoutes={hasNavigationRoutes} />\r\n\r\n <Box component=\"main\" sx={{ flex: 1, overflow: \"auto\" }}>\r\n <DrawerHeader />\r\n {(route.authenticated === false || user.isLoggedIn) && !route.disabled ? children : <Unauthorized />}\r\n </Box>\r\n </Box>\r\n\r\n <DevelopmentBanner user={user} hasNavigationRoutes={hasNavigationRoutes} />\r\n {(isFetching || isMutating) && <LinearProgress sx={{ position: \"fixed\", top: { xs: 56, sm: 64 }, left: 0, right: 0 }} />}\r\n </ThemeProvider>\r\n );\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/components/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE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B,GAAI,EACtF,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAI,IACnD,GACL,EAET,KAAC,gBAAgB,IAAC,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,mBAAmB,GAAI,EAExJ,MAAC,GAAG,IAAC,SAAS,EAAC,MAAM,EAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,aACnD,KAAC,YAAY,KAAG,EACf,CAAC,KAAK,CAAC,aAAa,KAAK,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,YAAY,KAAG,IAClG,IACJ,EAEN,KAAC,iBAAiB,IAAC,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,mBAAmB,GAAI,EAC1E,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,KAAC,cAAc,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAI,IAC5G,CACnB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Menu } from \"@mui/icons-material\";\r\nimport { Box, Chip, CssBaseline, IconButton, LinearProgress, AppBar as MuiAppBar, AppBarProps as MuiAppBarProps, Theme, Toolbar, Typography, useMediaQuery } from \"@mui/material\";\r\nimport { grey } from \"@mui/material/colors\";\r\nimport { csCZ, enUS } from \"@mui/material/locale\";\r\nimport { ThemeProvider, createTheme, styled } from \"@mui/material/styles\";\r\nimport { csCZ as dataGridCsCz, enUS as dataGridEnUs } from \"@mui/x-data-grid-premium/locales\";\r\nimport { csCZ as datePickersCsCz, enUS as datePickersEnUs } from \"@mui/x-date-pickers-pro/locales\";\r\nimport { useIsFetching, useIsMutating } from \"@tanstack/react-query\";\r\nimport React, { Dispatch, SetStateAction, useEffect, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { matchPath, useLocation } from \"react-router-dom\";\r\nimport { LayoutPaletteColorOptions } from \"../models/LayoutPaletteColorOptions\";\r\nimport { LayoutRoute } from \"../models/LayoutRoute\";\r\nimport Notification from \"../models/Notification\";\r\nimport { User } from \"../models/User\";\r\nimport { environment } from \"../utils/Helpers\";\r\nimport { doLogin, initKeycloak, keycloak } from \"../utils/UserService\";\r\nimport { AccountMenu } from \"./layout/AccountMenu\";\r\nimport { DevelopmentBanner } from \"./layout/DevelopmentBanner\";\r\nimport { NavigationDrawer } from \"./layout/NavigationDrawer\";\r\nimport { NotificationMenu } from \"./layout/NotificationMenu\";\r\nimport { Unauthorized } from \"./layout/Unauthorized\";\r\nimport useLocalStorageState from \"use-local-storage-state\";\r\n\r\n//Drawer\r\nconst drawerWidth = 240;\r\nconst DrawerHeader = styled(\"div\")(({ theme }) => ({\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-end\",\r\n padding: theme.spacing(0, 1),\r\n // necessary for content to be below app bar\r\n ...theme.mixins.toolbar,\r\n}));\r\n\r\n//AppBar\r\ninterface AppBarProps extends MuiAppBarProps {\r\n open?: boolean;\r\n}\r\n\r\nconst AppBar = styled(MuiAppBar, {\r\n shouldForwardProp: (prop) => prop !== \"open\",\r\n})<AppBarProps>(({ theme, open }) => ({\r\n zIndex: theme.zIndex.drawer + 1,\r\n transition: theme.transitions.create([\"width\", \"margin\"], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.leavingScreen,\r\n }),\r\n ...(open && {\r\n marginLeft: drawerWidth,\r\n width: `calc(100% - ${drawerWidth}px)`,\r\n transition: theme.transitions.create([\"width\", \"margin\"], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.enteringScreen,\r\n }),\r\n }),\r\n}));\r\n\r\nconst getAllRoutesWithPath = (routes: LayoutRoute[]): LayoutRoute[] => {\r\n let result: LayoutRoute[] = [];\r\n for (const route of routes) {\r\n if (route.path) {\r\n result.push(route);\r\n }\r\n if (route.children) {\r\n result = result.concat(getAllRoutesWithPath(route.children));\r\n }\r\n }\r\n return result;\r\n};\r\n\r\ninterface LayoutProps {\r\n routes: LayoutRoute[];\r\n appVersion: string;\r\n colors: LayoutPaletteColorOptions;\r\n children: React.ReactNode;\r\n user: User;\r\n notifications: Notification[] | undefined;\r\n setNotifications: Dispatch<SetStateAction<Notification[] | undefined>>;\r\n}\r\n\r\nexport const Layout: React.FC<LayoutProps> = ({ routes, colors, appVersion, user, notifications, setNotifications, children }) => {\r\n const prefersDarkMode: boolean = useMediaQuery(\"(prefers-color-scheme: dark)\");\r\n const [mode, setMode] = useLocalStorageState<\"light\" | \"dark\" | \"system\">(\"mui-mode\", { defaultValue: \"system\" });\r\n const [leftDrawerOpen, setLeftDrawerOpen] = useState<boolean>(false);\r\n const { i18n } = useTranslation();\r\n const isFetching = !!useIsFetching();\r\n const isMutating = !!useIsMutating();\r\n const location = useLocation();\r\n const navigationRoutes = getAllRoutesWithPath(routes);\r\n const route = navigationRoutes.find(r => matchPath(r.path!, location.pathname))!;\r\n\r\n useEffect(() => {\r\n if (route.authenticated !== false && !user.isLoggedIn)\r\n initKeycloak();\r\n }, [route, user]);\r\n\r\n keycloak.onTokenExpired = async () => {\r\n try {\r\n await keycloak.updateToken(30);\r\n } catch {\r\n if (route.authenticated !== false) {\r\n await doLogin();\r\n }\r\n }\r\n };\r\n\r\n const resolvedMode = mode === \"system\" ? (prefersDarkMode ? \"dark\" : \"light\") : mode;\r\n\r\n const theme: Theme = createTheme({\r\n palette: {\r\n mode: resolvedMode,\r\n primary: { main: (colors.primary as any)?.[resolvedMode] || (colors.primary as any)?.main, },\r\n secondary: { main: (colors.secondary as any)?.[resolvedMode] || (colors.secondary as any)?.main, },\r\n background: resolvedMode === \"light\" && colors.background ? { default: colors.background.default, paper: colors.background.paper, } : {},\r\n },\r\n components: {\r\n MuiCssBaseline: {\r\n styleOverrides: (theme) => ({\r\n body: {\r\n \"&::-webkit-scrollbar, & *::-webkit-scrollbar\": {\r\n width: \"0.7em\",\r\n height: \"0.7em\",\r\n },\r\n \"&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[900] : grey[200],\r\n borderRadius: \"5px\",\r\n },\r\n \"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[800] : grey[400],\r\n borderRadius: \"10px\",\r\n },\r\n \"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[700] : grey[500],\r\n },\r\n \"&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner\": {\r\n backgroundColor: \"transparent\",\r\n },\r\n },\r\n }),\r\n },\r\n },\r\n },\r\n i18n.language === \"cs\" ? datePickersCsCz : datePickersEnUs,\r\n i18n.language === \"cs\" ? dataGridCsCz : dataGridEnUs,\r\n i18n.language === \"cs\" ? csCZ : enUS\r\n );\r\n\r\n const title = route.pageTitle ?? route.title;\r\n\r\n useEffect(() => {\r\n if (title) document.title = title;\r\n }, [title]);\r\n\r\n const toggleNavigationDrawer = () => setLeftDrawerOpen(!leftDrawerOpen);\r\n\r\n const hasNavigationRoutes: boolean = navigationRoutes.filter(route => route.showInMenu && !route.disabled).length > 1;\r\n\r\n return (\r\n <ThemeProvider theme={theme}>\r\n <Box sx={{ display: \"flex\", position: \"sticky\" }}>\r\n <CssBaseline />\r\n <AppBar position=\"fixed\" open={leftDrawerOpen}>\r\n <Toolbar>\r\n <IconButton color=\"inherit\" onClick={toggleNavigationDrawer} edge=\"start\" sx={{ marginRight: 2, ...((leftDrawerOpen || !hasNavigationRoutes) && { display: \"none\" }) }} >\r\n <Menu />\r\n </IconButton>\r\n\r\n <Typography variant=\"h6\" noWrap component=\"div\" sx={{ flexGrow: 1 }}>{title}</Typography>\r\n\r\n {environment !== \"production\" && <Chip sx={theme => ({ mr: 1, bgcolor: \"secondary.main\", color: theme.palette.primary.contrastText })} label={environment} />}\r\n\r\n <NotificationMenu notifications={notifications} setNotifications={setNotifications} />\r\n <AccountMenu mode={mode} setMode={setMode} user={user} />\r\n </Toolbar>\r\n </AppBar>\r\n\r\n <NavigationDrawer routes={navigationRoutes} appVersion={appVersion} open={leftDrawerOpen} setOpen={setLeftDrawerOpen} hasRoutes={hasNavigationRoutes} />\r\n\r\n <Box component=\"main\" sx={{ flex: 1, overflow: \"auto\" }}>\r\n <DrawerHeader />\r\n {(route.authenticated === false || user.isLoggedIn) && !route.disabled ? children : <Unauthorized />}\r\n </Box>\r\n </Box>\r\n\r\n <DevelopmentBanner user={user} hasNavigationRoutes={hasNavigationRoutes} />\r\n {(isFetching || isMutating) && <LinearProgress sx={{ position: \"fixed\", top: { xs: 56, sm: 64 }, left: 0, right: 0 }} />}\r\n </ThemeProvider>\r\n );\r\n};\r\n"]}
|
|
@@ -12,6 +12,10 @@ export const TableContainer = ({ sx, ...props }) => {
|
|
|
12
12
|
"& .MuiDataGrid-columnHeaderTitle": {
|
|
13
13
|
fontWeight: "600",
|
|
14
14
|
},
|
|
15
|
+
"& .MuiDataGrid-cell": {
|
|
16
|
+
display: "flex",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
},
|
|
15
19
|
"& .Mui-error": {
|
|
16
20
|
backgroundColor: theme.palette.error.main,
|
|
17
21
|
color: theme.palette.error.contrastText
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableContainer.js","sourceRoot":"","sources":["../../../../src/components/dataGrid/TableContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGxD,MAAM,CAAC,MAAM,cAAc,GAAuB,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACnE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,OAAO,CACH,KAAC,GAAG,OACI,KAAK,EACT,EAAE,EAAE;YACA,MAAM,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,EAAE,EAAE,oBAAoB,EAAE;YAC9D,8BAA8B,EAAE;gBAC5B,sBAAsB,EAAE;oBACpB,MAAM,EAAE,MAAM;iBACjB;aACJ;YACD,kCAAkC,EAAE;gBAChC,UAAU,EAAE,KAAK;aACpB;YACD,cAAc,EAAE;gBACZ,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI;gBACzC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY;aAC1C;YACD,iDAAiD,EAAE;gBAC/C,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,YAAY;aACnD;YACD,kDAAkD,EAAE;gBAChD,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,YAAY;aACjD;YACD,GAAG,EAAE;SACR,YACA,KAAK,CAAC,QAAQ,GACb,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Box, BoxProps, useTheme } from \"@mui/material\";\r\nimport React from \"react\";\r\n\r\nexport const TableContainer: React.FC<BoxProps> = ({ sx, ...props }) => {\r\n const theme = useTheme();\r\n\r\n return (\r\n <Box\r\n {...props}\r\n sx={{\r\n height: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" },\r\n \"& .MuiDataGrid-cell--editing\": {\r\n \"& .MuiInputBase-root\": {\r\n height: \"100%\",\r\n },\r\n },\r\n \"& .MuiDataGrid-columnHeaderTitle\": {\r\n fontWeight: \"600\",\r\n },\r\n \"& .Mui-error\": {\r\n backgroundColor: theme.palette.error.main,\r\n color: theme.palette.error.contrastText\r\n },\r\n \"& .MuiDataGrid-booleanCell[data-value=\\\"true\\\"]\": {\r\n color: `${theme.palette.success.main}!important`\r\n },\r\n \"& .MuiDataGrid-booleanCell[data-value=\\\"false\\\"]\": {\r\n color: `${theme.palette.error.main}!important`\r\n },\r\n ...sx\r\n }}>\r\n {props.children}\r\n </Box>\r\n );\r\n};"]}
|
|
1
|
+
{"version":3,"file":"TableContainer.js","sourceRoot":"","sources":["../../../../src/components/dataGrid/TableContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGxD,MAAM,CAAC,MAAM,cAAc,GAAuB,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACnE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,OAAO,CACH,KAAC,GAAG,OACI,KAAK,EACT,EAAE,EAAE;YACA,MAAM,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,EAAE,EAAE,oBAAoB,EAAE;YAC9D,8BAA8B,EAAE;gBAC5B,sBAAsB,EAAE;oBACpB,MAAM,EAAE,MAAM;iBACjB;aACJ;YACD,kCAAkC,EAAE;gBAChC,UAAU,EAAE,KAAK;aACpB;YACD,qBAAqB,EAAE;gBACnB,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,QAAQ;aACvB;YACD,cAAc,EAAE;gBACZ,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI;gBACzC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY;aAC1C;YACD,iDAAiD,EAAE;gBAC/C,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,YAAY;aACnD;YACD,kDAAkD,EAAE;gBAChD,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,YAAY;aACjD;YACD,GAAG,EAAE;SACR,YACA,KAAK,CAAC,QAAQ,GACb,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Box, BoxProps, useTheme } from \"@mui/material\";\r\nimport React from \"react\";\r\n\r\nexport const TableContainer: React.FC<BoxProps> = ({ sx, ...props }) => {\r\n const theme = useTheme();\r\n\r\n return (\r\n <Box\r\n {...props}\r\n sx={{\r\n height: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" },\r\n \"& .MuiDataGrid-cell--editing\": {\r\n \"& .MuiInputBase-root\": {\r\n height: \"100%\",\r\n },\r\n },\r\n \"& .MuiDataGrid-columnHeaderTitle\": {\r\n fontWeight: \"600\",\r\n },\r\n \"& .MuiDataGrid-cell\": {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n },\r\n \"& .Mui-error\": {\r\n backgroundColor: theme.palette.error.main,\r\n color: theme.palette.error.contrastText\r\n },\r\n \"& .MuiDataGrid-booleanCell[data-value=\\\"true\\\"]\": {\r\n color: `${theme.palette.success.main}!important`\r\n },\r\n \"& .MuiDataGrid-booleanCell[data-value=\\\"false\\\"]\": {\r\n color: `${theme.palette.error.main}!important`\r\n },\r\n ...sx\r\n }}>\r\n {props.children}\r\n </Box>\r\n );\r\n};"]}
|
|
@@ -2,7 +2,7 @@ import { Breakpoint } from "@mui/material";
|
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
interface DialogProps {
|
|
4
4
|
open: boolean;
|
|
5
|
-
onClose: () => void;
|
|
5
|
+
onClose: (_event?: {}, reason?: "backdropClick" | "escapeKeyDown") => void;
|
|
6
6
|
title: string | ReactNode;
|
|
7
7
|
color?: "success" | "info" | "warning" | "error" | "primary" | "secondary" | "inherit" | "default";
|
|
8
8
|
maxWidth?: Breakpoint;
|
|
@@ -4,12 +4,7 @@ import { AppBar, Dialog, DialogTitle, Grid2, IconButton, Toolbar, Typography, us
|
|
|
4
4
|
export const LayoutDialog = ({ open, onClose, title, color, maxWidth, children }) => {
|
|
5
5
|
const theme = useTheme();
|
|
6
6
|
const fullscreen = useMediaQuery(theme.breakpoints.down("sm"));
|
|
7
|
-
|
|
8
|
-
if (reason === "backdropClick")
|
|
9
|
-
return;
|
|
10
|
-
onClose();
|
|
11
|
-
};
|
|
12
|
-
return (_jsxs(Dialog, { open: open, onClose: closeDialog, fullScreen: fullscreen, fullWidth: true, maxWidth: maxWidth, children: [fullscreen ?
|
|
7
|
+
return (_jsxs(Dialog, { open: open, onClose: onClose, fullScreen: fullscreen, fullWidth: true, maxWidth: maxWidth, children: [fullscreen ?
|
|
13
8
|
_jsx(AppBar, { sx: { position: "relative", bgcolor: `${color}.main` }, children: _jsxs(Toolbar, { children: [_jsx(Typography, { sx: { flex: 1 }, variant: "h6", children: title }), _jsx(IconButton, { onClick: onClose, children: _jsx(Close, { sx: { color: `${color}.contrastText` } }) })] }) })
|
|
14
9
|
:
|
|
15
10
|
_jsxs(Grid2, { container: true, justifyContent: "space-between", sx: { bgcolor: `${color}.main`, color: `${color}.contrastText` }, children: [_jsx(Grid2, { children: _jsx(DialogTitle, { children: title }) }), _jsx(Grid2, { size: 2, sx: { p: 1, textAlign: "right" }, children: _jsx(IconButton, { onClick: onClose, children: _jsx(Close, { fontSize: "small", sx: { color: `${color}.contrastText` } }) }) })] }), open ? children : null] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutDialog.js","sourceRoot":"","sources":["../../../../src/components/layout/LayoutDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAc,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAYzI,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,Q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AAK,EAAE,GAAG,KAAK,eAAe,EAAE,GAAI,GACxC,IACP,GACL;gBACT,CAAC;oBACD,MAAC,KAAK,IAAC,SAAS,QAAC,cAAc,EAAC,eAAe,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,eAAe,EAAE,aAC5G,KAAC,KAAK,cACF,KAAC,WAAW,cACP,KAAK,GACI,GACV,EAER,KAAC,KAAK,IAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,YAC5C,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,YACxB,KAAC,KAAK,IAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,eAAe,EAAE,GAAI,GACzD,GACT,IACJ,EAGX,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IACjB,CACb,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Close } from \"@mui/icons-material\";\r\nimport { AppBar, Breakpoint, Dialog, DialogTitle, Grid2, IconButton, Toolbar, Typography, useMediaQuery, useTheme } from \"@mui/material\";\r\nimport { ReactNode } from \"react\";\r\n\r\ninterface DialogProps {\r\n open: boolean;\r\n onClose: (_event?: {}, reason?: \"backdropClick\" | \"escapeKeyDown\") => void;\r\n title: string | ReactNode;\r\n color?: \"success\" | \"info\" | \"warning\" | \"error\" | \"primary\" | \"secondary\" | \"inherit\" | \"default\";\r\n maxWidth?: Breakpoint;\r\n children?: ReactNode;\r\n}\r\n\r\nexport const LayoutDialog: React.FC<DialogProps> = ({ open, onClose, title, color, maxWidth, children }) => {\r\n const theme = useTheme();\r\n const fullscreen = useMediaQuery(theme.breakpoints.down(\"sm\"));\r\n\r\n return (\r\n <Dialog open={open} onClose={onClose} fullScreen={fullscreen} fullWidth maxWidth={maxWidth}>\r\n {fullscreen ?\r\n <AppBar sx={{ position: \"relative\", bgcolor: `${color}.main` }}>\r\n <Toolbar>\r\n <Typography sx={{ flex: 1 }} variant=\"h6\">\r\n {title}\r\n </Typography>\r\n <IconButton onClick={onClose}>\r\n <Close sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Toolbar>\r\n </AppBar>\r\n :\r\n <Grid2 container justifyContent=\"space-between\" sx={{ bgcolor: `${color}.main`, color: `${color}.contrastText` }}>\r\n <Grid2>\r\n <DialogTitle>\r\n {title}\r\n </DialogTitle>\r\n </Grid2>\r\n\r\n <Grid2 size={2} sx={{ p: 1, textAlign: \"right\" }}>\r\n <IconButton onClick={onClose}>\r\n <Close fontSize=\"small\" sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Grid2>\r\n </Grid2>\r\n }\r\n\r\n {open ? children : null}\r\n </Dialog >\r\n );\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeycloakExtendedConfig.js","sourceRoot":"","sources":["../../../src/models/KeycloakExtendedConfig.ts"],"names":[],"mappings":"","sourcesContent":["export default interface KeycloakExtendedConfig {\
|
|
1
|
+
{"version":3,"file":"KeycloakExtendedConfig.js","sourceRoot":"","sources":["../../../src/models/KeycloakExtendedConfig.ts"],"names":[],"mappings":"","sourcesContent":["export default interface KeycloakExtendedConfig {\n autoLogin?: boolean,\n confidential?: Confidential,\n realm: string,\n \"auth-server-url\": string,\n idpHint?: string\n}\n\nexport interface Confidential {\n client: string,\n secret: string\n}"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const fetchGet: (url: string, signal: AbortSignal | undefined) => Promise<any>;
|
|
2
|
+
export declare const fetchFileGet: (url: string, signal: AbortSignal | undefined) => Promise<Blob>;
|
|
3
|
+
export declare const fetchPost: (url: string, data: unknown) => Promise<any>;
|
|
4
|
+
export declare const fetchPut: (url: string, data: unknown) => Promise<Response>;
|
|
5
|
+
export declare const fetchDelete: (url: string) => Promise<Response>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { getToken } from "../utils/UserService";
|
|
2
|
+
export const fetchGet = async (url, signal) => {
|
|
3
|
+
const initReq = await getRequestInit("GET", null, signal);
|
|
4
|
+
const response = await fetch(url, initReq);
|
|
5
|
+
if (!response.ok)
|
|
6
|
+
throw await response.json();
|
|
7
|
+
return response.json();
|
|
8
|
+
};
|
|
9
|
+
export const fetchFileGet = async (url, signal) => {
|
|
10
|
+
const initReq = await getRequestInit("GET", null, signal);
|
|
11
|
+
const response = await fetch(url, initReq);
|
|
12
|
+
if (!response.ok)
|
|
13
|
+
throw await response.json();
|
|
14
|
+
return response.blob();
|
|
15
|
+
};
|
|
16
|
+
export const fetchPost = async (url, data) => {
|
|
17
|
+
const initReq = await getRequestInit("POST", data);
|
|
18
|
+
const response = await fetch(url, initReq);
|
|
19
|
+
if (!response.ok)
|
|
20
|
+
throw await response.json();
|
|
21
|
+
return response.json();
|
|
22
|
+
};
|
|
23
|
+
export const fetchPut = async (url, data) => {
|
|
24
|
+
const initReq = await getRequestInit("PUT", data);
|
|
25
|
+
const response = await fetch(url, initReq);
|
|
26
|
+
if (!response.ok)
|
|
27
|
+
throw await response.json();
|
|
28
|
+
return response;
|
|
29
|
+
};
|
|
30
|
+
export const fetchDelete = async (url) => {
|
|
31
|
+
const initReq = await getRequestInit("DELETE");
|
|
32
|
+
const response = await fetch(url, initReq);
|
|
33
|
+
if (!response.ok)
|
|
34
|
+
throw await response.json();
|
|
35
|
+
return response;
|
|
36
|
+
};
|
|
37
|
+
const getRequestInit = async (method, data, signal) => {
|
|
38
|
+
const request = {
|
|
39
|
+
method: method,
|
|
40
|
+
signal: signal,
|
|
41
|
+
credentials: "include"
|
|
42
|
+
};
|
|
43
|
+
if (data) {
|
|
44
|
+
if (data instanceof FormData)
|
|
45
|
+
request.body = data;
|
|
46
|
+
else
|
|
47
|
+
request.body = JSON.stringify(data);
|
|
48
|
+
}
|
|
49
|
+
if (data instanceof FormData)
|
|
50
|
+
request.headers = {
|
|
51
|
+
"Authorization": `Bearer ${await getToken()}`
|
|
52
|
+
};
|
|
53
|
+
else {
|
|
54
|
+
request.headers = {
|
|
55
|
+
"Content-Type": "application/json",
|
|
56
|
+
"Authorization": `Bearer ${await getToken()}`
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return request;
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=Fetches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fetches.js","sourceRoot":"","sources":["../../../src/next/Fetches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAAE,GAAW,EAAE,MAA+B,EAAgB,EAAE;IACzF,MAAM,OAAO,GAAgB,MAAM,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAEvE,MAAM,QAAQ,GAAa,MAAM,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACrD,IAAI,CAAC,QAAQ,CAAC,EAAE;QACZ,MAAM,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEhC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,GAAW,EAAE,MAA+B,EAAiB,EAAE;IAC9F,MAAM,OAAO,GAAgB,MAAM,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAEvE,MAAM,QAAQ,GAAa,MAAM,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACrD,IAAI,CAAC,QAAQ,CAAC,EAAE;QACZ,MAAM,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEhC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,S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AAC;IAEF,IAAI,IAAI,EAAE;QACN,IAAI,IAAI,YAAY,QAAQ;YACxB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;;YAEpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;KAC3C;IAED,IAAI,IAAI,YAAY,QAAQ;QACxB,OAAO,CAAC,OAAO,GAAG;YACd,eAAe,EAAE,UAAU,MAAM,QAAQ,EAAE,EAAE;SAChD,CAAC;SACD;QACD,OAAO,CAAC,OAAO,GAAG;YACd,cAAc,EAAE,kBAAkB;YAClC,eAAe,EAAE,UAAU,MAAM,QAAQ,EAAE,EAAE;SAChD,CAAC;KACL;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import { getToken } from \"../utils/UserService\";\r\n\r\nexport const fetchGet = async (url: string, signal: AbortSignal | undefined): Promise<any> => {\r\n const initReq: RequestInit = await getRequestInit(\"GET\", null, signal);\r\n\r\n const response: Response = await fetch(url, initReq);\r\n if (!response.ok)\r\n throw await response.json();\r\n\r\n return response.json();\r\n};\r\n\r\nexport const fetchFileGet = async (url: string, signal: AbortSignal | undefined): Promise<Blob> => {\r\n const initReq: RequestInit = await getRequestInit(\"GET\", null, signal);\r\n\r\n const response: Response = await fetch(url, initReq);\r\n if (!response.ok)\r\n throw await response.json();\r\n\r\n return response.blob();\r\n};\r\n\r\nexport const fetchPost = async (url: string, data: unknown): Promise<any> => {\r\n const initReq: RequestInit = await getRequestInit(\"POST\", data);\r\n\r\n const response: Response = await fetch(url, initReq);\r\n if (!response.ok)\r\n throw await response.json();\r\n\r\n return response.json();\r\n};\r\n\r\nexport const fetchPut = async (url: string, data: unknown): Promise<Response> => {\r\n const initReq: RequestInit = await getRequestInit(\"PUT\", data);\r\n\r\n const response: Response = await fetch(url, initReq);\r\n if (!response.ok)\r\n throw await response.json();\r\n\r\n return response;\r\n};\r\n\r\nexport const fetchDelete = async (url: string): Promise<Response> => {\r\n const initReq: RequestInit = await getRequestInit(\"DELETE\");\r\n\r\n const response: Response = await fetch(url, initReq);\r\n if (!response.ok)\r\n throw await response.json();\r\n\r\n return response;\r\n};\r\n\r\nconst getRequestInit = async (method: string, data?: unknown, signal?: AbortSignal): Promise<RequestInit> => {\r\n const request: RequestInit = {\r\n method: method,\r\n signal: signal,\r\n credentials: \"include\"\r\n };\r\n\r\n if (data) {\r\n if (data instanceof FormData)\r\n request.body = data;\r\n else\r\n request.body = JSON.stringify(data);\r\n }\r\n\r\n if (data instanceof FormData)\r\n request.headers = {\r\n \"Authorization\": `Bearer ${await getToken()}`\r\n };\r\n else {\r\n request.headers = {\r\n \"Content-Type\": \"application/json\",\r\n \"Authorization\": `Bearer ${await getToken()}`\r\n };\r\n }\r\n\r\n return request;\r\n};"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const resources: {
|
|
2
|
+
en: {
|
|
3
|
+
translation: {
|
|
4
|
+
Layout: {
|
|
5
|
+
Logout: string;
|
|
6
|
+
LogIn: string;
|
|
7
|
+
Language: string;
|
|
8
|
+
Appearance: string;
|
|
9
|
+
Light: string;
|
|
10
|
+
Dark: string;
|
|
11
|
+
System: string;
|
|
12
|
+
Home: string;
|
|
13
|
+
Settings: string;
|
|
14
|
+
Version: string;
|
|
15
|
+
Unauthorized: string;
|
|
16
|
+
DevelopmentDialogTitle: string;
|
|
17
|
+
DevelopmentDialogContent: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
cs: {
|
|
22
|
+
translation: {
|
|
23
|
+
Layout: {
|
|
24
|
+
Logout: string;
|
|
25
|
+
LogIn: string;
|
|
26
|
+
Language: string;
|
|
27
|
+
Appearance: string;
|
|
28
|
+
Light: string;
|
|
29
|
+
Dark: string;
|
|
30
|
+
System: string;
|
|
31
|
+
Home: string;
|
|
32
|
+
Settings: string;
|
|
33
|
+
Version: string;
|
|
34
|
+
Unauthorized: string;
|
|
35
|
+
DevelopmentDialogTitle: string;
|
|
36
|
+
DevelopmentDialogContent: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const resources = {
|
|
2
|
+
en: {
|
|
3
|
+
translation: {
|
|
4
|
+
Layout: {
|
|
5
|
+
"Logout": "Logout",
|
|
6
|
+
"LogIn": "Log In",
|
|
7
|
+
"Language": "Language",
|
|
8
|
+
"Appearance": "Appearance",
|
|
9
|
+
"Light": "Light",
|
|
10
|
+
"Dark": "Dark",
|
|
11
|
+
"System": "System",
|
|
12
|
+
"Home": "Home",
|
|
13
|
+
"Settings": "Settings",
|
|
14
|
+
"Version": "Version",
|
|
15
|
+
"Unauthorized": "Unauthorized",
|
|
16
|
+
"DevelopmentDialogTitle": "Testing environment",
|
|
17
|
+
"DevelopmentDialogContent": "You are accessing a test environment. Data integrity is not guaranteed and application behavior may be unpredictable. Please proceed with caution and report any unexpected behavior to the development team."
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
cs: {
|
|
22
|
+
translation: {
|
|
23
|
+
Layout: {
|
|
24
|
+
"Logout": "Odhlásit se",
|
|
25
|
+
"LogIn": "Přihlásit se",
|
|
26
|
+
"Language": "Jazyk",
|
|
27
|
+
"Appearance": "Vzhled",
|
|
28
|
+
"Light": "Světlý",
|
|
29
|
+
"Dark": "Tmavý",
|
|
30
|
+
"System": "Systém",
|
|
31
|
+
"Home": "Domů",
|
|
32
|
+
"Settings": "Nastavení",
|
|
33
|
+
"Version": "Verze",
|
|
34
|
+
"Unauthorized": "Neoprávněný",
|
|
35
|
+
"DevelopmentDialogTitle": "Testovací prostředí",
|
|
36
|
+
"DevelopmentDialogContent": "Vstupujete do testovacího prostředí. Integrita dat není zaručena a chování aplikace může být nepředvídatelné. Prosím, buďte opatrní a jakékoli neočekávané chování ihned hláste vývojovému týmu."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=Translations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Translations.js","sourceRoot":"","sources":["../../../src/utils/Translations.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,EAAE,EAAE;QACA,WAAW,EAAE;YACT,MAAM,EAAE;gBACJ,QAAQ,EAAE,QAAQ;gBAClB,OAAO,EAAE,QAAQ;gBACjB,UAAU,EAAE,UAAU;gBACtB,YAAY,EAAE,YAAY;gBAC1B,OAAO,EAAE,OAAO;gBAChB,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,QAAQ;gBAClB,MAAM,EAAE,MAAM;gBACd,UAAU,EAAE,UAAU;gBACtB,SAAS,EAAE,SAAS;gBACpB,cAAc,EAAE,cAAc;gBAC9B,wBAAwB,EAAE,qBAAqB;gBAC/C,0BAA0B,EAAE,+MAA+M;aAC9O;SACJ;KACJ;IACD,EAAE,EAAE;QACA,WAAW,EAAE;YACT,MAAM,EAAE;gBACJ,QAAQ,EAAE,aAAa;gBACvB,OAAO,EAAE,cAAc;gBACvB,UAAU,EAAE,OAAO;gBACnB,YAAY,EAAE,QAAQ;gBACtB,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE,OAAO;gBACf,QAAQ,EAAE,QAAQ;gBAClB,MAAM,EAAE,MAAM;gBACd,UAAU,EAAE,WAAW;gBACvB,SAAS,EAAE,OAAO;gBAClB,cAAc,EAAE,aAAa;gBAC7B,wBAAwB,EAAE,qBAAqB;gBAC/C,0BAA0B,EAAE,kMAAkM;aACjO;SACJ;KACJ;CACJ,CAAC","sourcesContent":["export const resources = {\r\n en: {\r\n translation: {\r\n Layout: {\r\n \"Logout\": \"Logout\",\r\n \"LogIn\": \"Log In\",\r\n \"Language\": \"Language\",\r\n \"Appearance\": \"Appearance\",\r\n \"Light\": \"Light\",\r\n \"Dark\": \"Dark\",\r\n \"System\": \"System\",\r\n \"Home\": \"Home\",\r\n \"Settings\": \"Settings\",\r\n \"Version\": \"Version\",\r\n \"Unauthorized\": \"Unauthorized\",\r\n \"DevelopmentDialogTitle\": \"Testing environment\",\r\n \"DevelopmentDialogContent\": \"You are accessing a test environment. Data integrity is not guaranteed and application behavior may be unpredictable. Please proceed with caution and report any unexpected behavior to the development team.\"\r\n }\r\n }\r\n },\r\n cs: {\r\n translation: {\r\n Layout: {\r\n \"Logout\": \"Odhlásit se\",\r\n \"LogIn\": \"Přihlásit se\",\r\n \"Language\": \"Jazyk\",\r\n \"Appearance\": \"Vzhled\",\r\n \"Light\": \"Světlý\",\r\n \"Dark\": \"Tmavý\",\r\n \"System\": \"Systém\",\r\n \"Home\": \"Domů\",\r\n \"Settings\": \"Nastavení\",\r\n \"Version\": \"Verze\",\r\n \"Unauthorized\": \"Neoprávněný\",\r\n \"DevelopmentDialogTitle\": \"Testovací prostředí\",\r\n \"DevelopmentDialogContent\": \"Vstupujete do testovacího prostředí. Integrita dat není zaručena a chování aplikace může být nepředvídatelné. Prosím, buďte opatrní a jakékoli neočekávané chování ihned hláste vývojovému týmu.\"\r\n }\r\n }\r\n }\r\n};"]}
|