wcz-test 6.12.9 → 6.13.0
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/DialogsHooks-BlUsVlfv.js +39 -0
- package/dist/DialogsHooks-BlUsVlfv.js.map +1 -0
- package/dist/{RouterListItemButton-CHS7rofI.js → RouterListItemButton-Cx7rXEfm.js} +4 -4
- package/dist/{RouterListItemButton-CHS7rofI.js.map → RouterListItemButton-Cx7rXEfm.js.map} +1 -1
- package/dist/auth-client-o9U0_qmf.js +79 -0
- package/dist/auth-client-o9U0_qmf.js.map +1 -0
- package/dist/client.js +1 -1
- package/dist/components.js +66 -65
- package/dist/components.js.map +1 -1
- package/dist/hooks.js +31 -31
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +84 -83
- package/dist/index.js.map +1 -1
- package/dist/server.js +6 -8658
- package/dist/server.js.map +1 -1
- package/dist/vite.js +1 -12
- package/dist/vite.js.map +1 -1
- package/package.json +28 -28
- package/dist/DialogsHooks-Bi8dZoyu.js +0 -338
- package/dist/DialogsHooks-Bi8dZoyu.js.map +0 -1
- package/dist/auth-client-B6cIXYDV.js +0 -1417
- package/dist/auth-client-B6cIXYDV.js.map +0 -1
- package/dist/error-BhAKg8LX-X0sdNXNa.js +0 -195
- package/dist/error-BhAKg8LX-X0sdNXNa.js.map +0 -1
- package/dist/server-mxQ3s5dx-CC81W42s.js +0 -644
- package/dist/server-mxQ3s5dx-CC81W42s.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Stack, Typography, Collapse, useMediaQuery, useColorScheme, List as List$1, ListItemButton as ListItemButton$1, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1, ListSubheader as ListSubheader$1, IconButton, Avatar as Avatar$1, Menu, Box as Box$1, ListItem as ListItem$1, InitColorSchemeScript, CssBaseline, AppBar, Toolbar, LinearProgress, ThemeProvider } from "@mui/material";
|
|
3
3
|
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
4
4
|
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
|
@@ -7,12 +7,13 @@ import { getCookie } from "@tanstack/react-start/server";
|
|
|
7
7
|
import dayjs from "dayjs";
|
|
8
8
|
import i18n from "i18next";
|
|
9
9
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
10
|
-
import { useState, useId, useRef, Fragment, useEffect, useEffectEvent } from "react";
|
|
10
|
+
import { useState, useId, useRef, Fragment as Fragment$1, useEffect, useEffectEvent } from "react";
|
|
11
11
|
import { useTranslation, initReactI18next } from "react-i18next";
|
|
12
12
|
import { resources } from "virtual:wcz-layout";
|
|
13
13
|
import z__default from "zod";
|
|
14
14
|
import useEventCallback from "@mui/utils/useEventCallback";
|
|
15
|
-
import {
|
|
15
|
+
import { D as DialogsContext, u as useDialogs } from "./DialogsHooks-BlUsVlfv.js";
|
|
16
|
+
import { a as authClient, u as useGetTheme } from "./auth-client-o9U0_qmf.js";
|
|
16
17
|
import Menu$1 from "@mui/icons-material/Menu";
|
|
17
18
|
import MenuOpen from "@mui/icons-material/MenuOpen";
|
|
18
19
|
import { styled, useTheme } from "@mui/material/styles";
|
|
@@ -33,7 +34,7 @@ import ListItemText from "@mui/material/ListItemText";
|
|
|
33
34
|
import Paper from "@mui/material/Paper";
|
|
34
35
|
import Popper from "@mui/material/Popper";
|
|
35
36
|
import Typography$1 from "@mui/material/Typography";
|
|
36
|
-
import { R as RouterListItemButton } from "./RouterListItemButton-
|
|
37
|
+
import { R as RouterListItemButton } from "./RouterListItemButton-Cx7rXEfm.js";
|
|
37
38
|
import "@mui/icons-material/AccountCircle";
|
|
38
39
|
import ArrowBack from "@mui/icons-material/ArrowBack";
|
|
39
40
|
import Brightness4 from "@mui/icons-material/Brightness4";
|
|
@@ -96,9 +97,9 @@ function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
|
96
97
|
}
|
|
97
98
|
return dialog;
|
|
98
99
|
});
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
+
return /* @__PURE__ */ jsxs(DialogsContext.Provider, { value: { open: requestDialog, close: closeDialog }, children: [
|
|
100
101
|
children,
|
|
101
|
-
stack.map(({ key, open, Component, payload, promise }) => /* @__PURE__ */
|
|
102
|
+
stack.map(({ key, open, Component, payload, promise }) => /* @__PURE__ */ jsx(
|
|
102
103
|
Component,
|
|
103
104
|
{
|
|
104
105
|
payload,
|
|
@@ -112,9 +113,9 @@ function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
|
112
113
|
] });
|
|
113
114
|
}
|
|
114
115
|
const AppTitle = () => {
|
|
115
|
-
return /* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
116
|
+
return /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 2, flexGrow: 1, children: [
|
|
117
|
+
/* @__PURE__ */ jsx("img", { src: "/favicon-32x32.png", alt: "app-logo", loading: "lazy" }),
|
|
118
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", children: clientEnv.VITE_APP_TITLE }),
|
|
118
119
|
false
|
|
119
120
|
] });
|
|
120
121
|
};
|
|
@@ -161,12 +162,12 @@ const StyledRouterButton = styled(RouterListItemButton)(({ theme }) => ({
|
|
|
161
162
|
}));
|
|
162
163
|
const IconOrAvatar = ({ item, collapsed }) => {
|
|
163
164
|
if (item.icon || collapsed) {
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ jsxs(Box, { sx: collapsed ? { position: "absolute", left: "50%", top: "calc(50% - 6px)", transform: "translate(-50%, -50%)" } : {}, children: [
|
|
166
|
+
/* @__PURE__ */ jsxs(ListItemIcon, { sx: { display: "flex", alignItems: "center", justifyContent: "center", minWidth: ICON_SIZE }, children: [
|
|
166
167
|
item.icon ?? null,
|
|
167
|
-
!item.icon && collapsed ? /* @__PURE__ */
|
|
168
|
+
!item.icon && collapsed ? /* @__PURE__ */ jsx(Avatar, { sx: { width: ICON_SIZE - 7, height: ICON_SIZE - 7, fontSize: 12 }, children: item.title }) : null
|
|
168
169
|
] }),
|
|
169
|
-
collapsed ? /* @__PURE__ */
|
|
170
|
+
collapsed ? /* @__PURE__ */ jsx(
|
|
170
171
|
Typography$1,
|
|
171
172
|
{
|
|
172
173
|
variant: "caption",
|
|
@@ -190,7 +191,7 @@ const IconOrAvatar = ({ item, collapsed }) => {
|
|
|
190
191
|
}
|
|
191
192
|
return null;
|
|
192
193
|
};
|
|
193
|
-
const MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */
|
|
194
|
+
const MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx(
|
|
194
195
|
Popper,
|
|
195
196
|
{
|
|
196
197
|
open,
|
|
@@ -201,7 +202,7 @@ const MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsxRuntime
|
|
|
201
202
|
{ name: "preventOverflow", options: { padding: 8 } },
|
|
202
203
|
{ name: "flip", options: { fallbackPlacements: ["right-end", "left-start"] } }
|
|
203
204
|
],
|
|
204
|
-
children: /* @__PURE__ */
|
|
205
|
+
children: /* @__PURE__ */ jsx(
|
|
205
206
|
Paper,
|
|
206
207
|
{
|
|
207
208
|
sx: {
|
|
@@ -243,9 +244,9 @@ const NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSid
|
|
|
243
244
|
disabled,
|
|
244
245
|
sx: { px: 1.4, height: collapsed ? 60 : 48 }
|
|
245
246
|
};
|
|
246
|
-
const buttonContent = /* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
!collapsed && /* @__PURE__ */
|
|
247
|
+
const buttonContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
248
|
+
/* @__PURE__ */ jsx(IconOrAvatar, { item, collapsed }),
|
|
249
|
+
!collapsed && /* @__PURE__ */ jsx(
|
|
249
250
|
ListItemText,
|
|
250
251
|
{
|
|
251
252
|
primary: item.title,
|
|
@@ -253,9 +254,9 @@ const NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSid
|
|
|
253
254
|
sx: { ml: 1.2, flex: 1, minWidth: 0, "& .MuiTypography-root": { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }
|
|
254
255
|
}
|
|
255
256
|
),
|
|
256
|
-
item.children ? /* @__PURE__ */
|
|
257
|
+
item.children ? /* @__PURE__ */ jsx(ExpandMoreIcon, { sx: chevronSx }) : null
|
|
257
258
|
] });
|
|
258
|
-
const listItem = /* @__PURE__ */
|
|
259
|
+
const listItem = /* @__PURE__ */ jsxs(
|
|
259
260
|
ListItem,
|
|
260
261
|
{
|
|
261
262
|
...item.children && collapsed ? {
|
|
@@ -269,7 +270,7 @@ const NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSid
|
|
|
269
270
|
} : {},
|
|
270
271
|
sx: { py: 0, px: 1, overflowX: "hidden" },
|
|
271
272
|
children: [
|
|
272
|
-
shouldJustExpand ? /* @__PURE__ */
|
|
273
|
+
shouldJustExpand ? /* @__PURE__ */ jsx(StyledNavButton, { ...buttonProps, onClick: () => onClick?.(item), children: buttonContent }) : /* @__PURE__ */ jsx(
|
|
273
274
|
StyledRouterButton,
|
|
274
275
|
{
|
|
275
276
|
...buttonProps,
|
|
@@ -281,13 +282,13 @@ const NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSid
|
|
|
281
282
|
children: buttonContent
|
|
282
283
|
}
|
|
283
284
|
),
|
|
284
|
-
item.children && collapsed ? /* @__PURE__ */
|
|
285
|
+
item.children && collapsed ? /* @__PURE__ */ jsx(MiniPopover, { open: item.title === hoveredPopoverItem, anchorEl: anchorElement, children: renderNested?.(item.children) }) : null
|
|
285
286
|
]
|
|
286
287
|
}
|
|
287
288
|
);
|
|
288
|
-
return /* @__PURE__ */
|
|
289
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
289
290
|
listItem,
|
|
290
|
-
item.children && !collapsed ? /* @__PURE__ */
|
|
291
|
+
item.children && !collapsed ? /* @__PURE__ */ jsx(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: renderNested?.(item.children) }) : null
|
|
291
292
|
] }, item.to);
|
|
292
293
|
};
|
|
293
294
|
const isPageItem = (item) => !("kind" in item);
|
|
@@ -299,7 +300,7 @@ const NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSide
|
|
|
299
300
|
if (collapsed) setOpenKeys([]);
|
|
300
301
|
}, [collapsed]);
|
|
301
302
|
const toggleKey = (key) => setOpenKeys((previous) => previous.includes(key) ? previous.filter((k) => k !== key) : [...previous, key]);
|
|
302
|
-
const renderNested = (children) => /* @__PURE__ */
|
|
303
|
+
const renderNested = (children) => /* @__PURE__ */ jsx(
|
|
303
304
|
NavigationList,
|
|
304
305
|
{
|
|
305
306
|
subNavigation: children,
|
|
@@ -312,7 +313,7 @@ const NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSide
|
|
|
312
313
|
}
|
|
313
314
|
);
|
|
314
315
|
const filteredNavigation = subNavigation.filter((nav) => !nav.hidden);
|
|
315
|
-
return /* @__PURE__ */
|
|
316
|
+
return /* @__PURE__ */ jsx(
|
|
316
317
|
List,
|
|
317
318
|
{
|
|
318
319
|
sx: {
|
|
@@ -325,7 +326,7 @@ const NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSide
|
|
|
325
326
|
},
|
|
326
327
|
children: filteredNavigation.map((navItem, index) => {
|
|
327
328
|
if (isHeader(navItem)) {
|
|
328
|
-
return /* @__PURE__ */
|
|
329
|
+
return /* @__PURE__ */ jsx(
|
|
329
330
|
ListSubheader,
|
|
330
331
|
{
|
|
331
332
|
sx: {
|
|
@@ -348,13 +349,13 @@ const NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSide
|
|
|
348
349
|
}
|
|
349
350
|
if (isDivider(navItem)) {
|
|
350
351
|
const nextItem = filteredNavigation[index + 1];
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Divider, { sx: { mx: 1, mt: 1, mb: isHeader(nextItem) && !collapsed ? 0 : 1 } }) }, `divider-${depth}-${index}`);
|
|
352
353
|
}
|
|
353
354
|
if (!isPageItem(navItem)) return null;
|
|
354
355
|
const key = `item-${depth}-${index}`;
|
|
355
356
|
const uniqueItemKey = `${depth}-${index}-${navItem.title}`;
|
|
356
|
-
if (renderItem) return /* @__PURE__ */
|
|
357
|
-
return /* @__PURE__ */
|
|
357
|
+
if (renderItem) return /* @__PURE__ */ jsx(Fragment$1, { children: renderItem(navItem, { collapsed: !!collapsed }) }, key);
|
|
358
|
+
return /* @__PURE__ */ jsx(
|
|
358
359
|
NavigationListItem,
|
|
359
360
|
{
|
|
360
361
|
item: navItem,
|
|
@@ -381,7 +382,7 @@ const NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
381
382
|
const routerState = useRouterState();
|
|
382
383
|
const theme = useTheme();
|
|
383
384
|
const showPermanent = useMediaQuery(theme.breakpoints.up("sm"));
|
|
384
|
-
const drawerContent = (collapsed) => /* @__PURE__ */
|
|
385
|
+
const drawerContent = (collapsed) => /* @__PURE__ */ jsx(
|
|
385
386
|
Box,
|
|
386
387
|
{
|
|
387
388
|
component: "nav",
|
|
@@ -395,7 +396,7 @@ const NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
395
396
|
overflowX: "hidden",
|
|
396
397
|
pt: navigation[0] && isHeader(navigation[0]) && !collapsed ? 0 : 2
|
|
397
398
|
},
|
|
398
|
-
children: /* @__PURE__ */
|
|
399
|
+
children: /* @__PURE__ */ jsx(
|
|
399
400
|
NavigationList,
|
|
400
401
|
{
|
|
401
402
|
subNavigation: navigation,
|
|
@@ -411,7 +412,7 @@ const NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
411
412
|
}
|
|
412
413
|
);
|
|
413
414
|
if (showPermanent)
|
|
414
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ jsx(
|
|
415
416
|
Drawer,
|
|
416
417
|
{
|
|
417
418
|
variant: "permanent",
|
|
@@ -429,7 +430,7 @@ const NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
429
430
|
children: drawerContent(!expanded)
|
|
430
431
|
}
|
|
431
432
|
);
|
|
432
|
-
return /* @__PURE__ */
|
|
433
|
+
return /* @__PURE__ */ jsx(Drawer, { open: expanded, onClose: () => setExpanded(false), children: drawerContent(!expanded) });
|
|
433
434
|
};
|
|
434
435
|
const capitalize = (value) => value && value.charAt(0).toUpperCase() + value.slice(1);
|
|
435
436
|
const ToolbarAccount = () => {
|
|
@@ -462,23 +463,23 @@ const ToolbarAccount = () => {
|
|
|
462
463
|
setTimeout(() => setTab("settings"), 300);
|
|
463
464
|
};
|
|
464
465
|
const changeTab = (newTab) => () => setTab(newTab);
|
|
465
|
-
const settings = /* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
/* @__PURE__ */
|
|
466
|
+
const settings = /* @__PURE__ */ jsxs(List$1, { component: "nav", subheader: /* @__PURE__ */ jsx(ListSubheader$1, { sx: { backgroundColor: "transparent" }, children: t("Layout.Settings") }), children: [
|
|
467
|
+
/* @__PURE__ */ jsxs(ListItemButton$1, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
|
|
468
|
+
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Brightness4, {}) }),
|
|
469
|
+
/* @__PURE__ */ jsx(ListItemText$1, { primary: t("Layout.Appearance"), secondary: colorModes.find((m) => m.mode === mode)?.label }),
|
|
470
|
+
/* @__PURE__ */ jsx(ChevronRight, {})
|
|
470
471
|
] }),
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ jsxs(ListItemButton$1, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
|
|
473
|
+
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Translate, {}) }),
|
|
474
|
+
/* @__PURE__ */ jsx(ListItemText$1, { primary: t("Layout.Language"), secondary: capitalize(languageDisplayNames.of(i18n2.language)) }),
|
|
475
|
+
/* @__PURE__ */ jsx(ChevronRight, {})
|
|
475
476
|
] })
|
|
476
477
|
] });
|
|
477
|
-
const theme = /* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */
|
|
478
|
+
const theme = /* @__PURE__ */ jsx(List$1, { subheader: /* @__PURE__ */ jsxs(ListSubheader$1, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
479
|
+
/* @__PURE__ */ jsx(IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx(ArrowBack, { fontSize: "small" }) }),
|
|
479
480
|
" ",
|
|
480
481
|
t("Layout.Appearance")
|
|
481
|
-
] }), children: colorModes.map(({ mode: modeValue, icon: Icon, label }) => /* @__PURE__ */
|
|
482
|
+
] }), children: colorModes.map(({ mode: modeValue, icon: Icon, label }) => /* @__PURE__ */ jsxs(
|
|
482
483
|
ListItemButton$1,
|
|
483
484
|
{
|
|
484
485
|
onClick: () => {
|
|
@@ -487,40 +488,40 @@ const ToolbarAccount = () => {
|
|
|
487
488
|
},
|
|
488
489
|
selected: mode === modeValue,
|
|
489
490
|
children: [
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Icon, {}) }),
|
|
492
|
+
/* @__PURE__ */ jsx(ListItemText$1, { primary: label })
|
|
492
493
|
]
|
|
493
494
|
},
|
|
494
495
|
modeValue
|
|
495
496
|
)) });
|
|
496
|
-
const language = /* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
497
|
+
const language = /* @__PURE__ */ jsx(List$1, { subheader: /* @__PURE__ */ jsxs(ListSubheader$1, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
498
|
+
/* @__PURE__ */ jsx(IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx(ArrowBack, { fontSize: "small" }) }),
|
|
498
499
|
" ",
|
|
499
500
|
t("Layout.Language")
|
|
500
501
|
] }), children: supportedLanguages.map(
|
|
501
|
-
(languageCode) => /* @__PURE__ */
|
|
502
|
+
(languageCode) => /* @__PURE__ */ jsxs(
|
|
502
503
|
ListItemButton$1,
|
|
503
504
|
{
|
|
504
505
|
onClick: () => i18n2.changeLanguage(languageCode).finally(() => closeMenu()),
|
|
505
506
|
selected: i18n2.resolvedLanguage === languageCode,
|
|
506
507
|
children: [
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ jsx(ListItemIcon$1, { children: i18n2.resolvedLanguage === languageCode && /* @__PURE__ */ jsx(Done, {}) }),
|
|
509
|
+
/* @__PURE__ */ jsx(ListItemText$1, { primary: capitalize(languageDisplayNames.of(languageCode)) })
|
|
509
510
|
]
|
|
510
511
|
},
|
|
511
512
|
languageCode
|
|
512
513
|
)
|
|
513
514
|
) });
|
|
514
|
-
return /* @__PURE__ */
|
|
515
|
-
/* @__PURE__ */
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
515
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
516
|
+
/* @__PURE__ */ jsx(IconButton, { size: "small", edge: "end", onClick: openMenu, children: /* @__PURE__ */ jsx(Avatar$1, { sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 }, bgcolor: "primary.main" }, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", sx: { fontWeight: "bold", lineHeight: 0 }, children: usernameInitials() }) }) }),
|
|
517
|
+
/* @__PURE__ */ jsx(Menu, { anchorEl: anchorElement, open, onClose: closeMenu, children: /* @__PURE__ */ jsxs(Box$1, { sx: { width: 240 }, children: [
|
|
518
|
+
/* @__PURE__ */ jsx(List$1, { children: session ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
519
|
+
/* @__PURE__ */ jsx(ListItem$1, { children: /* @__PURE__ */ jsx(ListItemText$1, { primary: user.name, secondary: /* @__PURE__ */ jsxs("span", { children: [
|
|
520
|
+
/* @__PURE__ */ jsx("span", { children: user.employeeId }),
|
|
521
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
522
|
+
/* @__PURE__ */ jsx("span", { children: user.department })
|
|
522
523
|
] }) }) }),
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ jsxs(
|
|
524
525
|
ListItemButton$1,
|
|
525
526
|
{
|
|
526
527
|
onClick: () => authClient.signOut({}, {
|
|
@@ -528,12 +529,12 @@ const ToolbarAccount = () => {
|
|
|
528
529
|
onError: ({ error }) => alert(error.message)
|
|
529
530
|
}),
|
|
530
531
|
children: [
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Logout, { color: "error" }) }),
|
|
533
|
+
/* @__PURE__ */ jsx(ListItemText$1, { primary: t("Layout.Logout") })
|
|
533
534
|
]
|
|
534
535
|
}
|
|
535
536
|
)
|
|
536
|
-
] }) : /* @__PURE__ */
|
|
537
|
+
] }) : /* @__PURE__ */ jsxs(
|
|
537
538
|
ListItemButton$1,
|
|
538
539
|
{
|
|
539
540
|
onClick: () => authClient.signIn.social({ provider: "microsoft" }, {
|
|
@@ -541,8 +542,8 @@ const ToolbarAccount = () => {
|
|
|
541
542
|
onError: ({ error }) => alert(error.message)
|
|
542
543
|
}),
|
|
543
544
|
children: [
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Login, { color: "success" }) }),
|
|
546
|
+
/* @__PURE__ */ jsx(ListItemText$1, { primary: t("Layout.LogIn") })
|
|
546
547
|
]
|
|
547
548
|
}
|
|
548
549
|
) }),
|
|
@@ -571,11 +572,11 @@ const Layout = (props) => {
|
|
|
571
572
|
const [navigationOpen, setNavigationOpen] = useState(getNavigationOpenStatus);
|
|
572
573
|
const isFetching = !!useIsFetching();
|
|
573
574
|
const isMutating = !!useIsMutating();
|
|
574
|
-
return /* @__PURE__ */
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
575
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
576
|
+
/* @__PURE__ */ jsx(InitColorSchemeScript, {}),
|
|
577
|
+
/* @__PURE__ */ jsx(CssBaseline, {}),
|
|
578
|
+
/* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", height: "100dvh", maxHeight: "100dvh", overflow: "hidden", width: "100%" }, children: [
|
|
579
|
+
/* @__PURE__ */ jsx(
|
|
579
580
|
AppBar,
|
|
580
581
|
{
|
|
581
582
|
color: "transparent",
|
|
@@ -585,8 +586,8 @@ const Layout = (props) => {
|
|
|
585
586
|
borderColor: theme.vars?.palette.divider,
|
|
586
587
|
boxShadow: "none"
|
|
587
588
|
}),
|
|
588
|
-
children: /* @__PURE__ */
|
|
589
|
-
props.navigation && /* @__PURE__ */
|
|
589
|
+
children: /* @__PURE__ */ jsxs(Toolbar, { children: [
|
|
590
|
+
props.navigation && /* @__PURE__ */ jsx(
|
|
590
591
|
IconButton,
|
|
591
592
|
{
|
|
592
593
|
onClick: () => {
|
|
@@ -597,15 +598,15 @@ const Layout = (props) => {
|
|
|
597
598
|
});
|
|
598
599
|
},
|
|
599
600
|
sx: { marginRight: 2 },
|
|
600
|
-
children: navigationOpen ? /* @__PURE__ */
|
|
601
|
+
children: navigationOpen ? /* @__PURE__ */ jsx(MenuOpen, {}) : /* @__PURE__ */ jsx(Menu$1, {})
|
|
601
602
|
}
|
|
602
603
|
),
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ jsx(AppTitle, {}),
|
|
605
|
+
/* @__PURE__ */ jsx(ToolbarAccount, {})
|
|
605
606
|
] })
|
|
606
607
|
}
|
|
607
608
|
),
|
|
608
|
-
props.navigation && /* @__PURE__ */
|
|
609
|
+
props.navigation && /* @__PURE__ */ jsx(
|
|
609
610
|
NavigationRail,
|
|
610
611
|
{
|
|
611
612
|
navigation: props.navigation,
|
|
@@ -616,12 +617,12 @@ const Layout = (props) => {
|
|
|
616
617
|
}
|
|
617
618
|
}
|
|
618
619
|
),
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ jsxs(Box$1, { component: "main", sx: { flexGrow: 1, display: "flex", flexDirection: "column", minWidth: 0, height: "100%", overflow: "hidden" }, children: [
|
|
621
|
+
/* @__PURE__ */ jsx(DrawerHeader, {}),
|
|
622
|
+
/* @__PURE__ */ jsx(Box$1, { sx: { flex: 1, overflow: "auto", position: "relative" }, children: props.children })
|
|
622
623
|
] })
|
|
623
624
|
] }),
|
|
624
|
-
(isFetching || isMutating) && /* @__PURE__ */
|
|
625
|
+
(isFetching || isMutating) && /* @__PURE__ */ jsx(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
|
|
625
626
|
] });
|
|
626
627
|
};
|
|
627
628
|
const YEAR_IN_MINUTES = 60 * 24 * 365;
|
|
@@ -648,7 +649,7 @@ const LayoutProvider = ({ navigation, theme, children }) => {
|
|
|
648
649
|
i18n.off("languageChanged", languageChangedHandler);
|
|
649
650
|
};
|
|
650
651
|
}, []);
|
|
651
|
-
return /* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */ jsx(ThemeProvider, { theme: createdTheme, children: /* @__PURE__ */ jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n.language, children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(Layout, { navigation, children }) }) }, i18n.language) });
|
|
652
653
|
};
|
|
653
654
|
const setSSRLanguage = createServerFn().handler(async () => {
|
|
654
655
|
const language = getCookie(i18n.services.languageDetector.options.lookupCookie) || "en";
|